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
getAtomVersion();
Function: Get Atom firmware version
Return Value: Values of type int
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: Arrays of type Angles
writeAngle(int joint, float value, int speed);
Function: Send a single joint Angle
Parameter Specification:
Joint Number= joint, range from 1-6; Specified Angle Value= value, range approximately from -170°- + 170°; Specified Speed= speed, range from 0-100Return 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.
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: To send the specified coordinate parameter, which should be of type Coords, declare a variable of type Coords, which is used in the same way as an array
Parameter Specification
coords[0] = X, coords[1] = Y, coords[2] = Z,
X,Y,Z range from -300.00-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-100 unit %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 value
Parameter Specification:
Joint Number = joint, range from 1-7( 7 is generally a clamping jaw )
Potential Value 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 value
Parameter Specification: Servo Motor Number = joint range from 1-7
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 variable of type Angles: angleEncoders, it is used in the same way as arrays. Assign a value to the array angleEncoders, values range from 0-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-100 unit %
Return Value: None
getEncoders();
Function: Get all joint potential values
Return Value: Arrays of type Angles, range from 0-4096
getServoSpeeds();
Function: Get all servo speeds
Return Value: Arrays of type Angles, Velocity is 0 when not in motion
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-100 unit %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-100 unit %Return Value: None
jogStop();
Function: Stops the specified direction of motion that has started
Return Value: None
ProgramPause();
Function: Program pause
Return Value: None
ProgramResume();
Function: Program continues to run
Return Value: None
TaskStop();
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 %
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
setMovementType(MovementType movement_type);
Function: Set the movement method
Parameter Specification: Movements are non-linear path movement (movej) and linear path movement (movel)
Return Value: None
getMovementType();
Function: Read movement method
Return Value: The non-linear method returns 0; the linear method returns 1
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 servo serial number = joint, range from 1-6;
Data Address = data_id, refer to the following Figure for addressReturn Value: Refer to the following Figure for the value range
setServoData(int joint, byte data_id, byte data);
Function: Set the data parameters for the specified address of the servo
Parameter Specification:
Joint servo serial number = joint, range from 1-6;
Data Address = data_id, refer to the address range in the figure above;
data = the range of values in the above diagramReturn Value: None
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
releaseServo(byte servo_no);
Function: Loosen a joint of the arm/put a joint of the arm in a power-down state
Parameter Specification: servo_no is 1-6
Return Value: None
focusServo(byte servo_no);
Function: Putting a joint of the robot arm in the power-up state
Parameter Specification: servo_no is 1-6
Return Value: None
getServoVoltages();
Function: Get all servo voltages
Return Value: Array of type Angles, reference range from 8.4-12.0
getServoStatus();
Function: Get the status of all servos
Return Value: 0 means all states are normal; 1 means voltage overvoltage/undervoltage; 2 means magnetic code state abnormal; 4 means temperature overheating; 8 means current overcurrent; 32 means load overload; when the number that appears is not equal to the above abnormal numbers, for example: 3 means voltage overvoltage/undervoltage and magnetic code state abnormal, 7 means voltage overvoltage/undervoltage, magnetic code state abnormal and temperature overheating
getServoTemps();
Function: Get all servo temperatures
Return Value: Array of type Angles, reference range from 0-255
6. Atom IO Control
setPinMode(byte pin_no, byte pin_mode);
Function: Sets the state mode of the specified pin of atom
Parameter Specification:
Pin Serial Number =pin_no
, reference range from: 19、22、23、26、32、33
Output Mode = pin_mode, reference range from: 0、1Return Value: None
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
setGripperValue(int data, int sp);
Function: Set the jaw potential, please get the current potential of the jaw before use
Parameter Specification: Input values ( 1300-4096 )
Return Value: None
setGripperIni();
Function: Set jaw zero point
Return Value: None
getGripperValue();
Function: Get the current potential value of the jaws
Return Value: Returns the current jaw potential value, range 1300-4096
setGripperState(byte mode, int sp);
Function: Set the jaws to open and close
Parameter Specification: 0 on, 1 off
Return Value: None
isGripperMoving();
Function: Detects if the jaws are in motion
Return Value: 0 not in motion, 1 in motion
setDigitalOutput(byte pin_no, byte pin_state);
Function: Setting the operating state of IO pins
Parameter Specification: 0 input; 1 output; 2
pull_up_input
Return Value: None
getDitialInput(byte pin_no);
Function: Read input
Parameter Specification: Pin Serial Number = pin_no Range of values: 19、22、23、26、32、33
Return Value: None
setPWMOutput(byte pin_no, int freq, byte pin_write);
Function: Set ATOM end IO to output PWM signal with specified duty cycle
Parameter Specification:
`pin_no`: IO Serial Number<br> freq: Clock Frequency<br> pin_write: Duty Cycle 0-256; 128 means 50%
Return Value: None
7. Coordinate Control Mode
setToolReference(Coords coords);
Function: Set coordinate system of tool
Parameter Specification:
X,Y,Z range from -300.00-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.00-180.00Return Value: None
setWorldReference(Coords coords);
Function: Set coordinate system of world
Parameter Specification:
X,Y,Z range from -300.00-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.00-180.00Return Value: None
getToolReference();
Function: Get coordinate system of tool
Return Value:
X,Y,Z range from -300.00-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.00-180.00
getWorldReference();
Function: Get coordinate system of world
Return Value:
X,Y,Z range from -300.00-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.00-180.00
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 coordinate system as the base coordinateReturn Value: None
getReferenceFrame();
Function:Get coordinate system of flange
Return Value: X,Y,Z range from -300.00-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.00-180.00
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 endReturn Value: None
getEndType();
Function: Get coordinate system of the end
Return Value: X,Y,Z range from -300.00-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.00-180.00