Differential_drive module + Continious servo rotations values
Cherault from France  [8 posts]
10 year
Dear all,

My goal is really simple.
I just want to drive an arduino's robot with two continious servo rotation for the left and right, more a tilt which support the camera.
I would like to use the differential module you have, but i don't understand the point to convert the values.

You said in your tutorial that all values at mid point is set to 128, ok, no problem.
But how can i translate those values to a continous servo rotation ?
Usually, the servos values are set between 900 and 2200ms (PWM).
In a continious rotation, those values indicates just the speed rotation.

How can i do to translate correctly those values to my servos ?

Thanks for your help.
Steven from United States  [1445 posts] 10 year
The midpoint of 128 is for a non-Arduino SSC (servo controller). Most will use different values than what you need. In the differential module you can specify the range that you are converting from and converting to and it will take care of the rest (its actually a simple conversion formula).

So in your case you want to translate the X position of something within an image (lets assume a 640x480 image) which would be 0 to 640 to your servo range which is 900 to 2200 with a set speed of whatever (I set it to 250). This assumes you are getting your X value from an image as apposed to a joystick which the module defaults to as -1000 to 1000.

See the attached robofile as an example.


Cherault from France  [8 posts] 10 year

Thanks a lot for your help.
This is exactly what i needed, so thanks again !



This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index