Falcon 500 / NEO&SPARK MAX Absolute Encoder

I know that the main reason why there are encoders built into these motors is for commutation of the brushless phases, so the encoders are obviously absolute. But are they also absolute when used for PID in software? Ignoring the possible issues of gear lash, can you hang an arm off a Falcon and use its integrated sensor to set it to a known angle without any sort of homing or a separate mag encoder/CANCoder? It seems like it should definitely be possible, but I can’t find super-clear proof.

1 Like

(not a programmer, just looking through the docs)

From what I can see, yes. Polling the sensor data from a brushless motor looks to return an absolute value.

However, keep in mind that if you have any gearing between the motor and the mechanism other than 1:1, you will not be able to tell the absolute position of the mechanism based solely off the reading of the motor encoder. If you’re thinking of using a Falcon 500 or Neo as only an encoder, I believe it would work but don’t know if it would follow all FRC rules or be the wisest/cheapest solution.

2 Likes

Yeah, forgot about that. I guess if the reduction ratio isn’t that much, you could design your system so that the starting position is always within 1 turn of the motor so it can find position, but it’d get confused if it loses power during the match,

As long as you know the initial position of the mechanism and the gear ratio, you can used the integrated encoder. We have done this in 2020 and 2021 for our swerve steering using a NEO550. The module goes through many full revolutions in each direction and the integrated encoder has never had any issues with control.

2 caveats:

  1. Because you are measuring the input end of your mechanism rather than the output end, the backlash in the geartrain between the input and the output will affect the position of the mechanism relative to the encoder. If the mechanism is always loaded in a single direction, the backlash should be consistent and therefore a small amount of tuning should be able to produce repeatable results.

  2. This actually should improve your ability to tune your PID control. The problem with backlash when you are controlling the input (motor) and measuring the output (arm position) is that the backlash is basically deadband in your feedback loop. In other words, if you hold the arm in a fixed position, you can rotate the motor shaft some number of turns before using up all the backlash. Thus, then the control loop tries to command a direction change (to correct a position error) it will initially not see any response. You end up needing to operate with a fairly low gain (or a lot of damping) to keep such a system stable. If you are measuring the motor instead of the arm, then there is no deadband between the input and the response. So you can run a control loop with higher gain and/or less damping and get a much more responsive system. But, since you don’t get a free lunch here, you will pay the penalty of having less certainty about the thing you actually care about (i.e. the arm position) as I pointed out in point #1 above. Essentially, the backlash becomes an uncertainty band for the arm position rather than deadband in the control loop.

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