Hi all, yes! There is a question at the end of this.
My home made board has a 20x2 and Two L293D motor driver chips.
I use it with 12Vdc motors to drive my Meccano models.
I am controlling 4 motors forwards and reverse and all have PWM Softstart/Softstop
To do this I use Pulsout in subroutines, this give me the option of SoftStart /SoftStop on all outputs.
To find the values required, I observed the rise and fall of the needle on 12V anologe volt meter and also output shaft of the motor. These PWM SoftStart/SoftStop subroutines really do work well on a 12Voltgeared motor.
At last the questions. (I have tried).
Can I control the SPEED of a 12V motor using Pulsout in a similar subroutine method ?
A poke in the right direction ,or better still a bit of code would be much appreciated.
Thanks Brian
My home made board has a 20x2 and Two L293D motor driver chips.
I use it with 12Vdc motors to drive my Meccano models.
I am controlling 4 motors forwards and reverse and all have PWM Softstart/Softstop
To do this I use Pulsout in subroutines, this give me the option of SoftStart /SoftStop on all outputs.
To find the values required, I observed the rise and fall of the needle on 12V anologe volt meter and also output shaft of the motor. These PWM SoftStart/SoftStop subroutines really do work well on a 12Voltgeared motor.
At last the questions. (I have tried).
Can I control the SPEED of a 12V motor using Pulsout in a similar subroutine method ?
A poke in the right direction ,or better still a bit of code would be much appreciated.
Thanks Brian
Code:
SoftStart: 'UP from zero volts to 12 Volts
pause 100
low 4 'Low 4 as 5 is going high.
w0=100 'set the primary pulse time at 100ms
w4=50 'set the primary pause time at 50ms
w1=0 'set the Do count to 0
Do 'start of Do loop
inc W1 'adds 1 to W1 to count the number of pulses
dec W4 'decrease W4 by 1 to decrease the pause time by 1ms
W0=W0 +100 'increases the primary pulse time by 100ms
pulsout 5,w0 'pulsout the value of W0 on output 5
pause w4 'pause decreasing between pulses
Loop until w1=50'sets the number of pulses to be counted
w0=100
w1=0
high 5
END
SoftStop:'DOWN from 12volts to Zero Volts
pause 100
low 4
w0=100
w4=50
W1=0
Do
inc W1
dec W4
W0=W0 +100
pulsout 5,w0
pause w4
Loop until w1=50
w0=100
w1=0
low 5
END