PDA

View Full Version : switching high inductance loads



kitcat
- 29th July 2005, 09:55
Hi there.
I have been trying to solve my resetting pic problem for too long now.
I am using porta.0 of a pic16f872 to drive the coil of a dpdt relay (via transistor of course!). The relay is to switch polarity to some solenoids before they are operated using some ln2803s. So the pic sends a pulse to the coil. the coil switches the polarity to the solenoids and then back again ready for them to be driven by the ln2803. As soon as I connect a solenoid the pic resets when the pulse occurs. Even with the solenoid driven from a seperate power supply. Without a load it usually works fine and the relay is clicking over as expected. I suppose it is some sort of voltage flying around. Sometimes when the pic resets the outputs come on high which causes the relay to switch over and the thing starts chattering. The pic then gets hot. I have lost a pic through this problem and I don't want to lose another.
Any ideas?

NavMicroSystems
- 29th July 2005, 11:27
Could you post your schematic?

switching high inductive loads is always a challenge.

Some things that may help:

- Check for Ground Loops
- reverse diodes accross all coils.
- RC filters across the relays contacts
- RC Filters at the PICs and Drivers I/O Pins
- Many large Ground Planes
- Relays as far as possible away from the PIC
- opto-isolators between MCU and drivers
- If switching AC, toggle the relays at zero crossing !

etc...

kitcat
- 29th July 2005, 13:00
Here is a rough schematic. The relevent parts anyway. Sorry it is so bad!

The problem occurs with just one tiny solenoid connected and without the uln2803 plugged in. So just sending a pulse to one test solenoid causes the problem. Are you saying that I should remove the relay from the board and just send the feed back?
Thanks

kitcat
- 29th July 2005, 13:01
Hmmmnn having trouble uploading !

kitcat
- 29th July 2005, 13:24
Another try.

Dave
- 29th July 2005, 13:51
kitcat, I assume from the schematic you are using one of the Allegro driver chips but I don't see pin 10 connected directly to the solenoid + supply. The reverse diode in series with this pin makes any connections to it useless.
I have used quite a few of the Allegro (formerly Sprague) drivers and I have never experenced any problems with them reseting any processors I have connected to them. One thing to keep in mind when using these multiple sinking or sourcing drivers is the current return path in the case of sinking drivers, and the supply path in the case of sourcing drivers should be as direct to the current supply as possible. Therefore in your application the pin 9 of your selected driver should have a seprate high current path to the current source "return" and the pin 10 should be going to the the closest point of the "loads" current source.
Dave Purola,

NavMicroSystems
- 29th July 2005, 16:57
kitcat,

First of all:
As Dave has already mentioned: Pin 10 of the 2803 MUST be connected to the positive supply of the solenoids.
(+12V in your case)

BTW
according to the schematic the Drivers on Pins 11 & 12 of the 2803 are not used.
If so, you could drive the relay off one of those pins and get rid of the transistor, diode and resistor.

Your schematic is not really clear,
what are the relay pins connected to?
(they some appear to be unconnected in your schematic)

Could you complete the schematic before we continue guessing?

Luciano
- 29th July 2005, 22:55
Hi,

See page 6 of this PDF (Fig.3).
http://www.pololu.com/products/misc/0024/sn754410.pdf

(fig 3). If you set Control A to "1" the current will flow
in one direction in the motor winding (or your solenoid) and if you
set Control A to "0" the current will flow in the opposite direction
in the motor winding (or your solenoid).

Same for Control B (Your second solenoid).

External diodes are mandatory!

* * *

With two IC 7406 (inverting buffer), three IC SN754410 and 24 diodes you
can drive your six solenoids.

(You can find similar driver ICs with built-in diodes).


Luciano

*******************
Edit:
One IC with built-in output clamp diodes for inductive transient suppression is the L293D.
The "D" at the end is for Diodes. The model L293 is without diodes.

See page 8 of this PDF.

(Texas Instruments Datasheet SLRS008C − SEPTEMBER 1986 − REVISED NOVEMBER 2004)
L293, L293D QUADRUPLE HALF-H DRIVERS

http://focus.ti.com/lit/ds/symlink/l293d.pdf

*******************

kitcat
- 30th July 2005, 10:21
Sorry for my unclear and incomplete schematic. I am lacking in any good software for this purpose (and the necessary skills!)
So far I have not even plugged the uln2803s into the sockets. I have just 1 solenoid hooked up and the pulse to flick the relay over and send current to the solenoid is enough to reset the pic. I will eventually have 16 solenoids with a global pulse to unltach them and then with the polarity reversed I was intending to latch the ones required. The equipment the are on hass them wired with a common feed and 16 returns which is why I have to do it this way.
I will have to start again with this one. would there be an advantage to seperating the drive for the solenoids from the board the Pic is on?

Luciano
- 30th July 2005, 11:24
Hi,

See attached schematic (JPG file).

Make sure you allow enough time for the relay to switch back
to its unenergized position before you activate the solenoids
with the 2803.

On my schematic D2 and D4 are not necessary if you connect +12V
to the PIN 10 of the IC 2803.

The schematic only shows two solenoids.
Do the same for the other four solenoids.

Please verify before you try the schematic!

I am on vacation for three days.


Luciano

mytekcontrols
- 31st July 2005, 06:31
kitkat,

Since you mentioned not having any good software for doing circuit diagrams I thought I'd make a few suggestions of some utilities I have used and recommend. Here is a source for an excellent, and free (with some limitations) circuit and PCB layout package: http://www.cadsoftusa.com/
(the free version only limits the size of the board you can layout, and allows only 1 page per schematic).

And if all you are interested in is just doing schematics then this is a very easy to use, and quite good open source solution: http://tinycad.sourceforge.net/
(this one allows using the clipboard to cut and paste into other windows apps... very nice).

I hope that helps on the schematic development side. On the other issue of getting resets of the pic when switching solenoids; I found the zero crossing triac (AC) opto isolator approach good for preventing this. If the relay or solenoid load is very small, then no external Triac is required. If not, then driving a suitably rated external Triac with a simple resistor, capacitor snubber network, does the trick. I have successfully done this with massive 220 Vac solenoids switching gears on a 3000 foot cable winch without any gliching problems what-so-ever. If I find the schematics, I'll post them.

Good luck!

kitcat
- 31st July 2005, 11:49
Hi.
thanks for those suggestions. I shall take a look real soon. I had been wondering what to do about my schematics. As for the schematics you mentioned, if you o have a chance could you have a look and see if you can find them. I am going to start again with this and see if I can't nail it.

Matt Kitcat

mytekcontrols
- 31st July 2005, 20:47
As for the schematics you mentioned, if you o have a chance could you have a look and see if you can find them
I found them, but it was part of a project I was subcontracted to do, so I can't post the entire schematic (too bad, since it has a lot of very useful power control related aspects). However I did take a snapshot of the item of interest, and have it shown here:

<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=386">

The circuit shows an MOC3022 being used. This is actually a random crossing device. For zero cross switching, you will want to substitute a MOC3043 (unless you use the PIC to monitor the AC line for zero crossing as I did on this project). Here is the spec sheet for the zero cross part: http://www.jameco.com/wcsstore/Jameco/Products/ProdDS/277843FSC.pdf
These are about $0.59 each from Jameco, and will be a drop-in replacement for the MOC3022 device. The external triac can be anything that is suitable for the voltage and load you anticipate for your application.

The AC source can be any voltage you wish. Although if you want to run this at 200+ volts, it is recommended that the resistors be increased to 180 ohms. Also as I mentioned in an earlier post, you can directly drive small AC loads directly from the opto isolator's output (a very small relay or solenoid).

By the way here is the Zero Cross Detection circuit I was using on the original project:

<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=387">

The output of the XOR Gate was monitored by the INT0 line of the PIC, and would enable switching of the OPTO's only when the AC was in the zero crossing state. I took this route because I was also doing speed control of 2 motors utilizing phase delayed switching, based on zero cross as the starting point.

I hope this info is of use to you,