Configuring two z motors
-
I am commissioning a new printer I just put together. The controller is a Duet2 wifi. The printer has two z motors. When I ask the z axis to move, only one motor moves. When I flip the motor connectors on the Duet, the second motor is the only one that moves. It would appear that the hardware for both motors work but the driver for the second motor does not activate. I am assuming something is wrong in my config.g but can't spot the problem. It all seems to be fairly straight forward.
Here is a partial coinfig.g:M550 P"Red" ; Set machine name
M552 S1 ; Enable network
M586 P0 S1 ; Enable HTTP
M586 P1 S0 ; Disable FTP
M586 P2 S0 ; Disable Telnet; Drives
M569 P0 S0 ; Physical drive 0 goes backwards (x)
M569 P1 S0 ; Physical drive 1 goes backwards (y)
M569 P2 S0 ; Physical drive 2 goes backwards (Z left)
M569 P3 S0 ; Physical drive 3 goes backwards (E0)
M569 P4 S0 ; Physical drive 4 goes backwards (Z right)M92 X80.20 Y80.15 Z400.00:400.00 E400
M350 X16 Y16 Z16:16 E16 I1 ; Configure microstepping with interpolation for x,y,z,E0
; map axis
M584 X0 y1 Z2:4 E3 ; set x connected to driver 0, y to driver 1 z to driver 2 and 4, extruder is connected to driver 3
M671 X-30:250 Y150:150 S3 ; dummy figuresWhen powered on, one of the z motors holds position but the other seems to be un-powered (no hold current). Is there a way to test the driver that is currently not powering up?
-
Further info:
I am setting motor currents like this:
M906 X1500.00 Y1500.00 Z800.00:800.00 E800 I50
but when I do an M906 by itself I get
Motor current (mA) - X:1500, Y:1500, Z:800, E:800, idle factor 50%In other words, Z is set at 800 mA but for only one Z current is listed. Should I see a second Z current or is it normal to have two Z motors and only a single current figure returned with an M906 (presumably because both Z motors have the same drive current)?
When connecting both z motors to drive 2 (ie where there are two motor connectors for one drive), both motors have proper holding torque.
-
@jens55 Before assigning drives 2 and 4 to the Z axis (M584), the firmware does not know the meaning of dual values for Z (like in M350 … Z16:16 …). With M92, M584, M906 etc, the second Z drive is axis U.
-
@infiniteloop, thanks for your reply. What do I need to do so the controller knows there are two z axis? Are you maybe saying that I need to move M584 before the M350 command ?
-
@jens55 said in Configuring two z motors:
Are you maybe saying that I need to move M584 before the M350 command ?
No. Just use axis U for all the driver settings.
-
@infiniteloop, I apologize for being slow but could you give me the commands that you think I should use?
An additional, unexpected behaviour:
Connecting z left to drive 4 and z right to drive 2 and moving the z axis will put hold current on only the left motor (drive 4). One would assume that driver 2 is not powering up. Connecting both z motors to drive 2 and moving Z will put hold current on both motors...... ????? This makes no sense at all.
I did not change anything in config.g between the two tries. -
@jens55 said in Configuring two z motors:
@infiniteloop, thanks for your reply. What do I need to do so the controller knows there are two z axis? .................
Are you saying that you want to move each Z motor independently? In which case, yes you need to create an additional axis. But if you simply want to use 2 motors to drive the Z axis, then you simply map both motors to the Z axis. If you have separate end stops for each motor, then you can do both. That is to say map motors 2 and 4 to the Z axis but also map motor 4 to the U axis. In that case you would use M584 P4 to show the 4th axis for homing and after homing you would use M584 P3 to hide the additional axis. But in all cases, any command that references axes (e.g. M350, M92, M566, M201, M906 etc) can have only one value per axis - you can't use colon separators. Also, if multiple motors are used per axis, then those motors must be identical. The slight caveat is that extruders are treated as separate "axes" so colon separators are allowed for "E" values where multiple extruders exist.
-
@jens55 said in Configuring two z motors:
@infiniteloop, I apologize for being slow but could you give me the commands that you think I should use?
An additional, unexpected behaviour:
Connecting z left to drive 4 and z right to drive 2 and moving the z axis will put hold current on only the left motor (drive 4). One would assume that driver 2 is not powering up. Connecting both z motors to drive 2 and moving Z will put hold current on both motors...... ????? This makes no sense at all.
I did not change anything in config.g between the two tries.You need to move your M584 to be earlier in your config.g file. From the documentation - quote ...............
"M584 must come earlier in config.g than any M350 and M906 commands. If it creates new axes, it must also be earlier than any M92, M201, M203, M208, M350, M566, M574, M667 and M669 commands."
-
@deckingman, I have two identical motors. On a CR10 style bed slinger I have one z motor on the left upright pillar and I have the second z motor on the right pillar. I want to configure them to run independent of each other so that I can run a macro that makes sure the Z height is identical on both sides of the printer.
As I am currently still only partially configured, I have no z endstop and no BLTouch yet. I will eventually configure a BL Touch for z probing which will allow me to measure the Z=0 on both sides of the bed and adjust the two z motors so that the gantry is level with respect to the build plate. During the testing, I simply use g1 z-10 H2 and g1 z-20 H2 to make the Z axis move. I expect that both Z motors would turn the same amount even though they are both driven independently.Moving the M584 as per your second post to just before the M350 did not change the situation. The M906 command is running via a macro after everything else.
I also tried moving the M584 to happen before the M92 (and M350) but still no change in behaviour. -
Is there a way to comment out a range of lines in config.g other than putting semicolons before each individual line? I am thinking of experimenting with removal of a large section of the config.g file to help me figure out if I am doing something stupid somewhere in the config.g file.
-
could you give me the commands that you think I should use?
@deckingman is right re. sequence of GCodes. In my config, I set up the second Z as a separate Axis (U) so that I can split these for tramming along X. Apart from the optional and explicit split (which I do not need so far), both drives operate in sync. Here’s the relevant part of my config (BTW, for a CR-10 style bedslinger):
; (Re-)map drivers: M584 X0 Y1 Z2:6 U6 E3:4 P3 ; Z combines 2+6, drives 3+4 are extruders, hide 4th axis "U" ; Set the X/Y origin to the center: M208 S1 X-156 Y-185 Z0 U0 ; coordinates are relative to the center of the printable area M208 S0 X164 Y147 Z350 U350 ; and refer to the middle between the nozzles of the chimera ; Drives: M569 P0 S1 ; drive 0 = X M569 P1 S1 ; drive 1 = Y M569 P2 S0 ; drive 2 = Z1 M569 P3 S0 ; drive 3 = E0 M569 P4 S0 ; drive 4 = E1 M569 P6 S0 ; drive 6 = Z2 (which turns out to be axis U) ; Motor tuning: M92 X80 Y80 Z400 U400 E800:800 ; set steps per mm M350 X16 Y16 Z16 U16 I1 ; X/Y/Z: configure microstepping with interpolation M350 E16:16 I1 ; extruders E0 and E1: configure microstepping with interpolation M566 X900 Y900 Z200 U200 E600 ; set maximum instantaneous speed changes (mm/min) M203 X12000 Y12000 Z2000 U2000 E3000 ; set maximum speeds (mm/min) M201 X1200 Y1200 Z600 U600 E5000 ; set accelerations (mm/s^2) M906 X800 Y800 Z800 U800 E600 I30 ; set motor currents (mA) and motor idle factor in percent
-
I decided to totally re-do the drives
x is on driver 4
y is on driver 3
z left is on driver 0
z right is on driver 1I get correct movement on all of the axes
I also tried having y on drive 2 and y did not move. From this I conclude that my config.g is correctly set up but there is something wrong with driver 2.
Since driver 2 worked when both z motors were on the two driver 2 connectors and since driver 2 did not work with only one motor connected, I am wondering: Should driver 2 work with only one motor plugged in? Is there some setting that maybe says to have the two headers of driver 2 configured as a serial connection rather than a parallel connection (which would mean that driver 2 can only work if both connectors are used)?
-
Mystery solved (pending verification)
As per the Duet document "connecting stepper motors" under the sub heading of " Connecting multiple motors on an axis", I fouund the following:
Duet 2 (WiFi, Ethernet and Maestro)
If you have two stepper motors for one axis, connect them to the ZA and ZB connectors. These connectors are wired in series, which is better than wiring them in parallel for most types of stepper motor used in 3D printers.
If you have only one Z stepper motor, plug it in to the ZA connector, and plug two jumpers into the ZB connector. Duet 2 boards are normally supplied with these jumpers already fitted.
Note the second paragraph - it ain't gona work unless the unused connector has jumpers connected !
Crap!!!
Thank you all for helping me sort this out !
-
Yup, confirmed!
-
-