My team is currently working on a pickup arm that needs to hold itself in three distinct positions. We originally tried using pid but were unable to get this to work due to the heavy weight of the arm and lack of knowledge. The arm uses a talon encoder to get its positions and needs to hold steady at -4700, -6000, and -3700 ticks with the press of a button. Our team is currently trying to use if statements and while loops to hold the arm but is struggling to move the arm precisely without it swinging down and slamming into our bumpers.
If anyone has sample code or ideas on how to control the arm please help!!!
We are competing at CVR today and are from team 3859.
Second option is to just gear the arm down enough that the motor doesn’t see the load much. If you’re driving the arm with a Versaplanetary gearbox or something, adding an extra reduction stage might be easier than counterbalancing.
If you are having the issue of the arm slamming into the bumpers than what helped for our team was using a slow voltage ramp rate when the PID is arm level
Additionally, to make your code nicer, I’d carefully tune a feed forward constant. Multiply this by the cosine of the CURRENT (not desired) arm position to get the force required to hold the arm at that position. From there, you may find it easier to use traditional PID tuning methods as you are not fighting the force of gravity