logo资料库

基于Matlab的模糊PID控制器设计与仿真.pdf

第1页 / 共4页
第2页 / 共4页
第3页 / 共4页
第4页 / 共4页
资料共4页,全文预览结束
Microcomputer Applications Vol. 26, No.4, 2010 学习园地 微型电脑应用 2010 年第 26 卷第 4 期 文章编号:1007-757X(2010)4-0059-02 基于 Matlab 的模糊 PID 控制器设计与仿真研究 何鹏 摘 要:简单介绍了常规 PID 控制的优缺点和模糊控制的基本原理,介绍了模糊 PID 控制的系统结构,同时利用 MATLAB 中的 SIMULINK 和 FUZZY 工具箱进行了仿真研究。仿真结果表明,模糊 PID 具有比常规 PID 更好的控制效果。 关键词:PID 控制;模糊 PID 控制;Matlab 仿真 中图分类号: TP273 文献标志码: A 0 引言 2 模糊控制器的实现 2.1 控制规律 PID 控制是最早发展起来的控制策略之一。由于其算 法简单,鲁棒性好和可靠性高.被广泛应用于工业过程控 制。在 PID 控制中。一个至关重要的问题是 PID 参数(比 例系数、积分时间、微分时间)的整定。参数整定的优劣 不但会影响到控制质量,而且还会影响到控制系统的稳定 性和鲁棒性。而实际工业生产过程往往具有非线性、时变 等不确定性干扰。常规 PID 控制器经常出现参数整定不 良、控制性能欠佳,且对运行工况的适应性较差等情况。 [1] 针对以上问题,长期以来,人们一直在寻求 PID 控制 器的自动整定技术,以适应复杂的工况和高指标的控制要 求。模糊控制是一类应用模糊集合理论的控制方法,不需 要被控对象的精确数学模型,因而特别适用于一些大滞 后、时变、非线性的复杂系统。 将模糊控制和传统 PID 控制相结合组成模糊 PID 控制 器,不但具有 PID 控制精度高等优点,又兼有模糊控制灵 活、适应性强的优点,是近年来控制领域十分活跃的一支 分支。[2] 1 模糊 PID 控制结构 模糊 PID 控制器以误差 e ( k ) 和误差变化率 e c ( k ) 作为输入,可以满足不同时刻的 e ( k ) 和 e c ( k )对 PID 参数整定的要求。利用模糊控制规则对 PID 参数进行修 改,便构成了模糊 PID 控制器,其结构如图 1 所示 。 r(t) e(t) — de/dt 模糊 推理 kp ki kd PID 控 制 器 y(t) 对象 图 1 模糊 PID 控制结构 PID 参数模糊自整定是找出 PID 三个参数与误差 e ( k ) 和误差变化率 e c ( k )之间的模糊关系,在运行中通过不 断检测,根据模糊控制原理来对 3 个参数进行在线修改, 以满足不同 e ( k ) 和 e c ( k ) 对控制参数的不同要求。 从而使被控对象有良好的动态、静态性能。 通常不同的偏差 | e |和偏差变化率| e c |控制器参数 Kp、Ki 、Kd 的整定要求不同,控制规则如下: (一) 当| e |较大时,为了使系统具有较好的跟踪性能, 应取较大的 Kp 和较小的 Kd, 同时为避免出现较大的超 调,应对积分作用加以限制,通常取 Ki=0 。 (二) 当| e |中等大小时,为了使系统具有较小的超调, Kp 应取得小些。在这种情况下,Kd 取值大小对系统影响 较大,应取得小一些.Ki 的取值要适当。 (三) 当| e |较小时,为了使系统具有较好的稳定性能, Kp 和 Ki 均应取得大些。同时,为了避免系统在设定值出 现振荡,并考虑系统抗干扰性能,当| e c |较大时 Kd 可取 得小些,当|ec|较小时 Kd 可取得大些。[3]-[4] 2.2 输入量和控制量的论域及模糊参考集 取系统误差 e,系统误差的变化 ec 为输入量,取 PID 控制器参数:Ukp 、Uki、 Ukd 为控制量。 模糊参考集取为:{NB,NM,NS,ZO,PS,PM, PB} 论域为: {-6,-5,-4,-3,-2,-1,0,1,2,3,4, 5,6}若不同的话,只需改变 Matlab 中输出对应的隶属度 函数,但模糊控制器的规则不变,结果大同小异)当实际 测量值与所设[-6,+6]范围不一致,而在〔a,b〕之间范 围,可以由变换式转化为[-6,+6]之间的量 Y: Y = 12 b a − [ x − a b + 2 ] (1) 令误差量化因子为 q=2×6/[x-(-x)]=6/x,这样对于基本 论域中的精确值 X∈[-x,x],可以用如下公式求出论域[-6, 6]中的元素 b b=q × X (2) 采用三角形隶属度函,隶属度函数数曲线为: 图 2 三角函数隶属度曲线图 (下转第 62 页) ——————————— 作者简介:何鹏,(1982),男,四川,上海交通大学,硕士,检测技术与自动化装置,上海 200240 ·59·
Microcomputer Applications Vol. 26, No.4, 2010 学习园地 微型电脑应用 2010 年第 26 卷第 4 期 理能够大大的减少执行时间,并且节省了内存空间。 分类方法 PCA+LDA+Correlation SVM PCA+LDA+SVM SVM+Adaboost PCA+LDA+SVM+Adaboost 表 3 五种分类方法的性能比较 特征 Haar 特征 一系列有选择性处理的局部特征 错误率(%) 29 17.2 25.7 5.05 5.21 时间(s) 1147 44210 1188 46048 5528 3 总结 根据不同的属性对人脸图像进行分类,是一个应用十 分广泛的实际问题,本文利用了 OMRON 公司的人脸库, 系统地比较了五种分类方法的性能。从实验结果可以看 出,在分类之前先对样本进行压缩降维,可以提高分类速 度,而且正确率也不会有太大损失。依据文献[6]提出的第 四种方案的分类正确率达到了 94.5%,但是在这种方法中 SVM 训练的时间耗费很大,导致系统分类时间过长。相 比之下,第五种方案分类正确率达到 94%以上,由于对特 征进行了降维处理,总的执行时间大大减少,仅为第四种 方 案 的 12% 左 右 。 对 于 大 型 数 据 , 应 用 第 五 种 方 案 “PCA+LDA+SVM+Adaboost”进行人脸分类是可行的。 同时,本文的工作还有一些尚未解决的问题。目前考 虑到的仅仅是正面姿态的人脸,对于非正面姿态的情况还 需要进一步的研究。并且本文只考虑了两种属性——墨镜 和口罩下的分类,如果增加其它属性进行分类,文中提到 的方法尚不具备可扩展性,这有待完善的。 参考文献 [1] 赵海霞,武建,“浅析主成分分析方法”[J],科技信息, 2009(02). (上接第 59 页) of Principal Components [2] Zhao W, Chellappa R, Krishnaswamy A,“Discriminant Analysis for Face Recognition”, Proc.of the 3rd IEEE International Conference on Automatic Face and Gesture Recognition, Nara, Japan, pp. 336-341, April 1998. [3] Boser B E, Guyon I M, Vapnik V N.“A training algorithm for optimal margin classifier”,Proc.5th ACM Workshop on Computational Learning Theory, Pittsburgh, PA, pp. 144-152, July 1992. [4] 董李燕,刘艺蕾,王晓峰,“基于人脸局部特征和SVM的 表情识别”[J],合肥学院学报(自然科学版),2009,(01): 24-27. [5] Cortes C,Vapnik V.“Support vector networks”,Machine Learning,20:1-25,1995. [6] Kumar N,Belhumeur P,Nayar S.“FaceTracer:A Search Engine for Large Collections of Images with Faces”, Proc. of European Conference on Computer Vision, 2008. [7] Seiffert C, Khoshgoftaar T M, Hulse J V, Napolitano A. “Resampling or Reweighting:A Comparison of Boosting International Implementations”,2008 Conference on Tools with Artificial Intelligence, 2008. 20th IEEE (收稿日期:2009-10-16) 表 1 输入量与控制量的隶属度函数赋值表 论域隶属度 参考集 PB PM PS ZO NS NM NB -6 1 -5 0.5 0.5 -4 1 -3 0.5 0.5 2 1 0 1 -2 1 -1 0.5 0.5 1 0.5 0.5 3 0.5 0.5 4 1 5 0.5 0.5 6 1 2.3 模糊关系矩阵 由控制经验可得模糊控制规则见表 2 2.4 模糊判决 模糊判决即解模糊过程是把语言表达的模糊量映射 到精确的调整量, 也就是根据输出模糊子集的隶属度计 算输出的确定值,控制量的反模糊化采用加权平均法,计 算公式如下: (下转第 64 页) ·62·
Microcomputer Applications Vol. 26, No.4, 2010 学习园地 微型电脑应用 2010 年第 26 卷第 4 期 入到 Orders 表中。具体代码如下所示: CREATE TRIGGER orderinsert ON OrderS INSTEAD OF INSERT AS declare @price money,@quantity int,@type varchar(10) declare @sum money select @price=price,@quantity=quantity,@type=type from goods,inserted,customers where goods.name=inserted. goodsnameandcustomers.customerid=inserted.customerid if @type='一般客户' set @sum=@price*@quantity else set @sum=@price*@quantity*0.85 insert into orders (goodsname,customerid,quantity, ordersum,orderdate) select goodsname,customerid,quantity,@ sum,orderdate from inserted. 触发器建成以后,只有向 order 表中插入记录,就会自 动计算 ordersum 字段的值,从而实现了比默认值及公式都 更为复杂的字段默认值的设置。 5 结束语 本文通过使用触发器,实现了通过几个表的数据对某一 字段进行自动计算的功能,完成了比 CHECK 约束更复杂的 限制。当然,也可以通过触发器实现数据库的级联更新、级 联删除及某些字段的自动更新功能(如增加某一订单时,减 少 Goods 表中相应货品的库存量)。综上所述,触发器的主 要特点在于,不管何种原因造成数据变化,它均能自动响应。 触发器对数据库开发过程中遇到的问题,往往会有独到的解 决方法。因此,在当今数据库系统的建立中,系统开发人员 除了使用视图、存储过程等技术外,大多也使用触发器技术, 以改进数据库系统建立的质量,使数据库的设计变得简洁和 高效。 参考文献 [1] 罗运模,王珊等《SQL Server 数据库系统基础》[M].高 [2] [美]James R.Groff Paul N.Weinberg 著.章小莉,宁欣,汪 [3] 郭勐,张拥军,彭宇行.数据库触发器机制的设计与实现 [4] 莫裕清,SQL Server 2000 中基于触发器的自动更新[J]. [5] 黄晓涛,数据库触发器实现数据库系统的主动功能[J]. [6] 周爱华,南理勇.SQL Server 2000 数据库触发器的应用 等教育出版社. 永好.等译《SQL 完全手册》[M].电子工业出版社. [J].电子技术应用, 2005, (02). 中国科技信息.2006 Vol.8 P.221-222. 计算机应用研究.2005 Vol.21 No.2 P.238-240. [J].商场现代化, 2008, (07). (收稿日期:2009-10-07) (上接第 62 页) * u n = ∑ i 1 = u u u ) B ( i / i u u ( B i ) (3) u u 是模糊子集 B 的隶属函数,在 Matlab 中,只 B ( ) i 需将去模糊化方法设置为 centriod 即可。[5] n ∑ i 1 = 表 2 Kp、Ki、Kd 模糊控制规律 e ec NB NM NS ZO PS PM PB NB PB/NB/PS PB/NB/NS PM/NM/NB PM/NM/NB PS/NS/NB ZO/ZO/NM ZO/ZO/PS NM PB/NB/PS PB/NB/NS PM/NM/NB PS/NS/NM PS/NS/NM ZO/ZO/NS NS/ZO/ZO NS PM/NB/ZO PM/NM/NS PM/NS/NM PS/NS/NM ZO/ZO/NS NS/PS/NS NS/PS/ZO ZO PM/NM/ZO PM/NM/NS PS/NS/NS ZO/ZO/NS NS/PS/NS NM/PM/NS NM/PM/ZO PS PS/NM/ZO PS/NS/ZO ZO/ZO/ZO NS/PS/ZO NS/PS/ZO NM/PM/ZO NM/PB/ZO PM PS/ZO/PB ZO/ZO/NS NS/PS/PS NM/PS/PS NM/PM/PS NM/PB/PS NB/PB/PB PB ZO/ZO/PB ZO/ZO/PM NM/PS/PM NM/PM/PM NM/PM/PS NB/PB/PS NB/PB/PB 2.5 仿真研究 利用 Matlab 中的 SIMULINK 和 FUZZY 工具箱建立 仿真系统如图,设被控对象系统传递函数为: s G ( ) 1 = 1 2 s + 1 2 s + (4) 图中的模糊逻辑控制器中隐含了输入输出关系的 FIS 需要利用行命令或者 GUI 编辑函数事先建立。 3 结论 本文将模糊控制理论和 MATLAB 有机结合通过对 PID 参数自整定模糊控制器的设计与仿真研究,介绍了系 统实现模糊控制的一般方案,具有易于熟悉,输出量连续, 超调量小等特点,能够达到较好的动态特性和静态特性。 Step error 1 Gain Derivative du/dt Mux Mux 2 Fuzzy Controller Product K- P 1.03 s I Add 1 2 s +2s+1 Transfer Fcn 2 Scope Add1 Sum Product 1 K- D1 du/dt Derivative 1 Add 2 Product 2 图 3 模糊自整定 PID 仿真系统图 参考文献 常规 PID 控制阶跃响应如图 4(a)所示,模糊自整 定 PID 阶跃响应如图(b)所示,通过对比可见,由系统仿 真阶跃响应对比可以看出,与常规 PID 控制相比,采用 模糊自整定 PID 控制,系统超调量为明显减少,调节时 间为与上升时间也明显缩短。--见图 4 [1] 刘曙光,魏俊民,竺志超.模糊控制技术.北京:中国纺织 [2] 爱民编著.模糊控制技术.西安:西安电子科技大学出版 [3] 夏红,赏星耀,宋建成.PID 参数自整定方法综述.浙江科 技学院学报,2007,15(4):236-240. [4] 韩力群主编,智能控制理论及应用.北京:机械工业出版 出版社,2001. 社,2008. 社, 2008. (a) (b) 图 4 系统阶跃响应曲线 ·64· [5] 黄忠霖,黄京编著,控制系统MATLAB计算及仿真.北京: 国防工业出版社,2009. (收稿日期:2009-11-10)
Microcomputer Applications Vol. 26, No. 4, 2010 ABSTRACTS & KEY WORDS 微型电脑应用 2010 年第 26 卷第 4 期 Detection of License Plate and Its Orientation Correction…………………………………………………………………………(45) JIANG Yi, YAN Jingqi (Institute of Image Processing and Pattern Recognition, Shanghai Jiaotong University, Shanghai 200240, China) Abstract: This paper proposes a fast and accuracy method of license plate location and its orientation correction based on the information of the characters. Firstly, by using gray morphology (top-hat) to enhance the license plate region ,the method well appears in the binary image.Secondly, find specific location of license plates through the number of connected components and their position are found. Finally, make orientation correction according to the center of connected components are made.This step contains two points, horizontal and vertical correction. Horizontal tilt angle can be got by the line through the center of the connected components.And vertical correction can be done by projection and pixels translation.The experimental results show that the proposed method can performance well even in the complicated conditions.The results of license plate location and the orientation correction are very good. Key words: License Plate Location; Orientation Correction; Top-hat; Connected Components Design Search of Decision Support System Based On Data Warehouse……………………………………………………………(48) Min Jianhu(Department of Information Technology,ChangZhou Textile Garment Institute, Changzhou 213164,China) Abstract: In the paper, the technique of data warehouse, online analytical processing and data mining is analyzed. In summary, a scheme that take data warehouse as the foundation, on-line analytical processing based on the design of decision support system are presented in this paper and has extensive application prospect. Key words: Data Warehouse; On-Line Analytical Processing; Data Mining; Decision Support System Xen-based Virtual Disk Scheduling Algorithm………………………………………………………………………………………(51) LIU Kechao (School of Information Security Engineering,Shanghai Jiaotong University,Shanghai 200240,China) Abstract: Xen’s current I/O scheduling algorithm can basically guarantee fairness in practical usage; however, different virtual machines may have different performance requirements. In this paper, Xen’s storage virtualization and I/O scheduling algorithm are analyzed.A dynamic priority scheduling scheme based on feedback mechanism is brought forward, and contrast experiments show that disk bandwidth is allocated as needed between virtual machines. Key words: Xen; Storage Virtualization; I/O Scheduling Algorithm An Improved Skeleton Extraction Algorithm Based on Feature Points……………………………………………………………(53) Gong Faming1,Chen Yixin2,Li Guangli3((1.College of Computer and Communication,China University of Petroleum,Dongying 257061, China;2.DongyingBranch,Industrial and Commercial Bank of China,Dongying257091,China;3.Zhejiang University,Hangzhou 310058,China) Abstract: This paper proposes a novel skeleton extraction algorithm, which is based on feature points extraction and Reeb graph theories. Feature points of 3D mesh models are computed firstly, and then they are used as geodestic origins to compute the corresponding vertexes, classifying all the vertexes according to the results and combining the same classification vertexes to be one branch point. Finally, adjacent skeleton points are connected according to their topology.Using the improved feature point’s extraction algorithm; the overall complexity of our method is reduced from o (n3) to o (n2 log (n)) steps. Experimental results show that the algorithm has a lower computing complexity, and meets the requirement of extracting nice-looking and affine-invariant skeletons efficiently. Key words: 3D Mesh; Skeleton Extraction; Feature Points; Skeleton Points LEARNERS’S GARDEN The Research on New Problems in Test Database Security during Examinations…………………………………………………(56) Chen Qingqing1,2,Wang Jiayang1(1.College of Information Science and Engineering,Central South University,Changsha 410083, China;2.Network Center,Hunan Institute of Technology,Hengyang 421002,China) Abstract: Examinations are crucial to the personnel selection and the development of teaching.With the developing of network technique, Examination through Internet will replace the traditional examination method gradually. Meanwhile, new problems arise. For instance, the credibility of examinations aided by computers will be questioned once the test database is available to examinees. And it will be the focus in this paper. Key words: Examination System; Test Database; Examination Security; Usb Design and Simulation Research of PID Fuzzy Controller Based on Matlab………………………………………………………(59) He Peng (Shanghai Jiaotong University, Shanghai 200240, China) Abstract: This paper introduces the different characteristics about conventional PID and fuzzy logic control,as well as the structure of fuzzy-PID. Simulation based on the toolboxes of SIMULINK and FUZZY inside MATLAB show that fuzzy-PID system has better control effect. Key words:PID control,Fuzzy-PID Control,Matlab Study on Face Classification Methods Based on Facial Attributes…………………………………………………………………(60) LI Xia, ZHAO Yuming (Institute of Image Processing and Pattern Recognition, Shanghai Jiaotong University, Shanghai 200240, China) Abstract: Face recognition is one of the most active and challenging problems in machine vision and pattern recognition.Based on two facial attributes – sunglass and mask, some face classification algorithms, such as Principal Component Analysis (PCA), Linear Discriminant Analysis (LDA), Correlation Coefficient (Correlation), Support Vector Machine (SVM), and Adaboost are summarized in this paper.By using the OMRON face dataset for each method,the experimental results show that reducing feature dimensions could decrease the classification time largely, with very little harm to classification performance. In addition, a classification approach which exploits the strong structure of faces to select and train on the optimal set of features for each attribute is proposed in this artical, and the result seemed to be ideal. Key words: PCA; LDA; Correlation; SVM; Adaboost The Application of Trigger in SQL Server …………………………………………………………………………………………(63) Xu Xiaoli (Department of Computer Science, Daqing Medical College, Daqing163312, China) Abstract: Trigger is a special storing process,which can't be called explicitly,but autoactived when inserting、updating、deleting records to tables.This acticle discusses the species、effection and creation of the triggers in SQL Server 2000 database,and show the strong ability of the triggers by an certain example . Key words: SQL Server 2000; Database; Trigger; Table Address:1954 Huashan R d., Shanghai, P.R. China Zip Code:200030 Tel:86-21-62933230 Fax:86-21-62933230 Email:smcaa@online.sh.cn URL:http//wxdy.chinajournal.net.cn IP:202.96.210.198 Publisher:Shanghai Microcomputer Application Association Code Number:M 6329 Distributor:International Book Trading Corporation(P.0.Box 399,Beijing) IV
分享到:
收藏