CTRE Phoenix 6 C++ 25.2.1
Loading...
Searching...
No Matches
HasExternalMotor.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) Cross The Road Electronics.  All rights reserved.
3 * License information can be found in CTRE_LICENSE.txt
4 * For support and suggestions contact support@ctr-electronics.com or file
5 * an issue tracker at https://github.com/CrossTheRoadElec/Phoenix-Releases
6 */
7#pragma once
8
12
13#include <units/temperature.h>
14#include <units/voltage.h>
15
16namespace ctre {
17namespace phoenix6 {
18namespace hardware {
19namespace traits {
20
21/**
22 * Contains all status signals for motor controllers that support external
23 * motors.
24 */
26{
27public:
28 virtual ~HasExternalMotor() = default;
29
30 /**
31 * \brief Status of the temperature sensor of the external motor.
32 *
33 *
34 * This refreshes and returns a cached StatusSignal object.
35 *
36 * \param refresh Whether to refresh the StatusSignal before returning it; defaults to true
37 * \returns ExternalMotorTempStatus Status Signal Object
38 */
40
41 /**
42 * \brief Temperature of the external motor.
43 *
44 * - Minimum Value: 0.0
45 * - Maximum Value: 255.0
46 * - Default Value: 0
47 * - Units: ℃
48 *
49 * This refreshes and returns a cached StatusSignal object.
50 *
51 * \param refresh Whether to refresh the StatusSignal before returning it; defaults to true
52 * \returns ExternalMotorTemp Status Signal Object
53 */
55
56 /**
57 * \brief The measured voltage of the 5V rail available on the JST and
58 * dataport connectors.
59 *
60 * - Minimum Value: 0.0
61 * - Maximum Value: 40.95
62 * - Default Value: 0
63 * - Units: Volts
64 *
65 * This refreshes and returns a cached StatusSignal object.
66 *
67 * \param refresh Whether to refresh the StatusSignal before returning it; defaults to true
68 * \returns FiveVRailVoltage Status Signal Object
69 */
71
72 /**
73 * \brief Bridge was disabled most likely due to a short in the motor
74 * leads.
75 *
76 * - Default Value: False
77 *
78 * This refreshes and returns a cached StatusSignal object.
79 *
80 * \param refresh Whether to refresh the StatusSignal before returning it; defaults to true
81 * \returns Fault_BridgeShort Status Signal Object
82 */
83 virtual StatusSignal<bool> &GetFault_BridgeShort(bool refresh = true) = 0;
84
85 /**
86 * \brief Bridge was disabled most likely due to a short in the motor
87 * leads.
88 *
89 * - Default Value: False
90 *
91 * This refreshes and returns a cached StatusSignal object.
92 *
93 * \param refresh Whether to refresh the StatusSignal before returning it; defaults to true
94 * \returns StickyFault_BridgeShort Status Signal Object
95 */
96 virtual StatusSignal<bool> &GetStickyFault_BridgeShort(bool refresh = true) = 0;
97
98 /**
99 * \brief Hall sensor signals are invalid. Check hall sensor and
100 * cabling. This fault can be used to detect when hall cable is
101 * unplugged.
102 *
103 * - Default Value: False
104 *
105 * This refreshes and returns a cached StatusSignal object.
106 *
107 * \param refresh Whether to refresh the StatusSignal before returning it; defaults to true
108 * \returns Fault_HallSensorMissing Status Signal Object
109 */
110 virtual StatusSignal<bool> &GetFault_HallSensorMissing(bool refresh = true) = 0;
111
112 /**
113 * \brief Hall sensor signals are invalid. Check hall sensor and
114 * cabling. This fault can be used to detect when hall cable is
115 * unplugged.
116 *
117 * - Default Value: False
118 *
119 * This refreshes and returns a cached StatusSignal object.
120 *
121 * \param refresh Whether to refresh the StatusSignal before returning it; defaults to true
122 * \returns StickyFault_HallSensorMissing Status Signal Object
123 */
124 virtual StatusSignal<bool> &GetStickyFault_HallSensorMissing(bool refresh = true) = 0;
125
126 /**
127 * \brief Hall sensor signals are invalid during motor drive, so motor
128 * was disabled. Check hall sensor and cabling.
129 *
130 * - Default Value: False
131 *
132 * This refreshes and returns a cached StatusSignal object.
133 *
134 * \param refresh Whether to refresh the StatusSignal before returning it; defaults to true
135 * \returns Fault_DriveDisabledHallSensor Status Signal Object
136 */
137 virtual StatusSignal<bool> &GetFault_DriveDisabledHallSensor(bool refresh = true) = 0;
138
139 /**
140 * \brief Hall sensor signals are invalid during motor drive, so motor
141 * was disabled. Check hall sensor and cabling.
142 *
143 * - Default Value: False
144 *
145 * This refreshes and returns a cached StatusSignal object.
146 *
147 * \param refresh Whether to refresh the StatusSignal before returning it; defaults to true
148 * \returns StickyFault_DriveDisabledHallSensor Status Signal Object
149 */
151
152 /**
153 * \brief Motor temperature signal appears to not be connected.
154 *
155 * - Default Value: False
156 *
157 * This refreshes and returns a cached StatusSignal object.
158 *
159 * \param refresh Whether to refresh the StatusSignal before returning it; defaults to true
160 * \returns Fault_MotorTempSensorMissing Status Signal Object
161 */
162 virtual StatusSignal<bool> &GetFault_MotorTempSensorMissing(bool refresh = true) = 0;
163
164 /**
165 * \brief Motor temperature signal appears to not be connected.
166 *
167 * - Default Value: False
168 *
169 * This refreshes and returns a cached StatusSignal object.
170 *
171 * \param refresh Whether to refresh the StatusSignal before returning it; defaults to true
172 * \returns StickyFault_MotorTempSensorMissing Status Signal Object
173 */
175
176 /**
177 * \brief Motor temperature signal indicates motor is too hot.
178 *
179 * - Default Value: False
180 *
181 * This refreshes and returns a cached StatusSignal object.
182 *
183 * \param refresh Whether to refresh the StatusSignal before returning it; defaults to true
184 * \returns Fault_MotorTempSensorTooHot Status Signal Object
185 */
186 virtual StatusSignal<bool> &GetFault_MotorTempSensorTooHot(bool refresh = true) = 0;
187
188 /**
189 * \brief Motor temperature signal indicates motor is too hot.
190 *
191 * - Default Value: False
192 *
193 * This refreshes and returns a cached StatusSignal object.
194 *
195 * \param refresh Whether to refresh the StatusSignal before returning it; defaults to true
196 * \returns StickyFault_MotorTempSensorTooHot Status Signal Object
197 */
199
200
201
202 /**
203 * \brief Clear sticky fault: Bridge was disabled most likely due to a
204 * short in the motor leads.
205 *
206 * \param timeoutSeconds Maximum time to wait up to in seconds.
207 * \returns StatusCode of the set command
208 */
209 virtual ctre::phoenix::StatusCode ClearStickyFault_BridgeShort(units::time::second_t timeoutSeconds) = 0;
210 /**
211 * \brief Clear sticky fault: Bridge was disabled most likely due to a
212 * short in the motor leads.
213 *
214 * This will wait up to 0.100 seconds (100ms) by default.
215 *
216 * \returns StatusCode of the set command
217 */
219
220 /**
221 * \brief Clear sticky fault: Hall sensor signals are invalid. Check
222 * hall sensor and cabling. This fault can be used to detect when
223 * hall cable is unplugged.
224 *
225 * \param timeoutSeconds Maximum time to wait up to in seconds.
226 * \returns StatusCode of the set command
227 */
228 virtual ctre::phoenix::StatusCode ClearStickyFault_HallSensorMissing(units::time::second_t timeoutSeconds) = 0;
229 /**
230 * \brief Clear sticky fault: Hall sensor signals are invalid. Check
231 * hall sensor and cabling. This fault can be used to detect when
232 * hall cable is unplugged.
233 *
234 * This will wait up to 0.100 seconds (100ms) by default.
235 *
236 * \returns StatusCode of the set command
237 */
239
240 /**
241 * \brief Clear sticky fault: Hall sensor signals are invalid during
242 * motor drive, so motor was disabled. Check hall sensor and cabling.
243 *
244 * \param timeoutSeconds Maximum time to wait up to in seconds.
245 * \returns StatusCode of the set command
246 */
247 virtual ctre::phoenix::StatusCode ClearStickyFault_DriveDisabledHallSensor(units::time::second_t timeoutSeconds) = 0;
248 /**
249 * \brief Clear sticky fault: Hall sensor signals are invalid during
250 * motor drive, so motor was disabled. Check hall sensor and cabling.
251 *
252 * This will wait up to 0.100 seconds (100ms) by default.
253 *
254 * \returns StatusCode of the set command
255 */
257
258 /**
259 * \brief Clear sticky fault: Motor temperature signal appears to not
260 * be connected.
261 *
262 * \param timeoutSeconds Maximum time to wait up to in seconds.
263 * \returns StatusCode of the set command
264 */
265 virtual ctre::phoenix::StatusCode ClearStickyFault_MotorTempSensorMissing(units::time::second_t timeoutSeconds) = 0;
266 /**
267 * \brief Clear sticky fault: Motor temperature signal appears to not
268 * be connected.
269 *
270 * This will wait up to 0.100 seconds (100ms) by default.
271 *
272 * \returns StatusCode of the set command
273 */
275
276 /**
277 * \brief Clear sticky fault: Motor temperature signal indicates motor
278 * is too hot.
279 *
280 * \param timeoutSeconds Maximum time to wait up to in seconds.
281 * \returns StatusCode of the set command
282 */
283 virtual ctre::phoenix::StatusCode ClearStickyFault_MotorTempSensorTooHot(units::time::second_t timeoutSeconds) = 0;
284 /**
285 * \brief Clear sticky fault: Motor temperature signal indicates motor
286 * is too hot.
287 *
288 * This will wait up to 0.100 seconds (100ms) by default.
289 *
290 * \returns StatusCode of the set command
291 */
293};
294
295}
296}
297}
298}
299
Represents a status signal with data of type T, and operations available to retrieve information abou...
Definition StatusSignal.hpp:656
Contains all status signals for motor controllers that support external motors.
Definition HasExternalMotor.hpp:26
virtual StatusSignal< bool > & GetStickyFault_MotorTempSensorTooHot(bool refresh=true)=0
Motor temperature signal indicates motor is too hot.
virtual ctre::phoenix::StatusCode ClearStickyFault_MotorTempSensorTooHot()=0
Clear sticky fault: Motor temperature signal indicates motor is too hot.
virtual StatusSignal< units::voltage::volt_t > & GetFiveVRailVoltage(bool refresh=true)=0
The measured voltage of the 5V rail available on the JST and dataport connectors.
virtual ctre::phoenix::StatusCode ClearStickyFault_BridgeShort(units::time::second_t timeoutSeconds)=0
Clear sticky fault: Bridge was disabled most likely due to a short in the motor leads.
virtual ctre::phoenix::StatusCode ClearStickyFault_MotorTempSensorMissing()=0
Clear sticky fault: Motor temperature signal appears to not be connected.
virtual ctre::phoenix::StatusCode ClearStickyFault_DriveDisabledHallSensor(units::time::second_t timeoutSeconds)=0
Clear sticky fault: Hall sensor signals are invalid during motor drive, so motor was disabled.
virtual StatusSignal< bool > & GetFault_MotorTempSensorTooHot(bool refresh=true)=0
Motor temperature signal indicates motor is too hot.
virtual ctre::phoenix::StatusCode ClearStickyFault_BridgeShort()=0
Clear sticky fault: Bridge was disabled most likely due to a short in the motor leads.
virtual ctre::phoenix::StatusCode ClearStickyFault_MotorTempSensorTooHot(units::time::second_t timeoutSeconds)=0
Clear sticky fault: Motor temperature signal indicates motor is too hot.
virtual StatusSignal< bool > & GetFault_DriveDisabledHallSensor(bool refresh=true)=0
Hall sensor signals are invalid during motor drive, so motor was disabled.
virtual StatusSignal< bool > & GetFault_MotorTempSensorMissing(bool refresh=true)=0
Motor temperature signal appears to not be connected.
virtual StatusSignal< units::temperature::celsius_t > & GetExternalMotorTemp(bool refresh=true)=0
Temperature of the external motor.
virtual StatusSignal< bool > & GetFault_HallSensorMissing(bool refresh=true)=0
Hall sensor signals are invalid.
virtual StatusSignal< signals::ExternalMotorTempStatusValue > & GetExternalMotorTempStatus(bool refresh=true)=0
Status of the temperature sensor of the external motor.
virtual StatusSignal< bool > & GetStickyFault_HallSensorMissing(bool refresh=true)=0
Hall sensor signals are invalid.
virtual ctre::phoenix::StatusCode ClearStickyFault_HallSensorMissing()=0
Clear sticky fault: Hall sensor signals are invalid.
virtual ctre::phoenix::StatusCode ClearStickyFault_MotorTempSensorMissing(units::time::second_t timeoutSeconds)=0
Clear sticky fault: Motor temperature signal appears to not be connected.
virtual ctre::phoenix::StatusCode ClearStickyFault_DriveDisabledHallSensor()=0
Clear sticky fault: Hall sensor signals are invalid during motor drive, so motor was disabled.
virtual StatusSignal< bool > & GetFault_BridgeShort(bool refresh=true)=0
Bridge was disabled most likely due to a short in the motor leads.
virtual StatusSignal< bool > & GetStickyFault_BridgeShort(bool refresh=true)=0
Bridge was disabled most likely due to a short in the motor leads.
virtual StatusSignal< bool > & GetStickyFault_MotorTempSensorMissing(bool refresh=true)=0
Motor temperature signal appears to not be connected.
virtual StatusSignal< bool > & GetStickyFault_DriveDisabledHallSensor(bool refresh=true)=0
Hall sensor signals are invalid during motor drive, so motor was disabled.
virtual ctre::phoenix::StatusCode ClearStickyFault_HallSensorMissing(units::time::second_t timeoutSeconds)=0
Clear sticky fault: Hall sensor signals are invalid.
Status codes reported by APIs, including OK, warnings, and errors.
Definition StatusCodes.h:27
Definition MotionMagicExpoTorqueCurrentFOC.hpp:18