Multiple Alarm Inputs Hal help needed

More
13 Sep 2016 15:24 #80405 by OT-CNC
To complicate things, I now have my VFD alarm , servo drive alarm, low air pressure and low oil alarm signals physically wired to my meas hardware. I have the physical pins configured correctly as I can see the status leds change yellow/brown. I was able to configure hal to read the vfd alarm and stop motion. So that is working. When I try to add the additional signals, my hal errors out. I looked at Motion and Hal Net docs and fail miserably trying to make this work. Can someone type up an example of the proper syntax for the multiple signals connected to hal pin motion.enable? Or other currently used component that stops motion and spindle.

Please Log in or Create an account to join the conversation.

More
13 Sep 2016 15:33 #80407 by BigJohnT
The best place to start is understanding the net command.
linuxcnc.org/docs/2.7/html/hal/basic-hal.html#_net

Hint or2 is a simple way to have two inputs act on one signal.
linuxcnc.org/docs/2.7/html/man/man9/or2.9.html

JT

Please Log in or Create an account to join the conversation.

More
13 Sep 2016 15:46 - 13 Sep 2016 15:46 #80408 by OT-CNC
JT

Thanks for the links but I have trouble with the basics obviously. I need a more copy/paste example.
I'm not trying to be lazy, I'm just getting frustrated at myself for not catching on fast enough....
Last edit: 13 Sep 2016 15:46 by OT-CNC. Reason: sp

Please Log in or Create an account to join the conversation.

More
13 Sep 2016 16:08 #80409 by BigJohnT
The net command is very simple is there some part of it you can't grasp? The diagram should be clear (I hope).

JT

Please Log in or Create an account to join the conversation.

More
13 Sep 2016 16:39 - 13 Sep 2016 16:44 #80410 by Todd Zuercher
The first thing about HAL that you need to remember is that a Hal pins (such as motion.enable) can only be connected to 1 signal (what you create with your "net" command.) Also and eually important is that each hal signal you create can only have one out put (but can connect to several inputs).

So right now you have a signal connecting your VFD alarm connected directly to motion.enable. That works great for just that one signal. To connect more than one signal to motion.enable, you have to use an "or2" or some other hal logic component.
example:
net vfda => or2.0.in1 <= (output pin of your VFD alarm)
net servoa => or2.0.in2 <= (output of your Servo alarm)
net enable => motion.enable <= or.0.out

don't forget you also have to loadrt the or2 component and addf it to a thread (usually the servo thread).

However there are other ways for a hal bit to stop motion, and or set alarms than just using motion.enable. Such as for example axis.N.amp-fault-in, is intended for being connected to a servo fault alarm signal, or iocontrol.0.lube_level is intended for a low lube level signal. Some of the less critical ones you might consider motion.feed-inhibit instead of motion.enable.

You might also want to consider using linuxcnc.org/docs/html/man/man9/message.9.html to give your user an explanation of why the machine may have stopped and or turned off.
Last edit: 13 Sep 2016 16:44 by Todd Zuercher.

Please Log in or Create an account to join the conversation.

More
13 Sep 2016 17:47 #80413 by OT-CNC
Thanks for the explanations. I kept trying to connect multiple signals to 1 hal pin. I will try to connect to existing Hal pins instead such as. axis.N.amp-fault-in. Checking Motion.9 manual, I don't see anything pre-existing for the VFD fault or spindle fault? Does one exist already?
Thanks for the link to the messages as that was going to be my next question.
Out of curiosity, how is iocontrol.0.lube_level handled if the fault clears? Say, if I run low on way oil, machine pauses, displays alrm message, I fill up the reservoir, fault status changes and what happens? Hit resume button and motion continues?
If I connect to these existing hal pins, is their behavior already internally determined by linuxcnc or do I need to link them further such as to motion.feed-inhibit?

Please Log in or Create an account to join the conversation.

More
13 Sep 2016 18:01 #80415 by BigJohnT
There is motion.spindle-inhibit IN BIT When TRUE, the spindle speed is set and held to 0.

Having never used those pins I don't know what they do, but interesting to find out in a sim perhaps.

JT

Please Log in or Create an account to join the conversation.

More
13 Sep 2016 18:51 #80417 by Todd Zuercher
The spindle inhibit just prevents the spindle from starting.

No there isn't a fault pin in specifically for the spindle (something I've lamented about before), so you'll need to press something else into service for that. One option could be to add a dummy [AXIS_N] heading to your ini file, and then use the amp fault in for that. All you need to do (if you have a 3 axis machine) would be to add a line [AXIS_3] and nothing else to your ini file, then Motion will make all the axis.3. pins available.

Please Log in or Create an account to join the conversation.

More
14 Sep 2016 01:17 - 14 Sep 2016 01:17 #80423 by OT-CNC
Okay I learned something today :cheer:
The missing thing for me was giving the signal a name. I thought net iocontrol.0.lube_level hm2_5i25.0.7i84.0.0.input-06-not would work but obviously not as I needed to connect a signal to the source:
net low-oil-alarm iocontrol.0.lube_level <= hm2_5i25.0.7i84.0.0.input-06-not
The above works. Correct me please if I'm still getting the syntax wrong.

net Z-Servo-Alarm axis.2.amp-fault-in <= hm2_5i25.0.7i84.0.0.input-10
The drive fault signal opens the drive contactors as I have them wired to the estop circuit and machine enable and kills power to the spindle and servos. This seems to work however it takes a few seconds to register a fault after pulling the encoder connector on my DMM drives. maybe this is okay for backup safety.
What's nice is the drive alarm message comes up.

Yes, a spindle fault pin would be nice as well as an io for low air pressure.
Last edit: 14 Sep 2016 01:17 by OT-CNC. Reason: sp

Please Log in or Create an account to join the conversation.

More
08 Jan 2017 01:45 #85444 by bevins

Okay I learned something today :cheer:
The missing thing for me was giving the signal a name. I thought net iocontrol.0.lube_level hm2_5i25.0.7i84.0.0.input-06-not would work but obviously not as I needed to connect a signal to the source:
net low-oil-alarm iocontrol.0.lube_level <= hm2_5i25.0.7i84.0.0.input-06-not
The above works. Correct me please if I'm still getting the syntax wrong.

net Z-Servo-Alarm axis.2.amp-fault-in <= hm2_5i25.0.7i84.0.0.input-10
The drive fault signal opens the drive contactors as I have them wired to the estop circuit and machine enable and kills power to the spindle and servos. This seems to work however it takes a few seconds to register a fault after pulling the encoder connector on my DMM drives. maybe this is okay for backup safety.
What's nice is the drive alarm message comes up.

Yes, a spindle fault pin would be nice as well as an io for low air pressure.


I would vote for a Low Vacuum io also.

Please Log in or Create an account to join the conversation.

Time to create page: 0.081 seconds
Powered by Kunena Forum