基于MATLAB的中央空调模糊控制器设计与仿真

Microcomputer Applications Vol. 25, No.8, 2009 技术交流 微型电脑应用 2009年第25卷第8期

·50·

文章编号:1007-757X(2009)8-0050-03

基于MATLAB 的中央空调模糊控制器设计与仿真

张丽 张朝轩 丁宝苍

摘 要:随着控制理论及系统研究的迅速发展,对控制效果要求越来越高,控制算法也越来越复杂,因而控制系统的设计也愈加困难。MATLAB 是国际最流行的控制系统计算机辅助设计语言和软件工具,该文在MATLAB7.0的基础上,通过S 函数,实现中央空调模糊控制器的优化和仿真。 关键词:MATLAB ;模糊控制;S 函数;中央空调 中图法分类号:TP316.89 文章标志码:A

0 引言

模糊控制是一种基于语言规则和模糊推理的控制方法,采用人类的语言语句表述,较为直观,也易于理解,可以对非线性、大惯性、大滞后对象以及难以建立数学模型的对象取得较好控制效果[1]。但由于模糊控制器设计过程中存在诸多主观因素,如隶属度确定、控制规则构造等,使得控制系统需要反复调试才能达到较好的鲁棒性和适应性。因此,利用计算机预先对模糊控制器进行仿真研究显得尤为重要。

1 基于MATLAB 的中央空调模糊控制器设计过程

MATLAB 将数值分析、矩阵计算、科学数据可视化以及非线型动态系统的建模和仿真等诸多强大功能集成在一个易于使用的视窗环境中,为科学研究、工程设计及众多学

科领域提供了一种简捷、高效的编程工具[2]

同时,MATLAB 是一个开放的系统,针对不同的学科,推出了不同的工具箱,从而大大扩展了其应用范围。目前,已推出的工具箱涉及学科从控制系统设计、系统辨识、模糊控制到信号处理等,非常丰富。

1.1 中央空调模糊控制器的设计过程

(1)确定语言变量

在FIS Editor 中单击菜单Edit/Add input,增加输入语言变量,并在下半部的右侧白框内分别输入“E”和“Ec”(温度误差和误差变化率);选中output 方框,在下半部的右侧白框内输入“U”。在下半部左侧为“与”、“或”、“蕴涵”、模糊规则的合成运算以及解模糊选择合适的方法,分别选择“min 极小”、“max 极大”、“min 极小”,“max 极大”、“centroid 面积重心法”。

(2)隶属度函数的建立

在FIS Editor 中单击菜单View/Edit mem-bership

function,弹出Membership Function Edi-tor 界面。

上半部分用于显示隶属度函数的图形,下半部分用于设定隶属度函数的参数。

为了实现模糊控制器的标准化设计,采用Mamdani 提出的处理方法。即将输入变量、输出变量的论域定为[-4,+4]

区间连续变化量,见图1所示。FIS Editor 离散化,构成含9个整数元素的离散集合{-4,-3,-2,-1,0,1,2,3,4},并将其分成5个等级{NB NS ZO PS PB }。每个等级对应一个Fuzzy 子集,[-4,+4]之间9个元素对应每个等级的隶属度可根据实际用隶属度函数模拟。

图1 模糊推理系统图形编辑器

(3)模糊规则的建立

通过模糊规则库编辑器确定“if…then”形式的模糊控制规则。本例中共有控制规则25条,每条规则的加权值缺省为1,推理算法为max-min 合成法,解模糊方法采用面积重心法。利用曲面观察器设计模糊控制器的输入、输出对应关系,由此进行修改和优化。见图2所示。

图2 曲面观察器

1.2 SIMULINK 仿真

———————————

作者简介:张 丽,河北工业大学电气与自动化学院,研究生,天津 300130

张朝轩,河北工业大学电气与自动化学院,研究生,天津 300130 丁宝苍,河北工业大学电气与自动化学院,研究生,天津 300130

Microcomputer Applications Vol. 25, No.8, 2009 技术交流 微型电脑应用 2009年第25卷第8期

·51·

SIMULINK 是一种用来对系统进行建模、动态仿真与分析的集成环境,用户可以利用它提供的功能众多的各种图形化模块方便地搭建系统,进行建模仿真[3]

。在SIMULINK

环境下,在其菜单中,选择Fuzzy Logic Toolbox 中的Fuzzy Logic Controller 模块,键入pid ,即建立起模糊控制器。

(1)空调系统模型 空气调节[4]

,就是把经过一定处理之后的空气,以一定方式送入室内,将室内空气的温湿度、流动速度和洁净度等控制在一定范围内。影响室内空气环境参数的变化,主要是

由以下两方面造成的。一是外部原因,如太阳辐射和外界气

候条件的变化:另一方面是内部原因,如室内人和设备产生

的热、湿和其它有害物质。当室内空气参数偏离了规定值时,就需要采取相应的空气调节措施和方法,使其恢复到规定的要求。

根据能量守恒定律,即单位时间内进入房间的能量减去单位时间内由房间流出的能量应等于房间内能量蓄存量的变化率,空调房间的长宽高为11m×5m×3.5m,则空调房间模型的数学方程式为

R t t q t t c L dt dt n n n s n ?++?=0)(C ρ (1)

C 为室内空气的热容量系数,L 为送风量,ρ为送风密

度,c 为比热,n t 为室内温度,0t 为室外环境的温度,n q 为室内散热量,R 为维护结构的总传热热阻。

现设定C t o n 25=,C t o s 18=,C t t o

)()4

sin(4320××+=π。 经过计算以及查阅相关的参考文献,确定空调房间的各送风参数如下

C =82.5s, kw k R /326.0=,3/2.1m kg =ρ,)/(01.1C kg kJ c o ?=。

根据空调房间模型的数学方程式,组成图3所示的空调房间的仿真模型。

图3 空调房间模型

2 中央空调模糊控制效果的改善

模糊逻辑控制技术经过近30年的发展已经在许多应用领域获得了成功,但是,不少人认为,模糊逻辑控制技术只适用于粗糙控制场合,对于高精度的控制问题,模糊逻辑控制技术的效果不理想,还得依赖经典控制或模糊逻辑控制技术与经典控制相结合的控制。 变论域模糊控制对控制规则和隶属度函数都没有过高的要求,因此对设计这样的模糊控制器就不需要过分依赖专

家知识和操作工经验。同时可以通过调整伸缩因子获得很好的动态和稳态性能,通过S 函数的介入对传统的模糊控制器

有所改善。 2.1 S 函数的介绍

S 函数又称系统函数,S 函数是对SIMULINK 功能的一种扩展,用户利用它可以创建所需的SIMULINK 模块。S

函数的编写可以使用MATLAB 的M 语言,或用C 语言编写后经MEX 工具生成[5]。 SIMULINK 与S 函数的接口靠S-Function 函数模块(即仿真模型的控制器)完成,图4显示S-Function 函数模块的参数设置界面。包括S 函数文件名和以SIMULINK 传递来

的参数,这些参数的次序、个数都要和S 函数第一行的参数变量一致。

图4 S-function 参数设置

2.2仿真结果及分析

本文利用SIMULINK ,将中央空调常规模糊控制、基

于S 函数可变论域的模糊控制放在一起进行仿真,

(见图5、图6)并比较最终的结果(见图7、图8)

图5 常规模糊控制器

图6 S-Function 模糊控制器

图7 常规模糊控制器仿真结果

·52

·

图8 S-Function 模糊控制器仿真结果

通过对温度的SIMNLINK 仿真可以发现,温度常规模糊控制存在振荡,采用论域可变的方法效果得到明显的改善。

3 结论

利用MATLABA 进行中央空调模糊控制系统设计,可以是设计过程变得简单,不需要进行大量的手工计算,而且可以灵活地改变控制系统的结构,优化模糊控制的效果。

采用论域可变的方法都可以有效地减少模糊控制的静差,而利用S 函数来实现论域可变的模糊控制,可以根据误差大小在线调整控制变量的论域,方便快捷。

参考文献

[1] 章卫国,杨向忠.模糊控制理论与应用[M].西安:西北工业

大学出版社,1999.

[2] 闻新,周露,李东江,贝超.MATLAB 模糊逻辑工具箱的分

析与应用[M].北京:科学出版社,2001.

[3] 王正林,王胜开,陈国顺.MATLAB/simulink 与控制系统仿

真[M].北京:电子工业出版社,2005.

[4]上海制冷学会,制冷与空气调节技术[M].上海:上海科学普

及出版社.1992.

[5] 姚俊,马松辉编著.Sinmulink 建模与仿真[M].西安:西安电

子科技大学出版社.2002.

(收稿日期:2008-11-20)

(上接第43页)

图2 稳压器第一组安全阀门仪控功能软件模块示意图

针对图1的仪控功能,按上述保护系统核级软件的模块化设计方法,我们采用信号处理部分实现稳压器压力的信号调理,具体通过次高选2.MAX 和次低选2.MIN 计算单元实现;采用逻辑处理部分实现定值器功能,具体通过MAX 和MIN 程序单元来实现,产生阀门螺线线圈的通断逻辑信号。针对图1中的四个冗余通道,根据局部符合原则,采用四取二运算处理冗余通道逻辑信号,实现逻辑处理。为了对仪控系统的运行状态进行监控,设计监控信息发送部分采集整个处理过程中的信号状态、参数等信息并将其传送到主控室。计算机输出的信号与多样性B 系统的输出信号线与后进入优先级选择模件,优先级选择模件的输出控制阀门螺线线圈的上下电,如图2所示。

在核电数字化仪控平台上(X86结构),按图2所示的设计对稳压器第一组安全阀门控制安全功能进行功能测试,软件的编译链接采用GCC (GNU Compiler Collection ,Linux 系统下的编译器),测试结果满足系统设计要求。

3 结束语

本文根据核电数字化仪控系统所实现的功能将核电站保护系统核级软件进行模块化设计,并分析了模块化设计在核级软件中的应用。为实现软件的透明性、准确性和一致性,除了运用成熟的设计方案、满足核电安全设计原则进行软件设计外,还必须对软件进行V&V 认证。模块化设计不仅更加容易的实现保护系统安全仪控功能,还能提高软件的可靠性;同时由于采用数字化设计,减少了运算放大器、继电器等模拟器件的使用,提高了核电站的经济性。合理的系统软件设计,保证了核电站数字化仪控系统,尤其是反应堆运行的高可靠性、安全性。

参考文献

[1] 王华金,刘立新,李谢晋等.核电站数字化反应堆保护系统

研究[ J ].核动力工程,2002,23(2):74-78.

[2] 晁平,郑明光.田湾核电站数字化安全级仪控系统结构与

性能研究[ J ].核电工程与技术,2003,(4):27-32.

[3] 唐涛,吴健.核电站的安全性[ J ].安全,2000,21(1):2-5. [4] 于文革,张志俭,黄卫刚等.大亚湾核电站反应堆保护系统

可靠性分析[ J ].核动力工程,2003,24(1):63-67.

[5] 余俊.现代设计方法及应用[M].北京:中国标准出版社,

2002.

[6] HAF102:核动力厂设计安全规定.国家核安全局,2004.

(收稿日期:2008-11-28)

LI Feng1, GUO Geng-qi1, Xu Ai-Jun2(1.Guangdong Communication Polytechnic, Guangzhou 510650, China;2.Guangzhou Institute Of Railway Technology, Guangzhou 510430, China)

Abstract: The first step to information security is the verify identity system. But the traditional verification has already out of date; the newly arisen bionic verification is blossoming. The bionic network is a security mechanism which bases on human’s physiology characteristic, it is the first defence line to guarantee network’s security .This article lay emphases on discussing the process of coding human’s physiology characteristic, and put forward the author’s view and opinion.

Keywords: Bionic network; Identity validation; Minutiae; Gray; Binarization

Detection of Buffer-OverFlow Based on GECISM (47)

CUI Jing1, LI Ning2, LI Fang 3(1. Computer Department of Ordnance Engineering College, Shijiazhuang 050003, China;2. Education Office of Ordnance Engineering College, Shijiazhuang 050003, China)

Abstract: Buffer-Overflow attacks has been the common and basic attack technology,and nowadays it is also the main direction of attack technology.The common method of buffer-overflow is to change the order of program execution in order to execute the code which is written by intruder.By this way,intruder can get the root access,and it willtake great threat to the system. The article constructs the DAE(Detecting and Eliminating)on the GECISM.The agent can detect intrusion with the rule which is formed by the RC4.5 Algorithm.

Keywords:Buffer-Overflow; System-Call; DAE agent; Detection; GECISM

Design and Simulation of Fuzzy Controller of Central Air-Conditioning Based on MATLAB (50)

ZHANG Li, ZHANG Chao-xuan, DING Bao-cang( School of Electrical engineering & Automation, Hebei University of Technology, Tianjin 300130,China)

Abstract: With the rapid development of control theory and system , the control of effect has been required more and more high, and control algorithms has been also more and more complex, control system design has become even more difficult. MATLAB is the most popular computer-aided control system design language and software tools. This article at the basis of MATLAB7.0 through the S function, achieve the optimization and simulation of fuzzy controller of central air-conditioning .

Keywords: MATLAB; Fuzzy control; S-Function; Central air-conditioning

Linux Transplantation Based on Processor of S3C2410 (53)

DENG Jun-Hua, DU Yu-Xiao(School of Automation, Guangdong University of technogy,Guangzhou 510006, China)

Abstract: This paper introduces the method and procedure of making Linux transplanted onto the target board based on the processor of S3C2410.First it says the transplanted method of embedded Linux,then it describes how to build up an environment for transplant,focusing on the framework and functionality of Bootloader and transplant of Linux kernel.This method proves high effective,the transplanted Linux in the embedded sysstem runs well. KeyWords: Embedded system; S3C2410 processor; Linux; Bootloader; Transplant

Learners’s Carden

Discussion of Domain Oriented Web Application Development Based on Grails (56)

ZHANG Hao, WANG Guang-xin(Information Technology Center, Jiujiang University, Jiujiang 332005, China)

Abstract: Domain oriented in enterprise web application development is discussed, and analysis and design of business tier are focused on. Domain Concept, objects in domain tier and their life cycle is introduced. Four design model that Fowler proposed are compared. After that, Thinking, Concept and Structure of the ROR-like Grails application framework is introduced. In the end, by introducing implement of one case, Procedure of domain oriented development using Grails is showed detaily, which offers reference to the design and development of Web application system with Grails. Keywords: Grails; Java; Spring hibernate

Implementation and Simple Application of Embedded Linux File System (59)

LIANG Lian-guan, ZHANG Hui-feng, XIE Qing-yan, WANG Jun-hui(College of Automation Science and Engineering, South China University of Technology, GuangZhou 510640, China)

Abstract: Root file system plays a key role in the embedded Linux system. This paper describes the implementation and application of root file system based on gec2410 development platform, and successfully designes a cramfs root file system which can automatically execute Qt application program. Finally, the operation situation of the file system designed is verified.

Keywords: root file system;cramfs;Busybox;Qt application program

Data Mining Technology Used in Course Selection System (61)

JIANG Yong-liang, FU Chuan-yi(Department of Information Technology, Qiongtai Normal College, Haikou 571100, China )

Abstract: Data mining is a process from which potential and useful information that hidden in mass data can be developed .If we can apply the association rules into the class selection system and mine the hidden and useful knowledge from the credit database,the correlations among different classes can be found. The correlations will give an effective help to teaching staffs to guide students to select their courses.

Keywords : Data mining; Apriori algorithm; Course selection system; Frequent item sets

Embedded Software Testing Platform Based on SOA (63)

LIU Xue1,YANG Ming2,MENG Wei3(1.Xi’an 863 software Incubator Co., Ltd., Xi'an 710075, China;2. School of Economy and Management of Xidian University, Xi'an 710071, China;3.Xi'an Software Engineering Research Center, Xi'an 710075, China) Abstract: The embedded software performance more complex, the quality of software for the ultimate embedded product quality played a decisive role. Embedded software testing ensures the quality of an embedded product. Embedded software testing platform to raise test efficiency and reduce the cost of testing. Firstly in this paper the concepts, and developing mode of Service-Oriented Architecture (SOA) are presented, then a new method to realize embedded software testing platform by realizing The Distributed Simulation Testing Environment (DSTE) is brought forward, so it can save memory resource of embedded system and be suitable to the cross test process of the embedded software.

Keywords: Service-oriented architecture; Distributed simulation testing environment; Embedded software testing platform

Address:1954 Huashan R d.,Shanghai,P.R. China

Zip Code:200030

Tel:86-21-62933230 Fax:86-21-62933230

Email:smcaa@https://www.360docs.net/doc/f17990717.html, URL:http//https://www.360docs.net/doc/f17990717.html,

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

相关文档
最新文档