web-based monitoring and control for bas using multi-protocol converter with embedded linux

26
Web-Based Monitoring and Con trol for BAS Using Multi-Pro tocol Converter with Embedded Linu x 带带带带带 Linux 带带带带带带带带 带带带带带带带带带带 (BAS) 带带带

Upload: tanek-cooper

Post on 03-Jan-2016

45 views

Category:

Documents


1 download

DESCRIPTION

Web-Based Monitoring and Control for BAS Using Multi-Protocol Converter with Embedded Linux. 带有嵌入式 Linux 的多协议转换器的 基于网络的楼宇自动化 (BAS) 监控系统. SUMMARY. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Web-Based Monitoring and Control for BAS Using Multi-Protocol Converter with Embedded Linux

Web-Based Monitoring and Control for BAS Using Multi-Protocol

Converter with Embedded Linux

带有嵌入式 Linux 的多协议转换器的基于网络的楼宇自动化 (BAS)

监控系统

Page 2: Web-Based Monitoring and Control for BAS Using Multi-Protocol Converter with Embedded Linux

SUMMARY   本文描述了一种适用于楼宇网络的基于 Web 的管理

系统。开发了一种基于 SoC 和嵌入式 Linux 的多协议转换器。它要求一种适当的操作系统来处理协议和一种类似于嵌入式 Linux 的高级的开发环境。这种多协议转换器通过 TCP/IP 协议或 Java 程序的客户机结合 RS-485 和 LonWorks 设备的控制网络到BAS 中。系统包括三层结构, BAS 或客户机,一个多协议转换器和控制设备。为了比较系统体系结构的可行性,将系统应用于一个小型的 BAS 系统中。通过使用 UML ,我们模拟了一个基于 Web 的带有统一标准的 TCP/IP 套接字通讯和系统架构的控制系统。开发的这个系统包含有采用 modbus 在 RS-485 网络中的逆变器电机控制系统。实验的结果表明使用嵌入式 Linux 的多协议转换器是一个建立基于 Web 的监控系统的灵活的高效的方法。

Page 3: Web-Based Monitoring and Control for BAS Using Multi-Protocol Converter with Embedded Linux

key words: remote monitoring and control,  web-based control,   embedded system,   LonWorks network,   BAS

关键词:远程监控, web-based ,嵌入式系统, LonWorks 网络, BAS 。

Page 4: Web-Based Monitoring and Control for BAS Using Multi-Protocol Converter with Embedded Linux

1.   Introductin

因为后 PC 时代的技术,嵌入式系统这个术语开始流行。从信息技术的角度来看,嵌入式系统可以定义为为了完成特定功能而设计电子控制系统,并在其上安装计算机系统。

近来,由于 Internet 的和嵌入式系统的迅速发展,嵌入式系统现在是随处可见。嵌入式操作系统可以管理日益复杂的系统资源和虚拟的硬件并使能不用定制的功能库,驱动等等。

Page 5: Web-Based Monitoring and Control for BAS Using Multi-Protocol Converter with Embedded Linux

本文中,我们开发了一个多协议的转换器来使用BAS 连接控制设备和传感器网络,而其 CPU 是一个片上系统 System on a Chip(SOC) 并运行了嵌入式 Linux 。控制节点由 LonWorks 执行,包括空气调节器,泵,温度传感器,照度传感器,七段 LED 显示。

它支持 RS-485 工业控制器通讯。工业控制器为一个变极器驱动的 AC 电机。 Modbus 协议由控制节点在多协议转换器中连接 RS485 实现来保持标准协议的实现。这样的网络应用于也可以像用在控制器中一样应用于控制设备。

Page 6: Web-Based Monitoring and Control for BAS Using Multi-Protocol Converter with Embedded Linux

为了整合常见的 BAS 到多协议转换器中,我们详细说明了 TCP/IP 协议。因此,多协议转换器可以将从 LonWorks 和 RS485 网络中获得的数据通过TCP/IP 协议轻松地转换到 BAS 中,这样一来,它就是一个建立不同的现场数据协议的分布式网络的灵活的体系结构。

相比于集中控制界面的典型的 BAS 系统,它由标准和 TCP/IP 协议和多协议转换器连接多个网络设备来实现。因此,这个系统可以满足协同工作的要求。

Page 7: Web-Based Monitoring and Control for BAS Using Multi-Protocol Converter with Embedded Linux

另一种使用多协议转换器的架构是不带有常见的 BAS 的基于 web 的系统,如图 1 所示。

为了开发这个系统,我们将嵌入式 web 服务引入到多协议转换器中。在这种情况下,系统成为三层的客户机—服务器体系结构。

近来,基于 web 的监控系统广泛应用了 Internet 技术来透明地访问控制设备,这些设备的 web 服务是由工作站或 PC 服务器来实现的。

可是我们设计了一个基于嵌入式 Linux 的嵌入式 web 服务器,它包含了应用在工业和建筑自动化领域的多种协议。

为了实现基于 web 的控制系统,用 Java 程序代替了公共网关接口 Common Gateway Interface(CGI) ,在此,实现了 Java 套接字程序和图形用户界面 Graphic User Interface(GUI) 。

Page 8: Web-Based Monitoring and Control for BAS Using Multi-Protocol Converter with Embedded Linux

图 1 展示了多协议转换器可以与 BAS 实现互联,并可以应用于不带有典型的 BAS 的基于 web 的控制系统。

Page 9: Web-Based Monitoring and Control for BAS Using Multi-Protocol Converter with Embedded Linux

2. Multi_protocol   Converter

为实现对控制网络的有效管理,开发一种多协议转换器,如表1 ,它包括两个 CPU ,一个基于 ARM7TDMI核的 S3C4530A芯片,使用嵌入式 Linux 和控制外设。另一个是支持 LonWorks 协议的神经元芯片。

第一部分基于 ARM 的片上系统设计用于连接 TCP/IP , RS485 , RS232C 和 LonWorks 协议。

Page 10: Web-Based Monitoring and Control for BAS Using Multi-Protocol Converter with Embedded Linux

图 2 展示了多协议转换器的设备图和组件构成。图中的多协议转换器包括两个 CPU ,神经元芯片和 S3C4530 。还需要硬件接口来在两个 CPU之间传送数据。这可以通过数据位并行通讯或者共用 DPRAM存储器来实现。我们使用 DPRAM 来传送由控制器中采集并转换为 TCP/IP 协议支持的的数据。

Page 11: Web-Based Monitoring and Control for BAS Using Multi-Protocol Converter with Embedded Linux

3. 嵌入式 Linux使用 ARM7TDMI 的 S3C4530 就是没有存储

器管理单元 (MMU) 的片上系统, uClinux 是Linux内核为没有 MMU 的 CPU扩展的实时操作系统。

本文选择 uClinux2.4内核,因为我们使用没有 MMU 的 S3C4530 的 CPU 。图 3 显示启动的代码,它通常由汇编语言来实现,并需要进行以下工作:

Page 12: Web-Based Monitoring and Control for BAS Using Multi-Protocol Converter with Embedded Linux

- 定义进入点 defining the entry point - 设定系统配置 system configuration 和 PLL(锁相环 ) -初始化串口 initializing the serial ports -初始化内存印象图 memory map - 将 ROM 的内容复制给 RAM 并设定初始堆栈 initial stack - 设定结构类型 architecure type -跳转到 Linux(启动内核 start kernel)

Page 13: Web-Based Monitoring and Control for BAS Using Multi-Protocol Converter with Embedded Linux

4.   Local Network Devices

3.1 LonWork Control DevicesLonwork 是一种通讯协议,作为标准协议

用于楼宇自动化系统和采用神经元芯片的控制网络。本文中实现 LonWorks 节点设备使用神经元芯片来构成分布式控制网络。节点控制器由实现多种控制对象的 LonWorks 硬件和接口电路来开发。

Page 14: Web-Based Monitoring and Control for BAS Using Multi-Protocol Converter with Embedded Linux

如图 4 所示接口电路根据存储器印象图来处理外设 I/O 。

图 5 中的控制节点通过采用增加了接口逻辑的 LonWorks 控制模块来实现。

Page 15: Web-Based Monitoring and Control for BAS Using Multi-Protocol Converter with Embedded Linux

5. Software Structure of LonWorks Network

LonWorks 的程序由基于事件驱动的神经元芯片的程序完成。网络和 I/O口的数据类型也可知。;了与 LonWorks进行通讯,分散的控制节点通过互相的连接与网络的捆绑来进行通信。图 6 描述了一个例子,在多协议器的输出网络变量定义为分段数据和空气调节器的控制。节点 TEMP 和 LUX用于获得由 A/D 转换器转换的温度和照度传感器的数据。

Page 16: Web-Based Monitoring and Control for BAS Using Multi-Protocol Converter with Embedded Linux

图 6 描述了一个例子,在多协议器的输出网络变量定义为分段数据和空气调节器的控制。节点 TEMP 和 LUX 用于获得由 A/D转换器转换的温度和照度传感器的数据。

Page 17: Web-Based Monitoring and Control for BAS Using Multi-Protocol Converter with Embedded Linux

6. Java Applet

对于一个基于 web 的系统,运用了 Active Server Page , PHP 和 Java Script Program 等脚本语言。但是脚本语言对于嵌入式系统来说是相当繁重的,所以使用 CGI 。

CGI 是基于客户机的 POP 和服务器的 PUSH 机制和各种丰富语言的支持的,问题是其运行的环境。 CGI 的应用程序运行在嵌入式系统中并不适用于资源非常有限的资源。

但是我们采用了 Java 程序, Java 程序并不需要脚本语言和运行环境在客户机上而不是服务器所以没有资源的限制。 Java 程序从服务器上下载到客户机并运行,这样在服务器端则没有过多的负载。

Page 18: Web-Based Monitoring and Control for BAS Using Multi-Protocol Converter with Embedded Linux

下图是 Java 程序的运行机制。 HTML 文件包含了嵌入式系统需要的程序。一旦浏览器从客户机中打开 HTML 文件, Java 程序上载到客户机并将在客户机中以 JVM 运行。

Page 19: Web-Based Monitoring and Control for BAS Using Multi-Protocol Converter with Embedded Linux

图 15 展示了设计的 Java 程序的结构,当载入到客户机后,先调用 init()函数进行初始化。然后执行 start()函数来运行用户界面如 16 图示,使 Java 套接字与网络服务器程序连接起来。

Page 20: Web-Based Monitoring and Control for BAS Using Multi-Protocol Converter with Embedded Linux

当这个连接建立后,用户就可以通过图形用户界面来控制网络中的设备。

当有用户单击动作时, mouseclicked()事件使用 Java 套接字通过 TCP/IP 协议发送命令到多协议转换器。

所有的图形对象都由事件柄进行定义。因此,我们可以轻易的处理底层的网络设备,而不需要其它的应用程序和常规的 BAS 。

当程序终端发送了终止命令到网络服务器时,调用destory()函数来关闭客户机的套接字连接。

Page 21: Web-Based Monitoring and Control for BAS Using Multi-Protocol Converter with Embedded Linux

7.Conclusion

 在本文中我们设计了一个有用的基于 web 的 BAS 。完成了一个多协议转换器和网络设备。

在这个多协议转换器中,使用 S3C4530 为主 CPU ,并应用嵌入式 Linux 和嵌入式 web 服务器来建立一个实用基于 web 的 BAS平台。

为了整合多种协议,使用了网络接口电路,神经元芯片, RS485 和以太网。

S3C4530 和神经元芯片通过 DPRAM 来通信。 也完成了诸如电机控制器和基于 LonWorks 设备

的控制节点。

Page 22: Web-Based Monitoring and Control for BAS Using Multi-Protocol Converter with Embedded Linux
Page 23: Web-Based Monitoring and Control for BAS Using Multi-Protocol Converter with Embedded Linux
Page 24: Web-Based Monitoring and Control for BAS Using Multi-Protocol Converter with Embedded Linux
Page 25: Web-Based Monitoring and Control for BAS Using Multi-Protocol Converter with Embedded Linux
Page 26: Web-Based Monitoring and Control for BAS Using Multi-Protocol Converter with Embedded Linux