PIDF and Feedforward
Combine feedback correction with predicted effort.
Combine feedback correction with predicted effort.
In this lesson, you will:
Feedforward predicts the effort needed for motion before error appears. PID corrects what remains. Together they make controllers smoother and less dependent on high feedback gains.
kS overcomes static friction, kV maps desired velocity to output, and kA helps during acceleration. These constants describe the robot, not just the code.
Compute feedback from error and feedforward from desired motion. Print both before summing. Tune or reason about each term by matching it to a physical symptom.
PIDF.javaJava
double feedback = kP * error + kD * derivative; double feedforward = kS * Math.signum(targetVelocity) + kV * targetVelocity + kA * targetAcceleration; double output = feedback + feedforward;
If the robot will not start, inspect kS. If steady speed is wrong, inspect kV. If it lags during acceleration, inspect kA or reduce profile constraints.
Add telemetry for feedback, feedforward, and total output to one controller.
Check your understanding before moving on.
0 of 2 answered