PDA

View Full Version : H-Bridge control DC motor



Paul F
- 2nd March 2005, 01:03
Hello All,
I am using a L6203 single H-Bridge driver and PWM to control a dc motor which rotates a flat bed clockwise or anticlockwise as selected. When driven from a bench top power supply at a voltage of 30v, the current drawn is between 200mA to 400mA depending on the PWM frequency. The current settings are 1ms on (H), 9 ms off (L). The flatbed position is obtained by using a digital potentiometer connected to the centre of the table. As the table rotates through 360 deg so does the pot. The pot output is approx 50mv at 0 deg rising linearly to about 4.6v at 360 degrees. Each degree of rotation being approximately 12.6mv.
The problem is that as the H-bridge is driven, it creates spikes on the dc supplies (30v motor supply and 5v logic suppy) even though they are heavily filtered. These spikes feed back to the pot output which messes up my ADC reading and so the position of the table is lost.
The dc motor has been replace by an 8 ohm resistive load and the spikes remain.
I would be grateful for any help or advice.
Cheers
Paul

mister_e
- 2nd March 2005, 04:20
o.k. i can figure something like that, but can you post a real schematic?!? case not we can still imagine something.

Did you try a capacitor between wiper pot and ground close to the PIC. It can also be a kind of ground loop...

what is the POT impedance?!? Where the supply come for the POT?

Maybe some kind of isolated dc-dc converter on the 5v can help. Opto coupler between PIC and h-bridge driver to be ground isolated.

OR probably also isolated your digital ground of the analog ground can also give a better result.

can be many things. Can also be caused by some floating pin not tied to ground or VCC. What about the 5V supply line ???

If you can post picture of the final stuff and schematic, we can help.

Acetronics2
- 2nd March 2005, 11:04
Hi Paul,

Steve is absolutely right ...

can't you derive your pot supply from a separate IC Regulator and filtering caps. a 78L05 or LM 317 L ( better to use: Zout smaller !!! ) could be sufficient here.
There's margin between 30 v and 5 v ... a very low pass R-C filter ahead the regulator could help further.

Using an op amp as a low pass filter ( sallen and Key i.e ) close to the pot to lower glitches catching on the line is to consider too.

THE Rich solution is to fully separate PIC and 6203 supplies from mains and use opto-isolation. The surest solution too.

Driving 7 segments Leds is also a funny sport, in this way. Beautiful spikes too.

Alain

Paul F
- 2nd March 2005, 22:17
Hi All,
Many thanks for your replies so far. Many of your thought have been my thoughts, heavy duty wire connections, ground loops, filtering etc:
I will attempt to post a schematic in pdf format but I have not done this before and hope it works OK.

The schematic is the second circuit built that I tried. It seperates the logic side via opto- isolators and has isolated 5v & 30v supplies.

The original circuit had a single power supply giving +30v and +5v supply with common ground. It was identical to the one posted except the opto-isolators were not used and neither was the choke at the 5v input to the logic.
Hope this helps
Paul

mister_e
- 3rd March 2005, 04:15
probably a little mistake but... From your your OPTO coupler output untill the end, ground muts be tie to GND instead of GND-A

GND-A is the PIC side ground.. right?!? Also 7805 circuit. Must be 470uF or more at the input + 0.1uF. Output 10-47uF + 0.1uF

Last thing 3.3K for the Zener diode... about 7mA... i find it's a bit low. 15-20 mA is a little bit safer. Use 1.2K

Paul F
- 3rd March 2005, 21:03
Hello Steve,
You are correct. The Opto-isolators are grounded to the ouptut side. Error in drawing up the schematic. I am testing using 2 bench power supplies, 5v,1A and 30V,1A at the moment but I do take the point about the caps.

Scoping the circuit shows that the spikes on the supply lines are in line with the rising and falling edge of the driving PWM signal. Seems as though the mosfets within the L6203 when switching are causing my problem.

There is a fudge I've looked at today. If I ensure that the ADC does not do a read untill the pulse has driven the motor (1ms On, 9ms OFF) then I should not read any noise on the pot. Wait for the L to H then the H to L (1mS driving pulse), pause a few millisecs and then read, having 9mS to take a reading before the next 1mS driving pulse.
I sure this will sort out the ADC reading but I'm still unhappy as to why I have not worked out how to stop the H-Bridge from spiking the supplies.
Many thanks to all for advice so far. Much appreciated.
Cheers
Paul

mister_e
- 3rd March 2005, 21:23
one thing can be done... take multiple ADC reading and look at them after. if one is very different from the other, discard them/him and do an average of the others.

Maximum current driving of your 30V supply may also be the cause. If your motor ask for more or close to 1A when you apply the power on, your power supply can fall in a kind of current protection wich really drop the voltage or cause some spike. Depending on how good he is. In general motor will ask more current on the few uSec the power is apply on. The spec of the motor will tell you the average needed current without any load to drive and while he's already running for a few mSec or Usec. That has to be consider. Safe when you supply is 2-3 time higher than the current motor need.

nomada
- 10th March 2005, 01:43
Hello all
I don't know if this get in time yet, but....
Paul I hope that your workbench power supply has two different transformers, one for each power rail otherwise you maybe inducing noise right from the transformer.
In a machine I've worked with which has a vertical platform and the position was obtained from a pot I needed to take the wires away from the pot from those who controls the power (high induction through the wires) and as mister_e wrote it is a good practice to take a decent set of readings and discard the ones that goes out of the scale, in my machine the use of capacitor with the pot proved to be a bad choice so I discarded the capacitor and used a shielded cable (the pot was 2 meters away from the PIC16F877A).
Hope that you solved your problem

Paul F
- 11th March 2005, 13:50
Hello Normanda,
I think I have tried everything. Seperate bench supplies, Heavy wires, inductive filters in the supply lines, large resevoir cap 10,000uF.
The system is working now. The spikes on the supply was caused when the L6203 was being switched on and off, (pulsed driven).
I now only read the adc during the period when the L6203 is not driven and the results so far appear to be acceptable.

Many thanks for your reply especially the hint on screend cable to the pot and everyone else who offered their help and advice.

Many thanks to all
Paul