Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: blurrycustoms on October 29, 2008, 01:15:20 AM

Title: Outputs for Status Lights
Post by: blurrycustoms on October 29, 2008, 01:15:20 AM
I was wondering if someone could point me in the right direction.

I am trying to build a status light system with leds, but I am unsure of how to configure mach for this.  I have 2 free output pins (16 and 17).  I want the light bar to show green when mach is in a normal and running state, and I want it to show red when mach is in emergency mode.

Can anyone help me out here?
Title: Re: Outputs for Status Lights
Post by: Hood on October 29, 2008, 04:35:00 AM
Should be simple enough to do with a Brain. Not tried it but would think if you looked at the Run LED then passed the signal to an output that would activate one LED. For the opposite state you would just invert the signal to another output similar to the screenshot.
Hood
Title: Re: Outputs for Status Lights
Post by: blurrycustoms on October 29, 2008, 12:02:52 PM
Thanks for that.  I can get it to output when it is running, but when I hit the e-stop button, I don't get anything.  Does the e-stop disable all outputs?  It must. so is there an alternative to using an output?
Title: Re: Outputs for Status Lights
Post by: Chaoticone on October 29, 2008, 12:22:10 PM
Could you not have Mach holding it in what it thinks is an on state when reset is inactive?

Brett
Title: Re: Outputs for Status Lights
Post by: Hood on October 29, 2008, 12:29:21 PM
Ah ok thought you just wanted it when no code was running. So what exactly are you wanting? Is the LED to be Green when Mach is not in reset and Red when it is? Or are you wanting it Green only when running code and Red at all other times?
Hood
Title: Re: Outputs for Status Lights
Post by: blurrycustoms on October 29, 2008, 12:31:40 PM
I need Green lights when mach is not in reset (basically when the mach is on in normal mode)  and then red lights when mach is in reset.
Title: Re: Outputs for Status Lights
Post by: Hood on October 29, 2008, 12:34:23 PM
OK so then maybe setting the LED with a relay, you could then look at the E-Stop LED to switch the relay, NC side is for Red LED,  NO side for Green and then one output would control both states.

Hood
Title: Re: Outputs for Status Lights
Post by: Chaoticone on October 29, 2008, 12:36:58 PM
What are the lights? Beacon lights? Physical lights attached to Mach? Could you not use a relay? The output from Mach will be on unless in e-stop. It will be holding a relay in. When power is removed or mach is in reset it will drop the output and relax the relay fireing the red light (the other set of contacts on the relay).

Brett
Title: Re: Outputs for Status Lights
Post by: blurrycustoms on October 29, 2008, 12:37:08 PM
that's a good idea.  but still curious.  does mach disable all outputs when in reset mode?
Title: Re: Outputs for Status Lights
Post by: Hood on October 29, 2008, 12:41:41 PM
certainly seems that way although the enables must work so you could use them.
Hood
Title: Re: Outputs for Status Lights
Post by: blurrycustoms on October 29, 2008, 12:56:53 PM
I can't even get the enables to work by passing the ESTOP LED to enable 6
Title: Re: Outputs for Status Lights
Post by: blurrycustoms on October 29, 2008, 01:03:24 PM
Wait a minute.  I see a problem.  When I hit the reset button in mach (not an actual e-stop switch) the text to the right says that the estop button is pressed, however, in the diagnostic screen the emergency led does not light up.  I thought that pressing the reset button in mach, had the exact same effect as hitting a physical e-stop button.  Apparently not, any ideas on how to make that true?
Title: Re: Outputs for Status Lights
Post by: Hood on October 29, 2008, 02:15:14 PM
I think the standard screenset is wrong, my screen has the E-Stop LED flashing when in ReSet.
 OK will go look at a Brain and see what options there are, a relay would work but hopefully a brain could do that as well.
Hood
Title: Re: Outputs for Status Lights
Post by: Hood on October 29, 2008, 02:34:06 PM
I am wondering, did you actually set the outputs/enables up in ports and pins and monitor them with a meter? I know for a fact that the Enable definitely can output when Mach is in reset as that is how my drives enable. Unfortunately I cant test here as neither of the computers in the house have parallel ports.
Hood
Title: Re: Outputs for Status Lights
Post by: blurrycustoms on October 29, 2008, 02:37:08 PM
I've just been monitoring it on the Mach diagnostics screen.  I will try a physical test as soon as I can.
Title: Re: Outputs for Status Lights
Post by: Hood on October 29, 2008, 05:14:44 PM
OK, let us know please as it may help someone else. If I get a chance (and if I remember ) I will test it out but working away from the workshop tomorrow so it will be Friday at the earliest.
Hood
Title: Re: Outputs for Status Lights
Post by: blurrycustoms on November 01, 2008, 05:08:54 PM
Okay, its still a no go with the brain.  The green lights are no problem, working perfectly, but when mach is in emergency mode I cannot get it to output an led signal through outputs or enables.  However, when I am in emergency mode, and I hit reset, I get two blinks from the leds.  For some reason, mach does not output an led when in emergency mode.  I'm wondering what other variables are enabled whe mach is only in emergency mode?

Anybody?
Title: Re: Outputs for Status Lights
Post by: blurrycustoms on November 01, 2008, 05:23:04 PM
Alright so here is what I did to have the red lights on only in emergency mode!!

Set whichever pin you are using (mine was 17) to Active low.

Create a brain as follows:

Normal On (LED) --> Invert flip signal -------------------------------------> Output/Enable (whichever you have associated with you pin)


I don't know why the estop led doesn't work, but i tried a bunch of different ways.  The above configuration has red leds off when mach is in normal mode, and red leds on when mach is in emergency mode.

I also have the brain set up to turn green leds on in normal mode and off in emergency mode.


Hope this helps anyone that needs it!