View unanswered posts | View active topics It is currently Fri Oct 24, 2014 12:08 pm

Reply to topic  [ 3 posts ] 
Author Message

Joined: Thu May 17, 2012 3:35 pm
Posts: 35
Post servoChangeRate

I want to slowdown my servo motor. (Tetrix)


task main()

while (true) {

servo[servo1] = 126;

  int delta = 10000;
  servoChangeRate[servo1] = delta;
  servo[servo1] = 150;


I tried different delta rates, but it´s to fast. The Servo motor should move very slow. Who have an idea???

Please help.


Sun Dec 16, 2012 5:24 am
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: servoChangeRate
We don't use servoChangeRate. In our servo library module, we allow specifying a "step rate" for the servo. So you can slow it down. The idea is setting your target servo angle and specifying how long you need to reach that target. For example:
ServoSetAngle(g_WristServo, 180, 1000);

The above code means to turn the wrist up 180 degrees in 1 second2. So it means 180/1 = 180 degree/sec. If your robot loop is running every 100 msec, then it means you should step 18 degrees per loop. It works quite well for us. But obviously, the servo is still moving at its own speed. So the stepping will be moving/stopping on every step. In other words, it looks "robotically jerky". But it does what we want it to do.
According to your code and the RobotC documentation:
Specifies the rate at which an individual servo value is changed. A value of zero inidcates servo will move at maximum speed. The change rate is a useful variable for "smoothing" the movement of the servos and preventing jerky motion from software calculated rapid and wide changes in the servo value. The default value is a change rate of 10 positions on every servo update which occurs. (updates occur every 20 milliseconds)

You are specifying 10000 which means 10000 positions per update cycle (20 msec). This is very fast, not slowing down. The default is 10. If you want to slow down, you should specify 1. That's the slowest you can get.

Sun Dec 16, 2012 10:28 am

Joined: Thu May 17, 2012 3:35 pm
Posts: 35
Post Re: servoChangeRate
Thank you very much. I will test how many degrees have the steps:

60 to 40.

I will try.

Sun Dec 16, 2012 2:12 pm
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.