%% Discrete-Time 2-DOF PI Controller in Standard Form
% Create a discrete-time 2-DOF PI controller in standard form, using the trapezoidal discretization formula. Specify the formula using Name,Value syntax.

Kp = 1;
Ti = 2.4;
Td = 0;    
N = Inf; 
b = 0.5;   
c = 0;      
Ts = 0.1;
C2 = pidstd2(Kp,Ti,Td,N,b,c,Ts,'IFormula','Trapezoidal')

% Setting Td = 0 specifies a PI controller with no derivative term. As the display shows, the values of N and c are not used in this controller. The display also shows that the trapezoidal formula is used for the integrator.
% Copyright 2015 The MathWorks, Inc.