RoArm-M3-S Robotic Arm Control
MOVING CTRL - Robotic Arm Motion Control
In this tutorial, we will introduce the JSON command meaning for the robotic arm movement control, including the joint angle control and 3D Cartesian coordinates control. The joint angle control is categorized into control in the form of an angle system and radian system, and the 3D Cartesian coordinates control is for the coordinate position of the endpoint of the robotic arm.
The JSON command shortcuts in this section are located in the "MOVING CTRL" module of the Web interface.
Reset
CMD_MOVE_INIT - Move to Initial Position
{"T":100}
- 100: It indicates that this command is CMD_MOVE_INIT, which moves all the joints of the robotic arm to their initial positions.
Under normal circumstances, the robotic arm will automatically move to its initial position when powered on. This command will cause the process to block.
Joint Angle Control
CMD_SINGLE_JOINT_CTRL - Single Joint Control (Radian System)
{"T":101,"joint":0,"rad":0,"spd":0,"acc":10}
- 101: It indicates that this command is CMD_SINGLE_JOINT_CTRL, which controls the rotation of a joint of the robotic arm in radian system.
- joint: the joint number.
- 1: BASE_JOINT: base joint.
- 2: SHOULDER_JOINT: shoulder joint.
- 3: ELBOW_JOINT: elbow joint.
- 4: WRIST_JOINT: wrist joint 1.
- 5: ROLL_JOINT: wrist joint 2.
- 6: EOAT_JOINT: gripper joint .
- rad: the angle to be rotated (in radians). Based on the initial position of each joint, the default angle and rotation direction of each joint are as follows:
- The default initial angle of BASE_JOINT is 0, and its rotation range is 3.14 to -3.14. When the angle increases, the base joint turns left. When the angle decreases, the base joint turns right.
- The default initial angle of SHOULDER_JOINT is 0, and its rotation range is 1.57 to -1.57. When the angle increases, the shoulder joint rotates forward. When the angle decreases, the shoulder joint rotates backward.
- The default initial angle of ELBOW_JOINT is 1.570796, and its rotation range is 3.14 to 0. When the angle increases, the elbow joint rotates downward. When the angle decreases, the elbow joint rotates reversely.
- The default initial angle of WRIST_JOINT is 0, and its rotation range is 1.57 to -1.57. When the angle increases, the wrist joint 1 rotates downward. When the angle decreases, the wrist joint rotates upward.
- The default initial angle of ROLL_JOINT is 0, and its rotation range is 3.14 to -3.14. When the angle increases, wrist joint 2 rotates clockwise; when the angle decreases, wrist joint 2 rotates counterclockwise.
- The default initial angle of EOAT_JOINT is 3.141593, and its rotation range is 1.08 to 3.14. When the angle decreases, the gripper joint will open.
- spd: The speed of rotation, the speed unit is steps/s. One revolution of the servo is 4096 steps, the higher the value, the faster the speed. When the acceleration speed value is 0, rotate at the maximum speed.
- acc: Acceleration at the beginning and end of the rotation. The lower the value, the smoother the start and stop. The value can be 0-254, the unit is 100 steps/s^2. If set to 10, the speed will change according to an acceleration of 1000 steps/s^2. When the acceleration value is 0, then run at the maximum acceleration.
CMD_JOINTS_RAD_CTRL - All Joint Control (Radian)
{"T":102,"base":0,"shoulder":0,"elbow":1.57,"wrist":0,"roll":0,"hand":1.57,"spd":0,"acc":10}
- 102: It indicates that this command is CMD_JOINTS_RAD_CTRL, which controls the rotation of all joints for the robotic arm in radians.
- base: The angle of the base joints. For the angle rotation range, see the above explanation of rad key in the "CMD_SINGLE_JOINT_CTRL" command.
- shoulder: The angle of shoulder joint.
- elbow: The angle of elbow joint.
- wrist: wrist joint 1.
- roll: wrist joint 2.
- hand: the angle of gripper/wrist joints
- spd: The speed of rotation, the speed unit is steps/s. One revolution of the servo is 4096 steps, the higher the value, the faster the speed. When the acceleration speed value is 0, rotate at the maximum speed.
- acc: Acceleration at the beginning and end of the rotation. The lower the value, the smoother the start and stop. The value can be 0-254, the unit is 100 steps/s^2. If set to 10, the speed will change with an acceleration or deceleration of 1000 steps/s^2. When the acceleration value is 0, then run at the maximum acceleration.
CMD_JOINTS_RAD_CTRL - End Joint Control (Radian)
{"T":106,"cmd":3.14,"spd":0,"acc":0}
- 106: It indicates that this command is CMD_EOAT_HAND_CTRL, which sets the rotation angle of the gripper/wrist joint.
- cmd: The angle to be rotated (in radians). The default initial angle of EOAT_JOINT is 3.141593.
- The gripper joint, its angle rotation range is 1.08 to 3.14. When the angle decreases, the gripper joint will open.
- spd: The speed of rotation, the speed unit is steps/s. One revolution of the servo is 4096 steps, the higher the value, the faster the speed. When the acceleration speed value is 0, rotate at the maximum speed.
- acc: Acceleration at the beginning and end of the rotation. The lower the value, the smoother the start and stop. The value can be 0-254, the unit is 100 steps/s^2. If set to 10, the speed will change with an acceleration or deceleration of 1000 steps/s^2. When the acceleration value is 0, then run at the maximum acceleration.
CMD_SINGLE_JOINT_ANGLE - Single Joint Control (Angle System)
{"T":121,"joint":1,"angle":0,"spd":10,"acc":10}
- 121: This command is CMD_SINGLE_JOINT_ANGLE, which controls the rotation of a joint of the robotic arm in angle system.
- joint: the joint number.
- 1: BASE_JOINT: base joint.
- 2: SHOULDER_JOINT: shoulder joint.
- 3: ELBOW_JOINT: elbow joint.
- 4: WRIST_JOINT: wrist joint 1.
- 5: ROLL_JOINT: wrist joint 2.
- 6: EOAT_JOINT: gripper joint .
- angle: The angle to be rotated (in radians). Based on the initial position of each joint, the default angle and rotation direction of each joint are as follows:
- The default initial angle of BASE_JOINT is 0° with the rotation range of 180° to -180°. When the angle increases, the base joint turns left. When the angle decreases, the base joint turns right.
- The default initial angle of SHOULDER_JOINT is 0° with the rotation range of 90° to -90°. When the angle increases, the shoulder joint rotates forward. When the angle decreases, the shoulder joint rotates backward.
- The default initial angle of ELBOW_JOINT is 90° with the rotation range of 180° to 0°. When the angle increases, the elbow joint rotates downward. When the angle decreases, the elbow joint rotates reversely.
- The default initial angle of WRIST_JOINT is 0° with the rotation range of 90° to -90°. When the angle increases, the wrist joint 1 rotates downward. When the angle decreases, the wrist joint1 rotates upward.
- The default initial angle of ROLL_JOINT is 0° with the rotation range of 180° to -180°. When the angle increases, wrist joint 2 rotates clockwise; when the angle decreases, wrist joint 2 rotates counterclockwise.
- The default initial angle of EOAT_JOINT is 180° with the rotation range of 45° to 180°. When the angle decreases, the gripper joint will open.
- spd: The speed of rotation, the speed unit is °/s. The higher the value, the faster the speed. When the acceleration speed value is 0, rotate at the maximum speed.
- acc: Acceleration at the beginning and end of the rotation. The lower the value, the smoother the start and stop, the unit is °/s^2. When the acceleration value is 0, then run at the maximum acceleration.
CMD_JOINTS_ANGLE_CTRL - All Joint Control (Angle System)
{"T":122,"b":0,"s":0,"e":90,"t":0,"r":0,"h":180,"spd":10,"acc":10}
- 122: This command is CMD_JOINTS_ANGLE_CTRL, which controls the rotation of all joints of the robotic arm in angle system.
- b: The angle of the base joint. For the angle rotation range, see the explanation of angle key in "CMD_SINGLE_JOINT_ANGLE" command.
- s: The angle of shoulder joint.
- e: The angle of elbow joint.
- t: The angle of wrist joint 1.
- r: The angle of wrist joint 2.
- h: the angle of gripper/wrist joint
- spd: The speed of rotation, the speed unit is °/s. The higher the value, the faster the speed. When the acceleration speed value is 0, rotate at the maximum speed.
- acc: Acceleration at the beginning and end of the rotation. The lower the value, the smoother the start and stop. The value can be 0-254, the unit is °/s^2. When the acceleration value is 0, then run at the maximum acceleration.
3D Cartesian Coordinate Control
CMD_SINGLE_AXIS_CRTL - Individual Axis Position Control of Robotic Arm EoAT (Inverse Kinematics)
{"T":103,"axis":2,"pos":0,"spd":0.25}
The definition of the axes of the robot arm is based on the right-hand rule, with the X-axis positively oriented directly in front of the robot arm, the Y-axis positively oriented to the left of the front of the robot arm, and the Z-axis positively oriented directly above the vertical of the robot arm.
- 103: Indicates that this command is CMD_SIGNLE_AXIS_CRTL to control the robotic arm motion by giving the coordinate position of a separate axis to the EoAT of the robotic arm.
- axis: Indicates the axis number. 1-X-axis; 2-Y-axis; 3-Z-axis; 4-T axis (Pitch angle); 5-R axis (Roll angle); 6-G axis (gripper angle), in radian.
- pos: The specific position of a certain axis, in mm. The example above is to move the EoAT of the robotic arm to position 0 of the Y-axis, which is directly in front of the robotic arm.
- spd: The speed of the movement, the larger the value the faster the speed, this move command contains a curve speed control function at the bottom of the command, so the speed is not constant.
This command will cause the process to block.
CMD_XYZT_GOAL_CTRL - Position Control of Robotic Arm EoAT (Inverse Kinematics)
{"T":104,"x":235,"y":0,"z":234,"t":0,"r":0,"g":3.14,"spd":0.25}
- 104: Indicates that this command is CMD_XYZT_GOAL_CTRL, which can control the movement of the EoAT of the robotic arm.
- x, y, z, t, r, g: The specific positions of the six axes in mm. For details, please refer to the introduction in the CMD_SINGLE_AXIS_CTRL directives above.
- spd: The speed of the movement, the larger the value the faster the speed, this move command contains a curve speed control function at the bottom of the command, so the speed is not constant.
This command will cause the process to block.
CMD_XYZT_DIRECT_CTRL - Position Control of Robotic Arm EoAT (Inverse Kinematics)
{"T":1041,"x":235,"y":0,"z":234,"t":0,"r":0,"g":3.14}
- 1041: Indicates that this command is CMD_XYZT_DIRECT_CTRL, which can control the movement of the EoAT of the robotic arm.
- x, y, z, t, r, g: The specific positions of the six axes in mm. For details, please refer to the introduction in the CMD_SINGLE_AXIS_CTRL directives above.
Note: The difference between this command and the previous one is that it does not cause process blocking. Because there is no interpolation calculation at the bottom layer, the robotic arm will move to the target point at the fastest speed after the command is called. This is suitable for continuously setting new target points with each command, and the position difference between target points in each command should not be too large.
CMD_SERVO_RAD_FEEDBACK - Get Feedback from Robotic Arm
{"T":105}
- 105: Indicates this command is CMD_SERVO_RAD_FEEDBACK for getting the feedback of the EoAT including coordinates, all joint angles, and the load.
The following message will be fed back after entering the command:
{"T":1051,"x":344.9311553,"y":4.762362463,"z":206.9881693,"tit":0.056757289,"b":0.013805827,"s":0,"e":1.61528177,"t":0.012271846,"r":-0.006135923,"g":3.130854788,"tB":-44,"tS":0,"tE":128,"tT":48,"tR":32,"tG":-20,"torswitchB":1,"torswitchS":1,"torswitchE":1,"torswitchT":1,"torswitchR":1,"torswitchG":1,"v":1210}
- x, y and z respectively represent the position coordinates of the X-axis, Y-axis, and Z-axis of EoAT of the robotic arm;
- tit, b, s, e, t, r, g: Represent the End joint posture, base joint, shoulder joint, elbow joint, wrist joint 1, wrist joint 2, and end joint angle respectively, and are displayed in radians.
- tB, tS, tE, tT, tR: Represent the load of base joint, shoulder joint, elbow joint, wrist joint 1, and wrist joint 2.
- torswitchB, torswitchS, torswitchE, torswitchT, torswitchR, torswitchG: Represent the torque switch status of the base joint, shoulder joint, elbow joint, wrist joint 1, wrist joint 2, and end joint, respectively (0: Torque lock OFF; 1: Torque lock ON).
- v: Represents the current voltage, in units of 0.01V.
CMD_CONSTANT_CTRL - Continuous Movement Control (Angle Control + Inverse Kinematics Control)
{"T":123,"m":0,"axis":0,"cmd":0,"spd":0}
- 123: This command is CMD_CONSTANT_CTRL for enabling each joint of the robotic arm or the EoAT of the robotic arm to move continuously after a command is input.
- m: Continuous movement control mode.
- 0: Angle control mode.
- 1: Coordinate control mode.
- axis: The parts controlled for rotation varies depending on the mode.
- In angle control mode: when the value of m is 0, it controls the angle rotation of all joints for the robotic arm. 1 - Base: base joint; 2 - SHOULDER: shoulder joint; 3 - ELBOW: elbow joint; 4 - WRIST: wrist joint 1; 5 - ROLL: wrist joint 2; 6 - HAND: gripper joint.
- In coordinate control mode: when the value of m is 1, it controls the rotation of EoAT coordinates for the robotic arm. 1 - X-axis; 2 - Y-axis; 3 - Z-axis; 4 - Pitch angle; 5 - Roll angle; 6 - HAND gripper/wrist joint.
- cmd: The movement status.
- 0 - STOP: Stop the movement.
- 1 - INCREASE: The angle increases in angle control mode; the coordinates increase in inverse kinematics control mode.
- 2 - DECREASE: The angle decreases in angle control mode; the coordinates decrease in inverse kinematics control mode.
- spd: The speed coefficient, the bigger the value, the faster the speed. As the rotation speed of each joint is limited, the value is suggested in the range of 0-20.
RoArm-M3-S Tutorial
- RoArm-M3-S_Web Usage
- RoArm-M3-S_Secondary Development Tool Usage
- RoArm-M3-S_JSON Command Meaning
- RoArm-M3-S_WIFI Configuration
- RoArm-M3-S_Robotic Arm Control
- RoArm-M3-S_FLASH File System Operation
- RoArm-M3-S_Step Recording and Reproduction
- RoArm-M3-S_ESP-NOW Control
- RoArm-M3-S_Python UART Communication Control
- RoArm-M3-S_Python HTTP Request Communication