Class QuadratureConfigs

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

public class QuadratureConfigs extends Object implements ParentConfiguration
Configs related to the CANdi™ branded device's quadrature interface using both the S1IN and S2IN inputs

All the configs related to the quadrature interface for the CANdi™ branded device , including encoder edges per revolution and sensor direction.

  • Field Details

    • QuadratureEdgesPerRotation

      The number of quadrature edges in one rotation for the quadrature sensor connected to the Talon data port.

      This is the total number of transitions from high-to-low or low-to-high across both channels per rotation of the sensor. This is also equivalent to the Counts Per Revolution when using 4x decoding.

      For example, the SRX Mag Encoder has 4096 edges per rotation, and a US Digital 1024 CPR (Cycles Per Revolution) quadrature encoder has 4096 edges per rotation.

      On the Talon FXS, this can be at most 2,000,000,000 / Peak RPM.

      • Minimum Value: 1
      • Maximum Value: 1000000
      • Default Value: 4096
      • Units:
    • SensorDirection

      public boolean SensorDirection
      Direction of the quadrature sensor to determine positive rotation. Invert this so that forward motion on the mechanism results in an increase in quadrature position.
      • Default Value: False
  • Constructor Details

  • Method Details

    • withQuadratureEdgesPerRotation

      public QuadratureConfigs withQuadratureEdgesPerRotation(int newQuadratureEdgesPerRotation)
      Modifies this configuration's QuadratureEdgesPerRotation parameter and returns itself for method-chaining and easier to use config API.

      The number of quadrature edges in one rotation for the quadrature sensor connected to the Talon data port.

      This is the total number of transitions from high-to-low or low-to-high across both channels per rotation of the sensor. This is also equivalent to the Counts Per Revolution when using 4x decoding.

      For example, the SRX Mag Encoder has 4096 edges per rotation, and a US Digital 1024 CPR (Cycles Per Revolution) quadrature encoder has 4096 edges per rotation.

      On the Talon FXS, this can be at most 2,000,000,000 / Peak RPM.

      • Minimum Value: 1
      • Maximum Value: 1000000
      • Default Value: 4096
      • Units:
      Parameters:
      newQuadratureEdgesPerRotation - Parameter to modify
      Returns:
      Itself
    • withSensorDirection

      public QuadratureConfigs withSensorDirection(boolean newSensorDirection)
      Modifies this configuration's SensorDirection parameter and returns itself for method-chaining and easier to use config API.

      Direction of the quadrature sensor to determine positive rotation. Invert this so that forward motion on the mechanism results in an increase in quadrature position.

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

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

      public StatusCode deserialize(String to_deserialize)
      Specified by:
      deserialize in interface ParentConfiguration
    • serialize

      public String serialize()
      Specified by:
      serialize in interface ISerializable