Creating PWM signal similar to RC receiver using a BS2px
Lex
Posts: 13
Hi,
I''m using a dual H-bridge board to control 2 dc motors. I've test out the board using the RC tranceiver.
However, my intention is to use the px to control the motors. the PWM command dun seems to work.
Any suggestions?
I''m using a dual H-bridge board to control 2 dc motors. I've test out the board using the RC tranceiver.
However, my intention is to use the px to control the motors. the PWM command dun seems to work.
Any suggestions?
Comments
Dave
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Dave Andreae
Parallax Tech Support·
1 ms = turn left or reverse
1.5 ms = neutral
2 ms = turn right or forward
Is there a difference between the PWM & PULSOUT command?
here's the PULSOUT version:
· FOR i = 1 TO 100
·· ·PULSOUT 7, 1250··············· '1250 = 1 ms; 1875 = 1.5 ms; 2500 = 2 ms
··· PAUSE 10
·
· NEXT
···
···· RETURN
the version is very jerky.
here's the PWM version:
start:
·
· PWM 7, 255, 3······ '3 * .4 ms = 1.2 ms ~ 1.0 ms
·
· GOTO start
no response for this version. am i right to say that the Duty will control the speed of the output?
thanx
·
Read the manual chapters on the PWM and PULSOUT statements if you want to understand the difference between them.
FOR i = 1 TO 20 'Set motion time
PULSOUT DC_Throttle, 1875 '1250 = forward; 1875 = neutral; 2500 = reverse
PULSOUT DC_Steer, 2500 '1250 = left; 1875 = neutral; 2500 = right
NEXT
RETURN
However, this program does not permit speed control. Is there anyway to overcome this?
If it does, how should be the input signal ?
BS can generate lots of signals, but you have to know what kind of signal you need !
As for the type of signals, I believe it's the same as the RC signals, which is PWM right?