www.gusucode.com > control 案例程序 matlab源码代码 > control/ConvertDynamicSystemToParallelFormPIDControllerExample.m

    %% Convert Dynamic System to Parallel-Form PID Controller
% Convert a continuous-time dynamic system that represents a PID controller
% to parallel |pid| form.
%%
% The following dynamic system, with an integrator and two zeros,
% is equivalent to a PID controller.  
%%
% 
% $$H\left( s \right) = \frac{{3\left( {s + 1} \right)\left( {s + 2} \right)}}{s}.$$
% 
%%
% Create a |zpk| model of _H_.  Then use the |pid| command to obtain _H_ in
% terms of the PID gains |Kp|, |Ki|, and |Kd|.

% Copyright 2015 The MathWorks, Inc.

H = zpk([-1,-2],0,3);
C = pid(H)