Skip to content

Latest commit

 

History

History
160 lines (117 loc) · 5.88 KB

File metadata and controls

160 lines (117 loc) · 5.88 KB

TalonFX

Getting Started

The TalonFX is the motor controller used to control Kraken X60's and Falcon 500's

{% embed url="https://wcproducts.com/products/kraken" %}

{% hint style="warning" %} If you are using Falcon 500 v2 (which are effectively discontinued) make sure that you apply the loctite fix described here!
https://content.vexrobotics.com/vexpro/Falcon/217-6515-753-Falcon500-V2-Upgrade.pdf {% endhint %}

They are commonly used as drive motors since they can be more powerful and efficient than REV NEO's.

import com.ctre.phoenix6.hardware.TalonFX;
import com.ctre.phoenix6.controls.DutyCycleOut;

TalonFX motor = new TalonFX(10);
motor.setControl(new DutyCycleOut(1.0)); // 100% full speed positive.

Documentation

This device can be upgraded via CTRE Tuner X.

{% embed url="https://v6.docs.ctr-electronics.com/en/latest/docs/tuner/index.html" %} Tuner X install and documentation {% endembed %}

{% embed url="https://pro.docs.ctr-electronics.com/en/stable/docs/hardware-reference/talonfx/index.html" %} Official Documentation source {% endembed %}

Pay close attention to the LED status code to help you debug this at any time. Remember that any settings changed in Tuner X for the Talon FX are overwritten on startup of YAGSL.

YAGSL Checklist

  • Set all TalonFX's to unique CAN ID's.
  • Update all TalonFX's to the latest firmware.
  • The TalonFX rotates the motor counterclockwise positive. (Invert the TalonFX programmatically if it does not rotate counterclockwise positive).
  • Tune the PID value's for one drive motor.
  • Tune the PID value's for one steering/azimuth/angle motor.

Module example configuration

The following example is one for a module configuration file, e.g. frontleft.json, frontright.json, backleft.json, and backright.json.

{
  "drive": {
    "type": "talonfx",
    "id": 5,
    "canbus": null
  },
  "angle": {
    "type": "talonfx",
    "id": 6,
    "canbus": null
  },
  "encoder": {
    "type": "cancoder",
    "id": 11,
    "canbus": null
  },
  "inverted": {
    "drive": false,
    "angle": false
  },
  "absoluteEncoderOffset": -18.281,
  "location": {
    "front": -12,
    "left": -12
  }
}

Example pidfproperties.json

{
  "drive": {
    "p": 0.0020645,
    "i": 0,
    "d": 0,
    "f": 0,
    "iz": 0
  },
  "angle": {
    "p": 0.01,
    "i": 0,
    "d": 0,
    "f": 0,
    "iz": 0
  }
}

Example physicalproperties.json

{
  "conversionFactor": {
    "drive": 0.047286787200699704,
    "angle": 16.8
  },
  "currentLimit": {
    "drive": 40,
    "angle": 20
  },
  "rampRate": {
    "drive": 0.25,
    "angle": 0.25
  },
  "wheelGripCoefficientOfFriction": 1.19,
  "optimalVoltage": 12
}