Connect 5 stepper motors and 5 limit switches in Duet 2 Wifi
-
Hello,
I am trying to control 5 stepper motors with Duet 2 Wifi. Every one of these motors needs to have a limit switch. Despite that the board has 5 positions for limit switches ( X, Y, Z, E0, and E1 endstops), I cannot find how to configure them. Also, in the RepRap Configuration tool, it isn't possible to add 5 limit switches. Is it possible to write the configuration file manually and add 5 limit switches?
Thank you!
-
What axis will you end up having?
Have you seen this?
https://docs.duet3d.com/en/User_manual/Connecting_hardware/Sensors_endstops
https://docs.duet3d.com/en/User_manual/Reference/Gcodes#m574-set-endstop-configuration
-
@Phaedrux Thank you for your response. I am building a cartesian printer with three heads, so I need X and Y axes and three Z axes (Z1, Z2, and Z3 each one corresponding to a different head). I want every one of these 5 axes to have an endstop.
-
I'll have to see where we're at with regards to multiple independent Z axis. That may prove tricky.
-
@Odisseas The configuration tool supports relatively simple XYZE machine layouts, so can't create a configuration for custom machines. However, that doesn't mean RepRapFirmware can't support it; there are other users that have tools on separate Z axes, though the examples I can find only have two. See
https://forum.duet3d.com/topic/18051/printer-with-two-independent-z-axes-how-to-synchronize
https://forum.duet3d.com/topic/16609/multiple-z-axis-and-complex-tools-possible (referenced in thread above)
https://forum.duet3d.com/topic/7590/interested-in-using-two-z-axes
https://forum.duet3d.com/topic/2443/dual-z-for-idex user @stephenc has a lot of info about setting this up, though from a few years agoThere are various ways you can control the three Z axes. dc42 suggests:
You can only have one Z axis at any one time, but you can switch Z to be different motors using the M584 command. Or (and probably better) you can have a single Z axis, and use axes U, V and W to raise and lower the tools. You can hide the additional axes except when doing a tool change.
To initially control each axis, you need to map them to individual axes with M584, something like:
M584 X0 Y1 Z2:3:4 U2 V3 W4 P3
Z is initially set to all tool axes, U is tool 0, V is tool 1, W is tool 2, P3 means only three axes visible (X Y and Z)
Endstops can be mapped for the axes:
M574 X1 S1 P"xstop" ; configure switch-type (e.g. microswitch) endstop for low end on X via pin xstop M574 Y1 S1 P"ystop" ; configure switch-type (e.g. microswitch) endstop for low end on Y via pin ystop M574 U2 S1 P"zstop+e0stop+e1stop" ; configure switch-type (e.g. microswitch) endstop for high end for all Z tools
Homing Z will home all three tools to the maximum end. Set U, V and W to the value of the Z axis with G92.
For tool changes, dc42 says
You will be able to do it using variables (RRF 3.0 and later has variables, see https://docs.duet3d.com/en/User_manual/Reference/Gcode_meta_commands) :
• When Z-homing a tool or switching away from a tool in tfree, record its Z position in a variable
• When selecting a tool in tpre, recall its Z position and set that using G92; then move to the user Z position plus a bitFor information on the tool changing macros, see https://docs.duet3d.com/User_manual/Tuning/Tool_changing
You can use a variable, or switch the value of Z to/from the tool axis U, V or W using the Object Model. eg
;tpre for tool 0, U axis, driver 2, drive 3 in Object Model M584 Z0.2 ; sets Z to tool 0, U axis G92 Z{move.axes[3].userPosition} ; sets Z to U axis position
;tfree for tool 0, U axis, driver 2, drive 3 in Object Model G92 U{move.axes[2].userPosition} ; sets U to Z axis position
When you deselect the tool, you probably don't need to reassign Z with M584, because the tpre of the next tool will do that. However, the exact behaviour will depend on how you are using the machine, but this should give you an idea about how you can control the tools and switch Z between them.
Note: this is all theoretical and untested! Other users, feel free to chime in with your suggestions!
Ian
-
@droftarts and @Phaedrux thank you both for your advice and time. I will implement the above solution and update you as soon as possible.