continous rotation

rob nash

Senior Member
hello all
another servo Q,
well am playing wth the cont,servo's gbx012 have em going backwards forwards,,
is this the norm?

main:
servopos 0,70 'servo 1 fulforward
servopos 1,70 'servo 2 slowback

it didnt take long to confuse me,, but when i did this..
main:
servopos 0,70
servpos 1, 220
BING GO both went forward hahah like the mad hater. then i realised that i cant controll the time they on,,,:(:
HELP please should i be looking at pulsin ,,
 

BeanieBots

Moderator
Before you can use the servopos command, you must first issue a servo command.
try this: it should go full one way, stop, then full the other way

Code:
servo 0,150 'adjust the value 150 to give stopped
servo 1,150

do
  servopos 0,75 'full speed
  servopos 1,225 'full speed the other way
  pause 3000
  servopos 0,150
  servopos 1,150
  pause 2000
  servopos 0,225
  servopos 1,75
  pasue 3000
loop
 

Technical

Technical Support
Staff member
The normal layout is to have two back to back (ie normal wheel arrangement) - hence they are laid out the opposite way to each other and so yes, forward wheel direction on one will be reverse wheel direction on the other...
 

westaust55

Moderator
From what I have learnt about servos recently, the nominal mid position is achieve with a value of ~150.

As the magnitude of the difference between actual servo shaft position and required position increases, the motor speed also increase. Thus the motor reduces speed as it approaches the target position.

While I have not done any work with continuous rotation, it would seem that by adjusting the position values, the motor speed can be changed. Thus

Servopos 1, 70 ; bring this value closer to 150 to reduce the motor speed.
servpos 1, 220 ; bring this value closer to 150 to reduce the motor speed.

So by changing the “position” values I think that you will change the speed and thus be able to trim the motor speeds for travel in a straighter line.
 

Technical

Technical Support
Staff member
When working like this the exact values need to be found by experimentation. We would recommend you use symbols rather than actual numbers. You can then tweak each easily.

Code:
symbol r_off = 150
symbol r_forward_slow = 100
symbol r_forward_fast = 75
symbol r_back_slow = 200
symbol r_back_fast = 225
 
symbol l_off = 150
symbol l_forward_slow = 200
symbol l_forward_fast = 225
symbol l_back_slow = 100
symbol l_back_fast = 75
 
symbol l = 1
symbol r = 2
 
servo r, r_off
servo l, l_off
 
main:
servopos r, r_off
servopos l, l_off
pause 2000
servopos r, r_forward_fast
servopos l, l_forward_fast
pause 2000
goto main
 
Last edited:

Wrenow

Senior Member
Also, keep in mind that with most servos that have been modified for continuous rotation, and including some like the Hitec CR1425 which come from the factory set for continuous rotation, the range of control from stop to full speed is pretty darned tight (usable, but tight for really fine control).

If you want finer control of the motor speed, using something like the Vex Motor (looks like a servo, but has a more full-range ESC built in rather than the normal servo amplifier board), or replacing the servo amplifier board in the servo with an ESC (Electronic Speed Controller) will five you much finer control over your speed.

As an illustration, a normal servo might be 150 for neutral, 165 for full speed. With and ESC based system, you might have a range of 150 being neutral and 195 being full speed. I am currently working on an article comparing some of these devices, by the way.

Also, if wou want to mod a servo to the same system as the Vex, Vex does sell the ESC board (under Logic Devices on their web site for some reason) for about USD$10.

Cheers,

Wreno
 
Top