%% Convert 2-DOF PID Controller from Standard to Parallel Form
% Convert a standard-form pidstd2 controller to parallel form.
% Standard PID form expresses the controller actions in terms of an overall proportional gain Kp, integrator and derivative time constants Ti and Td, and filter divisor N. You can convert any 2-DOF standard-form controller to parallel form using the pid2 command. For example, consider the following standard-form controller.

Kp = 2;
Ti = 3;
Td = 4;
N = 50;
b = 0.1;
c = 0.5;
C2_std = pidstd2(Kp,Ti,Td,N,b,c)

%
% Convert this controller to parallel form using pid2.

C2_par = pid2(C2_std)

%
% A response plot confirms that the two forms are equivalent.

bodeplot(C2_par,'b-',C2_std,'r--')
legend('Parallel','Standard','Location','Southeast')

% Copyright 2015 The MathWorks, Inc.