CTRE_Phoenix 5.20.2
com.ctre.phoenix.motorcontrol.IMotorControllerEnhanced Interface Reference

Inherits com.ctre.phoenix.motorcontrol.IMotorController.

Inherited by com.ctre.phoenix.motorcontrol.can.BaseTalon.

Public Member Functions

ErrorCode configSelectedFeedbackSensor (FeedbackDevice feedbackDevice, int pidIdx, int timeoutMs)
 
ErrorCode configSupplyCurrentLimit (SupplyCurrentLimitConfiguration currLimitCfg, int timeoutMs)
 
ErrorCode setStatusFramePeriod (StatusFrameEnhanced frame, int periodMs, int timeoutMs)
 
int getStatusFramePeriod (StatusFrameEnhanced frame, int timeoutMs)
 
double getOutputCurrent ()
 
ErrorCode configVelocityMeasurementPeriod (SensorVelocityMeasPeriod period, int timeoutMs)
 
ErrorCode configVelocityMeasurementPeriod (VelocityMeasPeriod period, int timeoutMs)
 
ErrorCode configVelocityMeasurementWindow (int windowSize, int timeoutMs)
 
ErrorCode configForwardLimitSwitchSource (LimitSwitchSource type, LimitSwitchNormal normalOpenOrClose, int timeoutMs)
 
ErrorCode configReverseLimitSwitchSource (LimitSwitchSource type, LimitSwitchNormal normalOpenOrClose, int timeoutMs)
 
- Public Member Functions inherited from com.ctre.phoenix.motorcontrol.IMotorController
void set (ControlMode Mode, double demand)
 
void set (ControlMode Mode, double demand0, DemandType demand1Type, double demand1)
 
void neutralOutput ()
 
void setNeutralMode (NeutralMode neutralMode)
 
void setSensorPhase (boolean PhaseSensor)
 
void setInverted (boolean invert)
 
void setInverted (InvertType invertType)
 
boolean getInverted ()
 
ErrorCode configOpenloopRamp (double secondsFromNeutralToFull, int timeoutMs)
 
ErrorCode configClosedloopRamp (double secondsFromNeutralToFull, int timeoutMs)
 
ErrorCode configPeakOutputForward (double percentOut, int timeoutMs)
 
ErrorCode configPeakOutputReverse (double percentOut, int timeoutMs)
 
ErrorCode configNominalOutputForward (double percentOut, int timeoutMs)
 
ErrorCode configNominalOutputReverse (double percentOut, int timeoutMs)
 
ErrorCode configNeutralDeadband (double percentDeadband, int timeoutMs)
 
ErrorCode configVoltageCompSaturation (double voltage, int timeoutMs)
 
ErrorCode configVoltageMeasurementFilter (int filterWindowSamples, int timeoutMs)
 
void enableVoltageCompensation (boolean enable)
 
double getBusVoltage ()
 
double getMotorOutputPercent ()
 
double getMotorOutputVoltage ()
 
double getTemperature ()
 
ErrorCode configSelectedFeedbackSensor (RemoteFeedbackDevice feedbackDevice, int pidIdx, int timeoutMs)
 
ErrorCode configSelectedFeedbackCoefficient (double coefficient, int pidIdx, int timeoutMs)
 
ErrorCode configRemoteFeedbackFilter (int deviceID, RemoteSensorSource remoteSensorSource, int remoteOrdinal, int timeoutMs)
 
ErrorCode configRemoteFeedbackFilter (CANCoder canCoderRef, int remoteOrdinal, int timeoutMs)
 
ErrorCode configRemoteFeedbackFilter (BaseTalon talonRef, int remoteOrdinal, int timeoutMs)
 
ErrorCode configSensorTerm (SensorTerm sensorTerm, FeedbackDevice feedbackDevice, int timeoutMs)
 
double getSelectedSensorPosition (int pidIdx)
 
double getSelectedSensorVelocity (int pidIdx)
 
ErrorCode setSelectedSensorPosition (double sensorPos, int pidIdx, int timeoutMs)
 
ErrorCode setControlFramePeriod (ControlFrame frame, int periodMs)
 
ErrorCode setStatusFramePeriod (StatusFrame frame, int periodMs, int timeoutMs)
 
int getStatusFramePeriod (StatusFrame frame, int timeoutMs)
 
ErrorCode configForwardLimitSwitchSource (RemoteLimitSwitchSource type, LimitSwitchNormal normalOpenOrClose, int deviceID, int timeoutMs)
 
ErrorCode configReverseLimitSwitchSource (RemoteLimitSwitchSource type, LimitSwitchNormal normalOpenOrClose, int deviceID, int timeoutMs)
 
void overrideLimitSwitchesEnable (boolean enable)
 
ErrorCode configForwardSoftLimitThreshold (double forwardSensorLimit, int timeoutMs)
 
ErrorCode configReverseSoftLimitThreshold (double reverseSensorLimit, int timeoutMs)
 
ErrorCode configForwardSoftLimitEnable (boolean enable, int timeoutMs)
 
ErrorCode configReverseSoftLimitEnable (boolean enable, int timeoutMs)
 
void overrideSoftLimitsEnable (boolean enable)
 
ErrorCode config_kP (int slotIdx, double value, int timeoutMs)
 
ErrorCode config_kI (int slotIdx, double value, int timeoutMs)
 
ErrorCode config_kD (int slotIdx, double value, int timeoutMs)
 
ErrorCode config_kF (int slotIdx, double value, int timeoutMs)
 
ErrorCode config_IntegralZone (int slotIdx, double izone, int timeoutMs)
 
ErrorCode configAllowableClosedloopError (int slotIdx, double allowableCloseLoopError, int timeoutMs)
 
ErrorCode configMaxIntegralAccumulator (int slotIdx, double iaccum, int timeoutMs)
 
ErrorCode configClosedLoopPeakOutput (int slotIdx, double percentOut, int timeoutMs)
 
ErrorCode configClosedLoopPeriod (int slotIdx, int loopTimeMs, int timeoutMs)
 
ErrorCode configAuxPIDPolarity (boolean invert, int timeoutMs)
 
ErrorCode setIntegralAccumulator (double iaccum, int pidIdx, int timeoutMs)
 
double getClosedLoopError (int pidIdx)
 
double getIntegralAccumulator (int pidIdx)
 
double getErrorDerivative (int pidIdx)
 
void selectProfileSlot (int slotIdx, int pidIdx)
 
double getClosedLoopTarget (int pidIdx)
 
double getActiveTrajectoryPosition ()
 
double getActiveTrajectoryVelocity ()
 
ErrorCode configMotionCruiseVelocity (double sensorUnitsPer100ms, int timeoutMs)
 
ErrorCode configMotionAcceleration (double sensorUnitsPer100msPerSec, int timeoutMs)
 
ErrorCode configMotionSCurveStrength (int curveStrength, int timeoutMs)
 
ErrorCode configMotionProfileTrajectoryPeriod (int baseTrajDurationMs, int timeoutMs)
 
ErrorCode clearMotionProfileTrajectories ()
 
int getMotionProfileTopLevelBufferCount ()
 
ErrorCode pushMotionProfileTrajectory (TrajectoryPoint trajPt)
 
boolean isMotionProfileTopLevelBufferFull ()
 
void processMotionProfileBuffer ()
 
ErrorCode getMotionProfileStatus (MotionProfileStatus statusToFill)
 
ErrorCode clearMotionProfileHasUnderrun (int timeoutMs)
 
ErrorCode changeMotionControlFramePeriod (int periodMs)
 
ErrorCode getLastError ()
 
ErrorCode getFaults (Faults toFill)
 
ErrorCode getStickyFaults (StickyFaults toFill)
 
ErrorCode clearStickyFaults (int timeoutMs)
 
int getFirmwareVersion ()
 
boolean hasResetOccurred ()
 
ErrorCode configSetCustomParam (int newValue, int paramIndex, int timeoutMs)
 
int configGetCustomParam (int paramIndex, int timeoutMs)
 
ErrorCode configSetParameter (ParamEnum param, double value, int subValue, int ordinal, int timeoutMs)
 
ErrorCode configSetParameter (int param, double value, int subValue, int ordinal, int timeoutMs)
 
double configGetParameter (ParamEnum paramEnum, int ordinal, int timeoutMs)
 
double configGetParameter (int paramEnum, int ordinal, int timeoutMs)
 
int getBaseID ()
 
int getDeviceID ()
 
ControlMode getControlMode ()
 
void setInverted (boolean invert)
 
boolean getInverted ()
 
- Public Member Functions inherited from com.ctre.phoenix.motorcontrol.IFollower
void follow (IMotorController masterToFollow)
 
void valueUpdated ()
 

Detailed Description

Interface for enhanced motor controllers

Member Function Documentation

◆ configForwardLimitSwitchSource()

ErrorCode com.ctre.phoenix.motorcontrol.IMotorControllerEnhanced.configForwardLimitSwitchSource ( LimitSwitchSource  type,
LimitSwitchNormal  normalOpenOrClose,
int  timeoutMs 
)

Configures the forward limit switch for a remote source. For example, a CAN motor controller may need to monitor the Limit-F pin of another Talon or CANifier.

Parameters
typeRemote limit switch source. User can choose between a remote Talon SRX, CANifier, or deactivate the feature.
normalOpenOrCloseSetting for normally open, normally closed, or disabled. This setting matches the Phoenix Tuner drop down.
timeoutMsTimeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed.
Returns
Error Code generated by function. 0 indicates no error.

Implemented in com.ctre.phoenix.motorcontrol.can.BaseTalon.

◆ configReverseLimitSwitchSource()

ErrorCode com.ctre.phoenix.motorcontrol.IMotorControllerEnhanced.configReverseLimitSwitchSource ( LimitSwitchSource  type,
LimitSwitchNormal  normalOpenOrClose,
int  timeoutMs 
)

Configures the reverse limit switch for a remote source. For example, a CAN motor controller may need to monitor the Limit-R pin of another Talon or CANifier.

Parameters
typeRemote limit switch source. User can choose between a remote Talon SRX, CANifier, or deactivate the feature.
normalOpenOrCloseSetting for normally open, normally closed, or disabled. This setting matches the Phoenix Tuner drop down.
timeoutMsTimeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed.
Returns
Error Code generated by function. 0 indicates no error.

Implemented in com.ctre.phoenix.motorcontrol.can.BaseTalon.

◆ configSelectedFeedbackSensor()

ErrorCode com.ctre.phoenix.motorcontrol.IMotorControllerEnhanced.configSelectedFeedbackSensor ( FeedbackDevice  feedbackDevice,
int  pidIdx,
int  timeoutMs 
)

Select the feedback device for the motor controller.

Parameters
feedbackDeviceFeedback Device to select.
pidIdx0 for Primary closed-loop. 1 for auxiliary closed-loop.
timeoutMsTimeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed.
Returns
Error Code generated by function. 0 indicates no error.

◆ configSupplyCurrentLimit()

ErrorCode com.ctre.phoenix.motorcontrol.IMotorControllerEnhanced.configSupplyCurrentLimit ( SupplyCurrentLimitConfiguration  currLimitCfg,
int  timeoutMs 
)

Configures the supply (input) current limit.

Parameters
currLimitCfgCurrent limit configuration
timeoutMsTimeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed.
Returns
Error Code generated by function. 0 indicates no error.

Implemented in com.ctre.phoenix.motorcontrol.can.BaseTalon, com.ctre.phoenix.motorcontrol.can.TalonFX, and com.ctre.phoenix.motorcontrol.can.TalonSRX.

◆ configVelocityMeasurementPeriod() [1/2]

ErrorCode com.ctre.phoenix.motorcontrol.IMotorControllerEnhanced.configVelocityMeasurementPeriod ( SensorVelocityMeasPeriod  period,
int  timeoutMs 
)

Sets the period over which velocity measurements are taken.

Parameters
periodDesired period for the velocity measurement.
See also
com.ctre.phoenix.sensors.SensorVelocityMeasPeriod
Parameters
timeoutMsTimeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed.
Returns
Error Code generated by function. 0 indicates no error.

Implemented in com.ctre.phoenix.motorcontrol.can.BaseTalon.

◆ configVelocityMeasurementPeriod() [2/2]

ErrorCode com.ctre.phoenix.motorcontrol.IMotorControllerEnhanced.configVelocityMeasurementPeriod ( VelocityMeasPeriod  period,
int  timeoutMs 
)

Sets the period over which velocity measurements are taken.

Deprecated:
Use the overload with SensorVelocityMeasPeriod instead.
Parameters
periodDesired period for the velocity measurement.
See also
com.ctre.phoenix.sensors.SensorVelocityMeasPeriod
Parameters
timeoutMsTimeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed.
Returns
Error Code generated by function. 0 indicates no error.

Implemented in com.ctre.phoenix.motorcontrol.can.BaseTalon.

◆ configVelocityMeasurementWindow()

ErrorCode com.ctre.phoenix.motorcontrol.IMotorControllerEnhanced.configVelocityMeasurementWindow ( int  windowSize,
int  timeoutMs 
)

Sets the number of velocity samples used in the rolling average velocity measurement.

Parameters
windowSizeNumber of samples in the rolling average of velocity measurement. Valid values are 1,2,4,8,16,32. If another value is specified, it will truncate to nearest support value.
timeoutMsTimeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed.
Returns
Error Code generated by function. 0 indicates no error.

Implemented in com.ctre.phoenix.motorcontrol.can.BaseTalon.

◆ getOutputCurrent()

double com.ctre.phoenix.motorcontrol.IMotorControllerEnhanced.getOutputCurrent ( )

Gets the output current of the motor controller. In the case of TalonSRX class, this routine returns supply current for legacy reasons. In order to get the "true" output current, call GetStatorCurrent(). In the case of TalonFX class, this routine returns the true output stator current.

Deprecated:
Use getStatorCurrent/getSupplyCurrent instead.
Returns
The output current (in amps).

Implemented in com.ctre.phoenix.motorcontrol.can.BaseTalon.

◆ getStatusFramePeriod()

int com.ctre.phoenix.motorcontrol.IMotorControllerEnhanced.getStatusFramePeriod ( StatusFrameEnhanced  frame,
int  timeoutMs 
)

Gets the period of the given status frame.

Parameters
frameFrame to get the period of.
timeoutMsTimeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed.
Returns
Period of the given status frame.

Implemented in com.ctre.phoenix.motorcontrol.can.BaseTalon.

◆ setStatusFramePeriod()

ErrorCode com.ctre.phoenix.motorcontrol.IMotorControllerEnhanced.setStatusFramePeriod ( StatusFrameEnhanced  frame,
int  periodMs,
int  timeoutMs 
)

Sets the period of the given status frame.

User ensure CAN Bus utilization is not high.

This setting is not persistent and is lost when device is reset. If this is a concern, calling application can use hasResetOccurred() to determine if the status frame needs to be reconfigured.

Parameters
frameFrame whose period is to be changed.
periodMsPeriod in ms for the given frame.
timeoutMsTimeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed.
Returns
Error Code generated by function. 0 indicates no error.

Implemented in com.ctre.phoenix.motorcontrol.can.BaseTalon.


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