Closed Loop Control on a Rotating Arm

I would recommend starting with classic Motion Magic, particularly if you are unfamiliar with the tech, with a conservative acceleration value.

You likely will still want to dial kF since it profiles target-velocity. Even if you plan on using arbFeedFwd later. Otherwise you many need to include velocity/accel/etc in addition to your gravity compensation.

Then you can leverage the arbFeedFwd for your gravity compensation, basically use the 4-param set and calculate your feed-forward as you like. You can poll the current sensor position - which you will likely need for your math.

And you can always set kF to zero if you only want your calculated feed-forward portion of the math. This allows for great experimentation, so you can connect software-changes to your results.

https://github.com/CrossTheRoadElec/Phoenix-Examples-Languages/tree/master/Java/MotionMagic_AuxFeedForward

Doc section for posterity
https://phoenix-documentation.readthedocs.io/en/latest/ch16_ClosedLoop.html#

3 Likes