Unstable power supply with Propeller education kit
TL
Posts: 25
We've been using Basic stamps to control test equipment in our lab through reed relays. But after the last setup used 5 program slots, I decided it was time to get something easier to program.
I bought a Propeller Education Kit, and set out to make my next setup on the PEK breadboard. Because I was using reed relays again, I used a 2Amp 9V power supply in place of the 9V battery.
A problem has arisen, however: When I connect a reed relay to the PEK power supply, the line voltage goes UP to 4.1 volts or more. I added diodes to prevent back EMF, and added a resistor in line with the relay coil to help damp out oscillations, which seemed to solve the problem. But when microcontroller turns on two reed relays at once, the voltage again jumps up to 4 volts.
Since the circuit need to be able to close three (out of six) relays at once, I have to fix this. The relays are 250 ohms and can draw 20 mA each. (less with the resistor in line) Basic Radio Hut junk, but it seems like we're always in a hurry, and they're just a mile away.
Any ideas? I'm much better with software than electronics, and this is a bit beyond me.
-TL
I bought a Propeller Education Kit, and set out to make my next setup on the PEK breadboard. Because I was using reed relays again, I used a 2Amp 9V power supply in place of the 9V battery.
A problem has arisen, however: When I connect a reed relay to the PEK power supply, the line voltage goes UP to 4.1 volts or more. I added diodes to prevent back EMF, and added a resistor in line with the relay coil to help damp out oscillations, which seemed to solve the problem. But when microcontroller turns on two reed relays at once, the voltage again jumps up to 4 volts.
Since the circuit need to be able to close three (out of six) relays at once, I have to fix this. The relays are 250 ohms and can draw 20 mA each. (less with the resistor in line) Basic Radio Hut junk, but it seems like we're always in a hurry, and they're just a mile away.
Any ideas? I'm much better with software than electronics, and this is a bit beyond me.
-TL
Comments
Post Edited (originator) : 3/9/2007 7:49:26 AM GMT
6 propeller pins are connected to one side of six different reed relay coils, and the other side was connected to ground. This resulted in >4 volts between Vss and Vdd when one or more propeller pins were driven high, or when one of the wires was disconnected from the propeller and connected directly to Vdd.
The following changes were made: The other side of each reed relay coil was connected to ground through a 100 ohm resistor. This was determined by experimentation to be the lowest resistance that would keep the voltage at 3.3 V.
A diode is mounted "backwards" across the coil to eliminate the back EMF generated when voltage is suddenly withdrawn from the coil. (Trick learned after frying a few Basic Stamps)
The fix eliminates the problem for a single reed relay, but not for two or more. Increasing the resistor to the largest resistance that will still close the reed relay also isn't working.
There are a few other things connected to the propeller, like a 4x16 line serial LCD display and an optoisolator to monitor the state of an external circuit, but that's it.
Any ideas?
-TL
** I/O Port A Can source/sink 30 mA each at 3.3 VDC.
Do not exceed 100 mA source/sink total across any group of I/O pins at once.
Meter your current per relay, see if the aggregate is exceeding the 100mA limit.
Post Edited (originator) : 3/9/2007 8:18:08 AM GMT
I was doing that originally, when I was driving two relays from one pin. I fixed that, and per the manual, I should be OK now.
And the problem still occurs when I connect the high end of the coil directly to Vdd, without using the propeller at all, so I don't believe that is the problem.
One of my more electronics-savvy coworkers believes there is some sort of oscillation occurring between the coils and the power supply. If this is that case, would it really do any good to put a transistor in to switch the relay?
Also, I needed to add the 0.47 uF cap across the 3.3V output to drive the propeller even when it was running off the battery.
-TL
Post your code if you can that you are testing with. Use the code block feature to keep the indent the same of the forum.
Post Edited (originator) : 3/15/2007 4:42:27 AM GMT
I know the diodes across the relays are in the right way, because if they're backwards, the current goes straight to ground without going through the relay coil! [noparse]:)[/noparse] And all it does is damp the voltage spike when the coil is turned off. The propeller was resetting repeatedly before we added the diodes, and now it is fine. Either way, it doesn't really affect the overvoltage problem when they're in or out.
The reed relays are supposed to be fairly low power devices, safe for such applications. And they're braindead simple to wire up. We've been running them with Stamps for quite a while now.
-TL
If you have a camera that can take a clear picture of your board, maybe something will be more obvious.
Verify you are doing this with the electro caps, insure the caps polarity is right. Add some .01 and .1 caps near each regulator out, at the Vcc near the relays, at all Vcc pins on the Prop, at the Vin to the regulators, across all power busses (4 busses that I can see). Test all 4 power busses for Vcc and GND.
www.national.com/pf/LM/LM2940.html
www.national.com/pf/LM/LM2937.html
Post Edited (originator) : 3/9/2007 5:56:23 PM GMT
Could it be your 9v supply that is causing the problems?
Another thing to check is how good a connection the regulator components are making with the breadboard, a loose capacitor might cause trouble as the current draw goes up.
Its rather mysterious to me.
Graham
I took a look at the PEK schematics and noticed they were using an lm2937 with a surprise surprise 1,000uF cap (just to make sure). The LM2937 uses a PNP pass element which can exhibit stability problems if not properly decoupled. add a 10uF tantalum as close to the output and ground pins to the regulator as you can manage and your problems will disappear. The regulator is actually trying to compensate but overshoots and then undershoots etc. so it is oscillating badly and the average DC value is what you are reading.
I have no idea why they have such a large cap (and it's probably an electrolytic!!) on the output, the capacitors ESR and inductance will be too high to enable the regulator to be stable when dealing with load transients which inductive loads will certainly give you.
*Peter*
You nailed that one Peter.. for sure.
We have had an issue here also with one set that went to a customer.
A 10 uf and a 0.1uf fixed it ... yes they are electrolytic ones...big 1000 uf suckers...
We locally inlcude these parts (10 + 0.1) to solve that ..
Hopefully somebody at Parallax will see this thread and fix this issue.
Ronald Nollet (Parallax OZ disty)
The instructions say you won't need it with the 9V battery, but you will need it with an power supply to eliminate noise. Well, I couldn't get the prop to boot off the 9V battery until I added that cap!
It's my day off, but I'll drop by the lab this afternoon and try replacing the 0.47uF with a 10 uF cap. I'll see if I've got any in the parts barrel, otherwise I've have to drop by Radio Hut.
Ozstamp: when you say 10 + 0.1, I assume those would both be installed in parallel across the outputs?
If that doesn't work, I'll disassemble the power supply monday and rebuild it. I'm also ordering some solid state relays and optoisolators for future use. I think I'll make a big hurking driver panel of SSRs or optoisolators (whichever ends up be easier to use and more stable for our oddball aps) and just jumper to the microcontroller the driver panel to run whatever junk we need to to use at the moment. I really don't want to go back to the Stamps and their clunky bank switched EEPROM.
-TL
"Well, I've got the 0.47 uF cap directly acrosss the 3.3 V outputs" >>> will not work.
Post Edited (originator) : 3/9/2007 9:05:15 PM GMT
Pete
I haven't seen these symptoms even though I've used a variety of supplies and load characteristics with a scope hooked up.··Is there a certain combination of supply and load (and/or supply line length) that I can use to reproduce the problem?·
Why do we have such a large electrolytic?· The output capacitor was originally selected for the LM2940·5 V regulator on the Board of Education carrier board to solve a problem with transients introduced by servos.· It's been in circulation for quite a few years with no complaints.··The cap's ESR·is also compatible with the LM2940 datasheet's stated·output requirements.··The PE Kit was also tested·with a variety of projected educational applications, including groups of servos and motors with no hiccups.· The assumption was that if it got used for industrial apps, separate and/or isolated supplies would be added to the board.
None of that history changes the fact that your solution fixes a reported problem.· We'll take a closer look.··With the PE Kit, there's no board rev or waiting for a shipment.· Just add a couple of caps, and revise the docs, and it's done.·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andy Lindsay
Education Department
Parallax, Inc.
Post Edited (Andy Lindsay (Parallax)) : 3/10/2007 4:49:17 AM GMT
Originator is correct about the inductive loads. Using resistors with the same resistance as the reed relay coils causes no troubles at all.
I'd stick a scope on it, but I'm a mechanical engineer and software guy. Not a sparky. Even if I managed to hook up the scope without letting the magic blue smoke out of everything, I wouldn't know how to flatten the waveforms I saw. It would really be nice if someone would post a schematic of the entire revised power supply circuit to assist .
-TL
*Peter*
Let's get your project down the road via a tech support call. Below is a link to Parallax' toll free tech support number. Ask the receptionist for Andy when you call.
If you are outside the US, please email me your phone number and a good time to call. (Use the email button to the left of this post.)
Parallax Telephone and FAX Numbers
http://www.parallax.com/html_pages/tech/support/phone_fax_email.asp
Thanks, Andy
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andy Lindsay
Education Department
Parallax, Inc.
Post Edited (Andy Lindsay (Parallax)) : 3/12/2007 5:11:18 PM GMT
Is this the relay you're using?
· OMR-112H
Please let me know; I'd like to test it on my PE Kit.
Thanks, Andy
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andy Lindsay
Education Department
Parallax, Inc.
Post Edited (Andy Lindsay (Parallax)) : 3/13/2007 5:28:21 AM GMT
The datasheet quote still doesn't explain the oscillations. The ESR of the capacitor we are using is .36 ohms at room temperature, which is within the LM2940 datasheet's 0.1 to 1.0 ohm requirement. Further, the datasheet says that the output cap's·capacitance doesn't need a ceiling. It does point out that the ESR of an electrolytic cap can get too large when it gets really cold. Again, that doesn't account for the oscillations unless TL's prototype is in a refrigerator.
The kit parts were selected assuming classroom/lab use (room temperature). This in mind, the tantalum cap is one of the items I excluded to keep the cost as low as possible for students. I apologize for not having documented that in the Setup and Testing lab. I will update the docs with an explanation about the expected temperature range and how to modify the circuit for cold weather, noisy inductive loads, and whatever else we can come up with.
Andy
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andy Lindsay
Education Department
Parallax, Inc.
A combination of a very low load ( few milli-amps) and the load being inductive has a bearing on PSU circuitry.
It is common on an industrial powersupply that for example drives several stepper motors and
possibly some relay's to shunt it with a resistor ( so that there is a minimum pure resistive load)
Highly specialized power supplies like we sell also to industrial customers when used with stepper motors
that do super fast indexing (start and stoppping rapidly with lots of Back EMF) have a built in "BRAKE RESISTOR"
This effectively shunts away high voltages ...
Now a simply led + resistor drawing 10-20mA may well be worth testing on your lab kit ...( as a permanent load)
This would also indicate if there is actually power there... low cost ..
Just a thought for you.
Ronald Nollet
Hi Andy,
I understand where you're coming from. Personally I found it unusual that such a capacitor is used in this manner. However considering that it is a low-cost education kit then obviously there are good reasons for using such a capacitor. But someone always manages to make a working design go bad somehow. I would never of thought of using 3.3V reed relays off the same supply as the processor. It is normally standard practice for me to give any inductive load another supply. But it's called an education kit for more than one reason. We all learn.
Oh, and Ron's suggestion of a resistive load or power led is a good one for many reasons as you know. Sometimes I combine the power and a 'heartbeat' led into one indicator by only supplying a little current to the led from the supply and also feeding the led from another lower value resistor attached to a port pin. That way if you have a dim led then you know there is power but no activity. Of course, the cpu must toggle the port pin to have it flash steadily.
*Peter*
Is there anyway we can get a visual of your circuit design?· There are only a few occasions that I have seen the output of a voltage
regulator increase with load.· The +%20 voltage increase that you are observing seems to be extreme.
Here is a regulator design that has been used on several occasions where the power supply has been less than favorable in terms
of noise.· The stable 5V output can cascode into a 3.3V regulator similar to the PE Kit design.
Note: the schematic shows a 7805 regulator... This could just as easily be the LM2940······
Circuit operation:
The diode connected to Vin of the regulator in combination with the 1000uF capacitor form the first stage diode-capacitor sample
and hold style of filter.· A second stage filter is connected to the Vout of the regulator and the 10uF capacitor similar to the
first stage.· Because a diode will drop the voltage across it's PN junction by roughly .6V, it is necessary to offset the voltage
regulator's GND connection to compensate for the second stage diode-capacitor filter in this design.· Thus the reason for the diode
on the GND connection of the regulator.· The 100uF capacitor functions as a standard output stage regulator filter cap.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
I've placed a diode between Supply and the 5V regulator simply
because I've tried to hook up the 9V battery in reverse at 3:00 in the morning
before. Is the diode to GND needed in that situation, or just when a second stage
is used. So far so good, just wondering if not haveing one on GND will come back
·to haunt me
I understand potential problems when switching but he said:
"And the problem still occurs when I connect the high end of the coil directly to Vdd, without using the propeller at all"
Graham
The GND diode is only necessary if you implement the second stage diode-capacitor filter...
Because of the diode in the second stage filter, it drops the regulator output by 0.6V. To compensate
for this voltage drop, placing a diode on the regulators gnd terminal will effectively increase the regulators
output terminal to 5.6V with reference to GND.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Post Edited (Beau Schwabe (Parallax)) : 3/13/2007 5:44:43 PM GMT
Good Eye Graham!
Version 1 had only the coil, LED, and LED stepping resistor.
Version 2 added the diode across the coil. This solved a few problems we had with voltage spikes on the BS2px when the power was removed from the coil. Didn't help any here.
Version 3 added the 100 ohm resistor in series with the coil. I tried increasing this to just below the resistance that would prevent the relay from closing, to no effect.
The voltage goes up when the pin connected to the propeller is driven high, either by the propeller itself or by disconnecting the wire from the propeller and connecting it to the Vdd directly. Connect two relays and the voltage goes up dangerously.
And yes, Andy, OMR-112H is indeed the relay we're using. The circuit the relays are driving is totally isolated from the propellor. I could tell you what that circuit does, but then I'd have to kill you.
Turns out I won't be able to rewire the power supply until Thurs or Friday.
-TL
Post Edited (originator) : 3/14/2007 4:28:09 AM GMT
A regulator ain't a battery and if it were a battery then it wouldn't be a problem. The regulator attempts to match the output voltage with it's reference and when the load current increases (senses a voltage drop) it needs to decrease it's series resistance by means of the pnp pass element to keep the voltage at the same level. Trouble is that inductors aren't resistors and the current lags behind the voltage just as with capacitors the voltage lags behind the current. If you place a voltage across an inductor, initially it won't draw much current but then that rises exponentially to the level of the coils dc resistance (saturation). Of course remember too that the energy is stored in it's magnetic field and when the voltage is removed the field collapses quickly and can generate a high-voltage spike unless that energy is shunted (diodes/caps etc).
Now the pnp style regulators are a little slower than npn or pmos and so their attempt at compensation is a little out of synch with the load which is already playing tricks with the current. Remember, the regulator is sensing the voltage, not the current, because if it did sense the current it would be more in synch with the load. Ok, so this explanation could get complicated and I am trying to keep it short so I'll leave it at that and just remember to make allowances for regulators and various loads.
*Peter*
Hi TL,
I noticed the led in the circuit which comes on when the coil is off. If you place the led in series (1.6V drop) with the 100R and tie this to the +5V line then you will isolate the inductive load from the 3V3 and you will find that the circuit will be a lot more stable. BTW, the led will then come on when the coil is on. That is the way that I would do it.
*Peter*