stepper_reg.hpp
Go to the documentation of this file.
1 /*
2 stepper_reg.hpp
3 Copyright (C) 2020 Niryo
4 All rights reserved.
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13 You should have received a copy of the GNU General Public License
14 along with this program. If not, see <http:// www.gnu.org/licenses/>.
15 */
16 
17 #ifndef STEPPER_REG_HPP
18 #define STEPPER_REG_HPP
19 
20 #include <memory>
21 #include "common/model/hardware_type_enum.hpp"
22 #include "common/model/stepper_calibration_status_enum.hpp"
23 
24 namespace ttl_driver
25 {
26  struct StepperReg
27  {
28  static constexpr common::model::EHardwareType motor_type = common::model::EHardwareType::STEPPER;
29 
30  static constexpr float PROTOCOL_VERSION = 2.0;
31  static constexpr int MODEL_NUMBER = 2000;
32  static constexpr int VOLTAGE_CONVERSION = 1000;
33 
34  // EEPROM
35  static constexpr uint16_t ADDR_MODEL_NUMBER = 0;
36  using TYPE_MODEL_NUMBER = uint16_t;
37 
38  static constexpr uint16_t ADDR_ID = 7;
39  using TYPE_ID = uint8_t;
40 
41  static constexpr uint16_t ADDR_BAUDRATE = 8;
42  using TYPE_BAUDRATE = uint8_t;
43 
44  static constexpr uint16_t ADDR_OPERATING_MODE = 11;
45  using TYPE_OPERATING_MODE = uint8_t;
46 
47  static constexpr uint16_t ADDR_MAX_POSITION_LIMIT = 48;
48  using TYPE_MAX_POSITION_LIMIT = uint32_t;
49 
50  static constexpr uint16_t ADDR_MIN_POSITION_LIMIT = 52;
51  using TYPE_MIN_POSITION_LIMIT = uint32_t;
52 
53  static constexpr uint16_t ADDR_FIRMWARE_VERSION = 59;
54  using TYPE_FIRMWARE_VERSION = uint32_t;
55 
56  // RAM
57 
58  static constexpr uint16_t ADDR_TORQUE_ENABLE = 64;
59  using TYPE_TORQUE_ENABLE = uint8_t;
60 
61  static constexpr uint16_t ADDR_HW_ERROR_STATUS = 70;
62  using TYPE_HW_ERROR_STATUS = uint8_t;
63 
64  static constexpr float VELOCITY_UNIT = 0.01;
65  static constexpr uint16_t ADDR_GOAL_VELOCITY = 104;
66  using TYPE_GOAL_VELOCITY = uint32_t;
67 
68  // unit = 0.088 deg
69  static constexpr uint16_t ADDR_GOAL_POSITION = 116;
70  using TYPE_GOAL_POSITION = uint32_t;
71 
72  // unit = 0.01 RPM
73  static constexpr uint16_t ADDR_PRESENT_VELOCITY = 128;
74  using TYPE_PRESENT_VELOCITY = uint32_t;
75 
76  // unit = 0.088 deg
77  static constexpr uint16_t ADDR_PRESENT_POSITION = 132;
78  using TYPE_PRESENT_POSITION = uint32_t;
79 
80  // unit = 1mV
81  static constexpr uint16_t ADDR_PRESENT_VOLTAGE = 144;
82  using TYPE_PRESENT_VOLTAGE = uint16_t;
83 
84  static constexpr uint16_t ADDR_PRESENT_TEMPERATURE = 146;
85  using TYPE_PRESENT_TEMPERATURE = uint8_t;
86 
87  static constexpr uint16_t ADDR_COMMAND = 147;
88  using TYPE_COMMAND = uint8_t;
89 
90  static constexpr uint16_t ADDR_HOMING_STATUS = 148;
91  using TYPE_HOMING_STATUS = uint8_t;
92 
93  static constexpr uint16_t ADDR_HOMING_DIRECTION = 149;
94  using TYPE_HOMING_DIRECTION = uint8_t;
95 
96  static constexpr uint16_t ADDR_HOMING_STALL_THRESHOLD = 150;
97  using TYPE_HOMING_STALL_THRESHOLD = uint8_t;
98 
99  static constexpr uint16_t ADDR_HOMING_ABS_POSITION = 151;
100  using TYPE_HOMING_ABS_POSITION = uint32_t;
101 
102  // acceleration profile
103  using TYPE_PROFILE = uint32_t;
104  static constexpr uint16_t ADDR_VSTART = 1024;
105  static constexpr uint16_t ADDR_A1 = 1028;
106  static constexpr uint16_t ADDR_V1 = 1032;
107  static constexpr uint16_t ADDR_AMAX = 1036;
108  static constexpr uint16_t ADDR_VMAX = 1040;
109  static constexpr uint16_t ADDR_DMAX = 1044;
110  static constexpr uint16_t ADDR_D1 = 1048;
111  static constexpr uint16_t ADDR_VSTOP = 1052;
112 
113  // Firmware status
114 
115  static constexpr uint16_t ADDR_FIRMWARE_RUNNING = 8192;
116  using TYPE_FIRMWARE_RUNNING = uint8_t;
117 
118  static constexpr uint16_t ADDR_ENTER_BOOTLOADER = 8193;
119  using TYPE_ENTER_BOOTLOADER = uint32_t;
120  };
121 } // ttl_driver
122 
123 #endif // STEPPER_REG_HPP
ttl_driver::StepperReg::TYPE_COMMAND
uint8_t TYPE_COMMAND
Definition: stepper_reg.hpp:88
ttl_driver::StepperReg::TYPE_BAUDRATE
uint8_t TYPE_BAUDRATE
Definition: stepper_reg.hpp:42
ttl_driver::StepperReg::TYPE_MAX_POSITION_LIMIT
uint32_t TYPE_MAX_POSITION_LIMIT
Definition: stepper_reg.hpp:48
ttl_driver::StepperReg::ADDR_MAX_POSITION_LIMIT
static constexpr uint16_t ADDR_MAX_POSITION_LIMIT
Definition: stepper_reg.hpp:47
ttl_driver::StepperReg::ADDR_HOMING_STATUS
static constexpr uint16_t ADDR_HOMING_STATUS
Definition: stepper_reg.hpp:90
ttl_driver::StepperReg::ADDR_VSTOP
static constexpr uint16_t ADDR_VSTOP
Definition: stepper_reg.hpp:111
ttl_driver::StepperReg::VELOCITY_UNIT
static constexpr float VELOCITY_UNIT
Definition: stepper_reg.hpp:64
ttl_driver::StepperReg::ADDR_FIRMWARE_RUNNING
static constexpr uint16_t ADDR_FIRMWARE_RUNNING
Definition: stepper_reg.hpp:115
ttl_driver::StepperReg::ADDR_GOAL_POSITION
static constexpr uint16_t ADDR_GOAL_POSITION
Definition: stepper_reg.hpp:69
ttl_driver::StepperReg::MODEL_NUMBER
static constexpr int MODEL_NUMBER
Definition: stepper_reg.hpp:31
ttl_driver::StepperReg::TYPE_PRESENT_POSITION
uint32_t TYPE_PRESENT_POSITION
Definition: stepper_reg.hpp:78
ttl_driver::StepperReg::ADDR_OPERATING_MODE
static constexpr uint16_t ADDR_OPERATING_MODE
Definition: stepper_reg.hpp:44
ttl_driver::StepperReg::ADDR_BAUDRATE
static constexpr uint16_t ADDR_BAUDRATE
Definition: stepper_reg.hpp:41
ttl_driver::StepperReg::TYPE_FIRMWARE_VERSION
uint32_t TYPE_FIRMWARE_VERSION
Definition: stepper_reg.hpp:54
ttl_driver::StepperReg::ADDR_HW_ERROR_STATUS
static constexpr uint16_t ADDR_HW_ERROR_STATUS
Definition: stepper_reg.hpp:61
ttl_driver::StepperReg::TYPE_PRESENT_VOLTAGE
uint16_t TYPE_PRESENT_VOLTAGE
Definition: stepper_reg.hpp:82
ttl_driver::StepperReg::ADDR_HOMING_STALL_THRESHOLD
static constexpr uint16_t ADDR_HOMING_STALL_THRESHOLD
Definition: stepper_reg.hpp:96
ttl_driver::StepperReg::ADDR_MIN_POSITION_LIMIT
static constexpr uint16_t ADDR_MIN_POSITION_LIMIT
Definition: stepper_reg.hpp:50
ttl_driver::StepperReg::TYPE_ENTER_BOOTLOADER
uint32_t TYPE_ENTER_BOOTLOADER
Definition: stepper_reg.hpp:119
ttl_driver::StepperReg::ADDR_TORQUE_ENABLE
static constexpr uint16_t ADDR_TORQUE_ENABLE
Definition: stepper_reg.hpp:58
ttl_driver::StepperReg::TYPE_GOAL_VELOCITY
uint32_t TYPE_GOAL_VELOCITY
Definition: stepper_reg.hpp:66
ttl_driver::StepperReg::ADDR_HOMING_DIRECTION
static constexpr uint16_t ADDR_HOMING_DIRECTION
Definition: stepper_reg.hpp:93
ttl_driver::StepperReg::TYPE_HOMING_STALL_THRESHOLD
uint8_t TYPE_HOMING_STALL_THRESHOLD
Definition: stepper_reg.hpp:97
ttl_driver::StepperReg::ADDR_MODEL_NUMBER
static constexpr uint16_t ADDR_MODEL_NUMBER
Definition: stepper_reg.hpp:35
ttl_driver::StepperReg::ADDR_D1
static constexpr uint16_t ADDR_D1
Definition: stepper_reg.hpp:110
ttl_driver::StepperReg::ADDR_DMAX
static constexpr uint16_t ADDR_DMAX
Definition: stepper_reg.hpp:109
ttl_driver::StepperReg::ADDR_PRESENT_POSITION
static constexpr uint16_t ADDR_PRESENT_POSITION
Definition: stepper_reg.hpp:77
ttl_driver::StepperReg::ADDR_HOMING_ABS_POSITION
static constexpr uint16_t ADDR_HOMING_ABS_POSITION
Definition: stepper_reg.hpp:99
ttl_driver::StepperReg::ADDR_COMMAND
static constexpr uint16_t ADDR_COMMAND
Definition: stepper_reg.hpp:87
ttl_driver::StepperReg::ADDR_VMAX
static constexpr uint16_t ADDR_VMAX
Definition: stepper_reg.hpp:108
ttl_driver::StepperReg::TYPE_FIRMWARE_RUNNING
uint8_t TYPE_FIRMWARE_RUNNING
Definition: stepper_reg.hpp:116
ttl_driver
Definition: abstract_dxl_driver.hpp:30
ttl_driver::StepperReg::TYPE_ID
uint8_t TYPE_ID
Definition: stepper_reg.hpp:39
ttl_driver::StepperReg::ADDR_V1
static constexpr uint16_t ADDR_V1
Definition: stepper_reg.hpp:106
ttl_driver::StepperReg::VOLTAGE_CONVERSION
static constexpr int VOLTAGE_CONVERSION
Definition: stepper_reg.hpp:32
ttl_driver::StepperReg::TYPE_PRESENT_TEMPERATURE
uint8_t TYPE_PRESENT_TEMPERATURE
Definition: stepper_reg.hpp:85
ttl_driver::StepperReg::TYPE_OPERATING_MODE
uint8_t TYPE_OPERATING_MODE
Definition: stepper_reg.hpp:45
ttl_driver::StepperReg::TYPE_HOMING_ABS_POSITION
uint32_t TYPE_HOMING_ABS_POSITION
Definition: stepper_reg.hpp:100
ttl_driver::StepperReg::ADDR_A1
static constexpr uint16_t ADDR_A1
Definition: stepper_reg.hpp:105
ttl_driver::StepperReg::TYPE_PRESENT_VELOCITY
uint32_t TYPE_PRESENT_VELOCITY
Definition: stepper_reg.hpp:74
ttl_driver::StepperReg::TYPE_HOMING_STATUS
uint8_t TYPE_HOMING_STATUS
Definition: stepper_reg.hpp:91
ttl_driver::StepperReg::ADDR_ENTER_BOOTLOADER
static constexpr uint16_t ADDR_ENTER_BOOTLOADER
Definition: stepper_reg.hpp:118
ttl_driver::StepperReg::PROTOCOL_VERSION
static constexpr float PROTOCOL_VERSION
Definition: stepper_reg.hpp:30
ttl_driver::StepperReg::ADDR_VSTART
static constexpr uint16_t ADDR_VSTART
Definition: stepper_reg.hpp:104
ttl_driver::StepperReg::TYPE_GOAL_POSITION
uint32_t TYPE_GOAL_POSITION
Definition: stepper_reg.hpp:70
ttl_driver::StepperReg::ADDR_PRESENT_VELOCITY
static constexpr uint16_t ADDR_PRESENT_VELOCITY
Definition: stepper_reg.hpp:73
ttl_driver::StepperReg
Definition: stepper_reg.hpp:26
ttl_driver::StepperReg::ADDR_PRESENT_VOLTAGE
static constexpr uint16_t ADDR_PRESENT_VOLTAGE
Definition: stepper_reg.hpp:81
ttl_driver::StepperReg::TYPE_HOMING_DIRECTION
uint8_t TYPE_HOMING_DIRECTION
Definition: stepper_reg.hpp:94
ttl_driver::StepperReg::TYPE_MODEL_NUMBER
uint16_t TYPE_MODEL_NUMBER
Definition: stepper_reg.hpp:36
ttl_driver::StepperReg::ADDR_ID
static constexpr uint16_t ADDR_ID
Definition: stepper_reg.hpp:38
ttl_driver::StepperReg::ADDR_PRESENT_TEMPERATURE
static constexpr uint16_t ADDR_PRESENT_TEMPERATURE
Definition: stepper_reg.hpp:84
ttl_driver::StepperReg::TYPE_PROFILE
uint32_t TYPE_PROFILE
Definition: stepper_reg.hpp:103
ttl_driver::StepperReg::ADDR_AMAX
static constexpr uint16_t ADDR_AMAX
Definition: stepper_reg.hpp:107
ttl_driver::StepperReg::TYPE_HW_ERROR_STATUS
uint8_t TYPE_HW_ERROR_STATUS
Definition: stepper_reg.hpp:62
ttl_driver::StepperReg::motor_type
static constexpr common::model::EHardwareType motor_type
Definition: stepper_reg.hpp:28
ttl_driver::StepperReg::TYPE_TORQUE_ENABLE
uint8_t TYPE_TORQUE_ENABLE
Definition: stepper_reg.hpp:59
ttl_driver::StepperReg::TYPE_MIN_POSITION_LIMIT
uint32_t TYPE_MIN_POSITION_LIMIT
Definition: stepper_reg.hpp:51
ttl_driver::StepperReg::ADDR_FIRMWARE_VERSION
static constexpr uint16_t ADDR_FIRMWARE_VERSION
Definition: stepper_reg.hpp:53
ttl_driver::StepperReg::ADDR_GOAL_VELOCITY
static constexpr uint16_t ADDR_GOAL_VELOCITY
Definition: stepper_reg.hpp:65


ttl_driver
Author(s): Clement Cocquempot
autogenerated on Wed May 21 2025 08:30:14