Quick Start for Dynamixel Pro v1.00b
Page
56
/
139
vi.
Modifying the P gain value of Dynamixel PRO
-
Let’s control the P gain value of Dynamixel PRO’s position.
-
Dynamixel PRO implements PID control to maniputate its motor; therefore, the
movement changes cooresponding to the gain values.
-
On Dynamixel PRO’s Control Table, the Position_P_Gain address is set as 594
and it utilizes 2 bytes (1 word) of memory.
-
Thus,
dxl_write_word
function, which modifies 2 bytes of memory, changes
the P gain value.
-
The program’s entire source is shown 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_TORQUE_ENABLE 562
//Address of Torque Enable in Control Table
#define
P_POSITION_P_GAIN 594
//Address of Position P Gain in Contorl Table
#define
P_GOAL_POSITION 596
//Address of Goal Position in Contorl 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)
printf(
"Checksum error!\n"
);
if
(ErrorCode & ERRBIT_OVERLOAD)
printf(
"Overload error!\n"
);
if
(ErrorCode & ERRBIT_INSTRUCTION)
printf(
"Instruction code error!\n"
);
}
int
main(
void
)
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 ...