- Artificial Intelligence
- Infrared Distance
- Third Party Robots
- Touch Tablet
- Ultrasonic Distance
- Virtual Reality
Table of Contents
- How To Move Servos
- What is a servo motor?
- Servo vs PWM
- How does a servo motor work?
- Types of servo motors
- Controlling a servo motor
- How Does Continuous Rotation Servo Work?
- How is torque measured?
How To Move Servos
While this particular tutorial is focused on what a servo is, we provided this statement for those who wish to skip how a servo works sand jump right into how to move a servo. Of course, if you skip this section and jump into moving servos, you will end up back here because someone you will ask a question on the forum and someone will direct you here. So, if you're going to skip this section, click here to learn how to move servos in EZ-Builder.
click here to learn how to move servos
What is a servo motor?
A Servo motor (or servo) is a rotary actuator that allows for precise control of angular position, velocity and acceleration. Servos are found in many places: from toys to home electronics to cars and airplanes. If you have a radio-controlled model car, airplane, or helicopter, you are using at least a few servos. Servos also appear behind the scenes in devices we use every day. Electronic devices such as DVD and Blu-ray DiscTM players use servos to extend or retract the disc trays.
EZ-Robots use servos which manage the movement of joints, pan & tilt, and continuous rotational movement. The EZ-B v4, sends an electrical signal that tells the servo what position to reach and how quickly to get there. Servos come in a variety of shapes and sizes for different applications. You may want a large, powerful one for moving the arm of a big robot, or a tiny one to make a robot's eyebrows go up and down. By linking many of these servos together, you can very easily create robots that perform complex real world operations. Our Revolution robots utilizes the two most common sizes as shown below.
Servo vs PWM
PWM stands for Pulse Width Modulation. PWM is the process of turning ON and OFF digital voltage quickly to simulate a range of voltage. For example... If the digital output pin of a micro is 3.3v, and the PWM is set for a 50% duty cycle, the output voltage would be approx 1.65v. This is because the microcontroller is turning ON and OFF the digital 3.3v pin real quick, which is producing a simulated lower voltage. You can use PWM to vary the brightness of an LED, for example.
A servo uses PWM as well. The "frame" of a servo PWM signal is 20ms. Many controllers, such as Arduino libraries do not maintain the 20ms specification defined for servos. Because of this, challenges have been introduced to servo manufacturers when decoding incoming PWM signals. This has caused the need for servos to be "Smarter" by adapting to the unusual PWM transmitted by poorly written libraries which do not adhere to the servo PWM Standard. The EZ-B does adhere to servo PWM standards.
How does a servo motor work?
The simplicity of a servo is among the features that make them so reliable. The heart of a servo is a small direct current (DC) motor, similar to what you might find in an inexpensive toy. These motors run on electricity from a battery and spin at high RPM (rotations per minute) but put out very low torque (a twisting force used to do work— you apply torque when you open a jar). An arrangement of gears takes the high speed of the motor and slows it down while at the same time increasing the torque. (Basic law of physics: work = force x distance.) A tiny electric motor does not have much torque, but it can spin really fast (small force, big distance). The gear design inside the servo case converts the output to a much slower rotation speed but with more torque (big force, little distance). The amount of actual work is the same, just more useful. Gears in an inexpensive servo motor are generally made of plastic to keep it lighter and less costly. On a servo designed to provide more torque for heavier work, the gears are made of metal (such as with EZ-Robot Servos) and are harder to damage.
With a small DC motor, you apply power from a battery, and the motor spins. Unlike a simple DC motor, however, a servo's spinning motor shaft is slowed way down with gears. A positional sensor on the final gear is connected to a small circuit board. The sensor tells this circuit board how far the servo output shaft has rotated. The electronic input signal from the computer or the radio in a remote-controlled vehicle also feeds into that circuit board. The electronics on the circuit board decode the signals to determine how far the user wants the servo to rotate. It then compares the desired position to the actual position and decides which direction to rotate the shaft so it gets to the desired position.
|Figure 5. The circuit board and DC motor in a high-power servo. Did you notice how few parts are on the circuit board? Servos have evolved to a very efficient design over many years.|
Types of servo motors
Servos come in many sizes and in three basic types: positional rotation, continuous rotation, and linear.
- Positional rotation servo: This is the most common type of servo motor. The output shaft rotates in about half of a circle, or 180 degrees. It has physical stops placed in the gear mechanism to prevent turning beyond these limits to protect the rotational sensor. These common servos are found in EZ-Robot's arms, legs, limbs, etc.. For example, the JD or Six robots use these servos.
- Continuous rotation servo: This is quite similar to the common positional rotation servo motor, except it can turn in either direction indefinitely. The control signal, rather than setting the static position of the servo, is interpreted as the direction and speed of rotation. The range of possible commands causes the servo to rotate clockwise or counterclockwise as desired, at varying speed, depending on the command signal. You might use a servo of this type on a radar dish if you mounted one on a robot. Or you could use one as a drive motor on a mobile robot. The EZ-Robot AdventureBot uses two continuous rotation servos with wheels. The center (90 degrees) is the center of a continuous rotation's STOP position. The further you move away from 90 degrees in either direction controls the speed of the continuous rotation servo in that direction.
- Linear servo: This is also like the positional rotation servo motor described above, but with additional gears (usually a rack and pinion mechanism) to change the output from circular to back-and-forth. These servos are not easy to find, but you can sometimes find them at hobby stores where they are used as actuators in larger model airplanes.
Controlling a servo motorA standard servo is what you normally find in R/C Hobby Toys. They are high precision devices that can rotate a shaft up to 180 degrees. With the EZ-B and a Standard Servo, you can easily configure how many degrees to rotate the output shaft.
The EZ-B SDK and EZ-Builder takes care of the electrical communication to the servo for you. Standard servos can be used for the head or arms of your robot.
However, here is some technical information on how servos work. The servo is controlled using pulse controlling. The control pulse is a positive voltage with a length of 1 to 2 ms which determines the angle of the shaft. The control pulse is repeated every 18-25 ms.
The EZ-B has timing below 1ms and above 2ms to accommodate all servo types. Some servos do not fall within the specifications and require unusual timing. When testing with your servo, make sure you recognize the max and min values and set them in the control. If a servo attempts to move further than its maximum position, it may be damaged. Additionally, if a servo is rotated too far then it will consume a lot of current and the EZ-B may reset.
Here are the timings for the EZ-B...
Position 1 on v4, Position 1 on v3
Position 90 on v4, Position 50 on v3
Position 180 on v4, Position 100 on v3
The EZ-B v4 has high accuracy which results in 180 servo positions. The EZ-B v4 can control 24 servos simultaneously while it performs other various user specified tasks. If your servos draw more current then our specification sheet defines, the EZ-B may run out of power and reboot itself. This is called a Brown-Out. To prevent brown-out with many servos, provide alternate power. Check the manual on how to do that.
The EZ-Builder and EZ-SDK handles the technical work for you. Merely specify the servo position and voila!
How Does Continuous Rotation Servo Work?A continuous rotation servo, as mentioned earlier in this lesson, will spin the rotation shaft continuously in either direction. When the servo receives a 90 degree position, which is center on a standard servo, the continuous rotation servo will stop spinning. The center (90 degrees) is the center of a continuous rotation's STOP position. The further you move away from 90 degrees in either direction controls the speed of the continuous rotation servo in that direction. The continuous rotation servo will have a POT (potentiometer) exposed which allows you to fine tune the STOP position with a small screwdriver. Click here to view a tutorial on how to calibrate a continuous rotation servo.
100 < - Turning left faster
91 < - Turning left slower
90 <- Stopped
89 <- Turning right slower
80 < - Turning right faster
How Is Torque Measured?Now that we covered the basics of how-a-servo-works, the next question is torque. Torque is how much power the servo has. Different applications will require higher or lower torque. In most cases, you can get away with using a regular average torque servo. Average torque of a plastic servo is 2-3kg/cm @ 5 volts and the EZ-Robot Heavy Duty servos are much more (consult the servo product information).
Something that is often overlooked is energy consumption. Consider this: there is no free energy. Torque equals energy and vice-versa. The EZ-Robot Heavy Duty servos will require more energy to move it than cheaper plastic ones. If too many high torque servos are connected to the EZ-B without a sufficient power source, it will "brown-out". Browning-out means the voltage regulator could not keep up with the current draw so the microchip rebooted itself due to low current. Do not worry, the Revolution Robots are powered by a strong LiPo battery and will support up to 24 servos!
So what do the torque numbers mean? Let's speculate the torque value of a servo was 50 Ounces per Inch
Well if you had a servo arm that was one inch long on your servo it would be able to produce 50 ounces of pull or push force at the end of the servo arm before stalling. If you had a 1/2 inch servo arm what do you think the force would be? Yup, 100 ounces of force. How about a 2 inch arm, 25 ounces of force - easy huh?