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% on supported 351 * devices (see {@link SupportsFOC}). Set to false to 352 * use trapezoidal commutation. 353 * <p> 354 * FOC improves motor performance by leveraging torque 355 * (current) control. However, this may be inconvenient 356 * for applications that require specifying duty cycle 357 * or voltage. CTR-Electronics has developed a hybrid 358 * method that combines the performances gains of FOC 359 * while still allowing applications to provide duty 360 * cycle or voltage demand. This not to be confused 361 * with simple sinusoidal control or phase voltage 362 * control which lacks the performance gains. 363 * <li> <b>FeedForward:</b> Feedforward to apply in torque current in Amperes. 364 * User can use motor's kT to scale Newton-meter to 365 * Amperes. 366 * <li> <b>Slot:</b> Select which gains are applied by selecting the slot. Use 367 * the configuration api to set the gain values for the 368 * selected slot before enabling this feature. Slot must be 369 * within [0,2]. 370 * <li> <b>OverrideCoastDurNeutral:</b> Set to true to coast the rotor when 371 * output is zero (or within deadband). 372 * Set to false to use the NeutralMode 373 * configuration setting (default). This 374 * flag exists to provide the fundamental 375 * behavior of this control when output is 376 * zero, which is to provide 0A (zero 377 * torque). 378 * <li> <b>LimitForwardMotion:</b> Set to true to force forward limiting. This 379 * allows users to use other limit switch 380 * sensors connected to robot controller. This 381 * also allows use of active sensors that 382 * require external power. 383 * <li> <b>LimitReverseMotion:</b> Set to true to force reverse limiting. This 384 * allows users to use other limit switch 385 * sensors connected to robot controller. This 386 * also allows use of active sensors that 387 * require external power. 388 * <li> <b>IgnoreHardwareLimits:</b> Set to true to ignore hardware limit 389 * switches and the LimitForwardMotion and 390 * LimitReverseMotion parameters, instead 391 * allowing motion. 392 * <p> 393 * This can be useful on mechanisms such as 394 * an intake/feeder, where a limit switch 395 * stops motion while intaking but should be 396 * ignored when feeding to a shooter. 397 * <p> 398 * The hardware limit faults and 399 * Forward/ReverseLimit signals will still 400 * report the values of the limit switches 401 * regardless of this parameter. 402 * <li> <b>UseTimesync:</b> Set to true to delay applying this control request 403 * until a timesync boundary (requires Phoenix Pro and 404 * CANivore). This eliminates the impact of 405 * nondeterministic network delays in exchange for a 406 * larger but deterministic control latency. 407 * <p> 408 * This requires setting the ControlTimesyncFreqHz 409 * config in MotorOutputConfigs. Additionally, when 410 * this is enabled, the UpdateFreqHz of this request 411 * should be set to 0 Hz. 412 * </ul> 413 * </ul> 414 * 415 * @param request Control object to request of the device 416 * @return Code response of the request 417 */ 418 StatusCode setControl(MotionMagicVelocityTorqueCurrentFOC request); 419 420 /** 421 * Requests Motion Magic® to target a final position using an 422 * exponential motion profile. Users can optionally provide a torque 423 * current feedforward. 424 * <p> 425 * Motion Magic® Expo produces a motion profile in real-time while 426 * attempting to honor the Cruise Velocity (optional) and the 427 * mechanism kV and kA, specified via the Motion Magic® configuration 428 * values. Note that unlike the slot gains, the Expo_kV and Expo_kA 429 * configs are always in output units of Volts. 430 * <p> 431 * Setting Cruise Velocity to 0 will allow the profile to run to the 432 * max possible velocity based on Expo_kV. This control mode does not 433 * use the Acceleration or Jerk configs. 434 * <p> 435 * Target position can be changed on-the-fly and Motion Magic® will do 436 * its best to adjust the profile. This control mode is based on 437 * torque current, so relevant closed-loop gains will use Amperes for 438 * the numerator. 439 * <ul> 440 * <li> <b>MotionMagicExpoTorqueCurrentFOC Parameters:</b> 441 * <ul> 442 * <li> <b>Position:</b> Position to drive toward in rotations. 443 * <li> <b>FeedForward:</b> Feedforward to apply in torque current in Amperes. 444 * User can use motor's kT to scale Newton-meter to 445 * Amperes. 446 * <li> <b>Slot:</b> Select which gains are applied by selecting the slot. Use 447 * the configuration api to set the gain values for the 448 * selected slot before enabling this feature. Slot must be 449 * within [0,2]. 450 * <li> <b>OverrideCoastDurNeutral:</b> Set to true to coast the rotor when 451 * output is zero (or within deadband). 452 * Set to false to use the NeutralMode 453 * configuration setting (default). This 454 * flag exists to provide the fundamental 455 * behavior of this control when output is 456 * zero, which is to provide 0A (zero 457 * torque). 458 * <li> <b>LimitForwardMotion:</b> Set to true to force forward limiting. This 459 * allows users to use other limit switch 460 * sensors connected to robot controller. This 461 * also allows use of active sensors that 462 * require external power. 463 * <li> <b>LimitReverseMotion:</b> Set to true to force reverse limiting. This 464 * allows users to use other limit switch 465 * sensors connected to robot controller. This 466 * also allows use of active sensors that 467 * require external power. 468 * <li> <b>IgnoreHardwareLimits:</b> Set to true to ignore hardware limit 469 * switches and the LimitForwardMotion and 470 * LimitReverseMotion parameters, instead 471 * allowing motion. 472 * <p> 473 * This can be useful on mechanisms such as 474 * an intake/feeder, where a limit switch 475 * stops motion while intaking but should be 476 * ignored when feeding to a shooter. 477 * <p> 478 * The hardware limit faults and 479 * Forward/ReverseLimit signals will still 480 * report the values of the limit switches 481 * regardless of this parameter. 482 * <li> <b>UseTimesync:</b> Set to true to delay applying this control request 483 * until a timesync boundary (requires Phoenix Pro and 484 * CANivore). This eliminates the impact of 485 * nondeterministic network delays in exchange for a 486 * larger but deterministic control latency. 487 * <p> 488 * This requires setting the ControlTimesyncFreqHz 489 * config in MotorOutputConfigs. Additionally, when 490 * this is enabled, the UpdateFreqHz of this request 491 * should be set to 0 Hz. 492 * </ul> 493 * </ul> 494 * 495 * @param request Control object to request of the device 496 * @return Code response of the request 497 */ 498 StatusCode setControl(MotionMagicExpoTorqueCurrentFOC request); 499 500 /** 501 * Requests Motion Magic® to target a final position using a motion 502 * profile. This dynamic request allows runtime changes to Cruise 503 * Velocity, Acceleration, and Jerk. Users can optionally provide a 504 * torque current feedforward. This control requires use of a 505 * CANivore. 506 * <p> 507 * Motion Magic® produces a motion profile in real-time while 508 * attempting to honor the specified Cruise Velocity, Acceleration, 509 * and (optional) Jerk. This control mode does not use the Expo_kV or 510 * Expo_kA configs. 511 * <p> 512 * Target position can be changed on-the-fly and Motion Magic® will do 513 * its best to adjust the profile. This control mode is based on 514 * torque current, so relevant closed-loop gains will use Amperes for 515 * the numerator. 516 * <ul> 517 * <li> <b>DynamicMotionMagicTorqueCurrentFOC Parameters:</b> 518 * <ul> 519 * <li> <b>Position:</b> Position to drive toward in rotations. 520 * <li> <b>Velocity:</b> Cruise velocity for profiling. The signage does not 521 * matter as the device will use the absolute value for 522 * profile generation. 523 * <li> <b>Acceleration:</b> Acceleration for profiling. The signage does not 524 * matter as the device will use the absolute value 525 * for profile generation. 526 * <li> <b>Jerk:</b> Jerk for profiling. The signage does not matter as the 527 * device will use the absolute value for profile generation. 528 * <p> 529 * Jerk is optional; if this is set to zero, then Motion 530 * Magic® will not apply a Jerk limit. 531 * <li> <b>FeedForward:</b> Feedforward to apply in torque current in Amperes. 532 * User can use motor's kT to scale Newton-meter to 533 * Amperes. 534 * <li> <b>Slot:</b> Select which gains are applied by selecting the slot. Use 535 * the configuration api to set the gain values for the 536 * selected slot before enabling this feature. Slot must be 537 * within [0,2]. 538 * <li> <b>OverrideCoastDurNeutral:</b> Set to true to coast the rotor when 539 * output is zero (or within deadband). 540 * Set to false to use the NeutralMode 541 * configuration setting (default). This 542 * flag exists to provide the fundamental 543 * behavior of this control when output is 544 * zero, which is to provide 0A (zero 545 * torque). 546 * <li> <b>LimitForwardMotion:</b> Set to true to force forward limiting. This 547 * allows users to use other limit switch 548 * sensors connected to robot controller. This 549 * also allows use of active sensors that 550 * require external power. 551 * <li> <b>LimitReverseMotion:</b> Set to true to force reverse limiting. This 552 * allows users to use other limit switch 553 * sensors connected to robot controller. This 554 * also allows use of active sensors that 555 * require external power. 556 * <li> <b>IgnoreHardwareLimits:</b> Set to true to ignore hardware limit 557 * switches and the LimitForwardMotion and 558 * LimitReverseMotion parameters, instead 559 * allowing motion. 560 * <p> 561 * This can be useful on mechanisms such as 562 * an intake/feeder, where a limit switch 563 * stops motion while intaking but should be 564 * ignored when feeding to a shooter. 565 * <p> 566 * The hardware limit faults and 567 * Forward/ReverseLimit signals will still 568 * report the values of the limit switches 569 * regardless of this parameter. 570 * <li> <b>UseTimesync:</b> Set to true to delay applying this control request 571 * until a timesync boundary (requires Phoenix Pro and 572 * CANivore). This eliminates the impact of 573 * nondeterministic network delays in exchange for a 574 * larger but deterministic control latency. 575 * <p> 576 * This requires setting the ControlTimesyncFreqHz 577 * config in MotorOutputConfigs. Additionally, when 578 * this is enabled, the UpdateFreqHz of this request 579 * should be set to 0 Hz. 580 * </ul> 581 * </ul> 582 * 583 * @param request Control object to request of the device 584 * @return Code response of the request 585 */ 586 StatusCode setControl(DynamicMotionMagicTorqueCurrentFOC request); 587 588 /** 589 * Differential control with torque current average target and 590 * position difference target. 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 * <ul> 610 * <li> <b>Diff_PositionTorqueCurrentFOC_Position Parameters:</b> 611 * <ul> 612 * <li> <b>AverageRequest:</b> Average PositionTorqueCurrentFOC request of the 613 * mechanism. 614 * <li> <b>DifferentialRequest:</b> Differential PositionTorqueCurrentFOC 615 * request of the mechanism. 616 * </ul> 617 * </ul> 618 * 619 * @param request Control object to request of the device 620 * @return Code response of the request 621 */ 622 StatusCode setControl(Diff_PositionTorqueCurrentFOC_Position request); 623 624 /** 625 * Differential control with velocity average target and position 626 * difference target using torque current control. 627 * <ul> 628 * <li> <b>Diff_VelocityTorqueCurrentFOC_Position Parameters:</b> 629 * <ul> 630 * <li> <b>AverageRequest:</b> Average VelocityTorqueCurrentFOC request of the 631 * mechanism. 632 * <li> <b>DifferentialRequest:</b> Differential PositionTorqueCurrentFOC 633 * request of the mechanism. 634 * </ul> 635 * </ul> 636 * 637 * @param request Control object to request of the device 638 * @return Code response of the request 639 */ 640 StatusCode setControl(Diff_VelocityTorqueCurrentFOC_Position request); 641 642 /** 643 * Differential control with Motion Magic® average target and position 644 * difference target using torque current control. 645 * <ul> 646 * <li> <b>Diff_MotionMagicTorqueCurrentFOC_Position Parameters:</b> 647 * <ul> 648 * <li> <b>AverageRequest:</b> Average MotionMagicTorqueCurrentFOC request of 649 * the mechanism. 650 * <li> <b>DifferentialRequest:</b> Differential PositionTorqueCurrentFOC 651 * request of the mechanism. 652 * </ul> 653 * </ul> 654 * 655 * @param request Control object to request of the device 656 * @return Code response of the request 657 */ 658 StatusCode setControl(Diff_MotionMagicTorqueCurrentFOC_Position request); 659 660 /** 661 * Differential control with torque current average target and 662 * velocity difference target. 663 * <ul> 664 * <li> <b>Diff_TorqueCurrentFOC_Velocity Parameters:</b> 665 * <ul> 666 * <li> <b>AverageRequest:</b> Average TorqueCurrentFOC request of the 667 * mechanism. 668 * <li> <b>DifferentialRequest:</b> Differential VelocityTorqueCurrentFOC 669 * request of the mechanism. 670 * </ul> 671 * </ul> 672 * 673 * @param request Control object to request of the device 674 * @return Code response of the request 675 */ 676 StatusCode setControl(Diff_TorqueCurrentFOC_Velocity request); 677 678 /** 679 * Differential control with position average target and velocity 680 * difference target using torque current control. 681 * <ul> 682 * <li> <b>Diff_PositionTorqueCurrentFOC_Velocity Parameters:</b> 683 * <ul> 684 * <li> <b>AverageRequest:</b> Average PositionTorqueCurrentFOC request of the 685 * mechanism. 686 * <li> <b>DifferentialRequest:</b> Differential VelocityTorqueCurrentFOC 687 * request of the mechanism. 688 * </ul> 689 * </ul> 690 * 691 * @param request Control object to request of the device 692 * @return Code response of the request 693 */ 694 StatusCode setControl(Diff_PositionTorqueCurrentFOC_Velocity request); 695 696 /** 697 * Differential control with velocity average target and velocity 698 * difference target using torque current control. 699 * <ul> 700 * <li> <b>Diff_VelocityTorqueCurrentFOC_Velocity Parameters:</b> 701 * <ul> 702 * <li> <b>AverageRequest:</b> Average VelocityTorqueCurrentFOC request of the 703 * mechanism. 704 * <li> <b>DifferentialRequest:</b> Differential VelocityTorqueCurrentFOC 705 * request of the mechanism. 706 * </ul> 707 * </ul> 708 * 709 * @param request Control object to request of the device 710 * @return Code response of the request 711 */ 712 StatusCode setControl(Diff_VelocityTorqueCurrentFOC_Velocity request); 713 714 /** 715 * Differential control with Motion Magic® average target and velocity 716 * difference target using torque current control. 717 * <ul> 718 * <li> <b>Diff_MotionMagicTorqueCurrentFOC_Velocity Parameters:</b> 719 * <ul> 720 * <li> <b>AverageRequest:</b> Average MotionMagicTorqueCurrentFOC request of 721 * the mechanism. 722 * <li> <b>DifferentialRequest:</b> Differential VelocityTorqueCurrentFOC 723 * request of the mechanism. 724 * </ul> 725 * </ul> 726 * 727 * @param request Control object to request of the device 728 * @return Code response of the request 729 */ 730 StatusCode setControl(Diff_MotionMagicTorqueCurrentFOC_Velocity request); 731 732 /** 733 * Control device with generic control request object. 734 * <p> 735 * User must make sure the specified object is castable to a valid control request, 736 * otherwise this function will fail at run-time and return the NotSupported StatusCode 737 * 738 * @param request Control object to request of the device 739 * @return Status Code of the request, 0 is OK 740 */ 741 StatusCode setControl(ControlRequest request); 742 743} 744