Solved: Leadshine Closed-Loop External Motor Drivers with Duet2



  • Solved: How to use Leadshine Closed-Loop External Motor Drivers with Duet 2 Wifi and Breakout Expansion Board

    Note: I have wired the external drivers as "Common-Anode" and have supplied them with a +5v power supply. I have also set the DIP Switches to be 6400 Pulses/Revolution.
    0.png

    1- Start with a fresh config file and run through the basic setup as you would for any printer. I used the RRF Config Tool that can be found here: https://configtool.reprapfirmware.org/Start

    2- Now go into the Config file and make the following adjustments. (do this before you try using the machine)

    Set the M569 values for all of the External Motor Driver Axis

    • in the Config file place the M569 Parameters before all other drive settings. for me this was just after the network settings.

    • The "P" parameter is very straight forward. Just put the Pin Number from the Expansion Board for each axis. You can find this by looking for the Printed Labels next to each Header and add then add 3.1.png

    • The "S" parameter will be determined by your machine layout. you can always come back and change this if an Axis is running in the wrong direction.

    • Set the "R" parameter to "R1" Active High

    • Use the "Taa:bb:cc:dd" parameter and set it to "T5:2.5:5:7.5" (5us minimum step pulse, 2.5us minimum step interval, 5us DIR setup time and 7.5 hold time. This is the setting I found that worked will all of the different Leadshine Closed-Loop External Motor Drivers I have. if these setting do not work for you begin increasing the minimum step pulse (aa) by intervals of 0.5 until it they work. You can also try reducing the minimum step pulse (aa) and the hold time (dd) by intervals of 0.5 to increase motor speed however these settings are probably plenty fast. Note: Make sure that you do not set the minimum step pulse (aa) below a value of 2.5

    • The finished M569 parameters should look like this: M569 P7 S0 R1 T5:2.5:5:7.5 Make sure to do this for all of the External Headers you are using.

    3- Next add the Drive Mapping Parameter M584 to your Config File. Note: Make sure that this comes after the M569 parameters.

    Simply match the Header Numbers to the Axis that you have wired them to.
    mine ended up looking like this: M584 X7 Y6 Z5 E9

    With these setting uploaded you should now be able to move each axis on the machine. once you have verified that all of the External Drivers are moving the stepper motors without an unexpected sounds or movements, you will need to go through the process of setting the M92 (steps per mm) parameter.

    You Should now be ready to print! 😎

    After much trial and error, here is what my Drive Settings in my Config File ended up looking like.

    ; Drive Settings
    ; Drives driver direction, enable polarity and step pulse timing
    ;------------------X MOTOR-------------------------------------------------------------
    M569 P7 S0 R1 T5:2.5:5:7.5 ; driver 7 direction is backwards and requires an active high enable, 5us minimum step pulse, 2.5us minimum step interval, 5us DIR setup, and 7.5us hold time
    ;------------------Y MOTOR-------------------------------------------------------------
    M569 P6 S0 R1 T5:2.5:5:7.5 ; driver 6 direction is backwards and requires an active high enable, 5us minimum step pulse, 2.5us minimum step interval, 5us DIR setup, and 7.5us hold time
    ;-----------------Z MOTOR--------------------------------------------------------------
    M569 P5 S0 R1 T5:2.5:5:7.5 ; driver 5 direction is backwards and requires an active high enable, 5us minimum step pulse, 2.5us minimum step interval, 5us DIR setup, and 7.5us hold time
    ;-----------------EXTRUDER 0 MOTOR-----------------------------------------------------
    M569 P9 S0 R1 T5:2.5:5:7.5 ; driver 9 direction is backwards and requires an active high enable, 5us minimum step pulse, 2.5us minimum step interval, 5us DIR setup, and 7.5us hold time
    M584 X7 Y6 Z5 E9				   ; set drive mapping to external drivers
    M92 X171.00 Y171.00 Z1290.00 E400.00               ; set steps per mm
    M566 X100.00 Y100.00 Z60.00 E120.00                ; set maximum instantaneous speed changes (mm/min)
    M203 X2000.00 Y2000.00 Z180.00 E1200.00            ; set maximum speeds (mm/min)
    M201 X100.00 Y100.00 Z100.00 E1000.00              ; set accelerations (mm/s^2)
    M906 X1000 Y1000 Z1000 E1000 I30                   ; set motor currents (mA) and motor idle factor in per cent
    M84 S30                                            ; Set idle timeout
    
    

    I found this information to be hard to find, but the community here helped me piece it together so I though it would be good to compile it all in one location. I hope that this will help you through your build!



  • Well done.
    It would be interesting to see a before/after comparison of print quality and speed.



  • @OwenD Here are some initial results. I am still working on tuning the machine and am currently working on a new extruder/hotend design, but so far I am quite happy with the prints. This Bottle is almost 1 meter tall and used 1Kg of material. I printed it spiralized at .8mm layer height and it tool just over 3 hours. Once I have designed the new extruder assembly I will post an update. my goal is to get to 1kg of material in under an hour and maintain a decent print quality.

    Orange Sharpie for Scale πŸ–Š
    Screen Shot 2020-07-14 at 11.17.36 AM.png
    Screen Shot 2020-07-14 at 11.27.33 AM.png


  • Moderator

    1KG/hour is into pellet extruder territory. Very impressive.



  • That’s cool. And I thought I had a big printer, not compare to that one.



  • @Cameron Do you see any advantage or effect on print quality in using the closed loop motors instead of open loop steppers?



  • @mrehorstdmd I am mostly using the Closed Loop system to detect/prevent collisions because of the high speeds that I am running the printer at and Id like the machine to not destroy itself. They are very good at maintaining position at high speeds and after pausing. I have noticed that they do not seem to perform well with coasting setting in prints. I am working on a new print cooling system and should be able to increase my speeds.



  • @Cameron Are you using a closed loop stepper for the extruder, too? What does the hot end look like?



  • @Cameron

    So the answer to the gents question about improving print quality is no then..



  • @CaLviNx said in Solved: Leadshine Closed-Loop External Motor Drivers with Duet2:

    So the answer to the gents question about improving print quality is no then..

    It depends on the setup you are replacing πŸ™‚

    I'm using few leadshine closed loop steppers for some testing (mostly low power laser and some light milling) and compared to some sanguino board with old pololu stepper driver and some second hand el cheapo nema23 I was using for test initially the difference is staggering..

    I'll try to find images, I'm sure I saved them, it is very easy to see with laser as with original setup I had issues that line looked "pointy" and not smooth as stepper was not moving at constant speed but was "stopping" after every step and you see that by laser blacking paper more. Also the "points/dots" were not equaly spread on the line but were more concentrated around full and half step positions (no matter if I was using 1/16 microstepping or 1/32 the spread was same). With leadshine (I got both motor and driver from them "matched") the line is straight and smooth

    No clue if that would be visible on 3d print (as I don't see that with duet and different nema17 motors I tested) .. so as I said, depends what you are comparing it to. If you compare it to crappy open loop setup - it's better, microstepping is not only allowing for "smooth start" but is actually precise



  • I recently put iHSV servomotors in my sand table and they perform so much better than steppers in that application I'm going to try putting them into my printer. I am not expecting the sort of improvements I saw in the sand table performance, mainly because the application is so much different. In the sand table, I need high speed (1000-1500 mm/sec), high acceleration, and quiet operation, with precision and accuracy being secondary considerations- sand is not a high resolution medium.

    In the 3D printer I need low to moderate speed and acceleration, high precision and accuracy, and quiet operation. I think they'l be quiet, but I'm not sure how they'll behave at 3D printing speeds/accelerations. There are many parameters to tune in the driver to optimize performance, but no information in the manual or software about how do actually do the tuning, so I'll probably just run them at the factory default settings and hope for the best.



  • @mrehorstdmd said in Solved: Leadshine Closed-Loop External Motor Drivers with Duet2:

    I'll probably just run them at the factory default settings and hope for the best

    3D printing speeds should be covered by default settings as we go from ~10mm/sec up to 200mm/sec .. rarely below or above that, this is "inside" the normal range for e.g. milling machines or plazma cutters or wood routers.. thay are usually used for at factory settings and those cut sometimes at much lower speeds than our 10mm/sec and have free moves faster than 200mm/sec so IMHO factory will work perfectly for 3d printer


Log in to reply