[3.4b3] Homing coupler does not work correctly
-
Edit: This was solved back in the day, but just came back with 3.5b1, see here: https://forum.duet3d.com/post/303392So after solving my Y homing issues, back with more homing issues after upgrading from 3.3 to 3.4b3...
Now my coupler doesn't home correctly, however, ONLY when doing "Home All". When pressing "Home C" in DWC, everything works as expected.Summary of what's happening:
- Coupler is supposed to stall against its lower hard stop (no stall detection, it just sits there trying to move further with reduced current, this is the "official" way of homing a TC coupler), after that it declares to be at C0 and moves to an open position via macro
- Above always worked perfectly fine and still does when JUST homing the coupler
- When doing Home All, the printer first homes Y, then X, then C, then Z
- However, with 3.4b3, the C homing outright skips the actual homing code, it just declares C0 whereever it happens to be and then executes the "Open" macro and moves some based on the incorrect C0 position
- This only happens when I execute the Y or X (or both) homing before C, if I start with C in homeall.g, things work as expected
Here are a few files:
; homeall.g ; called to home all axes M98 P"homey.g" ; Home Y first, so that a head that is currently in one of the tool docks home correctly M98 P"homex.g" ; Home X ;check if any tool is undocked if sensors.gpIn[0].value = 0 || sensors.gpIn[1].value = 0 || sensors.gpIn[2].value = 0 || sensors.gpIn[3].value = 0 echo "Not all tools docked, docking tool before homing!" M98 P"/macros/Toolchanging/DockUnknownToolEmergency" M98 P"homec.g" ; Home C (ToolHead) M98 P"homez.g" ; Home Z
; homey.g ; called to home the Y axis ; ; generated by RepRapFirmware Configuration Tool v2 on Thu Dec 13 2018 18:14:06 GMT+0100 (Central European Standard Time) G91 ; relative positioning G1 Z5 F1000 H2 ; lift Z relative to current position G1 H1 Y-400 F10000 ; move quickly to Y axis endstop and stop there (first pass) G1 Y5 F10000 ; go back a few mm G1 H1 Y-400 F360 ; move slowly to Y axis endstop once more (second pass) G90 ; absolute positioning
; homex.g ; called to home the X axis ; ; generated by RepRapFirmware Configuration Tool v2 on Thu Dec 13 2018 18:14:06 GMT+0100 (Central European Standard Time) G91 ; relative positioning G1 Z5 F1000 H2 ; lift Z relative to current position G1 H1 X400 F10000 ; move quickly to X axis endstop and stop there (first pass) G1 X-5 F10000 ; go back a few mm G1 H1 X400 F360 ; move slowly to X axis endstop once more (second pass) G90 ; absolute positioning
; homec.g ; called to home the C axis (coupler) if sensors.gpIn[0].value = 0 || sensors.gpIn[1].value = 0 || sensors.gpIn[2].value = 0 || sensors.gpIn[3].value = 0 M291 S1 T5 P"Please return tool to dock before homing coupler" R"Can't home coupler" abort G91 M400 M913 C60 ; C MOTOR TO 60% CURRENT G1 H2 C-300 F10000 ; <-- this is being skipped when executed via homeall.g and calling homex.g or homey.g before homec.g G92 C0 G90 M400 M913 C100 ; C MOTORS TO 100% CURRENT M98 P"/macros/Toolchanging/Coupler - Unlock" ; open coupler
; Configuration file for Duet WiFi (firmware version 3) ; executed by the firmware on start-up ; ; generated by RepRapFirmware Configuration Tool v2.1.8 on Sun May 10 2020 15:03:19 GMT+0200 (Mitteleuropäische Sommerzeit) ; General preferences ;M929 S3 ;enable debug logging M575 P1 S1 B57600 ;Enable PanelDue Port G90 ; send absolute coordinates... M83 ; ...but relative extruder moves M550 P"V-Core Pro" ; set printer name M669 K1 ; select CoreXY mode ; Network M552 S1 ; enable network ; Drives M569 P0 S0 ; stepper X/Y M569 P1 S0 ; stepper X/Y M569 P2 S1 ; stepper Coupler M569 P3 S0 ; stepper E1 M569 P4 S0 ; stepper E2 M569 P5 S0 ; stepper E3 M569 P6 S0 ; stepper E4 M569 P7 S0 ; stepper Z1 M569 P8 S0 ; stepper Z2 M569 P9 S0 ; stepper Z3 M584 X0 Y1 C2 Z7:8:9 ; set drive mapping (motion system) M584 E3:4:5:6 ; set drive mapping (extruders) ; Axis Limits global minY = -149 global maxY = 72 M208 X-150:160 Y{global.minY,global.maxY} ; set axis minima & maxima M208 C0:250 Z0:270 ; set axis minima & maxima M671 X-201:8:214 Y-204:187:-204 S30 ; set Z leadscrew positions M92 X160.00 Y160.00 C200.00 Z800.00 ; set steps per mm M350 X16 Y16 I1 ; configure microstepping with interpolation M350 C16 Z16 I1 ; configure microstepping with interpolation M566 X200 Y200 C2 Z20 ; set maximum instantaneous speed changes (mm/min) ;Z used to be 70 M203 X30000 Y30000 C10000 Z2000 ; set maximum speeds (mm/min) M201 X2000 Y2000 C500 Z500 ; set accelerations (mm/s^2) M906 X1800 Y1800 C500 I30 ; set motor currents (mA) and motor idle factor in per cent M906 Z1400 I100 ; set motor currents (mA) and motor idle factor in per cent M906 E600:600:600:600 I100 ; set motor currents (mA) and motor idle factor in per cent (2x Flex3Drive 2x LGX) M84 S30 ; Set idle timeout ;M204 P1500 T3000 ;M593 F40 ; cancel ringing ;=================== Extruder ====================== M92 E408:408:408:408 ; set steps per mm M350 E16:16:16:16 I1 ; configure microstepping M566 E1200:1200:1200:1200 ; set maximum instantaneous speed changes (mm/min) M203 E4000:4000:4000:4000 ; set maximum speeds (mm/min) M201 E3000:3000:3000:3000 ; set accelerations (mm/s^2) ;==================================================== ; Endstops M574 X2 S1 P"xstop" ; configure active-high endstop for high end on X via pin xstop M574 Y1 S1 P"ystop" ; configure active-high endstop for high end on Y via pin ystop M574 Z0 ; No Z-Endstop (use as probe instead) M574 C1 S3 ; Stall detect coupler at low end of its range ;Stall Detection ;M915 C S6 F0 H200 R0 ; Coupler ; Z-Probe global zProbeSpeedFeed = 500 global zProbeSpeedTravel = 20000 global zProbeDiveHeightLevel = 30 global zProbeDiveHeightMesh = 3 global zProbePin = "zstop" global zProbeType = 8 global zProbeTriggerValue = 200 M558 P{global.zProbeType} C{global.zProbePin} H{global.zProbeDiveHeightMesh} F{global.zProbeSpeedFeed} T{global.zProbeSpeedTravel} ; set Z probe type to unfiltered switch and the dive height + speeds G31 X0 Y0 Z0 P{global.zProbeTriggerValue} ; set Z probe trigger value, offset and trigger height, offsets here are hardcoded in leveling macro as well global minYMesh = global.minY global maxYMesh = 115 M557 X-146:150 Y{global.minYMesh, global.maxYMesh} P10 ; define mesh grid M376 H0 ; Set bed correction taper ; Heaters M308 S0 P"bedtemp" Y"thermistor" T100000 B3950 ; configure sensor 0 as thermistor on pin bedtemp M950 H0 C"bedheat" T0 Q10 ; create bed heater output on bedheat and map it to sensor 0 M143 H0 S121 ; set temperature limit for heater 0 to 121C M307 H0 B0 R0.686 C403.9 D2.95 S1.00 V24.1 ; Bed PID Tuning M140 H0 ; map heated bed to heater 0 M308 S1 P"e0temp" Y"thermistor" T100000 B4725 C7.06e-8 ; configure sensor 1 as thermistor on pin e0temp M950 H1 C"e0heat" T1 ; create nozzle heater output on e0heat and map it to sensor 1 M143 H1 S301 ; set temperature limit for heater 1 to 301C M308 S2 P"e1temp" Y"thermistor" T100000 B4725 C7.06e-8 ; configure sensor 2 as thermistor on pin e1temp M950 H2 C"e1heat" T2 ; create nozzle heater output on e1heat and map it to sensor 2 M143 H2 S301 ; set temperature limit for heater 2 to 301C M308 S3 P"duex.e2temp" Y"thermistor" T100000 B4725 C7.06e-8 ; configure sensor 3 as thermistor on pin e2temp M950 H3 C"duex.e2heat" T3 ; create nozzle heater output on e2heat and map it to sensor 3 M143 H3 S301 ; set temperature limit for heater 3 to 301C M308 S4 P"duex.e3temp" Y"thermistor" T100000 B4725 C7.06e-8 ; configure sensor 2 as thermistor on pin e3temp M950 H4 C"duex.e3heat" T4 ; create nozzle heater output on e3heat and map it to sensor 2 M143 H4 S301 ; set temperature limit for heater 2 to 301C M302 S190 R190 ;Cold extrusion settings M307 H1 B0 R4.292 C143.6:138.0 D3.25 S1.00 V24.2 ; PID Tuning T0 M307 H2 B0 R3.836 C137.7:128.8 D1.66 S1.00 V24.2 ; PID Tuning T1 M307 H3 B0 R3.967 C139.3:126.4 D1.79 S1.00 V24.2 ; PID Tuning T1 M307 H4 B0 R3.965 C144.7:139.8 D1.96 S1.00 V24.2 ; PID Tuning T1 ; Fans M950 F0 C"fan0" ; Hotend Fan Tool 0 M106 P0 S255 L255 H1 T50 ; Hotend Fan Tool 0 M950 F1 C"duex.fan3" Q50 ; Layer Fan Tool 0 M106 P1 S0 H-1 ; Layer Fan Tool 0 M950 F2 C"fan2" ; Hotend Fan Tool 1 M106 P2 S255 L255 H2 T50 ; Hotend Fan Tool 1 M950 F3 C"duex.fan4" Q50 ; Layer Fan Tool 1 M106 P3 S0 H-1 ; Layer Fan Tool 1 M950 F4 C"duex.fan5" ; Hotend Fan Tool 2 M106 P4 S255 L255 H3 T50 ; Hotend Fan Tool 2 M950 F5 C"duex.fan6" Q50 ; Layer Fan Tool 2 M106 P5 S0 H-1 ; Layer Fan Tool 2 M950 F6 C"duex.fan7" ; Hotend Fan Tool 3 M106 P6 S255 L255 H4 T50 ; Hotend Fan Tool 3 M950 F7 C"duex.fan8" Q50 ; Layer Fan Tool 3 M106 P7 S0 H-1 ; Layer Fan Tool 3 ;Z-Offset: If nozzle is too close to bed _reduce_ offset (negative number becomes more negative) ; If nozzle is too far away, _increase_ offset (negative number becomes less negative) ; Tools M563 P0 D0 H1 F1 ; define tool 0 G10 P0 X-9 Y39 Z-4.60 ; set tool 0 axis offsets G10 P0 R0 S0 ; set initial tool 0 active and standby temperatures to 0C M563 P1 D1 H2 F3 ; define tool 1 G10 P1 X-9.480 Y38.790 Z-4.890 ; set tool 1 axis offsets G10 P1 R0 S0 ; set initial tool 1 active and standby temperatures to 0C M563 P2 D2 H3 F5 ; define tool 2 G10 P2 X-9.310 Y38.840 Z-5.010 ; set tool 2 axis offsets G10 P2 R0 S0 ; set initial tool 2 active and standby temperatures to 0C M563 P3 D3 H4 F7 ; define tool 3 G10 P3 X-9.450 Y37.880 Z-5.000 ; set tool 3 axis offsets G10 P3 R0 S0 ; set initial tool 3 active and standby temperatures to 0C M563 P4 S"Pen" ; define tool 4 (Pen) G10 P4 X0 Y46.5 Z-20.000 ; set tool 4 axis offsets ;Dock present switches M950 J0 C"e0stop" ; Tool 0 Dock switch M950 J1 C"e1stop" ; Tool 1 Dock switch M950 J2 C"duex.e2stop" ; Tool 2 Dock switch M950 J3 C"duex.e3stop" ; Tool 3 Dock switch M950 S0 C"duex.pwm4" ;PebbleWiper Servo M950 P1 C"duex.pwm5" ;Light switch PWM ;Accelerometer M955 P0 C"spi.cs3+spi.cs4" ;M593 F78 ; Miscellaneous M98 P"/macros/Misc/Lights/On" M98 P"/sys/config-tools.g"
My initial idea would be some sort of issue with M400 maybe when actual movement happened before?
-
Any ideas? This seems like something goes horribly wrong...
-
@diamondback I've added this to my list to look at next week. I am running 3.4beta3 on my TC and homing is working, although I think I saw homing the coupler fail once.
-
@dc42 said in [3.4b3] Homing coupler does not work correctly:
@diamondback I've added this to my list to look at next week. I am running 3.4beta3 on my TC and homing is working, although I think I saw homing the coupler fail once.
Thank you. For me, this happens every time, so if you need me to validate something, easy to test for me.
-
Further info on this: Even with the homing of C as the very first part of homeall.g it doesn't always work. I've run into multiple homing failures already and only noticed when the toolhead crashed into the tool with a non-open coupler...
Can't tell any patterns yet... -
I can confirm after 3.4b3 improper homing of the c motor.
Additional info I haven't seen mentioned.
After a system reboot, it will work correctly on the first instance of running home all but subsequent homec or home all will move the c motor in the wrong direction.
for example in homec.g, the first instance calls for G1 H2 C-500 F5000 but appears to actually run G1 H2 C500 F5000 when observing the behavior.
to recreate, reboot ->homeall then either homec or home all will put the coupler in the wrong position.
It does appear that homeing the other axes are involved in this as after the first reboot homec works every time. -
@greenlee @Diamondback please check that the direction has not been changed like this:
- Reboot
- Send M569 P# where # is the driver number that the coupler is connected to and record the response, in particular the forwards/backwards direction
- Home the printer
- Send M569 P# again and check that the direction hasn't changed/
-
@dc42 said in [3.4b3] Homing coupler does not work correctly:
@greenlee @Diamondback please check that the direction has not been changed like this:
- Reboot
- Send M569 P# where # is the driver number that the coupler is connected to and record the response, in particular the forwards/backwards direction
- Home the printer
- Send M569 P# again and check that the direction hasn't changed/
The older line is right after booting, the later line is after homing.
Btw, it's not just turning in the wrong direction, it's also turning way less than being asked for (in addition to the wrong direction)(Above is with beta4)
-
@dc42 For what it's worth, my coupler is the only stepper using a different direction...
-
@diamondback please test the C motor using the following commands:
G91
G1 H2 C500
G1 H2 C-500Repeat the last two as necessary and check that the direction is different for the two commands. Obviously the initial move command one won't work if the coupler is against the stop and can't move in the commanded direction.
The other thing that may be changing between the first homing and subsequent homings is the motor current. Send M906 and M913 without parameters to check the current setting.
-
@dc42 said in [3.4b3+] Homing coupler does not work correctly:
@diamondback please test the C motor using the following commands:
G91
G1 H2 C500
G1 H2 C-500Repeat the last two as necessary and check that the direction is different for the two commands. Obviously the initial move command one won't work if the coupler is against the stop and can't move in the commanded direction.
The other thing that may be changing between the first homing and subsequent homings is the motor current. Send M906 and M913 without parameters to check the current setting.
The H2 move seems to work correctly, it correctly switches movement direction based on the sign.
Checking the motor current seems to not show anything wrong, they all report the same (and expected) values before and after homing failure.
-
I had a similar problem after updating from 3.3 to 3.4rc4.
This is what I ended up with, for reliable operation. It probably has excess M400s and other bits could be tweaked somewhat, but it works..
The G91/G90 messed things up, but the negative move also seemed to be a problem.
; homec.g ; called to home the C axis (coupler) ; ;G91 M400 G92 C499 M400 M913 C60 ; MOTOR TO 60% CURRENT G1 H1 C0 F2000 ; M400 G92 C0 ;G90 M913 C100 ;MOTOR TO 100% CURRENT G1 C0 F10000 ;Open Coupler M98 P"/macros/Coupler - Unlock"
-
@diamondback were you able to fix this having the same problem
-
This is what I have in my home couple script on a toolchanger running 3.3b5 (pre release)
; homec.g ; called to home the C axis (coupler) ;crashc G92 C350 M913 C40 ; C MOTOR TO 40% CURRENT G1 C-350 F5000 M913 C100 ; C MOTOR TO 100% CURRENT G1 C1 F5000 G92 C0 ;Open Coupler M98 P"/macros/Coupler - Unlock"
It worked on previous betas that I tested with this machine (not all were tested with this machine though).
If you are having issues and the steps outlined above don't help, can you confirm if the coupler works with 3.3?
-
@rpoltera said in [3.4b3+] Homing coupler does not work correctly:
@diamondback were you able to fix this having the same problem
No, the behavior is still the very same (3.3 works, 3.4 doesn't).
I did not have time yet to look into the ideas posted by @rjenkinsgb -
@diamondback this is what I have in homec.g:
; homec.g ; called to home the C axis (coupler) G91 M400 M913 C60 ; XY MOTORS TO 60% CURRENT G1 H2 C-1000 F10000 G92 C-125 G90 M913 C100 ; XY MOTORS TO 100% CURRENT G1 C0 F10000 ;Open Coupler M98 P"/macros/Coupler - Unlock"
-
@dc42 Mine looks like this:
; homec.g ; called to home the C axis (coupler) if sensors.gpIn[0].value = 0 || sensors.gpIn[1].value = 0 || sensors.gpIn[2].value = 0 || sensors.gpIn[3].value = 0 M291 S1 T5 P"Please return tool to dock before homing coupler" R"Can't home coupler" abort G91 M400 M913 C60 ; C MOTOR TO 60% CURRENT G1 H2 C-300 F10000 G92 C0 G90 M400 M913 C100 ; C MOTORS TO 100% CURRENT M98 P"/macros/Toolchanging/Coupler - Unlock" ; open coupler
You mentioned that you saw a couple of failed homes on your TC as well, what happened to that?
-
@dc42 Further info: It seems that if I home Z before C, it works correctly as it did with 3.3. So basically I home C last now and so far, that worked every time.
-
@dc42 Hm I'm starting to think that my issue might be related to this thread: https://forum.duet3d.com/topic/25647/3-4b4-and-3-4b5-issue-with-sensorless-homing
If my initial home move command aborted immediately because sensorless homing triggered, the whole behavior makes sense.
I looked at my config and sure enough, C is halfway configured with sensorless homing there:M574 C1 S3 ; Stall detect coupler at low end of its range ;Stall Detection ;M915 C S6 F0 H200 R0 ; Coupler
(more or less copied from your toolchanger config on github)
I'm not actually using stall detection, but just ram the coupler against its hard stop for some time as recommended.
Thoughts?
-
@diamondback try commenting out the M574 command for C, I also use the "ram the coupler against the hard stop" method on my tool changer. I set the current lower in my home C file during homing and then increase it back up at the end because I want to use more current when coupling the tools than when homing.