Machine warning lights (Red, Amber, Green)

More
06 Jan 2017 08:54 #85327 by rodw
I didn't think this would be sooo hard.

I have 3 warning lights on my Mesa 7i76e. I want them to act as follows.

1. When in Estop, red light turns on, all other lights off.
2. When power button is pressed (eg in Axis GUI), Amber light comes on signifying its idle
3. When running gcode, I want the amber light to go off and the green light to come on to say its making money!

And if it was at all possible
4. When program is paused, one of the lights (green or amber, prefer green) to flash.

So the red light is easy to do (iocontrol.0.user-enable-out), the green light is easy to do (halui.program.is-running). I've currently got amber working quite well on motion.motion-enabled but I can't turn it out when a program is running in HAL. I figured if I got desperate I could use a relay triggered by the green light output to drop power to the amber light. I thought I should be able to use some logic statements but after wasting hours, I gave up as I kept ending up where I started.

I can generate a flashing light with
net flash-on-a conv-float-s32.0.in <= siggen.0.square
net flash-on-b conv-s32-bit.0.in <= conv-float-s32.0.out
net flash-on <= conv-s32-bit.0.out => hm2_7i76e.0.7i76.0.0.output-02
Signal just needs a couple of conversions to get back to a bit.

The reason I want to do this is I've used some machines with a light mast on them with red, green and amber lights and they were so good as you could see at a glance across the room what was going on so I wanted to replicate that on my machine. It is confusing when green and amber come on together as traffic lights don't do that!

Any ideas would be appreciated.

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

More
06 Jan 2017 12:55 - 06 Jan 2017 13:11 #85335 by bevins
One rung in classic ladder should do the trick.

Program is running -not contact in series with the power button contact =====> amber light


So when the power is on the amber light is on when it runs a program, the contact shuts it off.
However when the program finishes, the Amber light should turn back on.

Attachments:
Last edit: 06 Jan 2017 13:11 by bevins.

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

More
06 Jan 2017 13:37 - 06 Jan 2017 13:52 #85336 by bevins
Or you can do it all in classic ladder something like this and just connect your outputs directly to your lights.

Attachments:
Last edit: 06 Jan 2017 13:52 by bevins.

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

More
06 Jan 2017 13:44 - 06 Jan 2017 14:43 #85338 by bevins
The only thing I dont know is when the program is running and you hit pause, I dont know if "program running" goes false. If it doesnt, then the flashing contact should be a NOT and goes in series instead of parrallel.

/EDIT - If the Program running switches state when the pause is true then the yellow light may turn on while the green light is flashing. If this behaviour is not ideal for you then a pause(not flashing) contact NOT should be placed in series with the amber light rung like the image shows below.

Attachments:
Last edit: 06 Jan 2017 14:43 by bevins.

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

More
06 Jan 2017 13:49 #85339 by bevins
I like this idea. I may have to do this on my ongoing retrofit....

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

More
06 Jan 2017 15:14 - 06 Jan 2017 15:17 #85342 by Todd Zuercher
If you are not already using ClassicLadder, and don't want to bother adding it, it can all be done in hal as well.

I think I'd attack this something like this.
loadrt and2 count=2
loadrt xor2 count=1
loadrt siggen num_chan=1
addf and2.0 servo-thread
addf and2.1 servo-thread
addf xor2.0 servo-thread
addf siggen.0.update servo-thread

setp siggen.0.frequency 2

#Yellow Light
net yellow-in1 <= halui.machine.is-on => and2.0.in0
net yellow-in2 <= halui.program.is-idle => and2.0.in1 
net yellow-out <= and2.0.out
net yellow-out => hm2_7i76e.0.7i76.0.0.output-01 #(or what ever your output pin is for the yellow light)

#Green Light
net green-in1 <= halui.program.is-running => xor2.0.in0
net green-in2 <= halui.program.is-paused => and2.1.in1
net flash <= siggen.0.clock => and2.1.in0
net green-flash <= and2.1.out => xor2.0.in1
net green-on <= xor2.0.out => hm2_7i76e.0.7i76.0.0.output-02

#Red Light
net red-on <= halui.estop.is-activated => hm2_7i76e.0.7i76.0.0.output-00 #(or what ever your output pin is for the red light)

(I just have a big red light on each of our machines that turns on when they are not running a program.)
Last edit: 06 Jan 2017 15:17 by Todd Zuercher.

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

More
06 Jan 2017 15:31 #85344 by rodw
Bevins thanks for your input. I was afraid somebody would suggest classic ladder. More to learn!
I think it would be very cool to implement this. If you Google stack light, there are heaps of options for the lights.

I am sure will be asking for help along the way so keep the drawings coming. When paused the green signal I referred to is turned off but there is another halui signal which I think is called halui.program.is-paused that is enabled.

The machines I referred to were output devices (you can't call a 5m long device that runs at 320 pages per minute a simple laser printer) and they took it a bit further as there was a user configurable timer on the yellow light. If you set it to 5 minutes, then if the machine was going to stop in the next 5 minutes the amber light would come on. You'd check the console and see what was ging to happen. Eg one of the 8 paper trays was going to run out so you could top it up with the required paper in another spare paper tray on the fly and it would keep going. I thought asking LCNC how long the current program would run might be a bit too much but wanted to implement the stack light idea.

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

More
06 Jan 2017 15:34 - 06 Jan 2017 15:37 #85346 by rodw
Todd, thanks, I would prefer to keep it all in hal. I seem to be doing a Tommy as its 1:30am here so I'll play in the morning. I did try hard along the lines you suggest.
Last edit: 06 Jan 2017 15:37 by rodw.
The following user(s) said Thank You: tommylight

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

More
06 Jan 2017 15:47 #85347 by bevins

Bevins thanks for your input. I was afraid somebody would suggest classic ladder. More to learn!
I think it would be very cool to implement this. If you Google stack light, there are heaps of options for the lights.

I am sure will be asking for help along the way so keep the drawings coming. When paused the green signal I referred to is turned off but there is another halui signal which I think is called halui.program.is-paused that is enabled.

The machines I referred to were output devices (you can't call a 5m long device that runs at 320 pages per minute a simple laser printer) and they took it a bit further as there was a user configurable timer on the yellow light. If you set it to 5 minutes, then if the machine was going to stop in the next 5 minutes the amber light would come on. You'd check the console and see what was ging to happen. Eg one of the 8 paper trays was going to run out so you could top it up with the required paper in another spare paper tray on the fly and it would keep going. I thought asking LCNC how long the current program would run might be a bit too much but wanted to implement the stack light idea.


Either way will would work. I think Classic Ladder is easier than doing it in HAL, but then again I dont fully understand the HAL, so the Ladder diagram is easier for me.

However, Classic Ladder is really easy if you understand the logic. Just load it in HAL, and create your ladder logic in the interface. You can acually see it running and how everything works without even wiring anything.

Thats why I love linuxcnc, nothing it cant do..... to a point...Limited on your knowledge of couse......lol

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

More
06 Jan 2017 16:15 #85349 by bevins

If you are not already using ClassicLadder, and don't want to bother adding it, it can all be done in hal as well.

I think I'd attack this something like this.
loadrt and2 count=2
loadrt xor2 count=1
loadrt siggen num_chan=1
addf and2.0 servo-thread
addf and2.1 servo-thread
addf xor2.0 servo-thread
addf siggen.0.update servo-thread

setp siggen.0.frequency 2

#Yellow Light
net yellow-in1 <= halui.machine.is-on => and2.0.in0
net yellow-in2 <= halui.program.is-idle => and2.0.in1 
net yellow-out <= and2.0.out
net yellow-out => hm2_7i76e.0.7i76.0.0.output-01 #(or what ever your output pin is for the yellow light)

#Green Light
net green-in1 <= halui.program.is-running => xor2.0.in0
net green-in2 <= halui.program.is-paused => and2.1.in1
net flash <= siggen.0.clock => and2.1.in0
net green-flash <= and2.1.out => xor2.0.in1
net green-on <= xor2.0.out => hm2_7i76e.0.7i76.0.0.output-02

#Red Light
net red-on <= halui.estop.is-activated => hm2_7i76e.0.7i76.0.0.output-00 #(or what ever your output pin is for the red light)

(I just have a big red light on each of our machines that turns on when they are not running a program.)


I think I understand this....... HAL hurts my head sometimes......lol

Do you know if the program-is-running stays true when it is paused? if so, will the program-is-paused override the program-is-running and flash the light?

I will check this in a bit and see...... I love this stuff.....

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

Time to create page: 0.407 seconds
Powered by Kunena Forum