Complete the code to set the Proportional gain of the PID block.
pidBlock.P = [1];The Proportional gain (P) controls the reaction to the current error. Setting it to 1.5 means the controller will respond proportionally to the error magnitude.
Complete the code to set the Integral gain of the PID block.
pidBlock.I = [1];The Integral gain (I) helps eliminate steady-state error by integrating the error over time. A positive value like 0.7 is typical.
Fix the error in setting the Derivative gain of the PID block.
pidBlock.D = [1];The Derivative gain (D) predicts future error based on its rate of change. It should be a positive number like 0.3 to stabilize the system.
Fill both blanks to configure the PID controller to 'PI' mode and set the filter coefficient.
pidBlock.ControllerType = '[1]'; pidBlock.FilterCoefficient = [2];
Setting ControllerType to 'PI' configures the controller to use only Proportional and Integral actions. The FilterCoefficient smooths the derivative action, here set to 0.1.
Fill all three blanks to create a PID controller with gains and set the sample time.
pidBlock.P = [1]; pidBlock.I = [2]; pidBlock.SampleTime = [3];
Here, Proportional gain is 2.0, Integral gain is 1.0, and SampleTime is 0.01 seconds, meaning the controller updates every 0.01 seconds.
