CTRE Phoenix 6 C++ 25.0.0-beta-4
Loading...
Searching...
No Matches
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%. Set to false to use trapezoidal
318 * commutation.
319 *
320 * FOC improves motor performance by leveraging torque (current)
321 * control. However, this may be inconvenient for applications that
322 * require specifying duty cycle or voltage. CTR-Electronics has
323 * developed a hybrid method that combines the performances gains of
324 * FOC while still allowing applications to provide duty cycle or
325 * voltage demand. This not to be confused with simple sinusoidal
326 * control or phase voltage control which lacks the performance
327 * gains.
328 * - FeedForward: Feedforward to apply in torque current in Amperes. User can
329 * use motor's kT to scale Newton-meter to Amperes.
330 * - Slot: Select which gains are applied by selecting the slot. Use the
331 * configuration api to set the gain values for the selected slot before
332 * enabling this feature. Slot must be within [0,2].
333 * - OverrideCoastDurNeutral: Set to true to coast the rotor when output is zero
334 * (or within deadband). Set to false to use the
335 * NeutralMode configuration setting (default). This
336 * flag exists to provide the fundamental behavior of
337 * this control when output is zero, which is to
338 * provide 0A (zero torque).
339 * - LimitForwardMotion: Set to true to force forward limiting. This allows
340 * users to use other limit switch sensors connected to
341 * robot controller. This also allows use of active
342 * sensors that require external power.
343 * - LimitReverseMotion: Set to true to force reverse limiting. This allows
344 * users to use other limit switch sensors connected to
345 * robot controller. This also allows use of active
346 * sensors that require external power.
347 * - IgnoreHardwareLimits: Set to true to ignore hardware limit switches and the
348 * LimitForwardMotion and LimitReverseMotion parameters,
349 * instead allowing motion.
350 *
351 * This can be useful on mechanisms such as an
352 * intake/feeder, where a limit switch stops motion while
353 * intaking but should be ignored when feeding to a
354 * shooter.
355 *
356 * The hardware limit faults and Forward/ReverseLimit
357 * signals will still report the values of the limit
358 * switches regardless of this parameter.
359 * - UseTimesync: Set to true to delay applying this control request until a
360 * timesync boundary (requires Phoenix Pro and CANivore). This
361 * eliminates the impact of nondeterministic network delays in
362 * exchange for a larger but deterministic control latency.
363 *
364 * This requires setting the ControlTimesyncFreqHz config in
365 * MotorOutputConfigs. Additionally, when this is enabled, the
366 * UpdateFreqHz of this request should be set to 0 Hz.
367 *
368 * \param request Control object to request of the device
369 * \returns Status Code of the request, 0 is OK
370 */
372
373 /**
374 * \brief Requests Motion Magic® to target a final position using an
375 * exponential motion profile. Users can optionally provide a torque
376 * current feedforward.
377 *
378 * \details Motion Magic® Expo produces a motion profile in real-time
379 * while attempting to honor the Cruise Velocity (optional) and the
380 * mechanism kV and kA, specified via the Motion Magic® configuration
381 * values. Note that unlike the slot gains, the Expo_kV and Expo_kA
382 * configs are always in output units of Volts.
383 *
384 * Setting Cruise Velocity to 0 will allow the profile to run to the
385 * max possible velocity based on Expo_kV. This control mode does not
386 * use the Acceleration or Jerk configs.
387 *
388 * Target position can be changed on-the-fly and Motion Magic® will do
389 * its best to adjust the profile. This control mode is based on
390 * torque current, so relevant closed-loop gains will use Amperes for
391 * the numerator.
392 *
393 * - MotionMagicExpoTorqueCurrentFOC Parameters:
394 * - Position: Position to drive toward in rotations.
395 * - FeedForward: Feedforward to apply in torque current in Amperes. User can
396 * use motor's kT to scale Newton-meter to Amperes.
397 * - Slot: Select which gains are applied by selecting the slot. Use the
398 * configuration api to set the gain values for the selected slot before
399 * enabling this feature. Slot must be within [0,2].
400 * - OverrideCoastDurNeutral: Set to true to coast the rotor when output is zero
401 * (or within deadband). Set to false to use the
402 * NeutralMode configuration setting (default). This
403 * flag exists to provide the fundamental behavior of
404 * this control when output is zero, which is to
405 * provide 0A (zero torque).
406 * - LimitForwardMotion: Set to true to force forward limiting. This allows
407 * users to use other limit switch sensors connected to
408 * robot controller. This also allows use of active
409 * sensors that require external power.
410 * - LimitReverseMotion: Set to true to force reverse limiting. This allows
411 * users to use other limit switch sensors connected to
412 * robot controller. This also allows use of active
413 * sensors that require external power.
414 * - IgnoreHardwareLimits: Set to true to ignore hardware limit switches and the
415 * LimitForwardMotion and LimitReverseMotion parameters,
416 * instead allowing motion.
417 *
418 * This can be useful on mechanisms such as an
419 * intake/feeder, where a limit switch stops motion while
420 * intaking but should be ignored when feeding to a
421 * shooter.
422 *
423 * The hardware limit faults and Forward/ReverseLimit
424 * signals will still report the values of the limit
425 * switches regardless of this parameter.
426 * - UseTimesync: Set to true to delay applying this control request until a
427 * timesync boundary (requires Phoenix Pro and CANivore). This
428 * eliminates the impact of nondeterministic network delays in
429 * exchange for a larger but deterministic control latency.
430 *
431 * This requires setting the ControlTimesyncFreqHz config in
432 * MotorOutputConfigs. Additionally, when this is enabled, the
433 * UpdateFreqHz of this request should be set to 0 Hz.
434 *
435 * \param request Control object to request of the device
436 * \returns Status Code of the request, 0 is OK
437 */
439
440 /**
441 * \brief Requests Motion Magic® to target a final position using a
442 * motion profile. This dynamic request allows runtime changes to
443 * Cruise Velocity, Acceleration, and Jerk. Users can optionally
444 * provide a torque current feedforward. This control requires use of
445 * a CANivore.
446 *
447 * \details Motion Magic® produces a motion profile in real-time while
448 * attempting to honor the specified Cruise Velocity, Acceleration,
449 * and (optional) Jerk. This control mode does not use the Expo_kV or
450 * Expo_kA configs.
451 *
452 * Target position can be changed on-the-fly and Motion Magic® will do
453 * its best to adjust the profile. This control mode is based on
454 * torque current, so relevant closed-loop gains will use Amperes for
455 * the numerator.
456 *
457 * - DynamicMotionMagicTorqueCurrentFOC Parameters:
458 * - Position: Position to drive toward in rotations.
459 * - Velocity: Cruise velocity for profiling. The signage does not matter as the
460 * device will use the absolute value for profile generation.
461 * - Acceleration: Acceleration for profiling. The signage does not matter as
462 * the device will use the absolute value for profile generation.
463 * - Jerk: Jerk for profiling. The signage does not matter as the device will
464 * use the absolute value for profile generation.
465 *
466 * Jerk is optional; if this is set to zero, then Motion Magic® will not
467 * apply a Jerk limit.
468 * - FeedForward: Feedforward to apply in torque current in Amperes. User can
469 * use motor's kT to scale Newton-meter to Amperes.
470 * - Slot: Select which gains are applied by selecting the slot. Use the
471 * configuration api to set the gain values for the selected slot before
472 * enabling this feature. Slot must be within [0,2].
473 * - OverrideCoastDurNeutral: Set to true to coast the rotor when output is zero
474 * (or within deadband). Set to false to use the
475 * NeutralMode configuration setting (default). This
476 * flag exists to provide the fundamental behavior of
477 * this control when output is zero, which is to
478 * provide 0A (zero torque).
479 * - LimitForwardMotion: Set to true to force forward limiting. This allows
480 * users to use other limit switch sensors connected to
481 * robot controller. This also allows use of active
482 * sensors that require external power.
483 * - LimitReverseMotion: Set to true to force reverse limiting. This allows
484 * users to use other limit switch sensors connected to
485 * robot controller. This also allows use of active
486 * sensors that require external power.
487 * - IgnoreHardwareLimits: Set to true to ignore hardware limit switches and the
488 * LimitForwardMotion and LimitReverseMotion parameters,
489 * instead allowing motion.
490 *
491 * This can be useful on mechanisms such as an
492 * intake/feeder, where a limit switch stops motion while
493 * intaking but should be ignored when feeding to a
494 * shooter.
495 *
496 * The hardware limit faults and Forward/ReverseLimit
497 * signals will still report the values of the limit
498 * switches regardless of this parameter.
499 * - UseTimesync: Set to true to delay applying this control request until a
500 * timesync boundary (requires Phoenix Pro and CANivore). This
501 * eliminates the impact of nondeterministic network delays in
502 * exchange for a larger but deterministic control latency.
503 *
504 * This requires setting the ControlTimesyncFreqHz config in
505 * MotorOutputConfigs. Additionally, when this is enabled, the
506 * UpdateFreqHz of this request should be set to 0 Hz.
507 *
508 * \param request Control object to request of the device
509 * \returns Status Code of the request, 0 is OK
510 */
512
513 /**
514 * \brief Differential control with torque current average target and
515 * position difference target.
516 *
517 * - Diff_TorqueCurrentFOC_Position Parameters:
518 * - AverageRequest: Average TorqueCurrentFOC request of the mechanism.
519 * - DifferentialRequest: Differential PositionTorqueCurrentFOC request of the
520 * mechanism.
521 *
522 * \param request Control object to request of the device
523 * \returns Status Code of the request, 0 is OK
524 */
525 virtual ctre::phoenix::StatusCode SetControl(const controls::compound::Diff_TorqueCurrentFOC_Position &request) = 0;
526
527 /**
528 * \brief Differential control with position average target and
529 * position difference target using torque current control.
530 *
531 * - Diff_PositionTorqueCurrentFOC_Position Parameters:
532 * - AverageRequest: Average PositionTorqueCurrentFOC request of the mechanism.
533 * - DifferentialRequest: Differential PositionTorqueCurrentFOC request of the
534 * mechanism.
535 *
536 * \param request Control object to request of the device
537 * \returns Status Code of the request, 0 is OK
538 */
539 virtual ctre::phoenix::StatusCode SetControl(const controls::compound::Diff_PositionTorqueCurrentFOC_Position &request) = 0;
540
541 /**
542 * \brief Differential control with velocity average target and
543 * position difference target using torque current control.
544 *
545 * - Diff_VelocityTorqueCurrentFOC_Position Parameters:
546 * - AverageRequest: Average VelocityTorqueCurrentFOC request of the mechanism.
547 * - DifferentialRequest: Differential PositionTorqueCurrentFOC request of the
548 * mechanism.
549 *
550 * \param request Control object to request of the device
551 * \returns Status Code of the request, 0 is OK
552 */
553 virtual ctre::phoenix::StatusCode SetControl(const controls::compound::Diff_VelocityTorqueCurrentFOC_Position &request) = 0;
554
555 /**
556 * \brief Differential control with Motion Magic® average target and
557 * position difference target using torque current control.
558 *
559 * - Diff_MotionMagicTorqueCurrentFOC_Position Parameters:
560 * - AverageRequest: Average MotionMagicTorqueCurrentFOC request of the
561 * mechanism.
562 * - DifferentialRequest: Differential PositionTorqueCurrentFOC request of the
563 * mechanism.
564 *
565 * \param request Control object to request of the device
566 * \returns Status Code of the request, 0 is OK
567 */
568 virtual ctre::phoenix::StatusCode SetControl(const controls::compound::Diff_MotionMagicTorqueCurrentFOC_Position &request) = 0;
569
570 /**
571 * \brief Differential control with torque current average target and
572 * velocity difference target.
573 *
574 * - Diff_TorqueCurrentFOC_Velocity Parameters:
575 * - AverageRequest: Average TorqueCurrentFOC request of the mechanism.
576 * - DifferentialRequest: Differential VelocityTorqueCurrentFOC request of the
577 * mechanism.
578 *
579 * \param request Control object to request of the device
580 * \returns Status Code of the request, 0 is OK
581 */
582 virtual ctre::phoenix::StatusCode SetControl(const controls::compound::Diff_TorqueCurrentFOC_Velocity &request) = 0;
583
584 /**
585 * \brief Differential control with position average target and
586 * velocity difference target using torque current control.
587 *
588 * - Diff_PositionTorqueCurrentFOC_Velocity Parameters:
589 * - AverageRequest: Average PositionTorqueCurrentFOC request of the mechanism.
590 * - DifferentialRequest: Differential VelocityTorqueCurrentFOC request of the
591 * mechanism.
592 *
593 * \param request Control object to request of the device
594 * \returns Status Code of the request, 0 is OK
595 */
596 virtual ctre::phoenix::StatusCode SetControl(const controls::compound::Diff_PositionTorqueCurrentFOC_Velocity &request) = 0;
597
598 /**
599 * \brief Differential control with velocity average target and
600 * velocity difference target using torque current control.
601 *
602 * - Diff_VelocityTorqueCurrentFOC_Velocity Parameters:
603 * - AverageRequest: Average VelocityTorqueCurrentFOC request of the mechanism.
604 * - DifferentialRequest: Differential VelocityTorqueCurrentFOC request of the
605 * mechanism.
606 *
607 * \param request Control object to request of the device
608 * \returns Status Code of the request, 0 is OK
609 */
610 virtual ctre::phoenix::StatusCode SetControl(const controls::compound::Diff_VelocityTorqueCurrentFOC_Velocity &request) = 0;
611
612 /**
613 * \brief Differential control with Motion Magic® average target and
614 * velocity difference target using torque current control.
615 *
616 * - Diff_MotionMagicTorqueCurrentFOC_Velocity Parameters:
617 * - AverageRequest: Average MotionMagicTorqueCurrentFOC request of the
618 * mechanism.
619 * - DifferentialRequest: Differential VelocityTorqueCurrentFOC request of the
620 * mechanism.
621 *
622 * \param request Control object to request of the device
623 * \returns Status Code of the request, 0 is OK
624 */
625 virtual ctre::phoenix::StatusCode SetControl(const controls::compound::Diff_MotionMagicTorqueCurrentFOC_Velocity &request) = 0;
626
627 /**
628 * \brief Control device with generic control request object. User must make
629 * sure the specified object is castable to a valid control request,
630 * otherwise this function will fail at run-time and return the NotSupported
631 * StatusCode
632 *
633 * \param request Control object to request of the device
634 * \returns Status Code of the request, 0 is OK
635 */
637
638};
639
640}
641}
642}
643}
644
Abstract Control Request class that other control requests extend for use.
Definition ControlRequest.hpp:29
Requires Phoenix Pro and CANivore; Requests Motion Magic® to target a final position using a motion p...
Definition DynamicMotionMagicTorqueCurrentFOC.hpp:41
Requires Phoenix Pro; Requests Motion Magic® to target a final position using an exponential motion p...
Definition MotionMagicExpoTorqueCurrentFOC.hpp:39
Requires Phoenix Pro; Requests Motion Magic® to target a final position using a motion profile.
Definition MotionMagicTorqueCurrentFOC.hpp:36
Requests Motion Magic® to target a final velocity using a motion profile.
Definition MotionMagicVelocityTorqueCurrentFOC.hpp:43
Requires Phoenix Pro; Request PID to target position with torque current feedforward.
Definition PositionTorqueCurrentFOC.hpp:32
Requires Phoenix Pro; Request a specified motor current (field oriented control).
Definition TorqueCurrentFOC.hpp:32
Requires Phoenix Pro; Request PID to target velocity with torque current feedforward.
Definition VelocityTorqueCurrentFOC.hpp:32
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 StatusCodes.h:18