Multiple endstops per axes (High end and Low end)
-
I am using a Duet 2 Wifi + Duex 5 on a CoreXY printer from SecKit Designs (The SecKit SK-Tank) and I noticed that the linear rail positioning and frame size make it so that carriage block reaches the end of the rail at the max range of the Z axis. Normally, I would program the max coordinates in RRF configuration to prevent the axes from going over, but when the printer is shut down and started up with the bed at a random position, the homing sequence moves the Z axis before homing the X and Y. This can cause the carriage blocks to dislodge from the rail if the Z axis is close to max position before the homing sequence starts.
In order to mitigate this, I was wondering if we could program and set up an endstop for Z max as well so that motion on the Z axis stops if the Z max end stop is triggered. I have extra endstop channels in the Duex 5, so was wondering how I would set up my config file for this.
Any help would be appreciated.
Thank you.
-
@theindiandude Yes that can be done - in fact I used to do exactly that on my CoreXY when I had Duet 2 with a Duex5.
As you have rightly surmised, the firmware has no idea where the axes are positioned until they have been homed. The other thing of note is that axis end stops are normally only checked during homing moves, so it would be possible to "nudge" any axis outside of it's normal maximum travel position using the web interface prior to homing.
So the way to do it is to to wire a switch to a spare end stop and set up an external trigger using M581. https://duet3d.dozuki.com/Wiki/M581
Looking back through my old configuration files, this is what I used to have
M581 E4 S1 T0 C0The E4 is the end stop that the switch was wired too, S1 means trigger on a rising edge, T0 will do an emergency stop like M112 and C0 means that the trigger should be acted on at any time.
I took it a step further to include all axes, not just a single axis. The easiest way to do that is to use normally closed switches on the maximum position of every axis and wire then in series. Then if any one switch becomes open, it will trigger. That way you only need to use a single end stop and a single trigger to "protect" all axes.
-
@deckingman thanks for the info! This is certainly a step in the right direction for me. However, instead of an emergency stop when the max limits are triggered, I want the axis that triggered the max limit to just stop moving and continue with the rest of the Gcode. The only situation where this will be a concern for me is while homing the axes. So if Z max is triggered, the Z axis should stop, the printer should continue homing X and Y and then home Z. My X and Y axes don't have the issue of max limits being triggered because the frame is designed in a way that encapsulates the end of the linear rails for these axes and the carriage blocks cannot dislodge from them.
I'll look into the different trigger config options on the M581 command and experiment with them.
Thanks a bunch!
-
@theindiandude Look at M18 and M84 which you can do to disable one motor/axis. Put this command in a trigger macro (e.g. trigger2.g) and save that macro to the /sys folder. Then in your M581 use T2 instead of T0 and that will call the macro "trigger2.g" which will in turn run M18 Z (or whatever command(s) you decide to use).