Through Bore Encoder

I get a position from my trough bore encoder, but the motor doesn’t go to the position I designated, it goes to a position below, can someone help me?

Can you share your code?

2 Likes

yes

Which encoder are you referring to in your code? The on in your arm subsystem or intake? Are you sure the encoders are connected to their respective DIO ports as shown in the code?

yes, the connections are correct, but the arm does not rise to the position I raised my hand to pick up the value on the shuffleboard

im assuming youre using PID to turn the arm to a position, sounds like it could be that you also need a gravity feedforward to help it get to the setpoint

2 Likes

Do you mean that you are undershooting your target? If so it must be an issue with either PID or lack of FF, not about the sensor itself .

to clarify, does the encoder reading show where the arm currently is? The robot knows where the arm is, it’s just not getting to the setpoint? If this is the case, it’s most likely a PID FF tuning issue.

If the encoder reading and actual arm position do not match up, then it could be an encoder issue.

What exactly is happening?

The I term of PID gives you the long-term correction to compensate for settling away from the setpoint. That’s typically not used in FRC mechanisms as the other suggestions posted here work well - Feedforward the largest static voltage you can without moving and Kp the largest possible without too much oscillation or damage to equipment.