View Full Version : How do the servos work?
our team was wondering how the servo works
i searched and cant find the threads...
thing we need is we want to turn the servo backwards after the servo makes full rotation
our program in Turing doesnt seem to work either...
Kris Verdeyen
04-02-2004, 18:03
our team was wondering how the servo works
i searched and cant find the threads...
thing we need is we want to turn the servo backwards after the servo makes full rotation
our program in Turing doesnt seem to work either...
The main problem you have is that hobby servos won't make a full rotation. They tend to be limited to around 180 degrees, and have no internal feedback to allow you to know when they've reached their holding point, so you'd need an external limit switch to feed that back, and let the code know when to reverse.
The main problem you have is that hobby servos won't make a full rotation. They tend to be limited to around 180 degrees, and have no internal feedback to allow you to know when they've reached their holding point, so you'd need an external limit switch to feed that back, and let the code know when to reverse.
We don't want the servo to rotate more then it is doing right now.But we were wondering if servos can be made to rotate backwards. This is because everytime you make it turn you have to manually twist it back to its starting position to make it turn again.
So can the servos actually be made to move backward, if so what type of signal or the code should you use.
As far as what i have researched and what you just said about their limit of 180 degrees matching, and the only way to modify would to be to take it apart and modify it internally ?? right..
your help is appreciated, this is my first year on the competition so do forgive me if these are newbie questions
thanks
Mike Soukup
04-02-2004, 18:30
We don't want the servo to rotate more then it is doing right now.But we were wondering if servos can be made to rotate backwards. This is because everytime you make it turn you have to manually twist it back to its starting position to make it turn again.
I think you first need to understand how a servo behaves. Unlike a motor, you do not give a servo a speed, you give it a position. If you directly map a motor to the y-axis of a joystick and push the stick half way forward, the motor will run at half speed until you release the stick, then it will stop. If you do the same with a servo, it will rotate half way to one end and stay there, then when you release the stick it will return to the middle. The servo is actually a motor and a potentiometer all in one, it performs the whole feedback loop for you. You give the servo a position (from 0-255) and it goes to that position and stays there until you give it a new position. They're actually pretty cool little devices.
I think you first need to understand how a servo behaves. Unlike a motor, you do not give a servo a speed, you give it a position. If you directly map a motor to the y-axis of a joystick and push the stick half way forward, the motor will run at half speed until you release the stick, then it will stop. If you do the same with a servo, it will rotate half way to one end and stay there, then when you release the stick it will return to the middle. The servo is actually a motor and a potentiometer all in one, it performs the whole feedback loop for you. You give the servo a position (from 0-255) and it goes to that position and stays there until you give it a new position. They're actually pretty cool little devices.
so how would i make it come back, well we were just testing the sevo using Turing We made it output 1 with a small delay and looped it.
So how would i make it come back???? we tried to output 0 but it doesn't come back any ideas???
steven114
04-02-2004, 19:07
127 is the center, not 0. 0-126 is one direction, and 128-254 is the other direction from the center.
deltacoder1020
07-02-2004, 01:01
essentially, when you output 1, you told the servo to rotate almost as far as it can in one direction (almost, because the minimum is 0, but there's little difference). thus, outputting 0 wouldn't make it come back, only turn a fraction more in the direction it already was.
dead center would be outputting 127. try that.
likewise, to make it turn in fully the other direction, output something towards the upper end of the range, such as 254.
are the servos in digital or analogue?
steven114
07-02-2004, 22:28
Well, considering that they vary from 0-255, they are considered analog. But, a more useful answer might be proposed if you explain more about what you want to know... (e.g. why does it matter?)
Justin Stiltner
09-02-2004, 15:57
You might want to think of it this way, output the data to the servo just like you do with a speed controller, ie if you want to center it send 127, full reverse 0 and full foward is 255. however insted of full foward and reverse you would have fully clockwise and fully counter clockwise. As somebody else suggested, map the data from an joystick to the servo output and print the data to your laptop and you will see what we are talking about.
Al Skierkiewicz
09-02-2004, 17:26
are the servos in digital or analogue?
The true answer here is both. The PWM data represents a particular angular position. The output shaft of the servo has a pot connected to it that outputs an analog voltage relative to the position. The circuit inside the servo then compares the position it was told to go to and the position it is currently at and sends a signal to the motor to move. When the output shaft/pot are at the position the PWM signal wants it to be the motor is shut off. This type of positioning is very common and can be accomplished fully digital, fully analog (this is the way it was done before the advent of cheap micros and memory modules) or a combination of both. The final design is one in which the tradeoffs between accuracy and expense have resulted in a fairly repeatable little box that costs under $50.
steven114
09-02-2004, 19:12
Ah, whoops. I was talking about the input signal, not how it worked...
Phil_Lutz
11-02-2004, 20:51
I have a tangent problem to this that I need a solution too.
I have the Servo directly connected to the PWM1 jack on the robot.
I map the PWM to a variable and set the variable to 0.
I tell the program to change the servo position (increment) when the trigger is held.
Nothing happens.
We are printf ' ingf the PWM value and the code seems to be working but the servo never moves.
Help!
Thanks,
Phil
Most servos wont make a full rotation. Servos are used to make small turns like on a model airplane. They are use to raise and lower the wing pich.
steven114
11-02-2004, 20:55
A few common debugging procedures:
1) Ensure that the triple cables from the Servo are in the proper direction
2) Test it with a different servo. Then try a different pin.
3) Post the code here.
Alan Anderson
11-02-2004, 21:46
I have the Servo directly connected to the PWM1 jack on the robot.
I map the PWM to a variable and set the variable to 0.
I tell the program to change the servo position (increment) when the trigger is held.
Nothing happens.
Do you have a good 7.2v battery connected? The servos won't work without one.
Al Skierkiewicz
12-02-2004, 07:44
I have a tangent problem to this that I need a solution too.
I have the Servo directly connected to the PWM1 jack on the robot.
Phil,
I just have to ask, is the 7.2 volt backup battery connected? Without it you have no power to the servo. Just a little "gotcha" from Innovation First. When nothing works, check the power supply.
Phil_Lutz
13-02-2004, 14:56
Phil,
I just have to ask, is the 7.2 volt backup battery connected? Without it you have no power to the servo. Just a little "gotcha" from Innovation First. When nothing works, check the power supply.
Yes. Good 7.2 volt Battery on the Robot, Good 12v as well.
I think I found the problem last night when working on Yaw Sensing.
I think I need to Generate_PWMS()
Servo is in PWM1, Yaw was in PWM2, got the Yaw Sensor to work didn't have time to try the Servo again.
Question.
Do you need to call Generate_PWMS() for each and every PWM you are using or just the Top 4, (13,14,15,16)
Thanks,
Phil
Al Skierkiewicz
13-02-2004, 15:27
Question.
Do you need to call Generate_PWMS() for each and every PWM you are using or just the Top 4, (13,14,15,16)
Thanks,
Phil
Phil,
I don't have an answer on software, I will alert my software gurus and let him or her answer.
Phil,
I don't have an answer on software, I will alert my software gurus and let him or her answer.I can answer now. :)
You only need to call Generate_PWMs() for the top four. The others are handled by the master processor.
Dave Flowerday
13-02-2004, 15:55
Do you need to call Generate_PWMS() for each and every PWM you are using or just the Top 4, (13,14,15,16)
Phil,
Generate_PWMS() is only used for the top 4. The putdata() call updates the other PWM outputs via the master processor.
Our team is also having problems with the servos. I could be wrong, but aren't servos supposed to resist turning by some outside force when they have power? We have tried several servos on several pwm's and you can easily turn them all with your hand. None of them move at all. I have tried mapping joystick outputs to the servos and tried moving them autonomously. Nothing works.
Phil_Lutz
15-02-2004, 02:03
We were (somehow) missing the putdata :(
All better now. Our 7.2 battery was not plugged in. Servos working like a charm now.
Yaw sensor not allowed as not in Kit 'o parts.
If we buy a gyro we can :)
Thanks for all the help.
Phil
Richomundo
17-02-2004, 20:40
I have tried to get the servo working.
Our code is set up so when i plug in pwms for motors they run. i inserted the servo code as a motor. pwm03 is the servo:
pwm03 = 200;
the servo is plugged in to the output 3 but does not move. i read the forums, and i see that they only run off the backup battery. is this true?
Joe Ross
17-02-2004, 22:47
the servo is plugged in to the output 3 but does not move. i read the forums, and i see that they only run off the backup battery. is this true?
Yes. That information is also on page 4 of the RC reference guide from Innovation First.
Al Skierkiewicz
18-02-2004, 07:47
I have tried to get the servo working. i read the forums, and i see that they only run off the backup battery. is this true?
Yes,
A little gift from Innovation FIRST is that the servo power is only from the backup battery (7.2 volts) If you are going to tuse servo make sure you have some way to check the battery and keep it charged.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.