Home > Industry Insights >BLDC
TECHNICAL SUPPORT

Product Support

Tutorial On How To Adjust The Steering Gear Rotation Angle To 90 Degrees For Precise Robot Control

Published 2026-03-06

Understanding how to rotate theservo90 degrees is actually not as difficult as you think

Many friends cannot avoid the little thing of steering gear when they are doing product innovation, especially when they are working on robots, smart homes or models. But when I got started, I wanted theservoto turn 90 degrees, but I found that it wasn't so obedient. Either the angle is wrong, or it keeps shaking or even burned out. In fact, the key to making theservorotate 90 degrees accurately is to understand its temperament and choose the right method. Don’t think about it too complicated, let’s talk about it thoroughly today.

How can the steering gear accurately turn 90 degrees?

If you want the servo to turn 90 degrees, you must first understand how it listens to you. There is a potentiometer inside the ordinary servo. It is like a little feedback steward, telling the control board "where am I turning now" in real time. The signal you send to it is actually telling it "Hey, move to that position." This signal is usually a PWM wave, which is a pulse width modulation signal. Simply put, it tells the servo the target angle by changing the duration of a high level.

For standard servos, this high-level time is generally between 0.5 milliseconds and 2.5 milliseconds, corresponding to 0 degrees to 180 degrees. So, to make it turn 90 degrees, you have to figure out the middle value, such as a high level signal of about 1.5 milliseconds. Of course, the pulse width range of different brands of servos may be slightly different. The safest way is to check the technical manual of the servos you have to find the specific pulse widths corresponding to 0 degrees and 180 degrees, and then take a middle value, so that the angles are almost the same.

What are the benefitsof turning the steering gear 90 degrees ?

In your project, you can accurately control the servo to turn 90 degrees, not just to show off your skills, but because the benefits it brings are real. The most obvious thing is that the movements are clean and crisp. For example, if you make a robotic arm, you need it to pick up something from point A and place it at point B, turning it 90 degrees in the middle. If the angle is not correct, it will either miss the point or place it off. Precise angles mean that when your mechanical structure performs tasks, it has high repeatability and smooth movements, making it look "professional".

In addition, precise control can also extend the life of the steering gear. If you think about it, if every command makes the servo hold back at that inaccurate angle, the motor will always be in a stalled or corrected state, generating high heat, high current, and rapid gear wear. When you can get it to be in position accurately, it can immediately relax and maintain its position. In this way, the servo can work easily and naturally be more durable, and the reliability of your product will also increase.

How to calculate the pulse width when the servo rotates 90 degrees

Calculating this pulse width is actually very simple, let's treat it as a mathematical problem. As mentioned just now, the pulse width range of most servos is 0.5ms to 2.5ms, corresponding to 0° to 180°. This span is 2ms (2.5-0.5), corresponding to a 180 degree change. Then the pulse width change corresponding to each degree is 2ms divided by 180°, which is approximately equal to 0.011ms, which is 11 microseconds.

Therefore, the pulse width corresponding to 90 degrees starts from 0.5ms (0 degrees), plus 90 times 11 microseconds. 90 multiplied by 0.011ms equals 0.99ms, plus 0.5ms, the result is approximately 1.49ms. When you actually operate, it changes linearly from 0.5ms to 2.5ms. Just fill in the value of 1.49ms into your control code. If the range of your servo is different, for example, 0 degrees corresponds to 0.6ms, and 180 degrees corresponds to 2.4ms, use the same formula and recalculate to ensure that it is not wrong.

How to write the program code for turning the steering gear 90 degrees

Writing code to control the servo to turn 90 degrees is really convenient now, especially when using this kind of platform. If you are using the most common SG90 servo, you can directly call the built-in servo library and get it done with just a few lines of code. The core is.write(90);this sentence, the library function will automatically help you convert 90 degrees into the corresponding pulse width signal and send it out.

But if you want to control it more finely, you can also use PWM output. For example, if you are using ESP32 or STM32, you can set the PWM frequency and duty cycle yourself. Assuming that the PWM period is 20ms (frequency 50Hz), then 90 degrees corresponds to a high level of 1.5ms, and the duty cycle is 1.5/20 = 7.5%. If you directly set the PWM duty cycle to 7.5% in the code, the servo will rotate to around 90 degrees. The advantage of writing it yourself is that you have a deeper understanding, and you can flexibly adjust the pulse width range to adapt to various non-standard servos.

How to adjust the servo to rotate slowly at 90 degrees without shaking?

Many novices encounter this problem: as soon as a signal is given, the servo bounces over with a "swish", which looks scary and tends to shake. If you want the servo to turn to 90 degrees slowly and steadily, the secret is "step execution" and "add delay". You can't directly throw the target angle from 0 to 90, but in a loop, let the angle increase little by little, for example, increase it by 1 degree each time, and then add a delay of 10 milliseconds to 20 milliseconds.

In this way, the servo will move smoothly one step at a time according to the steps you set, without any abruptness at all. Jitter problems are mostly caused by insufficient power supply or signal interference. ️Thefirst stepis to check your power supply. When the servo operates, the current is very high. Do not share the same weak current with the control circuit. It is best to supply power separately and share the ground. ️Thesecond step isto keep the signal line as short as possible. If it has to be long, you can use a magnetic ring or a small capacitor on the signal line to ground to filter out high-frequency interference.

How to solve the error when the steering gear rotates 90 degrees?

It is obviously calculated to be 1.5ms, but when I turn around and look, it is 5 degrees off. This is a common thing. Don't panic, the error mainly comes from two aspects: the mechanical return difference of the steering gear itself and the inaccuracy of the control signal. The mechanical return difference is caused by the gear backlash. When turning from direction A and turning from direction B, the final stopping position will be slightly different. The solution is to make the servo reach the target angle from the same direction every time during programming. For example, let it turn slightly smaller than the target each time, and then turn it forward to the target to eliminate the gap.

The signal is not accurate because the PWM pulse width generated by your control board is not that accurate. For example, if you want to output 1.5ms, the actual measured output is only 1.48ms. This requires you to make fine adjustments in the code, that is, calibration. You can write a program to turn the servo to the theoretical 90 degrees, then use a ruler to measure the actual deflection angle of the arm, and then correct your pulse width value in the opposite direction. Try several times to find the pulse width value that really makes the rotating arm perpendicular to the rudder housing. Write it in your code so that it will be remembered in the future.

Okay, we have talked quite a bit about turning the servo 90 degrees. From principles to codes, to speed adjustment and error elimination, they are actually all small skills that you can master by trying them out. I don’t know which problem with the servo most often stumps you when working on your own small project? Is it jitter, weakness or the angle cannot be adjusted accurately? Welcome to chat about your experience in the comment area, and don’t forget to give it a like and share it with your friends who are also playing with servos, so that we can communicate and make progress together!

Update Time:2026-03-06

Powering The Future

Contact Kpower's product specialist to recommend suitable motor or gearbox for your product.

Mail to Kpower
Submit Inquiry
+86 0769 8399 3238
 
kpowerMap