Class CustomBrushlessMotorConfigs

java.lang.Object
com.ctre.phoenix6.configs.CustomBrushlessMotorConfigs
All Implemented Interfaces:
ParentConfiguration, ISerializable, Cloneable

Configs related to using a custom brushless motor that is not formally supported by Talon FXS.

Configs are only used when Motor Arrangement is set to Custom Brushless Motor. Note this feature will only work device is not FRC-Locked.

Users are responsible for ensuring that these configs are accurate to the motor. CTR Electronics is not responsible for damage caused by an incorrect custom motor configuration.

  • Field Details

    • MotorKv

      public double MotorKv
      Kv constant of the connected custom brushless motor. This can usually be determined by consulting the motor manufacturer data sheet.
      • Minimum Value: 0
      • Maximum Value: 2047
      • Default Value: 500
      • Units: RPM/V
    • PolePairCount

      public int PolePairCount
      Number of pole pairs in the connected custom brushless motor (number of poles divided by 2). This can usually be determined by consulting the motor manufacturer data sheet.

      For example, if motor has ten poles, then specify five pole pairs.

      • Minimum Value: 1
      • Maximum Value: 8
      • Default Value: 1
      • Units:
    • HallDuringAB

      public int HallDuringAB
      Expected Hall Value when motor controller applies A+ and B-.

      Hall Values are little endian [CBA]. For example, if halls report: HA=0, HB=0, HC=1, then the Hall Value is 4.

      • Minimum Value: 0
      • Maximum Value: 6
      • Default Value: 0
      • Units:
    • HallDuringAC

      public int HallDuringAC
      Expected Hall Value when motor controller applies A+ and C-.

      Hall Values are little endian [CBA]. For example, if halls report: HA=0, HB=0, HC=1, then the Hall Value is 4.

      • Minimum Value: 0
      • Maximum Value: 6
      • Default Value: 0
      • Units:
    • HallCCWSelect

      public boolean HallCCWSelect
      Optional configuration to correct clockwise versus counter-clockwise rotor spin.

      Depending on the mechanical design of the motor, rotor may spin clockwise during positive output when Inverted is set to counterclockwise. This configuration can be toggled so that the rest of the API is canonically true.

      • Default Value: False
    • HallDirection

      public boolean HallDirection
      Determines expected Hall direction for rotor velocity signage.

      If RotorVelocity is signed opposite of applied voltage, flip this configuration.

      • Default Value: False
  • Constructor Details

  • Method Details

    • withMotorKv

      public final CustomBrushlessMotorConfigs withMotorKv(double newMotorKv)
      Modifies this configuration's MotorKv parameter and returns itself for method-chaining and easier to use config API.

      Kv constant of the connected custom brushless motor. This can usually be determined by consulting the motor manufacturer data sheet.

      • Minimum Value: 0
      • Maximum Value: 2047
      • Default Value: 500
      • Units: RPM/V
      Parameters:
      newMotorKv - Parameter to modify
      Returns:
      Itself
    • withMotorKv

      Modifies this configuration's MotorKv parameter and returns itself for method-chaining and easier to use config API.

      Kv constant of the connected custom brushless motor. This can usually be determined by consulting the motor manufacturer data sheet.

      • Minimum Value: 0
      • Maximum Value: 2047
      • Default Value: 500
      • Units: RPM/V
      Parameters:
      newMotorKv - Parameter to modify
      Returns:
      Itself
    • getMotorKvMeasure

      Helper method to get this configuration's MotorKv parameter converted to a unit type. If not using the Java units library, MotorKv can be accessed directly instead.

      Kv constant of the connected custom brushless motor. This can usually be determined by consulting the motor manufacturer data sheet.

      • Minimum Value: 0
      • Maximum Value: 2047
      • Default Value: 500
      • Units: RPM/V
      Returns:
      MotorKv
    • withPolePairCount

      public final CustomBrushlessMotorConfigs withPolePairCount(int newPolePairCount)
      Modifies this configuration's PolePairCount parameter and returns itself for method-chaining and easier to use config API.

      Number of pole pairs in the connected custom brushless motor (number of poles divided by 2). This can usually be determined by consulting the motor manufacturer data sheet.

      For example, if motor has ten poles, then specify five pole pairs.

      • Minimum Value: 1
      • Maximum Value: 8
      • Default Value: 1
      • Units:
      Parameters:
      newPolePairCount - Parameter to modify
      Returns:
      Itself
    • withHallDuringAB

      public final CustomBrushlessMotorConfigs withHallDuringAB(int newHallDuringAB)
      Modifies this configuration's HallDuringAB parameter and returns itself for method-chaining and easier to use config API.

      Expected Hall Value when motor controller applies A+ and B-.

      Hall Values are little endian [CBA]. For example, if halls report: HA=0, HB=0, HC=1, then the Hall Value is 4.

      • Minimum Value: 0
      • Maximum Value: 6
      • Default Value: 0
      • Units:
      Parameters:
      newHallDuringAB - Parameter to modify
      Returns:
      Itself
    • withHallDuringAC

      public final CustomBrushlessMotorConfigs withHallDuringAC(int newHallDuringAC)
      Modifies this configuration's HallDuringAC parameter and returns itself for method-chaining and easier to use config API.

      Expected Hall Value when motor controller applies A+ and C-.

      Hall Values are little endian [CBA]. For example, if halls report: HA=0, HB=0, HC=1, then the Hall Value is 4.

      • Minimum Value: 0
      • Maximum Value: 6
      • Default Value: 0
      • Units:
      Parameters:
      newHallDuringAC - Parameter to modify
      Returns:
      Itself
    • withHallCCWSelect

      public final CustomBrushlessMotorConfigs withHallCCWSelect(boolean newHallCCWSelect)
      Modifies this configuration's HallCCWSelect parameter and returns itself for method-chaining and easier to use config API.

      Optional configuration to correct clockwise versus counter-clockwise rotor spin.

      Depending on the mechanical design of the motor, rotor may spin clockwise during positive output when Inverted is set to counterclockwise. This configuration can be toggled so that the rest of the API is canonically true.

      • Default Value: False
      Parameters:
      newHallCCWSelect - Parameter to modify
      Returns:
      Itself
    • withHallDirection

      public final CustomBrushlessMotorConfigs withHallDirection(boolean newHallDirection)
      Modifies this configuration's HallDirection parameter and returns itself for method-chaining and easier to use config API.

      Determines expected Hall direction for rotor velocity signage.

      If RotorVelocity is signed opposite of applied voltage, flip this configuration.

      • Default Value: False
      Parameters:
      newHallDirection - Parameter to modify
      Returns:
      Itself
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • serialize

      public final String serialize()
      Get the serialized form of this configuration group.
      Specified by:
      serialize in interface ISerializable
      Returns:
      Serialized form of this config group
    • deserialize

      public final StatusCode deserialize(String to_deserialize)
      Take a string and deserialize it to this configuration group.
      Specified by:
      deserialize in interface ParentConfiguration
      Returns:
      Return code of the deserialize method
    • clone

      Overrides:
      clone in class Object