So after some heated debates it has come to my attention that the setReference function uses a setpoint. To my original understanding it took an error as the input. The fun thing is that it worked using an error. Any ideas?

Not a Java expert but can you post your code? It always helps diagnosing code problems.

Your question is a little vague, but if it is what it seems to be, then yes, the setReference function takes in the setpoint that you want the motor to go to. It does not take in (expected - current) ie. error.

Straight from the API Documentation:

The value to set depending on the control mode. For basic duty cycle control, this should be a value
between -1 and 1 Otherwise: Voltage Control: Voltage (volts) Velocity Control: Velocity (RPM)
Position Control: Position (Rotations) Current Control: Current (Amps). Native units can be changed
using the setPositionConversionFactor() or setVelocityConversionFactor() methods of the
CANEncoder class

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.