DO I need an external encoder for NEO1.1 when using PID?

Our team is planning on using PID control for the next season’s bot. So I wanted to know if external encoders are required for NEO 1.1. If there’s any info for this, it’d be greatly appreciated. Thank you!

That really depends on the mechanism you are trying to build. The encoder built into the NEO is a relative encoder (*see caveat below). This means that it can tell you the speed at which it is rotating and (in the case of the NEO, but not necessarily all relative encoders), how many rotations it has made since it was powered on.

If you are trying to PID control the speed of a mechanism like a shooter wheel, then the encoder built into the shooter will do the trick. If you are trying to control the absolute position of something, though, like the height of an elevator, it’s a little tricker. If your mechanism always powers on in a known position (like the elevator is all the way down) then you can use the amount that the motor has turned since it powered on to know it’s absolute position. If your mechanism does not always power on in a known state, you could slowly move it to a known state (like hitting a limit switch) at the start of each match, and then calculate the change in the motor’s position since then to know your absolute position. If your mechanism can’t support either of those things, then an external absolute encoder would be useful.

I’ll add in here that the encoder on the NEO doesn’t have a very high resolution, so if you are trying to get a very very precise control of speed, you’ll want an external encoder. People on this forum will have varying opinions on how critical this is, but ultimately it depends on how much precision you need on the speed control.

Lastly, the caveat from above: I believe that the NEO can actually tell you the absolute position of the shaft. But this isn’t generally useful, even for position control. That’s because there is likely to be a gear ratio between your motor and whatever mechanism you are trying to position. So if you have a X:1 gear ratio, that means that whatever the absolute position of the shaft is, the resulting mechanism could be in any of X positions.

There is a lot of complicated concepts embedded in here, so feel free to ask follow up questions!

2 Likes

The NEO has a relative encoder that runs 42 ticks per revolution, meaning an accuracy of 8.6 degrees. This accuracy isn’t really great, but it’s acceptable.

The problem is that it’s a relative encoder; you’ll need to add a limit switch to calibrate it to get the actual position of your mechanisms. For elevators and telescopes, that’s your only option. But it’s up to you for arms and pivots: built-in relative encoder + limit switch vs absolute encoder.

In most cases the motor is installed through a reduction, meaning that the accuracy at the output shaft is more than sufficient, even with the lackluster 42 ticks per revolution of the NEO encoder.

2 Likes

An external sensor certainly isn’t required for PID control, but it could help depending on your use case.

As mentioned earlier, the sensor in the NEO is a relative sensor, meaning it can only tell you how it’s moved relative to its position at bootup (or whatever other position you reset it at post-bootup).

If you’re doing velocity PID, note that the encoder in the NEO is suboptimal for this, but you can get okay performance if you tune some settings.

An external absolute encoder might be a nice addition for certain mechanisms.