状态反馈与极点配置报告

更新时间:2024-03-28 10:34:01 阅读量: 综合文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

自 动 控 制 原 理

(课程设计)

一、题目

用MATLAB创建用户界面,并完成以下功能:

(1)由用户输入被控系统的状态空间模型、闭环系统希望的一组极点; (2)显示未综合系统的单位阶跃响应曲线;

(3)显示采用一般设计方法得到的状态反馈矩阵参数; (4)显示闭环反馈系统的单位阶跃响应曲线; (5)将该子系统嵌入到寒假作业中程序中。

分别对固定阶次和任意阶次的被控系统进行设计。分别给出设计实例。

二、运行结果

界面:如图

由用户输入被控系统的状态空间模型、闭环系统希望的一组极点

?010??0??B??0?001例如,输入A????,??,C??2000?,D?0,闭环系统

???0?3?4???1??希望的一组极点:?2?j2、?2?j2、?5如图所示:

被控系统的单位阶跃响应曲线

闭环系统的单位阶跃响应曲线

状态反馈矩阵显示

三、讨论

该闭环控制系统的状态反馈与极点配置设计系统可用于任意阶次的控制系统。在此之前,我还做了一个固定阶次的控制系统状态反馈与极点配置的Matlab控制台程序(见附录二)。

该系统的利用状态反馈进行极点任意配置所采用的方法为一般方法,其步骤如下:

①判断受控系统是否完全能控;

②由给定的闭环极点要求确定希望的闭环特征多项式的n个系数ai; ③确定原受控系统的特征多项式系数ai; ④确定系统状态反馈矩阵F?[f1,f2,~~~~,fn]的诸元素fi?ai?1?a~~~~i?1;

⑤确定原受控系统化为能控标准形的变换阵的逆P?1,

⑥确定受控系统完成闭环极点配置任务的状态反馈阵F?FP?1。

四、参考文献

[1]黄家英.《自动控制原理》.高等教育出版社,2010.5

[2]唐向红,郑雪峰.《MATLAB及在电子信息类》.电子工业出版社,2009.6 [3]吴大正,高西全.《MATLAB新编教程》.机械工业出版社,2008.4

五、附录

function varargout = tufeiqiang(varargin) %TUFEIQIANG M-file for tufeiqiang.fig

% TUFEIQIANG, by itself, creates a new TUFEIQIANG or raises the existing

% singleton*. %

% H = TUFEIQIANG returns the handle to a new TUFEIQIANG or the handle to

% the existing singleton*. %

% TUFEIQIANG('Property','Value',...) creates a new TUFEIQIANG using

the

% given property value pairs. Unrecognized properties are passed via % varargin to tufeiqiang_OpeningFcn. This calling syntax produces a

% warning when there is an existing singleton*. %

% TUFEIQIANG('CALLBACK') and TUFEIQIANG('CALLBACK',hObject,...) call the

% local function named CALLBACK in TUFEIQIANG.M with the given input % arguments. %

% *See GUI Options on GUIDE's Tools menu. Choose \one

% instance to run (singleton)\ %

% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help tufeiqiang

% Last Modified by GUIDE v2.5 20-May-2015 23:49:56

% Begin initialization code - DO NOT EDIT gui_Singleton = 1;

gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ...

'gui_OpeningFcn', @tufeiqiang_OpeningFcn, ... 'gui_OutputFcn', @tufeiqiang_OutputFcn, ... 'gui_LayoutFcn', [], ... 'gui_Callback', []); if nargin && ischar(varargin{1})

gui_State.gui_Callback = str2func(varargin{1}); end

if nargout

[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); else

gui_mainfcn(gui_State, varargin{:}); end

% End initialization code - DO NOT EDIT

% --- Executes just before tufeiqiang is made visible.

function tufeiqiang_OpeningFcn(hObject, eventdata, handles, varargin) % This function has no output args, see OutputFcn.

% hObject handle to figure

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % varargin unrecognized PropertyName/PropertyValue pairs from the % command line (see VARARGIN)

% Choose default command line output for tufeiqiang handles.output = hObject;

% Update handles structure guidata(hObject, handles);

% UIWAIT makes tufeiqiang wait for user response (see UIRESUME) % uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line. function varargout = tufeiqiang_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning output args (see VARARGOUT); % hObject handle to figure

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure varargout{1} = handles.output;

function WZH_Callback(hObject, eventdata, handles) % hObject handle to WZH (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) A=get(handles.edit1,'String'); A=char(A); A=str2num(A);

B=get(handles.edit2,'String'); B=char(B); B=str2num(B);

C=get(handles.edit3,'String'); C=char(C); C=str2num(C);

D=get(handles.edit4,'String'); D=char(D); D=str2num(D);

sys = ss(A,B,C,D); axes(handles.axes1);

set(handles.axes1,'unit','normalized'); step(sys);

%title('??×????????????×???ì???ú??')

set(findobj(gca,'Type','line','Color',[0 0 1]),... 'Color','red',... 'LineWidth',2)

% --- Executes on button press in BFK.

function BFK_Callback(hObject, eventdata, handles) % hObject handle to BFK (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) A=get(handles.edit1,'String'); A=char(A); A=str2num(A);

B=get(handles.edit2,'String'); B=char(B); B=str2num(B);

C=get(handles.edit3,'String'); C=char(C); C=str2num(C);

D=get(handles.edit4,'String'); D=char(D); D=str2num(D);

P=get(handles.edit5,'String'); P=char(P); P=str2num(P);

K = acker(A,B,P); at = A-B*K; bt = B; ct = C; dt = D;

%[num,den]=zp2tf(z,p,k); %[num1,den1]=cloop(num,den); axes(handles.axes1);

set(handles.axes1,'unit','normalized'); %step(cloop(num,den)); %rlocus(A,B,K,0) %step(num1,den1); sys = ss(at,bt,ct,dt); step(sys);

title('±??··????????????×???ì???ú??')

set(findobj(gca,'Type','line','Color',[0 3 3]),... 'Color','yellow',... 'LineWidth',2)

function FKC_Callback(hObject, eventdata, handles) % hObject handle to FKC (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) A=get(handles.edit1,'String'); A=char(A); A=str2num(A);

B=get(handles.edit2,'String'); B=char(B); B=str2num(B);

Z=get(handles.edit5,'String'); Z=char(Z); Z=str2num(Z); Z

if rank(ctrb(A,B)) == rank(A) N = acker(A,B,Z); N

str=num2str(N)

H = findobj('tag','edit6'); set(H,'string',str); else

msgbox('????????????????????????'); end

function pushbutton6_Callback(hObject, eventdata, handles) % hObject handle to pushbutton6 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) A=get(handles.edit1,'String'); A

A=char(A); A

A=str2num(A); A

B=get(handles.edit2,'String');

B

B=char(B); B

B=str2num(B); B

M = ctrb(A,B); if rank(M) == rank(A)

msgbox('?????ê??????????????????');

%[num,den]=zp2tf(z,p,k); %[num1,den1]=cloop(num,den);%step(cloop(num,den)); %rlocus(A,B,K,0) %step(num1,den1); else

msgbox('????????????????????????end

); '

本文来源:https://www.bwwdw.com/article/1dsr.html

Top