[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ok, my turn - studio & h-bridges/pwm

From: Jeff Mann   jeffjeffmann.com
Date: Mon, 16 Aug 2004 16:08:39 -0700

A! Sent via the Art & Robotics Group mailing list: arg-list@xxxxxxxxxxxxxxx
R! Use your "Reply All" to  reply to the list, "Reply" for private response
G!

Hi all -

Now for a couple of questions of my own:

First, (off-topic but there's lots of robotic stuff below!), the person who's subletting our studio while Michelle & I are in Amsterdam has decided to leave town, and we need to find someone to take it over on short notice (for September 1st). Available at least until the end of January, after that we'll see... It's a nice studio, nothing fancy, at King & Portland in Toronto - just minutes from Active Surplus & Supremetronics! Suits one person or a couple, good deal at $800/month including heat & electricity (what we pay). The catch is we still have a bunch of our stuff stored there, behind some curtains. please e-mail me directly if you or anyone you know might be interested. Also since we can't get back to Toronto at the moment, if anyone in there could maybe volunteer to help out with showing the studio to prospective subletters, that would be fantastic!

Second, I'm working on an h-bridge/pwm motor controller board for our "Telekinetics" project. If anyone has some good hands-on experience with this, I could use some advice. Maybe some of the sumo roboteers?

At the moment I'm using an L298 h-bridge because they're relatively cheap and easy to find. The motor is a common 12V gear-head motor, like a Pittman, about 4cm in diameter, takes 1A stalled, 50mA no load.

I built a prototype using software-generated pwm signals, so I could do several motors (eight) at once, as suggested by Jim. This means the pwm frequency is quite low, only about 125Hz. It seems to work ok using the "enable chopping" method, where the motor is on during the high part of the duty cycle, and coasts freely during the off time. The motor definitely buzzes, but it's not terribly annoying. With an inertial load (a spinning bowl of sugar cubes!) I'm measuring about 100mA throughout the speed range (measured at the motor supply terminal on the chip, not through the motor itself).

However, I much prefer the action of the motor using the "input chopping" method, where the motor is braked (its leads shorted) during the pwm off-time. The motor will begin turning at a much lower speed, and seems to have more torque at a given speed (or I suppose, a lower speed at a given torque), also it comes to a rapid stop when commanded to. The problem with this is that at such a low pwm frequency, the motor draws more than double the current, eg. 230mA, and the chip gets twice as hot. Raising the pwm frequency (using hardware pwm) above 1kHz brings the current back down to 100mA or so.

Raising it to 16kHz though, causes the current to go up again, to 170mA with input chopping (and up to 400mA with antiphase chopping, see below), while it goes down to 70mA with enable chopping - so question #1: why does current go up so drastically with frequency? I mean I was expecting some switching losses, but up to four times the normal motor current? Doesn't seem right. And why isn't enable chopping affected? B.t.w., the L298 typical commutation frequency is listed at 25kHz in the data sheet.

Anyways, at between 1-4kHz, it runs quite well. I thought of trying to get the software pwm frequency up to 1kHz, it might be (barely) possible with a 40MHz PIC. But at 1kHz, the noise is quite objectionable. The 4kHz is much quieter. So I decided to use the new PIC18F4331, which has six hardware pwm outputs.

But the problem now is, to do input chopping you need to apply the pwm signal to one input to go forwards, and to the other input to go backwards (while holding the opposite one low). But the hardware pwm is fixed on a specific output pin, I can't change it the way I can with software. so question #2: can anyone think of a way to do this?

So then I thought I would use the common "locked anti-phase" method of pwm control, where the voltage on the motor is reversed during the pwm off time. The theory is that if the pwm frequency is high enough, at 50% duty cycle the motor will stand still (i.e. brake), and no current will
actually flow through the motor because of its inductance. It should give me the braked-motor action I prefer, plus reduce the number of control pins used on the chip. Also it should be easiest to use with a discrete-transistor h-bridge or the "open source motor controller" if I want bigger motors.


Well the theory is nice, but it's not what I'm seeing, and I usually trust my multimeter over theory (especially my own). At 1kHz, I'm seeing 125mA at zero speed. At 4kHz, it's 135mA, 8kHz 220mA, and 16kHz up to 500mA! The current decreases as the speed increases, but still is somewhat higher than the other methods, especially at the higher frequencies. But this full-on current at zero speed will be a killer on my batteries. So question #3: where is my zero current at 50% duty cycle? Is it just a myth? Is it something with the particular bridge (L298) I'm using? The recirculation diodes (I'm using fast recovery 1N4935s)? The motor?

Ok that's five questions. But I really want to know this part, it would be great if I could use the "locked anti-phase" method.

Here's some of my test data. Current listed is for the motor running about half-speed, which is usually the maximum current reading. The current measurements seem to correspond to chip temperature readings I also took.

125hz
enable    - 100mA
input     - 230mA
antiphase (didn't test)

1khz
enable    - 100mA
input     - 110mA
antiphase - 113mA (125mA at zero speed)

4khz
enable    - 105mA
input     - 110mA
antiphase - 135mA (135mA at zero speed)

16khz
enable    -  70mA
input     - 170mA
antiphase - 410mA (500mA at zero speed)

cu later <Jeff

A!
R!      messages saved at http://www.interaccess.org/arg/arg-list.html
G!      unsubscribe/help requests to mailto:Majordomo@xxxxxxxxxxxxxxx