FeedForward of an Arm with variable MoI and Length

For this year’s game, our team designed our arm as a telescoping arm connected to a shaft going through the arm itself. Connected to this shaft are two NEOs used to rotate the entire arm. There is a CANCoder on this arm to get the arm’s angular position and velocity. Generally, for an arm system, you could use SysID to identify the ArmSystem then use WPI’s ArmFeedForward class. The issue is because the Arm extends and retracts, the moment of inertia (and length) of the arm isn’t constant. I have already calculated the changing moment of inertia to high accuracy based on the Arm’s length but now I am stuck figuring out how to do FeedForward for the rotation mechanism. How can I calculate the FeedForward value given the current and setpoint state (a state is an angular position, angular velocity, and arm length from the pivot point to the effector).

I would:

  • Copy the implementation of the WPILib ArmFeedforward class
  • Add two more fields/constructor parameters for fully retracted/fully extended kG and kA gains (kV and kS should not care about the change in arm length)
  • Add an extra parameter to the calculate method specifying the fractional arm extension
  • Linearly interpolate between the retracted/extended gains based on the fractional arm extension, and then perform the rest of the copied implementation as normal

This might ignore some higher-order dynamics, but should be a good enough approximation to work well. Otherwise, you can try to work out the Lagrangian :wink:


Would it be more accurate to run identification several times are different lengths and then run regression on those values? Is the change linear enough to just interpolate?

1 Like

It should be quite linear, but there’s no harm in verifying theory with experiment.

Feel free to share the results of any testing here; i haven’t seen any hard data on this type of design yet, so my advice is mostly from first principles.

1 Like

Ok, our programming team likely won’t get much time with the robot and I want to minimize that estimated time as much as possible. If we get enough time with the robot, I will do the regression method and update this post and let you know! Thank you for your help.

1 Like

This is exactly what we did though we never even up using it.

Another idea would be to only move to the rotating position while retracted (use that feedforward) and then extend and the feedforward shouldn’t matter much if the feedback is working well enough.

That would also work if the feedback loop is good. One issue with that is that it would be significantly slower than just interpolating the kG and kA values which is what we are going to do.

1 Like

That wouldn’t necessarily work as the feed forward is designed to overcome the force of gravity to hold it in position. Relying on feedback control, PID, doesn’t help once you’ve reached ur target goal as ur error is negligible. Since the arm is extended, u may need a larger FF since the torque generated by the arm is larger.