Simulink Control Design™ - MathWorks

(Tuis.) #1
In this illustration, the PID controller is implemented as a Simulink PID Controller block.
Because the PID gains of that block are tunable, you can configure your system to write
the tuned gains to the deployed controller. Alternatively, you can also use your own
custom PID controller subsystem in the model that you deploy.

You can implement any logic appropriate to your application to determine whether and
how to update the PID controller with the tuned gains. In the illustrated system, the PID
update logic subsystem represents such a module. The External data block
represents whatever other information your logic requires to determine whether to
update the controller.

NoteWhen you are using the Closed-Loop PID Autotuner block, feeding the pid gains
outputs directly into the PID Controller gain inputs can introduce an algebraic loop that
prevents code generation. To avoid this problem, you can introduce a state in your PID
update logic that breaks the algebraic loop. For example, you can try one of the following
approaches:


  • Use a Unit Delay block to keep the controller output one time step ahead of the
    controller inputs.

  • Use a Data Store Memory block, as illustrated in “Tune PID Controller in Real Time
    Using Closed-Loop PID Autotuner Block” on page 8-39.


8 PID Autotuning

Free download pdf