自动控制原理(课程设计)一、题目用MATLAB创建用户界面,并完成以下功能:(1)由用户输入被控系统的状态空间模型、闭环系统希望的一组极点;(2)显示未综合系统的单位阶跃响应曲线;(3)显示采用一般设计方法得到的状态反馈矩阵参数;(4)显示闭环反馈系统的单位阶跃响应曲线;(5)将该子系统嵌入到寒假作业中程序中。分别对固定阶次和任意阶次的被控系统进行设计。分别给出设计实例。二、运行结果界面:如图由用户输入被控系统的状态空间模型、闭环系统希望的一组极点例如,输入010001034A,001B,2000C,0D,闭环系统希望的一组极点:22j、22j、5如图所示:被控系统的单位阶跃响应曲线闭环系统的单位阶跃响应曲线状态反馈矩阵显示三、讨论该闭环控制系统的状态反馈与极点配置设计系统可用于任意阶次的控制系统。在此之前,我还做了一个固定阶次的控制系统状态反馈与极点配置的Matlab控制台程序(见附录二)。该系统的利用状态反馈进行极点任意配置所采用的方法为一般方法,其步骤如下:①判断受控系统是否完全能控;②由给定的闭环极点要求确定希望的闭环特征多项式的n个系数~ia;③确定原受控系统的特征多项式系数ia;④确定系统状态反馈矩阵~~~~[,,,]12nfffF的诸元素~~11iiifaa;⑤确定原受控系统化为能控标准形的变换阵的逆1P,⑥确定受控系统完成闭环极点配置任务的状态反馈阵~1FFP。四、参考文献[1]黄家英.《自动控制原理》.高等教育出版社,2010.5[2]唐向红,郑雪峰.《MATLAB及在电子信息类》.电子工业出版社,2009.6[3]吴大正,高西全.《MATLAB新编教程》.机械工业出版社,2008.4五、附录functionvarargout=tufeiqiang(varargin)%TUFEIQIANGM-filefortufeiqiang.fig%TUFEIQIANG,byitself,createsanewTUFEIQIANGorraisestheexisting%singleton*.%%H=TUFEIQIANGreturnsthehandletoanewTUFEIQIANGorthehandleto%theexistingsingleton*.%%TUFEIQIANG('Property','Value',...)createsanewTUFEIQIANGusingthe%givenpropertyvaluepairs.Unrecognizedpropertiesarepassedvia%varargintotufeiqiang_OpeningFcn.Thiscallingsyntaxproducesa%warningwhenthereisanexistingsingleton*.%%TUFEIQIANG('CALLBACK')andTUFEIQIANG('CALLBACK',hObject,...)callthe%localfunctionnamedCALLBACKinTUFEIQIANG.Mwiththegiveninput%arguments.%%*SeeGUIOptionsonGUIDE'sToolsmenu.ChooseGUIallowsonlyone%instancetorun(singleton).%%Seealso:GUIDE,GUIDATA,GUIHANDLES%Edittheabovetexttomodifytheresponsetohelptufeiqiang%LastModifiedbyGUIDEv2.520-May-201523:49:56%Begininitializationcode-DONOTEDITgui_Singleton=1;gui_State=struct('gui_Name',mfilename,...'gui_Singleton',gui_Singleton,...'gui_OpeningFcn',@tufeiqiang_OpeningFcn,...'gui_OutputFcn',@tufeiqiang_OutputFcn,...'gui_LayoutFcn',[],...'gui_Callback',[]);ifnargin&&ischar(varargin{1})gui_State.gui_Callback=str2func(varargin{1});endifnargout[varargout{1:nargout}]=gui_mainfcn(gui_State,varargin{:});elsegui_mainfcn(gui_State,varargin{:});end%Endinitializationcode-DONOTEDIT%---Executesjustbeforetufeiqiangismadevisible.functiontufeiqiang_OpeningFcn(hObject,eventdata,handles,varargin)%Thisfunctionhasnooutputargs,seeOutputFcn.%hObjecthandletofigure%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)%vararginunrecognizedPropertyName/PropertyValuepairsfromthe%commandline(seeVARARGIN)%Choosedefaultcommandlineoutputfortufeiqianghandles.output=hObject;%Updatehandlesstructureguidata(hObject,handles);%UIWAITmakestufeiqiangwaitforuserresponse(seeUIRESUME)%uiwait(handles.figure1);%---Outputsfromthisfunctionarereturnedtothecommandline.functionvarargout=tufeiqiang_OutputFcn(hObject,eventdata,handles)%varargoutcellarrayforreturningoutputargs(seeVARARGOUT);%hObjecthandletofigure%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)%Getdefaultcommandlineoutputfromhandlesstructurevarargout{1}=handles.output;functionWZH_Callback(hObject,eventdata,handles)%hObjecthandletoWZH(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)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',[001]),...'Color','red',...'LineWidth',2)%---ExecutesonbuttonpressinBFK.functionBFK_Callback(hObject,eventdata,handles)%hObjecthandletoBFK(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)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',[033]),...'Color','yellow',...'LineWidth',2)functionFKC_Callback(hObject,eventdata,handles)%hObjecthandletoFKC(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)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);Zifrank(ctrb(A,B))==rank(A)N=acker(A,B,Z);Nstr=num2str(N)H=findobj('tag','edit6');set(H,'string',str);elsemsgbox('');endfunctionpushbutton6_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton6(seeGCBO)%eventdatareserved-tobedefinedinafuturever