View unanswered posts | View active topics It is currently Thu Jul 31, 2014 7:42 pm






Reply to topic  [ 3 posts ] 
servoChangeRate 
Author Message
Rookie

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

I want to slowdown my servo motor. (Tetrix)

Code:


task main()
{
   

while (true) {

servo[servo1] = 126;

  int delta = 10000;
  servoChangeRate[servo1] = delta;
  wait1Msec(2000);
  servo[servo1] = 150;
wait1Msec(1000);
}

}


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

Please help.

Thanks


Sun Dec 16, 2012 5:24 am
Profile
Guru
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:
Code:
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:
Quote:
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
Profile
Rookie

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
Profile
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.