Arduino API
1 Overall Status
powerOn();
- Function: atom power on(open by default)
- Return Value: none
powerOff();
- Function: atom power off
- Return Value: none
isPoweredOn();
- Function: atom status inquiry, return Atom link status
- Return Value: power on is TRUE, power off is FALSE
setFreeMove();
- Function: All joints close torsion output
- Return Value: none
2 MDI Mode and Robot Control (Manual Data Input)
getAngles();
- Function: Read all joint angles, when used one Angles should be defined to receive data that was read. Angles are defined in terms of variables or functions built into library functions. We can define a memory space that is 6 angles to store Angle variables, it is used in the same way as arrays.
- Return Value: Angles type of array
writeAngle(int joint, float value, int speed);
- Function: Send a single joint Angle
- Parameter Specification:
Joint Number= joint, range from 1 to 6 Specified Angle Value= value, range approximately from -160°~ + 160° Specified Speed= value, range from 0~100 - Return Value: none
writeAngles(Angles angles, int speed);
- Function: Synchronize joint angles, send joint angles at the same time. Specified Angles is a container with a capacity of 6 data, can be viewed as an array. Use a for loop to assign values, or assign values separately.
- Angles[0] = Specified Angle, Angles[2] = Specify Angle,range from 0 – 90 (the value range should be the same as writeAngle) unit°
Movement Speed = speed, range from 0 – 100 unit° - Return Value: none
getCoords();
- Function: Read x,y,z,rx,ry,rz of the end of myCobot, a Coords tempcoords should be defined when used to received angles that was read. Coords are defined in terms of variables or functions built into library functions. We can define a memory space that is 6 tempcoords to store Angle variables, it is used in the same way as arrays.
- Return Value: An array of type Coords. You need to define variables of type Coords.
isInPosition (Coords coord,bool is_linear);
- Function:Read x, y, z, rx, ry, rz at the end of the current robot arm to test whether the specified point has been reached, you should define a Coords tempcoords to receive the read angle when you use it. Coords is a variable number or function definition of a library function that defines a storage space of 6 memory, tempcoords, which is used in the same way as an array.
- Return value:An array under the Coords type that needs to define variables of the Coords type
writeCoord(Axis axis, float value, int speed);
- Function: Send the specific value of the individual coordinate parameters x/y/z, the ends are going to move in a single direction.
- Parameter Specification:
Value of Moving Path Coordinate = value range from -300 – 300 ( The position coordinates of axis=Axis::X,aixs=Axis::Y and axis=Axis::Z are respectively X,Y,Z, the units would be mm. Position coordinate value range is not uniform, axis=Axis::RX, aixs=Axis::RY and axis=Axis::RZ are respectively RX,RY,RZ ranging from-180°~180°, if the value is beyond the range it will return the clue “inverse kinematics no solution” )
Specified Speed = speed range from 0~100 unit %
- Return Value: none
writeCoords(Coords coords, int speed);
- Function: Send the specified coordinate parameter, the type of parameter is Coords, need to declares a variable of type COORDS, it is used in the same way as arrays.
- Parameter Specification
coords[0] = X, coords[1] = Y, coords[2] = Z,
X,Y,Z range from -300-300.00 ( Value range is not defined. If the value is beyond the range, the clue ”inverse kinematics no solution” will be given ) unit mm
RX,RY,RZ range from -180~180
Specified Speed = speed, range from 0~100unit % - Return Value: none
checkRunning();
- Function: Check whether the equipment is in motion
- Return Value: In motion is TRUE,on the contrary it’s FALSE
setEncoder(int joint, int encoder);
- Function: Set a single joint to rotate to a specified potential vaule
- Parameter Specification:
Joint Number = joint, range from 1-6
Potential Vaule of Servo Motor = encoder, range from 0-4096 ( The range should be positively related to the range of each joint ) - Return Value: none
getEncoder(int joint);
- Function: Get the specified joint potential vaule
- Parameter Specification: Servo Motor Number = joint range from 1-6
- Return Value: int type, range from 0-4096
setEncoders(Angles angleEncoders, int speed);
- Function: Set the six joints to run synchronously to the specified position
- Parameter Specification: Need to define a variableof type Angles: angleEncoders, it is used in the same way as arrays. Assign a value to the array angleEncoders, values range from 0 to 4096 ( The range should be positively related to the range of each joint ) , the length range of the array is 6. Specified Speed = speed, range from 0~100unit %
- Return Value: none
3 JOG Mode
jogAngle(int joint, int direction, int speed);
- Function: Control the movement of a single joint in one direction
- Parameter Specification:
Joint/Servo Motor
- Number = joint, range from 1-6
- Direction of Joint Motion = Direction, range from -1/1
- Specified Speed = speed, range from 0~100unit %
- Return Value: none
jogCoord(Axis axis, int direction, int speed);
- Function: Control myCobot moves in one direction in Cartesian space
Parameter Specification:
- Direction Selection = axis, range from X,Y,Z,RX,RY,RZ
- Direction of Joint Motion = Direction, range from -1/1
- Specified Speed = speed, range from 0~100unit %
- Return Value: none
jogStop();
- Function: Stops the specified direction of motion that has started
- Return Value: none
pause();
- Function: Program pause
- Return Value:none
resume();
- Function: Program continues to run
- Return Value: none
stop();
- Function: Program stop
- Return Value: none
4 Running Status and Settings
getSpeed();
- Function: read the current running speed
- Return Value: int tape, range from 0-100, unit %
setSpeed(int percentage);
- Function: set the running speed
- Parameter Specification: percentage, range from 0-100, unit %
getFeedOverride();
(Not open at this time)
- Function: read FeedOverride
- Return Value: float type of the array
sendFeedOverride(float feedOverride);
(Not open at this time)
- Function: send FeedOverride
getAcceleration();
(Not open at this time)
- Function: read acceleration
- Return Value: floattype of the array
setAcceleration(float acceleration);
(Not open at this time)
- Function: set acceleration
- Parameter Specification: acceleration range from 0-100 ( Value range is not defined )
getJointMin(int joint);
- Function: read the joint minimal limit Angle
- Parameter Specification: Joint Number = joint, range from 1-6
- Return Value: float type of the array
getJointMax(int joint);
- Function: read the joint maximal limit Angle
- Parameter Specification: Joint Number = joint, range from 1-6
- Return Value: float type of the array
setJointMin(int joint, float angle);
- Function: set the joint minimal limit Angle
- Parameter Specification: joint/servo motor number = joint, range from 1-6
- Return Value: none
setJointMax(int joint, float angle);
- Function: set the joint maximal limit Angle
- Parameter Specification: joint/servo motor number = joint, range from 1-6
- Return Value: none
5 Joint Servo Control
isServoEnabled(int joint);
- Function: Check whether the joint is properly connected
- Parameter Specification: Joint Number = joint, range from 1-6
- Return Value: Normal links return TRUE, on the contrary return FALSE
isAllServoEnabled();
- Function: Check whether all joins are properly connected
- Return Value: Normal links return TRUE, on the contrary return FALSE
getServoData(int joint, byte data_id);
- Function: Read the data of the specified address of joint
Parameter Specification:
- Joint Number = joint, range from 1-6
- Data Address = data_id. , refer to the following Figure for address
- Return Value: refer to the following Figure for the value range
setServoCalibration(int joint);
- Function: Calibrate the current position of the joint to zero Angle, the corresponding potential value is 2048
- Parameter Specification: joint number = joint, range from 1 – 6
jointBrake();
- Function: brake a single stand-alone
- Parameter Specification: joint number = joint, range from 1 – 6
setPinMode(byte pin\_no, byte pin\_mode);
- Function: set atom specified pin mode
- Parameter Specification:
- Pin Number = pin_no, range from:19, 22, 23, 26, 32, 33
- Pin mode = pin_mode, range from:0, 1
- Return Value: none
6 Atom IO Control
setLEDRGB(byte r, byte g, byte b);
- Function:set the color of the RGB lights of atom
- Parameter Specification:
- Parameter of Red Light = r, range from 0x00 – 0xFF;
- Parameter of Green Light = g, range from 0x00 – 0xFF;
- Parameter of Blue Light = b, range from 0x00 – 0xFF;
- Return Value: none
setGripper(int data);
- Function: Set the jaw opening and closing
- Parameter Specification: data 0 is open, 1 is close`
7 Coordinate Control Mode
setToolReference(Coords coords);
- Function: set coordinate system of tool
Parameter Specification:
- X,Y,Z range from -300-300.00 ( Value range is not defined. If the value is beyond the range, the clue ”inverse kinematics no solution” will be given ) unit mm
- RX,RY,RZ range from -180~180
- Value: none
setWorldReference(Coords coords);
- Function: set coordinate system of world
- Parameter Specification:
- X,Y,Z range from -300-300.00 ( Value range is not defined. If the value is beyond the range, the clue ”inverse kinematics no solution” will be given ) unit mm
- RX,RY,RZ range from -180~180
- Return Value: none
getToolReference();
- Function: get coordinate system of tool
- Parameter Specification: none
- Return Value:
- X,Y,Z range from -300-300.00 ( Value range is not defined. If the value is beyond the range, the clue ”inverse kinematics no solution” will be given ) unit mm
- RX,RY,RZ range from -180~180
getWorldReference();
- Function: get coordinate system of world
- Parameter Specification: none
- Return Value:
- X,Y,Z range from -300-300.00 ( Value range is not defined. If the value is beyond the range, the clue ”inverse kinematics no solution” will be given ) unit mm
- RX,RY,RZ range from -180~180
setReferenceFrame(RFType rftype);
- Function: set coordinate system of frame
- Parameter Specification: RFType::BASE takes the robot base as the base coordinate, RFType::WORLD takes the world/Youdao/Dict/8.9.6.0/resultui/html/index.html#/javascript:;) coordinate/Youdao/Dict/8.9.6.0/resultui/html/index.html#/javascript:;) system/Youdao/Dict/8.9.6.0/resultui/html/index.html#/javascript:;) as the base coordinate
- Return Value: none
getReferenceFrame();
- Function:get coordinate system of flange
- Parameter Specification: none
- Return Value:
- X,Y,Z range from -300-300.00 ( Value range is not defined. If the value is beyond the range, the clue ”inverse kinematics no solution” will be given ) unit mm
RX,RY,RZ range from -180~180
setEndType(EndType end\_type)
- Function: set coordinate system of the end
- Parameter Specification: EndType::FLANGE set the end as flange, EndType::TOOL set the end to the tool end
- Return Value: none
getEndType();
- Function: get coordinate system of the end
- Parameter Specification: none
- Return Value:
- X,Y,Z range from -300-300.00 ( Value range is not defined. If the value is beyond the range, the clue ”inverse kinematics no solution” will be given ) unit mm
- RX,RY,RZ range from -180~180
setGripperValue();
- Function: Set the electric potential of the gripper. Get the current electric potential of the gripper before use
- Parameter Specification: Input Value ( 0-4095 )
- Return Value: none
setGripperIni();
- Function: Set the gripperbe .zero
- Parameter Specification: none
- Return Value: none
getGripperValue();
- Function: get the value of the current electric potential
- Parameter Specification: none
- Return Value: return the value of the current electric potential, range from0-4085
setGripperState;
- Function: Set the opening and closing of the gripper
- Parameter Specification: 0 represents open,1 represents clsoe
- Return Value: none
setDigitalOutput;
- Function: Set the working state of IO pins
- Parameter Specification: 0 input; 1 output; 2 pull_up_input
- Return Value: none
getDitialInput;
- Function: Read input
- Parameter Specification: none
- Return Value: none
setPWMOutput(byte pin_no, int freq, byte pin_write);
- Function:Set the PWM signal of the ATOM end IO output that specifies the duty-through ratio
- Parameter description: pin_no:IO serial number freq: clock frequency pin_write:ratio: 0 ~ 256;128 indicates 50%.
- Return value:none