I've got a L293D and I've got a PIC16F877A outputting PWM. It's notNot real PWM, just using Timer0 to turn on aON a pin for 2ms2 ms and offOFF for 18ms, bringing a total18 ms (total of 20ms20 ms period).
W.R.T. to the above schematic I got VSSVSS
, VCVC
, CHIP 1CHIP 1
and 2CHIP 2
up to 5V.
My current method of controlling the motor is to turn input 1 and 2 on-off from the PWM, to control the outputs 1 and 2. My motor is a hacked servo motor that runs 360 degrees. What I did
EDIT: My motor is thata pre-hacked RC servo motor, when input 1specifically the Cytron C36S, hacked to run continuously (i.e. behave as a normal motor, no longer as a typical servo motor)
My approach
When input 1
is onON and 2input 2
is offOFF, promptingit prompts the motor to run one way, input 1input 1
is not always onON. Since input 1input 1
is the PWM output from the PIC, it'll turn on 2msON (HIGH) for 2 ms and off 18ms continuously soOFF (LOW) for 18 ms in continuous cycle of 20 ms. Using
But using this setup, my motor isn't properly working; sometimes it runs slower than usual (this is actually what I want) but most of the time it just hums in its place, no movement whatsoever.
How cando I improve this configuration, or is there a better way to control motor speed using L293D that I'm not aware of? If possible I want to use l293D as buying new components/ICs are too much of a hassle...
EDIT: My motor is a Cytron C36S servo motor, hacked to run continuously(i.e. behaves as a normal motor, no longer as servo motor)