stepper drivers keep stalling

  • Hello,

    I've asked some questions about this already but everytime something else comes up.
    I use external stepper drivers to support my NEMA34 motors.

    I had some problems with the pulse-width resulting in a 'position following error'. (I use ES-D808 stepper drivers). I asked that on this forum where people stated that I needed to extend my pulse width to a minimum of 2.5 microseconds (that's what is recommended as minimum in the manual)

    After setting that up, I used the following config code (for this part):

    ; Drives
    M569 P5 R1 S1 T5.0:5.0:5:5                                 ; physical drive 0 goes forwards
    M569 P6 R1 S1 T5.0:5.0:5:5                                 ; physical drive 1 goes forwards
    M569 P7 R1 S0 T5.0:5.0:5:5                                 ; physical drive 2 goes forwards
    M569 P8 R1 S1 T5.0:5.0:5:5                                 ; physical drive 3 goes forwards
    M584 X5 Y6 Z7 E3                               ; set drive mapping
    M350 E16 I0                                    ; configure microstepping without interpolation
    M350 X16 Y16 Z16 I1                            ; configure microstepping with interpolation
    M92 X80.00 Y80.00 Z320.00 E410                 ; set steps per mm
    M566 X900.00 Y900.00 Z12.00 E120.00            ; set maximum instantaneous speed changes (mm/min)
    M203 X6000.00 Y6000.00 Z180.00 E1200.00        ; set maximum speeds (mm/min)
    M201 X500.00 Y500.00 Z20.00 E200.00            ; set accelerations (mm/s^2)
    M906 X800 Y800 Z800 E800 I30                   ; set motor currents (mA) and motor idle factor in per cent
    M84 S30                                        ; Set idle timeout

    When I am printing, the first 5 hours go well and after that, one of my stepper drivers get a 'positioning following error' and stops moving. I have set all my motors in serie so they all stop moving (I have a parallel x-axis so it would rip the printer apart if I don't do this).

    This is the main problem, but it causes another: The printer does not know my stepper driver goes into fault. All my axis motors stop but the extruder does not. You can guess what that problem becomes, my extruder creates a big blob.

    I now have the plan to connect the fault-signal from my stepper driver to the reset pin of my duet board. This is not the optimal solution but prevents my printer from breaking itself down. If there is a stop function without end-stops, I am more than interested to learn about this!

    My big question: How is it possible that my stepper driver goes into fault after 5-6 hours of printing? My pulse width is long enough (>2.5 microseconds) so should not be the problem. Anybody who recognizes this problem?

    Many thanks in advance!

  • Moderator

    @peterartechno Can you confirm what Duet you are using and firmware versions? Please send M115 to your Duet and post the reply.

    I think this is step rate problem. If you send M569 P5 to the Duet (I think you have Duet 2 WiFi?), you'll probably see the response:

    M569 P5
    Drive 5 runs forwards, active high enable, timing 5.3:5.3:5.3:5.3us

    5.3us (microseconds) is as close as the Duet can get to the requested timing due to the Duet processor speed. A full step pulse is the 'step pulse width', plus the 'step pulse interval' (the second T parameter in M569), ie 5.3 + 5.3 = 10.6 us. This gives you a theoretical maximum steps per second of:

    1,000,000 / 10.6 = 94339.6 steps per second

    In your config.g, you have set 80 steps per mm (M350), x16 microstepping (M92) and maximum speed of 100 mm/s (M203: 6000 mm/min / 60):

    80 * 16 * 100 = 128000 steps per second

    Edit: This is incorrect, and my (deleted) advice related to the step rate being too fast was mostly misleading. M350 is not counted for external drivers. Steps per second is just 80 (steps per mm) x 100 (mm/s) = 8000, well within the capability of the Duet.


  • @droftarts

    Thanks for your elaborate answer,

    The results of M115 are:
    IRMWARE_NAME: RepRapFirmware for Duet 2 WiFi/Ethernet FIRMWARE_VERSION: 3.1.1 ELECTRONICS: Duet WiFi 1.02 or later FIRMWARE_DATE: 2020-05-19b2

    I checked your config suggestions and I found something that I am not sure about. According to my own settings, I have a x16 microstepping and a 80steps/mm.

    When I check my stepper driver dip switches I find a 1600/rev resolution, which would need a x8 microstepping.

    Could it be possible that my microstepping should be x8, while my movements are correct at the moment? (100mm command results in a 100mm movement). I find this hard to be true but could be the problem.

    The Duet then gives too much steps compared with my settings.

    I use a 20mm/rev spindle as axis.

    My plan:
    Change the code to x8 microstepping and try everything again

    My fear: movements are not correct afterwards anymore

    Many thanks in advance.

  • @peterartechno I have no idea what's causing your problem, but I desperately want to see some pictures of this machine! Please....

  • administrators

    @peterartechno said in stepper drivers keep stalling:

    I checked your config suggestions and I found something that I am not sure about. According to my own settings, I have a x16 microstepping and a 80steps/mm.

    For external drivers M350 is not relevant the firmware cannot set specific microstepping on the driver (in your case it is done by dip switches). What is important is the steps/mm. In your case you have 80 steps/mm, which depends on your driver setting, gearing via pulleys etc If you are getting the correct amount of movement then the setting is correct. (which 1600 steps/rev and 20mm/ rev is 80 steps/mm so that looks good).

    The issue is why the drivers are having an issue at high speeds, causing the position following error to be reported needs further investigation. Please determine what length/speed of move is needed to recreate the problem (does not need to be a print file, just send the movement from the console) and the send M122 after the position following error is reported. You can do this without extruding, although you might need a higher speed movement to trigger it depending on if its triggered by a pure travel move, or a travel move which also has (e.g.) retraction and Z hop in the same move).

    Regarding the other issue. You can wire the fault lines to a free endstop input and then configure that input as a trigger to take whatever actions (pause, send a message to the UI etc) in the specific triggerN.g macro:

  • @T3P3Tony Thanks for your answer

    The thing with the 1600/rev is that my duet says that I have a x16 microstepping but my stepper driver is set at x8. This does not give me a wrong movement so I just found out just now. Can I leave it like this? You say that M350 has no influence but the Duet gives the amount of pulses right? So x16 has twice the pulses compared to x8.

    The strange thing is that this does not happen at extreme speeds but randomly. I printed multiple parts with a higher speed and when I try to move my exttuder at max speed (100mm/s), I never get an error. The error occurs after some time.
    The big problem here is that there is no feedback from my printer. The printer does not know the motor is in fault. That is why the extruder also keeps going.

    Somebody told me that this could also be caused by the following:
    M566 X900.00 Y900.00 Z12.00 E120.00 ; set maximum instantaneous speed changes (mm/min)

    That the instantaneous speed difference is too big. This could be the problem, but I am not sure. I have a picture added to see what happens if the motor stops working!

    2021-02-04 at 13.48.40.jpeg 2021-02-04 at 13.48.36.jpeg

    I know the quality of the printer is not optimal here, but I use a 0.8mm nozzle with a printbed over a 1m2 so it is not designed for small shapes.

    I had this error also when printing something of 40x60cm

    If anybody could maybe help me with the M566 line and if that could be of any influence, thanks a lot!

  • @mrehorstdmd

    sending it soon, as you see I first have to clean my extruder head haha

  • Hi,

    Have you seen this before?

    When M350 is processed, the steps/mm will be adjusted automatically to allow for any changes in microstepping. Therefore you can either:

    a) Set Steps/mm correctly for the default 1/16 microstepping, then set the microstepping to the desired amount using M350:

    M92 X80 Y80 Z400 ; set axis steps/mm
    M92 E420:430 ; set extruder 0 and 1 steps/mm
    M350 X128 Y128 Z128 E128:128 ; set microstepping

    b) Set the microstepping using M350 and then set the correct steps/mm for that microstepping amount:

    M350 X128 Y128 Z128 E128:128 ; set microstepping
    M92 X640 Y640 Z3200 ; set axis steps/mm @128 microstepping
    M92 E3360:3440 ; set extruder 0 and 1 steps/mm

    Assuming that in the first example the microstepping was initially at the default x16, both the above examples result in the same steps/mm settings.


  • administrators

    M350 does not apply to external drivers so I would remove any axis from M350 that are connected to external drivers. It's only M92 that applies in this case.

    The M566 settings determine how much of a velocity change is allowed without accelerating. That needs to be set to a value that makes sense for the mechanics of the printer. Too low and it will not be able to print curves well. Too high and you will get pronounced ringing.

    I would work on one problem at a time. Starting with a repeatable command to cause a driver to go into fault mode.

  • @T3P3Tony

    Strange things happen,

    When I raise my maximum speed and acceleration, my speed on the printer does not go up. I changed it from 6000mm/min to 9000, no difference. Any clues why that could happen?

  • @mrehorstdmd

    as requested:

    WhatsApp Image 2021-02-05 at 16.58.59.jpeg

    WhatsApp Image 2021-02-05 at 16.58.59 (2).jpeg
    It is going to be changed a lot (bed is going to be reduced to 1000mm instead of 1400mm), maybe change the Gantry, way too heavy right now...

Log in to reply