Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Industrial Motor Circuit Controller Board Randomly Resets

Status
Not open for further replies.

monnie

Newbie level 3
Joined
Aug 18, 2014
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
70
About the Project:
My software colleague and I (as the hardware guy) are working on a circuit to control a simple Brushed DC Motor. It's rated at 24 Volts, and it will be powered with a 24 Volt power supply, but it needs to be ran at about 12 Volts to run at the desired speed. To achieve the correct speed of the motor we are PWMing it at 50% Duty and at 7.2 KHz (Low Side Switching with a MOSFET). Also, the circuit controls four relays used as VFC (Volt Free Contacts). One powers a "Running" light, another powers a "Fault" light, and the other two are spares for future expansion.

At the beginning of a cycle the "Running" relay turns on, which lights a lamp and indicates a cycle has began. At the same time, the motor starts turning, PWMed at 50% Duty. The motor cycles through 6 positions (approximately 50 degrees apart) , dwells at each position for a few seconds, and then goes "home" using feedback from an infrared LED, a photo-transistor, and an encoder disk with 7 holes (6 positions and "home"). When the motor reaches its "home" position, the controller turns the motor off, and turns the relay off at the same time. This repeats at a specified time in software, or can be triggered using a button on the user interface.

Problem We are Having:
Sometimes, at some point in the middle of it's cycle, the controller either resets, or goes crazy. By "goes crazy" I mean the LCD displays funny characters (indicating the EEPROM has probably been corrupted), and the controller stops controlling the motor. sometimes the motor continues to PWM until the power is cycled (since we are using the built in hardware in the ATMEGA32A microcontroller), and sometimes the motor sees a full 24 Volts until a power cycle. If the controller resets, it works normally again. If it "goes crazy" it requires to be reprogrammed to reinitialize EEPROM to the correct values.

The problem we are having is hard to deal with because it is seemingly random, and hard to pinpoint when it exactly happens. Sometimes it runs perfectly fine for 30 or 50 cycles, then it runs a single cycle where it glitches and runs fine again for 30 or 50 complete cycles. There is nothing for me to trigger on, since most of the time the PWM just continues forever. It seems like the glitch always occurs either when the motor is running, or just as it turns on. I'm not sure since I can't trigger on the event.

Things I've checked/tried:
I checked 24 V supply at the motor, and it only dips a couple of volts when the motor turns on.

I am measuring the current in the motor with a current probe, and it spikes to about 6.5 Amps in about 2.5 ms, and then decays to 300 mA in about 30 or 50 ms.

I measured the 5 Volt supply and the reset line right at the microcontroller pins, with the scope ground also at the microcontroller pin. Both are stable and don't drop out when the glitch occurs.

I added 470uF at the motor positive to the Source of the MOSFET. It didn't stop the problem.

I disabled the relays (by shorting each of the bases of the BJTs that control them to it's emitter). The problem still happens.

I can't remove the motor, because the microcontroller does a fault check. If the motor doesn't start moving within 1 second it stops the motor and sets a fault.

ANY IDEAS! Is it hardware related, could it possibly be software related (maybe some overflow in some cases depending on current/voltage feedback)?
 

monnie

Newbie level 3
Joined
Aug 18, 2014
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
70
I just put a 150 nF capacitor in parallel with the motor, and it glitched every time just as the motor turned on. Also, the inrush current waveform was much sharper (very high di/dt). This led me to not believe what I saw on my oscilloscope, and instead believe that the 5V supply WAS dropping out. Maybe my cheap Rigol scope didn't detect the glitch? Lesson learned for next time, I guess.

So, I put a diode in front of the 5V regulator, and put a 1mF 35V electrolytic capacitor after the diode, before the regulator. This would keep the 5V regulator fed while the motor hogs all of the current from my power supply.

I just ran the controller over 100 cycles and it didn't even glitch once.

I'll modify my other sample and test it. If it works then I'll mark this post as solved. If nothing else this post gave me a good sounding board and will serve to educate others.
 

monnie

Newbie level 3
Joined
Aug 18, 2014
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
70
My other samples all are working now with this change.

For completeness, here is my theory:
when the motor turned on the large current draw bogged down the 24 Volt power supply so that it either:
1) fell below the minimum voltage required by the 5 Volt regulator and therefore the 5 Volt regulator turned off, turning off the microcontroller, which turned off the motor, which allowed the 24 Volt supply to come back up, which turned the microcontroller back on.
or
2) the 5V regulator couldn't react to the fast dv/dt in the 24 Volt supply, and lost regulation.

In either case, it really wasn't a "reset" in the classical sense, it was a power down and power back up.

Also, in either case, the diode stopped the capacitor at the input of the 5 Volt regulator from discharging "backwards" into the motor.

Monnie Holt
 

SunnySkyguy

Advanced Member level 5
Joined
Sep 26, 2007
Messages
6,747
Helped
1,678
Reputation
3,354
Reaction score
1,646
Trophy points
1,413
Location
Richmond Hill, ON, Canada
Activity points
50,747
Beware of inductive noise causing ground shift as well as glitches coupling into sensor inputs. CM Chokes or ferrite beads help with low impedance braid or litz wire to motor and comparing effective series resistance (ESR) of power source and MOSFET with motor winding resistance. Power Source ESR and ESL of wires should be much lower than load. Shielding of sensor wires ( twisted pair + shield) also helps improve noise immunity. Inrush current limiters (ICL) or NTC resistors) are also a cheap way of limiting motor surge currents at the expense of acceleration. ( avail from Digikey) PTC polyfuses are also one method of stall current protection. Motor position overshoot on reaching the home position can be improved by using braking effects of shorting the motor thru a small load resistance that does not exceed device current limits.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top