当前位置:文档之家› 'MATLAB中文版',doc_type,pdf

'MATLAB中文版',doc_type,pdf

'MATLAB中文版',doc_type,pdf
'MATLAB中文版',doc_type,pdf

控制系统MATLAB仿真基础

系统仿真 § 4.1控制系统的数学模型 1、传递函数模型(tranfer function) 2、零极点增益模型(zero-pole-gain) 3、状态空间模型(state-space) 4、动态结构图(Simulink结构图) 一、传递函数模型(transfer fcn-----tf) 1、传递函数模型的形式 传函定义:在零初始条件下,系统输出量的拉氏变换C(S)与输入量的拉氏变换R(S)之比。 C(S) b1S m+b2S m-1+…+b m G(S)=----------- =- -------------------------------- R(S) a1S n + a2S n-1 +…+ a n num(S) = ------------ den(S) 2、在MATLAB命令中的输入形式 在MATLAB环境中,可直接用分子分母多项式系数构成的两个向量num、den表示系统: num = [b1, b2, ..., b m]; den = [a1, a2, ..., a n]; 注:1)将系统的分子分母多项式的系数按降幂的方式以向量的形式输入两个变量,中间缺项的用0补齐,不能遗漏。 2)num、den是任意两个变量名,用户可以用其他任意的变量名来输入系数向量。 3)当系统种含有几个传函时,输入MATLAB命令状态下可用n1,d1;n2,d2…….。 4)给变量num,den赋值时用的是方括号;方括号内每个系数分隔开用空格或逗号;num,den方括号间用的是分号。 3、函数命令tf( ) 在MATLAB中,用函数命令tf( )来建立控制系统的传函模型,或者将零极点增益模型、状态空间模型转换为传函模型。 tf( )函数命令的调用格式为: 圆括号中的逗号不能用空格来代替 sys = tf ( num, den ) [G= tf ( num, den )]

控制系统的MATLAB仿真与设计课后答案

控制系统的MATLAB仿真与设计课后答案

>>z=-4*sqrt(2)*sin(t); >>plot3(x,y,z,'p'); >>title('Line in 3-D Space'); >>text(0,0,0,'origin'); >>xlabel('X'),ylable('Y'),zlable('Z');grid; 4>>theta=0:0.01:2*pi; >>rho=sin(2*theta).*cos(2*theta); >>polar(theta,rho,'k'); 5>>[x,y,z]=sphere(20); >>z1=z; >>z1(:,1:4)=NaN; >>c1=ones(size(z1)); >>surf(3*x,3*y,3*z1,c1); >>hold on >>z2=z; >>c2=2*ones(size(z2)); >>c2(:,1:4)=3*ones(size(c2(:,1:4))); >>surf(1.5*x,1.5*y,1.5*z2,c2); >>colormap([0,1,0;0.5,0,0;1,0,0]); >>grid on >>hold off 第四章 1>>for m=100:999 m1=fix(m/100); m2=rem(fix(m/10),10); m3=rem(m,10); if m==m1*m1*m1+m2*m2*m2+m3*m3*m3 disp(m) end end 2M文件:function[s,p]=fcircle(r) s=pi*r*r; p=2*pi*r; 主程序: [s,p]=fcircle(10) 3>>y=0;n=100; for i=1:n y=y+1/i/i; end >>y

MATLAB控制系统与仿真设计

MATLAB控制系统与仿真 课 程 设 计 报 告 院(系):电气与控制工程学院 专业班级:测控技术与仪器1301班 姓名:吴凯 学号:1306070127

指导教师:杨洁昝宏洋 基于MATLAB的PID恒温控制器 本论文以温度控制系统为研究对象设计一个PID控制器。PID控制是迄今为止最通用的控制方法,大多数反馈回路用该方法或其较小的变形来控制。PID控制器(亦称调节器)及其改进型因此成为工业过程控制中最常见的控制器(至今在全世界过程控制中用的84%仍是纯PID调节器,若改进型包含在内则超过90%)。在PID控制器的设计中,参数整定是最为重要的,随着计算机技术的迅速发展,对PID参数的整定大多借助于一些先进的软件,例如目前得到广泛应用的MATLAB仿真系统。本设计就是借助此软件主要运用Relay-feedback法,线上综合法和系统辨识法来研究PID控制器的设计方法,设计一个温控系统的PID控制器,并通过MATLAB中的虚拟示波器观察系统完善后在阶跃信号下的输出波形。 关键词:PID参数整定;PID控制器;MATLAB仿真。 Design of PID Controller based on MATLAB Abstract This paper regards temperature control system as the research object to design a pid controller. Pid control is the most common control method up until now; the great majority feedback loop is controlled by this method or its small deformation. Pid controller (claim regulator also) and its second generation so become the most common controllers in the industry process control (so far, about 84% of the controller being used is the pure pid controller, it’ll exceed 90% if the second generation included). Pid parameter setting is most important in pid controller designing, and with the rapid development of the computer technology, it mostly recurs to some advanced software, for example, mat lab simulation software widely used now. this design is to apply that soft mainly use Relay feedback law and synthetic method on the line to study pid

matlab控制系统仿真课程设计

课程设计报告 题目PID控制器应用 课程名称控制系统仿真院部名称机电工程学院专业 班级 学生姓名 学号 课程设计地点 课程设计学时 指导教师 金陵科技学院教务处制成绩

一、课程设计应达到的目的 应用所学的自动控制基本知识与工程设计方法,结合生产实际,确定系统的性能指标与实现方案,进行控制系统的初步设计。 应用计算机仿真技术,通过在MATLAB软件上建立控制系统的数学模型,对控制系统进行性能仿真研究,掌握系统参数对系统性能的影响。 二、课程设计题目及要求 1.单回路控制系统的设计及仿真。 2.串级控制系统的设计及仿真。 3.反馈前馈控制系统的设计及仿真。 4.采用Smith 补偿器克服纯滞后的控制系统的设计及仿真。 三、课程设计的内容与步骤 (1).单回路控制系统的设计及仿真。 (a)已知被控对象传函W(s) = 1 / (s2 +20s + 1)。 (b)画出单回路控制系统的方框图。 (c)用MatLab的Simulink画出该系统。 (d)选PID调节器的参数使系统的控制性能较好,并画出相应的单位阶约响应

曲线。注明所用PID调节器公式。PID调节器公式Wc(s)=50(5s+1)/(3s+1) 给定值为单位阶跃响应幅值为3。 有积分作用单回路控制系统 无积分作用单回路控制系统

大比例作用单回路控制系统 (e)修改调节器的参数,观察系统的稳定性或单位阶约响应曲线,理解控制器参数对系统的稳定性及控制性能的影响? 答:由上图分别可以看出无积分作用和大比例积分作用下的系数响应曲线,这两个PID调节的响应曲线均不如前面的理想。增大比例系数将加快系统的响应,但是过大的比例系数会使系统有比较大的超调,并产生振荡,使稳定性变坏;增大积分时间有利于减小超调,减小振荡,使系统的稳定性增加,但是系统静差消除时间变长,加入微分环节,有利于加快系统的响应速度,使系统超调量减小,稳定性增加。 (2).串级控制系统的设计及仿真。 (a)已知主被控对象传函W 01(s) = 1 / (100s + 1),副被控对象传函W 02 (s) = 1 / (10s + 1),副环干扰通道传函W d (s) = 1/(s2 +20s + 1)。 (b)画出串级控制系统方框图及相同控制对象下的单回路控制系统的方框图。(c)用MatLab的Simulink画出上述两系统。

《控制系统MATLAB仿真》实验讲义88

《自动控制原理实验》 目录 第一部分实验箱的使用 第二部分经典控制实验 第一章基本实验 实验一典型环节及其阶跃响应 实验二二阶系统阶跃响应 实验三控制系统的稳定性分析 实验四控制系统的频率特性 实验五连续控制系统的串联校正 实验六数字PID控制实验 第二章综合实验 第三部现代控制理论实验 第一章基本实验 第二章综合实验

实验一 典型环节及其阶跃响应 预习要求: 1、复习运算放大器的工作原理;了解采用A μ741运算放大器构成各种运算电路的方法; 2、了解比例控制、微分控制、积分控制的物理意义。 一、实验目的 1、学习自动控制系统典型环节的电模拟方法,了解电路参数对环节特性的影响。 2、学习典型环节阶跃响应的测量方法; 3、学会根据阶跃响应曲线计算确定典型环节的传递函数。 二、实验内容 1、比例环节 电路模拟: 图1-1 传递函数: 2211 ()()()U s R G s U s R ==- 2、惯性环节 电路模拟: 图1-2 传递函数: 22112()/()()11 U s R R K G s U s Ts R Cs = =-=- ++ 3、积分环节 电路模拟: A/D1 D/A1 A/D1

图1-3 传递函数: 21()11 ()()U s G s U s Ts RCs = =-=- 4、微分环节 电路模拟: 图1-4 传递函数: 211() ()() U s G s s RC s U s τ= =-=- 5、比例微分 电路模拟: 图1-5 传递函数: 222111 ()()(1)(1)()U s R G s K s R C s U s R τ= =-+=-+ 6、比例积分 电路模拟: 图1-6 A/D1 2 R D/A1 A/D1 A/D1 A/D1 C

MATLAB控制系统仿真作业1

一、 控制系统的模型与转换 1. 请将下面的传递函数模型输入到matlab 环境。 ]52)1)[(2(24)(322 33++++++=s s s s s s s G ) 99.02.0)(1(568 .0)(22+--+=z z z z z H ,T=0.1s >> s=tf('s'); G=(s^3+4*s+2)/(s^3*(s^2+2)*((s^2+1)^3+2*s+5)); G Transfer function: s^3 + 4 s + 2 ------------------------------------------------------ s^11 + 5 s^9 + 9 s^7 + 2 s^6 + 12 s^5 + 4 s^4 + 12 s^3 >> num=[1 0 0.56]; den=conv([1 -1],[1 -0.2 0.99]); H=tf(num,den,'Ts',0.1) Transfer function: z^2 + 0.56 ----------------------------- z^3 - 1.2 z^2 + 1.19 z - 0.99 2. 请将下面的零极点模型输入到matlab 环境。请求出上述模型的零极点,并绘制其位置。 )1)(6)(5()1)(1(8)(22 +++-+++=s s s s j s j s s G ) 2.8() 6.2)(2.3()(1 511-++=----z z z z z H ,T=0.05s >>z=[-1-j -1+j]; p=[0 0 -5 -6 -j j]; G=zpk(z,p,8) Zero/pole/gain: 8 (s^2 + 2s + 2) -------------------------- s^2 (s+5) (s+6) (s^2 + 1) >>pzmap(G)

基于MATLAB的自动控制系统仿真

摘要 自动控制原理理论性强,现实模型在实验室较难建立,因此利用SIMULINK进行仿真实验,可以加深我们学生对课程的理解,调动我们学习的积极性,同时大大提高了我们深入思考问题的能力和创新能力。本文针对自动控制系统的设计很大程度上还依赖于实际系统的反复实验、调整的普遍现象,结合具体的设计实例,介绍了利用较先进的MATLAB软件中的SIMULINK仿真工具来实现对自动控制系统建模、分析与设计、仿真的方法。它能够直观、快速地分析系统的动态性能、和稳态性能。并且能够灵活的改变系统的结构和参数,通过快速、直观的仿真达到系统的优化设计。关键词:MATLAB;自动控制;系统仿真

Abstract Strong theory of automatic control theory, the reality is more difficult to establish in the laboratory model, thus using the SIMULINK simulation experiment, students can deepen our understanding of the course, to mobilize the enthusiasm of our study, while greatly increasing our ability to think deeply and Innovationcapacity.In this paper, the design of automatic control system is still largely dependent on the actual system of repeated experiments, adjustment of the universal phenomenon, with specific design example, introduced the use of more advanced software in the MATLAB SIMULINK simulation tools to achieve the automatic control systemModeling, Analysis and design, simulation methods.It can intuitively and quickly analyze the dynamic performance, and steady-state performance. Keywords:MATLAB; Automatic control; System simulation

matlab 控制系统仿真

摘要 MATLAB语言是一种十分有效的工具,能容易地解决在系统仿真及控制系统计算机辅助设计领域的教学与研究中遇到的问题,它可以将使用者从繁琐的底层编程中解放出来,把有限的宝贵时间更多地花在解决科学问题上。MATLAB GUI 是MATLAB的人机交互界面。由于GUI本身提供了windows基本控件的支持,并且具有良好的事件驱动机制,同时提供了MATLAB数学库的接口,所以GUI 对于控制系统仿真的平台设计显得十分合适。GUI对于每个用户窗口生成.fig和.m 文件。前者负责界面的设计信息,后者负责后台代码的设计。 本文所做的研究主要是基于MATLAB GUI平台,结合控制系统基础理论和MATLAB控制系统工具箱,实现了用于控制系统计算机辅助分析与设计的软件。本软件主要功能:实现传递函数模型输入、状态方程模型输入、模型装换、控制系统稳定性分析、系统可观性可控性判断,绘制系统奈奎斯特图、波特图、根轨迹图以及零极点分布图。在继续完善的基础上能够用于本科自动控制原理教程的教学实验和一般的科学研究。 关键词:控制系统;MATLAB GUI;计算机辅助设计

Abstract MATLAB language is a very effective tool,and can be easily resolved in the system simulation and control system of teaching in the field of computer-aided design and research problems,it could be the bottom of the user from tedious programming liberate the limited spend more valuable time to solve scientific problems.The MATLAB GUI is the interactive interface.As the GUI itself provides the basic control windows support,and has a good mechanism for event-driven,while providing the MATLAB Math Library interface,the GUI for control system simulation platform for the design of it is suitable. GUI window generated for each user. Fig and.M file. The former is responsible for the design of the interface information,which is responsible for the design of the background code. Research done in this article is mainly based on MATLAB GUI platform,the basis of combination of control system theory and MATLAB Control System Toolbox,the realization of control systems for computer-aided analysis and design software. The main functions of the software: the realization of transfer function model input,the state equation model input,the model fitted for the control system stability analysis,system observability controllability judgments、rendering the system Nyquist diagram、Bode plots、root locus and Pole-zero distribution. While continuing to improve based on the principle of automatic control can be used for undergraduate teaching course experiments and scientific research in general. Key words:Control System;MATLAB GUI; Computer-assistant design

MatLab与控制系统仿真(重点编程)

第4章MatLab的程序设计 MatLab是一个工具、开发平台,同时它也是一门编程语言。与在命令窗口用交互的方式工作相比,通过程序运行来解决实际问题,其效率更高,因此,凡是复杂的、大型的应用都是以程序的方式执行。相对其它高级语言,MatLab更简单、编程的效率更高、调试过程也更容易。 MatLab中的程序文件是以m为后缀,所以通常将MatLab的程序文件称为m文件。MatLab提供了两种形式的m文件,即:脚本(Script)式m文件(就简称m文件)、函数型m文件。在MatLab中已经嵌入了一个功能强大的集成开发环境——m 文件编辑器,用它来进行程序的编辑、修改、调试、运行等,完成应用开发工作。 4.1 MatLab程序设计基础 通过前面内容的学习,大家对MatLab已经有了一个初步的认识和印象,到目前为止,我们都是在“命令”窗口中,以交互的方式运行,完成我们的工作。实际上简单的m文件,就是一个批处理程序,它是若干条命令的集合。 例: 4.1.1 M文件规则和属性 函数M文件必须遵循一些特定的规则。除此之外,它们有许多的重要属性,这其中包括: 1. 函数名和文件名必须相同。例如,函数fliplr存储在名为fliplr.m文件中。 2. MATLAB头一次执行一函数个M文件时,它打开相应的文本文件并将命令编辑成存储器的内部表示,以加速执行以后所有的调用。如果函数包含了对其它函数M文件的引用,它们也同样被编译到存储器。普通的脚本M文件不被编译,即使它们是从函数M文件内调用;打开脚本M文件,调用一次就逐行进行注释。 3. 在函数M文件中,到第一个非注释行为止的注释行是帮助文本。当需要帮助时,返回该文本。例如,? help fliplr返回上述前八行注释。 4. 第一行帮助行,名为H1 行,是由lookfor命令搜索的行。 5. 函数可以有零个或更多个输入参量。函数可以有零个或更多个输出参量。

控制系统仿真(MATLAB)实验2

MATLAB实验二 自动化2班解洪超200940600138 一、实验目的: 1. Learn to design branch and loop statements program 2. Be familiar with relational and logical operators 3. Practice 2D plotting 二、实验内容: 1. Assume that a,b,c, and d are defined, and evaluate the following expression. a=20; b=-2; c=0; d=1; (1) a>b; ans= 1(2) b>d; ans= 0 (3) a>b&c>d; ans=0 (4) a==b; ans= 0 (5) a&b>c; ans=0 6) ~~b; ans=1 a=2; b=[1 –2;-0 10]; c=[0 1;2 0]; d=[-2 1 2;0 1 0]; (7) ~(a>b) ans = 0 0 0 1 (8) a>c&b>c ans = 1 0 0 1 (9) c<=d Error using ==> le Matrix dimensions must agree. a=2; b=3; c=10; d=0; (10) a*b^2>a*c ans= 0 (11) d|b>a ans= 1 (12) (d|b)>a ans= 0 a=20; b=-2; c=0; d=’Test’; (13) isinf(a/b) ans=014) isinf(a/c) ans=1(15) a>b&ischar(d)ans=1(16) isempty(c) ans= 0 2. Write a Matlab program to solve the function1 ()ln 1 y x x = - , where x is a number <1. Use an if structure to verify that the value passed to the program is legal. If the value of x is legal, caculate y(x). If not ,write a suitable error message and quit. x=input('enter a number of x:') if x<1 y=log(1/(1-x)) else disp('the value of x is illegal.') end enter a number of x:0.5 y = 0.6931 enter a number of x:3 the value of x is illegal. 3. Write out m. file and plot the figures with grids Assume that the complex function f(t) is defined by the equation f(t)=(0.5-0.25i)t-1.0 Plot the amplitude and phase of function for 0 4. t ≤≤ t=0:0.001:4; m=sqrt((0.25.*t).^2+(0.5.*t-1).^2) n=atan((0.25.*t)./(0.5.*t-1)) plot(t,m,'k-',t,n) grid on

基于MATLAB控制系统的仿真与应用

毕业设计(论文)题目基于MATLAB控制系统仿真应用研究 系别信息工程系 专业名称电子信息工程

毕业设计(论文)任务书 I、毕业设计(论文)题目: 基于MATLAB的控制系统仿真应用研究 II、毕业设计(论文)使用的原始资料(数据)及设计技术要求: 原始资料: (1)MATLAB语言。 (2)控制系统基本理论。 设计技术要求: (1)采用MATLAB仿真软件建立控制系统的仿真模型,进行计算机模拟,分析整个系统的构建,比较各种控制算法的性能。 (2)利用MATLAB完善的控制系统工具箱和强大的Simulink动态仿真环境,提供用方框图进行建模的图形接口,分别介绍离散和连续系统的MATLAB和Simulink仿真。 III、毕业设计(论文)工作内容及完成时间: 第01~03周:查找课题相关资料,完成开题报告,英文资料翻译。 第04~11周:掌握MATLAB语言,熟悉控制系统基本理论。 第12~15周:完成对控制系统基本模块MATLAB仿真。 第16~18周:撰写毕业论文,答辩。

Ⅳ、主要参考资料: [1] 《MATLAB在控制系统中的应用》,张静编著,电子工业出版社。 [2]《MATLAB在控制系统应用与实例》,樊京,刘叔军编著,清华大学出版社。 [3]《智能控制》,刘金琨编著,电子工业出版社。 [4]《MATLAB控制系统仿真与设计》,赵景波编著,机械工业出版社。 [5]The Mathworks,Inc.MATLAB-Mathemmatics(Cer.7).2005. 信息工程系电子信息工程专业类 0882052 班学生(签名): 填写日期:年月日 指导教师(签名): 助理指导教师(并指出所负责的部分): 信息工程系(室)主任(签名):

控制系统Matlab仿真 (传递函数)

控制系统仿真 [教学目的] 掌握数字仿真基本原理 控制系统的数学模型建立 掌握控制系统分析 [教学内容] 一、控制系统的数学模型 sys=tf(num,den) %多项式模型,num为分子多项式的系数向量,den为分母多项式的系%数向量,函数tf()创建一个TF模型对象。 sys=zpk(z,p,k) %z为系统的零点向量,p为系统的极点向量,k为增益值,函数zpk()创建一个ZPK模型对象。 (一)控制系统的参数模型 1、TF模型 传递函数 num=[b m b m-1 b m-2…b1 b0] den=[a m a m-1 a m-2…a1 a0] sys=tf(num,den) 【例1】系统的传递函数为。 >>num=[0 1 12 44 48]; >>den=[1 16 86 176 105]; >>sys=tf(num,den); >>sys Transfer function: s^3 + 12 s^2 + 44 s + 48 ------------------------------------- s^4 + 16 s^3 + 86 s^2 + 176 s + 105 >>get(sys) >>set(sys) >>set(sys,'num',[2 1 2])

>> sys Transfer function: 2 s^2 + s + 2 ------------------------------------- s^4 + 16 s^3 + 86 s^2 + 176 s + 105 【例2】系统的传递函数为。 >>num=conv([20],[1 1]); >>num num = 20 20 >>den=conv([1 0 0],conv([1 2],[1 6 10])); >>sys=tf(num,den) Transfer function: 20 s + 20 ------------------------------- s^5 + 8 s^4 + 22 s^3 + 20 s^2 【例3】系统的开环传递函数为,写出单位负反馈时闭环传递函数的TF模型。 >>numo=conv([5],[1 1]); >>deno=conv([1 0 0],[1 3]); >>syso=tf(numo,deno); >>sysc=feedback(syso,1) Transfer function: 5 s + 5 ---------------------- s^3 + 3 s^2 + 5 s + 5 【例4】反馈系统的结构图为: R (s) C

相关主题
文本预览
相关文档 最新文档