Question on ServoPal for various speeds
robot.girrl
Posts: 5
Good morning,
I am trying to use ServoPal for my boebot. I have tried to use it. I can make it turn - go forward and backward, but I am having a hard time adjusting the speed. Are you able to adjust the speed? I am trying to use it the same way I would using PULSOUT directly to the servos. If the values below should be running at different speeds then maybe the issue is in my code somewhere else.
How do you change the speed using ServoPal?
I tried using the following values for Move = FWD to change the speed, but it seems to be running at the same speed each time:
700, 800 forward
650, 850 forward
500, 1250forward
250, 1000forward
250, 1250forward
My code is similar to this:
Move = FWD 'Start BOE-Bot moving forward,
GOSUB DoMotor ' using the DoMotor routine.
DoMotor:
IF (Move = BKWD) THEN
PULSOUT nInp, 900
PULSOUT nInp, 600
ELSEIF (Move = LEFT) THEN
PULSOUT nInp, 600
PULSOUT nInp, 600
ELSEIF (Move = RIGHT) THEN
PULSOUT nInp, 900
PULSOUT nInp, 900
ELSE
PULSOUT nInp, 600
PULSOUT nInp, 900
ENDIF
RETURN
Thank you for your help
I am trying to use ServoPal for my boebot. I have tried to use it. I can make it turn - go forward and backward, but I am having a hard time adjusting the speed. Are you able to adjust the speed? I am trying to use it the same way I would using PULSOUT directly to the servos. If the values below should be running at different speeds then maybe the issue is in my code somewhere else.
How do you change the speed using ServoPal?
I tried using the following values for Move = FWD to change the speed, but it seems to be running at the same speed each time:
700, 800 forward
650, 850 forward
500, 1250forward
250, 1000forward
250, 1250forward
My code is similar to this:
Move = FWD 'Start BOE-Bot moving forward,
GOSUB DoMotor ' using the DoMotor routine.
DoMotor:
IF (Move = BKWD) THEN
PULSOUT nInp, 900
PULSOUT nInp, 600
ELSEIF (Move = LEFT) THEN
PULSOUT nInp, 600
PULSOUT nInp, 600
ELSEIF (Move = RIGHT) THEN
PULSOUT nInp, 900
PULSOUT nInp, 900
ELSE
PULSOUT nInp, 600
PULSOUT nInp, 900
ENDIF
RETURN
Thank you for your help
Comments
If you're getting a velocity near the maximum speed, you may want to try values closer to 750.
-Phil
*
I believe that this peice of code initiates the ServoPal
INPUT nInp********** 'Make sure nInp isn't being driven.
DO UNTIL nInp******* 'Wait for ServoPAL to power up.
LOOP
LOW nInp************ 'Set pin to an output and hold it low
PAUSE 100*********** ' for 100mS.
HIGH nInp*********** 'Raise the pin.
PULSOUT nInp, 2 <-- This line skips Servo 0
PULSOUT nInp, 500 <-- This line sets Servo 1 signal to 1mS (CW Med)
*
I am presuming the following (which may be what I am misunderstanding)
*
value pulse width direction & speed
********** 250 0.5 CW Full
********** 500 1 CW Med
********** 750 1.5 Stopped
******* 1,000 2 *CCW Med*
******* 1,250 2.5 *CCW Full*
*
*
so I am presuming that if I use:
*
PULSOUT nInp, 2 <-- This line skips Servo 0
PULSOUT nInp, 1000 <-- This line sets Servo 1 signal to 2mS (CCW Med speed*)
*
and
*
PULSOUT nInp,*750 <-- This line stops Servo 0
PULSOUT nInp, 750 <-- This line*stops Servo 1
and
*
PULSOUT nInp,*250 <-- This line sets Servo 0 signal to .5mS CW Full
PULSOUT nInp, 1250 <-- This line sets Servo 1 signal to 2.5mS CCW Full* -- so together Boe-Bot would move foward at full speed
*
and
*
PULSOUT nInp,*500 <-- This line sets Servo 0 signal to 1mS CW Med
PULSOUT nInp, 1000 <-- This line sets Servo 1 signal to 2mS CCW Med -- so together Boe-Bot would move foward at medium speed
*
and
*
PULSOUT nInp,*700 <-- This line sets Servo 0 signal to* CW Slow
PULSOUT nInp, 800 <-- This line sets Servo 1 signal to* CCW*Slow -- so together Boe-Bot would move foward at slow speed
*
*
I have noticed the following results while adjusting the code
nInp (servo 0) nInp (servo 1) direction ~ degrees
600 700 turn left 120
******* 1,250 ********** 250 backward 0
1250 1250 turn right 120
250 250 turn left 120
1250 750 Pivot back left 80
750 250 Pivot back right 80
********** 750 750 *Stopped* 0
********** 600 600 *left* 120
********** 900 900 *right* 120
********** 250 600 *left* 120
********** 250 750 Pivot left 45
********** 500 750 Pivot left 60
********** 600 750 Pivot left 60
********** 700 ********** 800 forward 0
********** 650 ********** 850 forward 0
********** 500 1,250 forward 0
********** 250 1,000 forward 0
250 1250 forward 0
*
Each time I changed the values I changed them in the same place and downloaded the code to the boe-bot. I was thinking the the last 5 cases would produce different speeds along with different degrees of turns, but instead boe-bot moved foward each time at the same
An example;
Slow: 740, 760
Medium: 720, 780
Fast: 700, 800
As you get further from 750 there will come a point where a greater value has no effect on the speed. That point is different for each servo so it will take some experimentation to find it. Right now, each of your speeds are far enough away from 750 that there may be no difference as far as the servo is concerned.
Rich H
Off-topic, but I'm curious what you used to enter/edit the post with all the asterisks in it. These typically appear in vBulletin whenever a non-breaking space is entered then edited.
BTW, it's much preferred if you put your program text between [noparse] [/noparse] tags.
Thanks,
-Phil
Thanks for the suggestions. I will give em a try tonight.
I will use tags next time.
:jumpin:
I used the following, and I could see a definite difference in the speeds. So I will go from there to see how far I can push it.
Slow: 740, 760
Medium: 720, 780
Fast: 700, 800
Thanks again. Boe-bot is off and rolling now :smilewinkgrin: