Class CommutationConfigs

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

public class CommutationConfigs extends Object implements ParentConfiguration, Cloneable
Configs that determine motor selection and commutation.

Set these configs to match your motor setup before commanding motor output.

  • Field Details

    • AdvancedHallSupport

      public AdvancedHallSupportValue AdvancedHallSupport
      Requires Phoenix Pro; Improves commutation and velocity measurement for motors with hall sensors. Talon can use advanced features to improve commutation and velocity measurement when using a motor with hall sensors. This can improve peak efficiency by as high as 2% and reduce noise in the measured velocity.
    • MotorArrangement

      public MotorArrangementValue MotorArrangement
      Selects the motor and motor connections used with Talon.

      This setting determines what kind of motor and sensors are used with the Talon. This also determines what signals are used on the JST and Gadgeteer port.

      Motor drive will not function correctly if this setting does not match the physical setup.

    • BrushedMotorWiring

      public BrushedMotorWiringValue BrushedMotorWiring
      If a brushed motor is selected with Motor Arrangement, this config determines which of three leads to use.
  • Constructor Details

    • CommutationConfigs

      public CommutationConfigs()
  • Method Details

    • withAdvancedHallSupport

      public final CommutationConfigs withAdvancedHallSupport(AdvancedHallSupportValue newAdvancedHallSupport)
      Modifies this configuration's AdvancedHallSupport parameter and returns itself for method-chaining and easier to use config API.

      Requires Phoenix Pro; Improves commutation and velocity measurement for motors with hall sensors. Talon can use advanced features to improve commutation and velocity measurement when using a motor with hall sensors. This can improve peak efficiency by as high as 2% and reduce noise in the measured velocity.

      Parameters:
      newAdvancedHallSupport - Parameter to modify
      Returns:
      Itself
    • withMotorArrangement

      public final CommutationConfigs withMotorArrangement(MotorArrangementValue newMotorArrangement)
      Modifies this configuration's MotorArrangement parameter and returns itself for method-chaining and easier to use config API.

      Selects the motor and motor connections used with Talon.

      This setting determines what kind of motor and sensors are used with the Talon. This also determines what signals are used on the JST and Gadgeteer port.

      Motor drive will not function correctly if this setting does not match the physical setup.

      Parameters:
      newMotorArrangement - Parameter to modify
      Returns:
      Itself
    • withBrushedMotorWiring

      public final CommutationConfigs withBrushedMotorWiring(BrushedMotorWiringValue newBrushedMotorWiring)
      Modifies this configuration's BrushedMotorWiring parameter and returns itself for method-chaining and easier to use config API.

      If a brushed motor is selected with Motor Arrangement, this config determines which of three leads to use.

      Parameters:
      newBrushedMotorWiring - 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 ParentConfiguration
      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
      Parameters:
      to_deserialize - The serialized configuration
      Returns:
      Return code of the deserialize method
    • clone

      public CommutationConfigs clone()
      Overrides:
      clone in class Object