Independent X axis homing fails - one side overshooting
-
Hello everyone,
I'm building and commissioning a large wall-mounted plotter and am having some trouble getting the X-axis to home properly.
Background info
Here's a photo for some context: https://www.dropbox.com/scl/fi/sz3vvjem5lfj9oh27qymf/IMG_7640.jpg?rlkey=ety6ned3zbdai1smagn2k973i&dl=0The gantry is 6m long and 4m high.
The X and Y axes are driven by clearpath SD servo motors and so far they have been working well. The carriages are belt driven from the servos directly (no gear boxes).
Drives are being run from a Duet 3 Mainboard 6XD
M115 FIRMWARE_NAME: RepRapFirmware for Duet 3 MB6XD FIRMWARE_VERSION: 3.4.6 ELECTRONICS: Duet 3 MB6XD v1.01 or later FIRMWARE_DATE: 2023-07-21 14:11:58 Duet Web Control 3.4.6
The X-axis has a motor on both sides X-top and X-bot(tom)
There are inductive end stop switches set up for all axes, the Y axis homes without issue so I'm fairly sure their configuration is correct/wiring is working.
Issue
When homing the dual motor axis using both end stops while both the inductive sensors fire (their built-in LEDs come on) duet continues to drive the top motor and the Y gantry starts to twist/become skewed and the only recovery is to e-stop the machine.As the gantry starts to skew, one of the motors errors out as it goes over its torque limit - is there a way to have any drive error stop all other drives?
While getting things set up, I connected the I/O pins for these end stops to some flying wires so I could manually simulate the home switches going off and this would stop both motors correctly. In this setup, I tied the I/O pins together so I would only need to short one pin to ground to get both of them to fire at the same time.
Now that the real sensors are connected (and that they are far apart) it is difficult to do a simulated trigger like this.
Do you have any advice as to how to go about debugging this issue?
Investigations to date
Currently, the 'most working' version of things uses a one of the inductive switches to stop the homing procedure - we square the Y gantry by hand and hope it doesn't go out of plumb (not ideal).
Here's the relevant config files:
config.g; Configuration file for Duet 3 MB 6XD (firmware version 3.3) ; executed by the firmware on start-up ; ; generated by RepRapFirmware Configuration Tool v3.3.16 on Fri Sep 15 2023 20:09:09 GMT+0100 (British Summer Time) ; Edited by DJ - 20230917 ; General preferences G90 ; send absolute coordinates... M83 ; ...but relative extruder moves M550 P"name" ; set printer name ; Wait a moment for the CAN expansion boards to start G4 S2 ; Network M552 P192.168.1.200 S1 ; enable network and set IP address M553 P255.255.255.0 ; set netmask M554 P192.168.1.254 ; set gateway - we don't always know what the gateway will be, how do we do DHCP with a static fallback? M586 P0 S1 ; enable HTTP M586 P1 S1 ; enable FTP M586 P2 S0 ; disable Telnet ; Drives M569 P0.0 S1 T3:3:3:3 ; physical drive 0.0 goes forwards - Xbot - set Minimum driver step pulse width, step pulse interval, direction setup time and direction hold time, in microseconds - driver is active low (default) M569 P0.1 S1 T3:3:3:3 ; physical drive 0.1 goes forwards - Xtop - set Minimum driver step pulse width, step pulse interval, direction setup time and direction hold time, in microseconds - driver is active low (default) M569 P0.2 S0 T3:3:3:3 ; physical drive 0.2 goes backwards (zero at bottom) - Y - set Minimum driver step pulse width, step pulse interval, direction setup time and direction hold time, in microseconds - driver is active low (default) M569 P121.0 S1 ; physical drive 121.0 goes forwards - Z M569 P122.0 S1 ; physical drive 122.0 goes forwards - Extruder M584 X0.0:0.1 Y0.2 Z121.0 E122.0 ; set drive mapping Xbot MB0-Driver0, Xtop MB0-Driver1, Y MB0-Driver2, Z TB121-Driver0, Extruder TB122-Driver0 M92 X40.00 Y40.00 Z400.00 E420.00 ; set steps per mm (max 52 steps/mm at 8000 counts/rev on clearpath) ; Steps per mm calculator https://blog.prusa3d.com/calculator_3416/ M566 X900.00 Y900.00 Z60.00 E120.00 ; set maximum instantaneous speed changes (mm/min) M203 X30000.00 Y30000.00 Z1800.00 E1200.00 ; set maximum speeds (mm/min) M201 X600.00 Y600.00 Z200.00 E250.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 ; Axis Limits M208 X0 Y0 Z0 S1 ; set axis minima M208 X5000 Y3600 Z150 S0 ; set axis maxima ; Endstops M574 X1 S1 P"!^io0.in" ; configure switch-type (e.g. microswitch) endstop for low end on Xbot via pin !^io0.in only M574 Y1 S1 P"!^io2.in" ; configure switch-type (e.g. microswitch) endstop for low end on Y via pin !^io2.in M574 Z1 S1 P"!^121.io2.in" ; configure switch-type (e.g. microswitch) endstop for low end on Z via pin !^121.io2.in ; Z-Probe M558 P1 C"121.io0.in" H5 F120 T6000 ; set Z probe type to unmodulated and the dive height + speeds G31 P500 X0 Y0 Z2.5 ; set Z probe trigger value, offset and trigger height M557 X15:4500 Y15:3500 S100 ; define mesh grid ; Heaters M140 H1 ; disable heated bed ; Fans M950 F0 C"121.out2" Q500 ; create fan 0 on pin 121.out2 and set its frequency M106 P0 S0 H-1 ; set fan 0 value. Thermostatic control is turned off M950 F1 C"122.out2" Q500 ; create fan 1 on pin 122.out2 and set its frequency M106 P1 S1 H-1 ; set fan 1 value. Thermostatic control is turned off ; Tools M563 P0 S"Brush" D0 F0 ; define tool 0, no H here means no heater. D0 = extruder 0, F0 = fan 0 G10 P0 X5 Y10 Z20 ; set tool 0 axis offsets G10 P0 R0 S0 ; set initial tool 0 active and standby temperatures to 0C ; Custom settings are not defined ;M301 P1 ; disable heaters so we don't have an error ;M562 P1 ; reset the heater error - feels like a hack; doesn't seem to work here - maybe it has to go at the top of the job file? ; Miscellaneous T0 ; select first tool M17 ; enable all axes ( holds Y in place without brake) - this needs to change when the brake connects to the IO pin
homex.g
; homex.g ; called to home the X axis ; ; generated by RepRapFirmware Configuration Tool v3.3.16 on Fri Sep 15 2023 20:09:09 GMT+0100 (British Summer Time) G91 ; relative positioning G1 H2 Z5 F6000 ; lift Z relative to current position G1 H1 X-5005 F1800 ; move quickly to X axis endstop and stop there (first pass) G1 H2 X10 F6000 ; go back a few mm G1 H1 X-5005 F360 ; move slowly to X axis endstop once more (second pass) G1 H2 Z-5 F6000 ; lower Z again G90 ; absolute positioning
Earlier when testing, both end stops were used for homing (connected to flying leads on the bench):
config.g snippet
... ; Endstops M574 X1 S1 P"!^io0.in+!^io1.in" ; configure switch-type (e.g. microswitch) endstop for low end on Xbot via pin !^io0.in AND endstop for low end on Xtop via pin !^io1.in M574 Y1 S1 P"!^io2.in" ; configure switch-type (e.g. microswitch) endstop for low end on Y via pin !^io2.in M574 Z1 S1 P"!^121.io2.in" ; configure switch-type (e.g. microswitch) endstop for low end on Z via pin !^121.io2.in ...
homex.g
; homex.g ; called to home the X axis ; ; generated by RepRapFirmware Configuration Tool v3.3.16 on Fri Sep 15 2023 20:09:09 GMT+0100 (British Summer Time) G91 ; relative positioning G1 H2 Z5 F6000 ; lift Z relative to current position G1 H1 X-5005 F1800 ; move quickly to X axis endstop and stop there (first pass) G1 H2 X10 F6000 ; go back a few mm G1 H1 X-5005 F360 ; move slowly to X axis endstop once more (second pass) G1 H2 Z-5 F6000 ; lower Z again G90 ; absolute positioning
This worked on the bench but overshoots the top x rail on the real machine.
I also tried doing a split axis homing using RR2 style commands using the following config:
config.g snippet
... ; Endstops M574 X1 S1 P"!^io0.in" ; configure switch-type (e.g. microswitch) endstop for low end on Xbot via pin !^io0.in M574 U1 S1 P"!^io1.in" ; configure switch-type (e.g. microswitch) endstop for low end on Xtop via pin !^io1.in - U axis is a temporay axis used only during homing M574 Y1 S1 P"!^io2.in" ; configure switch-type (e.g. microswitch) endstop for low end on Y via pin !^io2.in M574 Z1 S1 P"!^121.io2.in" ; configure switch-type (e.g. microswitch) endstop for low end on Z via pin !^121.io2.in ...
homex.g
; homex.g ; called to home the X axis ; ; generated by RepRapFirmware Configuration Tool v3.3.16 on Fri Sep 15 2023 20:09:09 GMT+0100 (British Summer Time) G91 ; relative positioning G1 H2 Z5 F6000 ; lift Z relative to current position M584 X0.0 U0.1 ; Split X axis motors G1 H1 X500 U500 F1800 ; move quickly to Y axis endstop and stop there (first pass) G1 X-5 U-5 F6000 ; go back a few mm G1 H1 X25 U25 F360 ; move slowly to Y axis endstop once more (second pass) G1 H2 Z-5 F6000 ; lower Z again G90 ; absolute positioning M584 X0.0:0.1 ; Combine X-Axis
but this fails before the motors move - Duet reports an error :
G28 U Error: Failed to enable endstops
where axis U is really Xtop.
Questions
Do you see anything wrong with the configuration
Are there any other tests I can run to narrow down what the issue might be
Is there an issue here with my mapping of Xbot=0, Xtop=1, and Y=2 motors as it doesn't match the default - from what I've read this shouldn't be an issue as the values are being explicitly set
Does dual motor dual endstop homing still need the RR2 style split in homex.g or not?Any advice you can provide or guidance would be much appreciated - if there's any other details you need please do let me know,
Ciao!
Dev -
You should only use a split X / U axis for homing if you want to do skew correction and the endstops are fixed.
Instead use the combined endstops.
M574 X1 S1 P"!^io0.in+!^io1.in"
Also make sure that the order of the endstops matches the order of the motors in
M584 X0.0:0.1
If the order doesn't match you could see the problem you're experiencing. -
Hey @Phaedrux - thanks for your reply.
I'll set that up and test it against the machine when I'm back at the workshop.
I've checked the order of the end stops vs motors in their respective set up lines and they do match.
It would be good to be able to conduct a self-squaring when homing - the length of the Y axis means it does walk out of alignment over time and I do have fixed endstops. Can you advise as to how to get that working. My attempted configuration failed and I'm not sure what I got wrong.
-
@mynameisdev said in Independent X axis homing fails - one side overshooting:
I do have fixed endstops
If the endstops are fixed and you have no control over the trigger position you would need to use the split axis option. X/U so that each motor can move independently to the endstop and then make an adjustment move to return to square. You still need a way to determine what square is though so you know how much to adjust.
This page gives details on both options. It's geared towards the Z axis, but the principles are the same.
https://docs.duet3d.com/en/User_manual/Connecting_hardware/Z_probe_auto_levelling
If you're still having some issues can you capture a video of the homing process in action so we can see what's happening?
-
@Phaedrux I flipped the order of the switches in my config and now everything works just fine. The overshooting was a result of the sensor stopping the 'wrong' motor and then the other one never reaching a place it could trigger its end stop.
I am confused though - If this is my motor config:
M584 X0.0:0.1 Y0.2 Z121.0 E122.0 ; set drive mapping Xbot MB0-Driver0, Xtop MB0-Driver1, Y MB0-Driver2, Z TB121-Driver0, Extruder TB122-Driver0
The X motors are ordered 0 - 1
Then in my end stop config - this works:
M574 X1 S1 P"!^io1.in+!^io0.in"
and this didn't:
M574 X1 S1 P"!^io0.in+!^io1.in"
Which seems backward to me.
I know the sensors are not connected the wrong way - this week I've been running with only io.0.in connected in single end stop mode and the machine was homing correctly.
Can you explain how I got this muddled up?
Thanks again for your help!
D -
the io1 and io0 order needs to match the physical wiring connection, not just the motor order in m584.