A memo for making a parallel link robot, also known as a delta robot. Soft edition.
In the mechanical edition, we used 3D CAD and 3D printing services to create the main body of a parallel link robot consisting of three servo motors. This time, I will write about the software that I made to control the servo motor from Python and move it as a robot.
When controlling a robot, the procedure of teaching the robot the movement, which is generally called "teaching", is performed, and then the robot is automatically executed as taught. There are three main types of teaching. This time I decided to implement all of these.
Types of teaching | Description |
---|---|
Online teaching | Using the remote control that controls the robot, teach the movement while actually moving the robot. |
Offline teaching | Move the robot on the simulator to teach the movement. |
Direct teaching | Touch the robot with bare hands to teach direct movements. |
It is a class diagram of a module written in Python.
The role of each class.
name of the class | role |
---|---|
PS4Controller | A class that uses the pygame module to acquire various operation information from the PS4 DualShock4 controller. The information on the analog stick is used to instruct the three-dimensional movement of the delta robot. The ○ △ □ × buttons are used to switch the view mode of the drawing area of the simulation model of the delta robot. |
AX12Driver | dynamixel_A class that controls the Dynamixel AX12 servomotor using the sdk module. By controlling the positioning of the three server motors that make up the delta robot, the delta robot operates up, down, left, and right. |
DeltaModel | A class that provides computational logic for delta robot kinematics and inverse kinematics. |
DeltaBase | An abstract class that provides the functions commonly required to control delta robots. In addition to initializing various classes, it provides a function to constantly draw a 3D graph of the robot shape using matplotlib. |
DeltaTeaching | An abstract class that provides the functionality commonly needed for teaching Delta robots. The position information of the servo motor during the teaching operation is recorded in the memory and output to a file at the end of the program. The output format is JSON. |
DeltaTeachingOffline | A class for offline teaching of Delta robots. From the operation information obtained from PS4Controller, the movement speed in each axial direction is acquired and the current position of the robot is calculated. Use the inverse kinematics calculation function of DeltaModel to convert the position information into the angle information of the motor. A function inherited from DeltaBase that draws the updated robot status on a virtual model on a 3D graph. |
DeltaTeachingOnline | A class for online teaching of Delta robots. The virtual model is controlled using the function inherited from the DeltaTeachingOffline class, and the position control instruction of the servo motor is given to the AX12Driver so that the virtual model and the actual machine are in the same state. |
DeltaTeachingDirect | A class for direct teaching of Delta robots. Acquires the current position information (angle) of the servo motor from the AX12Driver and records it. At the same time, the function inherited from DeltaBase reflects the same information in the virtual model on the 3D graph. |
DeltaPlayerOffline | A class that automatically executes offline Delta robots. By inputting the time series data of the position information of the servo motor recorded at the time of various teachings, the taught movement is reproduced by a virtual model on a 3D graph. |
DeltaPlayerOnline | A class that automatically executes online Delta robots. The virtual model is controlled using the function inherited from DeltaPlayerOffline, and the position control instruction of the servo motor is given to the AX12 Driver so that the virtual model and the actual machine are in the same state. |
https://github.com/kizitorashiro/deltarobot
This is the site that I referred to when implementing it.
item | URL |
---|---|
Inverse kinematics of delta robots | https://tony-mooori.blogspot.com/2016/09/kinematics.html |
Delta robot kinematics | http://hypertriangle.com/~alex/delta-robot-tutorial/ |
Delta robot kinematics | https://github.com/awesomebytes/delta_robot/blob/master/src/delta_kinematics.py |
PS4 DualShock4 | https://gist.github.com/claymcleod/028386b860b75e4f5472 |
Dynamixel servo motor specifications | http://support.robotis.com/jp/product/dynamixel/ax_series/dxl_ax_actuator.htm |
Dynamixel servo motor driver | https://github.com/ROBOTIS-GIT/DynamixelSDK |
Use the PS4 controller as a remote control to move the Delta robot. The virtual model on the PC and the actual machine operate in synchronization. The virtual model can be displayed with a different viewpoint by switching to view mode.
Using the PS4 controller as a remote controller, you can control the virtual model of the Delta robot and at the same time record the position information as time series data. After that, the robot automatically replays the same movement.
Move the robot by directly touching it with your hands. Every time the position of the robot changes, that information is recorded as time series data. After that, the robot automatically replays the same movement.
Recommended Posts