Loading [MathJax]/extensions/tex2jax.js
CTRE Phoenix 6 C++ 25.4.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SupportsFOC.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
27
28
29namespace ctre {
30namespace phoenix6 {
31namespace hardware {
32namespace traits {
33
34/**
35 * Requires Phoenix Pro; Contains all FOC-exclusive control functions available
36 * for devices that support FOC.
37 */
39{
40public:
41 virtual ~SupportsFOC() = default;
42
43
44 /**
45 * \brief Request a specified motor current (field oriented control).
46 *
47 * \details This control request will drive the motor to the requested
48 * motor (stator) current value. This leverages field oriented
49 * control (FOC), which means greater peak power than what is
50 * documented. This scales to torque based on Motor's kT constant.
51 *
52 * - TorqueCurrentFOC Parameters:
53 * - Output: Amount of motor current in Amperes
54 * - MaxAbsDutyCycle: The maximum absolute motor output that can be applied,
55 * which effectively limits the velocity. For example, 0.50
56 * means no more than 50% output in either direction. This is
57 * useful for preventing the motor from spinning to its
58 * terminal velocity when there is no external torque applied
59 * unto the rotor. Note this is absolute maximum, so the
60 * value should be between zero and one.
61 * - Deadband: Deadband in Amperes. If torque request is within deadband, the
62 * bridge output is neutral. If deadband is set to zero then there is
63 * effectively no deadband. Note if deadband is zero, a free spinning
64 * motor will spin for quite a while as the firmware attempts to hold
65 * the motor's bemf. If user expects motor to cease spinning quickly
66 * with a demand of zero, we recommend a deadband of one Ampere. This
67 * value will be converted to an integral value of amps.
68 * - OverrideCoastDurNeutral: Set to true to coast the rotor when output is zero
69 * (or within deadband). Set to false to use the
70 * NeutralMode configuration setting (default). This
71 * flag exists to provide the fundamental behavior of
72 * this control when output is zero, which is to
73 * provide 0A (zero torque).
74 * - LimitForwardMotion: Set to true to force forward limiting. This allows
75 * users to use other limit switch sensors connected to
76 * robot controller. This also allows use of active
77 * sensors that require external power.
78 * - LimitReverseMotion: Set to true to force reverse limiting. This allows
79 * users to use other limit switch sensors connected to
80 * robot controller. This also allows use of active
81 * sensors that require external power.
82 * - IgnoreHardwareLimits: Set to true to ignore hardware limit switches and the
83 * LimitForwardMotion and LimitReverseMotion parameters,
84 * instead allowing motion.
85 *
86 * This can be useful on mechanisms such as an
87 * intake/feeder, where a limit switch stops motion while
88 * intaking but should be ignored when feeding to a
89 * shooter.
90 *
91 * The hardware limit faults and Forward/ReverseLimit
92 * signals will still report the values of the limit
93 * switches regardless of this parameter.
94 * - UseTimesync: Set to true to delay applying this control request until a
95 * timesync boundary (requires Phoenix Pro and CANivore). This
96 * eliminates the impact of nondeterministic network delays in
97 * exchange for a larger but deterministic control latency.
98 *
99 * This requires setting the ControlTimesyncFreqHz config in
100 * MotorOutputConfigs. Additionally, when this is enabled, the
101 * UpdateFreqHz of this request should be set to 0 Hz.
102 *
103 * \param request Control object to request of the device
104 * \returns Status Code of the request, 0 is OK
105 */
107
108 /**
109 * \brief Request PID to target position with torque current
110 * feedforward.
111 *
112 * \details This control mode will set the motor's position setpoint
113 * to the position specified by the user. In addition, it will apply
114 * an additional torque current as an arbitrary feedforward value.
115 *
116 * - PositionTorqueCurrentFOC Parameters:
117 * - Position: Position to drive toward in rotations.
118 * - Velocity: Velocity to drive toward in rotations per second. This is
119 * typically used for motion profiles generated by the robot program.
120 * - FeedForward: Feedforward to apply in torque current in Amperes. User can
121 * use motor's kT to scale Newton-meter to Amperes.
122 * - Slot: Select which gains are applied by selecting the slot. Use the
123 * configuration api to set the gain values for the selected slot before
124 * enabling this feature. Slot must be within [0,2].
125 * - OverrideCoastDurNeutral: Set to true to coast the rotor when output is zero
126 * (or within deadband). Set to false to use the
127 * NeutralMode configuration setting (default). This
128 * flag exists to provide the fundamental behavior of
129 * this control when output is zero, which is to
130 * provide 0A (zero torque).
131 * - LimitForwardMotion: Set to true to force forward limiting. This allows
132 * users to use other limit switch sensors connected to
133 * robot controller. This also allows use of active
134 * sensors that require external power.
135 * - LimitReverseMotion: Set to true to force reverse limiting. This allows
136 * users to use other limit switch sensors connected to
137 * robot controller. This also allows use of active
138 * sensors that require external power.
139 * - IgnoreHardwareLimits: Set to true to ignore hardware limit switches and the
140 * LimitForwardMotion and LimitReverseMotion parameters,
141 * instead allowing motion.
142 *
143 * This can be useful on mechanisms such as an
144 * intake/feeder, where a limit switch stops motion while
145 * intaking but should be ignored when feeding to a
146 * shooter.
147 *
148 * The hardware limit faults and Forward/ReverseLimit
149 * signals will still report the values of the limit
150 * switches regardless of this parameter.
151 * - UseTimesync: Set to true to delay applying this control request until a
152 * timesync boundary (requires Phoenix Pro and CANivore). This
153 * eliminates the impact of nondeterministic network delays in
154 * exchange for a larger but deterministic control latency.
155 *
156 * This requires setting the ControlTimesyncFreqHz config in
157 * MotorOutputConfigs. Additionally, when this is enabled, the
158 * UpdateFreqHz of this request should be set to 0 Hz.
159 *
160 * \param request Control object to request of the device
161 * \returns Status Code of the request, 0 is OK
162 */
164
165 /**
166 * \brief Request PID to target velocity with torque current
167 * feedforward.
168 *
169 * \details This control mode will set the motor's velocity setpoint
170 * to the velocity specified by the user. In addition, it will apply
171 * an additional torque current as an arbitrary feedforward value.
172 *
173 * - VelocityTorqueCurrentFOC Parameters:
174 * - Velocity: Velocity to drive toward in rotations per second.
175 * - Acceleration: Acceleration to drive toward in rotations per second squared.
176 * This is typically used for motion profiles generated by the
177 * robot program.
178 * - FeedForward: Feedforward to apply in torque current in Amperes. User can
179 * use motor's kT to scale Newton-meter to Amperes.
180 * - Slot: Select which gains are applied by selecting the slot. Use the
181 * configuration api to set the gain values for the selected slot before
182 * enabling this feature. Slot must be within [0,2].
183 * - OverrideCoastDurNeutral: Set to true to coast the rotor when output is zero
184 * (or within deadband). Set to false to use the
185 * NeutralMode configuration setting (default). This
186 * flag exists to provide the fundamental behavior of
187 * this control when output is zero, which is to
188 * provide 0A (zero torque).
189 * - LimitForwardMotion: Set to true to force forward limiting. This allows
190 * users to use other limit switch sensors connected to
191 * robot controller. This also allows use of active
192 * sensors that require external power.
193 * - LimitReverseMotion: Set to true to force reverse limiting. This allows
194 * users to use other limit switch sensors connected to
195 * robot controller. This also allows use of active
196 * sensors that require external power.
197 * - IgnoreHardwareLimits: Set to true to ignore hardware limit switches and the
198 * LimitForwardMotion and LimitReverseMotion parameters,
199 * instead allowing motion.
200 *
201 * This can be useful on mechanisms such as an
202 * intake/feeder, where a limit switch stops motion while
203 * intaking but should be ignored when feeding to a
204 * shooter.
205 *
206 * The hardware limit faults and Forward/ReverseLimit
207 * signals will still report the values of the limit
208 * switches regardless of this parameter.
209 * - UseTimesync: Set to true to delay applying this control request until a
210 * timesync boundary (requires Phoenix Pro and CANivore). This
211 * eliminates the impact of nondeterministic network delays in
212 * exchange for a larger but deterministic control latency.
213 *
214 * This requires setting the ControlTimesyncFreqHz config in
215 * MotorOutputConfigs. Additionally, when this is enabled, the
216 * UpdateFreqHz of this request should be set to 0 Hz.
217 *
218 * \param request Control object to request of the device
219 * \returns Status Code of the request, 0 is OK
220 */
222
223 /**
224 * \brief Requests Motion Magic® to target a final position using a
225 * motion profile. Users can optionally provide a torque current
226 * feedforward.
227 *
228 * \details Motion Magic® produces a motion profile in real-time while
229 * attempting to honor the Cruise Velocity, Acceleration, and
230 * (optional) Jerk specified via the Motion Magic® configuration
231 * values. This control mode does not use the Expo_kV or Expo_kA
232 * configs.
233 *
234 * Target position can be changed on-the-fly and Motion Magic® will do
235 * its best to adjust the profile. This control mode is based on
236 * torque current, so relevant closed-loop gains will use Amperes for
237 * the numerator.
238 *
239 * - MotionMagicTorqueCurrentFOC Parameters:
240 * - Position: Position to drive toward in rotations.
241 * - FeedForward: Feedforward to apply in torque current in Amperes. User can
242 * use motor's kT to scale Newton-meter to Amperes.
243 * - Slot: Select which gains are applied by selecting the slot. Use the
244 * configuration api to set the gain values for the selected slot before
245 * enabling this feature. Slot must be within [0,2].
246 * - OverrideCoastDurNeutral: Set to true to coast the rotor when output is zero
247 * (or within deadband). Set to false to use the
248 * NeutralMode configuration setting (default). This
249 * flag exists to provide the fundamental behavior of
250 * this control when output is zero, which is to
251 * provide 0A (zero torque).
252 * - LimitForwardMotion: Set to true to force forward limiting. This allows
253 * users to use other limit switch sensors connected to
254 * robot controller. This also allows use of active
255 * sensors that require external power.
256 * - LimitReverseMotion: Set to true to force reverse limiting. This allows
257 * users to use other limit switch sensors connected to
258 * robot controller. This also allows use of active
259 * sensors that require external power.
260 * - IgnoreHardwareLimits: Set to true to ignore hardware limit switches and the
261 * LimitForwardMotion and LimitReverseMotion parameters,
262 * instead allowing motion.
263 *
264 * This can be useful on mechanisms such as an
265 * intake/feeder, where a limit switch stops motion while
266 * intaking but should be ignored when feeding to a
267 * shooter.
268 *
269 * The hardware limit faults and Forward/ReverseLimit
270 * signals will still report the values of the limit
271 * switches regardless of this parameter.
272 * - UseTimesync: Set to true to delay applying this control request until a
273 * timesync boundary (requires Phoenix Pro and CANivore). This
274 * eliminates the impact of nondeterministic network delays in
275 * exchange for a larger but deterministic control latency.
276 *
277 * This requires setting the ControlTimesyncFreqHz config in
278 * MotorOutputConfigs. Additionally, when this is enabled, the
279 * UpdateFreqHz of this request should be set to 0 Hz.
280 *
281 * \param request Control object to request of the device
282 * \returns Status Code of the request, 0 is OK
283 */
285
286 /**
287 * \brief Requests Motion Magic® to target a final velocity using a
288 * motion profile. This allows smooth transitions between velocity
289 * set points. Users can optionally provide a torque feedforward.
290 *
291 * \details Motion Magic® Velocity produces a motion profile in
292 * real-time while attempting to honor the specified Acceleration and
293 * (optional) Jerk. This control mode does not use the
294 * CruiseVelocity, Expo_kV, or Expo_kA configs.
295 *
296 * If the specified acceleration is zero, the Acceleration under
297 * Motion Magic® configuration parameter is used instead. This allows
298 * for runtime adjustment of acceleration for advanced users. Jerk is
299 * also specified in the Motion Magic® persistent configuration
300 * values. If Jerk is set to zero, Motion Magic® will produce a
301 * trapezoidal acceleration profile.
302 *
303 * Target velocity can also be changed on-the-fly and Motion Magic®
304 * will do its best to adjust the profile. This control mode is based
305 * on torque current, so relevant closed-loop gains will use Amperes
306 * for the numerator.
307 *
308 * - MotionMagicVelocityTorqueCurrentFOC Parameters:
309 * - Velocity: Target velocity to drive toward in rotations per second. This can
310 * be changed on-the fly.
311 * - Acceleration: This is the absolute Acceleration to use generating the
312 * profile. If this parameter is zero, the Acceleration
313 * persistent configuration parameter is used instead.
314 * Acceleration is in rotations per second squared. If nonzero,
315 * the signage does not matter as the absolute value is used.
316 * - EnableFOC: Set to true to use FOC commutation (requires Phoenix Pro), which
317 * increases peak power by ~15% on supported devices (see
318 * hardware#traits#SupportsFOC). Set to false to use trapezoidal
319 * commutation.
320 *
321 * FOC improves motor performance by leveraging torque (current)
322 * control. However, this may be inconvenient for applications that
323 * require specifying duty cycle or voltage. CTR-Electronics has
324 * developed a hybrid method that combines the performances gains of
325 * FOC while still allowing applications to provide duty cycle or
326 * voltage demand. This not to be confused with simple sinusoidal
327 * control or phase voltage control which lacks the performance
328 * gains.
329 * - FeedForward: Feedforward to apply in torque current in Amperes. User can
330 * use motor's kT to scale Newton-meter to Amperes.
331 * - Slot: Select which gains are applied by selecting the slot. Use the
332 * configuration api to set the gain values for the selected slot before
333 * enabling this feature. Slot must be within [0,2].
334 * - OverrideCoastDurNeutral: Set to true to coast the rotor when output is zero
335 * (or within deadband). Set to false to use the
336 * NeutralMode configuration setting (default). This
337 * flag exists to provide the fundamental behavior of
338 * this control when output is zero, which is to
339 * provide 0A (zero torque).
340 * - LimitForwardMotion: Set to true to force forward limiting. This allows
341 * users to use other limit switch sensors connected to
342 * robot controller. This also allows use of active
343 * sensors that require external power.
344 * - LimitReverseMotion: Set to true to force reverse limiting. This allows
345 * users to use other limit switch sensors connected to
346 * robot controller. This also allows use of active
347 * sensors that require external power.
348 * - IgnoreHardwareLimits: Set to true to ignore hardware limit switches and the
349 * LimitForwardMotion and LimitReverseMotion parameters,
350 * instead allowing motion.
351 *
352 * This can be useful on mechanisms such as an
353 * intake/feeder, where a limit switch stops motion while
354 * intaking but should be ignored when feeding to a
355 * shooter.
356 *
357 * The hardware limit faults and Forward/ReverseLimit
358 * signals will still report the values of the limit
359 * switches regardless of this parameter.
360 * - UseTimesync: Set to true to delay applying this control request until a
361 * timesync boundary (requires Phoenix Pro and CANivore). This
362 * eliminates the impact of nondeterministic network delays in
363 * exchange for a larger but deterministic control latency.
364 *
365 * This requires setting the ControlTimesyncFreqHz config in
366 * MotorOutputConfigs. Additionally, when this is enabled, the
367 * UpdateFreqHz of this request should be set to 0 Hz.
368 *
369 * \param request Control object to request of the device
370 * \returns Status Code of the request, 0 is OK
371 */
373
374 /**
375 * \brief Requests Motion Magic® to target a final position using an
376 * exponential motion profile. Users can optionally provide a torque
377 * current feedforward.
378 *
379 * \details Motion Magic® Expo produces a motion profile in real-time
380 * while attempting to honor the Cruise Velocity (optional) and the
381 * mechanism kV and kA, specified via the Motion Magic® configuration
382 * values. Note that unlike the slot gains, the Expo_kV and Expo_kA
383 * configs are always in output units of Volts.
384 *
385 * Setting Cruise Velocity to 0 will allow the profile to run to the
386 * max possible velocity based on Expo_kV. This control mode does not
387 * use the Acceleration or Jerk configs.
388 *
389 * Target position can be changed on-the-fly and Motion Magic® will do
390 * its best to adjust the profile. This control mode is based on
391 * torque current, so relevant closed-loop gains will use Amperes for
392 * the numerator.
393 *
394 * - MotionMagicExpoTorqueCurrentFOC Parameters:
395 * - Position: Position to drive toward in rotations.
396 * - FeedForward: Feedforward to apply in torque current in Amperes. User can
397 * use motor's kT to scale Newton-meter to Amperes.
398 * - Slot: Select which gains are applied by selecting the slot. Use the
399 * configuration api to set the gain values for the selected slot before
400 * enabling this feature. Slot must be within [0,2].
401 * - OverrideCoastDurNeutral: Set to true to coast the rotor when output is zero
402 * (or within deadband). Set to false to use the
403 * NeutralMode configuration setting (default). This
404 * flag exists to provide the fundamental behavior of
405 * this control when output is zero, which is to
406 * provide 0A (zero torque).
407 * - LimitForwardMotion: Set to true to force forward limiting. This allows
408 * users to use other limit switch sensors connected to
409 * robot controller. This also allows use of active
410 * sensors that require external power.
411 * - LimitReverseMotion: Set to true to force reverse limiting. This allows
412 * users to use other limit switch sensors connected to
413 * robot controller. This also allows use of active
414 * sensors that require external power.
415 * - IgnoreHardwareLimits: Set to true to ignore hardware limit switches and the
416 * LimitForwardMotion and LimitReverseMotion parameters,
417 * instead allowing motion.
418 *
419 * This can be useful on mechanisms such as an
420 * intake/feeder, where a limit switch stops motion while
421 * intaking but should be ignored when feeding to a
422 * shooter.
423 *
424 * The hardware limit faults and Forward/ReverseLimit
425 * signals will still report the values of the limit
426 * switches regardless of this parameter.
427 * - UseTimesync: Set to true to delay applying this control request until a
428 * timesync boundary (requires Phoenix Pro and CANivore). This
429 * eliminates the impact of nondeterministic network delays in
430 * exchange for a larger but deterministic control latency.
431 *
432 * This requires setting the ControlTimesyncFreqHz config in
433 * MotorOutputConfigs. Additionally, when this is enabled, the
434 * UpdateFreqHz of this request should be set to 0 Hz.
435 *
436 * \param request Control object to request of the device
437 * \returns Status Code of the request, 0 is OK
438 */
440
441 /**
442 * \brief Requests Motion Magic® to target a final position using a
443 * motion profile. This dynamic request allows runtime changes to
444 * Cruise Velocity, Acceleration, and Jerk. Users can optionally
445 * provide a torque current feedforward. This control requires use of
446 * a CANivore.
447 *
448 * \details Motion Magic® produces a motion profile in real-time while
449 * attempting to honor the specified Cruise Velocity, Acceleration,
450 * and (optional) Jerk. This control mode does not use the Expo_kV or
451 * Expo_kA configs.
452 *
453 * Target position can be changed on-the-fly and Motion Magic® will do
454 * its best to adjust the profile. This control mode is based on
455 * torque current, so relevant closed-loop gains will use Amperes for
456 * the numerator.
457 *
458 * - DynamicMotionMagicTorqueCurrentFOC Parameters:
459 * - Position: Position to drive toward in rotations.
460 * - Velocity: Cruise velocity for profiling. The signage does not matter as the
461 * device will use the absolute value for profile generation.
462 * - Acceleration: Acceleration for profiling. The signage does not matter as
463 * the device will use the absolute value for profile generation.
464 * - Jerk: Jerk for profiling. The signage does not matter as the device will
465 * use the absolute value for profile generation.
466 *
467 * Jerk is optional; if this is set to zero, then Motion Magic® will not
468 * apply a Jerk limit.
469 * - FeedForward: Feedforward to apply in torque current in Amperes. User can
470 * use motor's kT to scale Newton-meter to Amperes.
471 * - Slot: Select which gains are applied by selecting the slot. Use the
472 * configuration api to set the gain values for the selected slot before
473 * enabling this feature. Slot must be within [0,2].
474 * - OverrideCoastDurNeutral: Set to true to coast the rotor when output is zero
475 * (or within deadband). Set to false to use the
476 * NeutralMode configuration setting (default). This
477 * flag exists to provide the fundamental behavior of
478 * this control when output is zero, which is to
479 * provide 0A (zero torque).
480 * - LimitForwardMotion: Set to true to force forward limiting. This allows
481 * users to use other limit switch sensors connected to
482 * robot controller. This also allows use of active
483 * sensors that require external power.
484 * - LimitReverseMotion: Set to true to force reverse limiting. This allows
485 * users to use other limit switch sensors connected to
486 * robot controller. This also allows use of active
487 * sensors that require external power.
488 * - IgnoreHardwareLimits: Set to true to ignore hardware limit switches and the
489 * LimitForwardMotion and LimitReverseMotion parameters,
490 * instead allowing motion.
491 *
492 * This can be useful on mechanisms such as an
493 * intake/feeder, where a limit switch stops motion while
494 * intaking but should be ignored when feeding to a
495 * shooter.
496 *
497 * The hardware limit faults and Forward/ReverseLimit
498 * signals will still report the values of the limit
499 * switches regardless of this parameter.
500 * - UseTimesync: Set to true to delay applying this control request until a
501 * timesync boundary (requires Phoenix Pro and CANivore). This
502 * eliminates the impact of nondeterministic network delays in
503 * exchange for a larger but deterministic control latency.
504 *
505 * This requires setting the ControlTimesyncFreqHz config in
506 * MotorOutputConfigs. Additionally, when this is enabled, the
507 * UpdateFreqHz of this request should be set to 0 Hz.
508 *
509 * \param request Control object to request of the device
510 * \returns Status Code of the request, 0 is OK
511 */
513
514 /**
515 * \brief Differential control with torque current average target and
516 * position difference target.
517 *
518 * - Diff_TorqueCurrentFOC_Position Parameters:
519 * - AverageRequest: Average TorqueCurrentFOC request of the mechanism.
520 * - DifferentialRequest: Differential PositionTorqueCurrentFOC request of the
521 * mechanism.
522 *
523 * \param request Control object to request of the device
524 * \returns Status Code of the request, 0 is OK
525 */
526 virtual ctre::phoenix::StatusCode SetControl(const controls::compound::Diff_TorqueCurrentFOC_Position &request) = 0;
527
528 /**
529 * \brief Differential control with position average target and
530 * position difference target using torque current control.
531 *
532 * - Diff_PositionTorqueCurrentFOC_Position Parameters:
533 * - AverageRequest: Average PositionTorqueCurrentFOC request of the mechanism.
534 * - DifferentialRequest: Differential PositionTorqueCurrentFOC request of the
535 * mechanism.
536 *
537 * \param request Control object to request of the device
538 * \returns Status Code of the request, 0 is OK
539 */
540 virtual ctre::phoenix::StatusCode SetControl(const controls::compound::Diff_PositionTorqueCurrentFOC_Position &request) = 0;
541
542 /**
543 * \brief Differential control with velocity average target and
544 * position difference target using torque current control.
545 *
546 * - Diff_VelocityTorqueCurrentFOC_Position Parameters:
547 * - AverageRequest: Average VelocityTorqueCurrentFOC request of the mechanism.
548 * - DifferentialRequest: Differential PositionTorqueCurrentFOC request of the
549 * mechanism.
550 *
551 * \param request Control object to request of the device
552 * \returns Status Code of the request, 0 is OK
553 */
554 virtual ctre::phoenix::StatusCode SetControl(const controls::compound::Diff_VelocityTorqueCurrentFOC_Position &request) = 0;
555
556 /**
557 * \brief Differential control with Motion Magic® average target and
558 * position difference target using torque current control.
559 *
560 * - Diff_MotionMagicTorqueCurrentFOC_Position Parameters:
561 * - AverageRequest: Average MotionMagicTorqueCurrentFOC request of the
562 * mechanism.
563 * - DifferentialRequest: Differential PositionTorqueCurrentFOC request of the
564 * mechanism.
565 *
566 * \param request Control object to request of the device
567 * \returns Status Code of the request, 0 is OK
568 */
569 virtual ctre::phoenix::StatusCode SetControl(const controls::compound::Diff_MotionMagicTorqueCurrentFOC_Position &request) = 0;
570
571 /**
572 * \brief Differential control with torque current average target and
573 * velocity difference target.
574 *
575 * - Diff_TorqueCurrentFOC_Velocity Parameters:
576 * - AverageRequest: Average TorqueCurrentFOC request of the mechanism.
577 * - DifferentialRequest: Differential VelocityTorqueCurrentFOC request of the
578 * mechanism.
579 *
580 * \param request Control object to request of the device
581 * \returns Status Code of the request, 0 is OK
582 */
583 virtual ctre::phoenix::StatusCode SetControl(const controls::compound::Diff_TorqueCurrentFOC_Velocity &request) = 0;
584
585 /**
586 * \brief Differential control with position average target and
587 * velocity difference target using torque current control.
588 *
589 * - Diff_PositionTorqueCurrentFOC_Velocity Parameters:
590 * - AverageRequest: Average PositionTorqueCurrentFOC request of the mechanism.
591 * - DifferentialRequest: Differential VelocityTorqueCurrentFOC request of the
592 * mechanism.
593 *
594 * \param request Control object to request of the device
595 * \returns Status Code of the request, 0 is OK
596 */
597 virtual ctre::phoenix::StatusCode SetControl(const controls::compound::Diff_PositionTorqueCurrentFOC_Velocity &request) = 0;
598
599 /**
600 * \brief Differential control with velocity average target and
601 * velocity difference target using torque current control.
602 *
603 * - Diff_VelocityTorqueCurrentFOC_Velocity Parameters:
604 * - AverageRequest: Average VelocityTorqueCurrentFOC request of the mechanism.
605 * - DifferentialRequest: Differential VelocityTorqueCurrentFOC request of the
606 * mechanism.
607 *
608 * \param request Control object to request of the device
609 * \returns Status Code of the request, 0 is OK
610 */
611 virtual ctre::phoenix::StatusCode SetControl(const controls::compound::Diff_VelocityTorqueCurrentFOC_Velocity &request) = 0;
612
613 /**
614 * \brief Differential control with Motion Magic® average target and
615 * velocity difference target using torque current control.
616 *
617 * - Diff_MotionMagicTorqueCurrentFOC_Velocity Parameters:
618 * - AverageRequest: Average MotionMagicTorqueCurrentFOC request of the
619 * mechanism.
620 * - DifferentialRequest: Differential VelocityTorqueCurrentFOC request of the
621 * mechanism.
622 *
623 * \param request Control object to request of the device
624 * \returns Status Code of the request, 0 is OK
625 */
626 virtual ctre::phoenix::StatusCode SetControl(const controls::compound::Diff_MotionMagicTorqueCurrentFOC_Velocity &request) = 0;
627
628 /**
629 * \brief Control device with generic control request object. User must make
630 * sure the specified object is castable to a valid control request,
631 * otherwise this function will fail at run-time and return the NotSupported
632 * StatusCode
633 *
634 * \param request Control object to request of the device
635 * \returns Status Code of the request, 0 is OK
636 */
638
639};
640
641}
642}
643}
644}
645
Abstract Control Request class that other control requests extend for use.
Definition ControlRequest.hpp:30
Requires Phoenix Pro and CANivore; Requests Motion Magic® to target a final position using a motion p...
Definition DynamicMotionMagicTorqueCurrentFOC.hpp:40
Requires Phoenix Pro; Requests Motion Magic® to target a final position using an exponential motion p...
Definition MotionMagicExpoTorqueCurrentFOC.hpp:38
Requires Phoenix Pro; Requests Motion Magic® to target a final position using a motion profile.
Definition MotionMagicTorqueCurrentFOC.hpp:35
Requests Motion Magic® to target a final velocity using a motion profile.
Definition MotionMagicVelocityTorqueCurrentFOC.hpp:42
Requires Phoenix Pro; Request PID to target position with torque current feedforward.
Definition PositionTorqueCurrentFOC.hpp:31
Requires Phoenix Pro; Request a specified motor current (field oriented control).
Definition TorqueCurrentFOC.hpp:31
Requires Phoenix Pro; Request PID to target velocity with torque current feedforward.
Definition VelocityTorqueCurrentFOC.hpp:31
Requires Phoenix Pro; Contains all FOC-exclusive control functions available for devices that support...
Definition SupportsFOC.hpp:39
virtual ctre::phoenix::StatusCode SetControl(const controls::MotionMagicTorqueCurrentFOC &request)=0
Requests Motion Magic® to target a final position using a motion profile.
virtual ctre::phoenix::StatusCode SetControl(const controls::ControlRequest &request)=0
Control device with generic control request object.
virtual ctre::phoenix::StatusCode SetControl(const controls::VelocityTorqueCurrentFOC &request)=0
Request PID to target velocity with torque current feedforward.
virtual ctre::phoenix::StatusCode SetControl(const controls::compound::Diff_VelocityTorqueCurrentFOC_Velocity &request)=0
Differential control with velocity average target and velocity difference target using torque current...
virtual ctre::phoenix::StatusCode SetControl(const controls::DynamicMotionMagicTorqueCurrentFOC &request)=0
Requests Motion Magic® to target a final position using a motion profile.
virtual ctre::phoenix::StatusCode SetControl(const controls::compound::Diff_VelocityTorqueCurrentFOC_Position &request)=0
Differential control with velocity average target and position difference target using torque current...
virtual ctre::phoenix::StatusCode SetControl(const controls::compound::Diff_TorqueCurrentFOC_Velocity &request)=0
Differential control with torque current average target and velocity difference target.
virtual ctre::phoenix::StatusCode SetControl(const controls::compound::Diff_MotionMagicTorqueCurrentFOC_Position &request)=0
Differential control with Motion Magic® average target and position difference target using torque cu...
virtual ctre::phoenix::StatusCode SetControl(const controls::compound::Diff_PositionTorqueCurrentFOC_Velocity &request)=0
Differential control with position average target and velocity difference target using torque current...
virtual ctre::phoenix::StatusCode SetControl(const controls::compound::Diff_TorqueCurrentFOC_Position &request)=0
Differential control with torque current average target and position difference target.
virtual ctre::phoenix::StatusCode SetControl(const controls::MotionMagicVelocityTorqueCurrentFOC &request)=0
Requests Motion Magic® to target a final velocity using a motion profile.
virtual ctre::phoenix::StatusCode SetControl(const controls::compound::Diff_MotionMagicTorqueCurrentFOC_Velocity &request)=0
Differential control with Motion Magic® average target and velocity difference target using torque cu...
virtual ctre::phoenix::StatusCode SetControl(const controls::compound::Diff_PositionTorqueCurrentFOC_Position &request)=0
Differential control with position average target and position difference target using torque current...
virtual ctre::phoenix::StatusCode SetControl(const controls::PositionTorqueCurrentFOC &request)=0
Request PID to target position with torque current feedforward.
virtual ctre::phoenix::StatusCode SetControl(const controls::MotionMagicExpoTorqueCurrentFOC &request)=0
Requests Motion Magic® to target a final position using an exponential motion profile.
virtual ctre::phoenix::StatusCode SetControl(const controls::TorqueCurrentFOC &request)=0
Request a specified motor current (field oriented control).
Status codes reported by APIs, including OK, warnings, and errors.
Definition StatusCodes.h:27
Definition Diff_PositionDutyCycle_Position.hpp:15