How to use PID controller in MATLAB?
You can obtain pid controller models in one of the following ways. Create a model using the pid function. Use pidtune function to tune PID controllers for a plant model. Specify a 1-DOF PID controller type in the type argument of the pidtune function to obtain a parallel-form PID controller.