Hi guys, I am wondering how to implement a motion profiling control on a arm system.
In order to control it you need to give the talon a certain output based on the current point target velocity and the current angle.
You can’t change the feed forward implementation (due to the fact that we are using the talon API) to make it calculate the angle based on the current encoder position and add it to the motion profiling calculation.
If you go down this route I’d reccomend setting kF to zero and passing in all the feedforward values through the arbitrary feedforward—it’s easier to keep track of things.
319 uses Motion Magic to do the motion profiling control for us.
Here’s a link to our 2018 wrist code in which we implemented motion magic to go to and hold positions. We made a bunch of our own classes in an effort to make it easy to follow. You can most certainly use the feed forward component of PIDF.
If you have any questions, I’m happy to answer them.
This is the approach I did for my elevator this year. Let the Talon handle the motion profile, and continuously update the arbitrary feedforward value (albeit at a slower rate.)
talon.set(ContorlMode.MotionProfile, SetValueMotionProfile.Enable, DemandType.ArbitraryFeedForward, cos(angle) and some math...);
and continually update it? the result will be output = cos(angle) and some math… + FPID (from MP)?
Amm, sounds interesting!
I will be sure to check it out, but I did not completely understood the difference between MP and motion magic.
You still need to set max V and acceleration and it will be different for each angle(?)