Servo.speed(..) and continuous rotation.

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
herchu
Posts: 1
Joined: Sun Aug 24, 2014 12:30 pm

Servo.speed(..) and continuous rotation.

Post by herchu » Sun Aug 24, 2014 1:58 pm

I received the board some weeks ago and this weekend started to play with it. Had a lot of fun following the tutorial and trying the extra exercises!
What I didn't get is what's Servo.speed suppose to do. I thought that it starts to continuous rotate the motor (clock/counterwise) but for me it works exactly like angle. Am I missing something here?
I'm using the stock pyboard with the HS-55 servo (the Kickstarter wireless kit).

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: Servo.speed(..) and continuous rotation.

Post by dhylands » Sun Aug 24, 2014 5:46 pm

Continuous Rotation servos are modified versions of regular servos.

You normally disconnect the shaft potentiometer, and connect up a couple of resistors in place of the potentiometer. This fakes out the servo driver and tells it that the shaft is in a central position all of the time.

The servo drivers look at the current position (faked out to say its in the middle) and the desired position (whats being sent over the control line). The further away the desired position is from the current position, the faster the driver will drive the motor. Some servos do this more than others, and some don't do it at all. It really depends on the brand of the servo.

So yes - setting the speed of a continuous rotation servo is exactly the same thing as setting the angle. But the semantics are different, so the code looks a litle cleaner when calling a set speed function rather than a set angle function.

Post Reply