PDA

View Full Version : Wiring up the Alarm output on Leadshine AM882



Shinobiwan
06-01-2013, 06:13 AM
Hey folks,

I'm wanting to double check I've got this right before wiring it up.

The AM882 has an alarm signal output that triggers when the driver goes into a fault state. The object here is I want that signal to be picked up on one of the BOB inputs so Mach can trigger an estop and halt the other drivers.

Here's the an image of what Leadshine suggests in the manual.

7875

And here's a crude wiring drawing that I've knocked up to stick on the inside of the control box for quick reference (please ignore the extra details such as the relays and stepper wiring)

7876

Will that work?

John S
06-01-2013, 03:05 PM
Loose the brown link wire to alarm.
you are feeding it V+ from this and then to ground. when it triggers it will be a dead short.
You want e stop to go to one alarm terminal then to ground.

Basically alarm is in series with the estop

Shinobiwan
06-01-2013, 03:37 PM
Thanks John.

Not sure I completely understand but had a go at updating.

Is this what you were getting at?

It should be noted that the Alarm+ outputs 30v 100mA and Alarm- is 0v so I don't think I've done this right.

John S
06-01-2013, 06:56 PM
It should be noted that the Alarm+ outputs 30v 100mA and Alarm- is 0v so I don't think I've done this right.


In which case feed the E Stop circuit through a set of relay NC contacts and the alarm + and - to that relay coil.

Connect all 3 drivers to the same coil and then it doesn't matter which one trips.
Driver alarms, switches the relay and breaks the E Stop. - Simples.

m_c
06-01-2013, 09:43 PM
The alarm terminals don't output any power. It's an open collector output capable of switching 100mA at 30V.

So you still need a relay as per John's suggestion to connect into to the Estop circuit, but you need to provide the power to the relay, then connect the relay to ground via the alarm terminals. You could also have the relay in circuit after the alarm terminals, but it's usually better practice to switch the ground side in electronics.

Shinobiwan
07-01-2013, 03:29 AM
Thanks guy, I think I'm starting to understand now.

Based on what's been I've changed things around and attached the updated diagram.

Is this looking OK now?

Ricardoco
07-01-2013, 05:02 AM
Thanks guy, I think I'm starting to understand now.

Based on what's been I've changed things around and attached the updated diagram.

Is this looking OK now? No, I'm thinking that's still wrong, I suspect one of them will draw the circuit by tomorrow but if not I will, but I wont be home from work till the morning and not up till 2pm so we will have to see. Rick

Shinobiwan
07-01-2013, 05:34 AM
Ohh thought I'd got it then. I'm missing something here so would someone be kind enough to just put me out my misery and scribble the correct way over the top my drawing please.

Ricardoco
07-01-2013, 07:56 AM
Ohh thought I'd got it then. I'm missing something here so would someone be kind enough to just put me out my misery and scribble the correct way over the top my drawing please. Ok I think this is how it would be wired but you better confirm that with the gurus..

7893

Sorry its crude but ive just got home from work.. I think you will understand it.

Rick

Shinobiwan
07-01-2013, 09:11 AM
Thanks Rick,

Have I interpreted it correctly?

Ricardoco
07-01-2013, 09:23 AM
Thanks Rick,

Have I interpreted it correctly?Yep I think you have, although on my machines i always make the Estop ring as normaly closed ie you break the loop to Impose a condition, the reason for this is if a wire or connection breaks or the power fails or a component fails it will always break the circuit, showing an alarm condition. so all respective relays are energised giving closed condition for normal. this basicly gives me a circuit that is broken in the event of component failure or activation. the other way would not alarm in the event of a broken wire or failed component.

Remember to check it with the Gurus though..

Rick

Shinobiwan
07-01-2013, 10:03 AM
OK will hope someone can confirm if this will work. I still have doubts about what I've drawn there. I know just enough to be dangerous!

m_c
07-01-2013, 01:18 PM
Either way of wiring in the relay would work. Your first diagram switched the high (positive) side, and your second switched the low (negative/gnd) side.

Only thing that threw me was the markings on your relays. Vcc is a supply voltage in electronics, whereas you've used it for the contacts.

Ricardoco is right that e-stop circuits should be fail safe. For the actual e-stop button circuit, the relay should be active when the e-stop circuit is not in stop condition, with the BOB e-stop wires going through a pair of NO (Normally Open) contacts. That way if anything fails, the machine stops.

With the drive alarm function, a truly failsafe method is not possible due to the fact the alarm only activates when there is a fault, so you need to implement a system that relies on relays/wiring working when there is a fault. This isn't quite as big an issue on the alarm funcion, as a failure to stop when a drive faults out isn't as major a safety issue. At worst two axis keep moving, while one sits still.

Shinobiwan
08-01-2013, 11:32 AM
OK with that sorted I'm also looking to eventually add proximity switches for home positions.

These look a little different since they're powered devices with an output intended for a parallel port input.

Am I right in thinking its possible to only use 1 input on the BOB for 3 switches or does each need its own? Currently I have 1 input with 3 mechanical switches but not sure if that will work here.

m_c
08-01-2013, 07:45 PM
If they have active (i.e. TTL level) outputs, then they won't like being connected up. Possible work arounds could be some kind of OR gate, or mini relays.

If they have an Open Collector option, then it will be possible to link them up.

Shinobiwan
08-01-2013, 07:59 PM
Hi m_c, thanks for all the help you've given. Appreciate it.

The sensors are these types:

DC 10-30V 4mm Inductive Green Proximity Sensor Switch 3-wire PNP SN04-P2 | eBay (http://www.ebay.co.uk/itm/DC-10-30V-4mm-Inductive-Green-Proximity-Sensor-Switch-3-wire-PNP-NC-SN04-P2-/300829236549?pt=UK_BOI_Electrical_Components_Suppl ies_ET&hash=item460ad1dd45)

Sadly no data sheet and the specs are basic at best. I'd say that they're active outputs as I had them test wired this evening and when you tie all the outputs together they do strange things. There's a little led on each to show active, when wired in this manner you have to trip a couple of them in order to get things going. Wired individually they work fine.

Could I place a diode after each output or is this not a case of current flowing back to one another?

Shinobiwan
08-01-2013, 08:08 PM
I did manage to find a datasheet to these devices, its in Chinese though!

http://www.ic72.com/pdf_file/-/84401.pdf

m_c
09-01-2013, 01:35 AM
Given that they're NC when not activated, if you want to connect them through a single pin, then you'll need some way to invert the signal.

There are various options, however the one that involves reasonable size components is to use a small relay for each sensor.

However, looking at the specs for those sensors, they are far from ideal, given detection distance is listed as 5mm +/- 10%.
A slot type sensor is far more accurate, such as Optical End / StartStop w. mounts- For CNC, Reprap and laserengraving machine | eBay (http://tinyurl.com/a48pybo)

Shinobiwan
09-01-2013, 04:49 AM
However, looking at the specs for those sensors, they are far from ideal, given detection distance is listed as 5mm +/- 10%.
A slot type sensor is far more accurate, such as Optical End / StartStop w. mounts- For CNC, Reprap and laserengraving machine | eBay (http://tinyurl.com/a48pybo)

I was reading the massive thread over on cnczone about the DIY version of these and it depends how you use them as far as accuracy goes. Passing the sensing object very close across the sensor is preferable to bringing the object up to the sensor. That's 20% error in the specs is at a distance of 5mm from the sensing object. The closer the object is to the sensor the more accurate it is. At 1mm they're accurate to 0.05mm or better.

There's video here showing the repeatability of these cheap ebay proximity switches using a dial indicator.


http://www.youtube.com/watch?v=i3nmp9AXccQ

m_c
09-01-2013, 02:33 PM
For a router, that accuracy is pretty good.
I'm more used to metal work, where 0.05 is borderline acceptible. It's certainly not really good enough for a lathe, as that translates to 0.1mm on the diameter. The sensor I'm using acheives better than 0.01mm accuracy.

Shinobiwan
09-01-2013, 04:50 PM
0.01mm is about the resolution of my stepping setup. Mechanically a C7 screw and nut is 0.05mm or better.

I think these sensors are a good match for my system. Anything more would have been overkill but I can see why you'd like better if your doing the kind of precision work that absolutely requires it to be dead on.

Swarfing
09-01-2013, 09:47 PM
The other issue you can get with these that you don't get with a 3D printer is keeping then clear of swarf? you would need to shield them very well

JAZZCNC
19-01-2013, 01:24 PM
Given that they're NC when not activated, if you want to connect them through a single pin, then you'll need some way to invert the signal.

Missed this but it's easy fixed just set the Home input to Active low and it will see the signal when it goes low IE: The switch opens.

m_c
19-01-2013, 08:02 PM
Missed this but it's easy fixed just set the Home input to Active low and it will see the signal when it goes low IE: The switch opens.

Still wouldn't work for homing ;-)
Wiring three to the same pin, unless you can make sure 2 are triggered (i.e switched open circuit) while you home the third one, it's not going to work.

JAZZCNC
19-01-2013, 08:30 PM
Still wouldn't work for homing ;-)
Wiring three to the same pin, unless you can make sure 2 are triggered (i.e switched open circuit) while you home the third one, it's not going to work.

See what you mean and didn't give it a lot of thought plus I've Never used these type Switches so won't argue but I've just been looking thru PMDX126 manual and they use them wired in parallel on a single Pin so wouldn't be so sure.?

m_c
19-01-2013, 09:36 PM
That's because the sensors in that diagram have a NO output.

JAZZCNC
20-01-2013, 06:10 PM
That's because the sensors in that diagram have a NO output.

Ah I didn't realise these where NC switches. . . Makes sense now.!! . . . Really should start reading the threads more often.!
(To be honest didn't even knew Proximity switches add NC - NO option never used them or thought about it. Thought they just sensed magnetic fields but on reflection it's obvious it's just an electrical circuit so could have and would need to both options to work has switches. . . Doh.!!)

dsc
22-02-2014, 10:17 PM
I thought I'd bounce this thread as I have a question related to the ALM output from a Leadshine drive (EM806, which is pretty much an upgraded AM882).

Is it safe to wire the ALM straight to a PIC pin, or should I use another (opto) transistor in the middle somewhere to isolate the two?

Regards,
T.

JAZZCNC
22-02-2014, 10:44 PM
I thought I'd bounce this thread as I have a question related to the ALM output from a Leadshine drive (EM806, which is pretty much an upgraded AM882).

Is it safe to wire the ALM straight to a PIC pin, or should I use another (opto) transistor in the middle somewhere to isolate the two?

Regards,
T.

I'm no electronics expert but think it should be ok has the alarm output can sink or source 20ma @ 24V and don't think the Pic will kick out more than 5V.

Something I do know thou is don't want you to blow my bloody drive up So be sure before trying. .Lol

dsc
22-02-2014, 11:54 PM
Lol, I'm not keen on blowing anything up, thus the question :D

Regards,
T.

m_c
23-02-2014, 01:02 AM
The Fault ouput is Open Collector, so provided there's not an issue with wires being connected wrongly, then you can connect it directly.
If noise is an issue, or the possibility of wires being connected wrongly, then having an opto would likely be beneficial.

irving2008
23-02-2014, 01:10 AM
The Fault output on the EM806 (i guess that's what you mean by the Alarm output) is a floating optoisolated transistor. You could do it two ways:

1. Flt+ to PIC Vcc, Flt- to the input pin and a 1k resistor from input to PIC ground. Input will go low on fault; or

2. Flt+ to PIC input, Flt- to PIC ground, 4k7 resistor from PIC Input to PIC VCC. Input goes high on fault.

m_c
23-02-2014, 12:50 PM
Wouldn't using an internal pull up be just as easy?

dsc
23-02-2014, 03:07 PM
Looking at the diagram in the manual again, I thought that if I use R = 4.7k, the PIC pin will see 5V when the FLT output is disabled, and 0V when the FLT output is enabled. With nothing passing through the FLT optotransistor in the EM806 ie. with no fault, the PIC pin should see 5VDC on the input, if the FLT optotransistor is enabled, it would pass current down to 0VDC, thus bringing the PIC pin down to 0VDC. Or am I missing something?

Regards,
T.

11686

m_c
23-02-2014, 04:25 PM
That'll work fine.

irving2008
24-02-2014, 06:24 AM
Looking at the diagram in the manual again, I thought that if I use R = 4.7k, the PIC pin will see 5V when the FLT output is disabled, and 0V when the FLT output is enabled. With nothing passing through the FLT optotransistor in the EM806 ie. with no fault, the PIC pin should see 5VDC on the input, if the FLT optotransistor is enabled, it would pass current down to 0VDC, thus bringing the PIC pin down to 0VDC. Or am I missing something?

Regards,
T.

That was my option 2 and will work fine, but if you read page 3 of the manual you'll see it says that the output is low impedance in normal operation and goes high when there's a fault, i.e. the logic is reversed. The reason for this is if you put the pullup at the controller end and the cable gets broken or disconnected you get a fault condition.

@m_c you could use internal weak pull_up but needs to be turned on in s/w and is only 10k so more susceptible to noise in this environment. Indeed on reflection I'd probably use a 1k external pull_up for just that reason.

joel0407
31-07-2017, 01:20 PM
Hey guys,

I know this thread is a little old but it's about he only decent thing that comes up when I searched "AM882 alarm wiring". I just registered to post this update.

This is just an FYI how mine worked. I have 2 motors on one axis and I didn't want the driver to sense something that would put it in to alarm and stop one motor while the other kept going. Hope that makes sense. I wanted that if one driver went into alarm that the others would stop.

Turned out really simple. In the software set the alarm to go "LOW". Run the E-Stop though as many switches as you need then end at the "ALM +" of the first drive then "ALM -" to the "ALM +" of the next and so on. After the last drive "ALM -" goes back to the control board "GND" and that's it. Job done. If any drive goes into alarm, the circuit is broken and E-Stop is activated.

Happy Days

Clive S
31-07-2017, 03:09 PM
Hi Joe and welcome to the forum. There are a lot of people on here that use the AM882 drives and the later model EM806 both are very good drives and for a gantry machine a must, because like you have pointed out the alarm feature

joel0407
31-07-2017, 03:16 PM
I just thought the beginning of the thread got a bit complicated with using relays and the such. I don't know if the op had used a different control board or something and it had me a little confused. I know how to use a transistor and a relay but couldn't work out the alarm port on the AM882.

I expected it to be simple open circuit and closed circuit when alarming or not. What threw me off the most was putting a multi-meter across the terminals didn't show continuity or only a few millivolts on DC. I figured there wasn't enough voltage to do any damage so I just give it a go running a jumper from the E-Stop on my Parallel Breakout board, "ALM +" then "ALM -" back to the GND on my break out board. What do you know it worked then I found it also worked jumping them all together so all good..

Happy Days

Joel

Lee Roberts
31-07-2017, 04:02 PM
Happy Days

Joel

Thanks for taking the time to share Joel, I'm sure some will find your info usefull.

Good luck and welcome to the forum !

EddyCurrent
31-07-2017, 06:00 PM
There are drawings here; http://www.mycncuk.com/threads/6565-Ready-Steady-Eddy?p=52213#post52213
of how I wired them.

m_c
31-07-2017, 10:59 PM
Turned out really simple. In the software set the alarm to go "LOW". Run the E-Stop though as many switches as you need then end at the "ALM +" of the first drive then "ALM -" to the "ALM +" of the next and so on. After the last drive "ALM -" goes back to the control board "GND" and that's it. Job done. If any drive goes into alarm, the circuit is broken and E-Stop is activated.

Happy Days

One thing to be aware of with doing this, is the alarm outputs may have a slight voltage drop (I've just checked the EM manual and it doesn't give any specs, but electronic open collector type outputs typically have a voltage drop, unlike true mechanical relay contacts). So if you connect multiple drives in series, you risk increased interference/noise issues.
I.e. if you're connecting to a TTL level type input, which needs a guaranteed voltage below 0.7V to be active, if you connect 4 drives with a 0.1V drop, you then only have a noise margin of 0.3V.

Off course, the exact effect will vary depending on the kind of input you're using. If you were to get noise problems, the simplest solution would be to add a relay controlled by the alarm/e-stop circuit, as a reasonable amount of current is needed to activate the relay, which should be far greater than anything noise/interference would cause.

joel0407
01-08-2017, 03:07 AM
One thing to be aware of with doing this, is the alarm outputs may have a slight voltage drop (I've just checked the EM manual and it doesn't give any specs, but electronic open collector type outputs typically have a voltage drop, unlike true mechanical relay contacts). So if you connect multiple drives in series, you risk increased interference/noise issues.
I.e. if you're connecting to a TTL level type input, which needs a guaranteed voltage below 0.7V to be active, if you connect 4 drives with a 0.1V drop, you then only have a noise margin of 0.3V.

Off course, the exact effect will vary depending on the kind of input you're using. If you were to get noise problems, the simplest solution would be to add a relay controlled by the alarm/e-stop circuit, as a reasonable amount of current is needed to activate the relay, which should be far greater than anything noise/interference would cause.

Thanks mate. Makes sense. I don't know much about open collectors.

Happy Days