www.gusucode.com > control 案例程序 matlab源码代码 > control/ExtractSISOComponentsFrom2DOFPIDControllerExample.m
%% Extract SISO Components from 2-DOF PID Controller % Decompose a 2-DOF PID controller into SISO control components, using each of % the feedforward, feedback, and filter configurations. %% % To start, obtain a 2-DOF PID controller. For this example, create a plant model and tune a 2-DOF % PID controller for it. % Copyright 2015 The MathWorks, Inc. G = tf(1,[1 0.5 0.1]); C2 = pidtune(G,'pidf2',1.5) %% % |C2| is a |pid2| controller object, with two inputs and one output. % Decompose |C2| into SISO control components using the feedforward % configuration. [Cff,Xff] = getComponents(C2,'feedforward') %% % As the display shows, this command returns the SISO PID controller |Cff| as a |pid| object. The % feedforward compensator |X| is returned as a |zpk| object. %% % Decompose |C2| using the feedback configuration. In this case as well, % |Cfb| is a |pid| controller object, and the feedback compensator |X| is a % |zpk| model. [Cfb,Xfb] = getComponents(C2,'feedback'); %% % Decompose |C2| using the filter configuration. Again, the components are % a SISO |pid| controller and a |zpk| model representing the prefilter. [Cfr,Xfr] = getComponents(C2,'filter');