Auto re centering after missed steps?



  • i have searched and searched with no answer. Does the duet re center the print (adjust to correct) after missed steps?





  • so this code

    M915 P0:2:3 S10 F1 R3

    but where dose one put it in gcode?



  • Please read through the documentation and the information on the wiki: https://duet3d.dozuki.com/Wiki/ConfiguringRepRapFirmwareCartesianPrinter#Section_Main_configuration_file



  • @codfish124:

    i have searched and searched with no answer. Does the duet re center the print (adjust to correct) after missed steps?

    Disclaimer: I am not with Duet3d (the company) and am not a firmware developer of contributor to Duet3d. However… I am a firmware developer / contributor for other motion control systems.

    There are two significant "no" answers to your question:

    First, generally speaking, no "open loop" system can recover after missed steps. "Open Loop" means "no encoders". Any stepper motor based system that does not have extra physical encoders is "open loop". Including the Duet.

    There is literally, physically, no way for an open loop system to "know" where anything is. With one exception: Homing. In theory, a system that can DETECT a missed step, could "home" and then resume whatever it was doing.

    That brings us to the second point: How are missed steps detected? Stall detection in TMCxxxx chips can detect some kinds of missed steps, and not others.

    If a mechanical missed step occurs that does NOT cause an overcurrent stall, the Duet/TMC combination cannot know it occured. This could be a belt skipping a tooth, a leadscrew jumping a thread, a loose pulley, or any number of things. This cannot be overstated… further, to my personal experience, I've seen lots of CNC or 3D machines miss steps, and I believe about 99% of them could not have been detected via motor current.

    With the above as background, let's return to your original qustion: What does the Duet do when a stall is detected?

    There is a very simple way to answer your question (assuming you have a 3D printer with a Duet): Upgrade to the latest firmware, start a print (with or without filament loaded), then stall the machine (stall, not skip), and watch what it does.

    Perhaps repeat the experiment with various settings of M915, particularly the "R" parameter.

    [[language]]
    M915: Configure motor stall detection
    Parameters
    
    Pnnn:nnn:... Drive number(s) to configure
    X,Y,Z,U,V,W,A,B,C Axes to configure (alternative to using the P parameter)
    Snnn Stall detection threshold (-64 to +63, values below -10 not recommended)
    Fn Stall detection filter mode, 1 = filtered (one reading per 4 full steps), 0 = unfiltered (default, 1 reading per full step)
    Hnnn (optional) Minimum motor full steps per second for stall detection to be considered reliable, default 200
    Tnnn (optional) Coolstep control register, 16-bit unsigned integer
    Rn Action to take on detecting a stall from any of these drivers: 0 = no action (default), 1 = just log it, 2 = pause print, 3 = pause print, execute /sys/rehome.g, and resume print
    
    


  • The above is my best effort to help, based on facts around how motion control and the Duet work.

    Now for a personal opinion: I would personally be very reluctant to ever use M915 R3 and take actions in /sys/rehome.g

    Again, personal opinion: If steps are missed, something is drastically wrong. Loose belt, loose pulley, gcode that jams the head, something. Recovering and trying again is just going to result in the same thing, repeated ad infinitum.

    Also, that's my "hands on" experience across numerous CNC and 3D Print machines: A skip/jam has to be fixed. A re-run would result in the same failure. I literally can't think of one that could have been auto-recovered. They may exist, but they seem very rare.

    YMMV (Your Mileage May Vary) 🙂



  • This is a great explanation why closed loop has not taken off in 3D printing (as well as cost). You shouldn't be missing steps the only times when it might come in useful (in normal desktop 3d printers) is if someone grabs the carriage and skips steps or the machine falls off the desk. All not very likely scenarios and skipped steps would be the least of your worries in either hypothetical case.


  • administrators

    Where the stall detection is useful is in tuning your machine. You can push the acceleration, jerk and max speed values up and play with the motor currents to get an idea of what the maximums are before steps are skipped by the drivers. Once you have established these for the worst case scenario (ie you have a maximum sized print on your moving bed) then you can back off from these maximums with a safety margin and be confident that if you do get skipped steps in the future it is because of either a mechanical issue that has developed or the print is curling up and snagging the nozzle.



  • I thought there wasa way to use the drivers like the MK3. I don't have issues with missing steps more of a precaution. I print multi day prints all the time and was just looking for more back up.

    I am new to the Duet this is my 2nd printer running it I think it's great still wrapping my head around every thing. I just don't know where codes go. just anywhere in the config.g? I'm still learning Duet.


  • administrators

    Mostly the order of GCodes in config.g doesn't matter. For the exceptions, see https://duet3d.dozuki.com/Wiki/ConfiguringRepRapFirmwareCartesianPrinter#Section_Main_configuration_file.

    While you are tuning your stall detection you will find it easier to send the M915 commands from the GCode Console in DuetWebControl.

    Bear in mind that for the MK3, Prusa was able to match the power voltage and the choice of motors with the drivers, and that the MK3 doesn't run at very high speeds.



  • thank you DC42 thats a big help. this is on a CRturd I doubt i'll be printing higher than 60 mms. Just want more error prevention

    i also see this https://duet3d.dozuki.com/Wiki/Stall_detection_and_sensorless_homing#Section_Configuring_sensorless_homing

    but i cant seem to get the macro to work on the CR10

    ;''' Sensorless Homing test file for RepRapFirmware on Kossel'''
    M915 X Y S5 R2
    M400 ; make sure everything has stopped before we make changes
    M574 X2 Y2 S3 ; set endstops to use motor stall
    M913 X50 Y50 Z50 ; reduce motor current to 50% to prevent belts slipping
    G91 ; use relative positioning
    G28 S1 X0 Y0
    G90 ; back to absolute positioning
    M913 X100 Y100 Z100 ; motor currents back to normal
    M574 X2 Y2 Z2 S1 ; set endstops back to normal so that homedelta.g


  • administrators

    You need to tune the stall detection threshold to suit your motors, in particular the S parameter in the M915 commands. You may need a different value for each motor.



  • thank you I got it I found some core XY help

    M400 ; make sure everything has stopped before we make changes
    M574 X1 Y1 S3 ; set endstops to use motor stall
    M913 X50 Y50 Z50 ; drop motor currents to 50%
    M915 X Y S3 R0 F0 ; set X and Y to sensitivity 3, do nothing when stall, unfiltered
    G91 ; use relative positioning
    G1 S1 X-400 Y-400 F4000 ; move left 300mm, stopping at the endstop
    G90 ; back to absolute positioning
    M400 ; make sure everything has stopped before we reset the motor currents
    M913 X100 Y100 Z100 ; motor currents back to 100%
    M574 X1 Y1 S0 ; Define active low and unused microswitches
    M574 Y1 Z1 S1 ; Define active low and unused microswitches



  • I think there is one argument for closed loop which I think is valid and which may be workable with stall detection to some extent and that is with an unsupervised print and some sort of notification system. If you have a problem, like a print issue causing the nozzle or part cooling duct to catch and steps being missed (admittedly I am a novice so these occurrence will hopefully abate) while you might not want the print to automatically stop as it might be a false positive, but a notification would allow you to check a webcam and make the decision to stop the print and save any further filament wastage or "the blob of death". Along the same lines, with my current build I intend to setup heatsink temperature monitoring to automatically pause the print if it goes too high.


  • administrators

    @codfish124:

    thank you I got it I found some core XY help

    M400 ; make sure everything has stopped before we make changes
    M574 X1 Y1 S3 ; set endstops to use motor stall
    M913 X50 Y50 Z50 ; drop motor currents to 50%
    M915 X Y S3 R0 F0 ; set X and Y to sensitivity 3, do nothing when stall, unfiltered
    G91 ; use relative positioning
    G1 S1 X-400 Y-400 F4000 ; move left 300mm, stopping at the endstop
    G90 ; back to absolute positioning
    M400 ; make sure everything has stopped before we reset the motor currents
    M913 X100 Y100 Z100 ; motor currents back to 100%
    M574 X1 Y1 S0 ; Define active low and unused microswitches
    M574 Y1 Z1 S1 ; Define active low and unused microswitches

    That is for homing X and Y without using endstop switches. However, it is incomplete because on a CoreXY printer that will home either X or Y (whichever stops first). You would need to follow G1 S1 X-400 Y-400 F4000 with G1 S1 X-400 F4000 and G1 S1 Y-400 F4000 to ensure that both X and Y are homed.


 

Looks like your connection to Duet3D was lost, please wait while we try to reconnect.