Author Topic: Output State on Power Off  (Read 51231 times)

ccdubs

  • Full Member
  • Posts: 116
    • View Profile
Output State on Power Off
« on: January 17, 2008, 02:59:14 PM »
Hi All,

Here's another one for you related to the power loss topic posted previously.

I have a PLC whose outputs pull down input pins (5V high) on a PIC micro to perform certain actions. The PLC is powered by a seperate supply which shares the same gnd as the PIC supply.

When the supply feeding the PLC shuts down, the pins on the PIC get pulled low and unwanted action occurs. I found that if I disconnect the output connector on the PLC that the PIC action stops. The same is true when I installed the diode in the +ve supply to the PLC.

The path to gnd is probably through some other load but are there any extra measures (beyond the diode in the +ve line) I can take within/on the PLC to stop this. I can't put diodes in each ouput as the Vdrop across them doesn't let the PIC recognise a low on the input pin.

Once again any and all help appreciated.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Output State on Power Off
« Reply #1 on: January 18, 2008, 10:08:19 AM »
If you power down the PLC its output state is indeterministic although I would think that the transistor output would simply be switched off. But during power down there may be glitches that can trigger the PIC  since PIC is a 5V logic device and may be sensitive to the changes during power down.

You may want to use an electromagnetic relay to complete the interface with the PIC. When the PLC power down the PLC output would not have enough energy to energize the relay coil and therefore would not trigger the PIC unexpectedly.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

ccdubs

  • Full Member
  • Posts: 116
    • View Profile
Re:Output State on Power Off
« Reply #2 on: January 18, 2008, 03:28:10 PM »
Hi Support,

The code in the PIC requires the input to remain low for the action to occur so I don't think it is anything to do with momentary glitches during power down. The undesired action will be continuous upon PLC power down hence showing the PIN is pulled to ground idefinetely.

What I would like to know is via what "low impedance" components in the PLC are the outputs connected to the +ve supply?

Is it the pull up resistors, LED's?

Thanks

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Output State on Power Off
« Reply #3 on: January 18, 2008, 09:45:16 PM »
Which PLC model? If it is T100MD888+, E10 or H-series the output drivers are ULN2003A/ULN2803A which are simply darlington transistor driver. There is a pull up resistor and the red LED for indicator. The LED would prevent the output terminal of the PLC from sinking current (except for only micro amp leakage current) from the PIC so I don't see why it will pull down the signal from the PIC. Does your PIC input has a pull up resistor to its +5V power supply? If not you should add a 4.7K pull up resistor to the input of the PIC and that should take care of the problem.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

ccdubs

  • Full Member
  • Posts: 116
    • View Profile
Re:Output State on Power Off
« Reply #4 on: January 19, 2008, 11:32:28 AM »
The PLC is a T100MD888+.

Yes the input pins of the PIC are pulled up by 10k resistors, they also have a 10k resistor in series to limit the current driven by the PLC from its outputs in the OFF state due to the PLC's pull up resitors. This also means that the PLC output LED's are always ON.

Is it possible that the issue is being caused by the pull up resistors in the PLC. What were to happen if they were removed?

Thanks.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Output State on Power Off
« Reply #5 on: January 19, 2008, 12:49:18 PM »
Please see output circuit below:

+24V ---[5.6K]---|>| ---+
                        |
     ULN2003A driver   ---+----------  PIC input


ULN2003A is open collector darlington transistor driver so when it is in the OFF state it is basically an open circuit. The output driver is being pulled up via a 5.6K ohm resistor in series with the red LED. When the +24V PLC power supply goes to zero the LED would be in reverse bias and should prevent the current from flowing back to the PLC's power supply so that shouldn't be the cause.

Did you use a multi-meter to measure the voltage at the PIC input (with your 10K pull up) when PLC power is OFF? What is the voltage reading?
« Last Edit: January 19, 2008, 12:50:07 PM by support »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

ccdubs

  • Full Member
  • Posts: 116
    • View Profile
Re:Output State on Power Off
« Reply #6 on: January 19, 2008, 01:12:16 PM »
When the PLC is depowered (by turning off its supply) the voltage on the PIC input pin is 1.05V. If I remove the PLC ouput connector this raises to 3.24V, the same happens if I disconnect the PLC power connector.




ccdubs

  • Full Member
  • Posts: 116
    • View Profile
Re:Output State on Power Off
« Reply #7 on: January 19, 2008, 02:17:44 PM »
Upon doing more testing I have found the following:

With PLC DC-DC power supply completely isolated:
- PIC V = 2 V
- Remove PLC +V: PIC V = 2V
- Remove PLC 0V: PIC V = 3.24V
- Remove both PLC +V & 0V = 3.24 V

With PLC DC-DC power supply outputs connected but no inputs, therefore depowered:
- PIC V = 1.05V
- Remove PLC +V: PIC V = 2V
- Remove PLC 0V: PIC V = 1.05V
- Remove both PLC +V & 0V = 3.24 V

This would tend to show that there are 2 paths that lead to ground:

One within the DC-DC converter output (measured at 470ohms between + and - on output)

The other between PLC output and it's 0V power terminals (measured at 760ohms between ouput and 0V).

Ironically it is only when both of these paths are enabled that the PIC voltage drops low enough to cause and activation, however it surprises me that it seems like the PLC ouputs when depowered are not isolated from 0V.

I have done a further test where I completely disconnected the PLC from everything and applied 3.88V (3 x AA cells) to output 4 and 0V. The measured current was 4.5mA and I noticed that the LED next to the power supply connector was faintly glowing.

When repeating the above test I found that outputs 7 and 8 don't draw any current and when I connect them to the PIC there is no action. So these seem to work as predicted.
« Last Edit: January 19, 2008, 06:21:08 PM by ccdubs »

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Output State on Power Off
« Reply #8 on: January 19, 2008, 07:15:38 PM »
Did you connect the PLC 0V power supply with the PIC 0V power supply? You need to have common ground before you can connect the two systems together.

If you take a multimeter and measure the PLC output with respect to its 0V terminal you will see something around 5 M ohms.

Output 7 & 8 are power MOSFET and these have much lower leakage current than the Darlington transistor outputs #1-6.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

ccdubs

  • Full Member
  • Posts: 116
    • View Profile
Re:Output State on Power Off
« Reply #9 on: January 19, 2008, 07:45:00 PM »
Yes the 0V is common.

I can't measure the exact output to gnd impedance but it is higher than 3Mohms.

This doesn't explain why when I put the 3.88V on the output I measured 4.5mA which equates to ~860ohms or why the green LED next to the power connector marked P1(i think) goes on during the same measurement.

Surely the leakage current of the darlington transistors wouldn't be this high at such a low voltage?

It is very important in this application that false activation risk is almost eliminated, hence all the questions  :)

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Output State on Power Off
« Reply #10 on: January 20, 2008, 10:17:31 PM »
Well, if you turn off power to the PLC there is little we can do about ts output state and hence I wouldn't call this a "problem" that require a resolution.  As mentioned the surest way is to use an electromagnetic relay to provide the isolation between the PLC output and 5V PIC electronics.

However, personally I don't think it is the leakage current that is triggering the PIC. I believe it has something to do with the design of your entire system. I suggest you isolate the PLC from your circuit and test its leakage current on its own to find out if it is indeed a leakage current issue.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

ccdubs

  • Full Member
  • Posts: 116
    • View Profile
Re:Output State on Power Off
« Reply #11 on: January 20, 2008, 10:57:41 PM »
Hi Support,

I have already performed this test, please refer to my post on 19 Jan 05:17:

"I have done a further test where I completely disconnected the PLC from everything and applied 3.88V (3 x AA cells) to output 4 and 0V. The measured current was 4.5mA and I noticed that the LED next to the power supply connector was faintly glowing."

I know that there is at least one other component in my system that is contributing to the issue and I am dealing with that seperately.

I disagree with your first comment, as it would be expected that an output would be off (open cct) when a unit is depowered otherwise there is no failsafe capability. If the PLC and all loads are on the same cct failsafe is automatic but I am sure there would be many applications using seperate supplies especially with remote IO apps.

Perhaps you could perform the test I have conducted on a PLC you have there. It may be that the batch I have has a faulty component.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Output State on Power Off
« Reply #12 on: January 20, 2008, 11:38:09 PM »
I think I know why: each ULN2003A/ULN2803A driver has a flyback diode whose anode is connected to the transistor's collector and cathode connected to the +24V. When the PLC is powered up this diode is in reverse bias and it serves to protect the transistor against inductive kick when switching inductive load.

When you turn off power to the PLC and apply a positive voltage to the PLC output, now the flyback diode becomes forward bias and current flows via this diode back into the other part of the circuit. This explains the several mA of current you observe when connecting +Ve voltage to the transistor driver when the power to the PLC is turned OFF.

The MOSFET output does not use the flyback diode but uses its intrinsic zener to protect agains inductive kick. This is why you don't see the same current flow when connecting to output #7&#8.

BTW, the outputs on EXP4040 board are all MOSFET and you can consider using it if you need to connect more than 2 outputs to your PIC board.

« Last Edit: January 20, 2008, 11:38:55 PM by support »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

ccdubs

  • Full Member
  • Posts: 116
    • View Profile
Re:Output State on Power Off
« Reply #13 on: January 20, 2008, 11:52:58 PM »
Thanks for getting to the bottom of this. I am already committed to using the PLC's I have (30 of them!) and by using the 2 mosfets I have a workaround that I am comfortable with. I really like the TriPLC and have enjoyed learning how to use them.

It may be worthwhile looking at another darlington driver cct that won't cause this issue....but I guess if I am the first customer to have this issue it may not be.

If anything comes up to help me with my other 2 outputs (also driving a PIC input but slightly less critical) on pins 6 and 5 please let me know.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Output State on Power Off
« Reply #14 on: January 21, 2008, 09:03:57 AM »
You could use a very cheap opto isolator such as the H11AA814 (other part numbers are PC814A, LTV814) which is a 4-pin IC. Connect a current limiting resistor in series with pin 1-2 and have the PLC output drives the transmitter in pin 1-2. Pin 3-4 of this IC is then used as a transistor switch to drive the PIC input. This way it provides a very low cost and simple solution and also you provide galvanic isolation between  the two circuits.  Check the following link for a datasheet of this IC:

http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail?name=425-2437-5-ND

You can build a little PCB to contain the ICs if you are building them on production quantities.

Email: support@triplc.com
Tel: 1-877-TRI-PLCS