-
Notifications
You must be signed in to change notification settings - Fork 0
/
Register_Map.h
109 lines (101 loc) · 2.46 KB
/
Register_Map.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#ifndef REGISTER_MAP_H_
#define REGISTER_MAP_H_
#define BROADCASTER_ID 0xFE
// Register map
#define MODEL_NUMBER 0x00
#define MODEL_INFORMATION 0x02
#define FIRMWARE_VERSION 0x06
#define DYNAMIXEL_ID 0x07
#define BAUD_RATE 0x08
#define RESPONSE_DELAY_TIME 0x09
#define DRIVE_MODE 0x0A
#define OPERATING_MODE 0x0B
#define SHADOW_ID 0x0C
#define PROTOCOL_VERSION 0x0D
#define HOME_POSITION_OFFSET 0x14
#define MOVING_THRESHOLD 0x18
#define TEMPERATURE_LIMIT 0x1F
#define MAX_VOLTAGE_LIMIT 0x20
#define MINIMUM_VOLTAGE_LIMIT 0x22
#define MAXIMUM_PWM_LIMIT 0x24
#define MAXIMUM_CURRENT_LIMIT 0x26
#define MAXIMUM_ACCELERATION_LIMIT 0x28
#define MAXIMUM_VELOCITY_LIMIT 0x2C
#define MAXIMUM_POSITION_LIMIT 0x30
#define MINIMUM_POSITION_LIMIT 0x34
#define SHUTDOWN_DYNAMIXEL 0x3F
#define TORQUE_ENABLE 0x40
#define LED_STATUS 0x41
#define STATUS_RETURN_LEVEL 0x44
#define REGISTERED_INSTRUCTION 0x45
#define HARDWARE_ERROR_STATUS 0x46
#define VELOCITY_I_GAIN 0x4C
#define VELOCITY_P_GAIN 0x4E
#define POSITION_D_GAIN 0x50
#define POSITION_I_GAIN 0x52
#define POSITION_P_GAIN 0x54
#define FEEDFORWARD_2ND_GAIN 0x58
#define FEEDFORWARD_1ST_GAIN 0x5A
#define BUS_WATCHDOG 0x62
#define GOAL_PWM 0x64
#define GOAL_CURRENT 0x66
#define GOAL_VELOCITY 0x68
#define PROFILE_ACCELERATION 0x6C
#define PROFILE_VELOCITY 0x70
#define GOAL_POSITION 0x74
#define REALTIME_TICK 0x78
#define MOVING_STATUS 0x7A
#define DETAILED_MOVING_STATUS 0x7B
#define PRESENT_PWM 0x7C
#define PRESENT_CURRENT 0x7E
#define PRESENT_VELOCITY 0x80
#define PRESENT_POSITION 0x84
#define VELOCITY_TRAJECTORY 0x88
#define POSITION_TRAJECTORY 0x8C
#define PRESENT_INPUT_VOLTAGE 0x90
#define PRESENT_TEMPERATURE 0x92
// Protocol 2.0 instructions
#define PING 0x01
#define READ 0x02
#define WRITE 0x03
#define REG_WRITE 0x04
#define ACTION 0x05
#define FACTORY_RESET 0x06
#define REBOOT 0x08
#define CLEAR 0x10
#define STATUS 0x55
#define SYNC_READ 0x82
#define SYNC_WRITE 0x83
#define BULK_READ 0x92
#define BULK_WRITE 0x93
//servo's operating mode
enum OperatingMode {
CURRENT_MODE = 0X00,
VELOCITY_MODE = 0X01,
POSITION_MODE = 0X03,
EXTENDED_POSITION_MODE = 0X04,
CURRENT_POSITION_MODE = 0X05,
PWM_MODE = 0X10
};
//servo's driving mode
enum DriveMode {
CCW, CW
};
//servo's return level
enum ReturnLevel {
PING_INSTRUCTION,
PING_READ_INSTRUCTION,
ALL_INSTRUCTIONS
};
//servo's error number to indicate its type
enum Error {
NO_ERROR,
RESULT_ERROR,
INSTRUCTION_ERROR,
CRC_ERROR,
RANGE_ERROR,
LENGTH_ERROR,
LIMIT_ERROR,
ACCESS_ERROR
};
#endif