# How can feedforward be used with PID for motion control

In a motion control system where a motor accelerates, coasts, and decelerates (setpoint is position, not velocity!), what would be the benefit of using feedforward with PID, instead of solely PID?

How would you calculate a feedforward value to add to the PID output?

• Have you got a satisfactory answer? Are all answers satisfactory? Do you need to leave comments for clarification? – Andy aka May 3 '18 at 7:39

Once the motor has accelerated to full speed (coasting) you could potentially overshoot the target position if it is close-by so, instead, you can use feed-forward to limit the full speed to a value that is based on

• The knowledge of the starting position and
• The "distance" to target position

You might also choose to preset some PID values based on the distance you need to travel to optimize the algorithm rather than use one-size fits all mentality.

Feed-forward control usually means measuring disturbances that are direct inputs to the plant or process, and feeding these to the plant input (i.e. earlier in the forward path) through a feed-forward controller. The feed-forward controller TF is, ideally, the inverse of the process TF (or at least the part of the process that's affected by the disturbance), and the resultant signal is negated and added to the plant input signal, thereby cancelling the disturbance affects predictively.

TF inverses are sometimes awkward to implement practically, and an approximate realisation is often necessary.

Feed-forward control is largely independent of, say, a PID controller in the forward path, so design of the PID controller is not affected by the inclusion of feed-forward control.

Feed forward means that your controller doesn't wait for the integral to build up, it also FORWARDS the setpoint with certain coefficient to the output of the PID. In steady state the integral will compensate, so it's only good for transitions.

So in some systems the controller performs quicker, in others it mat be unstable. Like always, it all depends on the system.

Which is why rather than calculate it you could just tune according to the measurements.