Motor Speed Control
bluejay
Posts: 131
in BASIC Stamp
Does anyone has a program for controlling speed on a dc motor?
I am using pwm with a L298N Dual H-Bridge Motor Driver Module. Thanks in advance.
Comments
The tricky thing about the BASIC Stamp is that it doesn't have set-and-forget PWM capability, so motor control without external help is quite difficult -- unless you only need to coast, stop, run full-speed forward, or run full-speed reverse.
I have some control using the following command :
DO
PWM 1, 80, 1000
Loop
80 signifies duty cycle. Formula for duty cycle is (duty/256) * 5 v = duty cycle.
By increasing duty cycle greater than 80 (max is 256) voltage on dc motor increases and therefore speed increases.