CounterObject for RPM


I am using the AS5030 rotary encoder to find rpm of the shooter wheels. Since there is only on 3 prong PWM cable coming out from the encoder, I decided to use a counter class to find rpms. It works well for when the victor is barley running at like (victor.get() = .106666). After that it doesn’t work, can someone help me?


I don’t about that issue in particular, but if you continue to have problems, you could connect it to a CANJaguar. It has a built-in getSpeed function, but is tricky to rewire, flash, and configure if you’re already using PWM.

If it only works when the motor is going slow, could it be that your wheel or whatever you’re driving is going faster than the AS5030’s max RPM? Also I think that encoder in particular isn’t really for detecting speeds more than angles. You might be better off using the encoders that go on the ToughBoxes. In any case, could you post your encoder code just to make sure it isn’t something wrong with that? It could also be that you haven’t set up the encoder properly in the code.