I’m playing with a very simple differential drive setup which I thought to configure with the fancy new ArbitraryFeedForward and AuxPID features.
The code is quite simple and merely attempts to steer the drive based off of the encoder, while accepting a throttle as a feedforward value.
It seems though, that only the master talon responds to the arbitrary feedforward. The slave reacts only to the PID.
So the slave is getting commands from the master, but the master doesn’t seem to be adding the feedforward term to the AuxPID1 output.
This especially boggles me as a nearly identical setup was working perfectly several months ago, and even reverting to the 3.8 firmware seems to have no effect.
You set the follower to be an aux1 follower. That means follower = masterPID0 - masterPID1. But PID1(aux) is not running, and therefore is zero. Instead you appear to be running PIDF0 + arbFF.
I think you intended that the follower match the master exactly, so change your call to slave.follow(master) or slave.follow(master, PercentOutput) - they do the same thing.
Make sense?
Aux1 follower is great for differential systems where you have a right-master and a left-slave, where
master = PID0 + PID1, and
slave = PID0-PID1.
What you can do is use PIDF1-aux to produce essentially a feed forward term. Set the gains for PIDF1 so its kF only. Then whatever target you specify for aux1 will just get multiplied by KF (essentially a feed forward),
This works on my setup…
Although I’m not sure what physical mechanism this would be useful for.
I guess doing a single-axis servo, and then applying an open-loop differential could be useful depending on where the sensor is.
Just got into the shop a few hours ago and tried this. Works like a charm! Thanks for coming to my rescue.
As for the physical mechanism, this is being used to steer with a closed loop and control throttle with an open loop. The quadrature input simulates a gyro that I don’t have yet.