Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: rcaffin on November 24, 2014, 05:38:55 PM

Title: Can Mach run a macro when eStop is triggered?
Post by: rcaffin on November 24, 2014, 05:38:55 PM
I'm rebuilding the electronics on my CNC. S far so good, but I would love to add a safety feature.
When you hit Reset, the Init string is executed. This can include G-codes and M-codes.
Is it possible to have Mach execute a string when eStop is triggered?

To explain:
My CNC is a sort-of dual function machining centre. It has a good vertical milling head, but it also has a horizontal lathe chuck. The config is a bit like those small lathes with a mill/drill over the chuck, but somewhat more stable. Only one spindle can be used at a time of course.

Now, in the past, a changeover relay was used to select whether I was milling or turning. However, when an eStop was triggered with one spindle spinning, the C/O relay could drop out and spin the OTHER spindle for a moment, while the spindle power supply shut down. This was mildly exciting at times.

I have changed this to have use DP relays, with logic interlocks. To use the mill Mach energises the mill relay in the Init string. To use the lathe Mach energises the lathe relay. The sytem cannot energise both at once. All the same, I would love to have Mach release whichever relay was energised when an eStop happens. I do not want to kill the Charge Pump however: that causes too many hassles. So, can I define a string to be run when eStop is triggered?

(Yes, I could do this with external logic linked to the eStop line.)

Cheers
Roger