Help with H-bridge

Raka, Mon May 08 2017, 07:19PM

I would like to use the arduino code by Misan (Link2 to implement a servo for a cnc machine. The h-bridge I build is similar to the one in the attached schematic, with IRF4905's and IRF3205's, I also added four STPF20H100 diodes for flywheel diodes. The motor is a standard 12v wiper motor, with an optical quadrature encoder added, the arduino is a nano and the input is 12v
The setup is working, but every once in a while when the motor reached its set point, there is a +-3 Amp current in one leg of the bridge, this current increases at a steady rate until I have to shut it down.
Can someone please tell me why this is and what I can do to correct it.
Some additional information:
Tested at no load
Only a small proportional gain is used at this stage, no I or D term used
Current trough the motor when running 0.9A, no current trough motor when fault occurs, no oscillation of motor.
Sometimes the left leg will get hot and sometimes the right. Left leg is on one heat sink and right leg is on another heat sink

1494271181 1838 FT0 Mosfeth1
Re: Help with H-bridge
Dr. Slack, Tue May 09 2017, 05:15AM

Do you have an oscilloscope? If not, get one.

Why should one leg get hot? If one leg is solid on, and the other is PWMing at some small duty cycle, the motor may not turn, but the active leg will have higher losses than the other. What is the activity on the drivers in this 'gets hot' condition? The scope will show you, or perhaps you could instrument the Arduino code to find out what it's doing, if you can do that without trashing the timing.

If you're trying to control the position of a motor by feedback with only a P term, it *will* oscillate, you need the D term to stabilise the loop. The I term is less important for stability, though as it allows you zero position error, it does allow you to turn the wick down on the P term, which can ease stability.
Re: Help with H-bridge
Raka, Sun May 14 2017, 08:39AM

Found the problem. The arduino's pwm frequency were raised to be out of the audio range. That was to fast for the opto isolators