Log in

View Full Version : Armabot RS7 Talon SRX Feed-Forward Tuning


Caboose
19-02-2016, 22:37
Hoping someone could help with this...:confused:

Using CTRE math in the `Speed Closed Loop.lvproj` to calculate the F value of a Armabot RS7 encoder with 12CPR on a 775pro, we are having an issue with the produced F value being too small to run the motor at the desired value.

CTRE Code.

VelocityNativeUnits = Change In Sensor / 100mS
also
VelocityNativeUnits = RPM / 600 * SensorUnitsPerRotation

Fgain = 100% X 1023 / VelocityNativeUnits ,
where VelocityNativeUnits is measured at 100% throttle

Mag Encoder has 4096 units per rotation.

Example: VelocityRPM is 10198 at 100% throttle
=> VelocityNativeUnits = (10198 / 600 * 4096) = 69618
=> Fgain = (1023 / 69618) = 0.01469


We are setting the CPR using the Talon SRX API VI. And multiply the CPR by 4 to get the SensorUnitsPerRotation.
https://i.imgur.com/0mo5QNP.png

Since the CPR is being set the `Sensor Velocity` is returned as RPM. So to get the VelocityNativeUnits we use the second equation.

Running the motor in %vbus at 10% we get a VelocityNativeUnit of 31 so we use the equation Fgain = (1023 * 0.1) / 31 = 3.3. Trying to run this Speed mode this applies a throttle of 1%.

Am I doing something obviously wrong?

ozrien
20-02-2016, 16:27
Use the self-test to confirm the native velocity as seen by the Talon.

Also I would avoid using the config-encoder-cpr VI and use native units in your LV app, see section 21.25 for the details

Caboose
20-02-2016, 17:51
This seems to work, thanks.

Greg McKaskle
21-02-2016, 10:09
We were bitten by the div by four sensor feature. It didn't cause issues with our F calculation, but we noticed it and thought is was rollover.

I've been meaning to ask you why that feature exists in the LV version. Do we need these things exposed?

Greg McKaskle