Hey there,
Here's my situation: I need to drive 10 h-bridges to control motors of various sizes (windshield wipers, etc.) in a servo-type configuration. In essence, I need 20
PWM pins, and I'm using an Arduino Mega, which I believe only has 12. Initially, I tried simply using the guts of a hobby servo to drive the h-bridge, but this failed horribly - apparently most of these hobby servos using an alternating PWM to control the DC motor - in essence not on and off pulses, but forward and backward pulses. Therefore, the motor vibrated horribly and will surely shake the robot to pieces if I use that configuration.
Therefore, I'm now trying to "roll my own" servos. I've already got some PID code up and running, and my initial test with a single motor and pot on A0 went well. Is there any possible way to create a "software PWM" setup to control all of these h-bridges? I've seen other forum posts like this one: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1278251011/all that deal with this, but the problem is, the program essentially has to stop while the pulsing is going on. I need to be able to update each of the 10 motors with the PID value at least every 15 ms. Is there any way to do this?
Thanks!
Edit: To clear any confusion, the PWM I need is being used to control DC motors directly, without a servo mechanism/IC in between. Therefore, I do need analogWrite-type functionality; i.e. whereas in a servo the position is updated every 20 ms, in my application the dc motor itself needs to be updated continuously, and as fast as possible.