Go Down

Topic: Question on monitoring the rotation of continuous servos (Read 2 times) previous topic - next topic


Jan 01, 2013, 09:46 pm Last Edit: Jan 01, 2013, 09:48 pm by brian305 Reason: 1
I am trying currently trying to covert a project I did with NXT using Lejos to Arduino.  I am using a Parallax BOE shield bot and Parallax continuous rotation servos. 

In the NXT/Lejos project I was able to map the robot in 2d space by using the compass and counting the rotation of both servos in a differential setup.

I am very close to getting the Arduino based robot to do the same but I cannot figure out how to accurately count the servo rotations.  It seems that the NXT servos allowed for this as all api's for the NXT servos provided some form of getTachoCount() method that would return the current count of the servo.  It was also possible to rotate the continuous servos a particular amount of degrees

Can anyone suggest a way to do this?  I have not been turning up much in my searching, but i might not be looking for the right thing so any terms you can think of that might be helpful to my searching would be appreciated as well.  At this point my best guess is to find the amount of time it takes the servo to rotate once at full speed and then do the math.  But I have a feeling this will become in-accurate rather quickly.  Are there any clever libraries already in existence?

I am open to completely new approaches but would like to work with what I have if possible.




A 3-pin 'continuous rotation servo' gives much less feedback than a 6-pin NXT motor.  To get the kind of control you want you should use a gearmotor with rotary encoder feedback.
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e


Thank you very much, reading up on gear ratios, etc.


Can anyone suggest a way to do this?

Perhaps as a troubleshooting/isolation thing put a serial print statement printing out the raw joystick measurements you are getting from your analogRead commands to see what raw values it is seeing when you have the servo hunting problem. Many joy sticks have pretty poor centering qualities so you need to try and isolate the problem to being a joy stick or servo problem. Also post your code for better possible analysis. What are the pot ohm values used in your joystick?



Jan 02, 2013, 05:11 pm Last Edit: Jan 04, 2013, 11:26 pm by kf2qd Reason: 1
Or you need to add a switch to you servo that trips once or twice or 4 times every revolution. The based on what direction it it running you add or subtract from a counter to get some position information. Either that or add an encoder (more expensive...)

Go Up