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.core; 008 009import com.ctre.phoenix6.hardware.ParentDevice; 010import com.ctre.phoenix6.controls.*; 011import com.ctre.phoenix6.controls.compound.*; 012import com.ctre.phoenix6.configs.*; 013import com.ctre.phoenix6.StatusCode; 014import com.ctre.phoenix6.jni.PlatformJNI; 015import com.ctre.phoenix6.sim.DeviceType; 016import com.ctre.phoenix6.sim.TalonFXSimState; 017import com.ctre.phoenix6.*; 018import com.ctre.phoenix6.spns.*; 019import com.ctre.phoenix6.signals.*; 020import java.util.HashMap; 021import java.util.Map; 022 023/** 024 * Class description for the Talon FX integrated motor controller. 025 * 026 * <pre> 027 * // Constants used in TalonFX construction 028 * final int kTalonFXId = 0; 029 * final String kTalonFXCANbus = "canivore"; 030 * 031 * // Construct the TalonFX 032 * TalonFX talonfx = new TalonFX(kTalonFXId, kTalonFXCANbus); 033 * 034 * // Configure the TalonFX for basic use 035 * TalonFXConfiguration configs = new TalonFXConfiguration(); 036 * // This TalonFX should be configured with a kP of 1, a kI of 0, a kD of 10, and a kV of 2 on slot 0 037 * configs.Slot0.kP = 1; 038 * configs.Slot0.kI = 0; 039 * configs.Slot0.kD = 10; 040 * configs.Slot0.kV = 2; 041 * 042 * // Write these configs to the TalonFX 043 * talonfx.getConfigurator().apply(configs); 044 * 045 * // Set the position to 0 rotations for initial use 046 * talonfx.setPosition(0); 047 * 048 * // Get Position and Velocity 049 * var position = talonfx.getPosition(); 050 * var velocity = talonfx.getVelocity(); 051 * 052 * // Refresh and print these values 053 * System.out.println("Position is " + position.refresh().toString()); 054 * System.out.println("Velocity is " + velocity.refresh().toString()); 055 * </pre> 056 */ 057public class CoreTalonFX extends ParentDevice 058{ 059 private TalonFXConfigurator _configurator; 060 061 062 /** 063 * Proportional output of PID controller when PID'ing under a 064 * DutyCycle Request 065 * 066 * <ul> 067 * <li> <b>Minimum Value:</b> -128.0 068 * <li> <b>Maximum Value:</b> 127.9990234375 069 * <li> <b>Default Value:</b> 0 070 * <li> <b>Units:</b> fractional 071 * </ul> 072 * 073 * Default Rates: 074 * <ul> 075 * <li> <b>CAN:</b> 4.0 Hz 076 * </ul> 077 * 078 * This refreshes and returns a cached StatusSignal object. 079 * 080 * @return PIDDutyCycle_ProportionalOutput Status Signal Object 081 */ 082 private StatusSignal<Double> getPIDDutyCycle_ProportionalOutput() 083 { 084 return super.lookupStatusSignal(SpnValue.PRO_PIDOutput_ProportionalOutput_DC.value, Double.class, "PIDDutyCycle_ProportionalOutput", true); 085 } 086 087 /** 088 * Proportional output of PID controller when PID'ing under a Voltage 089 * Request 090 * 091 * <ul> 092 * <li> <b>Minimum Value:</b> -1310.72 093 * <li> <b>Maximum Value:</b> 1310.71 094 * <li> <b>Default Value:</b> 0 095 * <li> <b>Units:</b> V 096 * </ul> 097 * 098 * Default Rates: 099 * <ul> 100 * <li> <b>CAN:</b> 4.0 Hz 101 * </ul> 102 * 103 * This refreshes and returns a cached StatusSignal object. 104 * 105 * @return PIDMotorVoltage_ProportionalOutput Status Signal Object 106 */ 107 private StatusSignal<Double> getPIDMotorVoltage_ProportionalOutput() 108 { 109 return super.lookupStatusSignal(SpnValue.PRO_PIDOutput_ProportionalOutput_V.value, Double.class, "PIDMotorVoltage_ProportionalOutput", true); 110 } 111 112 /** 113 * Proportional output of PID controller when PID'ing under a 114 * TorqueCurrent Request 115 * 116 * <ul> 117 * <li> <b>Minimum Value:</b> -13107.2 118 * <li> <b>Maximum Value:</b> 13107.1 119 * <li> <b>Default Value:</b> 0 120 * <li> <b>Units:</b> A 121 * </ul> 122 * 123 * Default Rates: 124 * <ul> 125 * <li> <b>CAN:</b> 4.0 Hz 126 * </ul> 127 * 128 * This refreshes and returns a cached StatusSignal object. 129 * 130 * @return PIDTorqueCurrent_ProportionalOutput Status Signal Object 131 */ 132 private StatusSignal<Double> getPIDTorqueCurrent_ProportionalOutput() 133 { 134 return super.lookupStatusSignal(SpnValue.PRO_PIDOutput_ProportionalOutput_A.value, Double.class, "PIDTorqueCurrent_ProportionalOutput", true); 135 } 136 137 /** 138 * Integrated Accumulator of PID controller when PID'ing under a 139 * DutyCycle Request 140 * 141 * <ul> 142 * <li> <b>Minimum Value:</b> -128.0 143 * <li> <b>Maximum Value:</b> 127.9990234375 144 * <li> <b>Default Value:</b> 0 145 * <li> <b>Units:</b> fractional 146 * </ul> 147 * 148 * Default Rates: 149 * <ul> 150 * <li> <b>CAN:</b> 4.0 Hz 151 * </ul> 152 * 153 * This refreshes and returns a cached StatusSignal object. 154 * 155 * @return PIDDutyCycle_IntegratedAccum Status Signal Object 156 */ 157 private StatusSignal<Double> getPIDDutyCycle_IntegratedAccum() 158 { 159 return super.lookupStatusSignal(SpnValue.PRO_PIDStateEnables_IntegratedAccum_DC.value, Double.class, "PIDDutyCycle_IntegratedAccum", true); 160 } 161 162 /** 163 * Integrated Accumulator of PID controller when PID'ing under a 164 * Voltage Request 165 * 166 * <ul> 167 * <li> <b>Minimum Value:</b> -1310.72 168 * <li> <b>Maximum Value:</b> 1310.71 169 * <li> <b>Default Value:</b> 0 170 * <li> <b>Units:</b> V 171 * </ul> 172 * 173 * Default Rates: 174 * <ul> 175 * <li> <b>CAN:</b> 4.0 Hz 176 * </ul> 177 * 178 * This refreshes and returns a cached StatusSignal object. 179 * 180 * @return PIDMotorVoltage_IntegratedAccum Status Signal Object 181 */ 182 private StatusSignal<Double> getPIDMotorVoltage_IntegratedAccum() 183 { 184 return super.lookupStatusSignal(SpnValue.PRO_PIDStateEnables_IntegratedAccum_V.value, Double.class, "PIDMotorVoltage_IntegratedAccum", true); 185 } 186 187 /** 188 * Integrated Accumulator of PID controller when PID'ing under a 189 * TorqueCurrent Request 190 * 191 * <ul> 192 * <li> <b>Minimum Value:</b> -13107.2 193 * <li> <b>Maximum Value:</b> 13107.1 194 * <li> <b>Default Value:</b> 0 195 * <li> <b>Units:</b> A 196 * </ul> 197 * 198 * Default Rates: 199 * <ul> 200 * <li> <b>CAN:</b> 4.0 Hz 201 * </ul> 202 * 203 * This refreshes and returns a cached StatusSignal object. 204 * 205 * @return PIDTorqueCurrent_IntegratedAccum Status Signal Object 206 */ 207 private StatusSignal<Double> getPIDTorqueCurrent_IntegratedAccum() 208 { 209 return super.lookupStatusSignal(SpnValue.PRO_PIDStateEnables_IntegratedAccum_A.value, Double.class, "PIDTorqueCurrent_IntegratedAccum", true); 210 } 211 212 /** 213 * Feedforward passed to PID controller 214 * 215 * <ul> 216 * <li> <b>Minimum Value:</b> -2.0 217 * <li> <b>Maximum Value:</b> 1.9990234375 218 * <li> <b>Default Value:</b> 0 219 * <li> <b>Units:</b> fractional 220 * </ul> 221 * 222 * Default Rates: 223 * <ul> 224 * <li> <b>CAN:</b> 4.0 Hz 225 * </ul> 226 * 227 * This refreshes and returns a cached StatusSignal object. 228 * 229 * @return PIDDutyCycle_FeedForward Status Signal Object 230 */ 231 private StatusSignal<Double> getPIDDutyCycle_FeedForward() 232 { 233 return super.lookupStatusSignal(SpnValue.PRO_PIDStateEnables_FeedForward_DC.value, Double.class, "PIDDutyCycle_FeedForward", true); 234 } 235 236 /** 237 * Feedforward passed to PID controller 238 * 239 * <ul> 240 * <li> <b>Minimum Value:</b> -20.48 241 * <li> <b>Maximum Value:</b> 20.47 242 * <li> <b>Default Value:</b> 0 243 * <li> <b>Units:</b> V 244 * </ul> 245 * 246 * Default Rates: 247 * <ul> 248 * <li> <b>CAN:</b> 4.0 Hz 249 * </ul> 250 * 251 * This refreshes and returns a cached StatusSignal object. 252 * 253 * @return PIDMotorVoltage_FeedForward Status Signal Object 254 */ 255 private StatusSignal<Double> getPIDMotorVoltage_FeedForward() 256 { 257 return super.lookupStatusSignal(SpnValue.PRO_PIDStateEnables_FeedForward_V.value, Double.class, "PIDMotorVoltage_FeedForward", true); 258 } 259 260 /** 261 * Feedforward passed to PID controller 262 * 263 * <ul> 264 * <li> <b>Minimum Value:</b> -409.6 265 * <li> <b>Maximum Value:</b> 409.40000000000003 266 * <li> <b>Default Value:</b> 0 267 * <li> <b>Units:</b> A 268 * </ul> 269 * 270 * Default Rates: 271 * <ul> 272 * <li> <b>CAN:</b> 4.0 Hz 273 * </ul> 274 * 275 * This refreshes and returns a cached StatusSignal object. 276 * 277 * @return PIDTorqueCurrent_FeedForward Status Signal Object 278 */ 279 private StatusSignal<Double> getPIDTorqueCurrent_FeedForward() 280 { 281 return super.lookupStatusSignal(SpnValue.PRO_PIDStateEnables_FeedForward_A.value, Double.class, "PIDTorqueCurrent_FeedForward", true); 282 } 283 284 /** 285 * Derivative Output of PID controller when PID'ing under a DutyCycle 286 * Request 287 * 288 * <ul> 289 * <li> <b>Minimum Value:</b> -128.0 290 * <li> <b>Maximum Value:</b> 127.9990234375 291 * <li> <b>Default Value:</b> 0 292 * <li> <b>Units:</b> fractional 293 * </ul> 294 * 295 * Default Rates: 296 * <ul> 297 * <li> <b>CAN:</b> 4.0 Hz 298 * </ul> 299 * 300 * This refreshes and returns a cached StatusSignal object. 301 * 302 * @return PIDDutyCycle_DerivativeOutput Status Signal Object 303 */ 304 private StatusSignal<Double> getPIDDutyCycle_DerivativeOutput() 305 { 306 return super.lookupStatusSignal(SpnValue.PRO_PIDOutput_DerivativeOutput_DC.value, Double.class, "PIDDutyCycle_DerivativeOutput", true); 307 } 308 309 /** 310 * Derivative Output of PID controller when PID'ing under a Voltage 311 * Request 312 * 313 * <ul> 314 * <li> <b>Minimum Value:</b> -1310.72 315 * <li> <b>Maximum Value:</b> 1310.71 316 * <li> <b>Default Value:</b> 0 317 * <li> <b>Units:</b> V 318 * </ul> 319 * 320 * Default Rates: 321 * <ul> 322 * <li> <b>CAN:</b> 4.0 Hz 323 * </ul> 324 * 325 * This refreshes and returns a cached StatusSignal object. 326 * 327 * @return PIDMotorVoltage_DerivativeOutput Status Signal Object 328 */ 329 private StatusSignal<Double> getPIDMotorVoltage_DerivativeOutput() 330 { 331 return super.lookupStatusSignal(SpnValue.PRO_PIDOutput_DerivativeOutput_V.value, Double.class, "PIDMotorVoltage_DerivativeOutput", true); 332 } 333 334 /** 335 * Derivative Output of PID controller when PID'ing under a 336 * TorqueCurrent Request 337 * 338 * <ul> 339 * <li> <b>Minimum Value:</b> -13107.2 340 * <li> <b>Maximum Value:</b> 13107.1 341 * <li> <b>Default Value:</b> 0 342 * <li> <b>Units:</b> A 343 * </ul> 344 * 345 * Default Rates: 346 * <ul> 347 * <li> <b>CAN:</b> 4.0 Hz 348 * </ul> 349 * 350 * This refreshes and returns a cached StatusSignal object. 351 * 352 * @return PIDTorqueCurrent_DerivativeOutput Status Signal Object 353 */ 354 private StatusSignal<Double> getPIDTorqueCurrent_DerivativeOutput() 355 { 356 return super.lookupStatusSignal(SpnValue.PRO_PIDOutput_DerivativeOutput_A.value, Double.class, "PIDTorqueCurrent_DerivativeOutput", true); 357 } 358 359 /** 360 * Output of PID controller when PID'ing under a DutyCycle Request 361 * 362 * <ul> 363 * <li> <b>Minimum Value:</b> -128.0 364 * <li> <b>Maximum Value:</b> 127.9990234375 365 * <li> <b>Default Value:</b> 0 366 * <li> <b>Units:</b> fractional 367 * </ul> 368 * 369 * Default Rates: 370 * <ul> 371 * <li> <b>CAN:</b> 4.0 Hz 372 * </ul> 373 * 374 * This refreshes and returns a cached StatusSignal object. 375 * 376 * @return PIDDutyCycle_Output Status Signal Object 377 */ 378 private StatusSignal<Double> getPIDDutyCycle_Output() 379 { 380 return super.lookupStatusSignal(SpnValue.PRO_PIDOutput_Output_DC.value, Double.class, "PIDDutyCycle_Output", true); 381 } 382 383 /** 384 * Output of PID controller when PID'ing under a Voltage Request 385 * 386 * <ul> 387 * <li> <b>Minimum Value:</b> -1310.72 388 * <li> <b>Maximum Value:</b> 1310.71 389 * <li> <b>Default Value:</b> 0 390 * <li> <b>Units:</b> V 391 * </ul> 392 * 393 * Default Rates: 394 * <ul> 395 * <li> <b>CAN:</b> 4.0 Hz 396 * </ul> 397 * 398 * This refreshes and returns a cached StatusSignal object. 399 * 400 * @return PIDMotorVoltage_Output Status Signal Object 401 */ 402 private StatusSignal<Double> getPIDMotorVoltage_Output() 403 { 404 return super.lookupStatusSignal(SpnValue.PRO_PIDOutput_Output_V.value, Double.class, "PIDMotorVoltage_Output", true); 405 } 406 407 /** 408 * Output of PID controller when PID'ing under a TorqueCurrent Request 409 * 410 * <ul> 411 * <li> <b>Minimum Value:</b> -13107.2 412 * <li> <b>Maximum Value:</b> 13107.1 413 * <li> <b>Default Value:</b> 0 414 * <li> <b>Units:</b> A 415 * </ul> 416 * 417 * Default Rates: 418 * <ul> 419 * <li> <b>CAN:</b> 4.0 Hz 420 * </ul> 421 * 422 * This refreshes and returns a cached StatusSignal object. 423 * 424 * @return PIDTorqueCurrent_Output Status Signal Object 425 */ 426 private StatusSignal<Double> getPIDTorqueCurrent_Output() 427 { 428 return super.lookupStatusSignal(SpnValue.PRO_PIDOutput_Output_A.value, Double.class, "PIDTorqueCurrent_Output", true); 429 } 430 431 /** 432 * Input position of PID controller when PID'ing to a position 433 * 434 * <ul> 435 * <li> <b>Minimum Value:</b> -10000 436 * <li> <b>Maximum Value:</b> 10000 437 * <li> <b>Default Value:</b> 0 438 * <li> <b>Units:</b> rotations 439 * </ul> 440 * 441 * Default Rates: 442 * <ul> 443 * <li> <b>CAN:</b> 4.0 Hz 444 * </ul> 445 * 446 * This refreshes and returns a cached StatusSignal object. 447 * 448 * @return PIDPosition_Reference Status Signal Object 449 */ 450 private StatusSignal<Double> getPIDPosition_Reference() 451 { 452 return super.lookupStatusSignal(SpnValue.PRO_PIDRefPIDErr_PIDRef_Position.value, Double.class, "PIDPosition_Reference", true); 453 } 454 455 /** 456 * Input velocity of PID controller when PID'ing to a velocity 457 * 458 * <ul> 459 * <li> <b>Minimum Value:</b> -10000 460 * <li> <b>Maximum Value:</b> 10000 461 * <li> <b>Default Value:</b> 0 462 * <li> <b>Units:</b> rotations per second 463 * </ul> 464 * 465 * Default Rates: 466 * <ul> 467 * <li> <b>CAN:</b> 4.0 Hz 468 * </ul> 469 * 470 * This refreshes and returns a cached StatusSignal object. 471 * 472 * @return PIDVelocity_Reference Status Signal Object 473 */ 474 private StatusSignal<Double> getPIDVelocity_Reference() 475 { 476 return super.lookupStatusSignal(SpnValue.PRO_PIDRefPIDErr_PIDRef_Velocity.value, Double.class, "PIDVelocity_Reference", true); 477 } 478 479 /** 480 * Change in input (velocity) of PID controller when PID'ing to a 481 * position 482 * 483 * <ul> 484 * <li> <b>Minimum Value:</b> -512.0 485 * <li> <b>Maximum Value:</b> 511.984375 486 * <li> <b>Default Value:</b> 0 487 * <li> <b>Units:</b> rotations per second 488 * </ul> 489 * 490 * Default Rates: 491 * <ul> 492 * <li> <b>CAN:</b> 4.0 Hz 493 * </ul> 494 * 495 * This refreshes and returns a cached StatusSignal object. 496 * 497 * @return PIDPosition_ReferenceSlope Status Signal Object 498 */ 499 private StatusSignal<Double> getPIDPosition_ReferenceSlope() 500 { 501 return super.lookupStatusSignal(SpnValue.PRO_PIDRefSlopeECUTime_ReferenceSlope_Position.value, Double.class, "PIDPosition_ReferenceSlope", true); 502 } 503 504 /** 505 * Change in input (acceleration) of PID controller when PID'ing to a 506 * velocity 507 * 508 * <ul> 509 * <li> <b>Minimum Value:</b> -512.0 510 * <li> <b>Maximum Value:</b> 511.984375 511 * <li> <b>Default Value:</b> 0 512 * <li> <b>Units:</b> rotations per second² 513 * </ul> 514 * 515 * Default Rates: 516 * <ul> 517 * <li> <b>CAN:</b> 4.0 Hz 518 * </ul> 519 * 520 * This refreshes and returns a cached StatusSignal object. 521 * 522 * @return PIDVelocity_ReferenceSlope Status Signal Object 523 */ 524 private StatusSignal<Double> getPIDVelocity_ReferenceSlope() 525 { 526 return super.lookupStatusSignal(SpnValue.PRO_PIDRefSlopeECUTime_ReferenceSlope_Velocity.value, Double.class, "PIDVelocity_ReferenceSlope", true); 527 } 528 529 /** 530 * The difference between target position and current position 531 * 532 * <ul> 533 * <li> <b>Minimum Value:</b> -10000 534 * <li> <b>Maximum Value:</b> 10000 535 * <li> <b>Default Value:</b> 0 536 * <li> <b>Units:</b> rotations 537 * </ul> 538 * 539 * Default Rates: 540 * <ul> 541 * <li> <b>CAN:</b> 4.0 Hz 542 * </ul> 543 * 544 * This refreshes and returns a cached StatusSignal object. 545 * 546 * @return PIDPosition_ClosedLoopError Status Signal Object 547 */ 548 private StatusSignal<Double> getPIDPosition_ClosedLoopError() 549 { 550 return super.lookupStatusSignal(SpnValue.PRO_PIDRefPIDErr_PIDErr_Position.value, Double.class, "PIDPosition_ClosedLoopError", true); 551 } 552 553 /** 554 * The difference between target velocity and current velocity 555 * 556 * <ul> 557 * <li> <b>Minimum Value:</b> -10000 558 * <li> <b>Maximum Value:</b> 10000 559 * <li> <b>Default Value:</b> 0 560 * <li> <b>Units:</b> rotations per second 561 * </ul> 562 * 563 * Default Rates: 564 * <ul> 565 * <li> <b>CAN:</b> 4.0 Hz 566 * </ul> 567 * 568 * This refreshes and returns a cached StatusSignal object. 569 * 570 * @return PIDVelocity_ClosedLoopError Status Signal Object 571 */ 572 private StatusSignal<Double> getPIDVelocity_ClosedLoopError() 573 { 574 return super.lookupStatusSignal(SpnValue.PRO_PIDRefPIDErr_PIDErr_Velocity.value, Double.class, "PIDVelocity_ClosedLoopError", true); 575 } 576 577 /** 578 * The calculated motor duty cycle for differential followers. 579 * 580 * <ul> 581 * <li> <b>Minimum Value:</b> -32.0 582 * <li> <b>Maximum Value:</b> 31.9990234375 583 * <li> <b>Default Value:</b> 0 584 * <li> <b>Units:</b> fractional 585 * </ul> 586 * 587 * Default Rates: 588 * <ul> 589 * <li> <b>CAN:</b> 4.0 Hz 590 * </ul> 591 * 592 * This refreshes and returns a cached StatusSignal object. 593 * 594 * @return DifferentialDutyCycle Status Signal Object 595 */ 596 private StatusSignal<Double> getDifferentialDutyCycle() 597 { 598 return super.lookupStatusSignal(SpnValue.PRO_MotorOutput_PIDState_Diff_DutyCycle.value, Double.class, "DifferentialDutyCycle", true); 599 } 600 601 /** 602 * The calculated motor torque current for differential followers. 603 * 604 * <ul> 605 * <li> <b>Minimum Value:</b> -327.68 606 * <li> <b>Maximum Value:</b> 327.67 607 * <li> <b>Default Value:</b> 0 608 * <li> <b>Units:</b> A 609 * </ul> 610 * 611 * Default Rates: 612 * <ul> 613 * <li> <b>CAN:</b> 4.0 Hz 614 * </ul> 615 * 616 * This refreshes and returns a cached StatusSignal object. 617 * 618 * @return DifferentialTorqueCurrent Status Signal Object 619 */ 620 private StatusSignal<Double> getDifferentialTorqueCurrent() 621 { 622 return super.lookupStatusSignal(SpnValue.PRO_MotorOutput_PIDState_Diff_TorqueCurrent.value, Double.class, "DifferentialTorqueCurrent", true); 623 } 624 625 /** 626 * Proportional output of differential PID controller when PID'ing 627 * under a DutyCycle Request 628 * 629 * <ul> 630 * <li> <b>Minimum Value:</b> -128.0 631 * <li> <b>Maximum Value:</b> 127.9990234375 632 * <li> <b>Default Value:</b> 0 633 * <li> <b>Units:</b> fractional 634 * </ul> 635 * 636 * Default Rates: 637 * <ul> 638 * <li> <b>CAN:</b> 4.0 Hz 639 * </ul> 640 * 641 * This refreshes and returns a cached StatusSignal object. 642 * 643 * @return DifferentialPIDDutyCycle_ProportionalOutput Status Signal Object 644 */ 645 private StatusSignal<Double> getDifferentialPIDDutyCycle_ProportionalOutput() 646 { 647 return super.lookupStatusSignal(SpnValue.PRO_DiffPIDOutput_ProportionalOutput_DC.value, Double.class, "DifferentialPIDDutyCycle_ProportionalOutput", true); 648 } 649 650 /** 651 * Proportional output of differential PID controller when PID'ing 652 * under a Voltage Request 653 * 654 * <ul> 655 * <li> <b>Minimum Value:</b> -1310.72 656 * <li> <b>Maximum Value:</b> 1310.71 657 * <li> <b>Default Value:</b> 0 658 * <li> <b>Units:</b> V 659 * </ul> 660 * 661 * Default Rates: 662 * <ul> 663 * <li> <b>CAN:</b> 4.0 Hz 664 * </ul> 665 * 666 * This refreshes and returns a cached StatusSignal object. 667 * 668 * @return DifferentialPIDMotorVoltage_ProportionalOutput Status Signal Object 669 */ 670 private StatusSignal<Double> getDifferentialPIDMotorVoltage_ProportionalOutput() 671 { 672 return super.lookupStatusSignal(SpnValue.PRO_DiffPIDOutput_ProportionalOutput_V.value, Double.class, "DifferentialPIDMotorVoltage_ProportionalOutput", true); 673 } 674 675 /** 676 * Proportional output of differential PID controller when PID'ing 677 * under a TorqueCurrent Request 678 * 679 * <ul> 680 * <li> <b>Minimum Value:</b> -13107.2 681 * <li> <b>Maximum Value:</b> 13107.1 682 * <li> <b>Default Value:</b> 0 683 * <li> <b>Units:</b> A 684 * </ul> 685 * 686 * Default Rates: 687 * <ul> 688 * <li> <b>CAN:</b> 4.0 Hz 689 * </ul> 690 * 691 * This refreshes and returns a cached StatusSignal object. 692 * 693 * @return DifferentialPIDTorqueCurrent_ProportionalOutput Status Signal Object 694 */ 695 private StatusSignal<Double> getDifferentialPIDTorqueCurrent_ProportionalOutput() 696 { 697 return super.lookupStatusSignal(SpnValue.PRO_DiffPIDOutput_ProportionalOutput_A.value, Double.class, "DifferentialPIDTorqueCurrent_ProportionalOutput", true); 698 } 699 700 /** 701 * Integrated Accumulator of differential PID controller when PID'ing 702 * under a DutyCycle Request 703 * 704 * <ul> 705 * <li> <b>Minimum Value:</b> -128.0 706 * <li> <b>Maximum Value:</b> 127.9990234375 707 * <li> <b>Default Value:</b> 0 708 * <li> <b>Units:</b> fractional 709 * </ul> 710 * 711 * Default Rates: 712 * <ul> 713 * <li> <b>CAN:</b> 4.0 Hz 714 * </ul> 715 * 716 * This refreshes and returns a cached StatusSignal object. 717 * 718 * @return DifferentialPIDDutyCycle_IntegratedAccum Status Signal Object 719 */ 720 private StatusSignal<Double> getDifferentialPIDDutyCycle_IntegratedAccum() 721 { 722 return super.lookupStatusSignal(SpnValue.PRO_MotorOutput_PIDState_Diff_IntegratedAccum_DC.value, Double.class, "DifferentialPIDDutyCycle_IntegratedAccum", true); 723 } 724 725 /** 726 * Integrated Accumulator of differential PID controller when PID'ing 727 * under a Voltage Request 728 * 729 * <ul> 730 * <li> <b>Minimum Value:</b> -1310.72 731 * <li> <b>Maximum Value:</b> 1310.71 732 * <li> <b>Default Value:</b> 0 733 * <li> <b>Units:</b> V 734 * </ul> 735 * 736 * Default Rates: 737 * <ul> 738 * <li> <b>CAN:</b> 4.0 Hz 739 * </ul> 740 * 741 * This refreshes and returns a cached StatusSignal object. 742 * 743 * @return DifferentialPIDMotorVoltage_IntegratedAccum Status Signal Object 744 */ 745 private StatusSignal<Double> getDifferentialPIDMotorVoltage_IntegratedAccum() 746 { 747 return super.lookupStatusSignal(SpnValue.PRO_MotorOutput_PIDState_Diff_IntegratedAccum_V.value, Double.class, "DifferentialPIDMotorVoltage_IntegratedAccum", true); 748 } 749 750 /** 751 * Integrated Accumulator of differential PID controller when PID'ing 752 * under a TorqueCurrent Request 753 * 754 * <ul> 755 * <li> <b>Minimum Value:</b> -13107.2 756 * <li> <b>Maximum Value:</b> 13107.1 757 * <li> <b>Default Value:</b> 0 758 * <li> <b>Units:</b> A 759 * </ul> 760 * 761 * Default Rates: 762 * <ul> 763 * <li> <b>CAN:</b> 4.0 Hz 764 * </ul> 765 * 766 * This refreshes and returns a cached StatusSignal object. 767 * 768 * @return DifferentialPIDTorqueCurrent_IntegratedAccum Status Signal Object 769 */ 770 private StatusSignal<Double> getDifferentialPIDTorqueCurrent_IntegratedAccum() 771 { 772 return super.lookupStatusSignal(SpnValue.PRO_MotorOutput_PIDState_Diff_IntegratedAccum_A.value, Double.class, "DifferentialPIDTorqueCurrent_IntegratedAccum", true); 773 } 774 775 /** 776 * Feedforward passed to differential PID controller 777 * 778 * <ul> 779 * <li> <b>Minimum Value:</b> -2.0 780 * <li> <b>Maximum Value:</b> 1.9990234375 781 * <li> <b>Default Value:</b> 0 782 * <li> <b>Units:</b> fractional 783 * </ul> 784 * 785 * Default Rates: 786 * <ul> 787 * <li> <b>CAN:</b> 4.0 Hz 788 * </ul> 789 * 790 * This refreshes and returns a cached StatusSignal object. 791 * 792 * @return DifferentialPIDDutyCycle_FeedForward Status Signal Object 793 */ 794 private StatusSignal<Double> getDifferentialPIDDutyCycle_FeedForward() 795 { 796 return super.lookupStatusSignal(SpnValue.PRO_MotorOutput_PIDState_Diff_FeedForward_DC.value, Double.class, "DifferentialPIDDutyCycle_FeedForward", true); 797 } 798 799 /** 800 * Feedforward passed to differential PID controller 801 * 802 * <ul> 803 * <li> <b>Minimum Value:</b> -20.48 804 * <li> <b>Maximum Value:</b> 20.47 805 * <li> <b>Default Value:</b> 0 806 * <li> <b>Units:</b> V 807 * </ul> 808 * 809 * Default Rates: 810 * <ul> 811 * <li> <b>CAN:</b> 4.0 Hz 812 * </ul> 813 * 814 * This refreshes and returns a cached StatusSignal object. 815 * 816 * @return DifferentialPIDMotorVoltage_FeedForward Status Signal Object 817 */ 818 private StatusSignal<Double> getDifferentialPIDMotorVoltage_FeedForward() 819 { 820 return super.lookupStatusSignal(SpnValue.PRO_MotorOutput_PIDState_Diff_FeedForward_V.value, Double.class, "DifferentialPIDMotorVoltage_FeedForward", true); 821 } 822 823 /** 824 * Feedforward passed to differential PID controller 825 * 826 * <ul> 827 * <li> <b>Minimum Value:</b> -409.6 828 * <li> <b>Maximum Value:</b> 409.40000000000003 829 * <li> <b>Default Value:</b> 0 830 * <li> <b>Units:</b> A 831 * </ul> 832 * 833 * Default Rates: 834 * <ul> 835 * <li> <b>CAN:</b> 4.0 Hz 836 * </ul> 837 * 838 * This refreshes and returns a cached StatusSignal object. 839 * 840 * @return DifferentialPIDTorqueCurrent_FeedForward Status Signal Object 841 */ 842 private StatusSignal<Double> getDifferentialPIDTorqueCurrent_FeedForward() 843 { 844 return super.lookupStatusSignal(SpnValue.PRO_MotorOutput_PIDState_Diff_FeedForward_A.value, Double.class, "DifferentialPIDTorqueCurrent_FeedForward", true); 845 } 846 847 /** 848 * Derivative Output of differential PID controller when PID'ing under 849 * a DutyCycle Request 850 * 851 * <ul> 852 * <li> <b>Minimum Value:</b> -128.0 853 * <li> <b>Maximum Value:</b> 127.9990234375 854 * <li> <b>Default Value:</b> 0 855 * <li> <b>Units:</b> fractional 856 * </ul> 857 * 858 * Default Rates: 859 * <ul> 860 * <li> <b>CAN:</b> 4.0 Hz 861 * </ul> 862 * 863 * This refreshes and returns a cached StatusSignal object. 864 * 865 * @return DifferentialPIDDutyCycle_DerivativeOutput Status Signal Object 866 */ 867 private StatusSignal<Double> getDifferentialPIDDutyCycle_DerivativeOutput() 868 { 869 return super.lookupStatusSignal(SpnValue.PRO_DiffPIDOutput_DerivativeOutput_DC.value, Double.class, "DifferentialPIDDutyCycle_DerivativeOutput", true); 870 } 871 872 /** 873 * Derivative Output of differential PID controller when PID'ing under 874 * a Voltage Request 875 * 876 * <ul> 877 * <li> <b>Minimum Value:</b> -1310.72 878 * <li> <b>Maximum Value:</b> 1310.71 879 * <li> <b>Default Value:</b> 0 880 * <li> <b>Units:</b> V 881 * </ul> 882 * 883 * Default Rates: 884 * <ul> 885 * <li> <b>CAN:</b> 4.0 Hz 886 * </ul> 887 * 888 * This refreshes and returns a cached StatusSignal object. 889 * 890 * @return DiffPIDMotorVoltage_DerivativeOutput Status Signal Object 891 */ 892 private StatusSignal<Double> getDiffPIDMotorVoltage_DerivativeOutput() 893 { 894 return super.lookupStatusSignal(SpnValue.PRO_DiffPIDOutput_DerivativeOutput_V.value, Double.class, "DiffPIDMotorVoltage_DerivativeOutput", true); 895 } 896 897 /** 898 * Derivative Output of differential PID controller when PID'ing under 899 * a TorqueCurrent Request 900 * 901 * <ul> 902 * <li> <b>Minimum Value:</b> -13107.2 903 * <li> <b>Maximum Value:</b> 13107.1 904 * <li> <b>Default Value:</b> 0 905 * <li> <b>Units:</b> A 906 * </ul> 907 * 908 * Default Rates: 909 * <ul> 910 * <li> <b>CAN:</b> 4.0 Hz 911 * </ul> 912 * 913 * This refreshes and returns a cached StatusSignal object. 914 * 915 * @return DifferentialPIDTorqueCurrent_DerivativeOutput Status Signal Object 916 */ 917 private StatusSignal<Double> getDifferentialPIDTorqueCurrent_DerivativeOutput() 918 { 919 return super.lookupStatusSignal(SpnValue.PRO_DiffPIDOutput_DerivativeOutput_A.value, Double.class, "DifferentialPIDTorqueCurrent_DerivativeOutput", true); 920 } 921 922 /** 923 * Output of differential PID controller when PID'ing under a 924 * DutyCycle Request 925 * 926 * <ul> 927 * <li> <b>Minimum Value:</b> -128.0 928 * <li> <b>Maximum Value:</b> 127.9990234375 929 * <li> <b>Default Value:</b> 0 930 * <li> <b>Units:</b> fractional 931 * </ul> 932 * 933 * Default Rates: 934 * <ul> 935 * <li> <b>CAN:</b> 4.0 Hz 936 * </ul> 937 * 938 * This refreshes and returns a cached StatusSignal object. 939 * 940 * @return DifferentialPIDDutyCycle_Output Status Signal Object 941 */ 942 private StatusSignal<Double> getDifferentialPIDDutyCycle_Output() 943 { 944 return super.lookupStatusSignal(SpnValue.PRO_DiffPIDOutput_Output_DC.value, Double.class, "DifferentialPIDDutyCycle_Output", true); 945 } 946 947 /** 948 * Output of differential PID controller when PID'ing under a Voltage 949 * Request 950 * 951 * <ul> 952 * <li> <b>Minimum Value:</b> -1310.72 953 * <li> <b>Maximum Value:</b> 1310.71 954 * <li> <b>Default Value:</b> 0 955 * <li> <b>Units:</b> V 956 * </ul> 957 * 958 * Default Rates: 959 * <ul> 960 * <li> <b>CAN:</b> 4.0 Hz 961 * </ul> 962 * 963 * This refreshes and returns a cached StatusSignal object. 964 * 965 * @return DifferentialPIDMotorVoltage_Output Status Signal Object 966 */ 967 private StatusSignal<Double> getDifferentialPIDMotorVoltage_Output() 968 { 969 return super.lookupStatusSignal(SpnValue.PRO_DiffPIDOutput_Output_V.value, Double.class, "DifferentialPIDMotorVoltage_Output", true); 970 } 971 972 /** 973 * Output of differential PID controller when PID'ing under a 974 * TorqueCurrent Request 975 * 976 * <ul> 977 * <li> <b>Minimum Value:</b> -13107.2 978 * <li> <b>Maximum Value:</b> 13107.1 979 * <li> <b>Default Value:</b> 0 980 * <li> <b>Units:</b> A 981 * </ul> 982 * 983 * Default Rates: 984 * <ul> 985 * <li> <b>CAN:</b> 4.0 Hz 986 * </ul> 987 * 988 * This refreshes and returns a cached StatusSignal object. 989 * 990 * @return DifferentialPIDTorqueCurrent_Output Status Signal Object 991 */ 992 private StatusSignal<Double> getDifferentialPIDTorqueCurrent_Output() 993 { 994 return super.lookupStatusSignal(SpnValue.PRO_DiffPIDOutput_Output_A.value, Double.class, "DifferentialPIDTorqueCurrent_Output", true); 995 } 996 997 /** 998 * Input position of differential PID controller when PID'ing to a 999 * differential position 1000 * 1001 * <ul> 1002 * <li> <b>Minimum Value:</b> -10000 1003 * <li> <b>Maximum Value:</b> 10000 1004 * <li> <b>Default Value:</b> 0 1005 * <li> <b>Units:</b> rotations 1006 * </ul> 1007 * 1008 * Default Rates: 1009 * <ul> 1010 * <li> <b>CAN:</b> 4.0 Hz 1011 * </ul> 1012 * 1013 * This refreshes and returns a cached StatusSignal object. 1014 * 1015 * @return DifferentialPIDPosition_Reference Status Signal Object 1016 */ 1017 private StatusSignal<Double> getDifferentialPIDPosition_Reference() 1018 { 1019 return super.lookupStatusSignal(SpnValue.PRO_DiffPIDRefPIDErr_PIDRef_Position.value, Double.class, "DifferentialPIDPosition_Reference", true); 1020 } 1021 1022 /** 1023 * Input velocity of differential PID controller when PID'ing to a 1024 * differential velocity 1025 * 1026 * <ul> 1027 * <li> <b>Minimum Value:</b> -10000 1028 * <li> <b>Maximum Value:</b> 10000 1029 * <li> <b>Default Value:</b> 0 1030 * <li> <b>Units:</b> rotations per second 1031 * </ul> 1032 * 1033 * Default Rates: 1034 * <ul> 1035 * <li> <b>CAN:</b> 4.0 Hz 1036 * </ul> 1037 * 1038 * This refreshes and returns a cached StatusSignal object. 1039 * 1040 * @return DifferentialPIDVelocity_Reference Status Signal Object 1041 */ 1042 private StatusSignal<Double> getDifferentialPIDVelocity_Reference() 1043 { 1044 return super.lookupStatusSignal(SpnValue.PRO_DiffPIDRefPIDErr_PIDRef_Velocity.value, Double.class, "DifferentialPIDVelocity_Reference", true); 1045 } 1046 1047 /** 1048 * Change in input (velocity) of differential PID controller when 1049 * PID'ing to a differential position 1050 * 1051 * <ul> 1052 * <li> <b>Minimum Value:</b> -512.0 1053 * <li> <b>Maximum Value:</b> 511.984375 1054 * <li> <b>Default Value:</b> 0 1055 * <li> <b>Units:</b> rotations per second 1056 * </ul> 1057 * 1058 * Default Rates: 1059 * <ul> 1060 * <li> <b>CAN:</b> 4.0 Hz 1061 * </ul> 1062 * 1063 * This refreshes and returns a cached StatusSignal object. 1064 * 1065 * @return DifferentialPIDPosition_ReferenceSlope Status Signal Object 1066 */ 1067 private StatusSignal<Double> getDifferentialPIDPosition_ReferenceSlope() 1068 { 1069 return super.lookupStatusSignal(SpnValue.PRO_DiffPIDRefSlopeECUTime_ReferenceSlope_Position.value, Double.class, "DifferentialPIDPosition_ReferenceSlope", true); 1070 } 1071 1072 /** 1073 * Change in input (acceleration) of differential PID controller when 1074 * PID'ing to a differential velocity 1075 * 1076 * <ul> 1077 * <li> <b>Minimum Value:</b> -512.0 1078 * <li> <b>Maximum Value:</b> 511.984375 1079 * <li> <b>Default Value:</b> 0 1080 * <li> <b>Units:</b> rotations per second² 1081 * </ul> 1082 * 1083 * Default Rates: 1084 * <ul> 1085 * <li> <b>CAN:</b> 4.0 Hz 1086 * </ul> 1087 * 1088 * This refreshes and returns a cached StatusSignal object. 1089 * 1090 * @return DifferentialPIDVelocity_ReferenceSlope Status Signal Object 1091 */ 1092 private StatusSignal<Double> getDifferentialPIDVelocity_ReferenceSlope() 1093 { 1094 return super.lookupStatusSignal(SpnValue.PRO_DiffPIDRefSlopeECUTime_ReferenceSlope_Velocity.value, Double.class, "DifferentialPIDVelocity_ReferenceSlope", true); 1095 } 1096 1097 /** 1098 * The difference between target differential position and current 1099 * differential position 1100 * 1101 * <ul> 1102 * <li> <b>Minimum Value:</b> -10000 1103 * <li> <b>Maximum Value:</b> 10000 1104 * <li> <b>Default Value:</b> 0 1105 * <li> <b>Units:</b> rotations 1106 * </ul> 1107 * 1108 * Default Rates: 1109 * <ul> 1110 * <li> <b>CAN:</b> 4.0 Hz 1111 * </ul> 1112 * 1113 * This refreshes and returns a cached StatusSignal object. 1114 * 1115 * @return DifferentialPIDPosition_ClosedLoopError Status Signal Object 1116 */ 1117 private StatusSignal<Double> getDifferentialPIDPosition_ClosedLoopError() 1118 { 1119 return super.lookupStatusSignal(SpnValue.PRO_DiffPIDRefPIDErr_PIDErr_Position.value, Double.class, "DifferentialPIDPosition_ClosedLoopError", true); 1120 } 1121 1122 /** 1123 * The difference between target differential velocity and current 1124 * differential velocity 1125 * 1126 * <ul> 1127 * <li> <b>Minimum Value:</b> -10000 1128 * <li> <b>Maximum Value:</b> 10000 1129 * <li> <b>Default Value:</b> 0 1130 * <li> <b>Units:</b> rotations per second 1131 * </ul> 1132 * 1133 * Default Rates: 1134 * <ul> 1135 * <li> <b>CAN:</b> 4.0 Hz 1136 * </ul> 1137 * 1138 * This refreshes and returns a cached StatusSignal object. 1139 * 1140 * @return DifferentialPIDVelocity_ClosedLoopError Status Signal Object 1141 */ 1142 private StatusSignal<Double> getDifferentialPIDVelocity_ClosedLoopError() 1143 { 1144 return super.lookupStatusSignal(SpnValue.PRO_DiffPIDRefPIDErr_PIDErr_Velocity.value, Double.class, "DifferentialPIDVelocity_ClosedLoopError", true); 1145 } 1146 1147 /** 1148 * Constructs a new Talon FX motor controller object. 1149 * <p> 1150 * Constructs the device using the default CAN bus for the system: 1151 * <ul> 1152 * <li>"rio" on roboRIO 1153 * <li>"can0" on Linux 1154 * <li>"*" on Windows 1155 * </ul> 1156 * 1157 * @param deviceId ID of the device, as configured in Phoenix Tuner. 1158 */ 1159 public CoreTalonFX(int deviceId) 1160 { 1161 this(deviceId, ""); 1162 } 1163 /** 1164 * Constructs a new Talon FX motor controller object. 1165 * 1166 * @param deviceId ID of the device, as configured in Phoenix Tuner. 1167 * @param canbus Name of the CAN bus this device is on. Possible CAN bus strings are: 1168 * <ul> 1169 * <li>"rio" for the native roboRIO CAN bus 1170 * <li>CANivore name or serial number 1171 * <li>SocketCAN interface (non-FRC Linux only) 1172 * <li>"*" for any CANivore seen by the program 1173 * <li>empty string (default) to select the default for the system: 1174 * <ul> 1175 * <li>"rio" on roboRIO 1176 * <li>"can0" on Linux 1177 * <li>"*" on Windows 1178 * </ul> 1179 * </ul> 1180 */ 1181 public CoreTalonFX(int deviceId, String canbus) 1182 { 1183 super(deviceId, "talon fx", canbus); 1184 _configurator = new TalonFXConfigurator(this.deviceIdentifier); 1185 PlatformJNI.JNI_SimCreate(DeviceType.PRO_TalonFXType.value, deviceId); 1186 } 1187 1188 /** 1189 * Gets the configurator to use with this device's configs 1190 * 1191 * @return Configurator for this object 1192 */ 1193 public TalonFXConfigurator getConfigurator() 1194 { 1195 return this._configurator; 1196 } 1197 1198 1199 private TalonFXSimState _simState = null; 1200 /** 1201 * Get the simulation state for this device. 1202 * <p> 1203 * This function reuses an allocated simulation state 1204 * object, so it is safe to call this function multiple 1205 * times in a robot loop. 1206 * 1207 * @return Simulation state 1208 */ 1209 public TalonFXSimState getSimState() { 1210 if (_simState == null) 1211 _simState = new TalonFXSimState(this); 1212 return _simState; 1213 } 1214 1215 1216 1217 /** 1218 * App Major Version number. 1219 * 1220 * <ul> 1221 * <li> <b>Minimum Value:</b> 0 1222 * <li> <b>Maximum Value:</b> 255 1223 * <li> <b>Default Value:</b> 0 1224 * <li> <b>Units:</b> 1225 * </ul> 1226 * 1227 * Default Rates: 1228 * <ul> 1229 * <li> <b>CAN:</b> 4.0 Hz 1230 * </ul> 1231 * 1232 * This refreshes and returns a cached StatusSignal object. 1233 * 1234 * @return VersionMajor Status Signal Object 1235 */ 1236 public StatusSignal<Integer> getVersionMajor() 1237 { 1238 return super.lookupStatusSignal(SpnValue.Version_Major.value, Integer.class, "VersionMajor", false); 1239 } 1240 1241 /** 1242 * App Minor Version number. 1243 * 1244 * <ul> 1245 * <li> <b>Minimum Value:</b> 0 1246 * <li> <b>Maximum Value:</b> 255 1247 * <li> <b>Default Value:</b> 0 1248 * <li> <b>Units:</b> 1249 * </ul> 1250 * 1251 * Default Rates: 1252 * <ul> 1253 * <li> <b>CAN:</b> 4.0 Hz 1254 * </ul> 1255 * 1256 * This refreshes and returns a cached StatusSignal object. 1257 * 1258 * @return VersionMinor Status Signal Object 1259 */ 1260 public StatusSignal<Integer> getVersionMinor() 1261 { 1262 return super.lookupStatusSignal(SpnValue.Version_Minor.value, Integer.class, "VersionMinor", false); 1263 } 1264 1265 /** 1266 * App Bugfix Version number. 1267 * 1268 * <ul> 1269 * <li> <b>Minimum Value:</b> 0 1270 * <li> <b>Maximum Value:</b> 255 1271 * <li> <b>Default Value:</b> 0 1272 * <li> <b>Units:</b> 1273 * </ul> 1274 * 1275 * Default Rates: 1276 * <ul> 1277 * <li> <b>CAN:</b> 4.0 Hz 1278 * </ul> 1279 * 1280 * This refreshes and returns a cached StatusSignal object. 1281 * 1282 * @return VersionBugfix Status Signal Object 1283 */ 1284 public StatusSignal<Integer> getVersionBugfix() 1285 { 1286 return super.lookupStatusSignal(SpnValue.Version_Bugfix.value, Integer.class, "VersionBugfix", false); 1287 } 1288 1289 /** 1290 * App Build Version number. 1291 * 1292 * <ul> 1293 * <li> <b>Minimum Value:</b> 0 1294 * <li> <b>Maximum Value:</b> 255 1295 * <li> <b>Default Value:</b> 0 1296 * <li> <b>Units:</b> 1297 * </ul> 1298 * 1299 * Default Rates: 1300 * <ul> 1301 * <li> <b>CAN:</b> 4.0 Hz 1302 * </ul> 1303 * 1304 * This refreshes and returns a cached StatusSignal object. 1305 * 1306 * @return VersionBuild Status Signal Object 1307 */ 1308 public StatusSignal<Integer> getVersionBuild() 1309 { 1310 return super.lookupStatusSignal(SpnValue.Version_Build.value, Integer.class, "VersionBuild", false); 1311 } 1312 1313 /** 1314 * Full Version. The format is a four byte value. 1315 * <p> 1316 * Full Version of firmware in device. The format is a four byte 1317 * value. 1318 * 1319 * <ul> 1320 * <li> <b>Minimum Value:</b> 0 1321 * <li> <b>Maximum Value:</b> 4294967295 1322 * <li> <b>Default Value:</b> 0 1323 * <li> <b>Units:</b> 1324 * </ul> 1325 * 1326 * Default Rates: 1327 * <ul> 1328 * <li> <b>CAN:</b> 4.0 Hz 1329 * </ul> 1330 * 1331 * This refreshes and returns a cached StatusSignal object. 1332 * 1333 * @return Version Status Signal Object 1334 */ 1335 public StatusSignal<Integer> getVersion() 1336 { 1337 return super.lookupStatusSignal(SpnValue.Version_Full.value, Integer.class, "Version", false); 1338 } 1339 1340 /** 1341 * Integer representing all faults 1342 * <p> 1343 * This returns the fault flags reported by the device. These are 1344 * device specific and are not used directly in typical applications. 1345 * Use the signal specific GetFault_*() methods instead. 1346 * 1347 * <ul> 1348 * <li> <b>Minimum Value:</b> 0 1349 * <li> <b>Maximum Value:</b> 16777215 1350 * <li> <b>Default Value:</b> 0 1351 * <li> <b>Units:</b> 1352 * </ul> 1353 * 1354 * Default Rates: 1355 * <ul> 1356 * <li> <b>CAN:</b> 4.0 Hz 1357 * </ul> 1358 * 1359 * This refreshes and returns a cached StatusSignal object. 1360 * 1361 * @return FaultField Status Signal Object 1362 */ 1363 public StatusSignal<Integer> getFaultField() 1364 { 1365 return super.lookupStatusSignal(SpnValue.AllFaults.value, Integer.class, "FaultField", true); 1366 } 1367 1368 /** 1369 * Integer representing all sticky faults 1370 * <p> 1371 * This returns the persistent "sticky" fault flags reported by the 1372 * device. These are device specific and are not used directly in 1373 * typical applications. Use the signal specific GetStickyFault_*() 1374 * methods instead. 1375 * 1376 * <ul> 1377 * <li> <b>Minimum Value:</b> 0 1378 * <li> <b>Maximum Value:</b> 16777215 1379 * <li> <b>Default Value:</b> 0 1380 * <li> <b>Units:</b> 1381 * </ul> 1382 * 1383 * Default Rates: 1384 * <ul> 1385 * <li> <b>CAN:</b> 4.0 Hz 1386 * </ul> 1387 * 1388 * This refreshes and returns a cached StatusSignal object. 1389 * 1390 * @return StickyFaultField Status Signal Object 1391 */ 1392 public StatusSignal<Integer> getStickyFaultField() 1393 { 1394 return super.lookupStatusSignal(SpnValue.AllStickyFaults.value, Integer.class, "StickyFaultField", true); 1395 } 1396 1397 /** 1398 * The applied (output) motor voltage. 1399 * 1400 * <ul> 1401 * <li> <b>Minimum Value:</b> -40.96 1402 * <li> <b>Maximum Value:</b> 40.95 1403 * <li> <b>Default Value:</b> 0 1404 * <li> <b>Units:</b> V 1405 * </ul> 1406 * 1407 * Default Rates: 1408 * <ul> 1409 * <li> <b>CAN 2.0:</b> 100.0 Hz 1410 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 1411 * </ul> 1412 * 1413 * This refreshes and returns a cached StatusSignal object. 1414 * 1415 * @return MotorVoltage Status Signal Object 1416 */ 1417 public StatusSignal<Double> getMotorVoltage() 1418 { 1419 return super.lookupStatusSignal(SpnValue.PRO_MotorOutput_MotorVoltage.value, Double.class, "MotorVoltage", true); 1420 } 1421 1422 /** 1423 * Forward Limit Pin. 1424 * 1425 * 1426 * Default Rates: 1427 * <ul> 1428 * <li> <b>CAN 2.0:</b> 100.0 Hz 1429 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 1430 * </ul> 1431 * 1432 * This refreshes and returns a cached StatusSignal object. 1433 * 1434 * @return ForwardLimit Status Signal Object 1435 */ 1436 public StatusSignal<ForwardLimitValue> getForwardLimit() 1437 { 1438 return super.lookupStatusSignal(SpnValue.ForwardLimit.value, ForwardLimitValue.class, "ForwardLimit", true); 1439 } 1440 1441 /** 1442 * Reverse Limit Pin. 1443 * 1444 * 1445 * Default Rates: 1446 * <ul> 1447 * <li> <b>CAN 2.0:</b> 100.0 Hz 1448 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 1449 * </ul> 1450 * 1451 * This refreshes and returns a cached StatusSignal object. 1452 * 1453 * @return ReverseLimit Status Signal Object 1454 */ 1455 public StatusSignal<ReverseLimitValue> getReverseLimit() 1456 { 1457 return super.lookupStatusSignal(SpnValue.ReverseLimit.value, ReverseLimitValue.class, "ReverseLimit", true); 1458 } 1459 1460 /** 1461 * The applied rotor polarity. This typically is determined by the 1462 * Inverted config, but can be overridden if using Follower features. 1463 * 1464 * 1465 * Default Rates: 1466 * <ul> 1467 * <li> <b>CAN 2.0:</b> 100.0 Hz 1468 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 1469 * </ul> 1470 * 1471 * This refreshes and returns a cached StatusSignal object. 1472 * 1473 * @return AppliedRotorPolarity Status Signal Object 1474 */ 1475 public StatusSignal<AppliedRotorPolarityValue> getAppliedRotorPolarity() 1476 { 1477 return super.lookupStatusSignal(SpnValue.PRO_MotorOutput_RotorPolarity.value, AppliedRotorPolarityValue.class, "AppliedRotorPolarity", true); 1478 } 1479 1480 /** 1481 * The applied motor duty cycle. 1482 * 1483 * <ul> 1484 * <li> <b>Minimum Value:</b> -2.0 1485 * <li> <b>Maximum Value:</b> 1.9990234375 1486 * <li> <b>Default Value:</b> 0 1487 * <li> <b>Units:</b> fractional 1488 * </ul> 1489 * 1490 * Default Rates: 1491 * <ul> 1492 * <li> <b>CAN 2.0:</b> 100.0 Hz 1493 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 1494 * </ul> 1495 * 1496 * This refreshes and returns a cached StatusSignal object. 1497 * 1498 * @return DutyCycle Status Signal Object 1499 */ 1500 public StatusSignal<Double> getDutyCycle() 1501 { 1502 return super.lookupStatusSignal(SpnValue.PRO_MotorOutput_DutyCycle.value, Double.class, "DutyCycle", true); 1503 } 1504 1505 /** 1506 * Current corresponding to the torque output by the motor. Similar to 1507 * StatorCurrent. Users will likely prefer this current to calculate 1508 * the applied torque to the rotor. 1509 * <p> 1510 * Stator current where positive current means torque is applied in 1511 * the forward direction as determined by the Inverted setting 1512 * 1513 * <ul> 1514 * <li> <b>Minimum Value:</b> -327.68 1515 * <li> <b>Maximum Value:</b> 327.67 1516 * <li> <b>Default Value:</b> 0 1517 * <li> <b>Units:</b> A 1518 * </ul> 1519 * 1520 * Default Rates: 1521 * <ul> 1522 * <li> <b>CAN 2.0:</b> 100.0 Hz 1523 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 1524 * </ul> 1525 * 1526 * This refreshes and returns a cached StatusSignal object. 1527 * 1528 * @return TorqueCurrent Status Signal Object 1529 */ 1530 public StatusSignal<Double> getTorqueCurrent() 1531 { 1532 return super.lookupStatusSignal(SpnValue.PRO_MotorOutput_TorqueCurrent.value, Double.class, "TorqueCurrent", true); 1533 } 1534 1535 /** 1536 * Current corresponding to the stator windings. Similar to 1537 * TorqueCurrent. Users will likely prefer TorqueCurrent over 1538 * StatorCurrent. 1539 * <p> 1540 * Stator current where Positive current indicates motoring regardless 1541 * of direction. Negative current indicates regenerative braking 1542 * regardless of direction. 1543 * 1544 * <ul> 1545 * <li> <b>Minimum Value:</b> -327.68 1546 * <li> <b>Maximum Value:</b> 327.66 1547 * <li> <b>Default Value:</b> 0 1548 * <li> <b>Units:</b> A 1549 * </ul> 1550 * 1551 * Default Rates: 1552 * <ul> 1553 * <li> <b>CAN 2.0:</b> 4.0 Hz 1554 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 1555 * </ul> 1556 * 1557 * This refreshes and returns a cached StatusSignal object. 1558 * 1559 * @return StatorCurrent Status Signal Object 1560 */ 1561 public StatusSignal<Double> getStatorCurrent() 1562 { 1563 return super.lookupStatusSignal(SpnValue.PRO_SupplyAndTemp_StatorCurrent.value, Double.class, "StatorCurrent", true); 1564 } 1565 1566 /** 1567 * Measured supply side current 1568 * 1569 * <ul> 1570 * <li> <b>Minimum Value:</b> -327.68 1571 * <li> <b>Maximum Value:</b> 327.66 1572 * <li> <b>Default Value:</b> 0 1573 * <li> <b>Units:</b> A 1574 * </ul> 1575 * 1576 * Default Rates: 1577 * <ul> 1578 * <li> <b>CAN 2.0:</b> 4.0 Hz 1579 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 1580 * </ul> 1581 * 1582 * This refreshes and returns a cached StatusSignal object. 1583 * 1584 * @return SupplyCurrent Status Signal Object 1585 */ 1586 public StatusSignal<Double> getSupplyCurrent() 1587 { 1588 return super.lookupStatusSignal(SpnValue.PRO_SupplyAndTemp_SupplyCurrent.value, Double.class, "SupplyCurrent", true); 1589 } 1590 1591 /** 1592 * Measured supply voltage to the TalonFX. 1593 * 1594 * <ul> 1595 * <li> <b>Minimum Value:</b> 4 1596 * <li> <b>Maximum Value:</b> 29.575 1597 * <li> <b>Default Value:</b> 4 1598 * <li> <b>Units:</b> V 1599 * </ul> 1600 * 1601 * Default Rates: 1602 * <ul> 1603 * <li> <b>CAN 2.0:</b> 4.0 Hz 1604 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 1605 * </ul> 1606 * 1607 * This refreshes and returns a cached StatusSignal object. 1608 * 1609 * @return SupplyVoltage Status Signal Object 1610 */ 1611 public StatusSignal<Double> getSupplyVoltage() 1612 { 1613 return super.lookupStatusSignal(SpnValue.PRO_SupplyAndTemp_SupplyVoltage.value, Double.class, "SupplyVoltage", true); 1614 } 1615 1616 /** 1617 * Temperature of device 1618 * <p> 1619 * This is the temperature that the device measures itself to be at. 1620 * Similar to Processor Temperature. 1621 * 1622 * <ul> 1623 * <li> <b>Minimum Value:</b> 0.0 1624 * <li> <b>Maximum Value:</b> 255.0 1625 * <li> <b>Default Value:</b> 0 1626 * <li> <b>Units:</b> ℃ 1627 * </ul> 1628 * 1629 * Default Rates: 1630 * <ul> 1631 * <li> <b>CAN 2.0:</b> 4.0 Hz 1632 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 1633 * </ul> 1634 * 1635 * This refreshes and returns a cached StatusSignal object. 1636 * 1637 * @return DeviceTemp Status Signal Object 1638 */ 1639 public StatusSignal<Double> getDeviceTemp() 1640 { 1641 return super.lookupStatusSignal(SpnValue.PRO_SupplyAndTemp_DeviceTemp.value, Double.class, "DeviceTemp", true); 1642 } 1643 1644 /** 1645 * Temperature of the processor 1646 * <p> 1647 * This is the temperature that the processor measures itself to be 1648 * at. Similar to Device Temperature. 1649 * 1650 * <ul> 1651 * <li> <b>Minimum Value:</b> 0.0 1652 * <li> <b>Maximum Value:</b> 255.0 1653 * <li> <b>Default Value:</b> 0 1654 * <li> <b>Units:</b> ℃ 1655 * </ul> 1656 * 1657 * Default Rates: 1658 * <ul> 1659 * <li> <b>CAN 2.0:</b> 4.0 Hz 1660 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 1661 * </ul> 1662 * 1663 * This refreshes and returns a cached StatusSignal object. 1664 * 1665 * @return ProcessorTemp Status Signal Object 1666 */ 1667 public StatusSignal<Double> getProcessorTemp() 1668 { 1669 return super.lookupStatusSignal(SpnValue.PRO_SupplyAndTemp_ProcessorTemp.value, Double.class, "ProcessorTemp", true); 1670 } 1671 1672 /** 1673 * Velocity of the motor rotor. This velocity is not affected by any 1674 * feedback configs. 1675 * 1676 * <ul> 1677 * <li> <b>Minimum Value:</b> -512.0 1678 * <li> <b>Maximum Value:</b> 511.998046875 1679 * <li> <b>Default Value:</b> 0 1680 * <li> <b>Units:</b> rotations per second 1681 * </ul> 1682 * 1683 * Default Rates: 1684 * <ul> 1685 * <li> <b>CAN 2.0:</b> 4.0 Hz 1686 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 1687 * </ul> 1688 * 1689 * This refreshes and returns a cached StatusSignal object. 1690 * 1691 * @return RotorVelocity Status Signal Object 1692 */ 1693 public StatusSignal<Double> getRotorVelocity() 1694 { 1695 return super.lookupStatusSignal(SpnValue.PRO_RotorPosAndVel_Velocity.value, Double.class, "RotorVelocity", true); 1696 } 1697 1698 /** 1699 * Position of the motor rotor. This position is only affected by the 1700 * RotorOffset config and calls to setPosition. 1701 * 1702 * <ul> 1703 * <li> <b>Minimum Value:</b> -16384.0 1704 * <li> <b>Maximum Value:</b> 16383.999755859375 1705 * <li> <b>Default Value:</b> 0 1706 * <li> <b>Units:</b> rotations 1707 * </ul> 1708 * 1709 * Default Rates: 1710 * <ul> 1711 * <li> <b>CAN 2.0:</b> 4.0 Hz 1712 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 1713 * </ul> 1714 * 1715 * This refreshes and returns a cached StatusSignal object. 1716 * 1717 * @return RotorPosition Status Signal Object 1718 */ 1719 public StatusSignal<Double> getRotorPosition() 1720 { 1721 return super.lookupStatusSignal(SpnValue.PRO_RotorPosAndVel_Position.value, Double.class, "RotorPosition", true); 1722 } 1723 1724 /** 1725 * Velocity of the device in mechanism rotations per second. This can 1726 * be the velocity of a remote sensor and is affected by the 1727 * RotorToSensorRatio and SensorToMechanismRatio configs. 1728 * 1729 * <ul> 1730 * <li> <b>Minimum Value:</b> -512.0 1731 * <li> <b>Maximum Value:</b> 511.998046875 1732 * <li> <b>Default Value:</b> 0 1733 * <li> <b>Units:</b> rotations per second 1734 * </ul> 1735 * 1736 * Default Rates: 1737 * <ul> 1738 * <li> <b>CAN 2.0:</b> 50.0 Hz 1739 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 1740 * </ul> 1741 * 1742 * This refreshes and returns a cached StatusSignal object. 1743 * 1744 * @return Velocity Status Signal Object 1745 */ 1746 public StatusSignal<Double> getVelocity() 1747 { 1748 return super.lookupStatusSignal(SpnValue.PRO_PosAndVel_Velocity.value, Double.class, "Velocity", true); 1749 } 1750 1751 /** 1752 * Position of the device in mechanism rotations. This can be the 1753 * position of a remote sensor and is affected by the 1754 * RotorToSensorRatio and SensorToMechanismRatio configs, as well as 1755 * calls to setPosition. 1756 * 1757 * <ul> 1758 * <li> <b>Minimum Value:</b> -16384.0 1759 * <li> <b>Maximum Value:</b> 16383.999755859375 1760 * <li> <b>Default Value:</b> 0 1761 * <li> <b>Units:</b> rotations 1762 * </ul> 1763 * 1764 * Default Rates: 1765 * <ul> 1766 * <li> <b>CAN 2.0:</b> 50.0 Hz 1767 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 1768 * </ul> 1769 * 1770 * This refreshes and returns a cached StatusSignal object. 1771 * 1772 * @return Position Status Signal Object 1773 */ 1774 public StatusSignal<Double> getPosition() 1775 { 1776 return super.lookupStatusSignal(SpnValue.PRO_PosAndVel_Position.value, Double.class, "Position", true); 1777 } 1778 1779 /** 1780 * Acceleration of the device in mechanism rotations per second². This 1781 * can be the acceleration of a remote sensor and is affected by the 1782 * RotorToSensorRatio and SensorToMechanismRatio configs. 1783 * 1784 * <ul> 1785 * <li> <b>Minimum Value:</b> -2048.0 1786 * <li> <b>Maximum Value:</b> 2047.75 1787 * <li> <b>Default Value:</b> 0 1788 * <li> <b>Units:</b> rotations per second² 1789 * </ul> 1790 * 1791 * Default Rates: 1792 * <ul> 1793 * <li> <b>CAN 2.0:</b> 50.0 Hz 1794 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 1795 * </ul> 1796 * 1797 * This refreshes and returns a cached StatusSignal object. 1798 * 1799 * @return Acceleration Status Signal Object 1800 */ 1801 public StatusSignal<Double> getAcceleration() 1802 { 1803 return super.lookupStatusSignal(SpnValue.PRO_PosAndVel_Acceleration.value, Double.class, "Acceleration", true); 1804 } 1805 1806 /** 1807 * The active control mode of the motor controller 1808 * 1809 * 1810 * Default Rates: 1811 * <ul> 1812 * <li> <b>CAN 2.0:</b> 4.0 Hz 1813 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 1814 * </ul> 1815 * 1816 * This refreshes and returns a cached StatusSignal object. 1817 * 1818 * @return ControlMode Status Signal Object 1819 */ 1820 public StatusSignal<ControlModeValue> getControlMode() 1821 { 1822 return super.lookupStatusSignal(SpnValue.TalonFX_ControlMode.value, ControlModeValue.class, "ControlMode", true); 1823 } 1824 1825 /** 1826 * Check if Motion Magic® is running. This is equivalent to checking 1827 * that the reported control mode is a Motion Magic® based mode. 1828 * 1829 * 1830 * Default Rates: 1831 * <ul> 1832 * <li> <b>CAN 2.0:</b> 4.0 Hz 1833 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 1834 * </ul> 1835 * 1836 * This refreshes and returns a cached StatusSignal object. 1837 * 1838 * @return MotionMagicIsRunning Status Signal Object 1839 */ 1840 public StatusSignal<MotionMagicIsRunningValue> getMotionMagicIsRunning() 1841 { 1842 return super.lookupStatusSignal(SpnValue.PRO_PIDStateEnables_IsMotionMagicRunning.value, MotionMagicIsRunningValue.class, "MotionMagicIsRunning", true); 1843 } 1844 1845 /** 1846 * Indicates if device is actuator enabled. 1847 * 1848 * 1849 * Default Rates: 1850 * <ul> 1851 * <li> <b>CAN 2.0:</b> 4.0 Hz 1852 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 1853 * </ul> 1854 * 1855 * This refreshes and returns a cached StatusSignal object. 1856 * 1857 * @return DeviceEnable Status Signal Object 1858 */ 1859 public StatusSignal<DeviceEnableValue> getDeviceEnable() 1860 { 1861 return super.lookupStatusSignal(SpnValue.PRO_PIDStateEnables_DeviceEnable.value, DeviceEnableValue.class, "DeviceEnable", true); 1862 } 1863 1864 /** 1865 * Closed loop slot in use 1866 * <p> 1867 * This is the slot that the closed loop PID is using. 1868 * 1869 * <ul> 1870 * <li> <b>Minimum Value:</b> 0 1871 * <li> <b>Maximum Value:</b> 2 1872 * <li> <b>Default Value:</b> 0 1873 * <li> <b>Units:</b> 1874 * </ul> 1875 * 1876 * Default Rates: 1877 * <ul> 1878 * <li> <b>CAN 2.0:</b> 4.0 Hz 1879 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 1880 * </ul> 1881 * 1882 * This refreshes and returns a cached StatusSignal object. 1883 * 1884 * @return ClosedLoopSlot Status Signal Object 1885 */ 1886 public StatusSignal<Integer> getClosedLoopSlot() 1887 { 1888 return super.lookupStatusSignal(SpnValue.PRO_PIDOutput_Slot.value, Integer.class, "ClosedLoopSlot", true); 1889 } 1890 1891 /** 1892 * The active control mode of the differential controller 1893 * 1894 * 1895 * Default Rates: 1896 * <ul> 1897 * <li> <b>CAN 2.0:</b> 100.0 Hz 1898 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 1899 * </ul> 1900 * 1901 * This refreshes and returns a cached StatusSignal object. 1902 * 1903 * @return DifferentialControlMode Status Signal Object 1904 */ 1905 public StatusSignal<DifferentialControlModeValue> getDifferentialControlMode() 1906 { 1907 return super.lookupStatusSignal(SpnValue.TalonFX_DifferentialControlMode.value, DifferentialControlModeValue.class, "DifferentialControlMode", true); 1908 } 1909 1910 /** 1911 * Average component of the differential velocity of device. 1912 * 1913 * <ul> 1914 * <li> <b>Minimum Value:</b> -512.0 1915 * <li> <b>Maximum Value:</b> 511.998046875 1916 * <li> <b>Default Value:</b> 0 1917 * <li> <b>Units:</b> rotations per second 1918 * </ul> 1919 * 1920 * Default Rates: 1921 * <ul> 1922 * <li> <b>CAN 2.0:</b> 4.0 Hz 1923 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 1924 * </ul> 1925 * 1926 * This refreshes and returns a cached StatusSignal object. 1927 * 1928 * @return DifferentialAverageVelocity Status Signal Object 1929 */ 1930 public StatusSignal<Double> getDifferentialAverageVelocity() 1931 { 1932 return super.lookupStatusSignal(SpnValue.PRO_AvgPosAndVel_Velocity.value, Double.class, "DifferentialAverageVelocity", true); 1933 } 1934 1935 /** 1936 * Average component of the differential position of device. 1937 * 1938 * <ul> 1939 * <li> <b>Minimum Value:</b> -16384.0 1940 * <li> <b>Maximum Value:</b> 16383.999755859375 1941 * <li> <b>Default Value:</b> 0 1942 * <li> <b>Units:</b> rotations 1943 * </ul> 1944 * 1945 * Default Rates: 1946 * <ul> 1947 * <li> <b>CAN 2.0:</b> 4.0 Hz 1948 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 1949 * </ul> 1950 * 1951 * This refreshes and returns a cached StatusSignal object. 1952 * 1953 * @return DifferentialAveragePosition Status Signal Object 1954 */ 1955 public StatusSignal<Double> getDifferentialAveragePosition() 1956 { 1957 return super.lookupStatusSignal(SpnValue.PRO_AvgPosAndVel_Position.value, Double.class, "DifferentialAveragePosition", true); 1958 } 1959 1960 /** 1961 * Difference component of the differential velocity of device. 1962 * 1963 * <ul> 1964 * <li> <b>Minimum Value:</b> -512.0 1965 * <li> <b>Maximum Value:</b> 511.998046875 1966 * <li> <b>Default Value:</b> 0 1967 * <li> <b>Units:</b> rotations per second 1968 * </ul> 1969 * 1970 * Default Rates: 1971 * <ul> 1972 * <li> <b>CAN 2.0:</b> 4.0 Hz 1973 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 1974 * </ul> 1975 * 1976 * This refreshes and returns a cached StatusSignal object. 1977 * 1978 * @return DifferentialDifferenceVelocity Status Signal Object 1979 */ 1980 public StatusSignal<Double> getDifferentialDifferenceVelocity() 1981 { 1982 return super.lookupStatusSignal(SpnValue.PRO_DiffPosAndVel_Velocity.value, Double.class, "DifferentialDifferenceVelocity", true); 1983 } 1984 1985 /** 1986 * Difference component of the differential position of device. 1987 * 1988 * <ul> 1989 * <li> <b>Minimum Value:</b> -16384.0 1990 * <li> <b>Maximum Value:</b> 16383.999755859375 1991 * <li> <b>Default Value:</b> 0 1992 * <li> <b>Units:</b> rotations 1993 * </ul> 1994 * 1995 * Default Rates: 1996 * <ul> 1997 * <li> <b>CAN 2.0:</b> 4.0 Hz 1998 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 1999 * </ul> 2000 * 2001 * This refreshes and returns a cached StatusSignal object. 2002 * 2003 * @return DifferentialDifferencePosition Status Signal Object 2004 */ 2005 public StatusSignal<Double> getDifferentialDifferencePosition() 2006 { 2007 return super.lookupStatusSignal(SpnValue.PRO_DiffPosAndVel_Position.value, Double.class, "DifferentialDifferencePosition", true); 2008 } 2009 2010 /** 2011 * Differential Closed loop slot in use 2012 * <p> 2013 * This is the slot that the closed loop differential PID is using. 2014 * 2015 * <ul> 2016 * <li> <b>Minimum Value:</b> 0 2017 * <li> <b>Maximum Value:</b> 2 2018 * <li> <b>Default Value:</b> 0 2019 * <li> <b>Units:</b> 2020 * </ul> 2021 * 2022 * Default Rates: 2023 * <ul> 2024 * <li> <b>CAN 2.0:</b> 4.0 Hz 2025 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 2026 * </ul> 2027 * 2028 * This refreshes and returns a cached StatusSignal object. 2029 * 2030 * @return DifferentialClosedLoopSlot Status Signal Object 2031 */ 2032 public StatusSignal<Integer> getDifferentialClosedLoopSlot() 2033 { 2034 return super.lookupStatusSignal(SpnValue.PRO_DiffPIDOutput_Slot.value, Integer.class, "DifferentialClosedLoopSlot", true); 2035 } 2036 2037 /** 2038 * The applied output of the bridge. 2039 * 2040 * 2041 * Default Rates: 2042 * <ul> 2043 * <li> <b>CAN 2.0:</b> 100.0 Hz 2044 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 2045 * </ul> 2046 * 2047 * This refreshes and returns a cached StatusSignal object. 2048 * 2049 * @return BridgeOutput Status Signal Object 2050 */ 2051 public StatusSignal<BridgeOutputValue> getBridgeOutput() 2052 { 2053 return super.lookupStatusSignal(SpnValue.PRO_MotorOutput_BridgeType_Public.value, BridgeOutputValue.class, "BridgeOutput", true); 2054 } 2055 2056 /** 2057 * Whether the device is Phoenix Pro licensed. 2058 * 2059 * <ul> 2060 * <li> <b>Default Value:</b> False 2061 * </ul> 2062 * 2063 * Default Rates: 2064 * <ul> 2065 * <li> <b>CAN:</b> 4.0 Hz 2066 * </ul> 2067 * 2068 * This refreshes and returns a cached StatusSignal object. 2069 * 2070 * @return IsProLicensed Status Signal Object 2071 */ 2072 public StatusSignal<Boolean> getIsProLicensed() 2073 { 2074 return super.lookupStatusSignal(SpnValue.Version_IsProLicensed.value, Boolean.class, "IsProLicensed", true); 2075 } 2076 2077 /** 2078 * Temperature of device from second sensor 2079 * <p> 2080 * Newer versions of Talon FX have multiple temperature measurement 2081 * methods. 2082 * 2083 * <ul> 2084 * <li> <b>Minimum Value:</b> 0.0 2085 * <li> <b>Maximum Value:</b> 255.0 2086 * <li> <b>Default Value:</b> 0 2087 * <li> <b>Units:</b> ℃ 2088 * </ul> 2089 * 2090 * Default Rates: 2091 * <ul> 2092 * <li> <b>CAN 2.0:</b> 4.0 Hz 2093 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 2094 * </ul> 2095 * 2096 * This refreshes and returns a cached StatusSignal object. 2097 * 2098 * @return AncillaryDeviceTemp Status Signal Object 2099 */ 2100 public StatusSignal<Double> getAncillaryDeviceTemp() 2101 { 2102 return super.lookupStatusSignal(SpnValue.PRO_SupplyAndTemp_DeviceTemp2.value, Double.class, "AncillaryDeviceTemp", true); 2103 } 2104 2105 /** 2106 * The type of motor attached to the Talon FX 2107 * <p> 2108 * This can be used to determine what motor is attached to the Talon 2109 * FX. Return will be "Unknown" if firmware is too old or device is 2110 * not present. 2111 * 2112 * 2113 * Default Rates: 2114 * <ul> 2115 * <li> <b>CAN 2.0:</b> 4.0 Hz 2116 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 2117 * </ul> 2118 * 2119 * This refreshes and returns a cached StatusSignal object. 2120 * 2121 * @return MotorType Status Signal Object 2122 */ 2123 public StatusSignal<MotorTypeValue> getMotorType() 2124 { 2125 return super.lookupStatusSignal(SpnValue.TalonFX_MotorType.value, MotorTypeValue.class, "MotorType", true); 2126 } 2127 2128 /** 2129 * Assess the status of the motor output with respect to load and 2130 * supply. 2131 * <p> 2132 * This routine can be used to determine the general status of motor 2133 * commutation. Off means that motor output is disabled. 2134 * StaticBraking typically means the motor is in neutral-brake. 2135 * Motoring means motor is loaded in a typical fashion, drawing 2136 * current from the supply, and successfully turning the rotor in the 2137 * direction of applied voltage. Discordant Motoring is the same as 2138 * Motoring, expect the rotor is being backdriven as the motor output 2139 * is not enough to defeat load forces. RegenBraking means the motor 2140 * is braking in such a way where motor current is traveling back to 2141 * the supply (typically a battery). 2142 * 2143 * 2144 * Default Rates: 2145 * <ul> 2146 * <li> <b>CAN 2.0:</b> 4.0 Hz 2147 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 2148 * </ul> 2149 * 2150 * This refreshes and returns a cached StatusSignal object. 2151 * 2152 * @return MotorOutputStatus Status Signal Object 2153 */ 2154 public StatusSignal<MotorOutputStatusValue> getMotorOutputStatus() 2155 { 2156 return super.lookupStatusSignal(SpnValue.TalonFX_MotorOutputStatus.value, MotorOutputStatusValue.class, "MotorOutputStatus", true); 2157 } 2158 2159 /** 2160 * Hardware fault occurred 2161 * 2162 * <ul> 2163 * <li> <b>Default Value:</b> False 2164 * </ul> 2165 * 2166 * Default Rates: 2167 * <ul> 2168 * <li> <b>CAN:</b> 4.0 Hz 2169 * </ul> 2170 * 2171 * This refreshes and returns a cached StatusSignal object. 2172 * 2173 * @return Fault_Hardware Status Signal Object 2174 */ 2175 public StatusSignal<Boolean> getFault_Hardware() 2176 { 2177 return super.lookupStatusSignal(SpnValue.Fault_Hardware.value, Boolean.class, "Fault_Hardware", true); 2178 } 2179 2180 /** 2181 * Hardware fault occurred 2182 * 2183 * <ul> 2184 * <li> <b>Default Value:</b> False 2185 * </ul> 2186 * 2187 * Default Rates: 2188 * <ul> 2189 * <li> <b>CAN:</b> 4.0 Hz 2190 * </ul> 2191 * 2192 * This refreshes and returns a cached StatusSignal object. 2193 * 2194 * @return StickyFault_Hardware Status Signal Object 2195 */ 2196 public StatusSignal<Boolean> getStickyFault_Hardware() 2197 { 2198 return super.lookupStatusSignal(SpnValue.StickyFault_Hardware.value, Boolean.class, "StickyFault_Hardware", true); 2199 } 2200 2201 /** 2202 * Processor temperature exceeded limit 2203 * 2204 * <ul> 2205 * <li> <b>Default Value:</b> False 2206 * </ul> 2207 * 2208 * Default Rates: 2209 * <ul> 2210 * <li> <b>CAN:</b> 4.0 Hz 2211 * </ul> 2212 * 2213 * This refreshes and returns a cached StatusSignal object. 2214 * 2215 * @return Fault_ProcTemp Status Signal Object 2216 */ 2217 public StatusSignal<Boolean> getFault_ProcTemp() 2218 { 2219 return super.lookupStatusSignal(SpnValue.Fault_ProcTemp.value, Boolean.class, "Fault_ProcTemp", true); 2220 } 2221 2222 /** 2223 * Processor temperature exceeded limit 2224 * 2225 * <ul> 2226 * <li> <b>Default Value:</b> False 2227 * </ul> 2228 * 2229 * Default Rates: 2230 * <ul> 2231 * <li> <b>CAN:</b> 4.0 Hz 2232 * </ul> 2233 * 2234 * This refreshes and returns a cached StatusSignal object. 2235 * 2236 * @return StickyFault_ProcTemp Status Signal Object 2237 */ 2238 public StatusSignal<Boolean> getStickyFault_ProcTemp() 2239 { 2240 return super.lookupStatusSignal(SpnValue.StickyFault_ProcTemp.value, Boolean.class, "StickyFault_ProcTemp", true); 2241 } 2242 2243 /** 2244 * Device temperature exceeded limit 2245 * 2246 * <ul> 2247 * <li> <b>Default Value:</b> False 2248 * </ul> 2249 * 2250 * Default Rates: 2251 * <ul> 2252 * <li> <b>CAN:</b> 4.0 Hz 2253 * </ul> 2254 * 2255 * This refreshes and returns a cached StatusSignal object. 2256 * 2257 * @return Fault_DeviceTemp Status Signal Object 2258 */ 2259 public StatusSignal<Boolean> getFault_DeviceTemp() 2260 { 2261 return super.lookupStatusSignal(SpnValue.Fault_DeviceTemp.value, Boolean.class, "Fault_DeviceTemp", true); 2262 } 2263 2264 /** 2265 * Device temperature exceeded limit 2266 * 2267 * <ul> 2268 * <li> <b>Default Value:</b> False 2269 * </ul> 2270 * 2271 * Default Rates: 2272 * <ul> 2273 * <li> <b>CAN:</b> 4.0 Hz 2274 * </ul> 2275 * 2276 * This refreshes and returns a cached StatusSignal object. 2277 * 2278 * @return StickyFault_DeviceTemp Status Signal Object 2279 */ 2280 public StatusSignal<Boolean> getStickyFault_DeviceTemp() 2281 { 2282 return super.lookupStatusSignal(SpnValue.StickyFault_DeviceTemp.value, Boolean.class, "StickyFault_DeviceTemp", true); 2283 } 2284 2285 /** 2286 * Device supply voltage dropped to near brownout levels 2287 * 2288 * <ul> 2289 * <li> <b>Default Value:</b> False 2290 * </ul> 2291 * 2292 * Default Rates: 2293 * <ul> 2294 * <li> <b>CAN:</b> 4.0 Hz 2295 * </ul> 2296 * 2297 * This refreshes and returns a cached StatusSignal object. 2298 * 2299 * @return Fault_Undervoltage Status Signal Object 2300 */ 2301 public StatusSignal<Boolean> getFault_Undervoltage() 2302 { 2303 return super.lookupStatusSignal(SpnValue.Fault_Undervoltage.value, Boolean.class, "Fault_Undervoltage", true); 2304 } 2305 2306 /** 2307 * Device supply voltage dropped to near brownout levels 2308 * 2309 * <ul> 2310 * <li> <b>Default Value:</b> False 2311 * </ul> 2312 * 2313 * Default Rates: 2314 * <ul> 2315 * <li> <b>CAN:</b> 4.0 Hz 2316 * </ul> 2317 * 2318 * This refreshes and returns a cached StatusSignal object. 2319 * 2320 * @return StickyFault_Undervoltage Status Signal Object 2321 */ 2322 public StatusSignal<Boolean> getStickyFault_Undervoltage() 2323 { 2324 return super.lookupStatusSignal(SpnValue.StickyFault_Undervoltage.value, Boolean.class, "StickyFault_Undervoltage", true); 2325 } 2326 2327 /** 2328 * Device boot while detecting the enable signal 2329 * 2330 * <ul> 2331 * <li> <b>Default Value:</b> False 2332 * </ul> 2333 * 2334 * Default Rates: 2335 * <ul> 2336 * <li> <b>CAN:</b> 4.0 Hz 2337 * </ul> 2338 * 2339 * This refreshes and returns a cached StatusSignal object. 2340 * 2341 * @return Fault_BootDuringEnable Status Signal Object 2342 */ 2343 public StatusSignal<Boolean> getFault_BootDuringEnable() 2344 { 2345 return super.lookupStatusSignal(SpnValue.Fault_BootDuringEnable.value, Boolean.class, "Fault_BootDuringEnable", true); 2346 } 2347 2348 /** 2349 * Device boot while detecting the enable signal 2350 * 2351 * <ul> 2352 * <li> <b>Default Value:</b> False 2353 * </ul> 2354 * 2355 * Default Rates: 2356 * <ul> 2357 * <li> <b>CAN:</b> 4.0 Hz 2358 * </ul> 2359 * 2360 * This refreshes and returns a cached StatusSignal object. 2361 * 2362 * @return StickyFault_BootDuringEnable Status Signal Object 2363 */ 2364 public StatusSignal<Boolean> getStickyFault_BootDuringEnable() 2365 { 2366 return super.lookupStatusSignal(SpnValue.StickyFault_BootDuringEnable.value, Boolean.class, "StickyFault_BootDuringEnable", true); 2367 } 2368 2369 /** 2370 * An unlicensed feature is in use, device may not behave as expected. 2371 * 2372 * <ul> 2373 * <li> <b>Default Value:</b> False 2374 * </ul> 2375 * 2376 * Default Rates: 2377 * <ul> 2378 * <li> <b>CAN:</b> 4.0 Hz 2379 * </ul> 2380 * 2381 * This refreshes and returns a cached StatusSignal object. 2382 * 2383 * @return Fault_UnlicensedFeatureInUse Status Signal Object 2384 */ 2385 public StatusSignal<Boolean> getFault_UnlicensedFeatureInUse() 2386 { 2387 return super.lookupStatusSignal(SpnValue.Fault_UnlicensedFeatureInUse.value, Boolean.class, "Fault_UnlicensedFeatureInUse", true); 2388 } 2389 2390 /** 2391 * An unlicensed feature is in use, device may not behave as expected. 2392 * 2393 * <ul> 2394 * <li> <b>Default Value:</b> False 2395 * </ul> 2396 * 2397 * Default Rates: 2398 * <ul> 2399 * <li> <b>CAN:</b> 4.0 Hz 2400 * </ul> 2401 * 2402 * This refreshes and returns a cached StatusSignal object. 2403 * 2404 * @return StickyFault_UnlicensedFeatureInUse Status Signal Object 2405 */ 2406 public StatusSignal<Boolean> getStickyFault_UnlicensedFeatureInUse() 2407 { 2408 return super.lookupStatusSignal(SpnValue.StickyFault_UnlicensedFeatureInUse.value, Boolean.class, "StickyFault_UnlicensedFeatureInUse", true); 2409 } 2410 2411 /** 2412 * Bridge was disabled most likely due to supply voltage dropping too 2413 * low. 2414 * 2415 * <ul> 2416 * <li> <b>Default Value:</b> False 2417 * </ul> 2418 * 2419 * Default Rates: 2420 * <ul> 2421 * <li> <b>CAN:</b> 4.0 Hz 2422 * </ul> 2423 * 2424 * This refreshes and returns a cached StatusSignal object. 2425 * 2426 * @return Fault_BridgeBrownout Status Signal Object 2427 */ 2428 public StatusSignal<Boolean> getFault_BridgeBrownout() 2429 { 2430 return super.lookupStatusSignal(SpnValue.Fault_TALONFX_BridgeBrownout.value, Boolean.class, "Fault_BridgeBrownout", true); 2431 } 2432 2433 /** 2434 * Bridge was disabled most likely due to supply voltage dropping too 2435 * low. 2436 * 2437 * <ul> 2438 * <li> <b>Default Value:</b> False 2439 * </ul> 2440 * 2441 * Default Rates: 2442 * <ul> 2443 * <li> <b>CAN:</b> 4.0 Hz 2444 * </ul> 2445 * 2446 * This refreshes and returns a cached StatusSignal object. 2447 * 2448 * @return StickyFault_BridgeBrownout Status Signal Object 2449 */ 2450 public StatusSignal<Boolean> getStickyFault_BridgeBrownout() 2451 { 2452 return super.lookupStatusSignal(SpnValue.StickyFault_TALONFX_BridgeBrownout.value, Boolean.class, "StickyFault_BridgeBrownout", true); 2453 } 2454 2455 /** 2456 * The remote sensor has reset. 2457 * 2458 * <ul> 2459 * <li> <b>Default Value:</b> False 2460 * </ul> 2461 * 2462 * Default Rates: 2463 * <ul> 2464 * <li> <b>CAN:</b> 4.0 Hz 2465 * </ul> 2466 * 2467 * This refreshes and returns a cached StatusSignal object. 2468 * 2469 * @return Fault_RemoteSensorReset Status Signal Object 2470 */ 2471 public StatusSignal<Boolean> getFault_RemoteSensorReset() 2472 { 2473 return super.lookupStatusSignal(SpnValue.Fault_TALONFX_RemoteSensorReset.value, Boolean.class, "Fault_RemoteSensorReset", true); 2474 } 2475 2476 /** 2477 * The remote sensor has reset. 2478 * 2479 * <ul> 2480 * <li> <b>Default Value:</b> False 2481 * </ul> 2482 * 2483 * Default Rates: 2484 * <ul> 2485 * <li> <b>CAN:</b> 4.0 Hz 2486 * </ul> 2487 * 2488 * This refreshes and returns a cached StatusSignal object. 2489 * 2490 * @return StickyFault_RemoteSensorReset Status Signal Object 2491 */ 2492 public StatusSignal<Boolean> getStickyFault_RemoteSensorReset() 2493 { 2494 return super.lookupStatusSignal(SpnValue.StickyFault_TALONFX_RemoteSensorReset.value, Boolean.class, "StickyFault_RemoteSensorReset", true); 2495 } 2496 2497 /** 2498 * The remote Talon FX used for differential control is not present on 2499 * CAN Bus. 2500 * 2501 * <ul> 2502 * <li> <b>Default Value:</b> False 2503 * </ul> 2504 * 2505 * Default Rates: 2506 * <ul> 2507 * <li> <b>CAN:</b> 4.0 Hz 2508 * </ul> 2509 * 2510 * This refreshes and returns a cached StatusSignal object. 2511 * 2512 * @return Fault_MissingDifferentialFX Status Signal Object 2513 */ 2514 public StatusSignal<Boolean> getFault_MissingDifferentialFX() 2515 { 2516 return super.lookupStatusSignal(SpnValue.Fault_TALONFX_MissingDifferentialFX.value, Boolean.class, "Fault_MissingDifferentialFX", true); 2517 } 2518 2519 /** 2520 * The remote Talon FX used for differential control is not present on 2521 * CAN Bus. 2522 * 2523 * <ul> 2524 * <li> <b>Default Value:</b> False 2525 * </ul> 2526 * 2527 * Default Rates: 2528 * <ul> 2529 * <li> <b>CAN:</b> 4.0 Hz 2530 * </ul> 2531 * 2532 * This refreshes and returns a cached StatusSignal object. 2533 * 2534 * @return StickyFault_MissingDifferentialFX Status Signal Object 2535 */ 2536 public StatusSignal<Boolean> getStickyFault_MissingDifferentialFX() 2537 { 2538 return super.lookupStatusSignal(SpnValue.StickyFault_TALONFX_MissingDifferentialFX.value, Boolean.class, "StickyFault_MissingDifferentialFX", true); 2539 } 2540 2541 /** 2542 * The remote sensor position has overflowed. Because of the nature of 2543 * remote sensors, it is possible for the remote sensor position to 2544 * overflow beyond what is supported by the status signal frame. 2545 * However, this is rare and cannot occur over the course of an FRC 2546 * match under normal use. 2547 * 2548 * <ul> 2549 * <li> <b>Default Value:</b> False 2550 * </ul> 2551 * 2552 * Default Rates: 2553 * <ul> 2554 * <li> <b>CAN:</b> 4.0 Hz 2555 * </ul> 2556 * 2557 * This refreshes and returns a cached StatusSignal object. 2558 * 2559 * @return Fault_RemoteSensorPosOverflow Status Signal Object 2560 */ 2561 public StatusSignal<Boolean> getFault_RemoteSensorPosOverflow() 2562 { 2563 return super.lookupStatusSignal(SpnValue.Fault_TALONFX_RemoteSensorPosOverflow.value, Boolean.class, "Fault_RemoteSensorPosOverflow", true); 2564 } 2565 2566 /** 2567 * The remote sensor position has overflowed. Because of the nature of 2568 * remote sensors, it is possible for the remote sensor position to 2569 * overflow beyond what is supported by the status signal frame. 2570 * However, this is rare and cannot occur over the course of an FRC 2571 * match under normal use. 2572 * 2573 * <ul> 2574 * <li> <b>Default Value:</b> False 2575 * </ul> 2576 * 2577 * Default Rates: 2578 * <ul> 2579 * <li> <b>CAN:</b> 4.0 Hz 2580 * </ul> 2581 * 2582 * This refreshes and returns a cached StatusSignal object. 2583 * 2584 * @return StickyFault_RemoteSensorPosOverflow Status Signal Object 2585 */ 2586 public StatusSignal<Boolean> getStickyFault_RemoteSensorPosOverflow() 2587 { 2588 return super.lookupStatusSignal(SpnValue.StickyFault_TALONFX_RemoteSensorPosOverflow.value, Boolean.class, "StickyFault_RemoteSensorPosOverflow", true); 2589 } 2590 2591 /** 2592 * Supply Voltage has exceeded the maximum voltage rating of device. 2593 * 2594 * <ul> 2595 * <li> <b>Default Value:</b> False 2596 * </ul> 2597 * 2598 * Default Rates: 2599 * <ul> 2600 * <li> <b>CAN:</b> 4.0 Hz 2601 * </ul> 2602 * 2603 * This refreshes and returns a cached StatusSignal object. 2604 * 2605 * @return Fault_OverSupplyV Status Signal Object 2606 */ 2607 public StatusSignal<Boolean> getFault_OverSupplyV() 2608 { 2609 return super.lookupStatusSignal(SpnValue.Fault_TALONFX_OverSupplyV.value, Boolean.class, "Fault_OverSupplyV", true); 2610 } 2611 2612 /** 2613 * Supply Voltage has exceeded the maximum voltage rating of device. 2614 * 2615 * <ul> 2616 * <li> <b>Default Value:</b> False 2617 * </ul> 2618 * 2619 * Default Rates: 2620 * <ul> 2621 * <li> <b>CAN:</b> 4.0 Hz 2622 * </ul> 2623 * 2624 * This refreshes and returns a cached StatusSignal object. 2625 * 2626 * @return StickyFault_OverSupplyV Status Signal Object 2627 */ 2628 public StatusSignal<Boolean> getStickyFault_OverSupplyV() 2629 { 2630 return super.lookupStatusSignal(SpnValue.StickyFault_TALONFX_OverSupplyV.value, Boolean.class, "StickyFault_OverSupplyV", true); 2631 } 2632 2633 /** 2634 * Supply Voltage is unstable. Ensure you are using a battery and 2635 * current limited power supply. 2636 * 2637 * <ul> 2638 * <li> <b>Default Value:</b> False 2639 * </ul> 2640 * 2641 * Default Rates: 2642 * <ul> 2643 * <li> <b>CAN:</b> 4.0 Hz 2644 * </ul> 2645 * 2646 * This refreshes and returns a cached StatusSignal object. 2647 * 2648 * @return Fault_UnstableSupplyV Status Signal Object 2649 */ 2650 public StatusSignal<Boolean> getFault_UnstableSupplyV() 2651 { 2652 return super.lookupStatusSignal(SpnValue.Fault_TALONFX_UnstableSupplyV.value, Boolean.class, "Fault_UnstableSupplyV", true); 2653 } 2654 2655 /** 2656 * Supply Voltage is unstable. Ensure you are using a battery and 2657 * current limited power supply. 2658 * 2659 * <ul> 2660 * <li> <b>Default Value:</b> False 2661 * </ul> 2662 * 2663 * Default Rates: 2664 * <ul> 2665 * <li> <b>CAN:</b> 4.0 Hz 2666 * </ul> 2667 * 2668 * This refreshes and returns a cached StatusSignal object. 2669 * 2670 * @return StickyFault_UnstableSupplyV Status Signal Object 2671 */ 2672 public StatusSignal<Boolean> getStickyFault_UnstableSupplyV() 2673 { 2674 return super.lookupStatusSignal(SpnValue.StickyFault_TALONFX_UnstableSupplyV.value, Boolean.class, "StickyFault_UnstableSupplyV", true); 2675 } 2676 2677 /** 2678 * Reverse limit switch has been asserted. Output is set to neutral. 2679 * 2680 * <ul> 2681 * <li> <b>Default Value:</b> False 2682 * </ul> 2683 * 2684 * Default Rates: 2685 * <ul> 2686 * <li> <b>CAN:</b> 4.0 Hz 2687 * </ul> 2688 * 2689 * This refreshes and returns a cached StatusSignal object. 2690 * 2691 * @return Fault_ReverseHardLimit Status Signal Object 2692 */ 2693 public StatusSignal<Boolean> getFault_ReverseHardLimit() 2694 { 2695 return super.lookupStatusSignal(SpnValue.Fault_TALONFX_ReverseHardLimit.value, Boolean.class, "Fault_ReverseHardLimit", true); 2696 } 2697 2698 /** 2699 * Reverse limit switch has been asserted. Output is set to neutral. 2700 * 2701 * <ul> 2702 * <li> <b>Default Value:</b> False 2703 * </ul> 2704 * 2705 * Default Rates: 2706 * <ul> 2707 * <li> <b>CAN:</b> 4.0 Hz 2708 * </ul> 2709 * 2710 * This refreshes and returns a cached StatusSignal object. 2711 * 2712 * @return StickyFault_ReverseHardLimit Status Signal Object 2713 */ 2714 public StatusSignal<Boolean> getStickyFault_ReverseHardLimit() 2715 { 2716 return super.lookupStatusSignal(SpnValue.StickyFault_TALONFX_ReverseHardLimit.value, Boolean.class, "StickyFault_ReverseHardLimit", true); 2717 } 2718 2719 /** 2720 * Forward limit switch has been asserted. Output is set to neutral. 2721 * 2722 * <ul> 2723 * <li> <b>Default Value:</b> False 2724 * </ul> 2725 * 2726 * Default Rates: 2727 * <ul> 2728 * <li> <b>CAN:</b> 4.0 Hz 2729 * </ul> 2730 * 2731 * This refreshes and returns a cached StatusSignal object. 2732 * 2733 * @return Fault_ForwardHardLimit Status Signal Object 2734 */ 2735 public StatusSignal<Boolean> getFault_ForwardHardLimit() 2736 { 2737 return super.lookupStatusSignal(SpnValue.Fault_TALONFX_ForwardHardLimit.value, Boolean.class, "Fault_ForwardHardLimit", true); 2738 } 2739 2740 /** 2741 * Forward limit switch has been asserted. Output is set to neutral. 2742 * 2743 * <ul> 2744 * <li> <b>Default Value:</b> False 2745 * </ul> 2746 * 2747 * Default Rates: 2748 * <ul> 2749 * <li> <b>CAN:</b> 4.0 Hz 2750 * </ul> 2751 * 2752 * This refreshes and returns a cached StatusSignal object. 2753 * 2754 * @return StickyFault_ForwardHardLimit Status Signal Object 2755 */ 2756 public StatusSignal<Boolean> getStickyFault_ForwardHardLimit() 2757 { 2758 return super.lookupStatusSignal(SpnValue.StickyFault_TALONFX_ForwardHardLimit.value, Boolean.class, "StickyFault_ForwardHardLimit", true); 2759 } 2760 2761 /** 2762 * Reverse soft limit has been asserted. Output is set to neutral. 2763 * 2764 * <ul> 2765 * <li> <b>Default Value:</b> False 2766 * </ul> 2767 * 2768 * Default Rates: 2769 * <ul> 2770 * <li> <b>CAN:</b> 4.0 Hz 2771 * </ul> 2772 * 2773 * This refreshes and returns a cached StatusSignal object. 2774 * 2775 * @return Fault_ReverseSoftLimit Status Signal Object 2776 */ 2777 public StatusSignal<Boolean> getFault_ReverseSoftLimit() 2778 { 2779 return super.lookupStatusSignal(SpnValue.Fault_TALONFX_ReverseSoftLimit.value, Boolean.class, "Fault_ReverseSoftLimit", true); 2780 } 2781 2782 /** 2783 * Reverse soft limit has been asserted. Output is set to neutral. 2784 * 2785 * <ul> 2786 * <li> <b>Default Value:</b> False 2787 * </ul> 2788 * 2789 * Default Rates: 2790 * <ul> 2791 * <li> <b>CAN:</b> 4.0 Hz 2792 * </ul> 2793 * 2794 * This refreshes and returns a cached StatusSignal object. 2795 * 2796 * @return StickyFault_ReverseSoftLimit Status Signal Object 2797 */ 2798 public StatusSignal<Boolean> getStickyFault_ReverseSoftLimit() 2799 { 2800 return super.lookupStatusSignal(SpnValue.StickyFault_TALONFX_ReverseSoftLimit.value, Boolean.class, "StickyFault_ReverseSoftLimit", true); 2801 } 2802 2803 /** 2804 * Forward soft limit has been asserted. Output is set to neutral. 2805 * 2806 * <ul> 2807 * <li> <b>Default Value:</b> False 2808 * </ul> 2809 * 2810 * Default Rates: 2811 * <ul> 2812 * <li> <b>CAN:</b> 4.0 Hz 2813 * </ul> 2814 * 2815 * This refreshes and returns a cached StatusSignal object. 2816 * 2817 * @return Fault_ForwardSoftLimit Status Signal Object 2818 */ 2819 public StatusSignal<Boolean> getFault_ForwardSoftLimit() 2820 { 2821 return super.lookupStatusSignal(SpnValue.Fault_TALONFX_ForwardSoftLimit.value, Boolean.class, "Fault_ForwardSoftLimit", true); 2822 } 2823 2824 /** 2825 * Forward soft limit has been asserted. Output is set to neutral. 2826 * 2827 * <ul> 2828 * <li> <b>Default Value:</b> False 2829 * </ul> 2830 * 2831 * Default Rates: 2832 * <ul> 2833 * <li> <b>CAN:</b> 4.0 Hz 2834 * </ul> 2835 * 2836 * This refreshes and returns a cached StatusSignal object. 2837 * 2838 * @return StickyFault_ForwardSoftLimit Status Signal Object 2839 */ 2840 public StatusSignal<Boolean> getStickyFault_ForwardSoftLimit() 2841 { 2842 return super.lookupStatusSignal(SpnValue.StickyFault_TALONFX_ForwardSoftLimit.value, Boolean.class, "StickyFault_ForwardSoftLimit", true); 2843 } 2844 2845 /** 2846 * The remote sensor's data is no longer trusted. This can happen if 2847 * the remote sensor disappears from the CAN bus or if the remote 2848 * sensor indicates its data is no longer valid, such as when a 2849 * CANcoder's magnet strength falls into the "red" range. 2850 * 2851 * <ul> 2852 * <li> <b>Default Value:</b> False 2853 * </ul> 2854 * 2855 * Default Rates: 2856 * <ul> 2857 * <li> <b>CAN:</b> 4.0 Hz 2858 * </ul> 2859 * 2860 * This refreshes and returns a cached StatusSignal object. 2861 * 2862 * @return Fault_RemoteSensorDataInvalid Status Signal Object 2863 */ 2864 public StatusSignal<Boolean> getFault_RemoteSensorDataInvalid() 2865 { 2866 return super.lookupStatusSignal(SpnValue.Fault_TALONFX_MissingRemoteSensor.value, Boolean.class, "Fault_RemoteSensorDataInvalid", true); 2867 } 2868 2869 /** 2870 * The remote sensor's data is no longer trusted. This can happen if 2871 * the remote sensor disappears from the CAN bus or if the remote 2872 * sensor indicates its data is no longer valid, such as when a 2873 * CANcoder's magnet strength falls into the "red" range. 2874 * 2875 * <ul> 2876 * <li> <b>Default Value:</b> False 2877 * </ul> 2878 * 2879 * Default Rates: 2880 * <ul> 2881 * <li> <b>CAN:</b> 4.0 Hz 2882 * </ul> 2883 * 2884 * This refreshes and returns a cached StatusSignal object. 2885 * 2886 * @return StickyFault_RemoteSensorDataInvalid Status Signal Object 2887 */ 2888 public StatusSignal<Boolean> getStickyFault_RemoteSensorDataInvalid() 2889 { 2890 return super.lookupStatusSignal(SpnValue.StickyFault_TALONFX_MissingRemoteSensor.value, Boolean.class, "StickyFault_RemoteSensorDataInvalid", true); 2891 } 2892 2893 /** 2894 * The remote sensor used for fusion has fallen out of sync to the 2895 * local sensor. A re-synchronization has occurred, which may cause a 2896 * discontinuity. This typically happens if there is significant slop 2897 * in the mechanism, or if the RotorToSensorRatio configuration 2898 * parameter is incorrect. 2899 * 2900 * <ul> 2901 * <li> <b>Default Value:</b> False 2902 * </ul> 2903 * 2904 * Default Rates: 2905 * <ul> 2906 * <li> <b>CAN:</b> 4.0 Hz 2907 * </ul> 2908 * 2909 * This refreshes and returns a cached StatusSignal object. 2910 * 2911 * @return Fault_FusedSensorOutOfSync Status Signal Object 2912 */ 2913 public StatusSignal<Boolean> getFault_FusedSensorOutOfSync() 2914 { 2915 return super.lookupStatusSignal(SpnValue.Fault_TALONFX_FusedSensorOutOfSync.value, Boolean.class, "Fault_FusedSensorOutOfSync", true); 2916 } 2917 2918 /** 2919 * The remote sensor used for fusion has fallen out of sync to the 2920 * local sensor. A re-synchronization has occurred, which may cause a 2921 * discontinuity. This typically happens if there is significant slop 2922 * in the mechanism, or if the RotorToSensorRatio configuration 2923 * parameter is incorrect. 2924 * 2925 * <ul> 2926 * <li> <b>Default Value:</b> False 2927 * </ul> 2928 * 2929 * Default Rates: 2930 * <ul> 2931 * <li> <b>CAN:</b> 4.0 Hz 2932 * </ul> 2933 * 2934 * This refreshes and returns a cached StatusSignal object. 2935 * 2936 * @return StickyFault_FusedSensorOutOfSync Status Signal Object 2937 */ 2938 public StatusSignal<Boolean> getStickyFault_FusedSensorOutOfSync() 2939 { 2940 return super.lookupStatusSignal(SpnValue.StickyFault_TALONFX_FusedSensorOutOfSync.value, Boolean.class, "StickyFault_FusedSensorOutOfSync", true); 2941 } 2942 2943 /** 2944 * Stator current limit occured. 2945 * 2946 * <ul> 2947 * <li> <b>Default Value:</b> False 2948 * </ul> 2949 * 2950 * Default Rates: 2951 * <ul> 2952 * <li> <b>CAN:</b> 4.0 Hz 2953 * </ul> 2954 * 2955 * This refreshes and returns a cached StatusSignal object. 2956 * 2957 * @return Fault_StatorCurrLimit Status Signal Object 2958 */ 2959 public StatusSignal<Boolean> getFault_StatorCurrLimit() 2960 { 2961 return super.lookupStatusSignal(SpnValue.Fault_TALONFX_StatorCurrLimit.value, Boolean.class, "Fault_StatorCurrLimit", true); 2962 } 2963 2964 /** 2965 * Stator current limit occured. 2966 * 2967 * <ul> 2968 * <li> <b>Default Value:</b> False 2969 * </ul> 2970 * 2971 * Default Rates: 2972 * <ul> 2973 * <li> <b>CAN:</b> 4.0 Hz 2974 * </ul> 2975 * 2976 * This refreshes and returns a cached StatusSignal object. 2977 * 2978 * @return StickyFault_StatorCurrLimit Status Signal Object 2979 */ 2980 public StatusSignal<Boolean> getStickyFault_StatorCurrLimit() 2981 { 2982 return super.lookupStatusSignal(SpnValue.StickyFault_TALONFX_StatorCurrLimit.value, Boolean.class, "StickyFault_StatorCurrLimit", true); 2983 } 2984 2985 /** 2986 * Supply current limit occured. 2987 * 2988 * <ul> 2989 * <li> <b>Default Value:</b> False 2990 * </ul> 2991 * 2992 * Default Rates: 2993 * <ul> 2994 * <li> <b>CAN:</b> 4.0 Hz 2995 * </ul> 2996 * 2997 * This refreshes and returns a cached StatusSignal object. 2998 * 2999 * @return Fault_SupplyCurrLimit Status Signal Object 3000 */ 3001 public StatusSignal<Boolean> getFault_SupplyCurrLimit() 3002 { 3003 return super.lookupStatusSignal(SpnValue.Fault_TALONFX_SupplyCurrLimit.value, Boolean.class, "Fault_SupplyCurrLimit", true); 3004 } 3005 3006 /** 3007 * Supply current limit occured. 3008 * 3009 * <ul> 3010 * <li> <b>Default Value:</b> False 3011 * </ul> 3012 * 3013 * Default Rates: 3014 * <ul> 3015 * <li> <b>CAN:</b> 4.0 Hz 3016 * </ul> 3017 * 3018 * This refreshes and returns a cached StatusSignal object. 3019 * 3020 * @return StickyFault_SupplyCurrLimit Status Signal Object 3021 */ 3022 public StatusSignal<Boolean> getStickyFault_SupplyCurrLimit() 3023 { 3024 return super.lookupStatusSignal(SpnValue.StickyFault_TALONFX_SupplyCurrLimit.value, Boolean.class, "StickyFault_SupplyCurrLimit", true); 3025 } 3026 3027 /** 3028 * Using Fused CANcoder feature while unlicensed. Device has fallen 3029 * back to remote CANcoder. 3030 * 3031 * <ul> 3032 * <li> <b>Default Value:</b> False 3033 * </ul> 3034 * 3035 * Default Rates: 3036 * <ul> 3037 * <li> <b>CAN:</b> 4.0 Hz 3038 * </ul> 3039 * 3040 * This refreshes and returns a cached StatusSignal object. 3041 * 3042 * @return Fault_UsingFusedCANcoderWhileUnlicensed Status Signal Object 3043 */ 3044 public StatusSignal<Boolean> getFault_UsingFusedCANcoderWhileUnlicensed() 3045 { 3046 return super.lookupStatusSignal(SpnValue.Fault_TALONFX_UsingFusedCCWhileUnlicensed.value, Boolean.class, "Fault_UsingFusedCANcoderWhileUnlicensed", true); 3047 } 3048 3049 /** 3050 * Using Fused CANcoder feature while unlicensed. Device has fallen 3051 * back to remote CANcoder. 3052 * 3053 * <ul> 3054 * <li> <b>Default Value:</b> False 3055 * </ul> 3056 * 3057 * Default Rates: 3058 * <ul> 3059 * <li> <b>CAN:</b> 4.0 Hz 3060 * </ul> 3061 * 3062 * This refreshes and returns a cached StatusSignal object. 3063 * 3064 * @return StickyFault_UsingFusedCANcoderWhileUnlicensed Status Signal Object 3065 */ 3066 public StatusSignal<Boolean> getStickyFault_UsingFusedCANcoderWhileUnlicensed() 3067 { 3068 return super.lookupStatusSignal(SpnValue.StickyFault_TALONFX_UsingFusedCCWhileUnlicensed.value, Boolean.class, "StickyFault_UsingFusedCANcoderWhileUnlicensed", true); 3069 } 3070 3071 /** 3072 * Static brake was momentarily disabled due to excessive braking 3073 * current while disabled. 3074 * 3075 * <ul> 3076 * <li> <b>Default Value:</b> False 3077 * </ul> 3078 * 3079 * Default Rates: 3080 * <ul> 3081 * <li> <b>CAN:</b> 4.0 Hz 3082 * </ul> 3083 * 3084 * This refreshes and returns a cached StatusSignal object. 3085 * 3086 * @return Fault_StaticBrakeDisabled Status Signal Object 3087 */ 3088 public StatusSignal<Boolean> getFault_StaticBrakeDisabled() 3089 { 3090 return super.lookupStatusSignal(SpnValue.Fault_TALONFX_StaticBrakeDisabled.value, Boolean.class, "Fault_StaticBrakeDisabled", true); 3091 } 3092 3093 /** 3094 * Static brake was momentarily disabled due to excessive braking 3095 * current while disabled. 3096 * 3097 * <ul> 3098 * <li> <b>Default Value:</b> False 3099 * </ul> 3100 * 3101 * Default Rates: 3102 * <ul> 3103 * <li> <b>CAN:</b> 4.0 Hz 3104 * </ul> 3105 * 3106 * This refreshes and returns a cached StatusSignal object. 3107 * 3108 * @return StickyFault_StaticBrakeDisabled Status Signal Object 3109 */ 3110 public StatusSignal<Boolean> getStickyFault_StaticBrakeDisabled() 3111 { 3112 return super.lookupStatusSignal(SpnValue.StickyFault_TALONFX_StaticBrakeDisabled.value, Boolean.class, "StickyFault_StaticBrakeDisabled", true); 3113 } 3114 3115 /** 3116 * Closed loop proportional component 3117 * <p> 3118 * The portion of the closed loop output that is the proportional to 3119 * the error. Alternatively, the p-Contribution of the closed loop 3120 * output. 3121 * 3122 * Default Rates: 3123 * <ul> 3124 * <li> <b>CAN 2.0:</b> 4.0 Hz 3125 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 3126 * </ul> 3127 * 3128 * This refreshes and returns a cached StatusSignal object. 3129 * 3130 * @return ClosedLoopProportionalOutput Status Signal object 3131 */ 3132 public StatusSignal<Double> getClosedLoopProportionalOutput() 3133 { 3134 MapGenerator<Double> mapFiller = ()->{ 3135 Map<Integer, StatusSignal<Double>> toAdd = new HashMap<Integer, StatusSignal<Double>>(); 3136 toAdd.put(ControlModeValue.PositionDutyCycle.value, getPIDDutyCycle_ProportionalOutput()); 3137 toAdd.put(ControlModeValue.PositionDutyCycleFOC.value, getPIDDutyCycle_ProportionalOutput()); 3138 toAdd.put(ControlModeValue.VelocityDutyCycle.value, getPIDDutyCycle_ProportionalOutput()); 3139 toAdd.put(ControlModeValue.VelocityDutyCycleFOC.value, getPIDDutyCycle_ProportionalOutput()); 3140 toAdd.put(ControlModeValue.MotionMagicDutyCycle.value, getPIDDutyCycle_ProportionalOutput()); 3141 toAdd.put(ControlModeValue.MotionMagicDutyCycleFOC.value, getPIDDutyCycle_ProportionalOutput()); 3142 toAdd.put(ControlModeValue.MotionMagicVelocityDutyCycle.value, getPIDDutyCycle_ProportionalOutput()); 3143 toAdd.put(ControlModeValue.MotionMagicVelocityDutyCycleFOC.value, getPIDDutyCycle_ProportionalOutput()); 3144 toAdd.put(ControlModeValue.MotionMagicExpoDutyCycle.value, getPIDDutyCycle_ProportionalOutput()); 3145 toAdd.put(ControlModeValue.MotionMagicExpoDutyCycleFOC.value, getPIDDutyCycle_ProportionalOutput()); 3146 toAdd.put(ControlModeValue.PositionVoltage.value, getPIDMotorVoltage_ProportionalOutput()); 3147 toAdd.put(ControlModeValue.PositionVoltageFOC.value, getPIDMotorVoltage_ProportionalOutput()); 3148 toAdd.put(ControlModeValue.VelocityVoltage.value, getPIDMotorVoltage_ProportionalOutput()); 3149 toAdd.put(ControlModeValue.VelocityVoltageFOC.value, getPIDMotorVoltage_ProportionalOutput()); 3150 toAdd.put(ControlModeValue.MotionMagicVoltage.value, getPIDMotorVoltage_ProportionalOutput()); 3151 toAdd.put(ControlModeValue.MotionMagicVoltageFOC.value, getPIDMotorVoltage_ProportionalOutput()); 3152 toAdd.put(ControlModeValue.MotionMagicVelocityVoltage.value, getPIDMotorVoltage_ProportionalOutput()); 3153 toAdd.put(ControlModeValue.MotionMagicVelocityVoltageFOC.value, getPIDMotorVoltage_ProportionalOutput()); 3154 toAdd.put(ControlModeValue.MotionMagicExpoVoltage.value, getPIDMotorVoltage_ProportionalOutput()); 3155 toAdd.put(ControlModeValue.MotionMagicExpoVoltageFOC.value, getPIDMotorVoltage_ProportionalOutput()); 3156 toAdd.put(ControlModeValue.PositionTorqueCurrentFOC.value, getPIDTorqueCurrent_ProportionalOutput()); 3157 toAdd.put(ControlModeValue.VelocityTorqueCurrentFOC.value, getPIDTorqueCurrent_ProportionalOutput()); 3158 toAdd.put(ControlModeValue.MotionMagicTorqueCurrentFOC.value, getPIDTorqueCurrent_ProportionalOutput()); 3159 toAdd.put(ControlModeValue.MotionMagicVelocityTorqueCurrentFOC.value, getPIDTorqueCurrent_ProportionalOutput()); 3160 toAdd.put(ControlModeValue.MotionMagicExpoTorqueCurrentFOC.value, getPIDTorqueCurrent_ProportionalOutput()); 3161 return toAdd; 3162 }; 3163 return super.lookupStatusSignal(SpnValue.TalonFX_ControlMode.value, Double.class, 1, mapFiller, "ClosedLoopProportionalOutput", true); 3164 } 3165 3166 /** 3167 * Closed loop integrated component 3168 * <p> 3169 * The portion of the closed loop output that is proportional to the 3170 * integrated error. Alternatively, the i-Contribution of the closed 3171 * loop output. 3172 * 3173 * Default Rates: 3174 * <ul> 3175 * <li> <b>CAN 2.0:</b> 4.0 Hz 3176 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 3177 * </ul> 3178 * 3179 * This refreshes and returns a cached StatusSignal object. 3180 * 3181 * @return ClosedLoopIntegratedOutput Status Signal object 3182 */ 3183 public StatusSignal<Double> getClosedLoopIntegratedOutput() 3184 { 3185 MapGenerator<Double> mapFiller = ()->{ 3186 Map<Integer, StatusSignal<Double>> toAdd = new HashMap<Integer, StatusSignal<Double>>(); 3187 toAdd.put(ControlModeValue.PositionDutyCycle.value, getPIDDutyCycle_IntegratedAccum()); 3188 toAdd.put(ControlModeValue.PositionDutyCycleFOC.value, getPIDDutyCycle_IntegratedAccum()); 3189 toAdd.put(ControlModeValue.VelocityDutyCycle.value, getPIDDutyCycle_IntegratedAccum()); 3190 toAdd.put(ControlModeValue.VelocityDutyCycleFOC.value, getPIDDutyCycle_IntegratedAccum()); 3191 toAdd.put(ControlModeValue.MotionMagicDutyCycle.value, getPIDDutyCycle_IntegratedAccum()); 3192 toAdd.put(ControlModeValue.MotionMagicDutyCycleFOC.value, getPIDDutyCycle_IntegratedAccum()); 3193 toAdd.put(ControlModeValue.MotionMagicVelocityDutyCycle.value, getPIDDutyCycle_IntegratedAccum()); 3194 toAdd.put(ControlModeValue.MotionMagicVelocityDutyCycleFOC.value, getPIDDutyCycle_IntegratedAccum()); 3195 toAdd.put(ControlModeValue.MotionMagicExpoDutyCycle.value, getPIDDutyCycle_IntegratedAccum()); 3196 toAdd.put(ControlModeValue.MotionMagicExpoDutyCycleFOC.value, getPIDDutyCycle_IntegratedAccum()); 3197 toAdd.put(ControlModeValue.PositionVoltage.value, getPIDMotorVoltage_IntegratedAccum()); 3198 toAdd.put(ControlModeValue.PositionVoltageFOC.value, getPIDMotorVoltage_IntegratedAccum()); 3199 toAdd.put(ControlModeValue.VelocityVoltage.value, getPIDMotorVoltage_IntegratedAccum()); 3200 toAdd.put(ControlModeValue.VelocityVoltageFOC.value, getPIDMotorVoltage_IntegratedAccum()); 3201 toAdd.put(ControlModeValue.MotionMagicVoltage.value, getPIDMotorVoltage_IntegratedAccum()); 3202 toAdd.put(ControlModeValue.MotionMagicVoltageFOC.value, getPIDMotorVoltage_IntegratedAccum()); 3203 toAdd.put(ControlModeValue.MotionMagicVelocityVoltage.value, getPIDMotorVoltage_IntegratedAccum()); 3204 toAdd.put(ControlModeValue.MotionMagicVelocityVoltageFOC.value, getPIDMotorVoltage_IntegratedAccum()); 3205 toAdd.put(ControlModeValue.MotionMagicExpoVoltage.value, getPIDMotorVoltage_IntegratedAccum()); 3206 toAdd.put(ControlModeValue.MotionMagicExpoVoltageFOC.value, getPIDMotorVoltage_IntegratedAccum()); 3207 toAdd.put(ControlModeValue.PositionTorqueCurrentFOC.value, getPIDTorqueCurrent_IntegratedAccum()); 3208 toAdd.put(ControlModeValue.VelocityTorqueCurrentFOC.value, getPIDTorqueCurrent_IntegratedAccum()); 3209 toAdd.put(ControlModeValue.MotionMagicTorqueCurrentFOC.value, getPIDTorqueCurrent_IntegratedAccum()); 3210 toAdd.put(ControlModeValue.MotionMagicVelocityTorqueCurrentFOC.value, getPIDTorqueCurrent_IntegratedAccum()); 3211 toAdd.put(ControlModeValue.MotionMagicExpoTorqueCurrentFOC.value, getPIDTorqueCurrent_IntegratedAccum()); 3212 return toAdd; 3213 }; 3214 return super.lookupStatusSignal(SpnValue.TalonFX_ControlMode.value, Double.class, 2, mapFiller, "ClosedLoopIntegratedOutput", true); 3215 } 3216 3217 /** 3218 * Feedforward passed by the user 3219 * <p> 3220 * This is the general feedforward that the user provides for the 3221 * closed loop. 3222 * 3223 * Default Rates: 3224 * <ul> 3225 * <li> <b>CAN 2.0:</b> 4.0 Hz 3226 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 3227 * </ul> 3228 * 3229 * This refreshes and returns a cached StatusSignal object. 3230 * 3231 * @return ClosedLoopFeedForward Status Signal object 3232 */ 3233 public StatusSignal<Double> getClosedLoopFeedForward() 3234 { 3235 MapGenerator<Double> mapFiller = ()->{ 3236 Map<Integer, StatusSignal<Double>> toAdd = new HashMap<Integer, StatusSignal<Double>>(); 3237 toAdd.put(ControlModeValue.PositionDutyCycle.value, getPIDDutyCycle_FeedForward()); 3238 toAdd.put(ControlModeValue.PositionDutyCycleFOC.value, getPIDDutyCycle_FeedForward()); 3239 toAdd.put(ControlModeValue.VelocityDutyCycle.value, getPIDDutyCycle_FeedForward()); 3240 toAdd.put(ControlModeValue.VelocityDutyCycleFOC.value, getPIDDutyCycle_FeedForward()); 3241 toAdd.put(ControlModeValue.MotionMagicDutyCycle.value, getPIDDutyCycle_FeedForward()); 3242 toAdd.put(ControlModeValue.MotionMagicDutyCycleFOC.value, getPIDDutyCycle_FeedForward()); 3243 toAdd.put(ControlModeValue.MotionMagicVelocityDutyCycle.value, getPIDDutyCycle_FeedForward()); 3244 toAdd.put(ControlModeValue.MotionMagicVelocityDutyCycleFOC.value, getPIDDutyCycle_FeedForward()); 3245 toAdd.put(ControlModeValue.MotionMagicExpoDutyCycle.value, getPIDDutyCycle_FeedForward()); 3246 toAdd.put(ControlModeValue.MotionMagicExpoDutyCycleFOC.value, getPIDDutyCycle_FeedForward()); 3247 toAdd.put(ControlModeValue.PositionVoltage.value, getPIDMotorVoltage_FeedForward()); 3248 toAdd.put(ControlModeValue.PositionVoltageFOC.value, getPIDMotorVoltage_FeedForward()); 3249 toAdd.put(ControlModeValue.VelocityVoltage.value, getPIDMotorVoltage_FeedForward()); 3250 toAdd.put(ControlModeValue.VelocityVoltageFOC.value, getPIDMotorVoltage_FeedForward()); 3251 toAdd.put(ControlModeValue.MotionMagicVoltage.value, getPIDMotorVoltage_FeedForward()); 3252 toAdd.put(ControlModeValue.MotionMagicVoltageFOC.value, getPIDMotorVoltage_FeedForward()); 3253 toAdd.put(ControlModeValue.MotionMagicVelocityVoltage.value, getPIDMotorVoltage_FeedForward()); 3254 toAdd.put(ControlModeValue.MotionMagicVelocityVoltageFOC.value, getPIDMotorVoltage_FeedForward()); 3255 toAdd.put(ControlModeValue.MotionMagicExpoVoltage.value, getPIDMotorVoltage_FeedForward()); 3256 toAdd.put(ControlModeValue.MotionMagicExpoVoltageFOC.value, getPIDMotorVoltage_FeedForward()); 3257 toAdd.put(ControlModeValue.PositionTorqueCurrentFOC.value, getPIDTorqueCurrent_FeedForward()); 3258 toAdd.put(ControlModeValue.VelocityTorqueCurrentFOC.value, getPIDTorqueCurrent_FeedForward()); 3259 toAdd.put(ControlModeValue.MotionMagicTorqueCurrentFOC.value, getPIDTorqueCurrent_FeedForward()); 3260 toAdd.put(ControlModeValue.MotionMagicVelocityTorqueCurrentFOC.value, getPIDTorqueCurrent_FeedForward()); 3261 toAdd.put(ControlModeValue.MotionMagicExpoTorqueCurrentFOC.value, getPIDTorqueCurrent_FeedForward()); 3262 return toAdd; 3263 }; 3264 return super.lookupStatusSignal(SpnValue.TalonFX_ControlMode.value, Double.class, 3, mapFiller, "ClosedLoopFeedForward", true); 3265 } 3266 3267 /** 3268 * Closed loop derivative component 3269 * <p> 3270 * The portion of the closed loop output that is the proportional to 3271 * the deriviative the error. Alternatively, the d-Contribution of the 3272 * closed loop output. 3273 * 3274 * Default Rates: 3275 * <ul> 3276 * <li> <b>CAN 2.0:</b> 4.0 Hz 3277 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 3278 * </ul> 3279 * 3280 * This refreshes and returns a cached StatusSignal object. 3281 * 3282 * @return ClosedLoopDerivativeOutput Status Signal object 3283 */ 3284 public StatusSignal<Double> getClosedLoopDerivativeOutput() 3285 { 3286 MapGenerator<Double> mapFiller = ()->{ 3287 Map<Integer, StatusSignal<Double>> toAdd = new HashMap<Integer, StatusSignal<Double>>(); 3288 toAdd.put(ControlModeValue.PositionDutyCycle.value, getPIDDutyCycle_DerivativeOutput()); 3289 toAdd.put(ControlModeValue.PositionDutyCycleFOC.value, getPIDDutyCycle_DerivativeOutput()); 3290 toAdd.put(ControlModeValue.VelocityDutyCycle.value, getPIDDutyCycle_DerivativeOutput()); 3291 toAdd.put(ControlModeValue.VelocityDutyCycleFOC.value, getPIDDutyCycle_DerivativeOutput()); 3292 toAdd.put(ControlModeValue.MotionMagicDutyCycle.value, getPIDDutyCycle_DerivativeOutput()); 3293 toAdd.put(ControlModeValue.MotionMagicDutyCycleFOC.value, getPIDDutyCycle_DerivativeOutput()); 3294 toAdd.put(ControlModeValue.MotionMagicVelocityDutyCycle.value, getPIDDutyCycle_DerivativeOutput()); 3295 toAdd.put(ControlModeValue.MotionMagicVelocityDutyCycleFOC.value, getPIDDutyCycle_DerivativeOutput()); 3296 toAdd.put(ControlModeValue.MotionMagicExpoDutyCycle.value, getPIDDutyCycle_DerivativeOutput()); 3297 toAdd.put(ControlModeValue.MotionMagicExpoDutyCycleFOC.value, getPIDDutyCycle_DerivativeOutput()); 3298 toAdd.put(ControlModeValue.PositionVoltage.value, getPIDMotorVoltage_DerivativeOutput()); 3299 toAdd.put(ControlModeValue.PositionVoltageFOC.value, getPIDMotorVoltage_DerivativeOutput()); 3300 toAdd.put(ControlModeValue.VelocityVoltage.value, getPIDMotorVoltage_DerivativeOutput()); 3301 toAdd.put(ControlModeValue.VelocityVoltageFOC.value, getPIDMotorVoltage_DerivativeOutput()); 3302 toAdd.put(ControlModeValue.MotionMagicVoltage.value, getPIDMotorVoltage_DerivativeOutput()); 3303 toAdd.put(ControlModeValue.MotionMagicVoltageFOC.value, getPIDMotorVoltage_DerivativeOutput()); 3304 toAdd.put(ControlModeValue.MotionMagicVelocityVoltage.value, getPIDMotorVoltage_DerivativeOutput()); 3305 toAdd.put(ControlModeValue.MotionMagicVelocityVoltageFOC.value, getPIDMotorVoltage_DerivativeOutput()); 3306 toAdd.put(ControlModeValue.MotionMagicExpoVoltage.value, getPIDMotorVoltage_DerivativeOutput()); 3307 toAdd.put(ControlModeValue.MotionMagicExpoVoltageFOC.value, getPIDMotorVoltage_DerivativeOutput()); 3308 toAdd.put(ControlModeValue.PositionTorqueCurrentFOC.value, getPIDTorqueCurrent_DerivativeOutput()); 3309 toAdd.put(ControlModeValue.VelocityTorqueCurrentFOC.value, getPIDTorqueCurrent_DerivativeOutput()); 3310 toAdd.put(ControlModeValue.MotionMagicTorqueCurrentFOC.value, getPIDTorqueCurrent_DerivativeOutput()); 3311 toAdd.put(ControlModeValue.MotionMagicVelocityTorqueCurrentFOC.value, getPIDTorqueCurrent_DerivativeOutput()); 3312 toAdd.put(ControlModeValue.MotionMagicExpoTorqueCurrentFOC.value, getPIDTorqueCurrent_DerivativeOutput()); 3313 return toAdd; 3314 }; 3315 return super.lookupStatusSignal(SpnValue.TalonFX_ControlMode.value, Double.class, 4, mapFiller, "ClosedLoopDerivativeOutput", true); 3316 } 3317 3318 /** 3319 * Closed loop total output 3320 * <p> 3321 * The total output of the closed loop output. 3322 * 3323 * Default Rates: 3324 * <ul> 3325 * <li> <b>CAN 2.0:</b> 4.0 Hz 3326 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 3327 * </ul> 3328 * 3329 * This refreshes and returns a cached StatusSignal object. 3330 * 3331 * @return ClosedLoopOutput Status Signal object 3332 */ 3333 public StatusSignal<Double> getClosedLoopOutput() 3334 { 3335 MapGenerator<Double> mapFiller = ()->{ 3336 Map<Integer, StatusSignal<Double>> toAdd = new HashMap<Integer, StatusSignal<Double>>(); 3337 toAdd.put(ControlModeValue.PositionDutyCycle.value, getPIDDutyCycle_Output()); 3338 toAdd.put(ControlModeValue.PositionDutyCycleFOC.value, getPIDDutyCycle_Output()); 3339 toAdd.put(ControlModeValue.VelocityDutyCycle.value, getPIDDutyCycle_Output()); 3340 toAdd.put(ControlModeValue.VelocityDutyCycleFOC.value, getPIDDutyCycle_Output()); 3341 toAdd.put(ControlModeValue.MotionMagicDutyCycle.value, getPIDDutyCycle_Output()); 3342 toAdd.put(ControlModeValue.MotionMagicDutyCycleFOC.value, getPIDDutyCycle_Output()); 3343 toAdd.put(ControlModeValue.MotionMagicVelocityDutyCycle.value, getPIDDutyCycle_Output()); 3344 toAdd.put(ControlModeValue.MotionMagicVelocityDutyCycleFOC.value, getPIDDutyCycle_Output()); 3345 toAdd.put(ControlModeValue.MotionMagicExpoDutyCycle.value, getPIDDutyCycle_Output()); 3346 toAdd.put(ControlModeValue.MotionMagicExpoDutyCycleFOC.value, getPIDDutyCycle_Output()); 3347 toAdd.put(ControlModeValue.PositionVoltage.value, getPIDMotorVoltage_Output()); 3348 toAdd.put(ControlModeValue.PositionVoltageFOC.value, getPIDMotorVoltage_Output()); 3349 toAdd.put(ControlModeValue.VelocityVoltage.value, getPIDMotorVoltage_Output()); 3350 toAdd.put(ControlModeValue.VelocityVoltageFOC.value, getPIDMotorVoltage_Output()); 3351 toAdd.put(ControlModeValue.MotionMagicVoltage.value, getPIDMotorVoltage_Output()); 3352 toAdd.put(ControlModeValue.MotionMagicVoltageFOC.value, getPIDMotorVoltage_Output()); 3353 toAdd.put(ControlModeValue.MotionMagicVelocityVoltage.value, getPIDMotorVoltage_Output()); 3354 toAdd.put(ControlModeValue.MotionMagicVelocityVoltageFOC.value, getPIDMotorVoltage_Output()); 3355 toAdd.put(ControlModeValue.MotionMagicExpoVoltage.value, getPIDMotorVoltage_Output()); 3356 toAdd.put(ControlModeValue.MotionMagicExpoVoltageFOC.value, getPIDMotorVoltage_Output()); 3357 toAdd.put(ControlModeValue.PositionTorqueCurrentFOC.value, getPIDTorqueCurrent_Output()); 3358 toAdd.put(ControlModeValue.VelocityTorqueCurrentFOC.value, getPIDTorqueCurrent_Output()); 3359 toAdd.put(ControlModeValue.MotionMagicTorqueCurrentFOC.value, getPIDTorqueCurrent_Output()); 3360 toAdd.put(ControlModeValue.MotionMagicVelocityTorqueCurrentFOC.value, getPIDTorqueCurrent_Output()); 3361 toAdd.put(ControlModeValue.MotionMagicExpoTorqueCurrentFOC.value, getPIDTorqueCurrent_Output()); 3362 return toAdd; 3363 }; 3364 return super.lookupStatusSignal(SpnValue.TalonFX_ControlMode.value, Double.class, 5, mapFiller, "ClosedLoopOutput", true); 3365 } 3366 3367 /** 3368 * Value that the closed loop is targeting 3369 * <p> 3370 * This is the value that the closed loop PID controller targets. 3371 * 3372 * Default Rates: 3373 * <ul> 3374 * <li> <b>CAN 2.0:</b> 4.0 Hz 3375 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 3376 * </ul> 3377 * 3378 * This refreshes and returns a cached StatusSignal object. 3379 * 3380 * @return ClosedLoopReference Status Signal object 3381 */ 3382 public StatusSignal<Double> getClosedLoopReference() 3383 { 3384 MapGenerator<Double> mapFiller = ()->{ 3385 Map<Integer, StatusSignal<Double>> toAdd = new HashMap<Integer, StatusSignal<Double>>(); 3386 toAdd.put(ControlModeValue.PositionDutyCycle.value, getPIDPosition_Reference()); 3387 toAdd.put(ControlModeValue.PositionDutyCycleFOC.value, getPIDPosition_Reference()); 3388 toAdd.put(ControlModeValue.MotionMagicDutyCycle.value, getPIDPosition_Reference()); 3389 toAdd.put(ControlModeValue.MotionMagicDutyCycleFOC.value, getPIDPosition_Reference()); 3390 toAdd.put(ControlModeValue.PositionVoltage.value, getPIDPosition_Reference()); 3391 toAdd.put(ControlModeValue.PositionVoltageFOC.value, getPIDPosition_Reference()); 3392 toAdd.put(ControlModeValue.MotionMagicVoltage.value, getPIDPosition_Reference()); 3393 toAdd.put(ControlModeValue.MotionMagicVoltageFOC.value, getPIDPosition_Reference()); 3394 toAdd.put(ControlModeValue.PositionTorqueCurrentFOC.value, getPIDPosition_Reference()); 3395 toAdd.put(ControlModeValue.MotionMagicTorqueCurrentFOC.value, getPIDPosition_Reference()); 3396 toAdd.put(ControlModeValue.MotionMagicExpoDutyCycle.value, getPIDPosition_Reference()); 3397 toAdd.put(ControlModeValue.MotionMagicExpoDutyCycleFOC.value, getPIDPosition_Reference()); 3398 toAdd.put(ControlModeValue.MotionMagicExpoVoltage.value, getPIDPosition_Reference()); 3399 toAdd.put(ControlModeValue.MotionMagicExpoVoltageFOC.value, getPIDPosition_Reference()); 3400 toAdd.put(ControlModeValue.MotionMagicExpoTorqueCurrentFOC.value, getPIDPosition_Reference()); 3401 toAdd.put(ControlModeValue.VelocityDutyCycle.value, getPIDVelocity_Reference()); 3402 toAdd.put(ControlModeValue.VelocityDutyCycleFOC.value, getPIDVelocity_Reference()); 3403 toAdd.put(ControlModeValue.VelocityVoltage.value, getPIDVelocity_Reference()); 3404 toAdd.put(ControlModeValue.VelocityVoltageFOC.value, getPIDVelocity_Reference()); 3405 toAdd.put(ControlModeValue.VelocityTorqueCurrentFOC.value, getPIDVelocity_Reference()); 3406 toAdd.put(ControlModeValue.MotionMagicVelocityDutyCycle.value, getPIDVelocity_Reference()); 3407 toAdd.put(ControlModeValue.MotionMagicVelocityDutyCycleFOC.value, getPIDVelocity_Reference()); 3408 toAdd.put(ControlModeValue.MotionMagicVelocityVoltage.value, getPIDVelocity_Reference()); 3409 toAdd.put(ControlModeValue.MotionMagicVelocityVoltageFOC.value, getPIDVelocity_Reference()); 3410 toAdd.put(ControlModeValue.MotionMagicVelocityTorqueCurrentFOC.value, getPIDVelocity_Reference()); 3411 return toAdd; 3412 }; 3413 return super.lookupStatusSignal(SpnValue.TalonFX_ControlMode.value, Double.class, 6, mapFiller, "ClosedLoopReference", true); 3414 } 3415 3416 /** 3417 * Derivative of the target that the closed loop is targeting 3418 * <p> 3419 * This is the change in the closed loop reference. This may be used 3420 * in the feed-forward calculation, the derivative-error, or in 3421 * application of the signage for kS. Typically, this represents the 3422 * target velocity during Motion Magic®. 3423 * 3424 * Default Rates: 3425 * <ul> 3426 * <li> <b>CAN 2.0:</b> 4.0 Hz 3427 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 3428 * </ul> 3429 * 3430 * This refreshes and returns a cached StatusSignal object. 3431 * 3432 * @return ClosedLoopReferenceSlope Status Signal object 3433 */ 3434 public StatusSignal<Double> getClosedLoopReferenceSlope() 3435 { 3436 MapGenerator<Double> mapFiller = ()->{ 3437 Map<Integer, StatusSignal<Double>> toAdd = new HashMap<Integer, StatusSignal<Double>>(); 3438 toAdd.put(ControlModeValue.PositionDutyCycle.value, getPIDPosition_ReferenceSlope()); 3439 toAdd.put(ControlModeValue.PositionDutyCycleFOC.value, getPIDPosition_ReferenceSlope()); 3440 toAdd.put(ControlModeValue.MotionMagicDutyCycle.value, getPIDPosition_ReferenceSlope()); 3441 toAdd.put(ControlModeValue.MotionMagicDutyCycleFOC.value, getPIDPosition_ReferenceSlope()); 3442 toAdd.put(ControlModeValue.PositionVoltage.value, getPIDPosition_ReferenceSlope()); 3443 toAdd.put(ControlModeValue.PositionVoltageFOC.value, getPIDPosition_ReferenceSlope()); 3444 toAdd.put(ControlModeValue.MotionMagicVoltage.value, getPIDPosition_ReferenceSlope()); 3445 toAdd.put(ControlModeValue.MotionMagicVoltageFOC.value, getPIDPosition_ReferenceSlope()); 3446 toAdd.put(ControlModeValue.PositionTorqueCurrentFOC.value, getPIDPosition_ReferenceSlope()); 3447 toAdd.put(ControlModeValue.MotionMagicTorqueCurrentFOC.value, getPIDPosition_ReferenceSlope()); 3448 toAdd.put(ControlModeValue.MotionMagicExpoDutyCycle.value, getPIDPosition_ReferenceSlope()); 3449 toAdd.put(ControlModeValue.MotionMagicExpoDutyCycleFOC.value, getPIDPosition_ReferenceSlope()); 3450 toAdd.put(ControlModeValue.MotionMagicExpoVoltage.value, getPIDPosition_ReferenceSlope()); 3451 toAdd.put(ControlModeValue.MotionMagicExpoVoltageFOC.value, getPIDPosition_ReferenceSlope()); 3452 toAdd.put(ControlModeValue.MotionMagicExpoTorqueCurrentFOC.value, getPIDPosition_ReferenceSlope()); 3453 toAdd.put(ControlModeValue.VelocityDutyCycle.value, getPIDVelocity_ReferenceSlope()); 3454 toAdd.put(ControlModeValue.VelocityDutyCycleFOC.value, getPIDVelocity_ReferenceSlope()); 3455 toAdd.put(ControlModeValue.VelocityVoltage.value, getPIDVelocity_ReferenceSlope()); 3456 toAdd.put(ControlModeValue.VelocityVoltageFOC.value, getPIDVelocity_ReferenceSlope()); 3457 toAdd.put(ControlModeValue.VelocityTorqueCurrentFOC.value, getPIDVelocity_ReferenceSlope()); 3458 toAdd.put(ControlModeValue.MotionMagicVelocityDutyCycle.value, getPIDVelocity_ReferenceSlope()); 3459 toAdd.put(ControlModeValue.MotionMagicVelocityDutyCycleFOC.value, getPIDVelocity_ReferenceSlope()); 3460 toAdd.put(ControlModeValue.MotionMagicVelocityVoltage.value, getPIDVelocity_ReferenceSlope()); 3461 toAdd.put(ControlModeValue.MotionMagicVelocityVoltageFOC.value, getPIDVelocity_ReferenceSlope()); 3462 toAdd.put(ControlModeValue.MotionMagicVelocityTorqueCurrentFOC.value, getPIDVelocity_ReferenceSlope()); 3463 return toAdd; 3464 }; 3465 return super.lookupStatusSignal(SpnValue.TalonFX_ControlMode.value, Double.class, 7, mapFiller, "ClosedLoopReferenceSlope", true); 3466 } 3467 3468 /** 3469 * The difference between target reference and current measurement 3470 * <p> 3471 * This is the value that is treated as the error in the PID loop. 3472 * 3473 * Default Rates: 3474 * <ul> 3475 * <li> <b>CAN 2.0:</b> 4.0 Hz 3476 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 3477 * </ul> 3478 * 3479 * This refreshes and returns a cached StatusSignal object. 3480 * 3481 * @return ClosedLoopError Status Signal object 3482 */ 3483 public StatusSignal<Double> getClosedLoopError() 3484 { 3485 MapGenerator<Double> mapFiller = ()->{ 3486 Map<Integer, StatusSignal<Double>> toAdd = new HashMap<Integer, StatusSignal<Double>>(); 3487 toAdd.put(ControlModeValue.PositionDutyCycle.value, getPIDPosition_ClosedLoopError()); 3488 toAdd.put(ControlModeValue.PositionDutyCycleFOC.value, getPIDPosition_ClosedLoopError()); 3489 toAdd.put(ControlModeValue.MotionMagicDutyCycle.value, getPIDPosition_ClosedLoopError()); 3490 toAdd.put(ControlModeValue.MotionMagicDutyCycleFOC.value, getPIDPosition_ClosedLoopError()); 3491 toAdd.put(ControlModeValue.PositionVoltage.value, getPIDPosition_ClosedLoopError()); 3492 toAdd.put(ControlModeValue.PositionVoltageFOC.value, getPIDPosition_ClosedLoopError()); 3493 toAdd.put(ControlModeValue.MotionMagicVoltage.value, getPIDPosition_ClosedLoopError()); 3494 toAdd.put(ControlModeValue.MotionMagicVoltageFOC.value, getPIDPosition_ClosedLoopError()); 3495 toAdd.put(ControlModeValue.PositionTorqueCurrentFOC.value, getPIDPosition_ClosedLoopError()); 3496 toAdd.put(ControlModeValue.MotionMagicTorqueCurrentFOC.value, getPIDPosition_ClosedLoopError()); 3497 toAdd.put(ControlModeValue.MotionMagicExpoDutyCycle.value, getPIDPosition_ClosedLoopError()); 3498 toAdd.put(ControlModeValue.MotionMagicExpoDutyCycleFOC.value, getPIDPosition_ClosedLoopError()); 3499 toAdd.put(ControlModeValue.MotionMagicExpoVoltage.value, getPIDPosition_ClosedLoopError()); 3500 toAdd.put(ControlModeValue.MotionMagicExpoVoltageFOC.value, getPIDPosition_ClosedLoopError()); 3501 toAdd.put(ControlModeValue.MotionMagicExpoTorqueCurrentFOC.value, getPIDPosition_ClosedLoopError()); 3502 toAdd.put(ControlModeValue.VelocityDutyCycle.value, getPIDVelocity_ClosedLoopError()); 3503 toAdd.put(ControlModeValue.VelocityDutyCycleFOC.value, getPIDVelocity_ClosedLoopError()); 3504 toAdd.put(ControlModeValue.VelocityVoltage.value, getPIDVelocity_ClosedLoopError()); 3505 toAdd.put(ControlModeValue.VelocityVoltageFOC.value, getPIDVelocity_ClosedLoopError()); 3506 toAdd.put(ControlModeValue.VelocityTorqueCurrentFOC.value, getPIDVelocity_ClosedLoopError()); 3507 toAdd.put(ControlModeValue.MotionMagicVelocityDutyCycle.value, getPIDVelocity_ClosedLoopError()); 3508 toAdd.put(ControlModeValue.MotionMagicVelocityDutyCycleFOC.value, getPIDVelocity_ClosedLoopError()); 3509 toAdd.put(ControlModeValue.MotionMagicVelocityVoltage.value, getPIDVelocity_ClosedLoopError()); 3510 toAdd.put(ControlModeValue.MotionMagicVelocityVoltageFOC.value, getPIDVelocity_ClosedLoopError()); 3511 toAdd.put(ControlModeValue.MotionMagicVelocityTorqueCurrentFOC.value, getPIDVelocity_ClosedLoopError()); 3512 return toAdd; 3513 }; 3514 return super.lookupStatusSignal(SpnValue.TalonFX_ControlMode.value, Double.class, 8, mapFiller, "ClosedLoopError", true); 3515 } 3516 3517 /** 3518 * The calculated motor output for differential followers. 3519 * <p> 3520 * This is a torque request when using the TorqueCurrentFOC control 3521 * output type, and a duty cycle in all other control types. 3522 * 3523 * Default Rates: 3524 * <ul> 3525 * <li> <b>CAN 2.0:</b> 100.0 Hz 3526 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 3527 * </ul> 3528 * 3529 * This refreshes and returns a cached StatusSignal object. 3530 * 3531 * @return DifferentialOutput Status Signal object 3532 */ 3533 public StatusSignal<Double> getDifferentialOutput() 3534 { 3535 MapGenerator<Double> mapFiller = ()->{ 3536 Map<Integer, StatusSignal<Double>> toAdd = new HashMap<Integer, StatusSignal<Double>>(); 3537 toAdd.put(DifferentialControlModeValue.PositionDutyCycle.value, getDifferentialDutyCycle()); 3538 toAdd.put(DifferentialControlModeValue.PositionDutyCycleFOC.value, getDifferentialDutyCycle()); 3539 toAdd.put(DifferentialControlModeValue.MotionMagicDutyCycle.value, getDifferentialDutyCycle()); 3540 toAdd.put(DifferentialControlModeValue.MotionMagicDutyCycleFOC.value, getDifferentialDutyCycle()); 3541 toAdd.put(DifferentialControlModeValue.PositionVoltage.value, getDifferentialDutyCycle()); 3542 toAdd.put(DifferentialControlModeValue.PositionVoltageFOC.value, getDifferentialDutyCycle()); 3543 toAdd.put(DifferentialControlModeValue.MotionMagicVoltage.value, getDifferentialDutyCycle()); 3544 toAdd.put(DifferentialControlModeValue.MotionMagicVoltageFOC.value, getDifferentialDutyCycle()); 3545 toAdd.put(DifferentialControlModeValue.VelocityDutyCycle.value, getDifferentialDutyCycle()); 3546 toAdd.put(DifferentialControlModeValue.VelocityDutyCycleFOC.value, getDifferentialDutyCycle()); 3547 toAdd.put(DifferentialControlModeValue.VelocityVoltage.value, getDifferentialDutyCycle()); 3548 toAdd.put(DifferentialControlModeValue.VelocityVoltageFOC.value, getDifferentialDutyCycle()); 3549 toAdd.put(DifferentialControlModeValue.PositionTorqueCurrentFOC.value, getDifferentialTorqueCurrent()); 3550 toAdd.put(DifferentialControlModeValue.MotionMagicTorqueCurrentFOC.value, getDifferentialTorqueCurrent()); 3551 toAdd.put(DifferentialControlModeValue.VelocityTorqueCurrentFOC.value, getDifferentialTorqueCurrent()); 3552 return toAdd; 3553 }; 3554 return super.lookupStatusSignal(SpnValue.TalonFX_DifferentialControlMode.value, Double.class, 9, mapFiller, "DifferentialOutput", true); 3555 } 3556 3557 /** 3558 * Differential closed loop proportional component 3559 * <p> 3560 * The portion of the differential closed loop output that is the 3561 * proportional to the error. Alternatively, the p-Contribution of the 3562 * closed loop output. 3563 * 3564 * Default Rates: 3565 * <ul> 3566 * <li> <b>CAN 2.0:</b> 4.0 Hz 3567 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 3568 * </ul> 3569 * 3570 * This refreshes and returns a cached StatusSignal object. 3571 * 3572 * @return DifferentialClosedLoopProportionalOutput Status Signal object 3573 */ 3574 public StatusSignal<Double> getDifferentialClosedLoopProportionalOutput() 3575 { 3576 MapGenerator<Double> mapFiller = ()->{ 3577 Map<Integer, StatusSignal<Double>> toAdd = new HashMap<Integer, StatusSignal<Double>>(); 3578 toAdd.put(DifferentialControlModeValue.PositionDutyCycle.value, getDifferentialPIDDutyCycle_ProportionalOutput()); 3579 toAdd.put(DifferentialControlModeValue.PositionDutyCycleFOC.value, getDifferentialPIDDutyCycle_ProportionalOutput()); 3580 toAdd.put(DifferentialControlModeValue.VelocityDutyCycle.value, getDifferentialPIDDutyCycle_ProportionalOutput()); 3581 toAdd.put(DifferentialControlModeValue.VelocityDutyCycleFOC.value, getDifferentialPIDDutyCycle_ProportionalOutput()); 3582 toAdd.put(DifferentialControlModeValue.MotionMagicDutyCycle.value, getDifferentialPIDDutyCycle_ProportionalOutput()); 3583 toAdd.put(DifferentialControlModeValue.MotionMagicDutyCycleFOC.value, getDifferentialPIDDutyCycle_ProportionalOutput()); 3584 toAdd.put(DifferentialControlModeValue.PositionVoltage.value, getDifferentialPIDMotorVoltage_ProportionalOutput()); 3585 toAdd.put(DifferentialControlModeValue.PositionVoltageFOC.value, getDifferentialPIDMotorVoltage_ProportionalOutput()); 3586 toAdd.put(DifferentialControlModeValue.VelocityVoltage.value, getDifferentialPIDMotorVoltage_ProportionalOutput()); 3587 toAdd.put(DifferentialControlModeValue.VelocityVoltageFOC.value, getDifferentialPIDMotorVoltage_ProportionalOutput()); 3588 toAdd.put(DifferentialControlModeValue.MotionMagicVoltage.value, getDifferentialPIDMotorVoltage_ProportionalOutput()); 3589 toAdd.put(DifferentialControlModeValue.MotionMagicVoltageFOC.value, getDifferentialPIDMotorVoltage_ProportionalOutput()); 3590 toAdd.put(DifferentialControlModeValue.PositionTorqueCurrentFOC.value, getDifferentialPIDTorqueCurrent_ProportionalOutput()); 3591 toAdd.put(DifferentialControlModeValue.VelocityTorqueCurrentFOC.value, getDifferentialPIDTorqueCurrent_ProportionalOutput()); 3592 toAdd.put(DifferentialControlModeValue.MotionMagicTorqueCurrentFOC.value, getDifferentialPIDTorqueCurrent_ProportionalOutput()); 3593 return toAdd; 3594 }; 3595 return super.lookupStatusSignal(SpnValue.TalonFX_DifferentialControlMode.value, Double.class, 10, mapFiller, "DifferentialClosedLoopProportionalOutput", true); 3596 } 3597 3598 /** 3599 * Differential closed loop integrated component 3600 * <p> 3601 * The portion of the differential closed loop output that is 3602 * proportional to the integrated error. Alternatively, the 3603 * i-Contribution of the closed loop output. 3604 * 3605 * Default Rates: 3606 * <ul> 3607 * <li> <b>CAN 2.0:</b> 100.0 Hz 3608 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 3609 * </ul> 3610 * 3611 * This refreshes and returns a cached StatusSignal object. 3612 * 3613 * @return DifferentialClosedLoopIntegratedOutput Status Signal object 3614 */ 3615 public StatusSignal<Double> getDifferentialClosedLoopIntegratedOutput() 3616 { 3617 MapGenerator<Double> mapFiller = ()->{ 3618 Map<Integer, StatusSignal<Double>> toAdd = new HashMap<Integer, StatusSignal<Double>>(); 3619 toAdd.put(DifferentialControlModeValue.PositionDutyCycle.value, getDifferentialPIDDutyCycle_IntegratedAccum()); 3620 toAdd.put(DifferentialControlModeValue.PositionDutyCycleFOC.value, getDifferentialPIDDutyCycle_IntegratedAccum()); 3621 toAdd.put(DifferentialControlModeValue.VelocityDutyCycle.value, getDifferentialPIDDutyCycle_IntegratedAccum()); 3622 toAdd.put(DifferentialControlModeValue.VelocityDutyCycleFOC.value, getDifferentialPIDDutyCycle_IntegratedAccum()); 3623 toAdd.put(DifferentialControlModeValue.MotionMagicDutyCycle.value, getDifferentialPIDDutyCycle_IntegratedAccum()); 3624 toAdd.put(DifferentialControlModeValue.MotionMagicDutyCycleFOC.value, getDifferentialPIDDutyCycle_IntegratedAccum()); 3625 toAdd.put(DifferentialControlModeValue.PositionVoltage.value, getDifferentialPIDMotorVoltage_IntegratedAccum()); 3626 toAdd.put(DifferentialControlModeValue.PositionVoltageFOC.value, getDifferentialPIDMotorVoltage_IntegratedAccum()); 3627 toAdd.put(DifferentialControlModeValue.VelocityVoltage.value, getDifferentialPIDMotorVoltage_IntegratedAccum()); 3628 toAdd.put(DifferentialControlModeValue.VelocityVoltageFOC.value, getDifferentialPIDMotorVoltage_IntegratedAccum()); 3629 toAdd.put(DifferentialControlModeValue.MotionMagicVoltage.value, getDifferentialPIDMotorVoltage_IntegratedAccum()); 3630 toAdd.put(DifferentialControlModeValue.MotionMagicVoltageFOC.value, getDifferentialPIDMotorVoltage_IntegratedAccum()); 3631 toAdd.put(DifferentialControlModeValue.PositionTorqueCurrentFOC.value, getDifferentialPIDTorqueCurrent_IntegratedAccum()); 3632 toAdd.put(DifferentialControlModeValue.VelocityTorqueCurrentFOC.value, getDifferentialPIDTorqueCurrent_IntegratedAccum()); 3633 toAdd.put(DifferentialControlModeValue.MotionMagicTorqueCurrentFOC.value, getDifferentialPIDTorqueCurrent_IntegratedAccum()); 3634 return toAdd; 3635 }; 3636 return super.lookupStatusSignal(SpnValue.TalonFX_DifferentialControlMode.value, Double.class, 11, mapFiller, "DifferentialClosedLoopIntegratedOutput", true); 3637 } 3638 3639 /** 3640 * Differential Feedforward passed by the user 3641 * <p> 3642 * This is the general feedforward that the user provides for the 3643 * differential closed loop. 3644 * 3645 * Default Rates: 3646 * <ul> 3647 * <li> <b>CAN 2.0:</b> 100.0 Hz 3648 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 3649 * </ul> 3650 * 3651 * This refreshes and returns a cached StatusSignal object. 3652 * 3653 * @return DifferentialClosedLoopFeedForward Status Signal object 3654 */ 3655 public StatusSignal<Double> getDifferentialClosedLoopFeedForward() 3656 { 3657 MapGenerator<Double> mapFiller = ()->{ 3658 Map<Integer, StatusSignal<Double>> toAdd = new HashMap<Integer, StatusSignal<Double>>(); 3659 toAdd.put(DifferentialControlModeValue.PositionDutyCycle.value, getDifferentialPIDDutyCycle_FeedForward()); 3660 toAdd.put(DifferentialControlModeValue.PositionDutyCycleFOC.value, getDifferentialPIDDutyCycle_FeedForward()); 3661 toAdd.put(DifferentialControlModeValue.VelocityDutyCycle.value, getDifferentialPIDDutyCycle_FeedForward()); 3662 toAdd.put(DifferentialControlModeValue.VelocityDutyCycleFOC.value, getDifferentialPIDDutyCycle_FeedForward()); 3663 toAdd.put(DifferentialControlModeValue.MotionMagicDutyCycle.value, getDifferentialPIDDutyCycle_FeedForward()); 3664 toAdd.put(DifferentialControlModeValue.MotionMagicDutyCycleFOC.value, getDifferentialPIDDutyCycle_FeedForward()); 3665 toAdd.put(DifferentialControlModeValue.PositionVoltage.value, getDifferentialPIDMotorVoltage_FeedForward()); 3666 toAdd.put(DifferentialControlModeValue.PositionVoltageFOC.value, getDifferentialPIDMotorVoltage_FeedForward()); 3667 toAdd.put(DifferentialControlModeValue.VelocityVoltage.value, getDifferentialPIDMotorVoltage_FeedForward()); 3668 toAdd.put(DifferentialControlModeValue.VelocityVoltageFOC.value, getDifferentialPIDMotorVoltage_FeedForward()); 3669 toAdd.put(DifferentialControlModeValue.MotionMagicVoltage.value, getDifferentialPIDMotorVoltage_FeedForward()); 3670 toAdd.put(DifferentialControlModeValue.MotionMagicVoltageFOC.value, getDifferentialPIDMotorVoltage_FeedForward()); 3671 toAdd.put(DifferentialControlModeValue.PositionTorqueCurrentFOC.value, getDifferentialPIDTorqueCurrent_FeedForward()); 3672 toAdd.put(DifferentialControlModeValue.VelocityTorqueCurrentFOC.value, getDifferentialPIDTorqueCurrent_FeedForward()); 3673 toAdd.put(DifferentialControlModeValue.MotionMagicTorqueCurrentFOC.value, getDifferentialPIDTorqueCurrent_FeedForward()); 3674 return toAdd; 3675 }; 3676 return super.lookupStatusSignal(SpnValue.TalonFX_DifferentialControlMode.value, Double.class, 12, mapFiller, "DifferentialClosedLoopFeedForward", true); 3677 } 3678 3679 /** 3680 * Differential closed loop derivative component 3681 * <p> 3682 * The portion of the differential closed loop output that is the 3683 * proportional to the deriviative the error. Alternatively, the 3684 * d-Contribution of the closed loop output. 3685 * 3686 * Default Rates: 3687 * <ul> 3688 * <li> <b>CAN 2.0:</b> 4.0 Hz 3689 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 3690 * </ul> 3691 * 3692 * This refreshes and returns a cached StatusSignal object. 3693 * 3694 * @return DifferentialClosedLoopDerivativeOutput Status Signal object 3695 */ 3696 public StatusSignal<Double> getDifferentialClosedLoopDerivativeOutput() 3697 { 3698 MapGenerator<Double> mapFiller = ()->{ 3699 Map<Integer, StatusSignal<Double>> toAdd = new HashMap<Integer, StatusSignal<Double>>(); 3700 toAdd.put(DifferentialControlModeValue.PositionDutyCycle.value, getDifferentialPIDDutyCycle_DerivativeOutput()); 3701 toAdd.put(DifferentialControlModeValue.PositionDutyCycleFOC.value, getDifferentialPIDDutyCycle_DerivativeOutput()); 3702 toAdd.put(DifferentialControlModeValue.VelocityDutyCycle.value, getDifferentialPIDDutyCycle_DerivativeOutput()); 3703 toAdd.put(DifferentialControlModeValue.VelocityDutyCycleFOC.value, getDifferentialPIDDutyCycle_DerivativeOutput()); 3704 toAdd.put(DifferentialControlModeValue.MotionMagicDutyCycle.value, getDifferentialPIDDutyCycle_DerivativeOutput()); 3705 toAdd.put(DifferentialControlModeValue.MotionMagicDutyCycleFOC.value, getDifferentialPIDDutyCycle_DerivativeOutput()); 3706 toAdd.put(DifferentialControlModeValue.PositionVoltage.value, getDiffPIDMotorVoltage_DerivativeOutput()); 3707 toAdd.put(DifferentialControlModeValue.PositionVoltageFOC.value, getDiffPIDMotorVoltage_DerivativeOutput()); 3708 toAdd.put(DifferentialControlModeValue.VelocityVoltage.value, getDiffPIDMotorVoltage_DerivativeOutput()); 3709 toAdd.put(DifferentialControlModeValue.VelocityVoltageFOC.value, getDiffPIDMotorVoltage_DerivativeOutput()); 3710 toAdd.put(DifferentialControlModeValue.MotionMagicVoltage.value, getDiffPIDMotorVoltage_DerivativeOutput()); 3711 toAdd.put(DifferentialControlModeValue.MotionMagicVoltageFOC.value, getDiffPIDMotorVoltage_DerivativeOutput()); 3712 toAdd.put(DifferentialControlModeValue.PositionTorqueCurrentFOC.value, getDifferentialPIDTorqueCurrent_DerivativeOutput()); 3713 toAdd.put(DifferentialControlModeValue.VelocityTorqueCurrentFOC.value, getDifferentialPIDTorqueCurrent_DerivativeOutput()); 3714 toAdd.put(DifferentialControlModeValue.MotionMagicTorqueCurrentFOC.value, getDifferentialPIDTorqueCurrent_DerivativeOutput()); 3715 return toAdd; 3716 }; 3717 return super.lookupStatusSignal(SpnValue.TalonFX_DifferentialControlMode.value, Double.class, 13, mapFiller, "DifferentialClosedLoopDerivativeOutput", true); 3718 } 3719 3720 /** 3721 * Differential closed loop total output 3722 * <p> 3723 * The total output of the differential closed loop output. 3724 * 3725 * Default Rates: 3726 * <ul> 3727 * <li> <b>CAN 2.0:</b> 4.0 Hz 3728 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 3729 * </ul> 3730 * 3731 * This refreshes and returns a cached StatusSignal object. 3732 * 3733 * @return DifferentialClosedLoopOutput Status Signal object 3734 */ 3735 public StatusSignal<Double> getDifferentialClosedLoopOutput() 3736 { 3737 MapGenerator<Double> mapFiller = ()->{ 3738 Map<Integer, StatusSignal<Double>> toAdd = new HashMap<Integer, StatusSignal<Double>>(); 3739 toAdd.put(DifferentialControlModeValue.PositionDutyCycle.value, getDifferentialPIDDutyCycle_Output()); 3740 toAdd.put(DifferentialControlModeValue.PositionDutyCycleFOC.value, getDifferentialPIDDutyCycle_Output()); 3741 toAdd.put(DifferentialControlModeValue.VelocityDutyCycle.value, getDifferentialPIDDutyCycle_Output()); 3742 toAdd.put(DifferentialControlModeValue.VelocityDutyCycleFOC.value, getDifferentialPIDDutyCycle_Output()); 3743 toAdd.put(DifferentialControlModeValue.MotionMagicDutyCycle.value, getDifferentialPIDDutyCycle_Output()); 3744 toAdd.put(DifferentialControlModeValue.MotionMagicDutyCycleFOC.value, getDifferentialPIDDutyCycle_Output()); 3745 toAdd.put(DifferentialControlModeValue.PositionVoltage.value, getDifferentialPIDMotorVoltage_Output()); 3746 toAdd.put(DifferentialControlModeValue.PositionVoltageFOC.value, getDifferentialPIDMotorVoltage_Output()); 3747 toAdd.put(DifferentialControlModeValue.VelocityVoltage.value, getDifferentialPIDMotorVoltage_Output()); 3748 toAdd.put(DifferentialControlModeValue.VelocityVoltageFOC.value, getDifferentialPIDMotorVoltage_Output()); 3749 toAdd.put(DifferentialControlModeValue.MotionMagicVoltage.value, getDifferentialPIDMotorVoltage_Output()); 3750 toAdd.put(DifferentialControlModeValue.MotionMagicVoltageFOC.value, getDifferentialPIDMotorVoltage_Output()); 3751 toAdd.put(DifferentialControlModeValue.PositionTorqueCurrentFOC.value, getDifferentialPIDTorqueCurrent_Output()); 3752 toAdd.put(DifferentialControlModeValue.VelocityTorqueCurrentFOC.value, getDifferentialPIDTorqueCurrent_Output()); 3753 toAdd.put(DifferentialControlModeValue.MotionMagicTorqueCurrentFOC.value, getDifferentialPIDTorqueCurrent_Output()); 3754 return toAdd; 3755 }; 3756 return super.lookupStatusSignal(SpnValue.TalonFX_DifferentialControlMode.value, Double.class, 14, mapFiller, "DifferentialClosedLoopOutput", true); 3757 } 3758 3759 /** 3760 * Value that the differential closed loop is targeting 3761 * <p> 3762 * This is the value that the differential closed loop PID controller 3763 * targets. 3764 * 3765 * Default Rates: 3766 * <ul> 3767 * <li> <b>CAN 2.0:</b> 4.0 Hz 3768 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 3769 * </ul> 3770 * 3771 * This refreshes and returns a cached StatusSignal object. 3772 * 3773 * @return DifferentialClosedLoopReference Status Signal object 3774 */ 3775 public StatusSignal<Double> getDifferentialClosedLoopReference() 3776 { 3777 MapGenerator<Double> mapFiller = ()->{ 3778 Map<Integer, StatusSignal<Double>> toAdd = new HashMap<Integer, StatusSignal<Double>>(); 3779 toAdd.put(DifferentialControlModeValue.PositionDutyCycle.value, getDifferentialPIDPosition_Reference()); 3780 toAdd.put(DifferentialControlModeValue.PositionDutyCycleFOC.value, getDifferentialPIDPosition_Reference()); 3781 toAdd.put(DifferentialControlModeValue.MotionMagicDutyCycle.value, getDifferentialPIDPosition_Reference()); 3782 toAdd.put(DifferentialControlModeValue.MotionMagicDutyCycleFOC.value, getDifferentialPIDPosition_Reference()); 3783 toAdd.put(DifferentialControlModeValue.PositionVoltage.value, getDifferentialPIDPosition_Reference()); 3784 toAdd.put(DifferentialControlModeValue.PositionVoltageFOC.value, getDifferentialPIDPosition_Reference()); 3785 toAdd.put(DifferentialControlModeValue.MotionMagicVoltage.value, getDifferentialPIDPosition_Reference()); 3786 toAdd.put(DifferentialControlModeValue.MotionMagicVoltageFOC.value, getDifferentialPIDPosition_Reference()); 3787 toAdd.put(DifferentialControlModeValue.PositionTorqueCurrentFOC.value, getDifferentialPIDPosition_Reference()); 3788 toAdd.put(DifferentialControlModeValue.MotionMagicTorqueCurrentFOC.value, getDifferentialPIDPosition_Reference()); 3789 toAdd.put(DifferentialControlModeValue.VelocityDutyCycle.value, getDifferentialPIDVelocity_Reference()); 3790 toAdd.put(DifferentialControlModeValue.VelocityDutyCycleFOC.value, getDifferentialPIDVelocity_Reference()); 3791 toAdd.put(DifferentialControlModeValue.VelocityVoltage.value, getDifferentialPIDVelocity_Reference()); 3792 toAdd.put(DifferentialControlModeValue.VelocityVoltageFOC.value, getDifferentialPIDVelocity_Reference()); 3793 toAdd.put(DifferentialControlModeValue.VelocityTorqueCurrentFOC.value, getDifferentialPIDVelocity_Reference()); 3794 return toAdd; 3795 }; 3796 return super.lookupStatusSignal(SpnValue.TalonFX_DifferentialControlMode.value, Double.class, 15, mapFiller, "DifferentialClosedLoopReference", true); 3797 } 3798 3799 /** 3800 * Derivative of the target that the differential closed loop is 3801 * targeting 3802 * <p> 3803 * This is the change in the closed loop reference. This may be used 3804 * in the feed-forward calculation, the derivative-error, or in 3805 * application of the signage for kS. Typically, this represents the 3806 * target velocity during Motion Magic®. 3807 * 3808 * Default Rates: 3809 * <ul> 3810 * <li> <b>CAN 2.0:</b> 4.0 Hz 3811 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 3812 * </ul> 3813 * 3814 * This refreshes and returns a cached StatusSignal object. 3815 * 3816 * @return DifferentialClosedLoopReferenceSlope Status Signal object 3817 */ 3818 public StatusSignal<Double> getDifferentialClosedLoopReferenceSlope() 3819 { 3820 MapGenerator<Double> mapFiller = ()->{ 3821 Map<Integer, StatusSignal<Double>> toAdd = new HashMap<Integer, StatusSignal<Double>>(); 3822 toAdd.put(DifferentialControlModeValue.PositionDutyCycle.value, getDifferentialPIDPosition_ReferenceSlope()); 3823 toAdd.put(DifferentialControlModeValue.PositionDutyCycleFOC.value, getDifferentialPIDPosition_ReferenceSlope()); 3824 toAdd.put(DifferentialControlModeValue.MotionMagicDutyCycle.value, getDifferentialPIDPosition_ReferenceSlope()); 3825 toAdd.put(DifferentialControlModeValue.MotionMagicDutyCycleFOC.value, getDifferentialPIDPosition_ReferenceSlope()); 3826 toAdd.put(DifferentialControlModeValue.PositionVoltage.value, getDifferentialPIDPosition_ReferenceSlope()); 3827 toAdd.put(DifferentialControlModeValue.PositionVoltageFOC.value, getDifferentialPIDPosition_ReferenceSlope()); 3828 toAdd.put(DifferentialControlModeValue.MotionMagicVoltage.value, getDifferentialPIDPosition_ReferenceSlope()); 3829 toAdd.put(DifferentialControlModeValue.MotionMagicVoltageFOC.value, getDifferentialPIDPosition_ReferenceSlope()); 3830 toAdd.put(DifferentialControlModeValue.PositionTorqueCurrentFOC.value, getDifferentialPIDPosition_ReferenceSlope()); 3831 toAdd.put(DifferentialControlModeValue.MotionMagicTorqueCurrentFOC.value, getDifferentialPIDPosition_ReferenceSlope()); 3832 toAdd.put(DifferentialControlModeValue.VelocityDutyCycle.value, getDifferentialPIDVelocity_ReferenceSlope()); 3833 toAdd.put(DifferentialControlModeValue.VelocityDutyCycleFOC.value, getDifferentialPIDVelocity_ReferenceSlope()); 3834 toAdd.put(DifferentialControlModeValue.VelocityVoltage.value, getDifferentialPIDVelocity_ReferenceSlope()); 3835 toAdd.put(DifferentialControlModeValue.VelocityVoltageFOC.value, getDifferentialPIDVelocity_ReferenceSlope()); 3836 toAdd.put(DifferentialControlModeValue.VelocityTorqueCurrentFOC.value, getDifferentialPIDVelocity_ReferenceSlope()); 3837 return toAdd; 3838 }; 3839 return super.lookupStatusSignal(SpnValue.TalonFX_DifferentialControlMode.value, Double.class, 16, mapFiller, "DifferentialClosedLoopReferenceSlope", true); 3840 } 3841 3842 /** 3843 * The difference between target differential reference and current 3844 * measurement 3845 * <p> 3846 * This is the value that is treated as the error in the differential 3847 * PID loop. 3848 * 3849 * Default Rates: 3850 * <ul> 3851 * <li> <b>CAN 2.0:</b> 4.0 Hz 3852 * <li> <b>CAN FD:</b> 100.0 Hz (TimeSynced with Pro) 3853 * </ul> 3854 * 3855 * This refreshes and returns a cached StatusSignal object. 3856 * 3857 * @return DifferentialClosedLoopError Status Signal object 3858 */ 3859 public StatusSignal<Double> getDifferentialClosedLoopError() 3860 { 3861 MapGenerator<Double> mapFiller = ()->{ 3862 Map<Integer, StatusSignal<Double>> toAdd = new HashMap<Integer, StatusSignal<Double>>(); 3863 toAdd.put(DifferentialControlModeValue.PositionDutyCycle.value, getDifferentialPIDPosition_ClosedLoopError()); 3864 toAdd.put(DifferentialControlModeValue.PositionDutyCycleFOC.value, getDifferentialPIDPosition_ClosedLoopError()); 3865 toAdd.put(DifferentialControlModeValue.MotionMagicDutyCycle.value, getDifferentialPIDPosition_ClosedLoopError()); 3866 toAdd.put(DifferentialControlModeValue.MotionMagicDutyCycleFOC.value, getDifferentialPIDPosition_ClosedLoopError()); 3867 toAdd.put(DifferentialControlModeValue.PositionVoltage.value, getDifferentialPIDPosition_ClosedLoopError()); 3868 toAdd.put(DifferentialControlModeValue.PositionVoltageFOC.value, getDifferentialPIDPosition_ClosedLoopError()); 3869 toAdd.put(DifferentialControlModeValue.MotionMagicVoltage.value, getDifferentialPIDPosition_ClosedLoopError()); 3870 toAdd.put(DifferentialControlModeValue.MotionMagicVoltageFOC.value, getDifferentialPIDPosition_ClosedLoopError()); 3871 toAdd.put(DifferentialControlModeValue.PositionTorqueCurrentFOC.value, getDifferentialPIDPosition_ClosedLoopError()); 3872 toAdd.put(DifferentialControlModeValue.MotionMagicTorqueCurrentFOC.value, getDifferentialPIDPosition_ClosedLoopError()); 3873 toAdd.put(DifferentialControlModeValue.VelocityDutyCycle.value, getDifferentialPIDVelocity_ClosedLoopError()); 3874 toAdd.put(DifferentialControlModeValue.VelocityDutyCycleFOC.value, getDifferentialPIDVelocity_ClosedLoopError()); 3875 toAdd.put(DifferentialControlModeValue.VelocityVoltage.value, getDifferentialPIDVelocity_ClosedLoopError()); 3876 toAdd.put(DifferentialControlModeValue.VelocityVoltageFOC.value, getDifferentialPIDVelocity_ClosedLoopError()); 3877 toAdd.put(DifferentialControlModeValue.VelocityTorqueCurrentFOC.value, getDifferentialPIDVelocity_ClosedLoopError()); 3878 return toAdd; 3879 }; 3880 return super.lookupStatusSignal(SpnValue.TalonFX_DifferentialControlMode.value, Double.class, 17, mapFiller, "DifferentialClosedLoopError", true); 3881 } 3882 3883 3884 /** 3885 * Request a specified motor duty cycle. 3886 * <p> 3887 * This control mode will output a proportion of the supplied voltage 3888 * which is supplied by the user. 3889 * <ul> 3890 * <li> <b>DutyCycleOut Parameters:</b> 3891 * <ul> 3892 * <li> <b>Output:</b> Proportion of supply voltage to apply in fractional 3893 * units between -1 and +1 3894 * <li> <b>EnableFOC:</b> Set to true to use FOC commutation (requires Phoenix 3895 * Pro), which increases peak power by ~15%. Set to 3896 * false to use trapezoidal commutation. 3897 * <p> 3898 * FOC improves motor performance by leveraging torque 3899 * (current) control. However, this may be inconvenient 3900 * for applications that require specifying duty cycle 3901 * or voltage. CTR-Electronics has developed a hybrid 3902 * method that combines the performances gains of FOC 3903 * while still allowing applications to provide duty 3904 * cycle or voltage demand. This not to be confused 3905 * with simple sinusoidal control or phase voltage 3906 * control which lacks the performance gains. 3907 * <li> <b>OverrideBrakeDurNeutral:</b> Set to true to static-brake the rotor 3908 * when output is zero (or within 3909 * deadband). Set to false to use the 3910 * NeutralMode configuration setting 3911 * (default). This flag exists to provide 3912 * the fundamental behavior of this 3913 * control when output is zero, which is 3914 * to provide 0V to the motor. 3915 * <li> <b>LimitForwardMotion:</b> Set to true to force forward limiting. This 3916 * allows users to use other limit switch 3917 * sensors connected to robot controller. This 3918 * also allows use of active sensors that 3919 * require external power. 3920 * <li> <b>LimitReverseMotion:</b> Set to true to force reverse limiting. This 3921 * allows users to use other limit switch 3922 * sensors connected to robot controller. This 3923 * also allows use of active sensors that 3924 * require external power. 3925 * </ul> 3926 * </ul> 3927 * 3928 * @param request Control object to request of the device 3929 * @return Code response of the request 3930 */ 3931 public StatusCode setControl(DutyCycleOut request) 3932 { 3933 return setControlPrivate(request); 3934 } 3935 3936 /** 3937 * Request a specified motor current (field oriented control). 3938 * <p> 3939 * This control request will drive the motor to the requested motor 3940 * (stator) current value. This leverages field oriented control 3941 * (FOC), which means greater peak power than what is documented. 3942 * This scales to torque based on Motor's kT constant. 3943 * <ul> 3944 * <li> <b>TorqueCurrentFOC Parameters:</b> 3945 * <ul> 3946 * <li> <b>Output:</b> Amount of motor current in Amperes 3947 * <li> <b>MaxAbsDutyCycle:</b> The maximum absolute motor output that can be 3948 * applied, which effectively limits the velocity. 3949 * For example, 0.50 means no more than 50% output 3950 * in either direction. This is useful for 3951 * preventing the motor from spinning to its 3952 * terminal velocity when there is no external 3953 * torque applied unto the rotor. Note this is 3954 * absolute maximum, so the value should be 3955 * between zero and one. 3956 * <li> <b>Deadband:</b> Deadband in Amperes. If torque request is within 3957 * deadband, the bridge output is neutral. If deadband is 3958 * set to zero then there is effectively no deadband. 3959 * Note if deadband is zero, a free spinning motor will 3960 * spin for quite a while as the firmware attempts to 3961 * hold the motor's bemf. If user expects motor to cease 3962 * spinning quickly with a demand of zero, we recommend a 3963 * deadband of one Ampere. This value will be converted 3964 * to an integral value of amps. 3965 * <li> <b>OverrideCoastDurNeutral:</b> Set to true to coast the rotor when 3966 * output is zero (or within deadband). 3967 * Set to false to use the NeutralMode 3968 * configuration setting (default). This 3969 * flag exists to provide the fundamental 3970 * behavior of this control when output is 3971 * zero, which is to provide 0A (zero 3972 * torque). 3973 * <li> <b>LimitForwardMotion:</b> Set to true to force forward limiting. This 3974 * allows users to use other limit switch 3975 * sensors connected to robot controller. This 3976 * also allows use of active sensors that 3977 * require external power. 3978 * <li> <b>LimitReverseMotion:</b> Set to true to force reverse limiting. This 3979 * allows users to use other limit switch 3980 * sensors connected to robot controller. This 3981 * also allows use of active sensors that 3982 * require external power. 3983 * </ul> 3984 * </ul> 3985 * 3986 * @param request Control object to request of the device 3987 * @return Code response of the request 3988 */ 3989 public StatusCode setControl(TorqueCurrentFOC request) 3990 { 3991 return setControlPrivate(request); 3992 } 3993 3994 /** 3995 * Request a specified voltage. 3996 * <p> 3997 * This control mode will attempt to apply the specified voltage to 3998 * the motor. If the supply voltage is below the requested voltage, 3999 * the motor controller will output the supply voltage. 4000 * <ul> 4001 * <li> <b>VoltageOut Parameters:</b> 4002 * <ul> 4003 * <li> <b>Output:</b> Voltage to attempt to drive at 4004 * <li> <b>EnableFOC:</b> Set to true to use FOC commutation (requires Phoenix 4005 * Pro), which increases peak power by ~15%. Set to 4006 * false to use trapezoidal commutation. 4007 * <p> 4008 * FOC improves motor performance by leveraging torque 4009 * (current) control. However, this may be inconvenient 4010 * for applications that require specifying duty cycle 4011 * or voltage. CTR-Electronics has developed a hybrid 4012 * method that combines the performances gains of FOC 4013 * while still allowing applications to provide duty 4014 * cycle or voltage demand. This not to be confused 4015 * with simple sinusoidal control or phase voltage 4016 * control which lacks the performance gains. 4017 * <li> <b>OverrideBrakeDurNeutral:</b> Set to true to static-brake the rotor 4018 * when output is zero (or within 4019 * deadband). Set to false to use the 4020 * NeutralMode configuration setting 4021 * (default). This flag exists to provide 4022 * the fundamental behavior of this 4023 * control when output is zero, which is 4024 * to provide 0V to the motor. 4025 * <li> <b>LimitForwardMotion:</b> Set to true to force forward limiting. This 4026 * allows users to use other limit switch 4027 * sensors connected to robot controller. This 4028 * also allows use of active sensors that 4029 * require external power. 4030 * <li> <b>LimitReverseMotion:</b> Set to true to force reverse limiting. This 4031 * allows users to use other limit switch 4032 * sensors connected to robot controller. This 4033 * also allows use of active sensors that 4034 * require external power. 4035 * </ul> 4036 * </ul> 4037 * 4038 * @param request Control object to request of the device 4039 * @return Code response of the request 4040 */ 4041 public StatusCode setControl(VoltageOut request) 4042 { 4043 return setControlPrivate(request); 4044 } 4045 4046 /** 4047 * Request PID to target position with duty cycle feedforward. 4048 * <p> 4049 * This control mode will set the motor's position setpoint to the 4050 * position specified by the user. In addition, it will apply an 4051 * additional duty cycle as an arbitrary feedforward value. 4052 * <ul> 4053 * <li> <b>PositionDutyCycle Parameters:</b> 4054 * <ul> 4055 * <li> <b>Position:</b> Position to drive toward in rotations. 4056 * <li> <b>Velocity:</b> Velocity to drive toward in rotations per second. This 4057 * is typically used for motion profiles generated by the 4058 * robot program. 4059 * <li> <b>EnableFOC:</b> Set to true to use FOC commutation (requires Phoenix 4060 * Pro), which increases peak power by ~15%. Set to 4061 * false to use trapezoidal commutation. 4062 * <p> 4063 * FOC improves motor performance by leveraging torque 4064 * (current) control. However, this may be inconvenient 4065 * for applications that require specifying duty cycle 4066 * or voltage. CTR-Electronics has developed a hybrid 4067 * method that combines the performances gains of FOC 4068 * while still allowing applications to provide duty 4069 * cycle or voltage demand. This not to be confused 4070 * with simple sinusoidal control or phase voltage 4071 * control which lacks the performance gains. 4072 * <li> <b>FeedForward:</b> Feedforward to apply in fractional units between -1 4073 * and +1. 4074 * <li> <b>Slot:</b> Select which gains are applied by selecting the slot. Use 4075 * the configuration api to set the gain values for the 4076 * selected slot before enabling this feature. Slot must be 4077 * within [0,2]. 4078 * <li> <b>OverrideBrakeDurNeutral:</b> Set to true to static-brake the rotor 4079 * when output is zero (or within 4080 * deadband). Set to false to use the 4081 * NeutralMode configuration setting 4082 * (default). This flag exists to provide 4083 * the fundamental behavior of this 4084 * control when output is zero, which is 4085 * to provide 0V to the motor. 4086 * <li> <b>LimitForwardMotion:</b> Set to true to force forward limiting. This 4087 * allows users to use other limit switch 4088 * sensors connected to robot controller. This 4089 * also allows use of active sensors that 4090 * require external power. 4091 * <li> <b>LimitReverseMotion:</b> Set to true to force reverse limiting. This 4092 * allows users to use other limit switch 4093 * sensors connected to robot controller. This 4094 * also allows use of active sensors that 4095 * require external power. 4096 * </ul> 4097 * </ul> 4098 * 4099 * @param request Control object to request of the device 4100 * @return Code response of the request 4101 */ 4102 public StatusCode setControl(PositionDutyCycle request) 4103 { 4104 return setControlPrivate(request); 4105 } 4106 4107 /** 4108 * Request PID to target position with voltage feedforward 4109 * <p> 4110 * This control mode will set the motor's position setpoint to the 4111 * position specified by the user. In addition, it will apply an 4112 * additional voltage as an arbitrary feedforward value. 4113 * <ul> 4114 * <li> <b>PositionVoltage Parameters:</b> 4115 * <ul> 4116 * <li> <b>Position:</b> Position to drive toward in rotations. 4117 * <li> <b>Velocity:</b> Velocity to drive toward in rotations per second. This 4118 * is typically used for motion profiles generated by the 4119 * robot program. 4120 * <li> <b>EnableFOC:</b> Set to true to use FOC commutation (requires Phoenix 4121 * Pro), which increases peak power by ~15%. Set to 4122 * false to use trapezoidal commutation. 4123 * <p> 4124 * FOC improves motor performance by leveraging torque 4125 * (current) control. However, this may be inconvenient 4126 * for applications that require specifying duty cycle 4127 * or voltage. CTR-Electronics has developed a hybrid 4128 * method that combines the performances gains of FOC 4129 * while still allowing applications to provide duty 4130 * cycle or voltage demand. This not to be confused 4131 * with simple sinusoidal control or phase voltage 4132 * control which lacks the performance gains. 4133 * <li> <b>FeedForward:</b> Feedforward to apply in volts 4134 * <li> <b>Slot:</b> Select which gains are applied by selecting the slot. Use 4135 * the configuration api to set the gain values for the 4136 * selected slot before enabling this feature. Slot must be 4137 * within [0,2]. 4138 * <li> <b>OverrideBrakeDurNeutral:</b> Set to true to static-brake the rotor 4139 * when output is zero (or within 4140 * deadband). Set to false to use the 4141 * NeutralMode configuration setting 4142 * (default). This flag exists to provide 4143 * the fundamental behavior of this 4144 * control when output is zero, which is 4145 * to provide 0V to the motor. 4146 * <li> <b>LimitForwardMotion:</b> Set to true to force forward limiting. This 4147 * allows users to use other limit switch 4148 * sensors connected to robot controller. This 4149 * also allows use of active sensors that 4150 * require external power. 4151 * <li> <b>LimitReverseMotion:</b> Set to true to force reverse limiting. This 4152 * allows users to use other limit switch 4153 * sensors connected to robot controller. This 4154 * also allows use of active sensors that 4155 * require external power. 4156 * </ul> 4157 * </ul> 4158 * 4159 * @param request Control object to request of the device 4160 * @return Code response of the request 4161 */ 4162 public StatusCode setControl(PositionVoltage request) 4163 { 4164 return setControlPrivate(request); 4165 } 4166 4167 /** 4168 * Request PID to target position with torque current feedforward. 4169 * <p> 4170 * This control mode will set the motor's position setpoint to the 4171 * position specified by the user. In addition, it will apply an 4172 * additional torque current as an arbitrary feedforward value. 4173 * <ul> 4174 * <li> <b>PositionTorqueCurrentFOC Parameters:</b> 4175 * <ul> 4176 * <li> <b>Position:</b> Position to drive toward in rotations. 4177 * <li> <b>Velocity:</b> Velocity to drive toward in rotations per second. This 4178 * is typically used for motion profiles generated by the 4179 * robot program. 4180 * <li> <b>FeedForward:</b> Feedforward to apply in torque current in Amperes. 4181 * User can use motor's kT to scale Newton-meter to 4182 * Amperes. 4183 * <li> <b>Slot:</b> Select which gains are applied by selecting the slot. Use 4184 * the configuration api to set the gain values for the 4185 * selected slot before enabling this feature. Slot must be 4186 * within [0,2]. 4187 * <li> <b>OverrideCoastDurNeutral:</b> Set to true to coast the rotor when 4188 * output is zero (or within deadband). 4189 * Set to false to use the NeutralMode 4190 * configuration setting (default). This 4191 * flag exists to provide the fundamental 4192 * behavior of this control when output is 4193 * zero, which is to provide 0A (zero 4194 * torque). 4195 * <li> <b>LimitForwardMotion:</b> Set to true to force forward limiting. This 4196 * allows users to use other limit switch 4197 * sensors connected to robot controller. This 4198 * also allows use of active sensors that 4199 * require external power. 4200 * <li> <b>LimitReverseMotion:</b> Set to true to force reverse limiting. This 4201 * allows users to use other limit switch 4202 * sensors connected to robot controller. This 4203 * also allows use of active sensors that 4204 * require external power. 4205 * </ul> 4206 * </ul> 4207 * 4208 * @param request Control object to request of the device 4209 * @return Code response of the request 4210 */ 4211 public StatusCode setControl(PositionTorqueCurrentFOC request) 4212 { 4213 return setControlPrivate(request); 4214 } 4215 4216 /** 4217 * Request PID to target velocity with duty cycle feedforward. 4218 * <p> 4219 * This control mode will set the motor's velocity setpoint to the 4220 * velocity specified by the user. In addition, it will apply an 4221 * additional voltage as an arbitrary feedforward value. 4222 * <ul> 4223 * <li> <b>VelocityDutyCycle Parameters:</b> 4224 * <ul> 4225 * <li> <b>Velocity:</b> Velocity to drive toward in rotations per second. 4226 * <li> <b>Acceleration:</b> Acceleration to drive toward in rotations per 4227 * second squared. This is typically used for motion 4228 * profiles generated by the robot program. 4229 * <li> <b>EnableFOC:</b> Set to true to use FOC commutation (requires Phoenix 4230 * Pro), which increases peak power by ~15%. Set to 4231 * false to use trapezoidal commutation. 4232 * <p> 4233 * FOC improves motor performance by leveraging torque 4234 * (current) control. However, this may be inconvenient 4235 * for applications that require specifying duty cycle 4236 * or voltage. CTR-Electronics has developed a hybrid 4237 * method that combines the performances gains of FOC 4238 * while still allowing applications to provide duty 4239 * cycle or voltage demand. This not to be confused 4240 * with simple sinusoidal control or phase voltage 4241 * control which lacks the performance gains. 4242 * <li> <b>FeedForward:</b> Feedforward to apply in fractional units between -1 4243 * and +1. 4244 * <li> <b>Slot:</b> Select which gains are applied by selecting the slot. Use 4245 * the configuration api to set the gain values for the 4246 * selected slot before enabling this feature. Slot must be 4247 * within [0,2]. 4248 * <li> <b>OverrideBrakeDurNeutral:</b> Set to true to static-brake the rotor 4249 * when output is zero (or within 4250 * deadband). Set to false to use the 4251 * NeutralMode configuration setting 4252 * (default). This flag exists to provide 4253 * the fundamental behavior of this 4254 * control when output is zero, which is 4255 * to provide 0V to the motor. 4256 * <li> <b>LimitForwardMotion:</b> Set to true to force forward limiting. This 4257 * allows users to use other limit switch 4258 * sensors connected to robot controller. This 4259 * also allows use of active sensors that 4260 * require external power. 4261 * <li> <b>LimitReverseMotion:</b> Set to true to force reverse limiting. This 4262 * allows users to use other limit switch 4263 * sensors connected to robot controller. This 4264 * also allows use of active sensors that 4265 * require external power. 4266 * </ul> 4267 * </ul> 4268 * 4269 * @param request Control object to request of the device 4270 * @return Code response of the request 4271 */ 4272 public StatusCode setControl(VelocityDutyCycle request) 4273 { 4274 return setControlPrivate(request); 4275 } 4276 4277 /** 4278 * Request PID to target velocity with voltage feedforward. 4279 * <p> 4280 * This control mode will set the motor's velocity setpoint to the 4281 * velocity specified by the user. In addition, it will apply an 4282 * additional voltage as an arbitrary feedforward value. 4283 * <ul> 4284 * <li> <b>VelocityVoltage Parameters:</b> 4285 * <ul> 4286 * <li> <b>Velocity:</b> Velocity to drive toward in rotations per second. 4287 * <li> <b>Acceleration:</b> Acceleration to drive toward in rotations per 4288 * second squared. This is typically used for motion 4289 * profiles generated by the robot program. 4290 * <li> <b>EnableFOC:</b> Set to true to use FOC commutation (requires Phoenix 4291 * Pro), which increases peak power by ~15%. Set to 4292 * false to use trapezoidal commutation. 4293 * <p> 4294 * FOC improves motor performance by leveraging torque 4295 * (current) control. However, this may be inconvenient 4296 * for applications that require specifying duty cycle 4297 * or voltage. CTR-Electronics has developed a hybrid 4298 * method that combines the performances gains of FOC 4299 * while still allowing applications to provide duty 4300 * cycle or voltage demand. This not to be confused 4301 * with simple sinusoidal control or phase voltage 4302 * control which lacks the performance gains. 4303 * <li> <b>FeedForward:</b> Feedforward to apply in volts 4304 * <li> <b>Slot:</b> Select which gains are applied by selecting the slot. Use 4305 * the configuration api to set the gain values for the 4306 * selected slot before enabling this feature. Slot must be 4307 * within [0,2]. 4308 * <li> <b>OverrideBrakeDurNeutral:</b> Set to true to static-brake the rotor 4309 * when output is zero (or within 4310 * deadband). Set to false to use the 4311 * NeutralMode configuration setting 4312 * (default). This flag exists to provide 4313 * the fundamental behavior of this 4314 * control when output is zero, which is 4315 * to provide 0V to the motor. 4316 * <li> <b>LimitForwardMotion:</b> Set to true to force forward limiting. This 4317 * allows users to use other limit switch 4318 * sensors connected to robot controller. This 4319 * also allows use of active sensors that 4320 * require external power. 4321 * <li> <b>LimitReverseMotion:</b> Set to true to force reverse limiting. This 4322 * allows users to use other limit switch 4323 * sensors connected to robot controller. This 4324 * also allows use of active sensors that 4325 * require external power. 4326 * </ul> 4327 * </ul> 4328 * 4329 * @param request Control object to request of the device 4330 * @return Code response of the request 4331 */ 4332 public StatusCode setControl(VelocityVoltage request) 4333 { 4334 return setControlPrivate(request); 4335 } 4336 4337 /** 4338 * Request PID to target velocity with torque current feedforward. 4339 * <p> 4340 * This control mode will set the motor's velocity setpoint to the 4341 * velocity specified by the user. In addition, it will apply an 4342 * additional torque current as an arbitrary feedforward value. 4343 * <ul> 4344 * <li> <b>VelocityTorqueCurrentFOC Parameters:</b> 4345 * <ul> 4346 * <li> <b>Velocity:</b> Velocity to drive toward in rotations per second. 4347 * <li> <b>Acceleration:</b> Acceleration to drive toward in rotations per 4348 * second squared. This is typically used for motion 4349 * profiles generated by the robot program. 4350 * <li> <b>FeedForward:</b> Feedforward to apply in torque current in Amperes. 4351 * User can use motor's kT to scale Newton-meter to 4352 * Amperes. 4353 * <li> <b>Slot:</b> Select which gains are applied by selecting the slot. Use 4354 * the configuration api to set the gain values for the 4355 * selected slot before enabling this feature. Slot must be 4356 * within [0,2]. 4357 * <li> <b>OverrideCoastDurNeutral:</b> Set to true to coast the rotor when 4358 * output is zero (or within deadband). 4359 * Set to false to use the NeutralMode 4360 * configuration setting (default). This 4361 * flag exists to provide the fundamental 4362 * behavior of this control when output is 4363 * zero, which is to provide 0A (zero 4364 * torque). 4365 * <li> <b>LimitForwardMotion:</b> Set to true to force forward limiting. This 4366 * allows users to use other limit switch 4367 * sensors connected to robot controller. This 4368 * also allows use of active sensors that 4369 * require external power. 4370 * <li> <b>LimitReverseMotion:</b> Set to true to force reverse limiting. This 4371 * allows users to use other limit switch 4372 * sensors connected to robot controller. This 4373 * also allows use of active sensors that 4374 * require external power. 4375 * </ul> 4376 * </ul> 4377 * 4378 * @param request Control object to request of the device 4379 * @return Code response of the request 4380 */ 4381 public StatusCode setControl(VelocityTorqueCurrentFOC request) 4382 { 4383 return setControlPrivate(request); 4384 } 4385 4386 /** 4387 * Requests Motion Magic® to target a final position using a motion 4388 * profile. Users can optionally provide a duty cycle feedforward. 4389 * <p> 4390 * Motion Magic® produces a motion profile in real-time while 4391 * attempting to honor the Cruise Velocity, Acceleration, and Jerk 4392 * value specified via the Motion Magic® configuration values. This 4393 * control mode does not use the Expo_kV or Expo_kA configs. Target 4394 * position can be changed on-the-fly and Motion Magic® will do its 4395 * best to adjust the profile. This control mode is duty cycle based, 4396 * so relevant closed-loop gains will use fractional duty cycle for 4397 * the numerator: +1.0 represents full forward output. 4398 * <ul> 4399 * <li> <b>MotionMagicDutyCycle Parameters:</b> 4400 * <ul> 4401 * <li> <b>Position:</b> Position to drive toward in rotations. 4402 * <li> <b>EnableFOC:</b> Set to true to use FOC commutation (requires Phoenix 4403 * Pro), which increases peak power by ~15%. Set to 4404 * false to use trapezoidal commutation. 4405 * <p> 4406 * FOC improves motor performance by leveraging torque 4407 * (current) control. However, this may be inconvenient 4408 * for applications that require specifying duty cycle 4409 * or voltage. CTR-Electronics has developed a hybrid 4410 * method that combines the performances gains of FOC 4411 * while still allowing applications to provide duty 4412 * cycle or voltage demand. This not to be confused 4413 * with simple sinusoidal control or phase voltage 4414 * control which lacks the performance gains. 4415 * <li> <b>FeedForward:</b> Feedforward to apply in fractional units between -1 4416 * and +1. 4417 * <li> <b>Slot:</b> Select which gains are applied by selecting the slot. Use 4418 * the configuration api to set the gain values for the 4419 * selected slot before enabling this feature. Slot must be 4420 * within [0,2]. 4421 * <li> <b>OverrideBrakeDurNeutral:</b> Set to true to static-brake the rotor 4422 * when output is zero (or within 4423 * deadband). Set to false to use the 4424 * NeutralMode configuration setting 4425 * (default). This flag exists to provide 4426 * the fundamental behavior of this 4427 * control when output is zero, which is 4428 * to provide 0V to the motor. 4429 * <li> <b>LimitForwardMotion:</b> Set to true to force forward limiting. This 4430 * allows users to use other limit switch 4431 * sensors connected to robot controller. This 4432 * also allows use of active sensors that 4433 * require external power. 4434 * <li> <b>LimitReverseMotion:</b> Set to true to force reverse limiting. This 4435 * allows users to use other limit switch 4436 * sensors connected to robot controller. This 4437 * also allows use of active sensors that 4438 * require external power. 4439 * </ul> 4440 * </ul> 4441 * 4442 * @param request Control object to request of the device 4443 * @return Code response of the request 4444 */ 4445 public StatusCode setControl(MotionMagicDutyCycle request) 4446 { 4447 return setControlPrivate(request); 4448 } 4449 4450 /** 4451 * Requests Motion Magic® to target a final position using a motion 4452 * profile. Users can optionally provide a voltage feedforward. 4453 * <p> 4454 * Motion Magic® produces a motion profile in real-time while 4455 * attempting to honor the Cruise Velocity, Acceleration, and Jerk 4456 * value specified via the Motion Magic® configuration values. This 4457 * control mode does not use the Expo_kV or Expo_kA configs. Target 4458 * position can be changed on-the-fly and Motion Magic® will do its 4459 * best to adjust the profile. This control mode is voltage-based, so 4460 * relevant closed-loop gains will use Volts for the numerator. 4461 * <ul> 4462 * <li> <b>MotionMagicVoltage Parameters:</b> 4463 * <ul> 4464 * <li> <b>Position:</b> Position to drive toward in rotations. 4465 * <li> <b>EnableFOC:</b> Set to true to use FOC commutation (requires Phoenix 4466 * Pro), which increases peak power by ~15%. Set to 4467 * false to use trapezoidal commutation. 4468 * <p> 4469 * FOC improves motor performance by leveraging torque 4470 * (current) control. However, this may be inconvenient 4471 * for applications that require specifying duty cycle 4472 * or voltage. CTR-Electronics has developed a hybrid 4473 * method that combines the performances gains of FOC 4474 * while still allowing applications to provide duty 4475 * cycle or voltage demand. This not to be confused 4476 * with simple sinusoidal control or phase voltage 4477 * control which lacks the performance gains. 4478 * <li> <b>FeedForward:</b> Feedforward to apply in volts 4479 * <li> <b>Slot:</b> Select which gains are applied by selecting the slot. Use 4480 * the configuration api to set the gain values for the 4481 * selected slot before enabling this feature. Slot must be 4482 * within [0,2]. 4483 * <li> <b>OverrideBrakeDurNeutral:</b> Set to true to static-brake the rotor 4484 * when output is zero (or within 4485 * deadband). Set to false to use the 4486 * NeutralMode configuration setting 4487 * (default). This flag exists to provide 4488 * the fundamental behavior of this 4489 * control when output is zero, which is 4490 * to provide 0V to the motor. 4491 * <li> <b>LimitForwardMotion:</b> Set to true to force forward limiting. This 4492 * allows users to use other limit switch 4493 * sensors connected to robot controller. This 4494 * also allows use of active sensors that 4495 * require external power. 4496 * <li> <b>LimitReverseMotion:</b> Set to true to force reverse limiting. This 4497 * allows users to use other limit switch 4498 * sensors connected to robot controller. This 4499 * also allows use of active sensors that 4500 * require external power. 4501 * </ul> 4502 * </ul> 4503 * 4504 * @param request Control object to request of the device 4505 * @return Code response of the request 4506 */ 4507 public StatusCode setControl(MotionMagicVoltage request) 4508 { 4509 return setControlPrivate(request); 4510 } 4511 4512 /** 4513 * Requests Motion Magic® to target a final position using a motion 4514 * profile. Users can optionally provide a torque current 4515 * feedforward. 4516 * <p> 4517 * Motion Magic® produces a motion profile in real-time while 4518 * attempting to honor the Cruise Velocity, Acceleration, and Jerk 4519 * value specified via the Motion Magic® configuration values. This 4520 * control mode does not use the Expo_kV or Expo_kA configs. Target 4521 * position can be changed on-the-fly and Motion Magic® will do its 4522 * best to adjust the profile. This control mode is based on torque 4523 * current, so relevant closed-loop gains will use Amperes for the 4524 * numerator. 4525 * <ul> 4526 * <li> <b>MotionMagicTorqueCurrentFOC Parameters:</b> 4527 * <ul> 4528 * <li> <b>Position:</b> Position to drive toward in rotations. 4529 * <li> <b>FeedForward:</b> Feedforward to apply in torque current in Amperes. 4530 * User can use motor's kT to scale Newton-meter to 4531 * Amperes. 4532 * <li> <b>Slot:</b> Select which gains are applied by selecting the slot. Use 4533 * the configuration api to set the gain values for the 4534 * selected slot before enabling this feature. Slot must be 4535 * within [0,2]. 4536 * <li> <b>OverrideCoastDurNeutral:</b> Set to true to coast the rotor when 4537 * output is zero (or within deadband). 4538 * Set to false to use the NeutralMode 4539 * configuration setting (default). This 4540 * flag exists to provide the fundamental 4541 * behavior of this control when output is 4542 * zero, which is to provide 0A (zero 4543 * torque). 4544 * <li> <b>LimitForwardMotion:</b> Set to true to force forward limiting. This 4545 * allows users to use other limit switch 4546 * sensors connected to robot controller. This 4547 * also allows use of active sensors that 4548 * require external power. 4549 * <li> <b>LimitReverseMotion:</b> Set to true to force reverse limiting. This 4550 * allows users to use other limit switch 4551 * sensors connected to robot controller. This 4552 * also allows use of active sensors that 4553 * require external power. 4554 * </ul> 4555 * </ul> 4556 * 4557 * @param request Control object to request of the device 4558 * @return Code response of the request 4559 */ 4560 public StatusCode setControl(MotionMagicTorqueCurrentFOC request) 4561 { 4562 return setControlPrivate(request); 4563 } 4564 4565 /** 4566 * Request a specified motor duty cycle with a differential position 4567 * closed-loop. 4568 * <p> 4569 * This control mode will output a proportion of the supplied voltage 4570 * which is supplied by the user. It will also set the motor's 4571 * differential position setpoint to the specified position. 4572 * <ul> 4573 * <li> <b>DifferentialDutyCycle Parameters:</b> 4574 * <ul> 4575 * <li> <b>TargetOutput:</b> Proportion of supply voltage to apply in 4576 * fractional units between -1 and +1 4577 * <li> <b>DifferentialPosition:</b> Differential position to drive towards in 4578 * rotations 4579 * <li> <b>EnableFOC:</b> Set to true to use FOC commutation (requires Phoenix 4580 * Pro), which increases peak power by ~15%. Set to 4581 * false to use trapezoidal commutation. 4582 * <p> 4583 * FOC improves motor performance by leveraging torque 4584 * (current) control. However, this may be inconvenient 4585 * for applications that require specifying duty cycle 4586 * or voltage. CTR-Electronics has developed a hybrid 4587 * method that combines the performances gains of FOC 4588 * while still allowing applications to provide duty 4589 * cycle or voltage demand. This not to be confused 4590 * with simple sinusoidal control or phase voltage 4591 * control which lacks the performance gains. 4592 * <li> <b>DifferentialSlot:</b> Select which gains are applied to the 4593 * differential controller by selecting the slot. 4594 * Use the configuration api to set the gain 4595 * values for the selected slot before enabling 4596 * this feature. Slot must be within [0,2]. 4597 * <li> <b>OverrideBrakeDurNeutral:</b> Set to true to static-brake the rotor 4598 * when output is zero (or within 4599 * deadband). Set to false to use the 4600 * NeutralMode configuration setting 4601 * (default). This flag exists to provide 4602 * the fundamental behavior of this 4603 * control when output is zero, which is 4604 * to provide 0V to the motor. 4605 * <li> <b>LimitForwardMotion:</b> Set to true to force forward limiting. This 4606 * allows users to use other limit switch 4607 * sensors connected to robot controller. This 4608 * also allows use of active sensors that 4609 * require external power. 4610 * <li> <b>LimitReverseMotion:</b> Set to true to force reverse limiting. This 4611 * allows users to use other limit switch 4612 * sensors connected to robot controller. This 4613 * also allows use of active sensors that 4614 * require external power. 4615 * </ul> 4616 * </ul> 4617 * 4618 * @param request Control object to request of the device 4619 * @return Code response of the request 4620 */ 4621 public StatusCode setControl(DifferentialDutyCycle request) 4622 { 4623 return setControlPrivate(request); 4624 } 4625 4626 /** 4627 * Request a specified voltage with a differential position 4628 * closed-loop. 4629 * <p> 4630 * This control mode will attempt to apply the specified voltage to 4631 * the motor. If the supply voltage is below the requested voltage, 4632 * the motor controller will output the supply voltage. It will also 4633 * set the motor's differential position setpoint to the specified 4634 * position. 4635 * <ul> 4636 * <li> <b>DifferentialVoltage Parameters:</b> 4637 * <ul> 4638 * <li> <b>TargetOutput:</b> Voltage to attempt to drive at 4639 * <li> <b>DifferentialPosition:</b> Differential position to drive towards in 4640 * rotations 4641 * <li> <b>EnableFOC:</b> Set to true to use FOC commutation (requires Phoenix 4642 * Pro), which increases peak power by ~15%. Set to 4643 * false to use trapezoidal commutation. 4644 * <p> 4645 * FOC improves motor performance by leveraging torque 4646 * (current) control. However, this may be inconvenient 4647 * for applications that require specifying duty cycle 4648 * or voltage. CTR-Electronics has developed a hybrid 4649 * method that combines the performances gains of FOC 4650 * while still allowing applications to provide duty 4651 * cycle or voltage demand. This not to be confused 4652 * with simple sinusoidal control or phase voltage 4653 * control which lacks the performance gains. 4654 * <li> <b>DifferentialSlot:</b> Select which gains are applied to the 4655 * differential controller by selecting the slot. 4656 * Use the configuration api to set the gain 4657 * values for the selected slot before enabling 4658 * this feature. Slot must be within [0,2]. 4659 * <li> <b>OverrideBrakeDurNeutral:</b> Set to true to static-brake the rotor 4660 * when output is zero (or within 4661 * deadband). Set to false to use the 4662 * NeutralMode configuration setting 4663 * (default). This flag exists to provide 4664 * the fundamental behavior of this 4665 * control when output is zero, which is 4666 * to provide 0V to the motor. 4667 * <li> <b>LimitForwardMotion:</b> Set to true to force forward limiting. This 4668 * allows users to use other limit switch 4669 * sensors connected to robot controller. This 4670 * also allows use of active sensors that 4671 * require external power. 4672 * <li> <b>LimitReverseMotion:</b> Set to true to force reverse limiting. This 4673 * allows users to use other limit switch 4674 * sensors connected to robot controller. This 4675 * also allows use of active sensors that 4676 * require external power. 4677 * </ul> 4678 * </ul> 4679 * 4680 * @param request Control object to request of the device 4681 * @return Code response of the request 4682 */ 4683 public StatusCode setControl(DifferentialVoltage request) 4684 { 4685 return setControlPrivate(request); 4686 } 4687 4688 /** 4689 * Request PID to target position with a differential position 4690 * setpoint. 4691 * <p> 4692 * This control mode will set the motor's position setpoint to the 4693 * position specified by the user. It will also set the motor's 4694 * differential position setpoint to the specified position. 4695 * <ul> 4696 * <li> <b>DifferentialPositionDutyCycle Parameters:</b> 4697 * <ul> 4698 * <li> <b>TargetPosition:</b> Average position to drive toward in rotations. 4699 * <li> <b>DifferentialPosition:</b> Differential position to drive toward in 4700 * rotations. 4701 * <li> <b>EnableFOC:</b> Set to true to use FOC commutation (requires Phoenix 4702 * Pro), which increases peak power by ~15%. Set to 4703 * false to use trapezoidal commutation. 4704 * <p> 4705 * FOC improves motor performance by leveraging torque 4706 * (current) control. However, this may be inconvenient 4707 * for applications that require specifying duty cycle 4708 * or voltage. CTR-Electronics has developed a hybrid 4709 * method that combines the performances gains of FOC 4710 * while still allowing applications to provide duty 4711 * cycle or voltage demand. This not to be confused 4712 * with simple sinusoidal control or phase voltage 4713 * control which lacks the performance gains. 4714 * <li> <b>TargetSlot:</b> Select which gains are applied to the primary 4715 * controller by selecting the slot. Use the 4716 * configuration api to set the gain values for the 4717 * selected slot before enabling this feature. Slot 4718 * must be within [0,2]. 4719 * <li> <b>DifferentialSlot:</b> Select which gains are applied to the 4720 * differential controller by selecting the slot. 4721 * Use the configuration api to set the gain 4722 * values for the selected slot before enabling 4723 * this feature. Slot must be within [0,2]. 4724 * <li> <b>OverrideBrakeDurNeutral:</b> Set to true to static-brake the rotor 4725 * when output is zero (or within 4726 * deadband). Set to false to use the 4727 * NeutralMode configuration setting 4728 * (default). This flag exists to provide 4729 * the fundamental behavior of this 4730 * control when output is zero, which is 4731 * to provide 0V to the motor. 4732 * <li> <b>LimitForwardMotion:</b> Set to true to force forward limiting. This 4733 * allows users to use other limit switch 4734 * sensors connected to robot controller. This 4735 * also allows use of active sensors that 4736 * require external power. 4737 * <li> <b>LimitReverseMotion:</b> Set to true to force reverse limiting. This 4738 * allows users to use other limit switch 4739 * sensors connected to robot controller. This 4740 * also allows use of active sensors that 4741 * require external power. 4742 * </ul> 4743 * </ul> 4744 * 4745 * @param request Control object to request of the device 4746 * @return Code response of the request 4747 */ 4748 public StatusCode setControl(DifferentialPositionDutyCycle request) 4749 { 4750 return setControlPrivate(request); 4751 } 4752 4753 /** 4754 * Request PID to target position with a differential position 4755 * setpoint 4756 * <p> 4757 * This control mode will set the motor's position setpoint to the 4758 * position specified by the user. It will also set the motor's 4759 * differential position setpoint to the specified position. 4760 * <ul> 4761 * <li> <b>DifferentialPositionVoltage Parameters:</b> 4762 * <ul> 4763 * <li> <b>TargetPosition:</b> Average position to drive toward in rotations. 4764 * <li> <b>DifferentialPosition:</b> Differential position to drive toward in 4765 * rotations. 4766 * <li> <b>EnableFOC:</b> Set to true to use FOC commutation (requires Phoenix 4767 * Pro), which increases peak power by ~15%. Set to 4768 * false to use trapezoidal commutation. 4769 * <p> 4770 * FOC improves motor performance by leveraging torque 4771 * (current) control. However, this may be inconvenient 4772 * for applications that require specifying duty cycle 4773 * or voltage. CTR-Electronics has developed a hybrid 4774 * method that combines the performances gains of FOC 4775 * while still allowing applications to provide duty 4776 * cycle or voltage demand. This not to be confused 4777 * with simple sinusoidal control or phase voltage 4778 * control which lacks the performance gains. 4779 * <li> <b>TargetSlot:</b> Select which gains are applied to the primary 4780 * controller by selecting the slot. Use the 4781 * configuration api to set the gain values for the 4782 * selected slot before enabling this feature. Slot 4783 * must be within [0,2]. 4784 * <li> <b>DifferentialSlot:</b> Select which gains are applied to the 4785 * differential controller by selecting the slot. 4786 * Use the configuration api to set the gain 4787 * values for the selected slot before enabling 4788 * this feature. Slot must be within [0,2]. 4789 * <li> <b>OverrideBrakeDurNeutral:</b> Set to true to static-brake the rotor 4790 * when output is zero (or within 4791 * deadband). Set to false to use the 4792 * NeutralMode configuration setting 4793 * (default). This flag exists to provide 4794 * the fundamental behavior of this 4795 * control when output is zero, which is 4796 * to provide 0V to the motor. 4797 * <li> <b>LimitForwardMotion:</b> Set to true to force forward limiting. This 4798 * allows users to use other limit switch 4799 * sensors connected to robot controller. This 4800 * also allows use of active sensors that 4801 * require external power. 4802 * <li> <b>LimitReverseMotion:</b> Set to true to force reverse limiting. This 4803 * allows users to use other limit switch 4804 * sensors connected to robot controller. This 4805 * also allows use of active sensors that 4806 * require external power. 4807 * </ul> 4808 * </ul> 4809 * 4810 * @param request Control object to request of the device 4811 * @return Code response of the request 4812 */ 4813 public StatusCode setControl(DifferentialPositionVoltage request) 4814 { 4815 return setControlPrivate(request); 4816 } 4817 4818 /** 4819 * Request PID to target velocity with a differential position 4820 * setpoint. 4821 * <p> 4822 * This control mode will set the motor's velocity setpoint to the 4823 * velocity specified by the user. It will also set the motor's 4824 * differential position setpoint to the specified position. 4825 * <ul> 4826 * <li> <b>DifferentialVelocityDutyCycle Parameters:</b> 4827 * <ul> 4828 * <li> <b>TargetVelocity:</b> Average velocity to drive toward in rotations 4829 * per second. 4830 * <li> <b>DifferentialPosition:</b> Differential position to drive toward in 4831 * rotations. 4832 * <li> <b>EnableFOC:</b> Set to true to use FOC commutation (requires Phoenix 4833 * Pro), which increases peak power by ~15%. Set to 4834 * false to use trapezoidal commutation. 4835 * <p> 4836 * FOC improves motor performance by leveraging torque 4837 * (current) control. However, this may be inconvenient 4838 * for applications that require specifying duty cycle 4839 * or voltage. CTR-Electronics has developed a hybrid 4840 * method that combines the performances gains of FOC 4841 * while still allowing applications to provide duty 4842 * cycle or voltage demand. This not to be confused 4843 * with simple sinusoidal control or phase voltage 4844 * control which lacks the performance gains. 4845 * <li> <b>TargetSlot:</b> Select which gains are applied to the primary 4846 * controller by selecting the slot. Use the 4847 * configuration api to set the gain values for the 4848 * selected slot before enabling this feature. Slot 4849 * must be within [0,2]. 4850 * <li> <b>DifferentialSlot:</b> Select which gains are applied to the 4851 * differential controller by selecting the slot. 4852 * Use the configuration api to set the gain 4853 * values for the selected slot before enabling 4854 * this feature. Slot must be within [0,2]. 4855 * <li> <b>OverrideBrakeDurNeutral:</b> Set to true to static-brake the rotor 4856 * when output is zero (or within 4857 * deadband). Set to false to use the 4858 * NeutralMode configuration setting 4859 * (default). This flag exists to provide 4860 * the fundamental behavior of this 4861 * control when output is zero, which is 4862 * to provide 0V to the motor. 4863 * <li> <b>LimitForwardMotion:</b> Set to true to force forward limiting. This 4864 * allows users to use other limit switch 4865 * sensors connected to robot controller. This 4866 * also allows use of active sensors that 4867 * require external power. 4868 * <li> <b>LimitReverseMotion:</b> Set to true to force reverse limiting. This 4869 * allows users to use other limit switch 4870 * sensors connected to robot controller. This 4871 * also allows use of active sensors that 4872 * require external power. 4873 * </ul> 4874 * </ul> 4875 * 4876 * @param request Control object to request of the device 4877 * @return Code response of the request 4878 */ 4879 public StatusCode setControl(DifferentialVelocityDutyCycle request) 4880 { 4881 return setControlPrivate(request); 4882 } 4883 4884 /** 4885 * Request PID to target velocity with a differential position 4886 * setpoint. 4887 * <p> 4888 * This control mode will set the motor's velocity setpoint to the 4889 * velocity specified by the user. It will also set the motor's 4890 * differential position setpoint to the specified position. 4891 * <ul> 4892 * <li> <b>DifferentialVelocityVoltage Parameters:</b> 4893 * <ul> 4894 * <li> <b>TargetVelocity:</b> Average velocity to drive toward in rotations 4895 * per second. 4896 * <li> <b>DifferentialPosition:</b> Differential position to drive toward in 4897 * rotations. 4898 * <li> <b>EnableFOC:</b> Set to true to use FOC commutation (requires Phoenix 4899 * Pro), which increases peak power by ~15%. Set to 4900 * false to use trapezoidal commutation. 4901 * <p> 4902 * FOC improves motor performance by leveraging torque 4903 * (current) control. However, this may be inconvenient 4904 * for applications that require specifying duty cycle 4905 * or voltage. CTR-Electronics has developed a hybrid 4906 * method that combines the performances gains of FOC 4907 * while still allowing applications to provide duty 4908 * cycle or voltage demand. This not to be confused 4909 * with simple sinusoidal control or phase voltage 4910 * control which lacks the performance gains. 4911 * <li> <b>TargetSlot:</b> Select which gains are applied to the primary 4912 * controller by selecting the slot. Use the 4913 * configuration api to set the gain values for the 4914 * selected slot before enabling this feature. Slot 4915 * must be within [0,2]. 4916 * <li> <b>DifferentialSlot:</b> Select which gains are applied to the 4917 * differential controller by selecting the slot. 4918 * Use the configuration api to set the gain 4919 * values for the selected slot before enabling 4920 * this feature. Slot must be within [0,2]. 4921 * <li> <b>OverrideBrakeDurNeutral:</b> Set to true to static-brake the rotor 4922 * when output is zero (or within 4923 * deadband). Set to false to use the 4924 * NeutralMode configuration setting 4925 * (default). This flag exists to provide 4926 * the fundamental behavior of this 4927 * control when output is zero, which is 4928 * to provide 0V to the motor. 4929 * <li> <b>LimitForwardMotion:</b> Set to true to force forward limiting. This 4930 * allows users to use other limit switch 4931 * sensors connected to robot controller. This 4932 * also allows use of active sensors that 4933 * require external power. 4934 * <li> <b>LimitReverseMotion:</b> Set to true to force reverse limiting. This 4935 * allows users to use other limit switch 4936 * sensors connected to robot controller. This 4937 * also allows use of active sensors that 4938 * require external power. 4939 * </ul> 4940 * </ul> 4941 * 4942 * @param request Control object to request of the device 4943 * @return Code response of the request 4944 */ 4945 public StatusCode setControl(DifferentialVelocityVoltage request) 4946 { 4947 return setControlPrivate(request); 4948 } 4949 4950 /** 4951 * Requests Motion Magic® to target a final position using a motion 4952 * profile, and PID to a differential position setpoint. 4953 * <p> 4954 * Motion Magic® produces a motion profile in real-time while 4955 * attempting to honor the Cruise Velocity, Acceleration, and Jerk 4956 * value specified via the Motion Magic® configuration values. This 4957 * control mode does not use the Expo_kV or Expo_kA configs. Target 4958 * position can be changed on-the-fly and Motion Magic® will do its 4959 * best to adjust the profile. This control mode is duty cycle based, 4960 * so relevant closed-loop gains will use fractional duty cycle for 4961 * the numerator: +1.0 represents full forward output. 4962 * <ul> 4963 * <li> <b>DifferentialMotionMagicDutyCycle Parameters:</b> 4964 * <ul> 4965 * <li> <b>TargetPosition:</b> Average position to drive toward in rotations. 4966 * <li> <b>DifferentialPosition:</b> Differential position to drive toward in 4967 * rotations. 4968 * <li> <b>EnableFOC:</b> Set to true to use FOC commutation (requires Phoenix 4969 * Pro), which increases peak power by ~15%. Set to 4970 * false to use trapezoidal commutation. 4971 * <p> 4972 * FOC improves motor performance by leveraging torque 4973 * (current) control. However, this may be inconvenient 4974 * for applications that require specifying duty cycle 4975 * or voltage. CTR-Electronics has developed a hybrid 4976 * method that combines the performances gains of FOC 4977 * while still allowing applications to provide duty 4978 * cycle or voltage demand. This not to be confused 4979 * with simple sinusoidal control or phase voltage 4980 * control which lacks the performance gains. 4981 * <li> <b>TargetSlot:</b> Select which gains are applied to the primary 4982 * controller by selecting the slot. Use the 4983 * configuration api to set the gain values for the 4984 * selected slot before enabling this feature. Slot 4985 * must be within [0,2]. 4986 * <li> <b>DifferentialSlot:</b> Select which gains are applied to the 4987 * differential controller by selecting the slot. 4988 * Use the configuration api to set the gain 4989 * values for the selected slot before enabling 4990 * this feature. Slot must be within [0,2]. 4991 * <li> <b>OverrideBrakeDurNeutral:</b> Set to true to static-brake the rotor 4992 * when output is zero (or within 4993 * deadband). Set to false to use the 4994 * NeutralMode configuration setting 4995 * (default). This flag exists to provide 4996 * the fundamental behavior of this 4997 * control when output is zero, which is 4998 * to provide 0V to the motor. 4999 * <li> <b>LimitForwardMotion:</b> Set to true to force forward limiting. This 5000 * allows users to use other limit switch 5001 * sensors connected to robot controller. This 5002 * also allows use of active sensors that 5003 * require external power. 5004 * <li> <b>LimitReverseMotion:</b> Set to true to force reverse limiting. This 5005 * allows users to use other limit switch 5006 * sensors connected to robot controller. This 5007 * also allows use of active sensors that 5008 * require external power. 5009 * </ul> 5010 * </ul> 5011 * 5012 * @param request Control object to request of the device 5013 * @return Code response of the request 5014 */ 5015 public StatusCode setControl(DifferentialMotionMagicDutyCycle request) 5016 { 5017 return setControlPrivate(request); 5018 } 5019 5020 /** 5021 * Requests Motion Magic® to target a final position using a motion 5022 * profile, and PID to a differential position setpoint. 5023 * <p> 5024 * Motion Magic® produces a motion profile in real-time while 5025 * attempting to honor the Cruise Velocity, Acceleration, and Jerk 5026 * value specified via the Motion Magic® configuration values. This 5027 * control mode does not use the Expo_kV or Expo_kA configs. Target 5028 * position can be changed on-the-fly and Motion Magic® will do its 5029 * best to adjust the profile. This control mode is voltage-based, so 5030 * relevant closed-loop gains will use Volts for the numerator. 5031 * <ul> 5032 * <li> <b>DifferentialMotionMagicVoltage Parameters:</b> 5033 * <ul> 5034 * <li> <b>TargetPosition:</b> Average position to drive toward in rotations. 5035 * <li> <b>DifferentialPosition:</b> Differential position to drive toward in 5036 * rotations. 5037 * <li> <b>EnableFOC:</b> Set to true to use FOC commutation (requires Phoenix 5038 * Pro), which increases peak power by ~15%. Set to 5039 * false to use trapezoidal commutation. 5040 * <p> 5041 * FOC improves motor performance by leveraging torque 5042 * (current) control. However, this may be inconvenient 5043 * for applications that require specifying duty cycle 5044 * or voltage. CTR-Electronics has developed a hybrid 5045 * method that combines the performances gains of FOC 5046 * while still allowing applications to provide duty 5047 * cycle or voltage demand. This not to be confused 5048 * with simple sinusoidal control or phase voltage 5049 * control which lacks the performance gains. 5050 * <li> <b>TargetSlot:</b> Select which gains are applied to the primary 5051 * controller by selecting the slot. Use the 5052 * configuration api to set the gain values for the 5053 * selected slot before enabling this feature. Slot 5054 * must be within [0,2]. 5055 * <li> <b>DifferentialSlot:</b> Select which gains are applied to the 5056 * differential controller by selecting the slot. 5057 * Use the configuration api to set the gain 5058 * values for the selected slot before enabling 5059 * this feature. Slot must be within [0,2]. 5060 * <li> <b>OverrideBrakeDurNeutral:</b> Set to true to static-brake the rotor 5061 * when output is zero (or within 5062 * deadband). Set to false to use the 5063 * NeutralMode configuration setting 5064 * (default). This flag exists to provide 5065 * the fundamental behavior of this 5066 * control when output is zero, which is 5067 * to provide 0V to the motor. 5068 * <li> <b>LimitForwardMotion:</b> Set to true to force forward limiting. This 5069 * allows users to use other limit switch 5070 * sensors connected to robot controller. This 5071 * also allows use of active sensors that 5072 * require external power. 5073 * <li> <b>LimitReverseMotion:</b> Set to true to force reverse limiting. This 5074 * allows users to use other limit switch 5075 * sensors connected to robot controller. This 5076 * also allows use of active sensors that 5077 * require external power. 5078 * </ul> 5079 * </ul> 5080 * 5081 * @param request Control object to request of the device 5082 * @return Code response of the request 5083 */ 5084 public StatusCode setControl(DifferentialMotionMagicVoltage request) 5085 { 5086 return setControlPrivate(request); 5087 } 5088 5089 /** 5090 * Follow the motor output of another Talon. 5091 * <p> 5092 * If Talon is in torque control, the torque is copied - which will 5093 * increase the total torque applied. If Talon is in percent supply 5094 * output control, the duty cycle is matched. Motor direction either 5095 * matches master's configured direction or opposes it based on 5096 * OpposeMasterDirection. 5097 * <ul> 5098 * <li> <b>Follower Parameters:</b> 5099 * <ul> 5100 * <li> <b>MasterID:</b> Device ID of the master to follow. 5101 * <li> <b>OpposeMasterDirection:</b> Set to false for motor invert to match 5102 * the master's configured Invert - which is 5103 * typical when master and follower are 5104 * mechanically linked and spin in the same 5105 * direction. Set to true for motor invert 5106 * to oppose the master's configured Invert 5107 * - this is typical where the the master 5108 * and follower mechanically spin in 5109 * opposite directions. 5110 * </ul> 5111 * </ul> 5112 * 5113 * @param request Control object to request of the device 5114 * @return Code response of the request 5115 */ 5116 public StatusCode setControl(Follower request) 5117 { 5118 return setControlPrivate(request); 5119 } 5120 5121 /** 5122 * Follow the motor output of another Talon while ignoring the 5123 * master's invert setting. 5124 * <p> 5125 * If Talon is in torque control, the torque is copied - which will 5126 * increase the total torque applied. If Talon is in percent supply 5127 * output control, the duty cycle is matched. Motor direction is 5128 * strictly determined by the configured invert and not the master. 5129 * If you want motor direction to match or oppose the master, use 5130 * FollowerRequest instead. 5131 * <ul> 5132 * <li> <b>StrictFollower Parameters:</b> 5133 * <ul> 5134 * <li> <b>MasterID:</b> Device ID of the master to follow. 5135 * </ul> 5136 * </ul> 5137 * 5138 * @param request Control object to request of the device 5139 * @return Code response of the request 5140 */ 5141 public StatusCode setControl(StrictFollower request) 5142 { 5143 return setControlPrivate(request); 5144 } 5145 5146 /** 5147 * Follow the differential motor output of another Talon. 5148 * <p> 5149 * If Talon is in torque control, the torque is copied - which will 5150 * increase the total torque applied. If Talon is in percent supply 5151 * output control, the duty cycle is matched. Motor direction either 5152 * matches master's configured direction or opposes it based on 5153 * OpposeMasterDirection. 5154 * <ul> 5155 * <li> <b>DifferentialFollower Parameters:</b> 5156 * <ul> 5157 * <li> <b>MasterID:</b> Device ID of the differential master to follow. 5158 * <li> <b>OpposeMasterDirection:</b> Set to false for motor invert to match 5159 * the master's configured Invert - which is 5160 * typical when master and follower are 5161 * mechanically linked and spin in the same 5162 * direction. Set to true for motor invert 5163 * to oppose the master's configured Invert 5164 * - this is typical where the the master 5165 * and follower mechanically spin in 5166 * opposite directions. 5167 * </ul> 5168 * </ul> 5169 * 5170 * @param request Control object to request of the device 5171 * @return Code response of the request 5172 */ 5173 public StatusCode setControl(DifferentialFollower request) 5174 { 5175 return setControlPrivate(request); 5176 } 5177 5178 /** 5179 * Follow the differential motor output of another Talon while 5180 * ignoring the master's invert setting. 5181 * <p> 5182 * If Talon is in torque control, the torque is copied - which will 5183 * increase the total torque applied. If Talon is in percent supply 5184 * output control, the duty cycle is matched. Motor direction is 5185 * strictly determined by the configured invert and not the master. 5186 * If you want motor direction to match or oppose the master, use 5187 * FollowerRequest instead. 5188 * <ul> 5189 * <li> <b>DifferentialStrictFollower Parameters:</b> 5190 * <ul> 5191 * <li> <b>MasterID:</b> Device ID of the differential master to follow. 5192 * </ul> 5193 * </ul> 5194 * 5195 * @param request Control object to request of the device 5196 * @return Code response of the request 5197 */ 5198 public StatusCode setControl(DifferentialStrictFollower request) 5199 { 5200 return setControlPrivate(request); 5201 } 5202 5203 /** 5204 * Request neutral output of actuator. The applied brake type is 5205 * determined by the NeutralMode configuration. 5206 * <ul> 5207 * <li> <b>NeutralOut Parameters:</b> 5208 * </ul> 5209 * 5210 * @param request Control object to request of the device 5211 * @return Code response of the request 5212 */ 5213 public StatusCode setControl(NeutralOut request) 5214 { 5215 return setControlPrivate(request); 5216 } 5217 5218 /** 5219 * Request coast neutral output of actuator. The bridge is disabled 5220 * and the rotor is allowed to coast. 5221 * <ul> 5222 * <li> <b>CoastOut Parameters:</b> 5223 * </ul> 5224 * 5225 * @param request Control object to request of the device 5226 * @return Code response of the request 5227 */ 5228 public StatusCode setControl(CoastOut request) 5229 { 5230 return setControlPrivate(request); 5231 } 5232 5233 /** 5234 * Applies full neutral-brake by shorting motor leads together. 5235 * <ul> 5236 * <li> <b>StaticBrake Parameters:</b> 5237 * </ul> 5238 * 5239 * @param request Control object to request of the device 5240 * @return Code response of the request 5241 */ 5242 public StatusCode setControl(StaticBrake request) 5243 { 5244 return setControlPrivate(request); 5245 } 5246 5247 /** 5248 * Plays a single tone at the user specified frequency. 5249 * <ul> 5250 * <li> <b>MusicTone Parameters:</b> 5251 * <ul> 5252 * <li> <b>AudioFrequency:</b> Sound frequency to play. A value of zero will 5253 * silence the device. The effective frequency 5254 * range is 10-20000Hz. Any nonzero frequency less 5255 * than 10 Hz will be capped to 10Hz. Any 5256 * frequency above 20Khz will be capped to 20KHz. 5257 * </ul> 5258 * </ul> 5259 * 5260 * @param request Control object to request of the device 5261 * @return Code response of the request 5262 */ 5263 public StatusCode setControl(MusicTone request) 5264 { 5265 return setControlPrivate(request); 5266 } 5267 5268 /** 5269 * Requests Motion Magic® to target a final velocity using a motion 5270 * profile. This allows smooth transitions between velocity set 5271 * points. Users can optionally provide a duty cycle feedforward. 5272 * <p> 5273 * Motion Magic® Velocity produces a motion profile in real-time while 5274 * attempting to honor the specified Acceleration and Jerk value. This 5275 * control mode does not use the CruiseVelocity, Expo_kV, or Expo_kA 5276 * configs. If the specified acceleration is zero, the Acceleration 5277 * under Motion Magic® configuration parameter is used instead. This 5278 * allows for runtime adjustment of acceleration for advanced users. 5279 * Jerk is also specified in the Motion Magic® persistent 5280 * configuration values. If Jerk is set to zero, Motion Magic® will 5281 * produce a trapezoidal acceleration profile. Target velocity can 5282 * also be changed on-the-fly and Motion Magic® will do its best to 5283 * adjust the profile. This control mode is duty cycle based, so 5284 * relevant closed-loop gains will use fractional duty cycle for the 5285 * numerator: +1.0 represents full forward output. 5286 * <ul> 5287 * <li> <b>MotionMagicVelocityDutyCycle Parameters:</b> 5288 * <ul> 5289 * <li> <b>Velocity:</b> Target velocity to drive toward in rotations per 5290 * second. This can be changed on-the fly. 5291 * <li> <b>Acceleration:</b> This is the absolute Acceleration to use 5292 * generating the profile. If this parameter is 5293 * zero, the Acceleration persistent configuration 5294 * parameter is used instead. Acceleration is in 5295 * rotations per second squared. If nonzero, the 5296 * signage does not matter as the absolute value is 5297 * used. 5298 * <li> <b>EnableFOC:</b> Set to true to use FOC commutation (requires Phoenix 5299 * Pro), which increases peak power by ~15%. Set to 5300 * false to use trapezoidal commutation. 5301 * <p> 5302 * FOC improves motor performance by leveraging torque 5303 * (current) control. However, this may be inconvenient 5304 * for applications that require specifying duty cycle 5305 * or voltage. CTR-Electronics has developed a hybrid 5306 * method that combines the performances gains of FOC 5307 * while still allowing applications to provide duty 5308 * cycle or voltage demand. This not to be confused 5309 * with simple sinusoidal control or phase voltage 5310 * control which lacks the performance gains. 5311 * <li> <b>FeedForward:</b> Feedforward to apply in fractional units between -1 5312 * and +1. 5313 * <li> <b>Slot:</b> Select which gains are applied by selecting the slot. Use 5314 * the configuration api to set the gain values for the 5315 * selected slot before enabling this feature. Slot must be 5316 * within [0,2]. 5317 * <li> <b>OverrideBrakeDurNeutral:</b> Set to true to static-brake the rotor 5318 * when output is zero (or within 5319 * deadband). Set to false to use the 5320 * NeutralMode configuration setting 5321 * (default). This flag exists to provide 5322 * the fundamental behavior of this 5323 * control when output is zero, which is 5324 * to provide 0V to the motor. 5325 * <li> <b>LimitForwardMotion:</b> Set to true to force forward limiting. This 5326 * allows users to use other limit switch 5327 * sensors connected to robot controller. This 5328 * also allows use of active sensors that 5329 * require external power. 5330 * <li> <b>LimitReverseMotion:</b> Set to true to force reverse limiting. This 5331 * allows users to use other limit switch 5332 * sensors connected to robot controller. This 5333 * also allows use of active sensors that 5334 * require external power. 5335 * </ul> 5336 * </ul> 5337 * 5338 * @param request Control object to request of the device 5339 * @return Code response of the request 5340 */ 5341 public StatusCode setControl(MotionMagicVelocityDutyCycle request) 5342 { 5343 return setControlPrivate(request); 5344 } 5345 5346 /** 5347 * Requests Motion Magic® to target a final velocity using a motion 5348 * profile. This allows smooth transitions between velocity set 5349 * points. Users can optionally provide a torque feedforward. 5350 * <p> 5351 * Motion Magic® Velocity produces a motion profile in real-time while 5352 * attempting to honor the specified Acceleration and Jerk value. This 5353 * control mode does not use the CruiseVelocity, Expo_kV, or Expo_kA 5354 * configs. If the specified acceleration is zero, the Acceleration 5355 * under Motion Magic® configuration parameter is used instead. This 5356 * allows for runtime adjustment of acceleration for advanced users. 5357 * Jerk is also specified in the Motion Magic® persistent 5358 * configuration values. If Jerk is set to zero, Motion Magic® will 5359 * produce a trapezoidal acceleration profile. Target velocity can 5360 * also be changed on-the-fly and Motion Magic® will do its best to 5361 * adjust the profile. This control mode is based on torque current, 5362 * so relevant closed-loop gains will use Amperes for the numerator. 5363 * <ul> 5364 * <li> <b>MotionMagicVelocityTorqueCurrentFOC Parameters:</b> 5365 * <ul> 5366 * <li> <b>Velocity:</b> Target velocity to drive toward in rotations per 5367 * second. This can be changed on-the fly. 5368 * <li> <b>Acceleration:</b> This is the absolute Acceleration to use 5369 * generating the profile. If this parameter is 5370 * zero, the Acceleration persistent configuration 5371 * parameter is used instead. Acceleration is in 5372 * rotations per second squared. If nonzero, the 5373 * signage does not matter as the absolute value is 5374 * used. 5375 * <li> <b>EnableFOC:</b> Set to true to use FOC commutation (requires Phoenix 5376 * Pro), which increases peak power by ~15%. Set to 5377 * false to use trapezoidal commutation. 5378 * <p> 5379 * FOC improves motor performance by leveraging torque 5380 * (current) control. However, this may be inconvenient 5381 * for applications that require specifying duty cycle 5382 * or voltage. CTR-Electronics has developed a hybrid 5383 * method that combines the performances gains of FOC 5384 * while still allowing applications to provide duty 5385 * cycle or voltage demand. This not to be confused 5386 * with simple sinusoidal control or phase voltage 5387 * control which lacks the performance gains. 5388 * <li> <b>FeedForward:</b> Feedforward to apply in torque current in Amperes. 5389 * User can use motor's kT to scale Newton-meter to 5390 * Amperes. 5391 * <li> <b>Slot:</b> Select which gains are applied by selecting the slot. Use 5392 * the configuration api to set the gain values for the 5393 * selected slot before enabling this feature. Slot must be 5394 * within [0,2]. 5395 * <li> <b>OverrideCoastDurNeutral:</b> Set to true to coast the rotor when 5396 * output is zero (or within deadband). 5397 * Set to false to use the NeutralMode 5398 * configuration setting (default). This 5399 * flag exists to provide the fundamental 5400 * behavior of this control when output is 5401 * zero, which is to provide 0A (zero 5402 * torque). 5403 * <li> <b>LimitForwardMotion:</b> Set to true to force forward limiting. This 5404 * allows users to use other limit switch 5405 * sensors connected to robot controller. This 5406 * also allows use of active sensors that 5407 * require external power. 5408 * <li> <b>LimitReverseMotion:</b> Set to true to force reverse limiting. This 5409 * allows users to use other limit switch 5410 * sensors connected to robot controller. This 5411 * also allows use of active sensors that 5412 * require external power. 5413 * </ul> 5414 * </ul> 5415 * 5416 * @param request Control object to request of the device 5417 * @return Code response of the request 5418 */ 5419 public StatusCode setControl(MotionMagicVelocityTorqueCurrentFOC request) 5420 { 5421 return setControlPrivate(request); 5422 } 5423 5424 /** 5425 * Requests Motion Magic® to target a final velocity using a motion 5426 * profile. This allows smooth transitions between velocity set 5427 * points. Users can optionally provide a voltage feedforward. 5428 * <p> 5429 * Motion Magic® Velocity produces a motion profile in real-time while 5430 * attempting to honor the specified Acceleration and Jerk value. This 5431 * control mode does not use the CruiseVelocity, Expo_kV, or Expo_kA 5432 * configs. If the specified acceleration is zero, the Acceleration 5433 * under Motion Magic® configuration parameter is used instead. This 5434 * allows for runtime adjustment of acceleration for advanced users. 5435 * Jerk is also specified in the Motion Magic® persistent 5436 * configuration values. If Jerk is set to zero, Motion Magic® will 5437 * produce a trapezoidal acceleration profile. Target velocity can 5438 * also be changed on-the-fly and Motion Magic® will do its best to 5439 * adjust the profile. This control mode is voltage-based, so 5440 * relevant closed-loop gains will use Volts for the numerator. 5441 * <ul> 5442 * <li> <b>MotionMagicVelocityVoltage Parameters:</b> 5443 * <ul> 5444 * <li> <b>Velocity:</b> Target velocity to drive toward in rotations per 5445 * second. This can be changed on-the fly. 5446 * <li> <b>Acceleration:</b> This is the absolute Acceleration to use 5447 * generating the profile. If this parameter is 5448 * zero, the Acceleration persistent configuration 5449 * parameter is used instead. Acceleration is in 5450 * rotations per second squared. If nonzero, the 5451 * signage does not matter as the absolute value is 5452 * used. 5453 * <li> <b>EnableFOC:</b> Set to true to use FOC commutation (requires Phoenix 5454 * Pro), which increases peak power by ~15%. Set to 5455 * false to use trapezoidal commutation. 5456 * <p> 5457 * FOC improves motor performance by leveraging torque 5458 * (current) control. However, this may be inconvenient 5459 * for applications that require specifying duty cycle 5460 * or voltage. CTR-Electronics has developed a hybrid 5461 * method that combines the performances gains of FOC 5462 * while still allowing applications to provide duty 5463 * cycle or voltage demand. This not to be confused 5464 * with simple sinusoidal control or phase voltage 5465 * control which lacks the performance gains. 5466 * <li> <b>FeedForward:</b> Feedforward to apply in volts 5467 * <li> <b>Slot:</b> Select which gains are applied by selecting the slot. Use 5468 * the configuration api to set the gain values for the 5469 * selected slot before enabling this feature. Slot must be 5470 * within [0,2]. 5471 * <li> <b>OverrideBrakeDurNeutral:</b> Set to true to static-brake the rotor 5472 * when output is zero (or within 5473 * deadband). Set to false to use the 5474 * NeutralMode configuration setting 5475 * (default). This flag exists to provide 5476 * the fundamental behavior of this 5477 * control when output is zero, which is 5478 * to provide 0V to the motor. 5479 * <li> <b>LimitForwardMotion:</b> Set to true to force forward limiting. This 5480 * allows users to use other limit switch 5481 * sensors connected to robot controller. This 5482 * also allows use of active sensors that 5483 * require external power. 5484 * <li> <b>LimitReverseMotion:</b> Set to true to force reverse limiting. This 5485 * allows users to use other limit switch 5486 * sensors connected to robot controller. This 5487 * also allows use of active sensors that 5488 * require external power. 5489 * </ul> 5490 * </ul> 5491 * 5492 * @param request Control object to request of the device 5493 * @return Code response of the request 5494 */ 5495 public StatusCode setControl(MotionMagicVelocityVoltage request) 5496 { 5497 return setControlPrivate(request); 5498 } 5499 5500 /** 5501 * Requests Motion Magic® to target a final position using an 5502 * exponential motion profile. Users can optionally provide a duty 5503 * cycle feedforward. 5504 * <p> 5505 * Motion Magic® Expo produces a motion profile in real-time while 5506 * attempting to honor the Cruise Velocity (optional) and the 5507 * mechanism kV and kA, specified via the Motion Magic® configuration 5508 * values. Setting Cruise Velocity to 0 will allow the profile to run 5509 * to the max possible velocity based on Expo_kV. This control mode 5510 * does not use the Acceleration or Jerk configs. Target position can 5511 * be changed on-the-fly and Motion Magic® will do its best to adjust 5512 * the profile. This control mode is duty cycle based, so relevant 5513 * closed-loop gains will use fractional duty cycle for the numerator: 5514 * +1.0 represents full forward output. 5515 * <ul> 5516 * <li> <b>MotionMagicExpoDutyCycle Parameters:</b> 5517 * <ul> 5518 * <li> <b>Position:</b> Position to drive toward in rotations. 5519 * <li> <b>EnableFOC:</b> Set to true to use FOC commutation (requires Phoenix 5520 * Pro), which increases peak power by ~15%. Set to 5521 * false to use trapezoidal commutation. 5522 * <p> 5523 * FOC improves motor performance by leveraging torque 5524 * (current) control. However, this may be inconvenient 5525 * for applications that require specifying duty cycle 5526 * or voltage. CTR-Electronics has developed a hybrid 5527 * method that combines the performances gains of FOC 5528 * while still allowing applications to provide duty 5529 * cycle or voltage demand. This not to be confused 5530 * with simple sinusoidal control or phase voltage 5531 * control which lacks the performance gains. 5532 * <li> <b>FeedForward:</b> Feedforward to apply in fractional units between -1 5533 * and +1. 5534 * <li> <b>Slot:</b> Select which gains are applied by selecting the slot. Use 5535 * the configuration api to set the gain values for the 5536 * selected slot before enabling this feature. Slot must be 5537 * within [0,2]. 5538 * <li> <b>OverrideBrakeDurNeutral:</b> Set to true to static-brake the rotor 5539 * when output is zero (or within 5540 * deadband). Set to false to use the 5541 * NeutralMode configuration setting 5542 * (default). This flag exists to provide 5543 * the fundamental behavior of this 5544 * control when output is zero, which is 5545 * to provide 0V to the motor. 5546 * <li> <b>LimitForwardMotion:</b> Set to true to force forward limiting. This 5547 * allows users to use other limit switch 5548 * sensors connected to robot controller. This 5549 * also allows use of active sensors that 5550 * require external power. 5551 * <li> <b>LimitReverseMotion:</b> Set to true to force reverse limiting. This 5552 * allows users to use other limit switch 5553 * sensors connected to robot controller. This 5554 * also allows use of active sensors that 5555 * require external power. 5556 * </ul> 5557 * </ul> 5558 * 5559 * @param request Control object to request of the device 5560 * @return Code response of the request 5561 */ 5562 public StatusCode setControl(MotionMagicExpoDutyCycle request) 5563 { 5564 return setControlPrivate(request); 5565 } 5566 5567 /** 5568 * Requests Motion Magic® to target a final position using an 5569 * exponential motion profile. Users can optionally provide a voltage 5570 * feedforward. 5571 * <p> 5572 * Motion Magic® Expo produces a motion profile in real-time while 5573 * attempting to honor the Cruise Velocity (optional) and the 5574 * mechanism kV and kA, specified via the Motion Magic® configuration 5575 * values. Setting Cruise Velocity to 0 will allow the profile to run 5576 * to the max possible velocity based on Expo_kV. This control mode 5577 * does not use the Acceleration or Jerk configs. Target position can 5578 * be changed on-the-fly and Motion Magic® will do its best to adjust 5579 * the profile. This control mode is voltage-based, so relevant 5580 * closed-loop gains will use Volts for the numerator. 5581 * <ul> 5582 * <li> <b>MotionMagicExpoVoltage Parameters:</b> 5583 * <ul> 5584 * <li> <b>Position:</b> Position to drive toward in rotations. 5585 * <li> <b>EnableFOC:</b> Set to true to use FOC commutation (requires Phoenix 5586 * Pro), which increases peak power by ~15%. Set to 5587 * false to use trapezoidal commutation. 5588 * <p> 5589 * FOC improves motor performance by leveraging torque 5590 * (current) control. However, this may be inconvenient 5591 * for applications that require specifying duty cycle 5592 * or voltage. CTR-Electronics has developed a hybrid 5593 * method that combines the performances gains of FOC 5594 * while still allowing applications to provide duty 5595 * cycle or voltage demand. This not to be confused 5596 * with simple sinusoidal control or phase voltage 5597 * control which lacks the performance gains. 5598 * <li> <b>FeedForward:</b> Feedforward to apply in volts 5599 * <li> <b>Slot:</b> Select which gains are applied by selecting the slot. Use 5600 * the configuration api to set the gain values for the 5601 * selected slot before enabling this feature. Slot must be 5602 * within [0,2]. 5603 * <li> <b>OverrideBrakeDurNeutral:</b> Set to true to static-brake the rotor 5604 * when output is zero (or within 5605 * deadband). Set to false to use the 5606 * NeutralMode configuration setting 5607 * (default). This flag exists to provide 5608 * the fundamental behavior of this 5609 * control when output is zero, which is 5610 * to provide 0V to the motor. 5611 * <li> <b>LimitForwardMotion:</b> Set to true to force forward limiting. This 5612 * allows users to use other limit switch 5613 * sensors connected to robot controller. This 5614 * also allows use of active sensors that 5615 * require external power. 5616 * <li> <b>LimitReverseMotion:</b> Set to true to force reverse limiting. This 5617 * allows users to use other limit switch 5618 * sensors connected to robot controller. This 5619 * also allows use of active sensors that 5620 * require external power. 5621 * </ul> 5622 * </ul> 5623 * 5624 * @param request Control object to request of the device 5625 * @return Code response of the request 5626 */ 5627 public StatusCode setControl(MotionMagicExpoVoltage request) 5628 { 5629 return setControlPrivate(request); 5630 } 5631 5632 /** 5633 * Requests Motion Magic® to target a final position using an 5634 * exponential motion profile. Users can optionally provide a torque 5635 * current feedforward. 5636 * <p> 5637 * Motion Magic® Expo produces a motion profile in real-time while 5638 * attempting to honor the Cruise Velocity (optional) and the 5639 * mechanism kV and kA, specified via the Motion Magic® configuration 5640 * values. Setting Cruise Velocity to 0 will allow the profile to run 5641 * to the max possible velocity based on Expo_kV. This control mode 5642 * does not use the Acceleration or Jerk configs. Target position can 5643 * be changed on-the-fly and Motion Magic® will do its best to adjust 5644 * the profile. This control mode is based on torque current, so 5645 * relevant closed-loop gains will use Amperes for the numerator. 5646 * <ul> 5647 * <li> <b>MotionMagicExpoTorqueCurrentFOC Parameters:</b> 5648 * <ul> 5649 * <li> <b>Position:</b> Position to drive toward in rotations. 5650 * <li> <b>FeedForward:</b> Feedforward to apply in torque current in Amperes. 5651 * User can use motor's kT to scale Newton-meter to 5652 * Amperes. 5653 * <li> <b>Slot:</b> Select which gains are applied by selecting the slot. Use 5654 * the configuration api to set the gain values for the 5655 * selected slot before enabling this feature. Slot must be 5656 * within [0,2]. 5657 * <li> <b>OverrideCoastDurNeutral:</b> Set to true to coast the rotor when 5658 * output is zero (or within deadband). 5659 * Set to false to use the NeutralMode 5660 * configuration setting (default). This 5661 * flag exists to provide the fundamental 5662 * behavior of this control when output is 5663 * zero, which is to provide 0A (zero 5664 * torque). 5665 * <li> <b>LimitForwardMotion:</b> Set to true to force forward limiting. This 5666 * allows users to use other limit switch 5667 * sensors connected to robot controller. This 5668 * also allows use of active sensors that 5669 * require external power. 5670 * <li> <b>LimitReverseMotion:</b> Set to true to force reverse limiting. This 5671 * allows users to use other limit switch 5672 * sensors connected to robot controller. This 5673 * also allows use of active sensors that 5674 * require external power. 5675 * </ul> 5676 * </ul> 5677 * 5678 * @param request Control object to request of the device 5679 * @return Code response of the request 5680 */ 5681 public StatusCode setControl(MotionMagicExpoTorqueCurrentFOC request) 5682 { 5683 return setControlPrivate(request); 5684 } 5685 5686 /** 5687 * Requests Motion Magic® to target a final position using a motion 5688 * profile. This dynamic request allows runtime changes to Cruise 5689 * Velocity, Acceleration, and Jerk. Users can optionally provide a 5690 * duty cycle feedforward. This control requires use of a CANivore. 5691 * <p> 5692 * Motion Magic® produces a motion profile in real-time while 5693 * attempting to honor the specified Cruise Velocity, Acceleration, 5694 * and Jerk value. This control mode does not use the Expo_kV or 5695 * Expo_kA configs. Target position can be changed on-the-fly and 5696 * Motion Magic® will do its best to adjust the profile. This control 5697 * mode is duty cycle based, so relevant closed-loop gains will use 5698 * fractional duty cycle for the numerator: +1.0 represents full 5699 * forward output. 5700 * <ul> 5701 * <li> <b>DynamicMotionMagicDutyCycle Parameters:</b> 5702 * <ul> 5703 * <li> <b>Position:</b> Position to drive toward in rotations. 5704 * <li> <b>Velocity:</b> Cruise velocity for profiling. The signage does not 5705 * matter as the device will use the absolute value for 5706 * profile generation. 5707 * <li> <b>Acceleration:</b> Acceleration for profiling. The signage does not 5708 * matter as the device will use the absolute value 5709 * for profile generation 5710 * <li> <b>Jerk:</b> Jerk for profiling. The signage does not matter as the 5711 * device will use the absolute value for profile generation 5712 * <li> <b>EnableFOC:</b> Set to true to use FOC commutation (requires Phoenix 5713 * Pro), which increases peak power by ~15%. Set to 5714 * false to use trapezoidal commutation. 5715 * <p> 5716 * FOC improves motor performance by leveraging torque 5717 * (current) control. However, this may be inconvenient 5718 * for applications that require specifying duty cycle 5719 * or voltage. CTR-Electronics has developed a hybrid 5720 * method that combines the performances gains of FOC 5721 * while still allowing applications to provide duty 5722 * cycle or voltage demand. This not to be confused 5723 * with simple sinusoidal control or phase voltage 5724 * control which lacks the performance gains. 5725 * <li> <b>FeedForward:</b> Feedforward to apply in fractional units between -1 5726 * and +1. 5727 * <li> <b>Slot:</b> Select which gains are applied by selecting the slot. Use 5728 * the configuration api to set the gain values for the 5729 * selected slot before enabling this feature. Slot must be 5730 * within [0,2]. 5731 * <li> <b>OverrideBrakeDurNeutral:</b> Set to true to static-brake the rotor 5732 * when output is zero (or within 5733 * deadband). Set to false to use the 5734 * NeutralMode configuration setting 5735 * (default). This flag exists to provide 5736 * the fundamental behavior of this 5737 * control when output is zero, which is 5738 * to provide 0V to the motor. 5739 * <li> <b>LimitForwardMotion:</b> Set to true to force forward limiting. This 5740 * allows users to use other limit switch 5741 * sensors connected to robot controller. This 5742 * also allows use of active sensors that 5743 * require external power. 5744 * <li> <b>LimitReverseMotion:</b> Set to true to force reverse limiting. This 5745 * allows users to use other limit switch 5746 * sensors connected to robot controller. This 5747 * also allows use of active sensors that 5748 * require external power. 5749 * </ul> 5750 * </ul> 5751 * 5752 * @param request Control object to request of the device 5753 * @return Code response of the request 5754 */ 5755 public StatusCode setControl(DynamicMotionMagicDutyCycle request) 5756 { 5757 return setControlPrivate(request); 5758 } 5759 5760 /** 5761 * Requests Motion Magic® to target a final position using a motion 5762 * profile. This dynamic request allows runtime changes to Cruise 5763 * Velocity, Acceleration, and Jerk. Users can optionally provide a 5764 * voltage feedforward. This control requires use of a CANivore. 5765 * <p> 5766 * Motion Magic® produces a motion profile in real-time while 5767 * attempting to honor the specified Cruise Velocity, Acceleration, 5768 * and Jerk value. This control mode does not use the Expo_kV or 5769 * Expo_kA configs. Target position can be changed on-the-fly and 5770 * Motion Magic® will do its best to adjust the profile. This control 5771 * mode is voltage-based, so relevant closed-loop gains will use Volts 5772 * for the numerator. 5773 * <ul> 5774 * <li> <b>DynamicMotionMagicVoltage Parameters:</b> 5775 * <ul> 5776 * <li> <b>Position:</b> Position to drive toward in rotations. 5777 * <li> <b>Velocity:</b> Cruise velocity for profiling. The signage does not 5778 * matter as the device will use the absolute value for 5779 * profile generation. 5780 * <li> <b>Acceleration:</b> Acceleration for profiling. The signage does not 5781 * matter as the device will use the absolute value 5782 * for profile generation. 5783 * <li> <b>Jerk:</b> Jerk for profiling. The signage does not matter as the 5784 * device will use the absolute value for profile generation. 5785 * <li> <b>EnableFOC:</b> Set to true to use FOC commutation (requires Phoenix 5786 * Pro), which increases peak power by ~15%. Set to 5787 * false to use trapezoidal commutation. 5788 * <p> 5789 * FOC improves motor performance by leveraging torque 5790 * (current) control. However, this may be inconvenient 5791 * for applications that require specifying duty cycle 5792 * or voltage. CTR-Electronics has developed a hybrid 5793 * method that combines the performances gains of FOC 5794 * while still allowing applications to provide duty 5795 * cycle or voltage demand. This not to be confused 5796 * with simple sinusoidal control or phase voltage 5797 * control which lacks the performance gains. 5798 * <li> <b>FeedForward:</b> Feedforward to apply in volts 5799 * <li> <b>Slot:</b> Select which gains are applied by selecting the slot. Use 5800 * the configuration api to set the gain values for the 5801 * selected slot before enabling this feature. Slot must be 5802 * within [0,2]. 5803 * <li> <b>OverrideBrakeDurNeutral:</b> Set to true to static-brake the rotor 5804 * when output is zero (or within 5805 * deadband). Set to false to use the 5806 * NeutralMode configuration setting 5807 * (default). This flag exists to provide 5808 * the fundamental behavior of this 5809 * control when output is zero, which is 5810 * to provide 0V to the motor. 5811 * <li> <b>LimitForwardMotion:</b> Set to true to force forward limiting. This 5812 * allows users to use other limit switch 5813 * sensors connected to robot controller. This 5814 * also allows use of active sensors that 5815 * require external power. 5816 * <li> <b>LimitReverseMotion:</b> Set to true to force reverse limiting. This 5817 * allows users to use other limit switch 5818 * sensors connected to robot controller. This 5819 * also allows use of active sensors that 5820 * require external power. 5821 * </ul> 5822 * </ul> 5823 * 5824 * @param request Control object to request of the device 5825 * @return Code response of the request 5826 */ 5827 public StatusCode setControl(DynamicMotionMagicVoltage request) 5828 { 5829 return setControlPrivate(request); 5830 } 5831 5832 /** 5833 * Requests Motion Magic® to target a final position using a motion 5834 * profile. This dynamic request allows runtime changes to Cruise 5835 * Velocity, Acceleration, and Jerk. Users can optionally provide a 5836 * torque current feedforward. This control requires use of a 5837 * CANivore. 5838 * <p> 5839 * Motion Magic® produces a motion profile in real-time while 5840 * attempting to honor the specified Cruise Velocity, Acceleration, 5841 * and Jerk value. This control mode does not use the Expo_kV or 5842 * Expo_kA configs. Target position can be changed on-the-fly and 5843 * Motion Magic® will do its best to adjust the profile. This control 5844 * mode is based on torque current, so relevant closed-loop gains will 5845 * use Amperes for the numerator. 5846 * <ul> 5847 * <li> <b>DynamicMotionMagicTorqueCurrentFOC Parameters:</b> 5848 * <ul> 5849 * <li> <b>Position:</b> Position to drive toward in rotations. 5850 * <li> <b>Velocity:</b> Cruise velocity for profiling. The signage does not 5851 * matter as the device will use the absolute value for 5852 * profile generation. 5853 * <li> <b>Acceleration:</b> Acceleration for profiling. The signage does not 5854 * matter as the device will use the absolute value 5855 * for profile generation. 5856 * <li> <b>Jerk:</b> Jerk for profiling. The signage does not matter as the 5857 * device will use the absolute value for profile generation. 5858 * <li> <b>FeedForward:</b> Feedforward to apply in torque current in Amperes. 5859 * User can use motor's kT to scale Newton-meter to 5860 * Amperes. 5861 * <li> <b>Slot:</b> Select which gains are applied by selecting the slot. Use 5862 * the configuration api to set the gain values for the 5863 * selected slot before enabling this feature. Slot must be 5864 * within [0,2]. 5865 * <li> <b>OverrideCoastDurNeutral:</b> Set to true to coast the rotor when 5866 * output is zero (or within deadband). 5867 * Set to false to use the NeutralMode 5868 * configuration setting (default). This 5869 * flag exists to provide the fundamental 5870 * behavior of this control when output is 5871 * zero, which is to provide 0A (zero 5872 * torque). 5873 * <li> <b>LimitForwardMotion:</b> Set to true to force forward limiting. This 5874 * allows users to use other limit switch 5875 * sensors connected to robot controller. This 5876 * also allows use of active sensors that 5877 * require external power. 5878 * <li> <b>LimitReverseMotion:</b> Set to true to force reverse limiting. This 5879 * allows users to use other limit switch 5880 * sensors connected to robot controller. This 5881 * also allows use of active sensors that 5882 * require external power. 5883 * </ul> 5884 * </ul> 5885 * 5886 * @param request Control object to request of the device 5887 * @return Code response of the request 5888 */ 5889 public StatusCode setControl(DynamicMotionMagicTorqueCurrentFOC request) 5890 { 5891 return setControlPrivate(request); 5892 } 5893 5894 /** 5895 * Differential control with duty cycle average target and position 5896 * difference target. 5897 * 5898 * <ul> 5899 * <li> <b>Diff_DutyCycleOut_Position Parameters:</b> 5900 * <ul> 5901 * <li> <b>AverageRequest:</b> Average DutyCycleOut request of the mechanism. 5902 * <li> <b>DifferentialRequest:</b> Differential PositionDutyCycle request of 5903 * the mechanism. 5904 * </ul> 5905 * </ul> 5906 * 5907 * @param request Control object to request of the device 5908 * @return Code response of the request 5909 */ 5910 public StatusCode setControl(Diff_DutyCycleOut_Position request) 5911 { 5912 return setControlPrivate(request); 5913 } 5914 5915 /** 5916 * Differential control with position average target and position 5917 * difference target using dutycycle control. 5918 * 5919 * <ul> 5920 * <li> <b>Diff_PositionDutyCycle_Position Parameters:</b> 5921 * <ul> 5922 * <li> <b>AverageRequest:</b> Average PositionDutyCycle request of the 5923 * mechanism. 5924 * <li> <b>DifferentialRequest:</b> Differential PositionDutyCycle request of 5925 * the mechanism. 5926 * </ul> 5927 * </ul> 5928 * 5929 * @param request Control object to request of the device 5930 * @return Code response of the request 5931 */ 5932 public StatusCode setControl(Diff_PositionDutyCycle_Position request) 5933 { 5934 return setControlPrivate(request); 5935 } 5936 5937 /** 5938 * Differential control with velocity average target and position 5939 * difference target using dutycycle control. 5940 * 5941 * <ul> 5942 * <li> <b>Diff_VelocityDutyCycle_Position Parameters:</b> 5943 * <ul> 5944 * <li> <b>AverageRequest:</b> Average VelocityDutyCYcle request of the 5945 * mechanism. 5946 * <li> <b>DifferentialRequest:</b> Differential PositionDutyCycle request of 5947 * the mechanism. 5948 * </ul> 5949 * </ul> 5950 * 5951 * @param request Control object to request of the device 5952 * @return Code response of the request 5953 */ 5954 public StatusCode setControl(Diff_VelocityDutyCycle_Position request) 5955 { 5956 return setControlPrivate(request); 5957 } 5958 5959 /** 5960 * Differential control with Motion Magic® average target and position 5961 * difference target using dutycycle control. 5962 * 5963 * <ul> 5964 * <li> <b>Diff_MotionMagicDutyCycle_Position Parameters:</b> 5965 * <ul> 5966 * <li> <b>AverageRequest:</b> Average MotionMagicDutyCycle request of the 5967 * mechanism. 5968 * <li> <b>DifferentialRequest:</b> Differential PositionDutyCycle request of 5969 * the mechanism. 5970 * </ul> 5971 * </ul> 5972 * 5973 * @param request Control object to request of the device 5974 * @return Code response of the request 5975 */ 5976 public StatusCode setControl(Diff_MotionMagicDutyCycle_Position request) 5977 { 5978 return setControlPrivate(request); 5979 } 5980 5981 /** 5982 * Differential control with duty cycle average target and velocity 5983 * difference target. 5984 * 5985 * <ul> 5986 * <li> <b>Diff_DutyCycleOut_Velocity Parameters:</b> 5987 * <ul> 5988 * <li> <b>AverageRequest:</b> Average DutyCycleOut request of the mechanism. 5989 * <li> <b>DifferentialRequest:</b> Differential VelocityDutyCycle request of 5990 * the mechanism. 5991 * </ul> 5992 * </ul> 5993 * 5994 * @param request Control object to request of the device 5995 * @return Code response of the request 5996 */ 5997 public StatusCode setControl(Diff_DutyCycleOut_Velocity request) 5998 { 5999 return setControlPrivate(request); 6000 } 6001 6002 /** 6003 * Differential control with position average target and velocity 6004 * difference target using dutycycle control. 6005 * 6006 * <ul> 6007 * <li> <b>Diff_PositionDutyCycle_Velocity Parameters:</b> 6008 * <ul> 6009 * <li> <b>AverageRequest:</b> Average PositionDutyCycle request of the 6010 * mechanism. 6011 * <li> <b>DifferentialRequest:</b> Differential VelocityDutyCycle request of 6012 * the mechanism. 6013 * </ul> 6014 * </ul> 6015 * 6016 * @param request Control object to request of the device 6017 * @return Code response of the request 6018 */ 6019 public StatusCode setControl(Diff_PositionDutyCycle_Velocity request) 6020 { 6021 return setControlPrivate(request); 6022 } 6023 6024 /** 6025 * Differential control with velocity average target and velocity 6026 * difference target using dutycycle control. 6027 * 6028 * <ul> 6029 * <li> <b>Diff_VelocityDutyCycle_Velocity Parameters:</b> 6030 * <ul> 6031 * <li> <b>AverageRequest:</b> Average VelocityDutyCycle request of the 6032 * mechanism. 6033 * <li> <b>DifferentialRequest:</b> Differential VelocityDutyCycle request of 6034 * the mechanism. 6035 * </ul> 6036 * </ul> 6037 * 6038 * @param request Control object to request of the device 6039 * @return Code response of the request 6040 */ 6041 public StatusCode setControl(Diff_VelocityDutyCycle_Velocity request) 6042 { 6043 return setControlPrivate(request); 6044 } 6045 6046 /** 6047 * Differential control with Motion Magic® average target and velocity 6048 * difference target using dutycycle control. 6049 * 6050 * <ul> 6051 * <li> <b>Diff_MotionMagicDutyCycle_Velocity Parameters:</b> 6052 * <ul> 6053 * <li> <b>AverageRequest:</b> Average MotionMagicDutyCycle request of the 6054 * mechanism. 6055 * <li> <b>DifferentialRequest:</b> Differential VelocityDutyCycle request of 6056 * the mechanism. 6057 * </ul> 6058 * </ul> 6059 * 6060 * @param request Control object to request of the device 6061 * @return Code response of the request 6062 */ 6063 public StatusCode setControl(Diff_MotionMagicDutyCycle_Velocity request) 6064 { 6065 return setControlPrivate(request); 6066 } 6067 6068 /** 6069 * Differential control with voltage average target and position 6070 * difference target. 6071 * 6072 * <ul> 6073 * <li> <b>Diff_VoltageOut_Position Parameters:</b> 6074 * <ul> 6075 * <li> <b>AverageRequest:</b> Average VoltageOut request of the mechanism. 6076 * <li> <b>DifferentialRequest:</b> Differential PositionVoltage request of the 6077 * mechanism. 6078 * </ul> 6079 * </ul> 6080 * 6081 * @param request Control object to request of the device 6082 * @return Code response of the request 6083 */ 6084 public StatusCode setControl(Diff_VoltageOut_Position request) 6085 { 6086 return setControlPrivate(request); 6087 } 6088 6089 /** 6090 * Differential control with position average target and position 6091 * difference target using voltage control. 6092 * 6093 * <ul> 6094 * <li> <b>Diff_PositionVoltage_Position Parameters:</b> 6095 * <ul> 6096 * <li> <b>AverageRequest:</b> Average PositionVoltage request of the 6097 * mechanism. 6098 * <li> <b>DifferentialRequest:</b> Differential PositionVoltage request of the 6099 * mechanism. 6100 * </ul> 6101 * </ul> 6102 * 6103 * @param request Control object to request of the device 6104 * @return Code response of the request 6105 */ 6106 public StatusCode setControl(Diff_PositionVoltage_Position request) 6107 { 6108 return setControlPrivate(request); 6109 } 6110 6111 /** 6112 * Differential control with velocity average target and position 6113 * difference target using voltage control. 6114 * 6115 * <ul> 6116 * <li> <b>Diff_VelocityVoltage_Position Parameters:</b> 6117 * <ul> 6118 * <li> <b>AverageRequest:</b> Average VelocityVoltage request of the 6119 * mechanism. 6120 * <li> <b>DifferentialRequest:</b> Differential PositionVoltage request of the 6121 * mechanism. 6122 * </ul> 6123 * </ul> 6124 * 6125 * @param request Control object to request of the device 6126 * @return Code response of the request 6127 */ 6128 public StatusCode setControl(Diff_VelocityVoltage_Position request) 6129 { 6130 return setControlPrivate(request); 6131 } 6132 6133 /** 6134 * Differential control with Motion Magic® average target and position 6135 * difference target using voltage control. 6136 * 6137 * <ul> 6138 * <li> <b>Diff_MotionMagicVoltage_Position Parameters:</b> 6139 * <ul> 6140 * <li> <b>AverageRequest:</b> Average MotionMagicVoltage request of the 6141 * mechanism. 6142 * <li> <b>DifferentialRequest:</b> Differential PositionVoltage request of the 6143 * mechanism. 6144 * </ul> 6145 * </ul> 6146 * 6147 * @param request Control object to request of the device 6148 * @return Code response of the request 6149 */ 6150 public StatusCode setControl(Diff_MotionMagicVoltage_Position request) 6151 { 6152 return setControlPrivate(request); 6153 } 6154 6155 /** 6156 * Differential control with voltage average target and velocity 6157 * difference target. 6158 * 6159 * <ul> 6160 * <li> <b>Diff_VoltageOut_Velocity Parameters:</b> 6161 * <ul> 6162 * <li> <b>AverageRequest:</b> Average VoltageOut request of the mechanism. 6163 * <li> <b>DifferentialRequest:</b> Differential VelocityVoltage request of the 6164 * mechanism. 6165 * </ul> 6166 * </ul> 6167 * 6168 * @param request Control object to request of the device 6169 * @return Code response of the request 6170 */ 6171 public StatusCode setControl(Diff_VoltageOut_Velocity request) 6172 { 6173 return setControlPrivate(request); 6174 } 6175 6176 /** 6177 * Differential control with position average target and velocity 6178 * difference target using voltage control. 6179 * 6180 * <ul> 6181 * <li> <b>Diff_PositionVoltage_Velocity Parameters:</b> 6182 * <ul> 6183 * <li> <b>AverageRequest:</b> Average PositionVoltage request of the 6184 * mechanism. 6185 * <li> <b>DifferentialRequest:</b> Differential VelocityVoltage request of the 6186 * mechanism. 6187 * </ul> 6188 * </ul> 6189 * 6190 * @param request Control object to request of the device 6191 * @return Code response of the request 6192 */ 6193 public StatusCode setControl(Diff_PositionVoltage_Velocity request) 6194 { 6195 return setControlPrivate(request); 6196 } 6197 6198 /** 6199 * Differential control with velocity average target and velocity 6200 * difference target using voltage control. 6201 * 6202 * <ul> 6203 * <li> <b>Diff_VelocityVoltage_Velocity Parameters:</b> 6204 * <ul> 6205 * <li> <b>AverageRequest:</b> Average VelocityVoltage request of the 6206 * mechanism. 6207 * <li> <b>DifferentialRequest:</b> Differential VelocityVoltage request of the 6208 * mechanism. 6209 * </ul> 6210 * </ul> 6211 * 6212 * @param request Control object to request of the device 6213 * @return Code response of the request 6214 */ 6215 public StatusCode setControl(Diff_VelocityVoltage_Velocity request) 6216 { 6217 return setControlPrivate(request); 6218 } 6219 6220 /** 6221 * Differential control with Motion Magic® average target and velocity 6222 * difference target using voltage control. 6223 * 6224 * <ul> 6225 * <li> <b>Diff_MotionMagicVoltage_Velocity Parameters:</b> 6226 * <ul> 6227 * <li> <b>AverageRequest:</b> Average MotionMagicVoltage request of the 6228 * mechanism. 6229 * <li> <b>DifferentialRequest:</b> Differential VelocityVoltage request of the 6230 * mechanism. 6231 * </ul> 6232 * </ul> 6233 * 6234 * @param request Control object to request of the device 6235 * @return Code response of the request 6236 */ 6237 public StatusCode setControl(Diff_MotionMagicVoltage_Velocity request) 6238 { 6239 return setControlPrivate(request); 6240 } 6241 6242 /** 6243 * Differential control with torque current average target and 6244 * position difference target. 6245 * 6246 * <ul> 6247 * <li> <b>Diff_TorqueCurrentFOC_Position Parameters:</b> 6248 * <ul> 6249 * <li> <b>AverageRequest:</b> Average TorqueCurrentFOC request of the 6250 * mechanism. 6251 * <li> <b>DifferentialRequest:</b> Differential PositionTorqueCurrentFOC 6252 * request of the mechanism. 6253 * </ul> 6254 * </ul> 6255 * 6256 * @param request Control object to request of the device 6257 * @return Code response of the request 6258 */ 6259 public StatusCode setControl(Diff_TorqueCurrentFOC_Position request) 6260 { 6261 return setControlPrivate(request); 6262 } 6263 6264 /** 6265 * Differential control with position average target and position 6266 * difference target using torque current control. 6267 * 6268 * <ul> 6269 * <li> <b>Diff_PositionTorqueCurrentFOC_Position Parameters:</b> 6270 * <ul> 6271 * <li> <b>AverageRequest:</b> Average PositionTorqueCurrentFOC request of the 6272 * mechanism. 6273 * <li> <b>DifferentialRequest:</b> Differential PositionTorqueCurrentFOC 6274 * request of the mechanism. 6275 * </ul> 6276 * </ul> 6277 * 6278 * @param request Control object to request of the device 6279 * @return Code response of the request 6280 */ 6281 public StatusCode setControl(Diff_PositionTorqueCurrentFOC_Position request) 6282 { 6283 return setControlPrivate(request); 6284 } 6285 6286 /** 6287 * Differential control with velocity average target and position 6288 * difference target using torque current control. 6289 * 6290 * <ul> 6291 * <li> <b>Diff_VelocityTorqueCurrentFOC_Position Parameters:</b> 6292 * <ul> 6293 * <li> <b>AverageRequest:</b> Average VelocityTorqueCurrentFOC request of the 6294 * mechanism. 6295 * <li> <b>DifferentialRequest:</b> Differential PositionTorqueCurrentFOC 6296 * request of the mechanism. 6297 * </ul> 6298 * </ul> 6299 * 6300 * @param request Control object to request of the device 6301 * @return Code response of the request 6302 */ 6303 public StatusCode setControl(Diff_VelocityTorqueCurrentFOC_Position request) 6304 { 6305 return setControlPrivate(request); 6306 } 6307 6308 /** 6309 * Differential control with Motion Magic® average target and position 6310 * difference target using torque current control. 6311 * 6312 * <ul> 6313 * <li> <b>Diff_MotionMagicTorqueCurrentFOC_Position Parameters:</b> 6314 * <ul> 6315 * <li> <b>AverageRequest:</b> Average MotionMagicTorqueCurrentFOC request of 6316 * the mechanism. 6317 * <li> <b>DifferentialRequest:</b> Differential PositionTorqueCurrentFOC 6318 * request of the mechanism. 6319 * </ul> 6320 * </ul> 6321 * 6322 * @param request Control object to request of the device 6323 * @return Code response of the request 6324 */ 6325 public StatusCode setControl(Diff_MotionMagicTorqueCurrentFOC_Position request) 6326 { 6327 return setControlPrivate(request); 6328 } 6329 6330 /** 6331 * Differential control with torque current average target and 6332 * velocity difference target. 6333 * 6334 * <ul> 6335 * <li> <b>Diff_TorqueCurrentFOC_Velocity Parameters:</b> 6336 * <ul> 6337 * <li> <b>AverageRequest:</b> Average TorqueCurrentFOC request of the 6338 * mechanism. 6339 * <li> <b>DifferentialRequest:</b> Differential VelocityTorqueCurrentFOC 6340 * request of the mechanism. 6341 * </ul> 6342 * </ul> 6343 * 6344 * @param request Control object to request of the device 6345 * @return Code response of the request 6346 */ 6347 public StatusCode setControl(Diff_TorqueCurrentFOC_Velocity request) 6348 { 6349 return setControlPrivate(request); 6350 } 6351 6352 /** 6353 * Differential control with position average target and velocity 6354 * difference target using torque current control. 6355 * 6356 * <ul> 6357 * <li> <b>Diff_PositionTorqueCurrentFOC_Velocity Parameters:</b> 6358 * <ul> 6359 * <li> <b>AverageRequest:</b> Average PositionTorqueCurrentFOC request of the 6360 * mechanism. 6361 * <li> <b>DifferentialRequest:</b> Differential VelocityTorqueCurrentFOC 6362 * request of the mechanism. 6363 * </ul> 6364 * </ul> 6365 * 6366 * @param request Control object to request of the device 6367 * @return Code response of the request 6368 */ 6369 public StatusCode setControl(Diff_PositionTorqueCurrentFOC_Velocity request) 6370 { 6371 return setControlPrivate(request); 6372 } 6373 6374 /** 6375 * Differential control with velocity average target and velocity 6376 * difference target using torque current control. 6377 * 6378 * <ul> 6379 * <li> <b>Diff_VelocityTorqueCurrentFOC_Velocity Parameters:</b> 6380 * <ul> 6381 * <li> <b>AverageRequest:</b> Average VelocityTorqueCurrentFOC request of the 6382 * mechanism. 6383 * <li> <b>DifferentialRequest:</b> Differential VelocityTorqueCurrentFOC 6384 * request of the mechanism. 6385 * </ul> 6386 * </ul> 6387 * 6388 * @param request Control object to request of the device 6389 * @return Code response of the request 6390 */ 6391 public StatusCode setControl(Diff_VelocityTorqueCurrentFOC_Velocity request) 6392 { 6393 return setControlPrivate(request); 6394 } 6395 6396 /** 6397 * Differential control with Motion Magic® average target and velocity 6398 * difference target using torque current control. 6399 * 6400 * <ul> 6401 * <li> <b>Diff_MotionMagicTorqueCurrentFOC_Velocity Parameters:</b> 6402 * <ul> 6403 * <li> <b>AverageRequest:</b> Average MotionMagicTorqueCurrentFOC request of 6404 * the mechanism. 6405 * <li> <b>DifferentialRequest:</b> Differential VelocityTorqueCurrentFOC 6406 * request of the mechanism. 6407 * </ul> 6408 * </ul> 6409 * 6410 * @param request Control object to request of the device 6411 * @return Code response of the request 6412 */ 6413 public StatusCode setControl(Diff_MotionMagicTorqueCurrentFOC_Velocity request) 6414 { 6415 return setControlPrivate(request); 6416 } 6417 6418 /** 6419 * Control motor with generic control request object. 6420 * <p> 6421 * User must make sure the specified object is castable to a valid control request, 6422 * otherwise this function will fail at run-time and return the NotSupported StatusCode 6423 * 6424 * @param request Control object to request of the device 6425 * @return Status Code of the request, 0 is OK 6426 */ 6427 public StatusCode setControl(ControlRequest request) 6428 { 6429 if (request instanceof DutyCycleOut) 6430 return setControl((DutyCycleOut)request); 6431 if (request instanceof TorqueCurrentFOC) 6432 return setControl((TorqueCurrentFOC)request); 6433 if (request instanceof VoltageOut) 6434 return setControl((VoltageOut)request); 6435 if (request instanceof PositionDutyCycle) 6436 return setControl((PositionDutyCycle)request); 6437 if (request instanceof PositionVoltage) 6438 return setControl((PositionVoltage)request); 6439 if (request instanceof PositionTorqueCurrentFOC) 6440 return setControl((PositionTorqueCurrentFOC)request); 6441 if (request instanceof VelocityDutyCycle) 6442 return setControl((VelocityDutyCycle)request); 6443 if (request instanceof VelocityVoltage) 6444 return setControl((VelocityVoltage)request); 6445 if (request instanceof VelocityTorqueCurrentFOC) 6446 return setControl((VelocityTorqueCurrentFOC)request); 6447 if (request instanceof MotionMagicDutyCycle) 6448 return setControl((MotionMagicDutyCycle)request); 6449 if (request instanceof MotionMagicVoltage) 6450 return setControl((MotionMagicVoltage)request); 6451 if (request instanceof MotionMagicTorqueCurrentFOC) 6452 return setControl((MotionMagicTorqueCurrentFOC)request); 6453 if (request instanceof DifferentialDutyCycle) 6454 return setControl((DifferentialDutyCycle)request); 6455 if (request instanceof DifferentialVoltage) 6456 return setControl((DifferentialVoltage)request); 6457 if (request instanceof DifferentialPositionDutyCycle) 6458 return setControl((DifferentialPositionDutyCycle)request); 6459 if (request instanceof DifferentialPositionVoltage) 6460 return setControl((DifferentialPositionVoltage)request); 6461 if (request instanceof DifferentialVelocityDutyCycle) 6462 return setControl((DifferentialVelocityDutyCycle)request); 6463 if (request instanceof DifferentialVelocityVoltage) 6464 return setControl((DifferentialVelocityVoltage)request); 6465 if (request instanceof DifferentialMotionMagicDutyCycle) 6466 return setControl((DifferentialMotionMagicDutyCycle)request); 6467 if (request instanceof DifferentialMotionMagicVoltage) 6468 return setControl((DifferentialMotionMagicVoltage)request); 6469 if (request instanceof Follower) 6470 return setControl((Follower)request); 6471 if (request instanceof StrictFollower) 6472 return setControl((StrictFollower)request); 6473 if (request instanceof DifferentialFollower) 6474 return setControl((DifferentialFollower)request); 6475 if (request instanceof DifferentialStrictFollower) 6476 return setControl((DifferentialStrictFollower)request); 6477 if (request instanceof NeutralOut) 6478 return setControl((NeutralOut)request); 6479 if (request instanceof CoastOut) 6480 return setControl((CoastOut)request); 6481 if (request instanceof StaticBrake) 6482 return setControl((StaticBrake)request); 6483 if (request instanceof MusicTone) 6484 return setControl((MusicTone)request); 6485 if (request instanceof MotionMagicVelocityDutyCycle) 6486 return setControl((MotionMagicVelocityDutyCycle)request); 6487 if (request instanceof MotionMagicVelocityTorqueCurrentFOC) 6488 return setControl((MotionMagicVelocityTorqueCurrentFOC)request); 6489 if (request instanceof MotionMagicVelocityVoltage) 6490 return setControl((MotionMagicVelocityVoltage)request); 6491 if (request instanceof MotionMagicExpoDutyCycle) 6492 return setControl((MotionMagicExpoDutyCycle)request); 6493 if (request instanceof MotionMagicExpoVoltage) 6494 return setControl((MotionMagicExpoVoltage)request); 6495 if (request instanceof MotionMagicExpoTorqueCurrentFOC) 6496 return setControl((MotionMagicExpoTorqueCurrentFOC)request); 6497 if (request instanceof DynamicMotionMagicDutyCycle) 6498 return setControl((DynamicMotionMagicDutyCycle)request); 6499 if (request instanceof DynamicMotionMagicVoltage) 6500 return setControl((DynamicMotionMagicVoltage)request); 6501 if (request instanceof DynamicMotionMagicTorqueCurrentFOC) 6502 return setControl((DynamicMotionMagicTorqueCurrentFOC)request); 6503 if (request instanceof Diff_DutyCycleOut_Position) 6504 return setControl((Diff_DutyCycleOut_Position)request); 6505 if (request instanceof Diff_PositionDutyCycle_Position) 6506 return setControl((Diff_PositionDutyCycle_Position)request); 6507 if (request instanceof Diff_VelocityDutyCycle_Position) 6508 return setControl((Diff_VelocityDutyCycle_Position)request); 6509 if (request instanceof Diff_MotionMagicDutyCycle_Position) 6510 return setControl((Diff_MotionMagicDutyCycle_Position)request); 6511 if (request instanceof Diff_DutyCycleOut_Velocity) 6512 return setControl((Diff_DutyCycleOut_Velocity)request); 6513 if (request instanceof Diff_PositionDutyCycle_Velocity) 6514 return setControl((Diff_PositionDutyCycle_Velocity)request); 6515 if (request instanceof Diff_VelocityDutyCycle_Velocity) 6516 return setControl((Diff_VelocityDutyCycle_Velocity)request); 6517 if (request instanceof Diff_MotionMagicDutyCycle_Velocity) 6518 return setControl((Diff_MotionMagicDutyCycle_Velocity)request); 6519 if (request instanceof Diff_VoltageOut_Position) 6520 return setControl((Diff_VoltageOut_Position)request); 6521 if (request instanceof Diff_PositionVoltage_Position) 6522 return setControl((Diff_PositionVoltage_Position)request); 6523 if (request instanceof Diff_VelocityVoltage_Position) 6524 return setControl((Diff_VelocityVoltage_Position)request); 6525 if (request instanceof Diff_MotionMagicVoltage_Position) 6526 return setControl((Diff_MotionMagicVoltage_Position)request); 6527 if (request instanceof Diff_VoltageOut_Velocity) 6528 return setControl((Diff_VoltageOut_Velocity)request); 6529 if (request instanceof Diff_PositionVoltage_Velocity) 6530 return setControl((Diff_PositionVoltage_Velocity)request); 6531 if (request instanceof Diff_VelocityVoltage_Velocity) 6532 return setControl((Diff_VelocityVoltage_Velocity)request); 6533 if (request instanceof Diff_MotionMagicVoltage_Velocity) 6534 return setControl((Diff_MotionMagicVoltage_Velocity)request); 6535 if (request instanceof Diff_TorqueCurrentFOC_Position) 6536 return setControl((Diff_TorqueCurrentFOC_Position)request); 6537 if (request instanceof Diff_PositionTorqueCurrentFOC_Position) 6538 return setControl((Diff_PositionTorqueCurrentFOC_Position)request); 6539 if (request instanceof Diff_VelocityTorqueCurrentFOC_Position) 6540 return setControl((Diff_VelocityTorqueCurrentFOC_Position)request); 6541 if (request instanceof Diff_MotionMagicTorqueCurrentFOC_Position) 6542 return setControl((Diff_MotionMagicTorqueCurrentFOC_Position)request); 6543 if (request instanceof Diff_TorqueCurrentFOC_Velocity) 6544 return setControl((Diff_TorqueCurrentFOC_Velocity)request); 6545 if (request instanceof Diff_PositionTorqueCurrentFOC_Velocity) 6546 return setControl((Diff_PositionTorqueCurrentFOC_Velocity)request); 6547 if (request instanceof Diff_VelocityTorqueCurrentFOC_Velocity) 6548 return setControl((Diff_VelocityTorqueCurrentFOC_Velocity)request); 6549 if (request instanceof Diff_MotionMagicTorqueCurrentFOC_Velocity) 6550 return setControl((Diff_MotionMagicTorqueCurrentFOC_Velocity)request); 6551 return StatusCode.NotSupported; 6552 } 6553 6554 6555 /** 6556 * Sets the mechanism position of the device in mechanism rotations. 6557 * 6558 * @param newValue Value to set to. Units are in rotations. 6559 * @param timeoutSeconds Maximum time to wait up to in seconds. 6560 * @return StatusCode of the set command 6561 */ 6562 public StatusCode setPosition(double newValue, double timeoutSeconds) { 6563 return getConfigurator().setPosition(newValue, timeoutSeconds); 6564 } 6565 /** 6566 * Sets the mechanism position of the device in mechanism rotations. 6567 * <p> 6568 * This will wait up to 0.050 seconds (50ms) by default. 6569 * 6570 * @param newValue Value to set to. Units are in rotations. 6571 * @return StatusCode of the set command 6572 */ 6573 public StatusCode setPosition(double newValue) { 6574 return setPosition(newValue, 0.050); 6575 } 6576 6577 /** 6578 * Clear the sticky faults in the device. 6579 * <p> 6580 * This typically has no impact on the device functionality. Instead, 6581 * it just clears telemetry faults that are accessible via API and 6582 * Tuner Self-Test. 6583 * 6584 * @param timeoutSeconds Maximum time to wait up to in seconds. 6585 * @return StatusCode of the set command 6586 */ 6587 public StatusCode clearStickyFaults(double timeoutSeconds) { 6588 return getConfigurator().clearStickyFaults(timeoutSeconds); 6589 } 6590 /** 6591 * Clear the sticky faults in the device. 6592 * <p> 6593 * This typically has no impact on the device functionality. Instead, 6594 * it just clears telemetry faults that are accessible via API and 6595 * Tuner Self-Test. 6596 * <p> 6597 * This will wait up to 0.050 seconds (50ms) by default. 6598 * 6599 * @return StatusCode of the set command 6600 */ 6601 public StatusCode clearStickyFaults() { 6602 return clearStickyFaults(0.050); 6603 } 6604 6605 /** 6606 * Clear sticky fault: Hardware fault occurred 6607 * 6608 * @param timeoutSeconds Maximum time to wait up to in seconds. 6609 * @return StatusCode of the set command 6610 */ 6611 public StatusCode clearStickyFault_Hardware(double timeoutSeconds) { 6612 return getConfigurator().clearStickyFault_Hardware(timeoutSeconds); 6613 } 6614 /** 6615 * Clear sticky fault: Hardware fault occurred 6616 * <p> 6617 * This will wait up to 0.050 seconds (50ms) by default. 6618 * 6619 * @return StatusCode of the set command 6620 */ 6621 public StatusCode clearStickyFault_Hardware() { 6622 return clearStickyFault_Hardware(0.050); 6623 } 6624 6625 /** 6626 * Clear sticky fault: Processor temperature exceeded limit 6627 * 6628 * @param timeoutSeconds Maximum time to wait up to in seconds. 6629 * @return StatusCode of the set command 6630 */ 6631 public StatusCode clearStickyFault_ProcTemp(double timeoutSeconds) { 6632 return getConfigurator().clearStickyFault_ProcTemp(timeoutSeconds); 6633 } 6634 /** 6635 * Clear sticky fault: Processor temperature exceeded limit 6636 * <p> 6637 * This will wait up to 0.050 seconds (50ms) by default. 6638 * 6639 * @return StatusCode of the set command 6640 */ 6641 public StatusCode clearStickyFault_ProcTemp() { 6642 return clearStickyFault_ProcTemp(0.050); 6643 } 6644 6645 /** 6646 * Clear sticky fault: Device temperature exceeded limit 6647 * 6648 * @param timeoutSeconds Maximum time to wait up to in seconds. 6649 * @return StatusCode of the set command 6650 */ 6651 public StatusCode clearStickyFault_DeviceTemp(double timeoutSeconds) { 6652 return getConfigurator().clearStickyFault_DeviceTemp(timeoutSeconds); 6653 } 6654 /** 6655 * Clear sticky fault: Device temperature exceeded limit 6656 * <p> 6657 * This will wait up to 0.050 seconds (50ms) by default. 6658 * 6659 * @return StatusCode of the set command 6660 */ 6661 public StatusCode clearStickyFault_DeviceTemp() { 6662 return clearStickyFault_DeviceTemp(0.050); 6663 } 6664 6665 /** 6666 * Clear sticky fault: Device supply voltage dropped to near brownout 6667 * levels 6668 * 6669 * @param timeoutSeconds Maximum time to wait up to in seconds. 6670 * @return StatusCode of the set command 6671 */ 6672 public StatusCode clearStickyFault_Undervoltage(double timeoutSeconds) { 6673 return getConfigurator().clearStickyFault_Undervoltage(timeoutSeconds); 6674 } 6675 /** 6676 * Clear sticky fault: Device supply voltage dropped to near brownout 6677 * levels 6678 * <p> 6679 * This will wait up to 0.050 seconds (50ms) by default. 6680 * 6681 * @return StatusCode of the set command 6682 */ 6683 public StatusCode clearStickyFault_Undervoltage() { 6684 return clearStickyFault_Undervoltage(0.050); 6685 } 6686 6687 /** 6688 * Clear sticky fault: Device boot while detecting the enable signal 6689 * 6690 * @param timeoutSeconds Maximum time to wait up to in seconds. 6691 * @return StatusCode of the set command 6692 */ 6693 public StatusCode clearStickyFault_BootDuringEnable(double timeoutSeconds) { 6694 return getConfigurator().clearStickyFault_BootDuringEnable(timeoutSeconds); 6695 } 6696 /** 6697 * Clear sticky fault: Device boot while detecting the enable signal 6698 * <p> 6699 * This will wait up to 0.050 seconds (50ms) by default. 6700 * 6701 * @return StatusCode of the set command 6702 */ 6703 public StatusCode clearStickyFault_BootDuringEnable() { 6704 return clearStickyFault_BootDuringEnable(0.050); 6705 } 6706 6707 /** 6708 * Clear sticky fault: Bridge was disabled most likely due to supply 6709 * voltage dropping too low. 6710 * 6711 * @param timeoutSeconds Maximum time to wait up to in seconds. 6712 * @return StatusCode of the set command 6713 */ 6714 public StatusCode clearStickyFault_BridgeBrownout(double timeoutSeconds) { 6715 return getConfigurator().clearStickyFault_BridgeBrownout(timeoutSeconds); 6716 } 6717 /** 6718 * Clear sticky fault: Bridge was disabled most likely due to supply 6719 * voltage dropping too low. 6720 * <p> 6721 * This will wait up to 0.050 seconds (50ms) by default. 6722 * 6723 * @return StatusCode of the set command 6724 */ 6725 public StatusCode clearStickyFault_BridgeBrownout() { 6726 return clearStickyFault_BridgeBrownout(0.050); 6727 } 6728 6729 /** 6730 * Clear sticky fault: The remote sensor has reset. 6731 * 6732 * @param timeoutSeconds Maximum time to wait up to in seconds. 6733 * @return StatusCode of the set command 6734 */ 6735 public StatusCode clearStickyFault_RemoteSensorReset(double timeoutSeconds) { 6736 return getConfigurator().clearStickyFault_RemoteSensorReset(timeoutSeconds); 6737 } 6738 /** 6739 * Clear sticky fault: The remote sensor has reset. 6740 * <p> 6741 * This will wait up to 0.050 seconds (50ms) by default. 6742 * 6743 * @return StatusCode of the set command 6744 */ 6745 public StatusCode clearStickyFault_RemoteSensorReset() { 6746 return clearStickyFault_RemoteSensorReset(0.050); 6747 } 6748 6749 /** 6750 * Clear sticky fault: The remote Talon FX used for differential 6751 * control is not present on CAN Bus. 6752 * 6753 * @param timeoutSeconds Maximum time to wait up to in seconds. 6754 * @return StatusCode of the set command 6755 */ 6756 public StatusCode clearStickyFault_MissingDifferentialFX(double timeoutSeconds) { 6757 return getConfigurator().clearStickyFault_MissingDifferentialFX(timeoutSeconds); 6758 } 6759 /** 6760 * Clear sticky fault: The remote Talon FX used for differential 6761 * control is not present on CAN Bus. 6762 * <p> 6763 * This will wait up to 0.050 seconds (50ms) by default. 6764 * 6765 * @return StatusCode of the set command 6766 */ 6767 public StatusCode clearStickyFault_MissingDifferentialFX() { 6768 return clearStickyFault_MissingDifferentialFX(0.050); 6769 } 6770 6771 /** 6772 * Clear sticky fault: The remote sensor position has overflowed. 6773 * Because of the nature of remote sensors, it is possible for the 6774 * remote sensor position to overflow beyond what is supported by the 6775 * status signal frame. However, this is rare and cannot occur over 6776 * the course of an FRC match under normal use. 6777 * 6778 * @param timeoutSeconds Maximum time to wait up to in seconds. 6779 * @return StatusCode of the set command 6780 */ 6781 public StatusCode clearStickyFault_RemoteSensorPosOverflow(double timeoutSeconds) { 6782 return getConfigurator().clearStickyFault_RemoteSensorPosOverflow(timeoutSeconds); 6783 } 6784 /** 6785 * Clear sticky fault: The remote sensor position has overflowed. 6786 * Because of the nature of remote sensors, it is possible for the 6787 * remote sensor position to overflow beyond what is supported by the 6788 * status signal frame. However, this is rare and cannot occur over 6789 * the course of an FRC match under normal use. 6790 * <p> 6791 * This will wait up to 0.050 seconds (50ms) by default. 6792 * 6793 * @return StatusCode of the set command 6794 */ 6795 public StatusCode clearStickyFault_RemoteSensorPosOverflow() { 6796 return clearStickyFault_RemoteSensorPosOverflow(0.050); 6797 } 6798 6799 /** 6800 * Clear sticky fault: Supply Voltage has exceeded the maximum voltage 6801 * rating of device. 6802 * 6803 * @param timeoutSeconds Maximum time to wait up to in seconds. 6804 * @return StatusCode of the set command 6805 */ 6806 public StatusCode clearStickyFault_OverSupplyV(double timeoutSeconds) { 6807 return getConfigurator().clearStickyFault_OverSupplyV(timeoutSeconds); 6808 } 6809 /** 6810 * Clear sticky fault: Supply Voltage has exceeded the maximum voltage 6811 * rating of device. 6812 * <p> 6813 * This will wait up to 0.050 seconds (50ms) by default. 6814 * 6815 * @return StatusCode of the set command 6816 */ 6817 public StatusCode clearStickyFault_OverSupplyV() { 6818 return clearStickyFault_OverSupplyV(0.050); 6819 } 6820 6821 /** 6822 * Clear sticky fault: Supply Voltage is unstable. Ensure you are 6823 * using a battery and current limited power supply. 6824 * 6825 * @param timeoutSeconds Maximum time to wait up to in seconds. 6826 * @return StatusCode of the set command 6827 */ 6828 public StatusCode clearStickyFault_UnstableSupplyV(double timeoutSeconds) { 6829 return getConfigurator().clearStickyFault_UnstableSupplyV(timeoutSeconds); 6830 } 6831 /** 6832 * Clear sticky fault: Supply Voltage is unstable. Ensure you are 6833 * using a battery and current limited power supply. 6834 * <p> 6835 * This will wait up to 0.050 seconds (50ms) by default. 6836 * 6837 * @return StatusCode of the set command 6838 */ 6839 public StatusCode clearStickyFault_UnstableSupplyV() { 6840 return clearStickyFault_UnstableSupplyV(0.050); 6841 } 6842 6843 /** 6844 * Clear sticky fault: Reverse limit switch has been asserted. Output 6845 * is set to neutral. 6846 * 6847 * @param timeoutSeconds Maximum time to wait up to in seconds. 6848 * @return StatusCode of the set command 6849 */ 6850 public StatusCode clearStickyFault_ReverseHardLimit(double timeoutSeconds) { 6851 return getConfigurator().clearStickyFault_ReverseHardLimit(timeoutSeconds); 6852 } 6853 /** 6854 * Clear sticky fault: Reverse limit switch has been asserted. Output 6855 * is set to neutral. 6856 * <p> 6857 * This will wait up to 0.050 seconds (50ms) by default. 6858 * 6859 * @return StatusCode of the set command 6860 */ 6861 public StatusCode clearStickyFault_ReverseHardLimit() { 6862 return clearStickyFault_ReverseHardLimit(0.050); 6863 } 6864 6865 /** 6866 * Clear sticky fault: Forward limit switch has been asserted. Output 6867 * is set to neutral. 6868 * 6869 * @param timeoutSeconds Maximum time to wait up to in seconds. 6870 * @return StatusCode of the set command 6871 */ 6872 public StatusCode clearStickyFault_ForwardHardLimit(double timeoutSeconds) { 6873 return getConfigurator().clearStickyFault_ForwardHardLimit(timeoutSeconds); 6874 } 6875 /** 6876 * Clear sticky fault: Forward limit switch has been asserted. Output 6877 * is set to neutral. 6878 * <p> 6879 * This will wait up to 0.050 seconds (50ms) by default. 6880 * 6881 * @return StatusCode of the set command 6882 */ 6883 public StatusCode clearStickyFault_ForwardHardLimit() { 6884 return clearStickyFault_ForwardHardLimit(0.050); 6885 } 6886 6887 /** 6888 * Clear sticky fault: Reverse soft limit has been asserted. Output 6889 * is set to neutral. 6890 * 6891 * @param timeoutSeconds Maximum time to wait up to in seconds. 6892 * @return StatusCode of the set command 6893 */ 6894 public StatusCode clearStickyFault_ReverseSoftLimit(double timeoutSeconds) { 6895 return getConfigurator().clearStickyFault_ReverseSoftLimit(timeoutSeconds); 6896 } 6897 /** 6898 * Clear sticky fault: Reverse soft limit has been asserted. Output 6899 * is set to neutral. 6900 * <p> 6901 * This will wait up to 0.050 seconds (50ms) by default. 6902 * 6903 * @return StatusCode of the set command 6904 */ 6905 public StatusCode clearStickyFault_ReverseSoftLimit() { 6906 return clearStickyFault_ReverseSoftLimit(0.050); 6907 } 6908 6909 /** 6910 * Clear sticky fault: Forward soft limit has been asserted. Output 6911 * is set to neutral. 6912 * 6913 * @param timeoutSeconds Maximum time to wait up to in seconds. 6914 * @return StatusCode of the set command 6915 */ 6916 public StatusCode clearStickyFault_ForwardSoftLimit(double timeoutSeconds) { 6917 return getConfigurator().clearStickyFault_ForwardSoftLimit(timeoutSeconds); 6918 } 6919 /** 6920 * Clear sticky fault: Forward soft limit has been asserted. Output 6921 * is set to neutral. 6922 * <p> 6923 * This will wait up to 0.050 seconds (50ms) by default. 6924 * 6925 * @return StatusCode of the set command 6926 */ 6927 public StatusCode clearStickyFault_ForwardSoftLimit() { 6928 return clearStickyFault_ForwardSoftLimit(0.050); 6929 } 6930 6931 /** 6932 * Clear sticky fault: The remote sensor's data is no longer trusted. 6933 * This can happen if the remote sensor disappears from the CAN bus or 6934 * if the remote sensor indicates its data is no longer valid, such as 6935 * when a CANcoder's magnet strength falls into the "red" range. 6936 * 6937 * @param timeoutSeconds Maximum time to wait up to in seconds. 6938 * @return StatusCode of the set command 6939 */ 6940 public StatusCode clearStickyFault_RemoteSensorDataInvalid(double timeoutSeconds) { 6941 return getConfigurator().clearStickyFault_RemoteSensorDataInvalid(timeoutSeconds); 6942 } 6943 /** 6944 * Clear sticky fault: The remote sensor's data is no longer trusted. 6945 * This can happen if the remote sensor disappears from the CAN bus or 6946 * if the remote sensor indicates its data is no longer valid, such as 6947 * when a CANcoder's magnet strength falls into the "red" range. 6948 * <p> 6949 * This will wait up to 0.050 seconds (50ms) by default. 6950 * 6951 * @return StatusCode of the set command 6952 */ 6953 public StatusCode clearStickyFault_RemoteSensorDataInvalid() { 6954 return clearStickyFault_RemoteSensorDataInvalid(0.050); 6955 } 6956 6957 /** 6958 * Clear sticky fault: The remote sensor used for fusion has fallen 6959 * out of sync to the local sensor. A re-synchronization has occurred, 6960 * which may cause a discontinuity. This typically happens if there is 6961 * significant slop in the mechanism, or if the RotorToSensorRatio 6962 * configuration parameter is incorrect. 6963 * 6964 * @param timeoutSeconds Maximum time to wait up to in seconds. 6965 * @return StatusCode of the set command 6966 */ 6967 public StatusCode clearStickyFault_FusedSensorOutOfSync(double timeoutSeconds) { 6968 return getConfigurator().clearStickyFault_FusedSensorOutOfSync(timeoutSeconds); 6969 } 6970 /** 6971 * Clear sticky fault: The remote sensor used for fusion has fallen 6972 * out of sync to the local sensor. A re-synchronization has occurred, 6973 * which may cause a discontinuity. This typically happens if there is 6974 * significant slop in the mechanism, or if the RotorToSensorRatio 6975 * configuration parameter is incorrect. 6976 * <p> 6977 * This will wait up to 0.050 seconds (50ms) by default. 6978 * 6979 * @return StatusCode of the set command 6980 */ 6981 public StatusCode clearStickyFault_FusedSensorOutOfSync() { 6982 return clearStickyFault_FusedSensorOutOfSync(0.050); 6983 } 6984 6985 /** 6986 * Clear sticky fault: Stator current limit occured. 6987 * 6988 * @param timeoutSeconds Maximum time to wait up to in seconds. 6989 * @return StatusCode of the set command 6990 */ 6991 public StatusCode clearStickyFault_StatorCurrLimit(double timeoutSeconds) { 6992 return getConfigurator().clearStickyFault_StatorCurrLimit(timeoutSeconds); 6993 } 6994 /** 6995 * Clear sticky fault: Stator current limit occured. 6996 * <p> 6997 * This will wait up to 0.050 seconds (50ms) by default. 6998 * 6999 * @return StatusCode of the set command 7000 */ 7001 public StatusCode clearStickyFault_StatorCurrLimit() { 7002 return clearStickyFault_StatorCurrLimit(0.050); 7003 } 7004 7005 /** 7006 * Clear sticky fault: Supply current limit occured. 7007 * 7008 * @param timeoutSeconds Maximum time to wait up to in seconds. 7009 * @return StatusCode of the set command 7010 */ 7011 public StatusCode clearStickyFault_SupplyCurrLimit(double timeoutSeconds) { 7012 return getConfigurator().clearStickyFault_SupplyCurrLimit(timeoutSeconds); 7013 } 7014 /** 7015 * Clear sticky fault: Supply current limit occured. 7016 * <p> 7017 * This will wait up to 0.050 seconds (50ms) by default. 7018 * 7019 * @return StatusCode of the set command 7020 */ 7021 public StatusCode clearStickyFault_SupplyCurrLimit() { 7022 return clearStickyFault_SupplyCurrLimit(0.050); 7023 } 7024} 7025