Homing X triggers before reaching endstop
-
Well one possible answer is that the X homing command simply isn't moving as far as you think it is going to move.
We need to see the actual homing code for X.
Also, have you verified that the X axis steps-per-mm setting is correct?
Frederick
-
@fcwilt The homing code for the X axis appears to be correct.
The working area of the machine is X1200Y2300 mm, and in the homing file, the G1 command for X is set to -1205 and Y -2305, which seems appropriate given the dimensions.Here is the relevant portion of the homing code for X:
G91 ; relative positioning G1 H2 Z10 F3000 ; lift Z relative to current position G1 H1 X-1205 F3000 ; move quickly to X axis endstop and stop there (first pass) G1 H2 X5 F3000 ; go back a few mm G1 H1 X-1205 F1500 ; move slowly to X axis endstop once more (second pass) G1 H2 Z-10 F3000 ; lower Z again G90 ; absolute positioning
Is it possible that the cable length (approx. 5 meters) is introducing additional resistance, making the controller interpret the switch as open?
Or could it be due to electrical noise from nearby signal or motor cables? -
@sebastianwac said in Homing X triggers before reaching endstop:
G91 ; relative positioning G1 H2 Z10 F3000 ; lift Z relative to current position G1 H1 X-1205 F3000 ; move quickly to X axis endstop and stop there (first pass) G1 H2 X5 F3000 ; go back a few mm G1 H1 X-1205 F1500 ; move slowly to X axis endstop once more (second pass) G1 H2 Z-10 F3000 ; lower Z again G90 ; absolute positioning
One small observation. The G1 H2 X5 F3000 command - you don't need H2 since the preceding G1 H1 X-1205 F3000 will have marked the X axis as homed and at the point plain G1 moves will work as expected.
Is it possible that the cable length (approx. 5 meters) is introducing additional resistance, making the controller interpret the switch as open?
Or could it be due to electrical noise from nearby signal or motor cables?5 meters is a lot. It could be picking up noise.
Is the wire twisted or shielded? Is the end-stop device a simple switch, like a micro-switch? Is it normally closed? Normally closed is the best as the signal wire is connected to ground, making it resistant to noise.
Frederick
-
Or could it be due to electrical noise from nearby signal or motor cables?
IMHO, that’s the most plausible scenario. To test, take another cable of similar length and route it as far away from any steppers and wiring harnesses as possible.
-
@sebastianwac said in Homing X triggers before reaching endstop:
Is it possible that the cable length (approx. 5 meters) is introducing additional resistance, making the controller interpret the switch as open?
Or could it be due to electrical noise from nearby signal or motor cables?Did you see my reply of 9 May?
-
Yes, the endstop wire is shielded, and the switch is a simple normally closed micro-switch, as recommended.
I’ve also noticed something very specific:
Right after powering on or resetting the controller, homing works perfectly — regardless of the axis position.
However, after performing an extrusion (extrude command), homing no longer works properly — the axes stop too early, as if the endstop had already been triggered.Could this behavior be caused by interference from the extruder motor?
The endstop wires are routed separately from the extruder motor cables, so they don't share the same path.Would it be possible to reset the extruder driver via G-code after each extrusion or print to prevent this issue?
-
@sebastianwac said in Homing X triggers before reaching endstop:
Would it be possible to reset the extruder driver via G-code after each extrusion or print to prevent this issue?
You could test with this. https://docs.duet3d.com/User_manual/Reference/Gcodes#m18-disable-motors
-
The endstop wires are routed separately from the extruder motor cables, so they don't share the same path.
Just for clarity - how exactly have you wired the X endstop? From my understanding, there are two lines:
- line 1 from Pin "io2.in" to endstop
- the other line from GND (where exactly do you take it from?) to endstop
Am I right with this assumption? Or do you supply 5V instead of GND? If so, where do you pick it up? Are any pull-up or pull-down resistors involved?
-
@infiniteloop
Endstop is wired to IN and GND pins of IO_2 connector.@Phaedrux
Thanks. I used M84 E0 at start of homing codes and it did the job. Now it is working correctly every time. -
@sebastianwac said in Homing X triggers before reaching endstop:
I used M84 E0 at start of homing codes and it did the job. Now it is working correctly every time.
That confirms that the issue was caused by interference between the extruder motor cable and the endstop cable. You said they are routed separately, but do they run parallel and close together for an appreciable distance?
Using shielded cable for endstop wires offers protection against capacitively coupled interference, but not against inductively coupled interference. You can defend against inductively coupled interference by using twisted pair cable. Preferably, the signal and ground wires of the endstop switch should be connected to the Duet using a single twisted pair; and the stepper motor should be connected to the Duet using two twisted pairs, each motor phase using one pair.