Telescopic arm control

Hi there guys, hope you can help me!!

So for the off season my team is making a Telescopic arm somewhat similar to the jack in the bot’s arm. And I’m in charge of the programming. So here’s where Im at right now:

So I know I will start with getting the PID constants for the arm
I already know all the absolute encoder programming

I know that using feedforward and smart control will improve the arm’s movement but I don’t know how to implement feedforward, can someone help me pleaseee??

Btw we are using neos

Thank you so much

1 Like

If your team has a reasonable gear ratio on the arm all you will really need is a proportional controller. Your gains are actually an imaginary number so being off by like 0.1 can make the entire world depending on what ur gains are in terms of.

I would stick to just doing a positional pid on the spark max while making sure to start slow by setting your output range to like ± 30% initially then slowly increasing it while tuning your kP. Because of the nature of how it works, as long as you dont change your output range by a lot your pid will only be slightly off. That way you wont end up accidentally breaking your mechanism.

If you really want a feedforward, it’s the fourth parameter of the setReference() method for doing pid’s on the spark max. Although, yes, you do need more volts to an extent with more gearing/friction, where a feedforward is useful is when you are drawing excessive amps from the motor which in turn causes you to have a higher kS/feedforward.

In my experience, this is quite far from the truth. Position PID controllers benefit greatly from a properly tuned integral terms due to P only controllers having steady-state error for P values that don’t oscillate. And for high-intertia systems, such as the rotation joint of an arm, a position PID alone will perform poorly due to using a first-order controller to control a second-order system which results improper handling of acceleration and deceleration.

So I should use the 3 PID gains?
Also I tried using a profiledPIDController and it actually worked pretty well, since when it achieves the goal position, it keeps the motors energized always keeping it in position. Do you think this is a great way of programming a pivoting arm? Or do you think I should use PID+feedforward instead?

WE almost always use a feed forward with our PID that way the P doesn’t have to be tuned to overcome static friction or gravity just what velocity to output to reach a goal. Though we do all of our PID and FF on the rio isntead of on controller.

We made use of the ArmFeedForward class to calculate our FF this year. We used the constants derived from the SysId tool

As for all 3 values I is almost never needed in FRC.

If you use an accurate feedforward there’s usually not a need for integral gain.

We ran a telescoping arm with just P and feedforward. You take your basic arm FF equation, k * cοs(θ), but include a term for extension of the arm.

Here is our code: https://github.com/FRC7902/ChargedUp2023/blob/18d0d7154cd628540e6d530ac3567574f6f251a5/Charged%20Up%202023/src/main/java/frc/robot/subsystems/ArmShoulder.java#L195

ArmShoulderFeedForwardMin is the power required when a fully retracted arm is horizontal. Determine this experimentally.
ArmShoulderFeedForwardDifference is the additional power required for each % of extension. This is calculated from an experimentally determined ArmShoulderFeedForwardMax, which is the power required when a fully extended arm is horizontal.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.