931
Mach4 General Discussion / Re: Mach 4 - Changing "Machine State"?
« on: January 03, 2022, 11:28:21 PM »
Hi,
jogging an axis and stopping on a Limit switch event is likely to fail.
Any event, like a Limit or Home switch, will be reported back to Mach but depending on your motion control board, and when the event
happened in its cycle the it may take 20-40 milliseconds to get back to Mach. By then the machine will have crashed.
Ordinarily Home, Limit and Probe events are handled by the motion controller because the motion controller can act on the event immediately, also
called realtime. In your case you have to wait for the motion control board to signal Mach....with some milliseconds delay, whereas what you want or
need is Mach to respond within a few microseconds...and that's just not going to happen.
For example the default cycle rate for an Ethernet SmoothStepper is 40Hz, or 25ms between data packets. Lets say your Limit switch activates at a time
t0, and your ESS is 1/2 way through its cycle, then it will report to Mach at t0 +12.5 ms.......and by then its probably to late.
Recall also that Mach issues trajectory data into a motion buffer. The default buffer length of the ESS is 180ms. Thus if you expect Mach to do something
quick you are going to be disappointed.
I have heard of people with good and modern PCs upping the cycle rate to 200Hz, and reducing the motion buffer to 20ms, but that still ends up with
delays of 0.5ms an 20ms respectively.
The only way for you to get this to work with any sort of accuracy is to have a REALLY SLOW JOG. Then it will not overrun too much before Mach gets to
hear about the Limit event and issue zero move trajectory data.
What is it that you are trying to do? Sounds like part way through a Gcode job you want to stop....jog to a Limit.....why?
Craig.
jogging an axis and stopping on a Limit switch event is likely to fail.
Any event, like a Limit or Home switch, will be reported back to Mach but depending on your motion control board, and when the event
happened in its cycle the it may take 20-40 milliseconds to get back to Mach. By then the machine will have crashed.
Ordinarily Home, Limit and Probe events are handled by the motion controller because the motion controller can act on the event immediately, also
called realtime. In your case you have to wait for the motion control board to signal Mach....with some milliseconds delay, whereas what you want or
need is Mach to respond within a few microseconds...and that's just not going to happen.
For example the default cycle rate for an Ethernet SmoothStepper is 40Hz, or 25ms between data packets. Lets say your Limit switch activates at a time
t0, and your ESS is 1/2 way through its cycle, then it will report to Mach at t0 +12.5 ms.......and by then its probably to late.
Recall also that Mach issues trajectory data into a motion buffer. The default buffer length of the ESS is 180ms. Thus if you expect Mach to do something
quick you are going to be disappointed.
I have heard of people with good and modern PCs upping the cycle rate to 200Hz, and reducing the motion buffer to 20ms, but that still ends up with
delays of 0.5ms an 20ms respectively.
The only way for you to get this to work with any sort of accuracy is to have a REALLY SLOW JOG. Then it will not overrun too much before Mach gets to
hear about the Limit event and issue zero move trajectory data.
What is it that you are trying to do? Sounds like part way through a Gcode job you want to stop....jog to a Limit.....why?
Craig.