I recently put together a L293D motor driver circuit (from Bajdi's very helpful website: http://www.bajdi.com/obstacle-avoiding-robot-made-from-cheap-parts/l293d-schematic/).
When I use PWM from a Teensy 2.0 (analogWrite) on the enable pins, the motors only make a soft high-pitched whining sound and don't move at all (but max duty cycle works of course). Using digitalWrite, the motors rotate fine. I would like to have speed control but am stumped about why the motors don't rotate. I've seen others use PWM on the enable pins fine so it might be my motors.
The motors I am using are cheap micro metal gear motors (like these: http://www.ebay.com/itm/DC-1-5-12V-3v-6v-9v-100rpm-200rpm-Geared-Motor-Micro-Metal-Geared-Electric-Motor-/271023316063?pt=LH_DefaultDomain_0&hash=item3f1a3f9c5f).
Any help would be appreciated and thanks in advance.
Thanks for the link. I have slight different circuit than the one described in that post (I’m not tying the enable pins high). I’m not having issues in the code, I’m just not sure why the motor doesn’t move even when I (I think I am) send the appropriate control signals.
Each motor only needs two pins (one for direction, other for enable) because both of the direction pins on the L293D for one motor are tied to the same pin and one of them is inverted. (same for the other motor control pins)
In the code I’m just setting the pins connected to the transistors low and then sending the PWM to the enable pins.
I’m new here! I have just got PWM to work on my robot, which I posted up yesterday. I used a Picaxe 20M2 but found that if I try driving the motors at anything above 100Hz, they just hum or whistle, The picaxe editor defaults to 10KHz when setting the PWM, fine to dimming LEDs and lamps but not much good for mechanical stuff like DC motors, so you need to change it?? My motors also run from an L293 but are connected to 6x AA Nimh cells giving about 7.3v then a LDO reg for the 5v logic.