Falcon 500 velocity control loop issue?

Hi,
While testing our shooter prototype with Falcon 500s, we have run into issues with the built in velocity closed control loop. We give the motor a set velocity, converted from rpm to encoder ticks per 100ms, as it says that it inputs velocity setpoints in that unit in the documentation. However, once we run the control loop and look at our actual velocity versus the setpoint (both in encoder ticks per 100ms) there is a significant difference. Specifically the setpoint we were testing was 2748 ticks (around 1550 rpm for our shooter) our encoder was reading upwards of 6500 ticks. Our current theory is that PID tuning is off, as when we messed with the values the difference would get less, around 4200 ticks. This is of course still off by a significant amount, but that is the lowest we have gotten without the shooter becoming extremely jittery.

Is the issue poor PID tuning like we are thinking and we just need to tune it, or is it something different?

What are your gains?

Currently our gains are as follows:

public static final double kShooterKp = 1.0;
public static final double kShooterKi = 0.0;
public static final double kShooterKd = 2.0;
public static final double kShooterKf = .15345;

Suggest going through this page if you haven’t already: https://phoenix-documentation.readthedocs.io/en/latest/ch16_ClosedLoop.html#calculating-velocity-feed-forward-gain-kf

Double check your Kf is close to the target velocity without any Kp/Ki/Kd, and only then add in some Kp.

4 Likes

What gearing are you using?
I ask because at 1:1 1550 RPM = a talon fx velocity of about 5290 encoder values/100ms

Sounds like too high f value. Set kp,kd to zero. Then tune the f until you get the exact velocity, then add kp
It should work

Just using the motor Kv your kF should be around 0.05. 0.15 is way too high, and PD gains alone can’t bring the velocity down and keep it down due to steady state error.

This post helped a lot. Got me close. I have a table of velocities that call out a feed forward for that velocity. The problem is that if I set it up at a value but then come back a few minutes later and try with that value it does not work. Any ideas?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.