CTRE Phoenix 6 C++ 25.2.1
Loading...
Searching...
No Matches
ctre::phoenix6::configs::QuadratureConfigs Class Reference

Configs related to CANdi's quadrature interface using both the S1IN and S2IN inputs. More...

#include <ctre/phoenix6/configs/Configs.hpp>

Inheritance diagram for ctre::phoenix6::configs::QuadratureConfigs:
ctre::phoenix6::configs::ParentConfiguration ctre::phoenix6::ISerializable

Public Member Functions

constexpr QuadratureConfigs ()=default
 
constexpr QuadratureConfigsWithQuadratureEdgesPerRotation (int newQuadratureEdgesPerRotation)
 Modifies this configuration's QuadratureEdgesPerRotation parameter and returns itself for method-chaining and easier to use config API.
 
constexpr QuadratureConfigsWithSensorDirection (bool newSensorDirection)
 Modifies this configuration's SensorDirection parameter and returns itself for method-chaining and easier to use config API.
 
std::string ToString () const override
 
std::string Serialize () const override
 
ctre::phoenix::StatusCode Deserialize (const std::string &to_deserialize) override
 
- Public Member Functions inherited from ctre::phoenix6::configs::ParentConfiguration
- Public Member Functions inherited from ctre::phoenix6::ISerializable

Public Attributes

int QuadratureEdgesPerRotation = 4096
 The number of quadrature edges in one rotation for the quadrature sensor connected to the Talon data port.
 
bool SensorDirection = false
 Direction of the quadrature sensor to determine positive rotation.
 

Detailed Description

Configs related to CANdi's quadrature interface using both the S1IN and S2IN inputs.

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

Constructor & Destructor Documentation

◆ QuadratureConfigs()

ctre::phoenix6::configs::QuadratureConfigs::QuadratureConfigs ( )
constexprdefault

Member Function Documentation

◆ Deserialize()

ctre::phoenix::StatusCode ctre::phoenix6::configs::QuadratureConfigs::Deserialize ( const std::string & to_deserialize)
inlineoverridevirtual

◆ Serialize()

std::string ctre::phoenix6::configs::QuadratureConfigs::Serialize ( ) const
inlineoverridevirtual

◆ ToString()

std::string ctre::phoenix6::configs::QuadratureConfigs::ToString ( ) const
inlineoverridevirtual

◆ WithQuadratureEdgesPerRotation()

QuadratureConfigs & ctre::phoenix6::configs::QuadratureConfigs::WithQuadratureEdgesPerRotation ( int newQuadratureEdgesPerRotation)
inlineconstexpr

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
newQuadratureEdgesPerRotationParameter to modify
Returns
Itself

◆ WithSensorDirection()

QuadratureConfigs & ctre::phoenix6::configs::QuadratureConfigs::WithSensorDirection ( bool newSensorDirection)
inlineconstexpr

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
newSensorDirectionParameter to modify
Returns
Itself

Member Data Documentation

◆ QuadratureEdgesPerRotation

int ctre::phoenix6::configs::QuadratureConfigs::QuadratureEdgesPerRotation = 4096

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

bool ctre::phoenix6::configs::QuadratureConfigs::SensorDirection = false

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

The documentation for this class was generated from the following file: