Possible to have both high and low endstops for an axis?
-
Hi
Have built a CNC machine which has dual Nema23s on both X and Y axes, and a single Nema 23 on the Z. Am using a Duet 2 Wifi (2.0.2 firmware) to control the machine and it is working fine.
Do have a problem with endstops though, in that can only define an endstop as high or low, and hitting an endstop does not stop subsequent commands. Not an issue with FDM machines where endstops are used in homing to define 0,0,0 (always in the same place) and axis travel extents work because calculated and absolute positions are the same.
With CNC machines however, 0,0,0 is not fixed but is set based on a point on the stock. This means that depending on the axis minima and maxima defined in the config, it is possible to give the machine a move command that exceeds the amount of travel physically available.
For example, my machine has 500x500x120mm travel (XYZ). Minima and maxima are set to -500,-500,-120 and 500,500 and 120 respectively. If my stock 0,0,0 is at 250,250,60 (absolute bed position), I could send G0 X-300 F750 which is within the defined min max limits but which will crash the machine as it tries to travel to absolute -50 X.
Thought endstops would be the answer. As a test, wired two microswitches in parallel and put them on either end of the x axis, and added it to config file using M574. Stops X axis when either switch is triggered, which is fine, but problem is 1) Duet assumes has hit whichever endstop is defined in config (high or low) regardless of actual endstop triggered, and 2) does not stop but will carry on with next move command.
All of this leads to my question - is it possible within the firmware framework to have none, high, low and both options for endstops, the last option using direction of travel to figure out which endstop has been hit, and to have a StopOnEndstopHit flag which would halt further command processing?
Thanks in advance -
@p0rr1dg3 you can't as you say have both hi and low endstops. What you can do though is set them both up as triggers once you've homed the machine and then use that trigger to pause the machine
-
@jay_s_uk Thanks for that. Haven't gone particularly in depth into advanced Duet topics, so am not sure how I would go about setting endstops up as triggers. Any advice?
-
@p0rr1dg3 have a look at M581 https://docs.duet3d.com/en/User_manual/Reference/Gcodes#m581-configure-external-trigger
you'll probably also want to run segmentation to speed up pausing e.g.M669 S1 T1
-
@p0rr1dg3 said in Possible to have both high and low endstops for an axis?:
@jay_s_uk Thanks for that. Haven't gone particularly in depth into advanced Duet topics, so am not sure how I would go about setting endstops up as triggers. Any advice?
https://docs.duet3d.com/User_manual/Reference/Gcodes#m581-configure-external-trigger
A practical example of a Z max switch as I have on my machine is as follows
M950 J3 C"^1.io5.in" ; exp board1 io 3, Z Max M581 P3 T0 R0 S0 ; Do emergency stop (T0), any time (R0).
Edit: Jay beat me too it as I was typing
-
@jay_s_uk and @deckingman, will have a look at M581 and M669 commands. Both of your help and suggestions much appreciated
-
@p0rr1dg3 I have an Ooznest Workbee CNC. It is configured with soft limits which prevent the machine from moving outside the machine limits.
What version of Duet Web Control are you using?
In CNC mode, we have machine coordinates (the actual physical limits of the CNC) and work coordinates, which are job specific.
When you set your X0 Y0 and Z0 they fall within the machine coordinates and you will get an error notification when the machine is given a command to move out of bounds.
Your work coordinates CANNOT exceed your machine coordinates limits.Edit
I see you're using very old firmware. Please upgrade to the latest stable firmware and your issues will be solved.