My team is attempting to run the new NEO motor from REVRobotics using the Spark Max motor controller. We got the motor running, but are unable to get the integrated encoder to work. We use the CANEncoder class defined here in their JavaAPI, but we can not get it working. In the SPARK MAX client, we’ve tried various combinations of “Sensor Type” and “Output Ratio”. No matter what we try, the getPosition() API always returns 0.0. Does anyone have a solution?
We have the same problem here. Our Spark Max status light when “Sensor Type” is “No Sensor” or “Encoder” blinks orange and purple which, according to the Spark Max Quick Start, indicates a “brushless encoder error.” Only “Hall Effect” seems to work for the motor. The firmware is up to date.
Just did some testing, it seems like that “Sensor Type” is problematic. The getPosition() method is working now, remember to update your firmware
Mind sharing what configuration settings you used in the Spark Max client? Specifically what did you have the sensor type and output ratio set to?
Additionally, would you mind posting a snippet of your code for getting the position?
Sensor Type: Hall Effect
Output Ration: 0
Everything else was set at default in the Spark Max Client
Check to make sure the ID in the Spark client matches the CAN ID you are using in the code
In the subsystem class
CANSparkMax motor = new CANSparkMax(CAN_ID);
CANEncoder encoder = new CANEncoder(motor);
In the default command for that subsystem
protected void execute() {
double encoderOutput = Robot.mySubsystem.encoder.getPosition();
System.out.println(encoderOutput);
}
I’m using LABVIEW and I’m having the same problem: I can’t get an encoder reading. The firmware is up to date
Using Java. Same issues
Please check to make sure that your APIs are up to date. Current versions:
LabVIEW - 1.0.0-26
Java - 1.0.27
C++ - 1.0.27
Also take a look at our “Reading Encoder Values” example in our SPARK MAX Code Examples.
Finally, make sure the “Sensor Type” parameter is set to “Hall Sensor” when using the NEO.
Let me know if you still can’t get it working after going through the above troubleshooting steps.