There are several ways to drive a load with an H-bridge. What I proposed was something called "Locked Antiphase". I wrote a paper: www.barello.net/Papers/Motion_Control that describes the two common drive techniques. If you want to stick with Sign-Magnitude drive just use one the A line for PWM and use the B line for forward/reverse. When in reverse you need to invert the PWM signal. That is just a bit set/reset with the AVR (read the data sheet). Locked anti-phase works great, but the ripple current through the motor can be unreasonable if your frequencies are not high enough. What is high enough? Well, it all depends upon your motor. Cheap motors with iron cores can be driven with 10-15khz. Coreless motors need 60-100khz (or just suffer the high ripple current...) (I am talking about hobby stuff, not big battle bot or industrial motors...) Personally, I never use the enable lines anymore. I aways drive the load. I have another paper I wrote explaining why (it is pretty high level & moves fast): www.barello.net/Papers/H-bridge.pdf Just an FYI: I set up a motor, H-Bridge and oscilloscope to measure the voltage across the lower FET body (for current) and was able to demonstrate all the hand drawn charts. They are really true. Cheers! -----Original Message----- From: ethan@bufbotics.org [mailto:ethan@bufbotics.org] Sent: Monday, January 31, 2005 7:34 AM To: AVR-Chat@yahoogroups.com Subject: RE: [AVR-Chat] tiny26, motor driver, and ISP Larry Barello said: > Don't use the enable line for PWM input. Use the complementary PWM > outputs > to drive the A & B side of the H-Bridge and use the enable line to, > well, > enable the driver. > Larry, Thank you for the feedback. I hadn't thought of using PWM on the A and B lines. I'm having a tough time visualizing what'll be happening though. Here's the mental picture I had of my original "PWM on the Enable Line" scenario: I can easily picture what happens when I set A=1 and B=0 for a motor. It'll go clockwise. Similarly, set A=0 and B=1, and I get reverse (counter clockwise). And the PWM signal on the Enable line then turns the motor on for only small snippets of time, as defined by the duty-cycle. Also in this scenario, I can set A=B and get braking mode. Now I'm trying to picture Larry's suggestion of using complementary PWM on A & B lines. Firstly, I can easily picture the Enable line now. Its now used simply for enable/disable, with no "rapid" switching like PWM. Then my vision gets cloudy of what's happening on the A & B pins. My limited understanding is that pin A will experience an average voltage proportional to the duty-cycle of the PWM signal. Pin B will experience the complementary average voltage. But what does this actually do for me? Doesn't it cause the direction of motor motion to switch really rapidly (at the PWM frequency)? I would love it if you would take tht time to explain intuitively what's happening. Ethan www.bufbotics.org Yahoo! Groups Links
Message
RE: [AVR-Chat] tiny26, motor driver, and ISP
2005-01-31 by Larry Barello
Attachments
- No local attachments were found for this message.