Tutorial 05 - Control the Servo to Rotate - ADA031-V5.0
Adeept · Uploaded · 2:31 · Watch on YouTube
Adeept walks through wiring a servo to the robotic arm control board, then uploading an example program. The program rotates the servo between 0 and 180 degrees every 2 seconds.
Transcript
Captions as a .vtt fileEmbed with the transcript
- 0:04This lesson introduces servos, which are widely used in robotics.
- 0:09We will demonstrate how to control a servo to rotate to a specified angle using an example program.
- 0:17Required components, robotic arm control board, USB cable, servo, and battery.
- 0:24The robotic arm control board has six servo ports.
- 0:28Servos 1 to 6 are connected to pins D5 to D10 of the microcontroller respectively.
- 0:34Servos operate at 50 Hz, different pulse widths correspond to different angles.
- 0:40We output pulses of varying widths from the corresponding pins to move the servo to the target position.
- 0:46Notes for servo wiring.
- 0:51The yellow wire is the signal line, the red wire connects to 5V power, and the black wire connects to GND.
- 0:58The control board is marked with matching colors.
- 1:01Please match the colors correctly during wiring, otherwise the servo may be damaged.
- 1:12Let's start the demonstration.
- 1:15First, connect the control board to your computer via USB.
- 1:20Wire the servos to the control board, connect the battery and turn on the power switch.
- 1:26Multiple servos draw large operating current, so the control board must be powered by the battery.
- 1:32Next, open the example code.
- 1:43Select the board type and serial port, then upload the program to the control board.
- 1:59After successful upload, the servo will rotate back and forth between 0 degrees and 180 degrees every 2 seconds.
- 2:07Code principle, initialize all servo instances first.
- 2:13Then inside the loop, set all servos to rotate to 0 degrees or 180 degrees every 2 seconds.
- 2:21Our servos support rotation from 0 degrees to 180 degrees, and can be used in robot joints to simulate joint movement.
- 2:29We'll see you next time.
- 2:29We'll see you next time.
Discussion
A mail when somebody comments. No account needed.
The newsletter
Get our free newsletter with new robots, prices and robotics news.