Class MotorOutputConfigs

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

public class MotorOutputConfigs extends Object implements ParentConfiguration
Configs that directly affect motor output.

Includes motor invert, neutral mode, and other features related to motor output.

  • Field Details

    • Inverted

      Invert state of the device as seen from the front of the motor.
    • NeutralMode

      The state of the motor controller bridge when output is neutral or disabled.
    • DutyCycleNeutralDeadband

      public double DutyCycleNeutralDeadband
      Configures the output deadband duty cycle during duty cycle and voltage based control modes.
      • Minimum Value: 0.0
      • Maximum Value: 0.25
      • Default Value: 0
      • Units: fractional
    • PeakForwardDutyCycle

      public double PeakForwardDutyCycle
      Maximum (forward) output during duty cycle based control modes.
      • Minimum Value: -1.0
      • Maximum Value: 1.0
      • Default Value: 1
      • Units: fractional
    • PeakReverseDutyCycle

      public double PeakReverseDutyCycle
      Minimum (reverse) output during duty cycle based control modes.
      • Minimum Value: -1.0
      • Maximum Value: 1.0
      • Default Value: -1
      • Units: fractional
    • ControlTimesyncFreqHz

      public double ControlTimesyncFreqHz
      When a control request UseTimesync is enabled, this determines the time-sychronized frequency at which control requests are applied.

      The application of the control request will be delayed until the next timesync boundary at the frequency defined by this config. When set to 0 Hz, timesync will never be used for control requests, regardless of the value of UseTimesync.

      • Minimum Value: 50
      • Maximum Value: 500
      • Default Value: 0
      • Units: Hz
  • Constructor Details

  • Method Details

    • withInverted

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

      Invert state of the device as seen from the front of the motor.

      Parameters:
      newInverted - Parameter to modify
      Returns:
      Itself
    • withNeutralMode

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

      The state of the motor controller bridge when output is neutral or disabled.

      Parameters:
      newNeutralMode - Parameter to modify
      Returns:
      Itself
    • withDutyCycleNeutralDeadband

      public MotorOutputConfigs withDutyCycleNeutralDeadband(double newDutyCycleNeutralDeadband)
      Modifies this configuration's DutyCycleNeutralDeadband parameter and returns itself for method-chaining and easier to use config API.

      Configures the output deadband duty cycle during duty cycle and voltage based control modes.

      • Minimum Value: 0.0
      • Maximum Value: 0.25
      • Default Value: 0
      • Units: fractional
      Parameters:
      newDutyCycleNeutralDeadband - Parameter to modify
      Returns:
      Itself
    • withPeakForwardDutyCycle

      public MotorOutputConfigs withPeakForwardDutyCycle(double newPeakForwardDutyCycle)
      Modifies this configuration's PeakForwardDutyCycle parameter and returns itself for method-chaining and easier to use config API.

      Maximum (forward) output during duty cycle based control modes.

      • Minimum Value: -1.0
      • Maximum Value: 1.0
      • Default Value: 1
      • Units: fractional
      Parameters:
      newPeakForwardDutyCycle - Parameter to modify
      Returns:
      Itself
    • withPeakReverseDutyCycle

      public MotorOutputConfigs withPeakReverseDutyCycle(double newPeakReverseDutyCycle)
      Modifies this configuration's PeakReverseDutyCycle parameter and returns itself for method-chaining and easier to use config API.

      Minimum (reverse) output during duty cycle based control modes.

      • Minimum Value: -1.0
      • Maximum Value: 1.0
      • Default Value: -1
      • Units: fractional
      Parameters:
      newPeakReverseDutyCycle - Parameter to modify
      Returns:
      Itself
    • withControlTimesyncFreqHz

      public MotorOutputConfigs withControlTimesyncFreqHz(double newControlTimesyncFreqHz)
      Modifies this configuration's ControlTimesyncFreqHz parameter and returns itself for method-chaining and easier to use config API.

      When a control request UseTimesync is enabled, this determines the time-sychronized frequency at which control requests are applied.

      The application of the control request will be delayed until the next timesync boundary at the frequency defined by this config. When set to 0 Hz, timesync will never be used for control requests, regardless of the value of UseTimesync.

      • Minimum Value: 50
      • Maximum Value: 500
      • Default Value: 0
      • Units: Hz
      Parameters:
      newControlTimesyncFreqHz - Parameter to modify
      Returns:
      Itself
    • withControlTimesyncFreqHz

      public MotorOutputConfigs withControlTimesyncFreqHz(Frequency newControlTimesyncFreqHz)
      Modifies this configuration's ControlTimesyncFreqHz parameter and returns itself for method-chaining and easier to use config API.

      When a control request UseTimesync is enabled, this determines the time-sychronized frequency at which control requests are applied.

      The application of the control request will be delayed until the next timesync boundary at the frequency defined by this config. When set to 0 Hz, timesync will never be used for control requests, regardless of the value of UseTimesync.

      • Minimum Value: 50
      • Maximum Value: 500
      • Default Value: 0
      • Units: Hz
      Parameters:
      newControlTimesyncFreqHz - Parameter to modify
      Returns:
      Itself
    • getControlTimesyncFreqHzMeasure

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

      When a control request UseTimesync is enabled, this determines the time-sychronized frequency at which control requests are applied.

      The application of the control request will be delayed until the next timesync boundary at the frequency defined by this config. When set to 0 Hz, timesync will never be used for control requests, regardless of the value of UseTimesync.

      • Minimum Value: 50
      • Maximum Value: 500
      • Default Value: 0
      • Units: Hz
      Returns:
      ControlTimesyncFreqHz
    • 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