Quick Start for Dynamixel Pro v1.00b
1.2.3 C programming language funtions.
i. Modifying the zero value of Dynamixel PRO
-
You can modify the zero-position of Dynamixel PRO.
-
Change the Control table's Homing Offset to modify Dynamixel PRO's zero-
position.
-
Homing Offset address on the Control Tableis 13 and requires 4 bytes of memory.
Therefore, implement dxl_write_dword to modify the Homing Offset value.
-
Homing Offset is a part of the EEPROM area, which requires the Torque Enable
to be turned off be for changes.
-
When modifying the Homing Offset value, designate the zero position by
inverting the desired zero position with a negative sign (-).
-
For instance, to set the Position Valu 50000 as the zero position, -50000 needs to
be entered as the Homing Offset value.
-
The program's entire source code is shown below.
-
Check if the Operation Mode is set as 'Joint Mode' before running the program
below.
main.cpp
#include
<stdio.h>
#include
<conio.h>
#include
"dynamixel.h"
#define
COM_PORT_NUM
#define
BAUD_RATE_NUM
#define
P_HOMING_OFFSET
#define
P_TORQUE_ENABLE
#define
P_GOAL_POSITION
#define
ID
// Print error bit of status packet
void PrintErrorCode(int
{
if(ErrorCode & ERRBIT_VOLTAGE)
printf("Input voltage
if(ErrorCode & ERRBIT_ANGLE)
printf("Angle limit
if(ErrorCode & ERRBIT_OVERHEAT)
printf("Overheat
if(ErrorCode & ERRBIT_RANGE)
printf("Out of range
if(ErrorCode & ERRBIT_CHECKSUM)
17
3
13
562
596
1
ErrorCode)
error!\n");
error!\n");
error!\n");
error!\n");
//Comport Number of USB2DXL
//Baudrate Number of Dynamixel PRO
//Address of Homing Offset in Control Table
//Address of Torque Enable in Control Table
//Address of Goal Position in Control Table
//ID of Dynamixel PRO you use
Page 76 / 139
Need help?
Do you have a question about the Dynamixel Pro and is the answer not in the manual?
Questions and answers