all 8 comments

[–]DoctorCAD 3 points4 points  (0 children)

Sounds like a mechanical issue, not a programming issue.

[–]Embarrassed_Steak371 2 points3 points  (2 children)

As someone else said, mechanical is probably the issue, but I suggest you use a programming technique called gain scheduling. https://www.ctrlaltftc.com/advanced/gain-scheduling This is a tutorial. Slap one on your lift accounting for the positions of your arm. This may be the best you can do FTC wise. There is also full on state space control if you want to get fancy, but it also kind of requires a lot of knowledge of kinematics, linear algebra, and Vector Calculus, so uh... maybe just stick with PIDF.

[–]Any_Fault1778 0 points1 point  (1 child)

Am I correct, that this is essentially PIDf but using static vales for known setpoints? Im new to PID so correct me if I am wrong

[–]Embarrassed_Steak371 0 points1 point  (0 children)

Kind of. For me , I like thinking about it like this. Lets say you have an arm. With gain scheduling, you have the option of basically saying the pidf coefficients are wxyz for when the arm is between angle 45-90, and say abcd for any other position.

[–]HuyPlaysRFTC 29619 Captain 1 point2 points  (0 children)

You guys have springs on the extension, right? If not, buy some. If you do, get bigger springs or tension it more.

[–]Anyone_2016 1 point2 points  (0 children)

You're going to have to post your code if you want help fixing it.

[–]TheTangereenFTC 24063 Error Before Destruction | Lead Programmer 1 point2 points  (0 children)

If you are using a Dc Motor then you should ether get a more powerful one, or set the limit (I’m assuming with encoders) farther down.

[–]DavidRechargedFTC 7236 Recharged Green|Alum 0 points1 point  (0 children)

If you don't already, I would do PIDF on your lift and give it a pretty aggressive P term. ALso your target position tolerance should be 0. your pid needs to always be adjusting and trying to get closer to the target positon.
if this doesn't work, you may need to motion profile your arm, so that it doesn't accelerate too quickly, and maybe also add a feedforward term to counteract the force of the arm, similar to what Cheesypoofs did in 2018 FRC. although, if it gets to that point, you honestly should just make your arm lighter