Hello Guest it is April 26, 2024, 03:47:35 PM

Author Topic: Need help triggering feedhold with a driver alarm - Mach 4  (Read 811 times)

0 Members and 1 Guest are viewing this topic.

Need help triggering feedhold with a driver alarm - Mach 4
« 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!

Offline DazTheGas

*
  •  778 778
  • DazTheGas
    • View Profile
Re: Need help triggering feedhold with a driver alarm - Mach 4
« Reply #1 on: August 03, 2021, 05:09:20 AM »
Try using mc.mcCntlFeedHold(inst) after you have set your error

DazTheGas
New For 2022 - Instagram: dazthegas
Re: Need help triggering feedhold with a driver alarm - Mach 4
« Reply #2 on: August 03, 2021, 12:32:59 PM »
Code: [Select]
-------------
-- 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.
Re: Need help triggering feedhold with a driver alarm - Mach 4
« Reply #3 on: August 03, 2021, 03:43:04 PM »
i think PMC can be the best way
Re: Need help triggering feedhold with a driver alarm - Mach 4
« Reply #4 on: August 03, 2021, 09:14:04 PM »
Try using mc.mcCntlFeedHold(inst) after you have set your error

DazTheGas

This worked perfectly, thanks!
Re: Need help triggering feedhold with a driver alarm - Mach 4
« Reply #5 on: August 03, 2021, 09:18:22 PM »

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.