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 #include "common/model/i_model_number_validator.hpp"
24 
25 namespace ttl_driver
26 {
30 struct StepperReg
31 {
32  static constexpr common::model::EHardwareType motor_type = common::model::EHardwareType::STEPPER;
33 
34  static constexpr float PROTOCOL_VERSION = 2.0;
35  static constexpr int MODEL_NUMBER = 2000;
36  static constexpr int VOLTAGE_CONVERSION = 1000;
37 
38  static std::unique_ptr<common::model::IModelNumberValidator> createModelNumberValidator()
39  {
40  return std::make_unique<common::model::ExactModelNumberValidator>(MODEL_NUMBER);
41  }
42 
43  // EEPROM
44  static constexpr uint16_t ADDR_MODEL_NUMBER = 0;
45  using TYPE_MODEL_NUMBER = uint16_t;
46 
47  static constexpr uint16_t ADDR_ID = 7;
48  using TYPE_ID = uint8_t;
49 
50  static constexpr uint16_t ADDR_BAUDRATE = 8;
51  using TYPE_BAUDRATE = uint8_t;
52 
53  static constexpr uint16_t ADDR_OPERATING_MODE = 11;
54  using TYPE_OPERATING_MODE = uint8_t;
55 
56  static constexpr uint16_t ADDR_MAX_POSITION_LIMIT = 48;
57  using TYPE_MAX_POSITION_LIMIT = uint32_t;
58 
59  static constexpr uint16_t ADDR_MIN_POSITION_LIMIT = 52;
60  using TYPE_MIN_POSITION_LIMIT = uint32_t;
61 
62  static constexpr uint16_t ADDR_FIRMWARE_VERSION = 59;
63  using TYPE_FIRMWARE_VERSION = uint32_t;
64 
65  // RAM
66 
67  static constexpr uint16_t ADDR_TORQUE_ENABLE = 64;
68  using TYPE_TORQUE_ENABLE = uint8_t;
69 
70  static constexpr uint16_t ADDR_HW_ERROR_STATUS = 70;
71  using TYPE_HW_ERROR_STATUS = uint8_t;
72 
73  static constexpr float VELOCITY_UNIT = 0.01;
74  static constexpr uint16_t ADDR_GOAL_VELOCITY = 104;
75  using TYPE_GOAL_VELOCITY = uint32_t;
76 
77  // unit = 0.088 deg
78  static constexpr uint16_t ADDR_GOAL_POSITION = 116;
79  using TYPE_GOAL_POSITION = uint32_t;
80 
81  // unit = 0.01 RPM
82  static constexpr uint16_t ADDR_PRESENT_VELOCITY = 128;
83  using TYPE_PRESENT_VELOCITY = uint32_t;
84 
85  // unit = 0.088 deg
86  static constexpr uint16_t ADDR_PRESENT_POSITION = 132;
87  using TYPE_PRESENT_POSITION = uint32_t;
88 
89  // unit = 1mV
90  static constexpr uint16_t ADDR_PRESENT_VOLTAGE = 144;
91  using TYPE_PRESENT_VOLTAGE = uint16_t;
92 
93  static constexpr uint16_t ADDR_PRESENT_TEMPERATURE = 146;
94  using TYPE_PRESENT_TEMPERATURE = uint8_t;
95 
96  static constexpr uint16_t ADDR_COMMAND = 147;
97  using TYPE_COMMAND = uint8_t;
98 
99  static constexpr uint16_t ADDR_HOMING_STATUS = 148;
100  using TYPE_HOMING_STATUS = uint8_t;
101 
102  static constexpr uint16_t ADDR_HOMING_DIRECTION = 149;
103  using TYPE_HOMING_DIRECTION = uint8_t;
104 
105  static constexpr uint16_t ADDR_HOMING_STALL_THRESHOLD = 150;
107 
108  static constexpr uint16_t ADDR_HOMING_ABS_POSITION = 151;
109  using TYPE_HOMING_ABS_POSITION = uint32_t;
110 
111  // acceleration profile
112  using TYPE_PROFILE = uint32_t;
113  static constexpr uint16_t ADDR_VSTART = 1024;
114  static constexpr uint16_t ADDR_A1 = 1028;
115  static constexpr uint16_t ADDR_V1 = 1032;
116  static constexpr uint16_t ADDR_AMAX = 1036;
117  static constexpr uint16_t ADDR_VMAX = 1040;
118  static constexpr uint16_t ADDR_DMAX = 1044;
119  static constexpr uint16_t ADDR_D1 = 1048;
120  static constexpr uint16_t ADDR_VSTOP = 1052;
121 
122  // Firmware status
123 
124  static constexpr uint16_t ADDR_FIRMWARE_RUNNING = 8192;
125  using TYPE_FIRMWARE_RUNNING = uint8_t;
126 
127  static constexpr uint16_t ADDR_ENTER_BOOTLOADER = 8193;
128  using TYPE_ENTER_BOOTLOADER = uint32_t;
129 };
130 } // namespace ttl_driver
131 
132 #endif // STEPPER_REG_HPP
ttl_driver::StepperReg::TYPE_COMMAND
uint8_t TYPE_COMMAND
Definition: stepper_reg.hpp:97
ttl_driver::StepperReg::TYPE_BAUDRATE
uint8_t TYPE_BAUDRATE
Definition: stepper_reg.hpp:51
ttl_driver::StepperReg::TYPE_MAX_POSITION_LIMIT
uint32_t TYPE_MAX_POSITION_LIMIT
Definition: stepper_reg.hpp:57
ttl_driver::StepperReg::ADDR_MAX_POSITION_LIMIT
static constexpr uint16_t ADDR_MAX_POSITION_LIMIT
Definition: stepper_reg.hpp:56
ttl_driver::StepperReg::ADDR_HOMING_STATUS
static constexpr uint16_t ADDR_HOMING_STATUS
Definition: stepper_reg.hpp:99
ttl_driver::StepperReg::ADDR_VSTOP
static constexpr uint16_t ADDR_VSTOP
Definition: stepper_reg.hpp:120
ttl_driver::StepperReg::VELOCITY_UNIT
static constexpr float VELOCITY_UNIT
Definition: stepper_reg.hpp:73
ttl_driver::StepperReg::ADDR_FIRMWARE_RUNNING
static constexpr uint16_t ADDR_FIRMWARE_RUNNING
Definition: stepper_reg.hpp:124
ttl_driver::StepperReg::ADDR_GOAL_POSITION
static constexpr uint16_t ADDR_GOAL_POSITION
Definition: stepper_reg.hpp:78
ttl_driver::StepperReg::MODEL_NUMBER
static constexpr int MODEL_NUMBER
Definition: stepper_reg.hpp:35
ttl_driver::StepperReg::TYPE_PRESENT_POSITION
uint32_t TYPE_PRESENT_POSITION
Definition: stepper_reg.hpp:87
ttl_driver::StepperReg::ADDR_OPERATING_MODE
static constexpr uint16_t ADDR_OPERATING_MODE
Definition: stepper_reg.hpp:53
ttl_driver::StepperReg::ADDR_BAUDRATE
static constexpr uint16_t ADDR_BAUDRATE
Definition: stepper_reg.hpp:50
ttl_driver::StepperReg::TYPE_FIRMWARE_VERSION
uint32_t TYPE_FIRMWARE_VERSION
Definition: stepper_reg.hpp:63
ttl_driver::StepperReg::ADDR_HW_ERROR_STATUS
static constexpr uint16_t ADDR_HW_ERROR_STATUS
Definition: stepper_reg.hpp:70
ttl_driver::StepperReg::TYPE_PRESENT_VOLTAGE
uint16_t TYPE_PRESENT_VOLTAGE
Definition: stepper_reg.hpp:91
ttl_driver::StepperReg::ADDR_HOMING_STALL_THRESHOLD
static constexpr uint16_t ADDR_HOMING_STALL_THRESHOLD
Definition: stepper_reg.hpp:105
ttl_driver::StepperReg::ADDR_MIN_POSITION_LIMIT
static constexpr uint16_t ADDR_MIN_POSITION_LIMIT
Definition: stepper_reg.hpp:59
ttl_driver::StepperReg::TYPE_ENTER_BOOTLOADER
uint32_t TYPE_ENTER_BOOTLOADER
Definition: stepper_reg.hpp:128
ttl_driver::StepperReg::ADDR_TORQUE_ENABLE
static constexpr uint16_t ADDR_TORQUE_ENABLE
Definition: stepper_reg.hpp:67
ttl_driver::StepperReg::TYPE_GOAL_VELOCITY
uint32_t TYPE_GOAL_VELOCITY
Definition: stepper_reg.hpp:75
ttl_driver::StepperReg::ADDR_HOMING_DIRECTION
static constexpr uint16_t ADDR_HOMING_DIRECTION
Definition: stepper_reg.hpp:102
ttl_driver::StepperReg::TYPE_HOMING_STALL_THRESHOLD
uint8_t TYPE_HOMING_STALL_THRESHOLD
Definition: stepper_reg.hpp:106
ttl_driver::StepperReg::ADDR_MODEL_NUMBER
static constexpr uint16_t ADDR_MODEL_NUMBER
Definition: stepper_reg.hpp:44
ttl_driver::StepperReg::ADDR_D1
static constexpr uint16_t ADDR_D1
Definition: stepper_reg.hpp:119
ttl_driver::StepperReg::ADDR_DMAX
static constexpr uint16_t ADDR_DMAX
Definition: stepper_reg.hpp:118
ttl_driver::StepperReg::ADDR_PRESENT_POSITION
static constexpr uint16_t ADDR_PRESENT_POSITION
Definition: stepper_reg.hpp:86
ttl_driver::StepperReg::ADDR_HOMING_ABS_POSITION
static constexpr uint16_t ADDR_HOMING_ABS_POSITION
Definition: stepper_reg.hpp:108
ttl_driver::StepperReg::ADDR_COMMAND
static constexpr uint16_t ADDR_COMMAND
Definition: stepper_reg.hpp:96
ttl_driver::StepperReg::ADDR_VMAX
static constexpr uint16_t ADDR_VMAX
Definition: stepper_reg.hpp:117
ttl_driver::StepperReg::TYPE_FIRMWARE_RUNNING
uint8_t TYPE_FIRMWARE_RUNNING
Definition: stepper_reg.hpp:125
ttl_driver
Definition: abstract_dxl_driver.hpp:30
ttl_driver::StepperReg::TYPE_ID
uint8_t TYPE_ID
Definition: stepper_reg.hpp:48
ttl_driver::StepperReg::ADDR_V1
static constexpr uint16_t ADDR_V1
Definition: stepper_reg.hpp:115
ttl_driver::StepperReg::VOLTAGE_CONVERSION
static constexpr int VOLTAGE_CONVERSION
Definition: stepper_reg.hpp:36
ttl_driver::StepperReg::TYPE_PRESENT_TEMPERATURE
uint8_t TYPE_PRESENT_TEMPERATURE
Definition: stepper_reg.hpp:94
ttl_driver::StepperReg::TYPE_OPERATING_MODE
uint8_t TYPE_OPERATING_MODE
Definition: stepper_reg.hpp:54
ttl_driver::StepperReg::TYPE_HOMING_ABS_POSITION
uint32_t TYPE_HOMING_ABS_POSITION
Definition: stepper_reg.hpp:109
ttl_driver::StepperReg::ADDR_A1
static constexpr uint16_t ADDR_A1
Definition: stepper_reg.hpp:114
ttl_driver::StepperReg::TYPE_PRESENT_VELOCITY
uint32_t TYPE_PRESENT_VELOCITY
Definition: stepper_reg.hpp:83
ttl_driver::StepperReg::TYPE_HOMING_STATUS
uint8_t TYPE_HOMING_STATUS
Definition: stepper_reg.hpp:100
ttl_driver::StepperReg::ADDR_ENTER_BOOTLOADER
static constexpr uint16_t ADDR_ENTER_BOOTLOADER
Definition: stepper_reg.hpp:127
ttl_driver::StepperReg::PROTOCOL_VERSION
static constexpr float PROTOCOL_VERSION
Definition: stepper_reg.hpp:34
ttl_driver::StepperReg::ADDR_VSTART
static constexpr uint16_t ADDR_VSTART
Definition: stepper_reg.hpp:113
ttl_driver::StepperReg::TYPE_GOAL_POSITION
uint32_t TYPE_GOAL_POSITION
Definition: stepper_reg.hpp:79
ttl_driver::StepperReg::ADDR_PRESENT_VELOCITY
static constexpr uint16_t ADDR_PRESENT_VELOCITY
Definition: stepper_reg.hpp:82
ttl_driver::StepperReg
Register definitions for Ned/Ned2 Stepper motor.
Definition: stepper_reg.hpp:30
ttl_driver::StepperReg::ADDR_PRESENT_VOLTAGE
static constexpr uint16_t ADDR_PRESENT_VOLTAGE
Definition: stepper_reg.hpp:90
ttl_driver::StepperReg::TYPE_HOMING_DIRECTION
uint8_t TYPE_HOMING_DIRECTION
Definition: stepper_reg.hpp:103
ttl_driver::StepperReg::TYPE_MODEL_NUMBER
uint16_t TYPE_MODEL_NUMBER
Definition: stepper_reg.hpp:45
ttl_driver::StepperReg::ADDR_ID
static constexpr uint16_t ADDR_ID
Definition: stepper_reg.hpp:47
ttl_driver::StepperReg::ADDR_PRESENT_TEMPERATURE
static constexpr uint16_t ADDR_PRESENT_TEMPERATURE
Definition: stepper_reg.hpp:93
ttl_driver::StepperReg::createModelNumberValidator
static std::unique_ptr< common::model::IModelNumberValidator > createModelNumberValidator()
Definition: stepper_reg.hpp:38
ttl_driver::StepperReg::TYPE_PROFILE
uint32_t TYPE_PROFILE
Definition: stepper_reg.hpp:112
ttl_driver::StepperReg::ADDR_AMAX
static constexpr uint16_t ADDR_AMAX
Definition: stepper_reg.hpp:116
ttl_driver::StepperReg::TYPE_HW_ERROR_STATUS
uint8_t TYPE_HW_ERROR_STATUS
Definition: stepper_reg.hpp:71
ttl_driver::StepperReg::motor_type
static constexpr common::model::EHardwareType motor_type
Definition: stepper_reg.hpp:32
ttl_driver::StepperReg::TYPE_TORQUE_ENABLE
uint8_t TYPE_TORQUE_ENABLE
Definition: stepper_reg.hpp:68
ttl_driver::StepperReg::TYPE_MIN_POSITION_LIMIT
uint32_t TYPE_MIN_POSITION_LIMIT
Definition: stepper_reg.hpp:60
ttl_driver::StepperReg::ADDR_FIRMWARE_VERSION
static constexpr uint16_t ADDR_FIRMWARE_VERSION
Definition: stepper_reg.hpp:62
ttl_driver::StepperReg::ADDR_GOAL_VELOCITY
static constexpr uint16_t ADDR_GOAL_VELOCITY
Definition: stepper_reg.hpp:74


ttl_driver
Author(s): Clement Cocquempot
autogenerated on Fri Mar 6 2026 15:24:15