Duet3 sensorless homing corexy failure
-
I am having difficulty understanding why stall detection does not seem to be happening on my new build corexy printer. I have a mini5 connected to a 1lc and a rasperry pi working in sbc mode. I have been working through the commissioning document, and all is fine until I get to the motors section. All the motors are now working, and moving the axes as expected. I attach the config.g file.config.g
I have spent some time trying to understand what is going wrong and have tried to simplify the problem in the attached homex.g filehomex.g
The M574 & M915 entries are there for convenience (they are in the config.g file as well). when I run this file from the dashboard all seems well until the G1 H1 X... command, the carriage moves, hits the end stop and stays there. The current X position in the dashboard updates to 355 (which would be the end of travel of the G1 H1 X.... command), making me believe the stall endstop has not triggered. Unsurprisingly the system returns a G28 failure.
Clearly something is wrong with the setup for detecting the stall - any help in finding where this is will be much appreciated -
@ProfChris Your config.g
; Configuration file for RepRapFirmware on Duet 3 Mini 5+ Ethernet ; executed by the firmware on start-up ; ; generated by RepRapFirmware Configuration Tool v3.5.10 on Mon Jan 27 2025 17:06:05 GMT+0000 (Greenwich Mean Time) ; General G90 ; absolute coordinates M83 ; relative extruder moves M550 P"Duet 3" ; set hostname M911 S19.8 R22 P"M913 X0 Y0 G91 M83 G1 Z3 E-5 F1000" ; set voltage thresholds and actions to run on power loss ; Accessories M918 P2 E1 F2000000 C30 R6 ; configure direct-connect display ; Wait a moment for the CAN expansion boards to become available G4 S2 ; LED Strips M950 E0 C"121.io0.out" T2 ; configure LED strip #0 ; Accelerometers M955 P121.0 I10 ; configure accelerometer on board #121 ; Smart Drivers M569 P0.0 S0 D2 ; driver 0.0 goes reverse (Z axis) M569 P0.1 S1 D2 ; driver 0.1 goes forwards (Z axis) M569 P0.2 S0 D2 ; driver 0.2 goes reverse (Z axis) M569 P0.3 S1 D2 ; driver 0.3 goes forwards (Z axis) M569 P0.4 S0 D2 ; driver 0.4 goes reverse (Y axis) M569 P0.5 S0 D2 ; driver 0.5 goes reverse (X axis) M569 P121.0 S1 D2 ; driver 121.0 goes forwards (extruder 0) ; Motor Idle Current Reduction M906 I30 ; set motor current idle factor M84 S30 ; set motor current idle timeout ; Axes M584 X0.5 Y0.4 Z0.0:0.1:0.2:0.3 ; set axis mapping M350 X16 Y16 Z16 I1 ; configure microstepping with interpolation M906 X1700 Y1700 Z1700 ; set axis driver currents M92 X80 Y80 Z400 ; configure steps per mm M208 X0:350 Y0:350 Z0:330 ; set minimum and maximum axis limits M566 X900 Y900 Z12 ; set maximum instantaneous speed changes (mm/min) M203 X30000 Y30000 Z6000 ; set maximum speeds (mm/min) M201 X25000 Y25000 Z5000 ; set accelerations (mm/s^2) ; Extruders M584 E121.0 ; set extruder mapping M350 E16 I1 ; configure microstepping with interpolation M906 E850 ; set extruder driver currents M92 E420 ; configure steps per mm M566 E120 ; set maximum instantaneous speed changes (mm/min) M203 E3600 ; set maximum speeds (mm/min) M201 E250 ; set accelerations (mm/s^2) ; Kinematics M669 K1 ; configure CoreXY kinematics ; Probes M558 K0 P8 C"121.io2.in" H5 F120 T6000 ; configure unfiltered digital probe via slot #0 G31 P500 X0 Y0 Z0.7 ; set Z probe trigger value, offset and trigger height ; Endstops M574 X2 S3 ; configure X axis endstop M574 Y2 S3 ; configure Y axis endstop M574 Z2 S4 ; configure Z axis endstop M915 P0:1:2:3:4:5 S3 R0 F0 ; set up sensorless homing ; Sensors M308 S0 P"temp0" Y"thermistor" A"Heated Bed" T100000 B3950 ; configure sensor #0 M308 S1 P"121.temp0" Y"thermistor" A"Nozzle" T100000 B4267 ; configure sensor #1 ; Heaters M950 H0 C"out1" T0 ; create heater #0 M143 H0 P0 T0 C0 S140 A0 ; configure heater monitor #0 for heater #0 M307 H0 R0.471 K0.236:0.000 D3.81 E1.35 S1.00 B0 ; configure model of heater #0 M950 H1 C"121.out0" T1 ; create heater #1 M143 H1 P0 T1 C0 S285 A0 ; configure heater monitor #0 for heater #1 M307 H1 R5.611 K0.762:0.617 D2.78 E1.35 S1.00 B0 V23.8; configure model of heater #1 ; Heated beds M140 P0 H0 ; configure heated bed #0 ; Fans M950 F0 C"121.out1" ; create fan #0 M106 P0 S0 L0 X1 B0.1 ; configure fan #0 M950 F1 C"121.out2" ; create fan #1 M106 P1 S0 B0.1 H1 T45 ; configure fan #1 ; Tools M563 P0 D0 H1 F0 ; create tool #0 M568 P0 R0 S0 ; set initial tool #0 active and standby temperatures to 0C
Your homex.g
; homex.g ; called to home the X axis ; ; generated by RepRapFirmware Configuration Tool v3.5.10 on Mon Jan 27 2025 17:06:07 GMT+0000 (Greenwich Mean Time) M574 X2 S3 ; configure X axis endstop M574 Y2 S3 ; configure Y axis endstop M574 Z2 S4 ; configure Z axis endstop M915 P0:1:2:3:4:5 S3 R0 F0 ; set up sensorless homing ; increase Z G91 ; relative positioning G1 H1 Z5 ; move Z relative to current position to avoid dragging nozzle over the bed G90 ; absolute positioning ; home X (sensorless) M400 ; Wait for any moves to finish M913 X30 Y30 ; drop motor currents to 70% M400 G91 ; relative positioning var maxTravel = move.axes[0].max - move.axes[0].min + 5 ; calculate how far X can travel plus 5mm G1 H1 X{var.maxTravel} Y{var.maxTravel} F10000 ; coarse home in the +X, +Y direction ;G1 H1 X{var.maxTravel} F12000; coarse home X ;G1 H1 Y{var.maxTravel} F10000; coarse home Y ;G1 H2 X-5 Y-5 F12000 ; move back 5mm ;G1 H1 X{var.maxTravel} F7000 ; fine home in the +X direction ;G1 H1 Y{var.maxTravel} F7000 ; fine home in the +Y direction G90 ; absolute positioning M400 ; Wait for any moves to finish M913 x100 Y100 ; return motor currents to 100% M400 ; decrease Z again G91 ; relative positioning G1 H1 Z-5 F6000 ; move Z relative to current position G90 ; absolute positioning
From what I can see, you're not changing to stealthChop mode (M569 ... D3), which is required for stall homing on Mini 5+, you're in spreadCycle (M569 ... D2). See https://docs.duet3d.com/en/User_manual/Connecting_hardware/Sensors_stall_detection#background-on-stall-detection
Additionally, the TMC2209 stepper driver used in Duet 3 Mini 5+ (and Duet 3 Tool board TOOL1LC once stallGuard is implemented in firmware), features stallGuard 4. This is optimised for operation with stealthChop, while its predecessor stallGuard 2 (TMC5160 and TMC2260) works with spreadCycle. You will need to adjust the speed at which stealthChop changes over to spreadCycle. This is set by M569 V parameter. The default is 2000.
Ian
-
@ProfChris you need to get several things right to get stall detection working on TMC2209 drivers such as are used on the Duet 3 Mini. To make this easier, in RRF 3.6 we check stall homing moves and if stall detection is not viable because the configure is not suitable then we abandon the move and produce an error message identifying the problem.
-
Many thanks for your help. I had not appreciated the need for the M569 command. I have added the M569 commands with the D3 parameter - but no stall detected.
I then added V100 to the M569 command - The carriage just moved a small amount but stall detection had worked just over sensitive! I thought I could leave the V100 as my understanding is that it doesn't affect the sensitivity of stall detection, just the switch from stealthchop to spreadcycle.
I have then tried changing the S parameter of the M915 command. I ve found that S7 appears too sensitive (i.e. premature stall detected) and S8 not sensitive enough (i.e. no stall detected).
I am encouraged by now being able to detect stalls, but do not understand which parameter (or command) I need to change to further control the sensitivity of the stall detection. -
@ProfChris have you read https://docs.duet3d.com/en/User_manual/Connecting_hardware/Sensors_stall_detection? You may find some useful tips there.
Having looked at your config and homex file I have a few suggestions:
-
You are using F10000 speed in your homing move. Depending on your motors, that may be too fast for reliable stall detection. Try F3000.
-
If it detects a stall just after the start of the homing move, this may be because the acceleration is too high. You can use the M201.1 command to reduce acceleration during stall homing moves.
-
If the motor was already stalled when you execute the homing move, then it won't move. To avoid this situation you can do a short (more than 1 full step) G1 H2 move in the opposite direction t un-stall the motor. Bear in mind that G1 H2 moves are raw motor moves, so to move in the -X direction you would need something like G1 X-1 Y-1.
-
-
Once again many thanks for your reply. Using M201.1 to reduce the acceleration has enabled me to achieve a sensorless home! I now feel able to adjust the various parameters to get a reliable performance.
I have read the document on stall detection many times; in fact it was the existence of that document which convinced me that sensor less homing was a viable option. On reading the document I hadn't realised that stealthchop needed to be specifically selected with M569, or that M201.1 could be used to control acceleration whilst homing.
I relied heavily on the section titled Configuring Sensorless Homing, and that doesn't mention these commands. However I also realise that describing stall detection and configuring it is a complex area given the range of stepper drivers used by Duet; and that it would not be possible to describe the software configuration for all hardware combinations
When I set out on building this coreXY machine I realised that there would be a number of challenges along the way and this seems to have been one of them, however it is a good and enjoyable experience when supported by folk like yourselves. -
@ProfChris I'm glad you got it working. Having read your comments, I have updated the page on stall detection.
-
undefined dc42 marked this topic as a question
-
undefined dc42 has marked this topic as solved