Servo Driver

From Waveshare Wiki
Jump to: navigation, search

Servo

Note: Before using the robotic arm. Please make sure to install the robotic arm correctly in strict accordance with the installation video. Otherwise, improper installation may result in uncertain movement of the robotic arm and damage after the program runs.

  • Enter http://<jetbot_ip_address>:8888 in the browser address bar to connect to the car, the left side Open /Notebooks/JETANK_1_servos/. Open the JETANK_1_servos_en.ipynb file. The program provides Chinese and English versions, with CN suffixes for Chinese comments and EN for English comments.

Servo Driver01.png

  • Click the running shortcut icon ▶ to run this program. After the program runs normally, it will display Succeeded to open the port, Succeeded to change the baud rate.
from SCSCtrl import TTLServo
  • If the JETANK library is installed, the config.sh file configuration is not executed correctly, and the serial port may not have permission, resulting in an error in importing TTLServo.
JETANK AI Kit Manual 2.png
  • After running this program, all 5 servos will turn to the middle position, and the robot arm will be in the initial state position. What the four parameters of the function represent has been explained in the comments. What is needed here is only the rotation speed parameter. If the parameter is set too large, the power supply of the servo may be automatically disconnected due to insufficient power supply. It needs to be turned off and then turned on to reply. .
JETANK AI Kit Manual 3.png
  • 5 servo ID pairs are shown in the above picture, ID 1 servo controls the left and right chassis rotation, ID 2, ID 3 servos control the forward and backward movement of the robotic arm, ID 4 servos control the collet opening and closing, and ID 5 servos control the camera Moving up and down.
JETANK AI Kit Manual 4.png
  • The code above is to use inverse kinematics to control the robotic arm and control the mechanical steering gear to move to the specified coordinate position. What needs to be paid attention to here is the direction of the coordinate system. The direction of the X axis is from the rear of the trolley to the rear of the trolley. The larger the X value, the more forward the chuck position. The direction of the Y-axis is from the bottom of the trolley to the top of the trolley. The larger the Y value, the higher the position of the chuck.
JETANK AI Kit Manual 5.png
  • These two programs control the movement of the robotic arm along the coordinate axis. You can check the installation video for the specific operation situation. If the actual running situation is different from the video, it may be because the installation of the robotic arm is uncertain or the steering gear is installed without the position of the center. .