Quick Start for Dynamixel Pro v1.00b
Page
76
/
139
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 17
//Comport Number of USB2DXL
#define
BAUD_RATE_NUM 3
//Baudrate Number of Dynamixel PRO
#define
P_HOMING_OFFSET 13
//Address of Homing Offset in Control Table
#define
P_TORQUE_ENABLE 562
//Address of Torque Enable in Control Table
#define
P_GOAL_POSITION 596
//Address of Goal Position in Control Table
#define
ID 1
//ID of Dynamixel PRO you use
// Print error bit of status packet
void
PrintErrorCode(
int
ErrorCode)
{
if
(ErrorCode & ERRBIT_VOLTAGE)
printf(
"Input voltage error!\n"
);
if
(ErrorCode & ERRBIT_ANGLE)
printf(
"Angle limit error!\n"
);
if
(ErrorCode & ERRBIT_OVERHEAT)
printf(
"Overheat error!\n"
);
if
(ErrorCode & ERRBIT_RANGE)
printf(
"Out of range error!\n"
);
if
(ErrorCode & ERRBIT_CHECKSUM)
Summary of Contents for Dynamixel Pro
Page 1: ...Quick Start for Dynamixel Pro ...
Page 8: ...Quick Start for Dynamixel Pro v1 00b Page 8 139 ...
Page 33: ...Quick Start for Dynamixel Pro v1 00b Page 33 139 Check Dynamixel PRO firmware update results ...
Page 37: ...Quick Start for Dynamixel Pro v1 00b Page 37 139 Dynamixel PRO firmware recovery is complete ...
Page 66: ...Quick Start for Dynamixel Pro v1 00b Page 66 139 The present temperature is constantly read ...
Page 133: ...Quick Start for Dynamixel Pro v1 00b Page 133 139 2 3 2 42 series H42 L42 ...
Page 136: ...Quick Start for Dynamixel Pro v1 00b Page 136 139 ...
Page 138: ...Quick Start for Dynamixel Pro v1 00b Page 138 139 iii L42 10 S300 R ...
Page 139: ...Quick Start for Dynamixel Pro v1 00b Page 139 139 2 5 Model notation ...