Machsupport Forum
Mach Discussion => Mach4 General Discussion => Topic started by: Ewalk02 on August 02, 2021, 08:45:56 PM
-
I have hybrid stepper motors on my plasma table and I would like the alarm function to trigger a feed hold in Mach 4. I have tried numerous different times to write the code myself (more like copying others code) but I can't get it to work. Right now I have the code where it reads the pin when the state changes and it sends an error message but I can't get it to trigger a feed hold no matter what I try. Any help would be appreciated.
Code so far:
[mc.ISIG_INPUT0] = function (state) -- X Axis
mc.mcCntlSetLastError(inst, "X Axis driver ALARM - STOPPING")
end,
Thanks!
-
Try using mc.mcCntlFeedHold(inst) after you have set your error
DazTheGas
-
-------------
-- Axis driver Alarms
-- Each motor driver has an alarm line that goes high
-- if ********* goes south
-- Stop machine and recover using external reset switches
[mc.ISIG_INPUT9] = function (state) -- X Axis
mc.mcCntlSetLastError(inst, "X Axis driver ALARM - STOPPING")
eStop()
end,
[mc.ISIG_INPUT10] = function (state) -- Z axis
mc.mcCntlSetLastError(inst, "Z Axis driver ALARM - STOPPING")
eStop()
end,
I wouldn't feed hold - I'd eStop.
Driver alarm means "I tried to get to the commanded move point but didn't get there" so you have lost positioning and something is very wrong.
That's a "shut everything off NOW" situation.
-
i think PMC can be the best way
-
Try using mc.mcCntlFeedHold(inst) after you have set your error
DazTheGas
This worked perfectly, thanks!
-
I wouldn't feed hold - I'd eStop.
Driver alarm means "I tried to get to the commanded move point but didn't get there" so you have lost positioning and something is very wrong.
That's a "shut everything off NOW" situation.
I wouldn't feed hold - I'd eStop.
Driver alarm means "I tried to get to the commanded move point but didn't get there" so you have lost positioning and something is very wrong.
That's a "shut everything off NOW" situation.
[/quote]
I thought about estop but since it's a plasma table I'm not too worried about a few lost steps, I wanted to be able to start back up if things were still close. I have limit switches on both sides of all the axis and a magnetic torch head so I doubt I could crash it too bad. I'll probably eat those words one day but for now it makes sense in my head.