CTRE_Phoenix 5.20.2
com.ctre.phoenix.motorcontrol.can.MotControllerJNI Class Reference

Inherits com.ctre.phoenix.CTREJNIWrapper.

Static Public Member Functions

static native long Create (int baseArbId)
 
static native long Create2 (int deviceID, String model, String canbus)
 
static native int JNI_destroy_MotController (long handle)
 
static native int GetDeviceNumber (long handle)
 
static native int GetBaseID (long handle)
 
static native void SetDemand (long handle, int mode, int demand0, int demand1)
 
static native void Set_4 (long handle, int mode, double demand0, double demand1, int demand1Type)
 
static native void SetNeutralMode (long handle, int neutralMode)
 
static native void SetSensorPhase (long handle, boolean PhaseSensor)
 
static native void SetInverted (long handle, boolean invert)
 
static native void SetInverted_2 (long handle, int invert)
 
static native int ConfigFactoryDefault (long handle, int timeoutMs)
 
static native int ConfigOpenLoopRamp (long handle, double secondsFromNeutralToFull, int timeoutMs)
 
static native int ConfigClosedLoopRamp (long handle, double secondsFromNeutralToFull, int timeoutMs)
 
static native int ConfigPeakOutputForward (long handle, double percentOut, int timeoutMs)
 
static native int ConfigPeakOutputReverse (long handle, double percentOut, int timeoutMs)
 
static native int ConfigNominalOutputForward (long handle, double percentOut, int timeoutMs)
 
static native int ConfigNominalOutputReverse (long handle, double percentOut, int timeoutMs)
 
static native int ConfigNeutralDeadband (long handle, double percentDeadband, int timeoutMs)
 
static native int ConfigVoltageCompSaturation (long handle, double voltage, int timeoutMs)
 
static native int ConfigVoltageMeasurementFilter (long handle, int filterWindowSamples, int timeoutMs)
 
static native void EnableVoltageCompensation (long handle, boolean enable)
 
static native boolean GetInverted (long handle)
 
static native double GetBusVoltage (long handle)
 
static native double GetMotorOutputPercent (long handle)
 
static native double GetOutputCurrent (long handle)
 
static native double GetSupplyCurrent (long handle)
 
static native double GetStatorCurrent (long handle)
 
static native double GetTemperature (long handle)
 
static native int ConfigRemoteFeedbackFilter (long handle, int deviceID, int remoteSensorSource, int remoteOrdinal, int timeoutMs)
 
static native int ConfigSelectedFeedbackSensor (long handle, int feedbackDevice, int pidIdx, int timeoutMs)
 
static native int ConfigSensorTerm (long handle, int sensorTerm, int feedbackDevice, int timeoutMs)
 
static native int GetSelectedSensorPosition (long handle, int pidIdx)
 
static native int GetSelectedSensorVelocity (long handle, int pidIdx)
 
static native int SetSelectedSensorPosition (long handle, int sensorPos, int pidIdx, int timeoutMs)
 
static native int SetControlFramePeriod (long handle, int frame, int periodMs)
 
static native int SetStatusFramePeriod (long handle, int frame, int periodMs, int timeoutMs)
 
static native int GetStatusFramePeriod (long handle, int frame, int timeoutMs)
 
static native int ConfigVelocityMeasurementPeriod (long handle, int period, int timeoutMs)
 
static native int ConfigVelocityMeasurementWindow (long handle, int windowSize, int timeoutMs)
 
static native int ConfigForwardLimitSwitchSource (long handle, int type, int normalOpenOrClose, int deviceID, int timeoutMs)
 
static native int ConfigReverseLimitSwitchSource (long handle, int type, int normalOpenOrClose, int deviceID, int timeoutMs)
 
static native void OverrideLimitSwitchesEnable (long handle, boolean enable)
 
static native int ConfigForwardSoftLimitThreshold (long handle, int forwardSensorLimit, int timeoutMs)
 
static native int ConfigReverseSoftLimitThreshold (long handle, int reverseSensorLimit, int timeoutMs)
 
static native int ConfigForwardSoftLimitEnable (long handle, boolean enable, int timeoutMs)
 
static native int ConfigReverseSoftLimitEnable (long handle, boolean enable, int timeoutMs)
 
static native void OverrideSoftLimitsEnable (long handle, boolean enable)
 
static native int Config_kP (long handle, int slotIdx, double value, int timeoutMs)
 
static native int Config_kI (long handle, int slotIdx, double value, int timeoutMs)
 
static native int Config_kD (long handle, int slotIdx, double value, int timeoutMs)
 
static native int Config_kF (long handle, int slotIdx, double value, int timeoutMs)
 
static native int Config_IntegralZone (long handle, int slotIdx, double izone, int timeoutMs)
 
static native int ConfigAllowableClosedloopError (long handle, int slotIdx, int allowableClosedLoopError, int timeoutMs)
 
static native int ConfigMaxIntegralAccumulator (long handle, int slotIdx, double iaccum, int timeoutMs)
 
static native int SetIntegralAccumulator (long handle, double iaccum, int pidIdx, int timeoutMs)
 
static native int GetClosedLoopError (long handle, int pidIdx)
 
static native double GetIntegralAccumulator (long handle, int pidIdx)
 
static native double GetErrorDerivative (long handle, int pidIdx)
 
static native void SelectProfileSlot (long handle, int slotIdx, int pidIdx)
 
static native int GetActiveTrajectoryPosition (long handle)
 
static native int GetActiveTrajectoryVelocity (long handle)
 
static native double GetActiveTrajectoryHeading (long handle)
 
static native int GetActiveTrajectoryPosition3 (long handle, int pidIdx)
 
static native int GetActiveTrajectoryVelocity3 (long handle, int pidIdx)
 
static native double GetActiveTrajectoryArbFeedFwd3 (long handle, int pidIdx)
 
static native int ConfigMotionCruiseVelocity (long handle, int sensorUnitsPer100ms, int timeoutMs)
 
static native int ConfigMotionAcceleration (long handle, int sensorUnitsPer100msPerSec, int timeoutMs)
 
static native int ConfigMotionSCurveStrength (long m_handle, int curveStrength, int timeoutMs)
 
static native int ClearMotionProfileTrajectories (long handle)
 
static native int GetMotionProfileTopLevelBufferCount (long handle)
 
static native int PushMotionProfileTrajectory (long handle, double position, double velocity, double headingDeg, int profileSlotSelect, boolean isLastPoint, boolean zeroPos)
 
static native int PushMotionProfileTrajectory2 (long handle, double position, double velocity, double headingDeg, int profileSlotSelect0, int profileSlotSelect1, boolean isLastPoint, boolean zeroPos, int durationMs)
 
static native int PushMotionProfileTrajectory3 (long handle, double position, double velocity, double arbFeedFwd, double auxiliaryPos, double auxiliaryVel, double auxiliaryArbFeedFwd, int profileSlotSelect0, int profileSlotSelect1, boolean isLastPoint, boolean zeroPos0, int timeDur, boolean useAuxPID)
 
static native int StartMotionProfile (long handle, long streamHandle, int minBufferedPts, int controlMode)
 
static native boolean IsMotionProfileTopLevelBufferFull (long handle)
 
static native boolean IsMotionProfileFinished (long handle)
 
static native int ProcessMotionProfileBuffer (long handle)
 
static native int GetMotionProfileStatus (long handle, int[] toFill_9)
 
static native int GetMotionProfileStatus2 (long handle, int[] toFill_11)
 
static native int ClearMotionProfileHasUnderrun (long handle, int timeoutMs)
 
static native int ChangeMotionControlFramePeriod (long handle, int periodMs)
 
static native int ConfigMotionProfileTrajectoryPeriod (long handle, int periodMs, int timeoutMs)
 
static native int ConfigMotionProfileTrajectoryInterpolationEnable (long handle, boolean enable, int timeoutMs)
 
static native int ConfigFeedbackNotContinuous (long handle, boolean feedbackNotContinuous, int timeoutMs)
 
static native int ConfigRemoteSensorClosedLoopDisableNeutralOnLOS (long handle, boolean remoteSensorClosedLoopDisableNeutralOnLOS, int timeoutMs)
 
static native int ConfigClearPositionOnLimitF (long handle, boolean clearPositionOnLimitF, int timeoutMs)
 
static native int ConfigClearPositionOnLimitR (long handle, boolean clearPositionOnLimitR, int timeoutMs)
 
static native int ConfigClearPositionOnQuadIdx (long handle, boolean clearPositionOnQuadIdx, int timeoutMs)
 
static native int ConfigLimitSwitchDisableNeutralOnLOS (long handle, boolean limitSwitchDisableNeutralOnLOS, int timeoutMs)
 
static native int ConfigSoftLimitDisableNeutralOnLOS (long handle, boolean softLimitDisableNeutralOnLOS, int timeoutMs)
 
static native int ConfigPulseWidthPeriod_EdgesPerRot (long handle, int pulseWidthPeriod_EdgesPerRot, int timeoutMs)
 
static native int ConfigPulseWidthPeriod_FilterWindowSz (long handle, int pulseWidthPeriod_FilterWindowSz, int timeoutMs)
 
static native int GetLastError (long handle)
 
static native int GetFirmwareVersion (long handle)
 
static native boolean HasResetOccurred (long handle)
 
static native int ConfigSetCustomParam (long handle, int newValue, int paramIndex, int timeoutMs)
 
static native int ConfigGetCustomParam (long handle, int paramIndex, int timoutMs)
 
static native int ConfigSetParameter (long handle, int param, double value, int subValue, int ordinal, int timeoutMs)
 
static native double ConfigGetParameter (long handle, int param, int ordinal, int timeoutMs)
 
static native int ConfigPeakCurrentLimit (long handle, int amps, int timeoutMs)
 
static native int ConfigPeakCurrentDuration (long handle, int milliseconds, int timeoutMs)
 
static native int ConfigContinuousCurrentLimit (long handle, int amps, int timeoutMs)
 
static native int EnableCurrentLimit (long handle, boolean enable)
 
static native int GetAnalogIn (long handle)
 
static native int SetAnalogPosition (long handle, int newPosition, int timeoutMs)
 
static native int GetAnalogInRaw (long handle)
 
static native int GetAnalogInVel (long handle)
 
static native int GetQuadraturePosition (long handle)
 
static native int SetQuadraturePosition (long handle, int newPosition, int timeoutMs)
 
static native int GetQuadratureVelocity (long handle)
 
static native int GetPulseWidthPosition (long handle)
 
static native int SetPulseWidthPosition (long handle, int newPosition, int timeoutMs)
 
static native int GetPulseWidthVelocity (long handle)
 
static native int GetPulseWidthRiseToFallUs (long handle)
 
static native int GetPulseWidthRiseToRiseUs (long handle)
 
static native int GetPinStateQuadA (long handle)
 
static native int GetPinStateQuadB (long handle)
 
static native int GetPinStateQuadIdx (long handle)
 
static native int IsFwdLimitSwitchClosed (long handle)
 
static native int IsRevLimitSwitchClosed (long handle)
 
static native int GetFaults (long handle)
 
static native int GetStickyFaults (long handle)
 
static native int ClearStickyFaults (long handle, int timeoutMs)
 
static native int SelectDemandType (long handle, int enable)
 
static native int SetMPEOutput (long handle, int mpeOutput)
 
static native int EnableHeadingHold (long handle, int enable)
 
static native int GetClosedLoopTarget (long handle, int pidIdx)
 
static native int ConfigSelectedFeedbackCoefficient (long handle, double coefficient, int pidIdx, int timeoutMs)
 
static native int ConfigClosedLoopPeakOutput (long handle, int slotIdx, double percentOut, int timeoutMs)
 
static native int ConfigClosedLoopPeriod (long handle, int slotIdx, int loopTimeMs, int timeoutMs)
 
static native int ConfigMotorCommutation (long handle, int motorCommutation, int timeoutMs)
 
static native int ConfigGetMotorCommutation (long handle, int timeoutMs)
 
static native int ConfigSupplyCurrentLimit (long handle, double[] params, int timeoutMs)
 
static native int ConfigStatorCurrentLimit (long handle, double[] params, int timeoutMs)
 
static native int ConfigSupplyCurrentLimitEnable (long handle, boolean enable, int timeoutMs)
 
static native int ConfigStatorCurrentLimitEnable (long handle, boolean enable, int timeoutMs)
 
static native int ConfigBrakeCurrentLimitEnable (long handle, boolean enable, int timeoutMs)
 
static native int ConfigGetSupplyCurrentLimit (long handle, double[] toFill, int timeoutMs)
 
static native int ConfigGetStatorCurrentLimit (long handle, double[] toFill, int timeoutMs)
 
static native int SetIntegratedSensorPosition (long handle, double newPos, int timeoutMs)
 
static native int SetIntegratedSensorPositionToAbsolute (long handle, int timeoutMs)
 
static native double GetIntegratedSensorPosition (long handle)
 
static native double GetIntegratedSensorAbsolutePosition (long handle)
 
static native double GetIntegratedSensorVelocity (long handle)
 
static native int ConfigIntegratedSensorAbsoluteRange (long handle, int absoluteSensorRange, int timeoutMs)
 
static native int ConfigIntegratedSensorOffset (long handle, double offsetDegrees, int timeoutMs)
 
static native int ConfigIntegratedSensorInitializationStrategy (long handle, int initStrategy, int timeoutMs)
 

Member Function Documentation

◆ Config_IntegralZone()

static native int com.ctre.phoenix.motorcontrol.can.MotControllerJNI.Config_IntegralZone ( long  handle,
int  slotIdx,
double  izone,
int  timeoutMs 
)
static

Sets the Integral Zone constant in the given parameter slot.

Parameters
handlehandle of device.
slotIdxParameter slot for the constant.
izoneValue of the Integral Zone constant.
timeoutMsTimeout value in ms.
See also
ConfigOpenLoopRamp
Returns
Error Code generated by function. 0 indicates no error.

◆ Config_kD()

static native int com.ctre.phoenix.motorcontrol.can.MotControllerJNI.Config_kD ( long  handle,
int  slotIdx,
double  value,
int  timeoutMs 
)
static

Sets the 'D' constant in the given parameter slot.

This is multiplied by derivative error (sensor units per PID loop, typically 1ms). Note the closed loop output interprets a final value of 1023 as full output. So use a gain of '250' to get full output if derr is 4096u (Mag Encoder 1 rotation) per 1000 loops (typ 1 sec)

Parameters
handlehandle of device.
slotIdxParameter slot for the constant.
valueValue of the D constant.
timeoutMsTimeout value in ms.
See also
ConfigOpenLoopRamp
Returns
Error Code generated by function. 0 indicates no error.

◆ Config_kF()

static native int com.ctre.phoenix.motorcontrol.can.MotControllerJNI.Config_kF ( long  handle,
int  slotIdx,
double  value,
int  timeoutMs 
)
static

Sets the 'F' constant in the given parameter slot.

See documentation for calculation details. If using velocity, motion magic, or motion profile, use (1023 * duty-cycle / sensor-velocity-sensor-units-per-100ms).

Parameters
handlehandle of device.
slotIdxParameter slot for the constant.
valueValue of the F constant.
timeoutMsTimeout value in ms.
See also
ConfigOpenLoopRamp
Returns
Error Code generated by function. 0 indicates no error.

◆ Config_kI()

static native int com.ctre.phoenix.motorcontrol.can.MotControllerJNI.Config_kI ( long  handle,
int  slotIdx,
double  value,
int  timeoutMs 
)
static

Sets the 'I' constant in the given parameter slot. This is multiplied by accumulated closed loop error in sensor units every PID Loop. Note the closed loop output interprets a final value of 1023 as full output. So use a gain of '0.00025' to get full output if err is 4096u for 1000 loops (accumulater holds 4,096,000), [which is equivalent to one CTRE mag encoder rotation for 1000 milliseconds].

Parameters
handlehandle of device.
slotIdxParameter slot for the constant.
valueValue of the I constant.
timeoutMsTimeout value in ms.
See also
ConfigOpenLoopRamp
Returns
Error Code generated by function. 0 indicates no error.

◆ Config_kP()

static native int com.ctre.phoenix.motorcontrol.can.MotControllerJNI.Config_kP ( long  handle,
int  slotIdx,
double  value,
int  timeoutMs 
)
static

Sets the 'P' constant in the given parameter slot. This is multiplied by closed loop error in sensor units. Note the closed loop output interprets a final value of 1023 as full output. So use a gain of '0.25' to get full output if err is 4096u (Mag Encoder 1 rotation)

Parameters
handlehandle of device.
slotIdxParameter slot for the constant.
valueValue of the P constant.
timeoutMsTimeout value in ms.
See also
ConfigOpenLoopRamp
Returns
Error Code generated by function. 0 indicates no error.

◆ ConfigAllowableClosedloopError()

static native int com.ctre.phoenix.motorcontrol.can.MotControllerJNI.ConfigAllowableClosedloopError ( long  handle,
int  slotIdx,
int  allowableClosedLoopError,
int  timeoutMs 
)
static

Sets the allowable closed-loop error in the given parameter slot.

Parameters
handlehandle of device.
slotIdxParameter slot for the constant.
allowableClosedLoopErrorValue of the allowable closed-loop error in sensor units (or sensor units per 100ms for velocity).
timeoutMsTimeout value in ms.
See also
ConfigOpenLoopRamp
Returns
Error Code generated by function. 0 indicates no error.

◆ ConfigClosedLoopRamp()

static native int com.ctre.phoenix.motorcontrol.can.MotControllerJNI.ConfigClosedLoopRamp ( long  handle,
double  secondsFromNeutralToFull,
int  timeoutMs 
)
static

Configures the closed-loop ramp rate of throttle output.

Parameters
handlehandle of device.
secondsFromNeutralToFullMinimum desired time to go from neutral to full throttle. A value of '0' will disable the ramp.
timeoutMsTimeout value in ms.
See also
ConfigOpenLoopRamp
Returns
Error Code generated by function. 0 indicates no error.

◆ ConfigContinuousCurrentLimit()

static native int com.ctre.phoenix.motorcontrol.can.MotControllerJNI.ConfigContinuousCurrentLimit ( long  handle,
int  amps,
int  timeoutMs 
)
static

Configures the continuous current limit.

Parameters
handlehandle of device.
ampsContinuous Current Limit.
timeoutMsTimeout value in ms.
See also
ConfigOpenLoopRamp
Returns
Error Code generated by function. 0 indicates no error.

◆ ConfigFactoryDefault()

static native int com.ctre.phoenix.motorcontrol.can.MotControllerJNI.ConfigFactoryDefault ( long  handle,
int  timeoutMs 
)
static

Revert all configurations to factory default values. Use this before your individual config* calls to avoid having to config every single param.

Alternatively you can use the configAllSettings routine.

Parameters
handlehandle of device.
timeoutMsTimeout value in ms. Function will generate error if config is not successful within timeout.
Returns
Error Code generated by function. 0 indicates no error.

◆ ConfigForwardLimitSwitchSource()

static native int com.ctre.phoenix.motorcontrol.can.MotControllerJNI.ConfigForwardLimitSwitchSource ( long  handle,
int  type,
int  normalOpenOrClose,
int  deviceID,
int  timeoutMs 
)
static

Configures the forward limit switch for a remote source.

Parameters
handlehandle of device.
typeRemote limit switch source.
See also
com.ctre.phoenix.motorcontrol.LimitSwitchSource
Parameters
normalOpenOrCloseSetting for normally open or normally closed.
deviceIDDevice ID of remote source.
timeoutMsTimeout value in ms.
See also
ConfigOpenLoopRamp
Returns
Error Code generated by function. 0 indicates no error.

◆ ConfigForwardSoftLimitThreshold()

static native int com.ctre.phoenix.motorcontrol.can.MotControllerJNI.ConfigForwardSoftLimitThreshold ( long  handle,
int  forwardSensorLimit,
int  timeoutMs 
)
static

Configures the forward soft limit.

Parameters
handlehandle of device.
forwardSensorLimitForward Sensor Position Limit (in Raw Sensor Units).
timeoutMsTimeout value in ms.
See also
ConfigOpenLoopRamp
Returns
Error Code generated by function. 0 indicates no error.

◆ ConfigGetCustomParam()

static native int com.ctre.phoenix.motorcontrol.can.MotControllerJNI.ConfigGetCustomParam ( long  handle,
int  paramIndex,
int  timoutMs 
)
static

Gets the value of a custom parameter.

Parameters
handlehandle of device.
paramIndexIndex of custom parameter.
timoutMsTimeout value in ms.
See also
ConfigOpenLoopRamp
Returns
Value of the custom param.

◆ ConfigGetParameter()

static native double com.ctre.phoenix.motorcontrol.can.MotControllerJNI.ConfigGetParameter ( long  handle,
int  param,
int  ordinal,
int  timeoutMs 
)
static

Gets a parameter.

Parameters
handlehandle of device.
paramParameter enumeration.
ordinalOrdinal of parameter.
timeoutMsTimeout value in ms.
See also
ConfigOpenLoopRamp
Returns
Value of parameter.

◆ ConfigMaxIntegralAccumulator()

static native int com.ctre.phoenix.motorcontrol.can.MotControllerJNI.ConfigMaxIntegralAccumulator ( long  handle,
int  slotIdx,
double  iaccum,
int  timeoutMs 
)
static

Sets the maximum integral accumulator in the given parameter slot.

Parameters
handlehandle of device.
slotIdxParameter slot for the constant.
iaccumValue of the maximum integral accumulator.
timeoutMsTimeout value in ms.
See also
ConfigOpenLoopRamp
Returns
Error Code generated by function. 0 indicates no error.

◆ ConfigMotionAcceleration()

static native int com.ctre.phoenix.motorcontrol.can.MotControllerJNI.ConfigMotionAcceleration ( long  handle,
int  sensorUnitsPer100msPerSec,
int  timeoutMs 
)
static

Sets the Motion Magic Acceleration.

Parameters
handlehandle of device.
sensorUnitsPer100msPerSecMotion Magic Acceleration (in Raw Sensor Units per 100 ms per second).
timeoutMsTimeout value in ms.
See also
ConfigOpenLoopRamp
Returns
Error Code generated by function. 0 indicates no error.

◆ ConfigMotionCruiseVelocity()

static native int com.ctre.phoenix.motorcontrol.can.MotControllerJNI.ConfigMotionCruiseVelocity ( long  handle,
int  sensorUnitsPer100ms,
int  timeoutMs 
)
static

Sets the Motion Magic Cruise Velocity.

Parameters
handlehandle of device.
sensorUnitsPer100msMotion Magic Cruise Velocity (in Raw Sensor Units per 100 ms).
timeoutMsTimeout value in ms.
See also
ConfigOpenLoopRamp
Returns
Error Code generated by function. 0 indicates no error.

◆ ConfigNeutralDeadband()

static native int com.ctre.phoenix.motorcontrol.can.MotControllerJNI.ConfigNeutralDeadband ( long  handle,
double  percentDeadband,
int  timeoutMs 
)
static

Configures the output deadband percentage.

Parameters
handlehandle of device.
percentDeadbandDesired deadband percentage. Minimum is 0.1%, Maximum is 25%.
timeoutMsTimeout value in ms.
See also
ConfigOpenLoopRamp
Returns
Error Code generated by function. 0 indicates no error.

◆ ConfigNominalOutputForward()

static native int com.ctre.phoenix.motorcontrol.can.MotControllerJNI.ConfigNominalOutputForward ( long  handle,
double  percentOut,
int  timeoutMs 
)
static

Configures the forward nominal output percentage.

Parameters
handlehandle of device.
percentOutNominal (minimum) percent output.
timeoutMsTimeout value in ms.
See also
ConfigOpenLoopRamp
Returns
Error Code generated by function. 0 indicates no error.

◆ ConfigNominalOutputReverse()

static native int com.ctre.phoenix.motorcontrol.can.MotControllerJNI.ConfigNominalOutputReverse ( long  handle,
double  percentOut,
int  timeoutMs 
)
static

Configures the reverse nominal output percentage.

Parameters
handlehandle of device.
percentOutNominal (minimum) percent output.
timeoutMsTimeout value in ms.
See also
ConfigOpenLoopRamp
Returns
Error Code generated by function. 0 indicates no error.

◆ ConfigOpenLoopRamp()

static native int com.ctre.phoenix.motorcontrol.can.MotControllerJNI.ConfigOpenLoopRamp ( long  handle,
double  secondsFromNeutralToFull,
int  timeoutMs 
)
static

Configures the open-loop ramp rate of throttle output.

Parameters
handlehandle of device.
secondsFromNeutralToFullMinimum desired time to go from neutral to full throttle. A value of '0' will disable the ramp.
timeoutMsTimeout value in ms. Function will generate error if config is not successful within timeout.
Returns
Error Code generated by function. 0 indicates no error.

◆ ConfigPeakCurrentDuration()

static native int com.ctre.phoenix.motorcontrol.can.MotControllerJNI.ConfigPeakCurrentDuration ( long  handle,
int  milliseconds,
int  timeoutMs 
)
static

Configures the maximum time allowed at peak current limit of the motor controller.

Parameters
handlehandle of device.
millisecondsMaximum time allowed at peak current limit (in milliseconds).
timeoutMsTimeout value in ms.
See also
ConfigOpenLoopRamp
Returns
Error Code generated by function. 0 indicates no error.

◆ ConfigPeakCurrentLimit()

static native int com.ctre.phoenix.motorcontrol.can.MotControllerJNI.ConfigPeakCurrentLimit ( long  handle,
int  amps,
int  timeoutMs 
)
static

Configures the peak current limit of the motor controller.

Parameters
handlehandle of device.
ampsPeak current limit (in amps).
timeoutMsTimeout value in ms.
See also
ConfigOpenLoopRamp
Returns
Error Code generated by function. 0 indicates no error.

◆ ConfigPeakOutputForward()

static native int com.ctre.phoenix.motorcontrol.can.MotControllerJNI.ConfigPeakOutputForward ( long  handle,
double  percentOut,
int  timeoutMs 
)
static

Configures the forward peak output percentage.

Parameters
handlehandle of device.
percentOutDesired peak output percentage.
timeoutMsTimeout value in ms.
See also
ConfigOpenLoopRamp
Returns
Error Code generated by function. 0 indicates no error.

◆ ConfigPeakOutputReverse()

static native int com.ctre.phoenix.motorcontrol.can.MotControllerJNI.ConfigPeakOutputReverse ( long  handle,
double  percentOut,
int  timeoutMs 
)
static

Configures the reverse peak output percentage.

Parameters
handlehandle of device.
percentOutDesired peak output percentage.
timeoutMsTimeout value in ms.
See also
ConfigOpenLoopRamp
Returns
Error Code generated by function. 0 indicates no error.

◆ ConfigRemoteFeedbackFilter()

static native int com.ctre.phoenix.motorcontrol.can.MotControllerJNI.ConfigRemoteFeedbackFilter ( long  handle,
int  deviceID,
int  remoteSensorSource,
int  remoteOrdinal,
int  timeoutMs 
)
static

Configures the remote feedback filter.

Parameters
handlehandle of device.
deviceIDID of remote device.
remoteSensorSourceType of remote sensor.
remoteOrdinalOrdinal of remote source [0-1].
timeoutMsTimeout value in ms.
See also
ConfigOpenLoopRamp
Returns
Error Code generated by function. 0 indicates no error.

◆ ConfigReverseLimitSwitchSource()

static native int com.ctre.phoenix.motorcontrol.can.MotControllerJNI.ConfigReverseLimitSwitchSource ( long  handle,
int  type,
int  normalOpenOrClose,
int  deviceID,
int  timeoutMs 
)
static

Configures the reverse limit switch for a remote source.

Parameters
handlehandle of device.
typeRemote limit switch source.
See also
com.ctre.phoenix.motorcontrol.LimitSwitchSource
Parameters
normalOpenOrCloseSetting for normally open or normally closed.
deviceIDDevice ID of remote source.
timeoutMsTimeout value in ms.
See also
ConfigOpenLoopRamp
Returns
Error Code generated by function. 0 indicates no error.

◆ ConfigReverseSoftLimitThreshold()

static native int com.ctre.phoenix.motorcontrol.can.MotControllerJNI.ConfigReverseSoftLimitThreshold ( long  handle,
int  reverseSensorLimit,
int  timeoutMs 
)
static

Configures the reverse soft limit.

Parameters
handlehandle of device.
reverseSensorLimitReverse Sensor Position Limit (in Raw Sensor Units).
timeoutMsTimeout value in ms.
See also
ConfigOpenLoopRamp
Returns
Error Code generated by function. 0 indicates no error.

◆ ConfigSelectedFeedbackSensor()

static native int com.ctre.phoenix.motorcontrol.can.MotControllerJNI.ConfigSelectedFeedbackSensor ( long  handle,
int  feedbackDevice,
int  pidIdx,
int  timeoutMs 
)
static

Select the feedback device for the motor controller.

Parameters
handlehandle of device.
feedbackDeviceFeedback Device to select.
pidIdxWhich closed loop to manipulate. 0 for primary, 1 for auxiliary
timeoutMsTimeout value in ms.
See also
ConfigOpenLoopRamp
Returns
Error Code generated by function. 0 indicates no error.

◆ ConfigSetCustomParam()

static native int com.ctre.phoenix.motorcontrol.can.MotControllerJNI.ConfigSetCustomParam ( long  handle,
int  newValue,
int  paramIndex,
int  timeoutMs 
)
static

Sets the value of a custom parameter.

Parameters
handlehandle of device.
newValueValue for custom parameter.
paramIndexIndex of custom parameter.
timeoutMsTimeout value in ms.
See also
ConfigOpenLoopRamp
Returns
Error Code generated by function. 0 indicates no error.

◆ ConfigSetParameter()

static native int com.ctre.phoenix.motorcontrol.can.MotControllerJNI.ConfigSetParameter ( long  handle,
int  param,
double  value,
int  subValue,
int  ordinal,
int  timeoutMs 
)
static

Sets a parameter.

Parameters
handlehandle of device.
paramParameter enumeration.
valueValue of parameter.
subValueSubvalue for parameter. Maximum value of 255.
ordinalOrdinal of parameter.
timeoutMsTimeout value in ms.
See also
ConfigOpenLoopRamp
Returns
Error Code generated by function. 0 indicates no error.

◆ ConfigVelocityMeasurementPeriod()

static native int com.ctre.phoenix.motorcontrol.can.MotControllerJNI.ConfigVelocityMeasurementPeriod ( long  handle,
int  period,
int  timeoutMs 
)
static

Sets the period over which velocity measurements are taken.

Parameters
handlehandle of device.
periodDesired period for the velocity measurement.
See also
com.ctre.phoenix.sensors.SensorVelocityMeasPeriod
Parameters
timeoutMsTimeout value in ms.
See also
ConfigOpenLoopRamp
Returns
Error Code generated by function. 0 indicates no error.

◆ ConfigVelocityMeasurementWindow()

static native int com.ctre.phoenix.motorcontrol.can.MotControllerJNI.ConfigVelocityMeasurementWindow ( long  handle,
int  windowSize,
int  timeoutMs 
)
static

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

Parameters
handlehandle of device.
windowSizeNumber of samples in the rolling average of velocity measurement.
timeoutMsTimeout value in ms.
See also
ConfigOpenLoopRamp
Returns
Error Code generated by function. 0 indicates no error.

◆ ConfigVoltageCompSaturation()

static native int com.ctre.phoenix.motorcontrol.can.MotControllerJNI.ConfigVoltageCompSaturation ( long  handle,
double  voltage,
int  timeoutMs 
)
static

Configures the Voltage Compensation saturation voltage.

Parameters
handlehandle of device.
voltageTO-DO: Comment me!
timeoutMsTimeout value in ms.
See also
ConfigOpenLoopRamp
Returns
Error Code generated by function. 0 indicates no error.

◆ ConfigVoltageMeasurementFilter()

static native int com.ctre.phoenix.motorcontrol.can.MotControllerJNI.ConfigVoltageMeasurementFilter ( long  handle,
int  filterWindowSamples,
int  timeoutMs 
)
static

Configures the voltage measurement filter.

Parameters
handlehandle of device.
filterWindowSamplesNumber of samples in the rolling average of voltage measurement.
timeoutMsTimeout value in ms.
See also
ConfigOpenLoopRamp
Returns
Error Code generated by function. 0 indicates no error.

◆ EnableCurrentLimit()

static native int com.ctre.phoenix.motorcontrol.can.MotControllerJNI.EnableCurrentLimit ( long  handle,
boolean  enable 
)
static

Enables the current limit feature.

Parameters
handlehandle of device.
enableEnable state of current limit.

◆ EnableVoltageCompensation()

static native void com.ctre.phoenix.motorcontrol.can.MotControllerJNI.EnableVoltageCompensation ( long  handle,
boolean  enable 
)
static

Enables voltage compensation. If enabled, voltage compensation works in all control modes.

Be sure to configure the saturation voltage before enabling this.

Parameters
handlehandle of device.
enableEnable state of voltage compensation.

◆ GetBusVoltage()

static native double com.ctre.phoenix.motorcontrol.can.MotControllerJNI.GetBusVoltage ( long  handle)
static

Gets the bus voltage seen by the motor controller.

Parameters
handlehandle of device.
Returns
The bus voltage value (in volts).

◆ GetClosedLoopError()

static native int com.ctre.phoenix.motorcontrol.can.MotControllerJNI.GetClosedLoopError ( long  handle,
int  pidIdx 
)
static

Gets the closed-loop error. The units depend on which control mode is in use.

If closed-loop is seeking a target sensor position, closed-loop error is the difference between target and current sensor value (in sensor units. Example 4096 units per rotation for CTRE Mag Encoder).

If closed-loop is seeking a target sensor velocity, closed-loop error is the difference between target and current sensor value (in sensor units per 100ms).

If using motion profiling or Motion Magic, closed loop error is calculated against the current target, and not the "final" target at the end of the profile/movement.

See Phoenix-Documentation information on units.

Parameters
handlehandle of device.
pidIdxWhich closed loop to manipulate. 0 for primary, 1 for auxiliary secondary loop.
Returns
Closed-loop error value.

◆ GetDeviceNumber()

static native int com.ctre.phoenix.motorcontrol.can.MotControllerJNI.GetDeviceNumber ( long  handle)
static

Returns the Device ID

Parameters
handlehandle of device.
Returns
Device number.

◆ GetErrorDerivative()

static native double com.ctre.phoenix.motorcontrol.can.MotControllerJNI.GetErrorDerivative ( long  handle,
int  pidIdx 
)
static

Gets the derivative of the closed-loop error.

Parameters
handlehandle of device.
pidIdxWhich closed loop to manipulate. 0 for primary, 1 for auxiliary secondary loop.
Returns
Error derivative value.

◆ GetFirmwareVersion()

static native int com.ctre.phoenix.motorcontrol.can.MotControllerJNI.GetFirmwareVersion ( long  handle)
static

Gets the firmware version of the device.

Parameters
handlehandle of device.
Returns
Firmware version of device.

◆ GetIntegralAccumulator()

static native double com.ctre.phoenix.motorcontrol.can.MotControllerJNI.GetIntegralAccumulator ( long  handle,
int  pidIdx 
)
static

Gets the iaccum value.

Parameters
handlehandle of device.
pidIdxWhich closed loop to manipulate. 0 for primary, 1 for auxiliary secondary loop.
Returns
Integral accumulator value.

◆ GetInverted()

static native boolean com.ctre.phoenix.motorcontrol.can.MotControllerJNI.GetInverted ( long  handle)
static

Gets the invert state of the motor controller.

Parameters
handlehandle of device.
Returns
The invert state.

◆ GetLastError()

static native int com.ctre.phoenix.motorcontrol.can.MotControllerJNI.GetLastError ( long  handle)
static

Gets the last error generated by this object.

Parameters
handlehandle of device.
Returns
Last Error Code generated by a function.

◆ GetMotorOutputPercent()

static native double com.ctre.phoenix.motorcontrol.can.MotControllerJNI.GetMotorOutputPercent ( long  handle)
static

Gets the output percentage of the motor controller.

Parameters
handlehandle of device.
Returns
Output of the motor controller (in percent).

◆ GetOutputCurrent()

static native double com.ctre.phoenix.motorcontrol.can.MotControllerJNI.GetOutputCurrent ( long  handle)
static

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.
Parameters
handlehandle of device
Returns
The output current (in amps).

◆ GetSelectedSensorPosition()

static native int com.ctre.phoenix.motorcontrol.can.MotControllerJNI.GetSelectedSensorPosition ( long  handle,
int  pidIdx 
)
static

Get the selected sensor position.

Parameters
handlehandle of device.
pidIdxWhich closed loop to manipulate. 0 for primary, 1 for auxiliary
Returns
Position of selected sensor (in Raw Sensor Units).

◆ GetSelectedSensorVelocity()

static native int com.ctre.phoenix.motorcontrol.can.MotControllerJNI.GetSelectedSensorVelocity ( long  handle,
int  pidIdx 
)
static

Get the selected sensor velocity.

Parameters
handlehandle of device.
pidIdxWhich closed loop to manipulate. 0 for primary, 1 for auxiliary
Returns
Velocity of selected sensor (in Raw Sensor Units per 100 ms).

◆ GetStatorCurrent()

static native double com.ctre.phoenix.motorcontrol.can.MotControllerJNI.GetStatorCurrent ( long  handle)
static

Gets the stator/output current of the motor controller.

Parameters
handlehandle of device
Returns
The stator/output current (in amps).

◆ GetStatusFramePeriod()

static native int com.ctre.phoenix.motorcontrol.can.MotControllerJNI.GetStatusFramePeriod ( long  handle,
int  frame,
int  timeoutMs 
)
static

Gets the period of the given status frame.

Parameters
handlehandle of device.
frameFrame to get the period of.
timeoutMsTimeout value in ms.
See also
ConfigOpenLoopRamp
Returns
The period of the given status frame.

◆ GetSupplyCurrent()

static native double com.ctre.phoenix.motorcontrol.can.MotControllerJNI.GetSupplyCurrent ( long  handle)
static

Gets the stator/output current of the motor controller.

Parameters
handlehandle of device
Returns
The stator/output current (in amps).

◆ GetTemperature()

static native double com.ctre.phoenix.motorcontrol.can.MotControllerJNI.GetTemperature ( long  handle)
static

Gets the temperature of the motor controller.

Parameters
handlehandle of device.
Returns
The temperature of the motor controller (in 'C)

◆ HasResetOccurred()

static native boolean com.ctre.phoenix.motorcontrol.can.MotControllerJNI.HasResetOccurred ( long  handle)
static

Returns true if the device has reset.

Parameters
handlehandle of device.
Returns
Has a Device Reset Occurred?

◆ OverrideLimitSwitchesEnable()

static native void com.ctre.phoenix.motorcontrol.can.MotControllerJNI.OverrideLimitSwitchesEnable ( long  handle,
boolean  enable 
)
static

Sets the enable state for limit switches.

Parameters
handlehandle of device.
enableEnable state for limit switches.

◆ OverrideSoftLimitsEnable()

static native void com.ctre.phoenix.motorcontrol.can.MotControllerJNI.OverrideSoftLimitsEnable ( long  handle,
boolean  enable 
)
static

Sets the enable state for soft limit switches.

Parameters
handlehandle of device.
enableEnable state for soft limit switches.

◆ SelectProfileSlot()

static native void com.ctre.phoenix.motorcontrol.can.MotControllerJNI.SelectProfileSlot ( long  handle,
int  slotIdx,
int  pidIdx 
)
static

Selects which profile slot to use for closed-loop control.

Parameters
handlehandle of device.
slotIdxProfile slot to select.
pidIdxWhich closed loop to manipulate. 0 for primary, 1 for auxiliary secondary loop.

◆ Set_4()

static native void com.ctre.phoenix.motorcontrol.can.MotControllerJNI.Set_4 ( long  handle,
int  mode,
double  demand0,
double  demand1,
int  demand1Type 
)
static

Sets the demand (output) of the motor controller.

◆ SetControlFramePeriod()

static native int com.ctre.phoenix.motorcontrol.can.MotControllerJNI.SetControlFramePeriod ( long  handle,
int  frame,
int  periodMs 
)
static

Sets the period of the given control frame.

Parameters
handlehandle of device.
frameFrame whose period is to be changed.
periodMsPeriod in ms for the given frame.
Returns
Error Code generated by function. 0 indicates no error.

◆ SetDemand()

static native void com.ctre.phoenix.motorcontrol.can.MotControllerJNI.SetDemand ( long  handle,
int  mode,
int  demand0,
int  demand1 
)
static

Sets the demand (output) of the motor controller.

Parameters
handlehandle of device.
modeControl Mode of the Motor Controller
demand0Primary Demand value
demand1Secondary Demand value

◆ SetIntegralAccumulator()

static native int com.ctre.phoenix.motorcontrol.can.MotControllerJNI.SetIntegralAccumulator ( long  handle,
double  iaccum,
int  pidIdx,
int  timeoutMs 
)
static

Sets the integral accumulator.

Parameters
handlehandle of device.
iaccumValue to set for the integral accumulator.
timeoutMsTimeout value in ms.
See also
ConfigOpenLoopRamp
Parameters
pidIdxWhich closed loop to manipulate. 0 for primary, 1 for auxiliary secondary loop.
Returns
Error Code generated by function. 0 indicates no error.

◆ SetInverted()

static native void com.ctre.phoenix.motorcontrol.can.MotControllerJNI.SetInverted ( long  handle,
boolean  invert 
)
static

Inverts the output of the motor controller. LEDs, sensor phase, and limit switches will also be inverted to match the new forward/reverse directions.

Parameters
handlehandle of device.
invertInvert state to set.

◆ SetInverted_2()

static native void com.ctre.phoenix.motorcontrol.can.MotControllerJNI.SetInverted_2 ( long  handle,
int  invert 
)
static

Inverts the output of the motor controller. LEDs, sensor phase, and limit switches will also be inverted to match the new forward/reverse directions.

Parameters
handlehandle of device.
invertInvert state to set.

◆ SetNeutralMode()

static native void com.ctre.phoenix.motorcontrol.can.MotControllerJNI.SetNeutralMode ( long  handle,
int  neutralMode 
)
static

Sets the mode of operation during neutral throttle output.

Parameters
handlehandle of device.
neutralModeThe desired mode of operation when the Controller output throttle is neutral (ie brake/coast)

◆ SetSelectedSensorPosition()

static native int com.ctre.phoenix.motorcontrol.can.MotControllerJNI.SetSelectedSensorPosition ( long  handle,
int  sensorPos,
int  pidIdx,
int  timeoutMs 
)
static

Sets the sensor position to the given value.

Parameters
handlehandle of device.
sensorPosPosition to set for the selected sensor (in Raw Sensor Units).
pidIdxWhich closed loop to manipulate. 0 for primary, 1 for auxiliary
timeoutMsTimeout value in ms.
See also
ConfigOpenLoopRamp
Returns
Error Code generated by function. 0 indicates no error.

◆ SetSensorPhase()

static native void com.ctre.phoenix.motorcontrol.can.MotControllerJNI.SetSensorPhase ( long  handle,
boolean  PhaseSensor 
)
static

Sets the phase of the sensor. Use when controller forward/reverse output doesn't correlate to appropriate forward/reverse reading of sensor.

Parameters
handlehandle of device.
PhaseSensorIndicates whether to invert the phase of the sensor.

◆ SetStatusFramePeriod()

static native int com.ctre.phoenix.motorcontrol.can.MotControllerJNI.SetStatusFramePeriod ( long  handle,
int  frame,
int  periodMs,
int  timeoutMs 
)
static

Sets the period of the given status frame.

Parameters
handlehandle of device.
frameFrame whose period is to be changed.
periodMsPeriod in ms for the given frame.
timeoutMsTimeout value in ms.
See also
ConfigOpenLoopRamp
Returns
Error Code generated by function. 0 indicates no error.

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