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


ttl_driver
Author(s): Clement Cocquempot
autogenerated on Tue Jan 13 2026 12:43:08