Home > Industry Insights >Servo
TECHNICAL SUPPORT

Product Support

Graphical programming to control the steering gear, implemented in three steps with zero foundation

Published 2026-04-29

For those learners who have no foundation at all, this article provides a complete set of graphical programming solutions to control the servo. It does not require any knowledge of coding. Just by dragging the graphics module, the servo can be rotated to the specified angle according to the instructions. The following will be divided into three steps to explain in detail hardware connection, software module configuration, program upload and debugging, as well as answers to frequently asked questions and practical suggestions.

01Hardware connection: Just align the three wires

To control the servo, you only need to connect three wires, one is the positive pole of the power supply, its color is red, one is the negative pole, its color is brown or black, and one is the signal wire, its color is orange or yellow. The red wire should be connected to the 5V pin of the main control board, the brown wire should be connected to GND, and the signal wire should be connected to any digital pin, such as the number 9. The core point is that the power supply must be stable.When a single standard 9g servo is working, the current is about 200-500mA. If the USB power supply on the main control board is directly used to drive multiple servos, it is easy to cause jitter or non-rotation due to insufficient current.. It is recommended to use an external 5V power supply (such as a battery box) to power the main control board and servo at the same time.

Common example: An enthusiast made a simple scarecrow hand-waving device, using a common open source main control board and a 9g servo. He connected the signal line to port D9 according to the wiring method mentioned above, and the power was obtained from the 5V output of the main control board. Given the minimal load on the servo, a single servo is fully operational. If you add a second servo, an external power supply is required.

Set the initial angle of the servo to 90° to prevent shock when the power is turned on. This is the recommended setting method for the initial angle of the servo.

02Graphical programming: drag and drop building blocks to set angles

Open the graphical programming software. The software usually has a "servo" or "servo" module. You don't need to remember any code syntax. The specific steps are as follows:

1. Find the servo module, and in the building block area on the left, search for the "Pin" category, or search for the "Actuator" category, then drag the "Set Servo Angle" building block to the programming area.

2. To select the pin number, click the drop-down menu above the building block and select the pin you are actually connected to, such as D9.

3. When inputting an angle value, the angle value range that the servo can accept is from 0° to 180°. 0° corresponds to one extreme position, 180° corresponds to another extreme position, and 90° is in the middle position.

编程图形化控制舵机怎么用_如何用程序控制舵机_图形化编程控制舵机

4. In order to achieve coordination time control and allow the servo to have sufficient time to rotate to the target angle, add a "wait 1 second" block after each angle is set.

Sample program logic

When the main control board is powered on, first set the servo angle to 90° and wait for 1 second.

Then execute again, set the angle to 0°, then wait for 1 second, then set the angle to 180°, wait for 1 second, then set the angle to 90°, and finally wait for 1 second.

In this way, the servo will continue to swing left and right. Among them, the key parameter is that it generally takes 0.3 to 0.5 seconds for the servo to turn from 0° to 180°. Therefore, the waiting time is no less than 0.5 seconds to ensure reaching the target.

03Program uploading and debugging

After programming is completed, choose to connect the main control board to the computer via a USB data cable. After pressing the "Upload" or "Download" button in the software, wait for the progress bar to complete. When the upload is successful, the servo will immediately start action according to the graphical program you sent.

Common troubleshooting

The servo does not move at all: check whether 5V and GND are connected reversely, and whether the signal line is firmly inserted.

The servo makes a buzzing sound, but does not turn. The angle command has been issued, but the servo is stuck, or the voltage is insufficient. Gently turn the output shaft with your hand. If it can rotate, increase the power supply current.

编程图形化控制舵机怎么用_图形化编程控制舵机_如何用程序控制舵机

The angle of rotation of the servo does not match the set value. You need to confirm that the pin number shown in the software is consistent with the actual physical pin.

04Frequently Asked Questions (Q/A)

Q1: What should I do if the servo does not rotate?

First, check whether the wiring is stable and measure whether the power supply voltage is 5V. Secondly, make sure that the pin numbers in the program are consistent with the actual wiring. Finally, try to replace the digital pins.

Q2: How to calibrate if the angle is not accurate?

Manually correct the pulse width boundary value in the graphical module. The standard is that 0° corresponds to 500 microseconds and 180° corresponds to 2500 microseconds. Adjust these two values ​​to calibrate.

Q3: Can the servo be controlled to rotate continuously?

The ordinary 0 to 180 degree servo cannot perform continuous rotation. If there is a need for continuous rotation, then a 360 degree continuous rotation servo must be used, and it is controlled by setting the speed value.

Q4: Will simultaneous control of multiple servos cause interference?

Just set the angle of each servo one by one. It should be noted that the total peak current must not exceed the power supply capacity of the main control board. It is recommended that you increase the power supply every time you add a servo.

If the servo is shaking, check whether the power supply current is sufficient, or try to reduce the load of a single servo.

05Repeat core ideas and action suggestions

The core point is emphasized again: the essence of graphical programming to control the steering gear is to encapsulate complex pulse width modulation signals into intuitive "angle" parameters. You only need to care about "when to rotate and how much angle to rotate to" without writing any underlying code. Such a model allows people with no basic knowledge to complete the first steering gear project within 10 minutes, greatly lowering the learning threshold.

Recommendations for immediate action

1. Prepare a set of basic hardware, including a common open source main control board, a standard 9g servo, several female-to-female DuPont cables, and a mobile phone power bank or battery box as a power source.

2. Complete the wiring according to the first step above and connect to the computer with a USB cable.

3. Open the graphical programming environment, drag the "Set Servo Angle" block, fill in the corresponding angle value, and then upload the program.

4. After the acquisition is successful, try to add a knob potentiometer, which is an analog input module, and use graphical building blocks to map the potentiometer value, which is the range from 0 to 1023, into an angle from 0 to 180, and then create a card reader-like robotic arm that can manually control the angle.

If you have achieved the swing of a single servo, you have mastered all the core skills related to graphical programming to control the servo. Next, expand to quadruped robots, robotic arms, and complex projects such as smart door locks. The underlying principles are completely integrated. Start your first project now.

Update Time:2026-04-29

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