001/* 002 * Copyright (C) Cross The Road Electronics. All rights reserved. 003 * License information can be found in CTRE_LICENSE.txt 004 * For support and suggestions contact support@ctr-electronics.com or file 005 * an issue tracker at https://github.com/CrossTheRoadElec/Phoenix-Releases 006 */ 007package com.ctre.phoenix6.hardware.traits; 008 009import com.ctre.phoenix6.StatusCode; 010import com.ctre.phoenix6.controls.*; 011import com.ctre.phoenix6.controls.compound.*; 012 013/** 014 * Requires Phoenix Pro; Contains all FOC-exclusive control functions available 015 * for devices that support FOC. 016 */ 017public interface SupportsFOC 018{ 019 020 021 /** 022 * Request a specified motor current (field oriented control). 023 * <p> 024 * This control request will drive the motor to the requested motor 025 * (stator) current value. This leverages field oriented control 026 * (FOC), which means greater peak power than what is documented. 027 * This scales to torque based on Motor's kT constant. 028 * <ul> 029 * <li> <b>TorqueCurrentFOC Parameters:</b> 030 * <ul> 031 * <li> <b>Output:</b> Amount of motor current in Amperes 032 * <li> <b>MaxAbsDutyCycle:</b> The maximum absolute motor output that can be 033 * applied, which effectively limits the velocity. 034 * For example, 0.50 means no more than 50% output 035 * in either direction. This is useful for 036 * preventing the motor from spinning to its 037 * terminal velocity when there is no external 038 * torque applied unto the rotor. Note this is 039 * absolute maximum, so the value should be 040 * between zero and one. 041 * <li> <b>Deadband:</b> Deadband in Amperes. If torque request is within 042 * deadband, the bridge output is neutral. If deadband is 043 * set to zero then there is effectively no deadband. 044 * Note if deadband is zero, a free spinning motor will 045 * spin for quite a while as the firmware attempts to 046 * hold the motor's bemf. If user expects motor to cease 047 * spinning quickly with a demand of zero, we recommend a 048 * deadband of one Ampere. This value will be converted 049 * to an integral value of amps. 050 * <li> <b>OverrideCoastDurNeutral:</b> Set to true to coast the rotor when 051 * output is zero (or within deadband). 052 * Set to false to use the NeutralMode 053 * configuration setting (default). This 054 * flag exists to provide the fundamental 055 * behavior of this control when output is 056 * zero, which is to provide 0A (zero 057 * torque). 058 * <li> <b>LimitForwardMotion:</b> Set to true to force forward limiting. This 059 * allows users to use other limit switch 060 * sensors connected to robot controller. This 061 * also allows use of active sensors that 062 * require external power. 063 * <li> <b>LimitReverseMotion:</b> Set to true to force reverse limiting. This 064 * allows users to use other limit switch 065 * sensors connected to robot controller. This 066 * also allows use of active sensors that 067 * require external power. 068 * <li> <b>IgnoreHardwareLimits:</b> Set to true to ignore hardware limit 069 * switches and the LimitForwardMotion and 070 * LimitReverseMotion parameters, instead 071 * allowing motion. 072 * <p> 073 * This can be useful on mechanisms such as 074 * an intake/feeder, where a limit switch 075 * stops motion while intaking but should be 076 * ignored when feeding to a shooter. 077 * <p> 078 * The hardware limit faults and 079 * Forward/ReverseLimit signals will still 080 * report the values of the limit switches 081 * regardless of this parameter. 082 * <li> <b>UseTimesync:</b> Set to true to delay applying this control request 083 * until a timesync boundary (requires Phoenix Pro and 084 * CANivore). This eliminates the impact of 085 * nondeterministic network delays in exchange for a 086 * larger but deterministic control latency. 087 * <p> 088 * This requires setting the ControlTimesyncFreqHz 089 * config in MotorOutputConfigs. Additionally, when 090 * this is enabled, the UpdateFreqHz of this request 091 * should be set to 0 Hz. 092 * </ul> 093 * </ul> 094 * 095 * @param request Control object to request of the device 096 * @return Code response of the request 097 */ 098 StatusCode setControl(TorqueCurrentFOC request); 099 100 /** 101 * Request PID to target position with torque current feedforward. 102 * <p> 103 * This control mode will set the motor's position setpoint to the 104 * position specified by the user. In addition, it will apply an 105 * additional torque current as an arbitrary feedforward value. 106 * <ul> 107 * <li> <b>PositionTorqueCurrentFOC Parameters:</b> 108 * <ul> 109 * <li> <b>Position:</b> Position to drive toward in rotations. 110 * <li> <b>Velocity:</b> Velocity to drive toward in rotations per second. This 111 * is typically used for motion profiles generated by the 112 * robot program. 113 * <li> <b>FeedForward:</b> Feedforward to apply in torque current in Amperes. 114 * User can use motor's kT to scale Newton-meter to 115 * Amperes. 116 * <li> <b>Slot:</b> Select which gains are applied by selecting the slot. Use 117 * the configuration api to set the gain values for the 118 * selected slot before enabling this feature. Slot must be 119 * within [0,2]. 120 * <li> <b>OverrideCoastDurNeutral:</b> Set to true to coast the rotor when 121 * output is zero (or within deadband). 122 * Set to false to use the NeutralMode 123 * configuration setting (default). This 124 * flag exists to provide the fundamental 125 * behavior of this control when output is 126 * zero, which is to provide 0A (zero 127 * torque). 128 * <li> <b>LimitForwardMotion:</b> Set to true to force forward limiting. This 129 * allows users to use other limit switch 130 * sensors connected to robot controller. This 131 * also allows use of active sensors that 132 * require external power. 133 * <li> <b>LimitReverseMotion:</b> Set to true to force reverse limiting. This 134 * allows users to use other limit switch 135 * sensors connected to robot controller. This 136 * also allows use of active sensors that 137 * require external power. 138 * <li> <b>IgnoreHardwareLimits:</b> Set to true to ignore hardware limit 139 * switches and the LimitForwardMotion and 140 * LimitReverseMotion parameters, instead 141 * allowing motion. 142 * <p> 143 * This can be useful on mechanisms such as 144 * an intake/feeder, where a limit switch 145 * stops motion while intaking but should be 146 * ignored when feeding to a shooter. 147 * <p> 148 * The hardware limit faults and 149 * Forward/ReverseLimit signals will still 150 * report the values of the limit switches 151 * regardless of this parameter. 152 * <li> <b>UseTimesync:</b> Set to true to delay applying this control request 153 * until a timesync boundary (requires Phoenix Pro and 154 * CANivore). This eliminates the impact of 155 * nondeterministic network delays in exchange for a 156 * larger but deterministic control latency. 157 * <p> 158 * This requires setting the ControlTimesyncFreqHz 159 * config in MotorOutputConfigs. Additionally, when 160 * this is enabled, the UpdateFreqHz of this request 161 * should be set to 0 Hz. 162 * </ul> 163 * </ul> 164 * 165 * @param request Control object to request of the device 166 * @return Code response of the request 167 */ 168 StatusCode setControl(PositionTorqueCurrentFOC request); 169 170 /** 171 * Request PID to target velocity with torque current feedforward. 172 * <p> 173 * This control mode will set the motor's velocity setpoint to the 174 * velocity specified by the user. In addition, it will apply an 175 * additional torque current as an arbitrary feedforward value. 176 * <ul> 177 * <li> <b>VelocityTorqueCurrentFOC Parameters:</b> 178 * <ul> 179 * <li> <b>Velocity:</b> Velocity to drive toward in rotations per second. 180 * <li> <b>Acceleration:</b> Acceleration to drive toward in rotations per 181 * second squared. This is typically used for motion 182 * profiles generated by the robot program. 183 * <li> <b>FeedForward:</b> Feedforward to apply in torque current in Amperes. 184 * User can use motor's kT to scale Newton-meter to 185 * Amperes. 186 * <li> <b>Slot:</b> Select which gains are applied by selecting the slot. Use 187 * the configuration api to set the gain values for the 188 * selected slot before enabling this feature. Slot must be 189 * within [0,2]. 190 * <li> <b>OverrideCoastDurNeutral:</b> Set to true to coast the rotor when 191 * output is zero (or within deadband). 192 * Set to false to use the NeutralMode 193 * configuration setting (default). This 194 * flag exists to provide the fundamental 195 * behavior of this control when output is 196 * zero, which is to provide 0A (zero 197 * torque). 198 * <li> <b>LimitForwardMotion:</b> Set to true to force forward limiting. This 199 * allows users to use other limit switch 200 * sensors connected to robot controller. This 201 * also allows use of active sensors that 202 * require external power. 203 * <li> <b>LimitReverseMotion:</b> Set to true to force reverse limiting. This 204 * allows users to use other limit switch 205 * sensors connected to robot controller. This 206 * also allows use of active sensors that 207 * require external power. 208 * <li> <b>IgnoreHardwareLimits:</b> Set to true to ignore hardware limit 209 * switches and the LimitForwardMotion and 210 * LimitReverseMotion parameters, instead 211 * allowing motion. 212 * <p> 213 * This can be useful on mechanisms such as 214 * an intake/feeder, where a limit switch 215 * stops motion while intaking but should be 216 * ignored when feeding to a shooter. 217 * <p> 218 * The hardware limit faults and 219 * Forward/ReverseLimit signals will still 220 * report the values of the limit switches 221 * regardless of this parameter. 222 * <li> <b>UseTimesync:</b> Set to true to delay applying this control request 223 * until a timesync boundary (requires Phoenix Pro and 224 * CANivore). This eliminates the impact of 225 * nondeterministic network delays in exchange for a 226 * larger but deterministic control latency. 227 * <p> 228 * This requires setting the ControlTimesyncFreqHz 229 * config in MotorOutputConfigs. Additionally, when 230 * this is enabled, the UpdateFreqHz of this request 231 * should be set to 0 Hz. 232 * </ul> 233 * </ul> 234 * 235 * @param request Control object to request of the device 236 * @return Code response of the request 237 */ 238 StatusCode setControl(VelocityTorqueCurrentFOC request); 239 240 /** 241 * Requests Motion Magic® to target a final position using a motion 242 * profile. Users can optionally provide a torque current 243 * feedforward. 244 * <p> 245 * Motion Magic® produces a motion profile in real-time while 246 * attempting to honor the Cruise Velocity, Acceleration, and 247 * (optional) Jerk specified via the Motion Magic® configuration 248 * values. This control mode does not use the Expo_kV or Expo_kA 249 * configs. 250 * <p> 251 * Target position can be changed on-the-fly and Motion Magic® will do 252 * its best to adjust the profile. This control mode is based on 253 * torque current, so relevant closed-loop gains will use Amperes for 254 * the numerator. 255 * <ul> 256 * <li> <b>MotionMagicTorqueCurrentFOC Parameters:</b> 257 * <ul> 258 * <li> <b>Position:</b> Position to drive toward in rotations. 259 * <li> <b>FeedForward:</b> Feedforward to apply in torque current in Amperes. 260 * User can use motor's kT to scale Newton-meter to 261 * Amperes. 262 * <li> <b>Slot:</b> Select which gains are applied by selecting the slot. Use 263 * the configuration api to set the gain values for the 264 * selected slot before enabling this feature. Slot must be 265 * within [0,2]. 266 * <li> <b>OverrideCoastDurNeutral:</b> Set to true to coast the rotor when 267 * output is zero (or within deadband). 268 * Set to false to use the NeutralMode 269 * configuration setting (default). This 270 * flag exists to provide the fundamental 271 * behavior of this control when output is 272 * zero, which is to provide 0A (zero 273 * torque). 274 * <li> <b>LimitForwardMotion:</b> Set to true to force forward limiting. This 275 * allows users to use other limit switch 276 * sensors connected to robot controller. This 277 * also allows use of active sensors that 278 * require external power. 279 * <li> <b>LimitReverseMotion:</b> Set to true to force reverse limiting. This 280 * allows users to use other limit switch 281 * sensors connected to robot controller. This 282 * also allows use of active sensors that 283 * require external power. 284 * <li> <b>IgnoreHardwareLimits:</b> Set to true to ignore hardware limit 285 * switches and the LimitForwardMotion and 286 * LimitReverseMotion parameters, instead 287 * allowing motion. 288 * <p> 289 * This can be useful on mechanisms such as 290 * an intake/feeder, where a limit switch 291 * stops motion while intaking but should be 292 * ignored when feeding to a shooter. 293 * <p> 294 * The hardware limit faults and 295 * Forward/ReverseLimit signals will still 296 * report the values of the limit switches 297 * regardless of this parameter. 298 * <li> <b>UseTimesync:</b> Set to true to delay applying this control request 299 * until a timesync boundary (requires Phoenix Pro and 300 * CANivore). This eliminates the impact of 301 * nondeterministic network delays in exchange for a 302 * larger but deterministic control latency. 303 * <p> 304 * This requires setting the ControlTimesyncFreqHz 305 * config in MotorOutputConfigs. Additionally, when 306 * this is enabled, the UpdateFreqHz of this request 307 * should be set to 0 Hz. 308 * </ul> 309 * </ul> 310 * 311 * @param request Control object to request of the device 312 * @return Code response of the request 313 */ 314 StatusCode setControl(MotionMagicTorqueCurrentFOC request); 315 316 /** 317 * Requests Motion Magic® to target a final velocity using a motion 318 * profile. This allows smooth transitions between velocity set 319 * points. Users can optionally provide a torque feedforward. 320 * <p> 321 * Motion Magic® Velocity produces a motion profile in real-time while 322 * attempting to honor the specified Acceleration and (optional) Jerk. 323 * This control mode does not use the CruiseVelocity, Expo_kV, or 324 * Expo_kA configs. 325 * <p> 326 * If the specified acceleration is zero, the Acceleration under 327 * Motion Magic® configuration parameter is used instead. This allows 328 * for runtime adjustment of acceleration for advanced users. Jerk is 329 * also specified in the Motion Magic® persistent configuration 330 * values. If Jerk is set to zero, Motion Magic® will produce a 331 * trapezoidal acceleration profile. 332 * <p> 333 * Target velocity can also be changed on-the-fly and Motion Magic® 334 * will do its best to adjust the profile. This control mode is based 335 * on torque current, so relevant closed-loop gains will use Amperes 336 * for the numerator. 337 * <ul> 338 * <li> <b>MotionMagicVelocityTorqueCurrentFOC Parameters:</b> 339 * <ul> 340 * <li> <b>Velocity:</b> Target velocity to drive toward in rotations per 341 * second. This can be changed on-the fly. 342 * <li> <b>Acceleration:</b> This is the absolute Acceleration to use 343 * generating the profile. If this parameter is 344 * zero, the Acceleration persistent configuration 345 * parameter is used instead. Acceleration is in 346 * rotations per second squared. If nonzero, the 347 * signage does not matter as the absolute value is 348 * used. 349 * <li> <b>EnableFOC:</b> Set to true to use FOC commutation (requires Phoenix 350 * Pro), which increases peak power by ~15%. Set to 351 * false to use trapezoidal commutation. 352 * <p> 353 * FOC improves motor performance by leveraging torque 354 * (current) control. However, this may be inconvenient 355 * for applications that require specifying duty cycle 356 * or voltage. CTR-Electronics has developed a hybrid 357 * method that combines the performances gains of FOC 358 * while still allowing applications to provide duty 359 * cycle or voltage demand. This not to be confused 360 * with simple sinusoidal control or phase voltage 361 * control which lacks the performance gains. 362 * <li> <b>FeedForward:</b> Feedforward to apply in torque current in Amperes. 363 * User can use motor's kT to scale Newton-meter to 364 * Amperes. 365 * <li> <b>Slot:</b> Select which gains are applied by selecting the slot. Use 366 * the configuration api to set the gain values for the 367 * selected slot before enabling this feature. Slot must be 368 * within [0,2]. 369 * <li> <b>OverrideCoastDurNeutral:</b> Set to true to coast the rotor when 370 * output is zero (or within deadband). 371 * Set to false to use the NeutralMode 372 * configuration setting (default). This 373 * flag exists to provide the fundamental 374 * behavior of this control when output is 375 * zero, which is to provide 0A (zero 376 * torque). 377 * <li> <b>LimitForwardMotion:</b> Set to true to force forward limiting. This 378 * allows users to use other limit switch 379 * sensors connected to robot controller. This 380 * also allows use of active sensors that 381 * require external power. 382 * <li> <b>LimitReverseMotion:</b> Set to true to force reverse limiting. This 383 * allows users to use other limit switch 384 * sensors connected to robot controller. This 385 * also allows use of active sensors that 386 * require external power. 387 * <li> <b>IgnoreHardwareLimits:</b> Set to true to ignore hardware limit 388 * switches and the LimitForwardMotion and 389 * LimitReverseMotion parameters, instead 390 * allowing motion. 391 * <p> 392 * This can be useful on mechanisms such as 393 * an intake/feeder, where a limit switch 394 * stops motion while intaking but should be 395 * ignored when feeding to a shooter. 396 * <p> 397 * The hardware limit faults and 398 * Forward/ReverseLimit signals will still 399 * report the values of the limit switches 400 * regardless of this parameter. 401 * <li> <b>UseTimesync:</b> Set to true to delay applying this control request 402 * until a timesync boundary (requires Phoenix Pro and 403 * CANivore). This eliminates the impact of 404 * nondeterministic network delays in exchange for a 405 * larger but deterministic control latency. 406 * <p> 407 * This requires setting the ControlTimesyncFreqHz 408 * config in MotorOutputConfigs. Additionally, when 409 * this is enabled, the UpdateFreqHz of this request 410 * should be set to 0 Hz. 411 * </ul> 412 * </ul> 413 * 414 * @param request Control object to request of the device 415 * @return Code response of the request 416 */ 417 StatusCode setControl(MotionMagicVelocityTorqueCurrentFOC request); 418 419 /** 420 * Requests Motion Magic® to target a final position using an 421 * exponential motion profile. Users can optionally provide a torque 422 * current feedforward. 423 * <p> 424 * Motion Magic® Expo produces a motion profile in real-time while 425 * attempting to honor the Cruise Velocity (optional) and the 426 * mechanism kV and kA, specified via the Motion Magic® configuration 427 * values. Note that unlike the slot gains, the Expo_kV and Expo_kA 428 * configs are always in output units of Volts. 429 * <p> 430 * Setting Cruise Velocity to 0 will allow the profile to run to the 431 * max possible velocity based on Expo_kV. This control mode does not 432 * use the Acceleration or Jerk configs. 433 * <p> 434 * Target position can be changed on-the-fly and Motion Magic® will do 435 * its best to adjust the profile. This control mode is based on 436 * torque current, so relevant closed-loop gains will use Amperes for 437 * the numerator. 438 * <ul> 439 * <li> <b>MotionMagicExpoTorqueCurrentFOC Parameters:</b> 440 * <ul> 441 * <li> <b>Position:</b> Position to drive toward in rotations. 442 * <li> <b>FeedForward:</b> Feedforward to apply in torque current in Amperes. 443 * User can use motor's kT to scale Newton-meter to 444 * Amperes. 445 * <li> <b>Slot:</b> Select which gains are applied by selecting the slot. Use 446 * the configuration api to set the gain values for the 447 * selected slot before enabling this feature. Slot must be 448 * within [0,2]. 449 * <li> <b>OverrideCoastDurNeutral:</b> Set to true to coast the rotor when 450 * output is zero (or within deadband). 451 * Set to false to use the NeutralMode 452 * configuration setting (default). This 453 * flag exists to provide the fundamental 454 * behavior of this control when output is 455 * zero, which is to provide 0A (zero 456 * torque). 457 * <li> <b>LimitForwardMotion:</b> Set to true to force forward limiting. This 458 * allows users to use other limit switch 459 * sensors connected to robot controller. This 460 * also allows use of active sensors that 461 * require external power. 462 * <li> <b>LimitReverseMotion:</b> Set to true to force reverse limiting. This 463 * allows users to use other limit switch 464 * sensors connected to robot controller. This 465 * also allows use of active sensors that 466 * require external power. 467 * <li> <b>IgnoreHardwareLimits:</b> Set to true to ignore hardware limit 468 * switches and the LimitForwardMotion and 469 * LimitReverseMotion parameters, instead 470 * allowing motion. 471 * <p> 472 * This can be useful on mechanisms such as 473 * an intake/feeder, where a limit switch 474 * stops motion while intaking but should be 475 * ignored when feeding to a shooter. 476 * <p> 477 * The hardware limit faults and 478 * Forward/ReverseLimit signals will still 479 * report the values of the limit switches 480 * regardless of this parameter. 481 * <li> <b>UseTimesync:</b> Set to true to delay applying this control request 482 * until a timesync boundary (requires Phoenix Pro and 483 * CANivore). This eliminates the impact of 484 * nondeterministic network delays in exchange for a 485 * larger but deterministic control latency. 486 * <p> 487 * This requires setting the ControlTimesyncFreqHz 488 * config in MotorOutputConfigs. Additionally, when 489 * this is enabled, the UpdateFreqHz of this request 490 * should be set to 0 Hz. 491 * </ul> 492 * </ul> 493 * 494 * @param request Control object to request of the device 495 * @return Code response of the request 496 */ 497 StatusCode setControl(MotionMagicExpoTorqueCurrentFOC request); 498 499 /** 500 * Requests Motion Magic® to target a final position using a motion 501 * profile. This dynamic request allows runtime changes to Cruise 502 * Velocity, Acceleration, and Jerk. Users can optionally provide a 503 * torque current feedforward. This control requires use of a 504 * CANivore. 505 * <p> 506 * Motion Magic® produces a motion profile in real-time while 507 * attempting to honor the specified Cruise Velocity, Acceleration, 508 * and (optional) Jerk. This control mode does not use the Expo_kV or 509 * Expo_kA configs. 510 * <p> 511 * Target position can be changed on-the-fly and Motion Magic® will do 512 * its best to adjust the profile. This control mode is based on 513 * torque current, so relevant closed-loop gains will use Amperes for 514 * the numerator. 515 * <ul> 516 * <li> <b>DynamicMotionMagicTorqueCurrentFOC Parameters:</b> 517 * <ul> 518 * <li> <b>Position:</b> Position to drive toward in rotations. 519 * <li> <b>Velocity:</b> Cruise velocity for profiling. The signage does not 520 * matter as the device will use the absolute value for 521 * profile generation. 522 * <li> <b>Acceleration:</b> Acceleration for profiling. The signage does not 523 * matter as the device will use the absolute value 524 * for profile generation. 525 * <li> <b>Jerk:</b> Jerk for profiling. The signage does not matter as the 526 * device will use the absolute value for profile generation. 527 * <p> 528 * Jerk is optional; if this is set to zero, then Motion 529 * Magic® will not apply a Jerk limit. 530 * <li> <b>FeedForward:</b> Feedforward to apply in torque current in Amperes. 531 * User can use motor's kT to scale Newton-meter to 532 * Amperes. 533 * <li> <b>Slot:</b> Select which gains are applied by selecting the slot. Use 534 * the configuration api to set the gain values for the 535 * selected slot before enabling this feature. Slot must be 536 * within [0,2]. 537 * <li> <b>OverrideCoastDurNeutral:</b> Set to true to coast the rotor when 538 * output is zero (or within deadband). 539 * Set to false to use the NeutralMode 540 * configuration setting (default). This 541 * flag exists to provide the fundamental 542 * behavior of this control when output is 543 * zero, which is to provide 0A (zero 544 * torque). 545 * <li> <b>LimitForwardMotion:</b> Set to true to force forward limiting. This 546 * allows users to use other limit switch 547 * sensors connected to robot controller. This 548 * also allows use of active sensors that 549 * require external power. 550 * <li> <b>LimitReverseMotion:</b> Set to true to force reverse limiting. This 551 * allows users to use other limit switch 552 * sensors connected to robot controller. This 553 * also allows use of active sensors that 554 * require external power. 555 * <li> <b>IgnoreHardwareLimits:</b> Set to true to ignore hardware limit 556 * switches and the LimitForwardMotion and 557 * LimitReverseMotion parameters, instead 558 * allowing motion. 559 * <p> 560 * This can be useful on mechanisms such as 561 * an intake/feeder, where a limit switch 562 * stops motion while intaking but should be 563 * ignored when feeding to a shooter. 564 * <p> 565 * The hardware limit faults and 566 * Forward/ReverseLimit signals will still 567 * report the values of the limit switches 568 * regardless of this parameter. 569 * <li> <b>UseTimesync:</b> Set to true to delay applying this control request 570 * until a timesync boundary (requires Phoenix Pro and 571 * CANivore). This eliminates the impact of 572 * nondeterministic network delays in exchange for a 573 * larger but deterministic control latency. 574 * <p> 575 * This requires setting the ControlTimesyncFreqHz 576 * config in MotorOutputConfigs. Additionally, when 577 * this is enabled, the UpdateFreqHz of this request 578 * should be set to 0 Hz. 579 * </ul> 580 * </ul> 581 * 582 * @param request Control object to request of the device 583 * @return Code response of the request 584 */ 585 StatusCode setControl(DynamicMotionMagicTorqueCurrentFOC request); 586 587 /** 588 * Differential control with torque current average target and 589 * position difference target. 590 * 591 * <ul> 592 * <li> <b>Diff_TorqueCurrentFOC_Position Parameters:</b> 593 * <ul> 594 * <li> <b>AverageRequest:</b> Average TorqueCurrentFOC request of the 595 * mechanism. 596 * <li> <b>DifferentialRequest:</b> Differential PositionTorqueCurrentFOC 597 * request of the mechanism. 598 * </ul> 599 * </ul> 600 * 601 * @param request Control object to request of the device 602 * @return Code response of the request 603 */ 604 StatusCode setControl(Diff_TorqueCurrentFOC_Position request); 605 606 /** 607 * Differential control with position average target and position 608 * difference target using torque current control. 609 * 610 * <ul> 611 * <li> <b>Diff_PositionTorqueCurrentFOC_Position Parameters:</b> 612 * <ul> 613 * <li> <b>AverageRequest:</b> Average PositionTorqueCurrentFOC request of the 614 * mechanism. 615 * <li> <b>DifferentialRequest:</b> Differential PositionTorqueCurrentFOC 616 * request of the mechanism. 617 * </ul> 618 * </ul> 619 * 620 * @param request Control object to request of the device 621 * @return Code response of the request 622 */ 623 StatusCode setControl(Diff_PositionTorqueCurrentFOC_Position request); 624 625 /** 626 * Differential control with velocity average target and position 627 * difference target using torque current control. 628 * 629 * <ul> 630 * <li> <b>Diff_VelocityTorqueCurrentFOC_Position Parameters:</b> 631 * <ul> 632 * <li> <b>AverageRequest:</b> Average VelocityTorqueCurrentFOC request of the 633 * mechanism. 634 * <li> <b>DifferentialRequest:</b> Differential PositionTorqueCurrentFOC 635 * request of the mechanism. 636 * </ul> 637 * </ul> 638 * 639 * @param request Control object to request of the device 640 * @return Code response of the request 641 */ 642 StatusCode setControl(Diff_VelocityTorqueCurrentFOC_Position request); 643 644 /** 645 * Differential control with Motion Magic® average target and position 646 * difference target using torque current control. 647 * 648 * <ul> 649 * <li> <b>Diff_MotionMagicTorqueCurrentFOC_Position Parameters:</b> 650 * <ul> 651 * <li> <b>AverageRequest:</b> Average MotionMagicTorqueCurrentFOC request of 652 * the mechanism. 653 * <li> <b>DifferentialRequest:</b> Differential PositionTorqueCurrentFOC 654 * request of the mechanism. 655 * </ul> 656 * </ul> 657 * 658 * @param request Control object to request of the device 659 * @return Code response of the request 660 */ 661 StatusCode setControl(Diff_MotionMagicTorqueCurrentFOC_Position request); 662 663 /** 664 * Differential control with torque current average target and 665 * velocity difference target. 666 * 667 * <ul> 668 * <li> <b>Diff_TorqueCurrentFOC_Velocity Parameters:</b> 669 * <ul> 670 * <li> <b>AverageRequest:</b> Average TorqueCurrentFOC request of the 671 * mechanism. 672 * <li> <b>DifferentialRequest:</b> Differential VelocityTorqueCurrentFOC 673 * request of the mechanism. 674 * </ul> 675 * </ul> 676 * 677 * @param request Control object to request of the device 678 * @return Code response of the request 679 */ 680 StatusCode setControl(Diff_TorqueCurrentFOC_Velocity request); 681 682 /** 683 * Differential control with position average target and velocity 684 * difference target using torque current control. 685 * 686 * <ul> 687 * <li> <b>Diff_PositionTorqueCurrentFOC_Velocity Parameters:</b> 688 * <ul> 689 * <li> <b>AverageRequest:</b> Average PositionTorqueCurrentFOC request of the 690 * mechanism. 691 * <li> <b>DifferentialRequest:</b> Differential VelocityTorqueCurrentFOC 692 * request of the mechanism. 693 * </ul> 694 * </ul> 695 * 696 * @param request Control object to request of the device 697 * @return Code response of the request 698 */ 699 StatusCode setControl(Diff_PositionTorqueCurrentFOC_Velocity request); 700 701 /** 702 * Differential control with velocity average target and velocity 703 * difference target using torque current control. 704 * 705 * <ul> 706 * <li> <b>Diff_VelocityTorqueCurrentFOC_Velocity Parameters:</b> 707 * <ul> 708 * <li> <b>AverageRequest:</b> Average VelocityTorqueCurrentFOC request of the 709 * mechanism. 710 * <li> <b>DifferentialRequest:</b> Differential VelocityTorqueCurrentFOC 711 * request of the mechanism. 712 * </ul> 713 * </ul> 714 * 715 * @param request Control object to request of the device 716 * @return Code response of the request 717 */ 718 StatusCode setControl(Diff_VelocityTorqueCurrentFOC_Velocity request); 719 720 /** 721 * Differential control with Motion Magic® average target and velocity 722 * difference target using torque current control. 723 * 724 * <ul> 725 * <li> <b>Diff_MotionMagicTorqueCurrentFOC_Velocity Parameters:</b> 726 * <ul> 727 * <li> <b>AverageRequest:</b> Average MotionMagicTorqueCurrentFOC request of 728 * the mechanism. 729 * <li> <b>DifferentialRequest:</b> Differential VelocityTorqueCurrentFOC 730 * request of the mechanism. 731 * </ul> 732 * </ul> 733 * 734 * @param request Control object to request of the device 735 * @return Code response of the request 736 */ 737 StatusCode setControl(Diff_MotionMagicTorqueCurrentFOC_Velocity request); 738 739 /** 740 * Control device with generic control request object. 741 * <p> 742 * User must make sure the specified object is castable to a valid control request, 743 * otherwise this function will fail at run-time and return the NotSupported StatusCode 744 * 745 * @param request Control object to request of the device 746 * @return Status Code of the request, 0 is OK 747 */ 748 StatusCode setControl(ControlRequest request); 749 750} 751