Help - SRX MotionMagic Feedforward Calculation

Hey guys, I am currently trying to use motionmagic in labview to come up with a position based control for our arm. We are using a parallel bar arm with 2 CIM motors on each side, with a quadrature encoders. Our arm is not yet finished, but I was able to try the motionmagic through a arm prototype with cim and encoder. I was able to get a decent PID on the arm, but having the feed forward term would be a lot more helpful.

I am very new to motionmagic, and I am not very sure what the control is based off.

I tried to calculate the feed forward value based on this post Velocity Limiting PID - #22 by dydx
FF = (Arm Weight) * (Distance to arm center of mass) / (Motor stall torque) * (Number of motors) * (Gear Ratio) ] * cos(theta)
My answers came out to be about 0.09 as the FF value.

However, when I tried to put this term onto our actual arm, the arm only begins to get actual power at about FF = 5. (the vbus with p,i,d, all at 0 and ff = 5 was 0.04)

I dont think i really understand what units the FF term for position based motion magic is based off of…

What does the FF term mean in motionmagic? How do i calculate a sound FF value? Currently my only idea is to wait until the entire arm is finished and find the minimum ff it takes for the arm to stay horizontal, and adjust the ff for different angles by taking the cosine.

Here is my current code (in labview)
image

Any help will be greatly appreciated!

Velocity feed forward

https://phoenix-documentation.readthedocs.io/en/latest/ch16_ClosedLoop.html#calculating-feed-forward-gain-kf
Unit explained in the link

Advanced FF

For more advanced FF, use the four-param set. Pick arbitrary feed forward for the demand1Type.
+/- 1.0 represents full output.

1 Like

I think the core misunderstanding here is your units. My post does things in units of Volts, whereas the Talon APIs (as of 2019) take 1023 to mean full output.

As Omar mentioned arbitrary feed forward is the correct way to go about this.