CTRE Phoenix 6 C++ 26.0.0-beta-1
Loading...
Searching...
No Matches
DynamicMotionMagicExpoDutyCycle.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
10#include <units/frequency.h>
11#include <units/time.h>
12#include <units/angle.h>
13#include "ctre/unit/pid_ff.h"
14#include <units/angular_velocity.h>
15#include <units/dimensionless.h>
16
17namespace ctre {
18namespace phoenix6 {
19namespace controls {
20
21/**
22 * Requires Phoenix Pro and CANivore;
23 * Requests Motion Magic® Expo to target a final position using an exponential
24 * motion profile. This dynamic request allows runtime changes to the profile
25 * kV, kA, and (optional) Cruise Velocity. Users can optionally provide a duty
26 * cycle feedforward.
27 *
28 * Motion Magic® Expo produces a motion profile in real-time while attempting to honor the specified Cruise
29 * Velocity (optional) and the mechanism kV and kA. Note that unlike the slot gains, the Expo_kV and Expo_kA
30 * parameters are always in output units of Volts.
31 *
32 * Setting the Cruise Velocity to 0 will allow the profile to run to the max possible velocity based on
33 * Expo_kV. This control mode does not use the Acceleration or Jerk configs.
34 *
35 * Target position can be changed on-the-fly and Motion Magic® will do its best to adjust the profile. This
36 * control mode is duty cycle based, so relevant closed-loop gains will use fractional duty cycle for the
37 * numerator: +1.0 represents full forward output.
38 */
40 ctre::phoenix::StatusCode SendRequest(const char *network, uint32_t deviceHash, std::shared_ptr<ControlRequest> &req) const override;
41
42public:
43 /**
44 * \brief Position to drive toward in rotations.
45 *
46 * - Units: rotations
47 *
48 */
49 units::angle::turn_t Position;
50 /**
51 * \brief Mechanism kV for profiling. Unlike the kV slot gain, this is always
52 * in units of V/rps.
53 *
54 * This represents the amount of voltage necessary to hold a velocity. In terms
55 * of the Motion Magic® Expo profile, a higher kV results in a slower maximum
56 * velocity.
57 *
58 * - Units: V/rps
59 *
60 */
61 ctre::unit::volts_per_turn_per_second_t kV;
62 /**
63 * \brief Mechanism kA for profiling. Unlike the kA slot gain, this is always
64 * in units of V/rps².
65 *
66 * This represents the amount of voltage necessary to achieve an acceleration.
67 * In terms of the Motion Magic® Expo profile, a higher kA results in a slower
68 * acceleration.
69 *
70 * - Units: V/rps²
71 *
72 */
73 ctre::unit::volts_per_turn_per_second_squared_t kA;
74 /**
75 * \brief Cruise velocity for profiling. The signage does not matter as the
76 * device will use the absolute value for profile generation. Setting this to 0
77 * will allow the profile to run to the max possible velocity based on Expo_kV.
78 *
79 * - Units: rotations per second
80 *
81 */
82 units::angular_velocity::turns_per_second_t Velocity = 0_tps;
83 /**
84 * \brief Set to true to use FOC commutation (requires Phoenix Pro), which
85 * increases peak power by ~15% on supported devices (see
86 * hardware#traits#SupportsFOC). Set to false to use trapezoidal commutation.
87 *
88 * FOC improves motor performance by leveraging torque (current) control.
89 * However, this may be inconvenient for applications that require specifying
90 * duty cycle or voltage. CTR-Electronics has developed a hybrid method that
91 * combines the performances gains of FOC while still allowing applications to
92 * provide duty cycle or voltage demand. This not to be confused with simple
93 * sinusoidal control or phase voltage control which lacks the performance
94 * gains.
95 */
96 bool EnableFOC = true;
97 /**
98 * \brief Feedforward to apply in fractional units between -1 and +1. This is
99 * added to the output of the onboard feedforward terms.
100 *
101 * - Units: fractional
102 *
103 */
104 units::dimensionless::scalar_t FeedForward = 0.0;
105 /**
106 * \brief Select which gains are applied by selecting the slot. Use the
107 * configuration api to set the gain values for the selected slot before
108 * enabling this feature. Slot must be within [0,2].
109 */
110 int Slot = 0;
111 /**
112 * \brief Set to true to static-brake the rotor when output is zero (or within
113 * deadband). Set to false to use the NeutralMode configuration setting
114 * (default). This flag exists to provide the fundamental behavior of this
115 * control when output is zero, which is to provide 0V to the motor.
116 */
118 /**
119 * \brief Set to true to force forward limiting. This allows users to use other
120 * limit switch sensors connected to robot controller. This also allows use of
121 * active sensors that require external power.
122 */
123 bool LimitForwardMotion = false;
124 /**
125 * \brief Set to true to force reverse limiting. This allows users to use other
126 * limit switch sensors connected to robot controller. This also allows use of
127 * active sensors that require external power.
128 */
129 bool LimitReverseMotion = false;
130 /**
131 * \brief Set to true to ignore hardware limit switches and the
132 * LimitForwardMotion and LimitReverseMotion parameters, instead allowing
133 * motion.
134 *
135 * This can be useful on mechanisms such as an intake/feeder, where a limit
136 * switch stops motion while intaking but should be ignored when feeding to a
137 * shooter.
138 *
139 * The hardware limit faults and Forward/ReverseLimit signals will still report
140 * the values of the limit switches regardless of this parameter.
141 */
143 /**
144 * \brief Set to true to ignore software limits, instead allowing motion.
145 *
146 * This can be useful when calibrating the zero point of a mechanism such as an
147 * elevator.
148 *
149 * The software limit faults will still report the values of the software limits
150 * regardless of this parameter.
151 */
153 /**
154 * \brief Set to true to delay applying this control request until a timesync
155 * boundary (requires Phoenix Pro and CANivore). This eliminates the impact of
156 * nondeterministic network delays in exchange for a larger but deterministic
157 * control latency.
158 *
159 * This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs.
160 * Additionally, when this is enabled, the UpdateFreqHz of this request should
161 * be set to 0 Hz.
162 */
163 bool UseTimesync = false;
164
165 /**
166 * \brief The frequency at which this control will update.
167 * This is designated in Hertz, with a minimum of 20 Hz
168 * (every 50 ms) and a maximum of 1000 Hz (every 1 ms).
169 * Some update frequencies are not supported and will be
170 * promoted up to the next highest supported frequency.
171 *
172 * If this field is set to 0 Hz, the control request will
173 * be sent immediately as a one-shot frame. This may be useful
174 * for advanced applications that require outputs to be
175 * synchronized with data acquisition. In this case, we
176 * recommend not exceeding 50 ms between control calls.
177 */
178 units::frequency::hertz_t UpdateFreqHz{100_Hz};
179
180 /**
181 * \brief Requires Phoenix Pro and CANivore;
182 * Requests Motion Magic® Expo to target a final position using an
183 * exponential motion profile. This dynamic request allows runtime
184 * changes to the profile kV, kA, and (optional) Cruise Velocity. Users
185 * can optionally provide a duty cycle feedforward.
186 *
187 * \details Motion Magic® Expo produces a motion profile in real-time while
188 * attempting to honor the specified Cruise Velocity (optional) and the
189 * mechanism kV and kA. Note that unlike the slot gains, the Expo_kV
190 * and Expo_kA parameters are always in output units of Volts.
191 *
192 * Setting the Cruise Velocity to 0 will allow the profile to run to
193 * the max possible velocity based on Expo_kV. This control mode does
194 * not use the Acceleration or Jerk configs.
195 *
196 * Target position can be changed on-the-fly and Motion Magic® will do
197 * its best to adjust the profile. This control mode is duty cycle
198 * based, so relevant closed-loop gains will use fractional duty cycle
199 * for the numerator: +1.0 represents full forward output.
200 *
201 * \param Position Position to drive toward in rotations.
202 * \param kV Mechanism kV for profiling. Unlike the kV slot gain, this is
203 * always in units of V/rps.
204 *
205 * This represents the amount of voltage necessary to hold a velocity.
206 * In terms of the Motion Magic® Expo profile, a higher kV results in
207 * a slower maximum velocity.
208 * \param kA Mechanism kA for profiling. Unlike the kA slot gain, this is
209 * always in units of V/rps².
210 *
211 * This represents the amount of voltage necessary to achieve an
212 * acceleration. In terms of the Motion Magic® Expo profile, a higher
213 * kA results in a slower acceleration.
214 */
215 constexpr DynamicMotionMagicExpoDutyCycle(units::angle::turn_t Position, ctre::unit::volts_per_turn_per_second_t kV, ctre::unit::volts_per_turn_per_second_squared_t kA) : ControlRequest{},
216 Position{std::move(Position)},
217 kV{std::move(kV)},
218 kA{std::move(kA)}
219 {}
220
221 constexpr ~DynamicMotionMagicExpoDutyCycle() override {}
222
223 /**
224 * \brief Gets the name of this control request.
225 *
226 * \returns Name of the control request
227 */
228 constexpr std::string_view GetName() const override
229 {
230 return "DynamicMotionMagicExpoDutyCycle";
231 }
232
233 /**
234 * \brief Modifies this Control Request's Position parameter and returns itself for
235 * method-chaining and easier to use request API.
236 *
237 * Position to drive toward in rotations.
238 *
239 * - Units: rotations
240 *
241 *
242 * \param newPosition Parameter to modify
243 * \returns Itself
244 */
245 constexpr DynamicMotionMagicExpoDutyCycle &WithPosition(units::angle::turn_t newPosition)
246 {
247 Position = std::move(newPosition);
248 return *this;
249 }
250
251 /**
252 * \brief Modifies this Control Request's kV parameter and returns itself for
253 * method-chaining and easier to use request API.
254 *
255 * Mechanism kV for profiling. Unlike the kV slot gain, this is always in units
256 * of V/rps.
257 *
258 * This represents the amount of voltage necessary to hold a velocity. In terms
259 * of the Motion Magic® Expo profile, a higher kV results in a slower maximum
260 * velocity.
261 *
262 * - Units: V/rps
263 *
264 *
265 * \param newKV Parameter to modify
266 * \returns Itself
267 */
268 constexpr DynamicMotionMagicExpoDutyCycle &WithKV(ctre::unit::volts_per_turn_per_second_t newKV)
269 {
270 kV = std::move(newKV);
271 return *this;
272 }
273
274 /**
275 * \brief Modifies this Control Request's kA parameter and returns itself for
276 * method-chaining and easier to use request API.
277 *
278 * Mechanism kA for profiling. Unlike the kA slot gain, this is always in units
279 * of V/rps².
280 *
281 * This represents the amount of voltage necessary to achieve an acceleration.
282 * In terms of the Motion Magic® Expo profile, a higher kA results in a slower
283 * acceleration.
284 *
285 * - Units: V/rps²
286 *
287 *
288 * \param newKA Parameter to modify
289 * \returns Itself
290 */
291 constexpr DynamicMotionMagicExpoDutyCycle &WithKA(ctre::unit::volts_per_turn_per_second_squared_t newKA)
292 {
293 kA = std::move(newKA);
294 return *this;
295 }
296
297 /**
298 * \brief Modifies this Control Request's Velocity parameter and returns itself for
299 * method-chaining and easier to use request API.
300 *
301 * Cruise velocity for profiling. The signage does not matter as the device
302 * will use the absolute value for profile generation. Setting this to 0 will
303 * allow the profile to run to the max possible velocity based on Expo_kV.
304 *
305 * - Units: rotations per second
306 *
307 *
308 * \param newVelocity Parameter to modify
309 * \returns Itself
310 */
311 constexpr DynamicMotionMagicExpoDutyCycle &WithVelocity(units::angular_velocity::turns_per_second_t newVelocity)
312 {
313 Velocity = std::move(newVelocity);
314 return *this;
315 }
316
317 /**
318 * \brief Modifies this Control Request's EnableFOC parameter and returns itself for
319 * method-chaining and easier to use request API.
320 *
321 * Set to true to use FOC commutation (requires Phoenix Pro), which increases
322 * peak power by ~15% on supported devices (see hardware#traits#SupportsFOC).
323 * Set to false to use trapezoidal commutation.
324 *
325 * FOC improves motor performance by leveraging torque (current) control.
326 * However, this may be inconvenient for applications that require specifying
327 * duty cycle or voltage. CTR-Electronics has developed a hybrid method that
328 * combines the performances gains of FOC while still allowing applications to
329 * provide duty cycle or voltage demand. This not to be confused with simple
330 * sinusoidal control or phase voltage control which lacks the performance
331 * gains.
332 *
333 * \param newEnableFOC Parameter to modify
334 * \returns Itself
335 */
336 constexpr DynamicMotionMagicExpoDutyCycle &WithEnableFOC(bool newEnableFOC)
337 {
338 EnableFOC = std::move(newEnableFOC);
339 return *this;
340 }
341
342 /**
343 * \brief Modifies this Control Request's FeedForward parameter and returns itself for
344 * method-chaining and easier to use request API.
345 *
346 * Feedforward to apply in fractional units between -1 and +1. This is added to
347 * the output of the onboard feedforward terms.
348 *
349 * - Units: fractional
350 *
351 *
352 * \param newFeedForward Parameter to modify
353 * \returns Itself
354 */
355 constexpr DynamicMotionMagicExpoDutyCycle &WithFeedForward(units::dimensionless::scalar_t newFeedForward)
356 {
357 FeedForward = std::move(newFeedForward);
358 return *this;
359 }
360
361 /**
362 * \brief Modifies this Control Request's Slot parameter and returns itself for
363 * method-chaining and easier to use request API.
364 *
365 * Select which gains are applied by selecting the slot. Use the configuration
366 * api to set the gain values for the selected slot before enabling this
367 * feature. Slot must be within [0,2].
368 *
369 * \param newSlot Parameter to modify
370 * \returns Itself
371 */
373 {
374 Slot = std::move(newSlot);
375 return *this;
376 }
377
378 /**
379 * \brief Modifies this Control Request's OverrideBrakeDurNeutral parameter and returns itself for
380 * method-chaining and easier to use request API.
381 *
382 * Set to true to static-brake the rotor when output is zero (or within
383 * deadband). Set to false to use the NeutralMode configuration setting
384 * (default). This flag exists to provide the fundamental behavior of this
385 * control when output is zero, which is to provide 0V to the motor.
386 *
387 * \param newOverrideBrakeDurNeutral Parameter to modify
388 * \returns Itself
389 */
390 constexpr DynamicMotionMagicExpoDutyCycle &WithOverrideBrakeDurNeutral(bool newOverrideBrakeDurNeutral)
391 {
392 OverrideBrakeDurNeutral = std::move(newOverrideBrakeDurNeutral);
393 return *this;
394 }
395
396 /**
397 * \brief Modifies this Control Request's LimitForwardMotion parameter and returns itself for
398 * method-chaining and easier to use request API.
399 *
400 * Set to true to force forward limiting. This allows users to use other limit
401 * switch sensors connected to robot controller. This also allows use of active
402 * sensors that require external power.
403 *
404 * \param newLimitForwardMotion Parameter to modify
405 * \returns Itself
406 */
407 constexpr DynamicMotionMagicExpoDutyCycle &WithLimitForwardMotion(bool newLimitForwardMotion)
408 {
409 LimitForwardMotion = std::move(newLimitForwardMotion);
410 return *this;
411 }
412
413 /**
414 * \brief Modifies this Control Request's LimitReverseMotion parameter and returns itself for
415 * method-chaining and easier to use request API.
416 *
417 * Set to true to force reverse limiting. This allows users to use other limit
418 * switch sensors connected to robot controller. This also allows use of active
419 * sensors that require external power.
420 *
421 * \param newLimitReverseMotion Parameter to modify
422 * \returns Itself
423 */
424 constexpr DynamicMotionMagicExpoDutyCycle &WithLimitReverseMotion(bool newLimitReverseMotion)
425 {
426 LimitReverseMotion = std::move(newLimitReverseMotion);
427 return *this;
428 }
429
430 /**
431 * \brief Modifies this Control Request's IgnoreHardwareLimits parameter and returns itself for
432 * method-chaining and easier to use request API.
433 *
434 * Set to true to ignore hardware limit switches and the LimitForwardMotion and
435 * LimitReverseMotion parameters, instead allowing motion.
436 *
437 * This can be useful on mechanisms such as an intake/feeder, where a limit
438 * switch stops motion while intaking but should be ignored when feeding to a
439 * shooter.
440 *
441 * The hardware limit faults and Forward/ReverseLimit signals will still report
442 * the values of the limit switches regardless of this parameter.
443 *
444 * \param newIgnoreHardwareLimits Parameter to modify
445 * \returns Itself
446 */
447 constexpr DynamicMotionMagicExpoDutyCycle &WithIgnoreHardwareLimits(bool newIgnoreHardwareLimits)
448 {
449 IgnoreHardwareLimits = std::move(newIgnoreHardwareLimits);
450 return *this;
451 }
452
453 /**
454 * \brief Modifies this Control Request's IgnoreSoftwareLimits parameter and returns itself for
455 * method-chaining and easier to use request API.
456 *
457 * Set to true to ignore software limits, instead allowing motion.
458 *
459 * This can be useful when calibrating the zero point of a mechanism such as an
460 * elevator.
461 *
462 * The software limit faults will still report the values of the software limits
463 * regardless of this parameter.
464 *
465 * \param newIgnoreSoftwareLimits Parameter to modify
466 * \returns Itself
467 */
468 constexpr DynamicMotionMagicExpoDutyCycle &WithIgnoreSoftwareLimits(bool newIgnoreSoftwareLimits)
469 {
470 IgnoreSoftwareLimits = std::move(newIgnoreSoftwareLimits);
471 return *this;
472 }
473
474 /**
475 * \brief Modifies this Control Request's UseTimesync parameter and returns itself for
476 * method-chaining and easier to use request API.
477 *
478 * Set to true to delay applying this control request until a timesync boundary
479 * (requires Phoenix Pro and CANivore). This eliminates the impact of
480 * nondeterministic network delays in exchange for a larger but deterministic
481 * control latency.
482 *
483 * This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs.
484 * Additionally, when this is enabled, the UpdateFreqHz of this request should
485 * be set to 0 Hz.
486 *
487 * \param newUseTimesync Parameter to modify
488 * \returns Itself
489 */
490 constexpr DynamicMotionMagicExpoDutyCycle &WithUseTimesync(bool newUseTimesync)
491 {
492 UseTimesync = std::move(newUseTimesync);
493 return *this;
494 }
495
496 /**
497 * \brief Sets the frequency at which this control will update.
498 * This is designated in Hertz, with a minimum of 20 Hz
499 * (every 50 ms) and a maximum of 1000 Hz (every 1 ms).
500 * Some update frequencies are not supported and will be
501 * promoted up to the next highest supported frequency.
502 *
503 * If this field is set to 0 Hz, the control request will
504 * be sent immediately as a one-shot frame. This may be useful
505 * for advanced applications that require outputs to be
506 * synchronized with data acquisition. In this case, we
507 * recommend not exceeding 50 ms between control calls.
508 *
509 * \param newUpdateFreqHz Parameter to modify
510 * \returns Itself
511 */
512 constexpr DynamicMotionMagicExpoDutyCycle &WithUpdateFreqHz(units::frequency::hertz_t newUpdateFreqHz)
513 {
514 UpdateFreqHz = newUpdateFreqHz;
515 return *this;
516 }
517
518 /**
519 * \brief Returns a string representation of the object.
520 *
521 * \returns a string representation of the object.
522 */
523 std::string ToString() const override;
524
525 /**
526 * \brief Gets information about this control request.
527 *
528 * \returns Map of control parameter names and corresponding applied values
529 */
530 std::map<std::string, std::string> GetControlInfo() const override;
531};
532
533}
534}
535}
536
Common interface implemented by all control requests.
Definition ControlRequest.hpp:27
Requires Phoenix Pro and CANivore; Requests Motion Magic® Expo to target a final position using an ex...
Definition DynamicMotionMagicExpoDutyCycle.hpp:39
constexpr DynamicMotionMagicExpoDutyCycle & WithIgnoreHardwareLimits(bool newIgnoreHardwareLimits)
Modifies this Control Request's IgnoreHardwareLimits parameter and returns itself for method-chaining...
Definition DynamicMotionMagicExpoDutyCycle.hpp:447
constexpr DynamicMotionMagicExpoDutyCycle & WithPosition(units::angle::turn_t newPosition)
Modifies this Control Request's Position parameter and returns itself for method-chaining and easier ...
Definition DynamicMotionMagicExpoDutyCycle.hpp:245
int Slot
Select which gains are applied by selecting the slot.
Definition DynamicMotionMagicExpoDutyCycle.hpp:110
std::map< std::string, std::string > GetControlInfo() const override
Gets information about this control request.
units::frequency::hertz_t UpdateFreqHz
The frequency at which this control will update.
Definition DynamicMotionMagicExpoDutyCycle.hpp:178
constexpr DynamicMotionMagicExpoDutyCycle & WithUpdateFreqHz(units::frequency::hertz_t newUpdateFreqHz)
Sets the frequency at which this control will update.
Definition DynamicMotionMagicExpoDutyCycle.hpp:512
ctre::unit::volts_per_turn_per_second_t kV
Mechanism kV for profiling.
Definition DynamicMotionMagicExpoDutyCycle.hpp:61
constexpr DynamicMotionMagicExpoDutyCycle & WithKA(ctre::unit::volts_per_turn_per_second_squared_t newKA)
Modifies this Control Request's kA parameter and returns itself for method-chaining and easier to use...
Definition DynamicMotionMagicExpoDutyCycle.hpp:291
units::angular_velocity::turns_per_second_t Velocity
Cruise velocity for profiling.
Definition DynamicMotionMagicExpoDutyCycle.hpp:82
constexpr DynamicMotionMagicExpoDutyCycle & WithUseTimesync(bool newUseTimesync)
Modifies this Control Request's UseTimesync parameter and returns itself for method-chaining and easi...
Definition DynamicMotionMagicExpoDutyCycle.hpp:490
constexpr ~DynamicMotionMagicExpoDutyCycle() override
Definition DynamicMotionMagicExpoDutyCycle.hpp:221
units::angle::turn_t Position
Position to drive toward in rotations.
Definition DynamicMotionMagicExpoDutyCycle.hpp:49
bool IgnoreSoftwareLimits
Set to true to ignore software limits, instead allowing motion.
Definition DynamicMotionMagicExpoDutyCycle.hpp:152
constexpr DynamicMotionMagicExpoDutyCycle & WithOverrideBrakeDurNeutral(bool newOverrideBrakeDurNeutral)
Modifies this Control Request's OverrideBrakeDurNeutral parameter and returns itself for method-chain...
Definition DynamicMotionMagicExpoDutyCycle.hpp:390
constexpr DynamicMotionMagicExpoDutyCycle & WithIgnoreSoftwareLimits(bool newIgnoreSoftwareLimits)
Modifies this Control Request's IgnoreSoftwareLimits parameter and returns itself for method-chaining...
Definition DynamicMotionMagicExpoDutyCycle.hpp:468
units::dimensionless::scalar_t FeedForward
Feedforward to apply in fractional units between -1 and +1.
Definition DynamicMotionMagicExpoDutyCycle.hpp:104
constexpr DynamicMotionMagicExpoDutyCycle & WithSlot(int newSlot)
Modifies this Control Request's Slot parameter and returns itself for method-chaining and easier to u...
Definition DynamicMotionMagicExpoDutyCycle.hpp:372
bool IgnoreHardwareLimits
Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion param...
Definition DynamicMotionMagicExpoDutyCycle.hpp:142
constexpr DynamicMotionMagicExpoDutyCycle & WithFeedForward(units::dimensionless::scalar_t newFeedForward)
Modifies this Control Request's FeedForward parameter and returns itself for method-chaining and easi...
Definition DynamicMotionMagicExpoDutyCycle.hpp:355
ctre::unit::volts_per_turn_per_second_squared_t kA
Mechanism kA for profiling.
Definition DynamicMotionMagicExpoDutyCycle.hpp:73
constexpr DynamicMotionMagicExpoDutyCycle & WithLimitReverseMotion(bool newLimitReverseMotion)
Modifies this Control Request's LimitReverseMotion parameter and returns itself for method-chaining a...
Definition DynamicMotionMagicExpoDutyCycle.hpp:424
constexpr std::string_view GetName() const override
Gets the name of this control request.
Definition DynamicMotionMagicExpoDutyCycle.hpp:228
constexpr DynamicMotionMagicExpoDutyCycle(units::angle::turn_t Position, ctre::unit::volts_per_turn_per_second_t kV, ctre::unit::volts_per_turn_per_second_squared_t kA)
Requires Phoenix Pro and CANivore; Requests Motion Magic® Expo to target a final position using an ex...
Definition DynamicMotionMagicExpoDutyCycle.hpp:215
bool LimitForwardMotion
Set to true to force forward limiting.
Definition DynamicMotionMagicExpoDutyCycle.hpp:123
bool UseTimesync
Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro an...
Definition DynamicMotionMagicExpoDutyCycle.hpp:163
bool LimitReverseMotion
Set to true to force reverse limiting.
Definition DynamicMotionMagicExpoDutyCycle.hpp:129
constexpr DynamicMotionMagicExpoDutyCycle & WithVelocity(units::angular_velocity::turns_per_second_t newVelocity)
Modifies this Control Request's Velocity parameter and returns itself for method-chaining and easier ...
Definition DynamicMotionMagicExpoDutyCycle.hpp:311
constexpr DynamicMotionMagicExpoDutyCycle & WithLimitForwardMotion(bool newLimitForwardMotion)
Modifies this Control Request's LimitForwardMotion parameter and returns itself for method-chaining a...
Definition DynamicMotionMagicExpoDutyCycle.hpp:407
constexpr DynamicMotionMagicExpoDutyCycle & WithKV(ctre::unit::volts_per_turn_per_second_t newKV)
Modifies this Control Request's kV parameter and returns itself for method-chaining and easier to use...
Definition DynamicMotionMagicExpoDutyCycle.hpp:268
bool EnableFOC
Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supp...
Definition DynamicMotionMagicExpoDutyCycle.hpp:96
bool OverrideBrakeDurNeutral
Set to true to static-brake the rotor when output is zero (or within deadband).
Definition DynamicMotionMagicExpoDutyCycle.hpp:117
std::string ToString() const override
Returns a string representation of the object.
constexpr DynamicMotionMagicExpoDutyCycle & WithEnableFOC(bool newEnableFOC)
Modifies this Control Request's EnableFOC parameter and returns itself for method-chaining and easier...
Definition DynamicMotionMagicExpoDutyCycle.hpp:336
Status codes reported by APIs, including OK, warnings, and errors.
Definition StatusCodes.h:28
Definition motor_constants.h:14