PID Control Simulation

Hard MATLAB Control
Solve this problem

Simulate a PID closed loop system in MATLAB given setpoint, plant transfer function, and time vector. Plot system output and error.

Constraints

  • Function: [y,e]=pid_sim(set,plant,t).
  • Use feedback and pidstd.
  • Compute error = set - y.
  • Plot response.
Starter codeMATLAB
1function [y,e] = pid_sim(set,plant,t)2% TODO3end