Trouble driving an external stepper driver with Duet 2 Wifi
-
Save yourself a lot of screwing around and get one of these: https://www.duet3d.com/Expansion_Breakout
I just used one with a Duet WiFi to drive integrated servomotors with direct connections to the differential outputs on the expansion board.
-
Thanks, I didn't realize that product existed! Just ordered one, we'll see how it goes.
-
@EricT If you're going to use the expansion board to drive external drivers replacing the X and Y motors, you have to remap the X and Y to the expansion board.
These are the config file statement I used to drive external drivers:M584 X5 Y6 ; remaps the X and Y motor drives to the Duet expansion board, first two ports
M569 P5 S1 R1 T4.0:5.0:6.0:11.0 ; sets the timing parameters for the X motor servo drive signals
M569 P6 S1 R1 T4.0:5.0:6.0:11.0 ; sets the timing parameters for the Y motor servo drive signals
M92: X31.25 Y31.25 ; sets steps/mm for motors using 16 tooth drive pulley and 1000 steps/rev
M350 X1 Y1 ; sets Duet to output full steps (microstepping is handled by the servomotor drivers)The integrated servos I am driving handle the microstepping, in my case set to 1000 steps/rev to match the 1000 line encoder. I have 16 tooth drive pulleys, so steps/mm works out to 31.25 steps/mm. The Duet board spits out full steps and the drivers turn them into microsteps. In other words, to the Duet board, the external drivers look like motors that take 1000 steps to make one revolution.
The M569 statements are important. You have to study the timing diagram for the drivers you're using and try to pick appropriate values. When I first hooked it up I had the pulse duration set to 2.5 us to match what the driver timing diagram showed. Unfortunately, that didn't work right and I got inconsistent motion. I bumped the step pulse duration to 4 us and it started working perfectly. I should probably try decreasing it a bit, but I'll never get close to maxing out the pulse rate so 4 us is fine.
-
Okay, bumping this issue again, I ordered & installed the expansion board, but am still unable to successfully drive the larger stepper motor in my setup via the external driver.
When I try to run it with the extrude/retract button in DWC, I get the error:
"Warning: motor phase A may be disconnected reported by driver(s) 4
Warning: motor phase B may be disconnected reported by driver(s) 4"The only motor that is having problems is the "ram extruder", which is connected to E2 on the expansion board and being run via a DM542S external stepper driver. All other motors (X, Y, Z, and the "screw extruder" E1) are being run from the internal drivers on the Duet 2 wifi without any problems.
In terms of troubleshooting steps, I've checked continuity between each of the the external driver's output terminals and the matching pin of the connector that goes into the stepper motor, no issues there. When I check voltage differences across the input terminals of the external driver (PUL+/-, DIR+/-, ENA+/-), I get a steady 3.4V for all of them, and none of them show a change from that when I command the motor run.
Any input on what to troubleshoot next would be appreciated, I'm pretty much at the end of my knowledge here.
My config.g file is as follows:
; Configuration file for Duet WiFi (firmware version 2.00)
; executed by the firmware on start-up
;
; generated by RepRapFirmware Configuration Tool v2.1.8 on Tue Feb 04 2020 22:23:02 GMT-0500 (Eastern Standard Time); General preferences
G90 ; send absolute coordinates...
M83 ; ...but relative extruder moves
M550 P"Cerambot" ; set printer name; Network
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 (X) goes backwards
M569 P1 S0 ; physical drive 1 (Y) goes backwards
M569 P2 S1 ; physical drive 2 (Z) goes forwards
M569 P3 S1 ; physical drive 3 (E1, screw extruder) goes forwards
M569 P4 S0 T10:10:10:10 ; physical drive 3(E2, ram extruder) goes forwards, all pulse widths & signal intervals set to 10us
M584 X0 Y1 Z2 E3:4 ; set drive mapping
M350 X16 Y16 Z16 E16:16 I1 ; configure microstepping with interpolation
M92 X320.00 Y320.00 Z320.00 E200.00:250.00 ; set steps per mm
M566 X1200.00 Y1200.00 Z1200.00 E1000.00:2000.00 ; set maximum instantaneous speed changes (mm/min)
M203 X18000.00 Y18000.00 Z18000.00 E2000.00:10000.00 ; set maximum speeds (mm/min)
M201 X1000.00 Y1000.00 Z1000.00 E200.00:1000.00 ; set accelerations (mm/s^2)
M906 X1000 Y1000 Z1000 E1000:1000 I30 ; set motor currents (mA) and motor idle factor in per cent
M84 S30 ; Set idle timeout; Axis Limits
M208 Z0 S1 ; set minimum Z; Endstops
M574 X2 Y2 Z2 S0 ; set active low endstops; Heaters
M140 H-1 ; disable heated bed; Fans
; Tools
M563 P0 D0 ; define tool 0 (test only, ram extruder)
M563 P1 D1 ; define tool 1 (test only, screw extruder)M563 P2 D0:1 ; define tool 2 (both extruders)
G10 P0 X0 Y0 Z0 ; set tool 2 axis offsets
G10 P0 R0 S0 ; set initial tool 2 active and standby temperatures to 0C
M568 P0 S1 ; enable mixing for tool 2
M567 P0 E0.5:0.5 ; set mixing ratios for tool 2 -
@EricT
The data sheet for your driver says the enable pins require 5-24 volts as does the step pins.
Not sure what voltage the breakout board delivers, but could be that the driver just isn’t being enabled. -
@OwenD said in Trouble driving an external stepper driver with Duet 2 Wifi:
Not sure what voltage the breakout board delivers, but could be that the driver just isn’t being enabled.
https://duet3d.dozuki.com/Wiki/Duet_Expansion_Breakout_Board#Section_Notes (tl;dr 3.6v differential)
-
@EricT for using 5v there are notes how to use it in the link @bearer gave.
But DM542 doesnt need ENA to be connected at all, default is enabled.If you have an Arduino uno lying around, testing DM542 and stepper to be sure both work is easy with the help of the AccelStepper library.
One problem which I had with DM542 was that the switches on positions were counterintuitive*). There is a small arrow pointing to the on position and the label ON on the switch to show where On is. I nearly killed the stepper by using 4A instead of 2A because I thought up is on. Better check it. With too much current the stepper doesnt rotate and gets hot.
*) I have often problems to read those labels, especially on SMD parts. I had the idea to take a picture with the smartphone and magnify it. This works pretty well.
-
@EricT In the image your SW1, SW2 and SW3 seem to be in off position, so it seems to me you set 4.2A for the stepper. (same as happended to me...)
If the stepper was in this high current too long and was too hot, the used neodym magnets inside loose their magnetism (above 80 °C) and the stepper would need to be replaced. My stepper was very warm, but survived.
Side note: maybe you were lucky that the too low ENA voltage hindered the controller to be activated and destroying the stepper.
-
@EricT the SW4 to 8 set the microstepping, you have set 1600, please check it does fit with your config setting M350 and the M92 calculation. And the M350 looks strange, you set two microstepping values for E, but have only one stepper attached.
I must confess I have an DM542T Stepperonline, slightly different label, so I'm sorry if I am wrong with the two last posts if e.g. your switches are other round. My switches are off in the direction up towards the description, on is down. (the google images I checked are all On = down)
-
@EricT said in Trouble driving an external stepper driver with Duet 2 Wifi:
When I try to run it with the extrude/retract button in DWC, I get the error:
"Warning: motor phase A may be disconnected reported by driver(s) 4
Warning: motor phase B may be disconnected reported by driver(s) 4"
The only motor that is having problems is the "ram extruder", which is connected to E2 on the expansion board and being run via a DM542S external stepper driver. All other motors (X, Y, Z, and the "screw extruder" E1) are being run from the internal drivers on the Duet 2 wifi without any problems.Driver 4 is the internal driver labelled E1 on the Duet. It's not one of your external drivers. So this line:
M569 P4 S0 T10:10:10:10 ; physical drive 3(E2, ram extruder) goes forwards, all pulse widths & signal intervals set to 10us
is setting the step pulse width on the wrong driver. External drivers connected to the breakout board are numbered 5 to 9.
On many external drivers, the input labelled ENA is actually a disable input, not an enable input. Use the R1 parameter in the M569 command for that driver to handle this.
-
Thank you for the responses and the help everyone! I've got all motors working now, and should be able to finish the rest of the machine from here without any issues.
The primary two issues turned out to be the bad drive mapping (I was using P4 instead of P5) and the flipped ENA input. Once I changed those two things, the larger motor worked perfectly. Thank you for your help @dc42! (and for creating a good product in general, this thing has been a pleasure to work with)
@JoergS5, thank you for pointing out the high stepper current. I had originally thought that my larger motor needed 4A, but your comment made me go back and double-check - turns out 2A was correct after all (and thanks to you I didn't even have to burn a motor to find that out).
Incidentally, this setup actually does have two stepper motors for extrusion, that bit wasn't a mistake. It's a clay-extruding printer (Cerambot), with a larger motor pushing the clay out of a large syringe and through a feed tube to the printhead, and a smaller stepper at the printhead itself driving an archimedes screw to extrude the clay onto the build plate
-
@EricT Thank you for confirming that the ideas had a sense. I wish you success with your project!