sysysy
Joined: 17 Nov 2010 Posts: 38 Location: 121
|
PWM in control dc motor speed (Both direction) |
Posted: Wed Dec 08, 2010 12:46 pm |
|
|
Hi,
I am using 16f877a PIC to control my 2 dc motor via L298 motor driver.(dual channel)
Since 16f877a only got 2 PWM pin, and I've used it for controlling both of my motor speed.
Initially, I use each of the pin to control each of my dc motor speed to running forward. Hence, I have no pins left for controlling the motor speed running reverse.
As we know, we need to set 1 input high and 1 input low to make the motor run.
My question is, can I only use 2 PWM pin but can control 2 of my DC motor speed running forward and backward as well? The concept is when running backward, I make 2 input also high, but one of the input is control by PWM.
Hence, there is a potential different between 2 input and manage to make the moving backward.
When I set my duty cycle for PWM very high, that mean motor will run faster in forward direction but slower in backward direction.
When I set my duty cycle for PWM very low, that mean motor will run slower in forward direction but faster in backward direction.
I try it and it really work. But I just worry is this danger to my circuit or driver?
Hope will get some opinions.
Thanks,
Regards,
sysysy |
|