Microcontroller resets on motor operations.
danny99
Posts: 10
Hi
I am trying to make circuit to control four, 24VDC 3A motor in both directions, i am using DPDT relay driven by ULN2803.
problem is whenever i switch the direction, microcontroller resets. Uptill now i have damaged two arduino boards.
CB210 keeps resetting when ever motor operate forward or backward, Circuit is working fine but I want to get rid of resetting problem of CB210.
Any suggestion will be helpful.
Thank you
I am trying to make circuit to control four, 24VDC 3A motor in both directions, i am using DPDT relay driven by ULN2803.
problem is whenever i switch the direction, microcontroller resets. Uptill now i have damaged two arduino boards.
CB210 keeps resetting when ever motor operate forward or backward, Circuit is working fine but I want to get rid of resetting problem of CB210.
Any suggestion will be helpful.
Thank you
Comments
Any time a motor suddenly reverses, it's a dead short for a while and sucks current with wild abandon, which drops the supply voltage. You have 4 motors and 4 relays that require a lot of current. Either that voltage drop or the resulting noise on the power supply line is the probable cause of your micro resetting.
Mike2545 is right, in any case. You probably need a whopper of a power supply. Try two BIG 12V gel cells (7AH or bigger) in series instead of a wall wart.
Your Arduino can operate on its own supply, from a 9-volt battery as a test. It's hard to see from your drawing what you're connecting the 9V supply to. It should be through the barrel connector, which gives you the additional protection of a reverse polarity diode. Don't connect it to just the Vin input on the bottom of the Arduino.
Place dropping resistors between the Arduino and the ULN2803. That'll at least limit current pulled from the driver chip should it blow because of excess demand on the other side.
And, as Erco says, dropping 24V to 9V through a linear regulator is wasting tons of energy in the form of heat. Your regulators won't last long, especially if they're not on heat sinks.
-- Gordon
-Phil
Motors work as generators until they stop spinning, so when you flip direction, you are going to dump a > -20V supply, across your 24V,
Try a separate 24V supply, with some current limiting to ease the flip-over.
Relays are also a known reset scourge, as they can give sub-ns edges - if you must use them, separate the power supplies, and move them as far from sensitive electronics as is practical.
There are Motor Bridge ICs from companies Like Allegro ?
To clarify more I am updating the schematic diagram plus i am adding more information related to the project.
I am designing a small window actuator control panel controlling 4 window actuator. HUWIN Linear Actuator
I am powering they system using MeanWell switch mode power supply AD155B - 5A, I have a linear regulator 7809 to power my CB210,
I am using DPDT relays to switch the directions of the window actuators, when I use separate supplies system tends to be stable but if I try to use same supplies to power motors and cb210, resetting problems occurs.
Unfortunately design requirements is to have one supply for everything.
Thank U , any help to sort the problem will be appreciated.
a. move direction A
b. move direction B
c. STOP
Does the motor have a built in limit switch that kills power so you do not need a power off mode on the relay?
You should have a large cap both in front of the 7809 and after it. ie.2200uf on the input (rated at >25V), similar on the output. This will mask any momentary drop out.
I would recommend using P and N channel mosfets and an H bridge mosfet driver. This has some benefits over relays:
1. Possible relay failure over time ( mechanical failure )
2. With mosfets, you can use PWM to ramp the motors on and avoid hard starts
3. Easier current limiting to the motors with an Hbridge driver.
If you are damaging your processor, then you may need to further isolate the IC with a buffer. A cheap simple buffer you may have on hand would be a 4050 ( or two 4049 gates in series ). Drive the 2003 from a buffer.
As DPDT was sparking alot, i have used extra SPST relay to switch over when DPDT relay contacts are in place, making sure contacts doesnt get shorted.
Will see if it works.
if not I am thinking of putting power mosfet in place of SPST any suggesstions. ?
thank u .
I am going to properly filter the supplies and will have another go if its reliable enough to go into the final design.
Now Snubber circuit, does anyone have any information or article to help me build a snubber for the bi directional motor control.
Thank u for your help mark.
I think i will try MOSFET H BRIDGE using opto isolator.
do u have information on snubber circuit, struggling to find some ideas to protect relays.
thank u
please have a look on the schematic. due to resolution picture are not coming clear from software. sorry
s
I am using an H bridge mosfet motor driver, when i connect manually the ground pins to ground circuit works fine.
but when micro is used to control motor via opto coupler motor some time work as desire and some time doesnt responds.
could any one help me. why mosfet are not working properly with optocoupler.
Iam using PC817 optocoupler.
thank u
The mosfet configuration should allow the high side to be ON on one side of the motor only when the LOW side is ON on the other side, and vice versa. Also, I have not used those mosfets but in some cases, the voltage to the gate of the high side mosfet needs to be some amount higher that the 24v. This is often achieved by a mosfet driver IC.
Unless I am mistaken one transistor is a P channel and the other is an N channel so both will not be on at the same time except when switching. Unfortunately that may cause a large current spike while switching, particularly if the optoisolators are not high speed units. Better to use an H bridge driver for this.
Power the micro from the 24V supply using a diode and large capacitor as in post 13.
Use a switching regulator instead of the 7805.
Use an H bridge driver to drive the transistors or a complete H bridge chip/module.
Allow time for the motors to stop before reversing direction.
Turn motors on one at a time and wait at least 100mSec before turning on the next motor.
The circuit in post 19 may work initially but the large spikes caused by both transistors being on during the transition period will eventually cause them to fail. An H bridge driver chip turns one transistor off before turning the other one on to avoid this problem.
@tchap yes it does work, but optocoupler are not able to work correctly with them resulting so many burnout mosfets.
i will update the post with the final solutions soon
thanks all for the help.
I never like concepts that switch both the PNP and NPN at the same time, because there is a potential for both to be on during the transition. There is also the potential for both mosfets to be partially on if the opto is not fully turning on(pulling the gate V to gnd). The other option is to independently control each gate with the Propeller, I would control it via a buffer(even as simple as a 4050 or 4049, not opto). But, the problem again with independent switching is that if there is a state where both can be on, things burn up. On boot up, when the pins are in input on the Prop, you would need to define the states of the gates with pullups or pulldowns until the Prop takes over. Then hope there is no case for a hangup on the Prop. That is why an Hbridge controller is best of all options. Choose an Hbridge driver based on voltages, amps required per motor. Then you can feed the controller direction and speed( DAC) straight off the Prop, and let the driver worry about the transitions. I spent a lot of time watching mosfets burn up to learn this the hard way. You can get this to work with the Prop alone, but it will take effort to make sure there is a dead time between transitions. A scope is best to watch the control lines to be sure that you are not overlapping gate controls. If you are wanting to use PWM, then you do not want to be switching both PNP and NPN off the same pin, that is like getting in car and slamming the gas down then slamming the brake, back and forth as fast as possible, this is assuming you have only one side of an Hbridge.
Another note: Unless you have adequate current to drive the gates, tying the NMOS and PMOS gates together like this can cause high current spikes... enough to reset a micro controller, this is why applying a brute force 'direct' connection will work, and it will fail when powered from the micro. Even if the NMOS and PMOS transistors are exactly matched ... i.e. complementary ... there is a certain amount of overlap during the transition from On to Off where BOTH transistors will be ON. This is due to the gate capacitance of the transistors. This is also why you see the gate drive split between an NMOS (low-side) and PMOS (high-side) driver. Other than supplying the correct gate voltage, high-side and low-side driver chips also introduce a small delay between turning one transistor OFF and turning the other transistor ON.
If the Opto is capable of delivering an adequate gate current (many times they are only a few milli-amps.), I would go ahead and leave the 10k resistors there, but I would also split the gates. This means putting 10k resistors on the NMOS transistors to ground as well as leaving the 10k resistord from the PMOS transistors to the supply voltage. This way all of the transistors are off during power-up and micro controller initialization. This also means that an Opto is connected, not only to the NMOS, but also to the PMOS transistors.
Another Note: the indicator LEDs that you have in series with the Opto might work with a 5V micro controller, but it will fail with a 3.3V micro controller... it's better to run your indicator lines from a separate parallel circuit rather than a series circuit.
Regarding using independent control of both the PNP and NPN with separate opto's, you cannot use a pullup or pulldown resistor on the input to the opto. But, you can insert a gate in front of the opto, and put a pullup or pulldown in front of the gate to serve the purpose of setting an initial boot up state for the gates until the Prop takes over.
thank you for your suggestions and comments. really kwin and tchap have very good knowledge on mosfets and electronics.
the scheme i m using was not good becos mosfet were not able driven properly by the opto n resulted all my mosfets burned in doing this test.
now i am trying to use relays again with a delay. Its working but i cannot address the spark ( arc ) in relays.
One spst is providing 24v supply line to 4 DPDT motor relays, when i have to switch the direction of the motor i break the circuit by opening SPST then give a delay and then switch DPDT motor relays.
this is not restting the micro now but, on scope i can see noise in supply plus spike in the supply lines on reversing the motors.
Regards
thank you .
Again, a short delay before reversing direction is recommended. Solid state zero crossing relays will avoid a lot of noise problems since they only turn power on or off when the AC voltage is crossing 0V.
Recommend RC snubber across the motor connections at the relay. Also, are you letting the motors stop prior to reversing them? If not, your going to have an additional time of high current. You also want to cure this arcing otherwise, you will have a relay contact weld shut bad news, the motor will not stop, or alternatively, the contact points will become charred and pitted resulting in a resistive or no contact at all. The worst of these being the resistive contact as it will heat up and eventually melt together of burn.
Frank
+
I wanna ask you few question on above circuit. I tried with SPDT relay not with DPDT
1)Whether above circuit has been successed
2) The above circuit dont have back emf protection. SO whenever it changes direction we assume freewheeling diode will take back emf current. But some time it wil try to move lease gnd path so that why arduino might get damage
3) it dont have short circuit protection.
4) Assume that you connected linear actuator to relay. What will happen if all relay drive get turn on
5) assume that you checked status of pin @ programming , but @ arduino get power all pins will be high , You can test your code with powering arduino