Get Feedback

The Thrifty Nova provides various types of feedback including encoder feedback, and current feedback.

Configuring Encoder Type for Feedback

For encoder feedback to report correctly the user must specify which encoder is being utilized. This can be set using the useEncoderType method.

One encoder type is the encoder inside the BLDC motor attached to the controller.

motor.useEncoderType(EncoderType.INTERNAL);

The encoder type can also be set to an external quadrature encoder.

motor.useEncoderType(EncoderType.QUAD);

In addition, the encoder type can also be set to an external absolute encoder, but currently only for position control and feedback.

motor.useEncoderType(EncoderType.ABS);

The following encoder functionality is work in progress:

  • Direct CAN encoder to motor controller

API Details

Set the encoder type to use for feedback control.

useEncoderType(EncoderType encoderType)

Parameters:

  • encoderType The encoder type to use.

Encoder Feedback Method Examples

You can access encoder feedback for both position and velocity measurements.

Position Feedback

Below is the method for retrieving the position feedback measurement from the encoder. This is returned as a double representing encoder units.

double position = motor.getPosition(); // measure position from the encoder

Velocity Feedback

Below is the method for retrieving the velocity feedback measurement from the encoder. This is returned as a double representing encoder units per second.

double velocity = motor.getVelocity(); // measure velocity from the encoder

Current Feedback

The Thrifty Nova also provides current feedback on both stator and supply side current. The difference is as follows:

  • Stator: Uses the total current draw of phase a, b, and c.

  • Supply: Uses the stator current draw plus the current draw of the controller itself.

Stator Current Feedback

Below is the method for retrieving the stator current feedback measurement from the motor. This is returned as an integer representing amps.

int statorCurrent = motor.getStatorCurrent(); // measure stator current from the Nova

Supply Current Feedback

Below is the method for retrieving the supply current feedback measurement from the motor. This is returned as an integer representing amps.

int supplyCurrent = motor.getSupplyCurrent(); // measure supply current from the Nova

Last updated