Published 2026-03-15
You must have encountered this situation: you happily connected theservoand wrote a program to make it rotate to 90°. As a result, it either didn't move at all, or shook non-stop, or even turned directly to the side. The angle of 90° is too commonly used in robot joints, camera heads, and remote control models, but there is a trick to controlling it accurately. Don't worry, as long as you understand the temperament of theservo, it is actually very simple to make it obediently turn to 90°.
The inside of the steering gear is actually a closed-loop control system, including a motor, reduction gear and angle sensor. Its control signal is a PWM wave, which is a pulse width modulation signal. You can think of PWM as a switch. The length of time each time it is turned on determines the position of theservo. The internal circuit of the servo will compare this pulse width with the current angle. If it is wrong, it will drive the motor to adjust until it is consistent.
For most standard servos, the corresponding relationship between pulse width and angle is regular. Usually a pulse of 1 millisecond (ms) corresponds to 0°, 1.5ms corresponds to 90°, and 2.5ms corresponds to 180°. Of course, this is a rough range, and servos from different manufacturers may differ slightly. The key is that to make the servo stop at 90°, you need to send it a high-level pulse with a width of 1.5ms every 20ms.
Although in theory 90° corresponds to a pulse width of 1.5ms, in actual use you will find that some servos are accurate at 1.48ms, and some require 1.52ms. This has something to do with the accuracy of the servo itself and the accuracy of the controller's timer. So when you get a new servo, it is best to use an oscilloscope or fine-tune it through a program to find its true 90° point, so that the movement can be accurate.
The specific parameter of the signal is a frequency of 50Hz, which is a period of 20ms. In this cycle, the high level lasts for 1.5ms, and the remaining 18.5ms are low levels. Controlling this time requires a microcontroller with relatively precise timing capabilities. If you are using a mainstream development board such as UNO or STM32, their timers can fully meet the requirements, so you can use it with confidence.
If you are using it, it is easiest to just use the built-in Servo library. Just include the header file, create a servo object, use () to specify the pin in setup(), and then write .write(90) in the program. The library function will automatically generate a 1.5ms pulse for you, without having to worry about the underlying details. It is especially suitable for quickly verifying ideas.
If you want to understand the control principle in depth, you can also use a timer to generate a PWM signal yourself. For example, if you use it, set the comparison register and flip the pin level in the interrupt. The advantage of this is that it has a higher degree of freedom and can accurately control the pulse width, which is very helpful for understanding the underlying logic of servo control. But no matter which method is used, the power supply must be stable. This is the basis.
Vibration is the most common headache problem encountered by novices. The servo shakes back and forth around 90° and cannot stop. Eighty percent of the reasons behind this are insufficient power supply or signal interference. The current when the servo is started is very large, especially when it is loaded. If the power supply cannot keep up and the voltage fluctuates, the servo will lose its accuracy and start to vibrate. In severe cases, the control board may be burned out.
The solution is actually not complicated: first supply power to the servo separately, and don't compete with the microcontroller for power. Use a voltage stabilizing module above 5V/2A to take power from the main power supply to the servo. Secondly, the control signal line should be as short as possible. If the line is too long, you can add a pull-down resistor. The software can also slightly reduce the response speed of the servo. For example, reducing the frequency of control signal updates can make the system more stable.
When you need to control several servos at the same time, such as making a six-legged robot or a robotic arm, the resources of the microcontroller may not be enough. At this time, the servo control board is needed. It is equivalent to a small butler dedicated to serving the servo. It can output multiple stable PWM signals at the same time, greatly reducing the burden on the main control chip.
The main points to consider when choosing a control board are: the number of channels should be enough for your needs, and 16 channels are generally more common; it should support the servo voltage you use, many control boards also come with a BEC (voltage stabilizing circuit), which can directly power the servo; the communication interface should be convenient, such as the I2C interface, which can control 16 servos with only two wires. The wiring is simple and it is very easy to use.
The steering gear looks small, but its appetite is quite big. If the 90° rotation is accompanied by a load, such as a camera on the gimbal, the instantaneous current can easily exceed 1A. If the power of the power supply is insufficient, the voltage will be pulled down, which may cause the machine to be unable to rotate at worst, or freeze directly at worst. Therefore, the power supply design must not be careless. This is the cornerstone of the stable operation of the steering gear.
A better approach is to use a 7.5V-12V DC power supply as the total input, and then reduce it to 5V or 6V through a high-current voltage stabilizing module to specifically power the servo. The microcontroller and sensor are powered by another voltage stabilizing module, and the ground wires of the two power supplies are connected together. This not only ensures that the steering gear has sufficient power, but also does not interfere with the normal operation of the control circuit, killing two birds with one stone.
When you were working on a steering gear project, what pitfalls did you go through in order to turn it to a precise 90°? How did you climb out again? Welcome to share your experiences and lessons learned in the comment area, so that everyone can avoid detours together. If this article is helpful to you, don’t forget to like it and forward it to your friends who play servos around you. Your support is my biggest motivation for sharing!
Update Time:2026-03-15
Contact Kpower's product specialist to recommend suitable motor or gearbox for your product.