CTRE_Phoenix 5.20.2
|
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 () |
Interface for enhanced motor controllers
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.
type | Remote limit switch source. User can choose between a remote Talon SRX, CANifier, or deactivate the feature. |
normalOpenOrClose | Setting for normally open, normally closed, or disabled. This setting matches the Phoenix Tuner drop down. |
timeoutMs | Timeout 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. |
Implemented in com.ctre.phoenix.motorcontrol.can.BaseTalon.
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.
type | Remote limit switch source. User can choose between a remote Talon SRX, CANifier, or deactivate the feature. |
normalOpenOrClose | Setting for normally open, normally closed, or disabled. This setting matches the Phoenix Tuner drop down. |
timeoutMs | Timeout 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. |
Implemented in com.ctre.phoenix.motorcontrol.can.BaseTalon.
ErrorCode com.ctre.phoenix.motorcontrol.IMotorControllerEnhanced.configSelectedFeedbackSensor | ( | FeedbackDevice | feedbackDevice, |
int | pidIdx, | ||
int | timeoutMs | ||
) |
Select the feedback device for the motor controller.
feedbackDevice | Feedback Device to select. |
pidIdx | 0 for Primary closed-loop. 1 for auxiliary closed-loop. |
timeoutMs | Timeout 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. |
ErrorCode com.ctre.phoenix.motorcontrol.IMotorControllerEnhanced.configSupplyCurrentLimit | ( | SupplyCurrentLimitConfiguration | currLimitCfg, |
int | timeoutMs | ||
) |
Configures the supply (input) current limit.
currLimitCfg | Current limit configuration |
timeoutMs | Timeout 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. |
Implemented in com.ctre.phoenix.motorcontrol.can.BaseTalon, com.ctre.phoenix.motorcontrol.can.TalonFX, and com.ctre.phoenix.motorcontrol.can.TalonSRX.
ErrorCode com.ctre.phoenix.motorcontrol.IMotorControllerEnhanced.configVelocityMeasurementPeriod | ( | SensorVelocityMeasPeriod | period, |
int | timeoutMs | ||
) |
Sets the period over which velocity measurements are taken.
period | Desired period for the velocity measurement. |
timeoutMs | Timeout 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. |
Implemented in com.ctre.phoenix.motorcontrol.can.BaseTalon.
ErrorCode com.ctre.phoenix.motorcontrol.IMotorControllerEnhanced.configVelocityMeasurementPeriod | ( | VelocityMeasPeriod | period, |
int | timeoutMs | ||
) |
Sets the period over which velocity measurements are taken.
period | Desired period for the velocity measurement. |
timeoutMs | Timeout 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. |
Implemented in com.ctre.phoenix.motorcontrol.can.BaseTalon.
ErrorCode com.ctre.phoenix.motorcontrol.IMotorControllerEnhanced.configVelocityMeasurementWindow | ( | int | windowSize, |
int | timeoutMs | ||
) |
Sets the number of velocity samples used in the rolling average velocity measurement.
windowSize | Number 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. |
timeoutMs | Timeout 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. |
Implemented in com.ctre.phoenix.motorcontrol.can.BaseTalon.
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.
Implemented in com.ctre.phoenix.motorcontrol.can.BaseTalon.
int com.ctre.phoenix.motorcontrol.IMotorControllerEnhanced.getStatusFramePeriod | ( | StatusFrameEnhanced | frame, |
int | timeoutMs | ||
) |
Gets the period of the given status frame.
frame | Frame to get the period of. |
timeoutMs | Timeout 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. |
Implemented in com.ctre.phoenix.motorcontrol.can.BaseTalon.
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.
frame | Frame whose period is to be changed. |
periodMs | Period in ms for the given frame. |
timeoutMs | Timeout 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. |
Implemented in com.ctre.phoenix.motorcontrol.can.BaseTalon.