We just purchased some MK4i swerve modules. We plan to use the REV brushless motors with our kit. I remember reading somewhere that additional encoders were needed to help align the wheels and help with steering, but I can’t seem to find the thread. What encoders should we get?
you should get the CTRE cancoders
We’re currently using the ThriftyBot Encoders (in the CTRE style case), connected to the Rio analog input ports.
What kind of “New” brushless motors do you have?
We did the same thing, but ran into an issue defining 4 Analog Gyros. Apparently WPILIB only allows for 3 to be defined and ended up just defining 4 AnalogInputs and manually converting the voltage to an angle. How did you handle this issue?
if you have an MXP breakout board, or a navx thats placed in the mxp port, I believe you get more AIO ports.
It’s not an issue with the number of physical analog ports. It’s when you attempt to define an AnalogGyro using index 3, you get an error stating that only indexes 0, 1, and 2 may be used to declare an AnalogGyro.
Why are you treating an encoder as a gyro?
Id say a scaled Analog input is the way to go. Should just be multiplication.
My mistake, I meant to say AnalogEncoder, but the AnalogInput is what ended up using.
You don’t want to use the AnalogGyro class for this. The likely reason for the limitation is that analog gyroscopes output a voltage proportional to angular velocity. Internally, the roborio’s FPGA integrates the velocity at a high rate to give you displacement. There are a limited number of these accumulators available.
You should be using AnalogInputs- that’s exactly what they’re for.
ah… yes this is the way. we measured voltage to figure out angle.
So did you have the issues above using AnalogEncoder or AnalogGyro? As far as I know there is not a restriction on how many AnalogEncoders you can use (at least not that low)
That may be a possibility haha!
We’re doing the same thing and did not have this issue. Double check that you are not double-instantiating devices with the same port.
Correct, ours are just AnalogInputs that are scaled to a radians value. Our code is here if you want to take a look.
That was supposed to be REV
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.