RoboGeeks

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

  1. 0:04This lesson introduces servos, which are widely used in robotics.
  2. 0:09We will demonstrate how to control a servo to rotate to a specified angle using an example program.
  3. 0:17Required components, robotic arm control board, USB cable, servo, and battery.
  4. 0:24The robotic arm control board has six servo ports.
  5. 0:28Servos 1 to 6 are connected to pins D5 to D10 of the microcontroller respectively.
  6. 0:34Servos operate at 50 Hz, different pulse widths correspond to different angles.
  7. 0:40We output pulses of varying widths from the corresponding pins to move the servo to the target position.
  8. 0:46Notes for servo wiring.
  9. 0:51The yellow wire is the signal line, the red wire connects to 5V power, and the black wire connects to GND.
  10. 0:58The control board is marked with matching colors.
  11. 1:01Please match the colors correctly during wiring, otherwise the servo may be damaged.
  12. 1:12Let's start the demonstration.
  13. 1:15First, connect the control board to your computer via USB.
  14. 1:20Wire the servos to the control board, connect the battery and turn on the power switch.
  15. 1:26Multiple servos draw large operating current, so the control board must be powered by the battery.
  16. 1:32Next, open the example code.
  17. 1:43Select the board type and serial port, then upload the program to the control board.
  18. 1:59After successful upload, the servo will rotate back and forth between 0 degrees and 180 degrees every 2 seconds.
  19. 2:07Code principle, initialize all servo instances first.
  20. 2:13Then inside the loop, set all servos to rotate to 0 degrees or 180 degrees every 2 seconds.
  21. 2:21Our servos support rotation from 0 degrees to 180 degrees, and can be used in robot joints to simulate joint movement.
  22. 2:29We'll see you next time.
  23. 2:29We'll see you next time.
Embed this video with its transcript

Paste this into your page. The frame holds the player and the transcript; the link below it says where the transcript comes from.

Discussion

You pick a name in the next step. Already a member? Log in.

A mail when somebody comments. No account needed.

The newsletter

Get our free newsletter with new robots, prices and robotics news.