View unanswered posts | View active topics It is currently Mon Jun 25, 2018 8:16 am

 Page 1 of 1 [ 3 posts ]
 Print view Previous topic | Next topic
servoChangeRate
Author Message
Rookie

Joined: Thu May 17, 2012 3:35 pm
Posts: 38
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???

Thanks

Sun Dec 16, 2012 5:24 am
Guru

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1523
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
Rookie

Joined: Thu May 17, 2012 3:35 pm
Posts: 38
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
 Page 1 of 1 [ 3 posts ]

#### Who is online

Users browsing this forum: No registered users and 2 guests

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

Search for:
 Jump to:  Select a forum ------------------ ROBOTC Applications    ROBOTC for LEGO MINDSTORMS       Third-party sensors    ROBOTC for CORTEX & PIC    ROBOTC for VEX IQ    ROBOTC for Arduino    Robot Virtual Worlds    Multi-Robot Communications    Issues and Bugs Competitions & Partners    Mini Urban Challenge    CS2N Robot Virtual Worlds Competitions       VEX Skyrise Competition 2014-2015       VEX Toss Up 2013-2014       FTC Block Party! 2013-2014    Competitions using VEX - BEST, TSA, VEX, and RoboFest!    FTC Programming    RoboCup Junior and Other ROBOT Competitions Virtual Brick Robotics Discussions    General Discussions    Project Discussions Off-Topic ROBOTC Forum & ROBOTC.net Suggestions/Feedback    ROBOTC Forums Suggestions/Comments    ROBOTC.net Suggestions/Comments       NXT Programming: Tips for Beginning with ROBOTC       VEX Programming: Tips for Beginning with ROBOTC    2013 Robotics Summer Of Learning       VEX Toss Up Programming Challenge       FTC Ring It Up! Programming Challenge    International Forums       Spanish Forums          ROBOTC for MINDSTORMS          ROBOTC for VEX       French Forums          ROBOTC pour Mindstorms          ROBOTC pour IFI VEX       Japanese Forums （日本語のフォーラム）       German Forums    2015 Spring Carnival Event    PLTW (Project Lead The Way)    Robotics Merit Badge    2014 Robotics Academy Summer of Learning

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