Optical Shaft Encoders for PID

Hi there! Our team is currently working on the autonomous period and we have some doubts in relation to PID. Can we use an Optical Shaft Encoder instead of an Integrated one for PID controlling? If so, will it work if we put the encoder in a different shaft than the one the motor’s and we take into account the gear ratio when calculating the target speed? (Our motor drives a 24-tooth sprocket connected to a 18-tooth sprocket, where the encoder is currently placed)

Thanks!

Yup. As long as you have one on each side corrected for the gearing (if one is attached to a motor and the other a wheel and there’s gears in between). it’ll work.