so I am using the ever so popular L293D to drive a DC motor with control over speed an direction. But there's an odd thing I noticed.
All tutorials I've seen use 3 Pins to drive one motor: Enable (with PWM for speed) + 2 Digital outs for direction logic & stop.
Like here http://itp.nyu.edu/physcomp/Labs/DCMotorControl (connections to Aruino added in blue)
Thanks for that link - I'm still slightly confused, as the schematich there uses an additional "tri-state switch", which I didn't find necessary. But poking arround that website gave me this: http://www.barello.net/Papers/Motion_Control/index.htm
There is an alternative way to drive the motor: The Enable bit is left ON all the time. One half of the H-Bridge is set forward or backwards and the PWM signal drives the other half of the bridge. The effect of this technique is that the motor is alternatively driven and shorted with the ratio set by the PWM signal
which I guess is what I'm doing. It even hints at using "locked-antiphase" to use only one pin per motor, but that I haven't understood quite yet.
I think the truth table in your pictures should say "Slow Motor Stop" when the Enable pin is low.
If you always have the Enable pin high and use PWM on an input for speed control, the output will alternate between HIGH and LOW. When both outputs are either HIGH or LOW, the motor will be braking. Imagine driving your car manually by 1Hz 50% PWM. You would stomp on the gas for one half second, then stomp on the brakes for one half second, and repeat.
If you use PWM on the Enable pin, the outputs will be in the X (high impendance) state when the EN pin is low. In our 50% PWM example, the motor won't be braking during half of the PWM cycle. This is like driving your car by stomping on the gas for one half second, then release it for one half second, and repeat.
Thanks for the explanation, the different stop modes make sense to me.
I think the startup behaviour at pwm settings that just begin to start a rotation is different with the two ways to dive the h-bridge. My current setup doesn't really allow for accurate easurement, but "drive & break" is a description that matches my observations