CN107203201A - Elevator monitoring method based on CAN - Google Patents
Elevator monitoring method based on CAN Download PDFInfo
- Publication number
- CN107203201A CN107203201A CN201710506995.2A CN201710506995A CN107203201A CN 107203201 A CN107203201 A CN 107203201A CN 201710506995 A CN201710506995 A CN 201710506995A CN 107203201 A CN107203201 A CN 107203201A
- Authority
- CN
- China
- Prior art keywords
- elevator
- data
- module
- monitoring method
- alarm
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000012544 monitoring process Methods 0.000 title claims abstract description 51
- 238000000034 method Methods 0.000 title claims abstract description 27
- 238000004891 communication Methods 0.000 claims abstract description 15
- 230000006870 function Effects 0.000 claims description 69
- 238000013528 artificial neural network Methods 0.000 claims description 17
- 230000001133 acceleration Effects 0.000 claims description 15
- 238000012545 processing Methods 0.000 claims description 13
- 230000002159 abnormal effect Effects 0.000 claims description 8
- 230000005540 biological transmission Effects 0.000 claims description 7
- 230000004913 activation Effects 0.000 claims description 5
- 230000009977 dual effect Effects 0.000 claims description 3
- 238000005070 sampling Methods 0.000 claims description 2
- 238000013507 mapping Methods 0.000 claims 1
- 238000012549 training Methods 0.000 description 24
- 238000013461 design Methods 0.000 description 21
- 238000007726 management method Methods 0.000 description 21
- 238000010586 diagram Methods 0.000 description 16
- 238000004422 calculation algorithm Methods 0.000 description 12
- 238000013523 data management Methods 0.000 description 7
- 238000006243 chemical reaction Methods 0.000 description 6
- 230000008569 process Effects 0.000 description 6
- 238000007418 data mining Methods 0.000 description 5
- 238000012937 correction Methods 0.000 description 4
- 238000007689 inspection Methods 0.000 description 4
- 238000012423 maintenance Methods 0.000 description 4
- 238000003062 neural network model Methods 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 2
- 238000013500 data storage Methods 0.000 description 2
- 238000001514 detection method Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 238000007781 pre-processing Methods 0.000 description 2
- 238000012360 testing method Methods 0.000 description 2
- 230000009466 transformation Effects 0.000 description 2
- 230000001960 triggered effect Effects 0.000 description 2
- 241000272194 Ciconiiformes Species 0.000 description 1
- 238000012897 Levenberg–Marquardt algorithm Methods 0.000 description 1
- 230000005856 abnormality Effects 0.000 description 1
- 230000009471 action Effects 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000004140 cleaning Methods 0.000 description 1
- 239000013078 crystal Substances 0.000 description 1
- 238000007405 data analysis Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000008571 general function Effects 0.000 description 1
- 238000003780 insertion Methods 0.000 description 1
- 230000037431 insertion Effects 0.000 description 1
- 239000011159 matrix material Substances 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 238000004088 simulation Methods 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B23/00—Testing or monitoring of control systems or parts thereof
- G05B23/02—Electric testing or monitoring
- G05B23/0205—Electric testing or monitoring by means of a monitoring system capable of detecting and responding to faults
- G05B23/0218—Electric testing or monitoring by means of a monitoring system capable of detecting and responding to faults characterised by the fault detection method dealing with either existing or incipient faults
- G05B23/0224—Process history based detection method, e.g. whereby history implies the availability of large amounts of data
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B2219/00—Program-control systems
- G05B2219/20—Pc systems
- G05B2219/24—Pc safety
- G05B2219/24065—Real time diagnostics
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Automation & Control Theory (AREA)
- Maintenance And Inspection Apparatuses For Elevators (AREA)
Abstract
Description
技术领域technical field
本发明涉及电梯监控方法,具体涉及基于CAN总线的电梯监控方法。The invention relates to an elevator monitoring method, in particular to an elevator monitoring method based on CAN bus.
背景技术Background technique
目前电梯监控系统多数只能针对几个特定的电梯型号,对故障率较高的早期电梯兼容不好,造成只能覆盖一部分的情况。At present, most elevator monitoring systems can only target a few specific elevator models, and are not compatible with early elevators with a high failure rate, resulting in only a part of the coverage.
现有的国产电梯监控系统界面一般都比较简陋,许多是直接使用组态软件制作的,而组态软件并不适合做用户交互界面良好的应用程序。The interfaces of the existing domestic elevator monitoring systems are generally relatively simple, and many of them are made directly by using configuration software, and the configuration software is not suitable for applications with good user interface.
目前国内大部分电梯监控系统是不带有数据库的,只是提供了基础的实时监控功能以及报警功能,这样的系统可扩展能力就比较差了,难以在其上进行更高层次的对电梯的情况进行分析,电梯监控系统即使带有数据库的,也仅仅是研发了一些简单的功能,如历史记录查询、故障情况分布等。At present, most elevator monitoring systems in China do not have a database, but only provide basic real-time monitoring functions and alarm functions. Such a system has poor scalability, and it is difficult to perform higher-level monitoring of elevator conditions on it. According to the analysis, even if the elevator monitoring system has a database, it has only developed some simple functions, such as historical record query, fault distribution, etc.
发明内容Contents of the invention
本发明设计开发了基于CAN总线的电梯监控方法,本发明的发明目的之一是采用现场总线作为通信载体实现电梯监控系统,减少传送误差,对数据进行实时存储与监控。The present invention designs and develops the elevator monitoring method based on the CAN bus. One of the invention objectives of the present invention is to use the field bus as a communication carrier to realize the elevator monitoring system, reduce transmission errors, and store and monitor data in real time.
本发明的发明目的之二是采用BP神经网络算法完成电梯监控系统的主动式报警,减少因电梯引发的事故。The second invention purpose of the present invention is to adopt the BP neural network algorithm to complete the active alarm of the elevator monitoring system, so as to reduce the accidents caused by the elevator.
本发明提供的技术方案为:The technical scheme provided by the invention is:
基于CAN总线的电梯监控方法,包括:The elevator monitoring method based on CAN bus, including:
CAN总线通信电路,包括至少一个CAN控制器和CAN收发器;CAN bus communication circuit, including at least one CAN controller and CAN transceiver;
主控制器,其连接所述CAN总线通信电路,能够监测所述电梯的工作状态;a main controller, which is connected to the CAN bus communication circuit and can monitor the working state of the elevator;
信号采集模块,其能够进行数据采集和实现与所述CAN总线通信电路之间的通信功能;A signal acquisition module, which can perform data acquisition and realize the communication function with the CAN bus communication circuit;
报警模块,其连接所述主控制器,能够对所述电梯的工作状态异常进行报警。An alarm module, which is connected to the main controller, can alarm the abnormal working state of the elevator.
优选的是,所述信号采集模块中设置拨码开关,所述信号采集模块通过对所述拨码开关进行读取后将数据和所述信号采集模块采集的数据与所述CAN总线通信电路之间的通信功能。Preferably, a dial switch is set in the signal acquisition module, and the signal acquisition module connects the data and the data collected by the signal acquisition module with the CAN bus communication circuit after reading the dial switch. communication function between them.
优选的是,还包括:后台功能模块,其用于监听所述CAN总线通信电路的传输数据。Preferably, it also includes: a background function module, which is used to monitor the transmission data of the CAN bus communication circuit.
优选的是,所述后台功能模块包括:Preferably, the background function module includes:
主动式报警模块,其用于判断电梯是否具有故障风险;An active alarm module, which is used to judge whether the elevator has a failure risk;
主界面模块,其用于刷新电梯的工作状态;Main interface module, which is used to refresh the working status of the elevator;
报警监控模块,其用于判断电梯工作是否异常。The alarm monitoring module is used for judging whether the elevator works abnormally.
优选的是,所述信号采集模块中设置定时器。Preferably, a timer is set in the signal acquisition module.
优选的是,所述CAN收发器为CTM1050T芯片。Preferably, the CAN transceiver is a CTM1050T chip.
优选的是,所述报警模块为GSM报警模块。Preferably, the alarm module is a GSM alarm module.
优选的是,其特征在于,采用BP神经网络对电梯进行预警,包括如下步骤:Preferably, it is characterized in that, adopting BP neural network to carry out early warning to elevator, comprises the steps:
步骤一、按照采样周期,采集数据包括电梯载重、轿厢开关门噪声、曳引机三项电流、曳引机三项电压、垂直振动加速度、水平振动加速度、垂直方向加速度、垂直方向减速度、电梯主机电动机温度、紧急制动器线圈温度以及机房温度;Step 1. According to the sampling period, the collected data includes elevator load, car door opening and closing noise, three currents of the traction machine, three voltages of the traction machine, vertical vibration acceleration, horizontal vibration acceleration, vertical acceleration, vertical deceleration, Elevator host motor temperature, emergency brake coil temperature and machine room temperature;
步骤二、将上述信号进行处理,所述电梯载重、轿厢开关门噪声、曳引机三项电流、曳引机三项电压、垂直振动加速度、水平振动加速度、垂直方向加速度以及垂直方向减速度通过S型隶属函数进行数据处理,所述电梯主机电动机温度、紧急制动器线圈温度以及机房温度通过高斯型隶属函数进行数据处理,确定三层BP神经网络的输入层节点;Step 2: Process the above signals, the elevator load, car door opening and closing noise, three currents of the traction machine, three voltages of the traction machine, vertical vibration acceleration, horizontal vibration acceleration, vertical acceleration and vertical deceleration Carry out data processing by S-type membership function, described elevator host motor temperature, emergency brake coil temperature and machine room temperature carry out data processing by Gaussian-type membership function, determine the input layer node of three-layer BP neural network;
步骤三、所述输入层向量映射到隐藏层,所述隐藏层向量Y={Y1,Y2,……,Yh};h为隐藏层节点个数;Step 3, the input layer vector is mapped to the hidden layer, the hidden layer vector Y={Y 1 , Y 2 ,...,Y h }; h is the number of nodes in the hidden layer;
步骤四、得到输出层节点T={T1,T2,T3,T4,T5,T6};其中,T1为电梯曳引机故障系数,T2为回路故障系数,T3为门机故障系数,T4为电梯控制器故障系数,T5为三相电源输入单元故障系数,T6为变频器故障系数。Step 4: Get the output layer node T={T 1 , T 2 , T 3 , T 4 , T 5 , T 6 }; among them, T 1 is the failure coefficient of the elevator traction machine, T 2 is the circuit failure coefficient, and T 3 is the failure coefficient of the door machine, T 4 is the failure coefficient of the elevator controller, T 5 is the failure coefficient of the three-phase power input unit, and T 6 is the failure coefficient of the inverter.
优选的是,在所述步骤三中,所述隐藏层节点个数h满足,其中,n′i为输入层节点数,n′0为输出层节点数,c为1~10之间的数。Preferably, in said step 3, the number h of said hidden layer nodes satisfies, Among them, n' i is the number of nodes in the input layer, n' 0 is the number of nodes in the output layer, and c is a number between 1 and 10.
优选的是,所述隐藏层激活函数为双曲正切函数,所述输出层激活函数为非线性对数S型函数。Preferably, the activation function of the hidden layer is a hyperbolic tangent function, and the activation function of the output layer is a nonlinear logarithmic Sigmoid function.
本发明与现有技术相比较所具有的有益效果:Compared with the prior art, the present invention has the beneficial effects:
1、本发明现场总线作为通信载体实现由计算机管理的电梯监控系统,可以将不同产品或者不同厂家的产品通过现场总线连接在一起,现场总线使用数字信号进行传输,一般带有仲裁与错误检测等能力,可以有效的减少传送误差;1. The field bus of the present invention realizes the elevator monitoring system managed by the computer as a communication carrier, and different products or products of different manufacturers can be connected together through the field bus. The field bus uses digital signals for transmission, generally with arbitration and error detection, etc. Ability to effectively reduce transmission errors;
2、本发明对电梯信号采集系统采集到的信号进行存储与监控,完成对电梯的实时监控,可以高效的完成故障报警功能,完成历史数据分析功能;2. The present invention stores and monitors the signals collected by the elevator signal acquisition system, completes the real-time monitoring of the elevator, can efficiently complete the fault alarm function, and complete the historical data analysis function;
3、本发明采用BP神经网络的数据挖掘算法,用于完成电梯监控系统的主动式报警功能,采用数据挖掘来分析某些事物潜在的发展趋势和隐患,可以大大减少因电梯引发的事故。3. The present invention adopts the data mining algorithm of BP neural network to complete the active alarm function of the elevator monitoring system, and uses data mining to analyze potential development trends and hidden dangers of certain things, which can greatly reduce accidents caused by elevators.
附图说明Description of drawings
图1为本发明所述的电梯监控系统框架图。Fig. 1 is a frame diagram of an elevator monitoring system according to the present invention.
图2为本发明所述的电梯监控系统底层信号图。Fig. 2 is a bottom signal diagram of the elevator monitoring system according to the present invention.
图3为本发明所述的电梯监控系统的后台功能模块图。Fig. 3 is a background functional module diagram of the elevator monitoring system according to the present invention.
图4为本发明所述的CAN总线网络拓扑结构图。Fig. 4 is a CAN bus network topology diagram according to the present invention.
图5为本发明所述的电梯监控系统信号截图示意图。Fig. 5 is a schematic diagram of a signal screenshot of the elevator monitoring system according to the present invention.
图6为本发明所述的信号获取器模块构成图。Fig. 6 is a block diagram of the signal acquirer module of the present invention.
图7为本发明所述的CAN总线部分电路图。FIG. 7 is a partial circuit diagram of the CAN bus according to the present invention.
图8为本发明所述的界面图。Fig. 8 is an interface diagram of the present invention.
图9为本发明所述的参数界面图。Fig. 9 is a parameter interface diagram of the present invention.
图10为本发明所述的三层神经网络的结构图。Fig. 10 is a structural diagram of a three-layer neural network according to the present invention.
图11为本发明所述的BP神经网络传播算法流程图。Fig. 11 is a flow chart of the BP neural network propagation algorithm of the present invention.
具体实施方式detailed description
下面结合附图对本发明做进一步的详细说明,以令本领域技术人员参照说明书文字能够据以实施。The present invention will be further described in detail below in conjunction with the accompanying drawings, so that those skilled in the art can implement it with reference to the description.
如图1所示,电梯监控系统框架图。本发明采用现场总线作为通信载体实现由计算机管理的电梯监控系统,电梯作为被监控的主体,控制中心运行在计算机中,借助计算机的运算能力对电梯运行情况监控,当判断电梯情况异常时,可以通过一定的手段通知管理人员或者是电梯维护人员对异常进行处理。电梯信号获取器获取到信息后,需要将其打包,封装成一个数据包,通过CAN总线收发模块发送到CAN总线网络中。在计算机上,存在着一个接入到CAN总线网络中的CAN总线模块,该模块会收集数据包,并通过串口发送至计算机中。As shown in Figure 1, the frame diagram of the elevator monitoring system. The present invention adopts the field bus as the communication carrier to realize the elevator monitoring system managed by the computer, the elevator is the main body to be monitored, the control center runs in the computer, and the operating condition of the elevator is monitored with the help of the computing power of the computer. When the elevator is judged to be abnormal, it can Notify the management personnel or elevator maintenance personnel through certain means to deal with the abnormality. After the elevator signal acquirer obtains the information, it needs to be packaged into a data packet and sent to the CAN bus network through the CAN bus transceiver module. On the computer, there is a CAN bus module connected to the CAN bus network, which will collect data packets and send them to the computer through the serial port.
如图2所示,系统底层信号获取器构成。电梯监控系统的底层服务是指CAN网络及以下的所有服务。它为系统上层提供电梯的运行数据,主要的实现部分为信号获取器,本发明设计的电梯监控系统主要是针对老旧电梯的,因为它们的型号不一,支持的功能也不一样,输入输出口的设计也不一样,为了解决这个问题,本设计在信号获取器上加了一个可以用于配置电梯型号的拨码开关,信号获取器可以通过对拨码开关进行读取,而后与采集数据一起上传,由上层的计算机后台服务去确定每一个引脚的含义。As shown in Figure 2, the signal acquirer at the bottom of the system is composed. The underlying service of the elevator monitoring system refers to all services on the CAN network and below. It provides the operating data of the elevator for the upper layer of the system. The main implementation part is the signal acquirer. The elevator monitoring system designed in the present invention is mainly aimed at old elevators, because their models are different and the functions they support are also different. Input and output The design of the port is also different. In order to solve this problem, this design adds a dial switch that can be used to configure the elevator model on the signal acquirer. The signal acquirer can read the dial switch and then communicate with the collected data. Upload together, and the upper computer background service will determine the meaning of each pin.
如图3所示,后台功能模块框图,后台功能模块入口为串口监听,它负责监听CAN总线网络上传来的数据。数据上传后,配置表管理器会从读取配置,并赋予上传的数据具体意义,由数据整理模块整理完毕后,会交由数据存储模块存储进数据库。As shown in Figure 3, the block diagram of the background function module, the entrance of the background function module is a serial port monitor, which is responsible for monitoring the data uploaded from the CAN bus network. After the data is uploaded, the configuration table manager will read the configuration from and give specific meaning to the uploaded data. After the data sorting module finishes sorting, it will be stored in the database by the data storage module.
数据整理模块同时会将数据交给数据分发模块,数据分发模块会将数据交给需要该数据的模块,一共有三个,分别是主动式报警模块、主界面以及报警监控。主动式报警模块后台会根据电梯的历史数据判断电梯是否有故障的风险;主界面用于刷新电梯的工作状态;报警监控模块会根据报警管理器的参数判定电梯工作是否异常,如果异常,则根据报警管理器提供的联系方式生成报警信息,并调用GSM驱动发出警报,GSM用于驱动一个GSM报警器,报警器支持TTS技术,能够将文字转换成语音在电话时播放。The data sorting module will also deliver the data to the data distribution module, and the data distribution module will deliver the data to the modules that need the data. There are three in total, namely the active alarm module, the main interface and the alarm monitoring. The background of the active alarm module will judge whether the elevator has a risk of failure according to the historical data of the elevator; the main interface is used to refresh the working status of the elevator; the alarm monitoring module will judge whether the elevator is working abnormally according to the parameters of the alarm manager, if abnormal, then according to The contact information provided by the alarm manager generates alarm information, and calls the GSM driver to issue an alarm. GSM is used to drive a GSM alarm. The alarm supports TTS technology, which can convert text into voice and play it on the phone.
主界面可以创建三个后台子模块,分别是用户权限管理器,用于处理用户管理方面的后台逻辑;数据查询结果生成器,用于为数据查询提供数据支持;报警管理器,用于管理用户设置的各项阈值以及管理人员联系方式。The main interface can create three background sub-modules, which are the user authority manager, which is used to handle the background logic of user management; the data query result generator, which is used to provide data support for data query; the alarm manager, which is used to manage users The thresholds set and the contact information of the management personnel.
如图4所示,多CAN总线网络拓扑结构,一个计算机可以接受多个CAN总线网络的数据,每个CAN总线网络都是一个星型网络,这种网络拓扑方式能在一定程度上提升CAN总线网络的稳定性以及避免网络拥堵的情况出现。As shown in Figure 4, the multi-CAN bus network topology structure, a computer can accept data from multiple CAN bus networks, and each CAN bus network is a star network. This network topology can improve the CAN bus network to a certain extent. The stability of the network and the avoidance of network congestion.
如图5所示,电梯监控系统信号截取示意图,本发明的电梯监控系统是基于现有的电梯系统之上的系统,所以先抽象出大部分电梯的运行方式,并在此基础之上,寻找一个合适的插入点,将电梯监控系统插入到正常的电梯系统之中,实现对电梯的运行情况的监控。As shown in Figure 5, the signal interception diagram of the elevator monitoring system, the elevator monitoring system of the present invention is based on the system above the existing elevator system, so first abstract the operating mode of most elevators, and on this basis, find A suitable insertion point is to insert the elevator monitoring system into the normal elevator system to monitor the operation of the elevator.
如图6所示,信号获取器模块构成图,信号采集器的功能是对外界输入的信号进行采集,采集的信号可能是模拟信号也可能是数字信号,信号采集器对不同的输入口进行不同的处理。使用一个拨码开关确定配置,之后将采集到的信息以及配置编号送入到信号转换器中。As shown in Figure 6, the structure diagram of the signal acquirer module, the function of the signal acquirer is to collect the signal input from the outside world, the collected signal may be an analog signal or a digital signal, and the signal acquirer performs different functions for different input ports. processing. Use a DIP switch to determine the configuration, and then send the collected information and configuration number to the signal converter.
信号采集器内部存在着一个定时器,用作定时循环扫描每一个输入口,当扫描完一遍后,会再次定时,等待下一次扫描。除此之外,还有一个拨码开关管理器,这个管理器的主要功能是确定采集到的信息究竟是哪种类别的信息,在系统中维护有一张表,划分出了使用不同的配置项,扫描信息加上配置项才可以得到信息的具体意义。There is a timer inside the signal collector, which is used to scan each input port in a regular cycle. After scanning once, it will be timed again and wait for the next scan. In addition, there is a DIP switch manager. The main function of this manager is to determine what type of information the collected information is. There is a table maintained in the system, which divides the configuration items used for different configuration items. , scan the information and add configuration items to get the specific meaning of the information.
数据转换器只有一个功能就是完成将信息转变成标准格式数据包的操作。数据包的格式设计如表1所示;The only function of a data converter is to complete the operation of converting information into standard format data packets. The format design of the data packet is shown in Table 1;
表1数据包的格式设计Table 1 Format design of data packet
配置编号是用于告知服务器本信号获取器配置的,数据说明是用于节省A/D转换通道采集到的数据的占用空间的。The configuration number is used to inform the server of the configuration of the signal acquirer, and the data description is used to save the occupied space of the data collected by the A/D conversion channel.
CAN总线接口模块是为单片机提供对外通信的模块,该模块仅仅负责初始化CAN总线控制器、接收数据转换器发送来的数据包,并将其发送到地址为0x00的CAN总线节点上。CAN总线接口模块内部由两个部分组成:第一部分是:CAN总线维护。该部分负责对CAN总线进行维护,在启动之初进行对CAN总线控制器的初始化工作,包括各个寄存器的设定、发送缓冲区的填写。在被要求发送数据时,根据预先设计的模板填写相关信息并完成发送。第二部分是:CAN总线数据拆分器。由于本设计中使用的CAN总线使用的数据帧每一帧可传送的有效字节大小为8Byte,所以在处理大的数据包时,需要将数据包拆开发送,数据拆分器会将数据包按照大小拆分为若干个数据帧,然后对每一个数据帧进行编号,将携带了编号的数据包送入CAN总线维护模块发送出去。The CAN bus interface module is a module that provides external communication for the microcontroller. This module is only responsible for initializing the CAN bus controller, receiving data packets sent by the data converter, and sending them to the CAN bus node whose address is 0x00. CAN bus interface module is composed of two parts: the first part is: CAN bus maintenance. This part is responsible for the maintenance of the CAN bus, and initializes the CAN bus controller at the beginning of the startup, including the setting of each register and the filling of the sending buffer. When required to send data, fill in the relevant information according to the pre-designed template and complete the sending. The second part is: CAN bus data splitter. Since the data frame used by the CAN bus used in this design can transmit an effective byte size of 8Byte per frame, when processing a large data packet, the data packet needs to be disassembled and sent, and the data splitter will divide the data packet Split into several data frames according to the size, and then number each data frame, send the numbered data packet to the CAN bus maintenance module and send it out.
在本发明中,CAN总线收发器使用的CTM1050T芯片,在该芯片里集成了所有CAN总线收发器件,而总的大小不超过3cm2,符合ISO 11898标准,CAN总线控制器使用的芯片型号为是SJA1000T。本发明中使用的是PeliCAN模式,在此模式下,SJA1000T能支持所有的CAN2.0B规范。In the present invention, the CTM1050T chip used by the CAN bus transceiver integrates all CAN bus transceiver devices in the chip, and the total size does not exceed 3cm 2 , which conforms to the ISO 11898 standard. The chip model used by the CAN bus controller is Yes SJA1000T. The PeliCAN mode is used in the present invention. In this mode, SJA1000T can support all CAN2.0B specifications.
如图7所示,CAN总线部分电路图,CTM1050T由SJA1000T进行控制,仅使用RX与TX两个引脚,分别接入SJA1000T的TX0和RX0,并且需要在CANH于CANL之间接入一个阻值约为120欧姆的终端电阻,但是该电阻在整个CAN总线网络中,仅仅需要一个就可以,不是所有的节点都需要终端电阻,所以终端电阻会直接接在总线上。SJA100T0与单片机进行连接,其中AD0至AD7作为数据线,ALE/AS,CS,RD,WR作为控制线,除此之外,SJA需要接一个晶振作为信号源,并且提供了一个中断口用于方便单片机控制SJA1000T的工作状态。As shown in Figure 7, part of the CAN bus circuit diagram, CTM1050T is controlled by SJA1000T, only use two pins RX and TX, respectively connected to TX0 and RX0 of SJA1000T, and need to connect a resistance between CANH and CANL 120 ohm terminal resistor, but only one resistor is needed in the entire CAN bus network, not all nodes need a terminal resistor, so the terminal resistor will be directly connected to the bus. SJA100T0 is connected to the single chip microcomputer, in which AD0 to AD7 are used as data lines, ALE/AS, CS, RD, WR are used as control lines, in addition, SJA needs to connect a crystal oscillator as a signal source, and provides an interrupt port for convenience SCM controls the working state of SJA1000T.
单片机采用的是STC单片机系列中的STC15F2K60S2,该单片机支持八个A/D通道,最大工作频率能达到33MHz,支持掉电唤醒以及硬件看门狗。在硬件电路里该单片机的作用为信号采集与控制CAN总线控制器在电路中P1是A/D转换通道,由于待检测电压都高于5V,所以使用了阻排进行分压,转换成低于5V的模拟电压,阻排的太小根据信号获取器要获取的信息不同而不同,获取电梯的输入输出信号时,使用5K就可以,获取高电压时,就需要使用100k左右的阻排分压。在数字开关量方面使用了CD4067,CD4067为16通道模拟开关,虽然有干扰,但是对数字量不影响,在输出口同样使用了电阻进行分压。由于单个单片机不能监控一台电梯的所有信号,所以需要加一个拨码开关确定配置,不同的配置表示采集不同的内容。网络AD是作为数据总线接入到CAN总线网络部分的,其他的为控制CAN总线网络部分的。The single-chip microcomputer adopts STC15F2K60S2 in the STC single-chip series. This single-chip microcomputer supports eight A/D channels, and the maximum operating frequency can reach 33MHz. It supports power-down wake-up and hardware watchdog. In the hardware circuit, the role of the single chip microcomputer is signal acquisition and control of the CAN bus controller. In the circuit, P1 is the A/D conversion channel. Since the voltage to be detected is higher than 5V, the resistive row is used to divide the voltage, which is converted into a voltage lower than 5V. 5V analog voltage, the resistance is too small. It varies according to the information to be obtained by the signal acquirer. When obtaining the input and output signals of the elevator, use 5K. When obtaining high voltage, you need to use about 100k resistance division. . CD4067 is used for digital switching value. CD4067 is a 16-channel analog switch. Although there is interference, it does not affect the digital value. Resistors are also used for voltage division at the output port. Since a single single-chip microcomputer cannot monitor all signals of an elevator, it is necessary to add a dial switch to determine the configuration. Different configurations indicate different content to be collected. The network AD is connected to the CAN bus network part as a data bus, and the others are used to control the CAN bus network part.
本发明中的信号获取器使用了双电源切换电路,在有12V供电的情况下,使用12V电源,同时切断电池供电,当12V电源缺失的情况下,可以将电源切换到备用电池供电,这样的设计是为了能够在掉电的情况下,传送出电源丢失信号给计算机,通知管理人员查看。The signal acquirer in the present invention uses a dual power supply switching circuit. In the case of a 12V power supply, the 12V power supply is used, and the battery power supply is cut off at the same time. When the 12V power supply is missing, the power supply can be switched to the backup battery for power supply. The design is to be able to transmit a power loss signal to the computer in case of power failure, and notify the management personnel to check.
本发明中信号获取器的软件设计主要是基于单片机STC15F2K60S2,软件要实现定时循环扫描各个输入口的输入信息,根据拨码开关确定输入口信息的意义,生成标准数据包,并且可以操作CAN总线控制器,包括初始化CAN总线控制器和发送数据。信号获取器的软件设计分为了四个部分,分别是CAN总线收发、定时扫描、标准数据包生成以及硬件看门狗。The software design of the signal acquirer in the present invention is mainly based on the single-chip microcomputer STC15F2K60S2, and the software should realize the input information of each input port of timing cycle scanning, determine the significance of the input port information according to the dial switch, generate standard data packets, and can operate the CAN bus control device, including initializing the CAN bus controller and sending data. The software design of the signal acquirer is divided into four parts, which are CAN bus transceiver, timing scan, standard data packet generation and hardware watchdog.
本设计的CAN总线控制器使用的SJA1000T,因此CAN总线的收发部分主要的工作内容就是操作SJA1000T。对SJA1000T的操作本质上就是对其各个寄存器的操作。CAN总线驱动代码指的是定义的SJA1000T头文件中定义的SJA1000T寄存器地址以及一个名为SJA1000T_Write()的函数。The CAN bus controller of this design uses SJA1000T, so the main work content of the transceiver part of CAN bus is to operate SJA1000T. The operation of SJA1000T is essentially the operation of its various registers. The CAN bus driver code refers to the SJA1000T register address defined in the defined SJA1000T header file and a function named SJA1000T_Write().
本设计的定时扫描程序分为两个部分。首先是定时循环部分,其次是扫描部分。定时循环部分在系统启动后开始运行,定时扫描程序使用的TIMER0作为定时器,定时时间为20ms,采集频率为50HZ,与市电220v同频率。程序首先修改TH0寄存器和TL0寄存器,设定循环计数,而后打开总中断,程序退出,之后定时器到时间后,就会进入到中断中,中断函数里会设置一个全局变量,将其设置为Ture,而后清理中断标识,在此进入循环。扫描部分是定时扫描程序的核心,该部分代码入口标识在interrupt 1的中断函数里进行设置,代码位于主线程中。当扫描部分检测到允许扫描标识为True时,启动扫描,并在最后将扫描标识重新更改为False。扫描函数首先逐个扫描八个A/D转换通道,并根据分压电路的阻值,计算出原有的电压,最终形成一个数组保留。之后再控制CD4067逐个扫描数字量,也存入一个数组,最后将配置与数组一起发给数据包生成器,完成全部的扫描过程。The timing scanning procedure of this design is divided into two parts. First is the timed loop section, followed by the scan section. The timing cycle part starts to run after the system is started. The timing scan program uses TIMER0 as a timer, the timing time is 20ms, and the acquisition frequency is 50HZ, which is the same frequency as the mains 220v. The program first modifies the TH0 register and the TL0 register, sets the loop count, then opens the total interrupt, the program exits, and after the timer expires, it will enter the interrupt. A global variable will be set in the interrupt function, and it will be set to True. , and then clear the interrupt flag, and enter the loop here. The scanning part is the core of the regular scanning program. The code entry mark of this part is set in the interrupt function of interrupt 1, and the code is located in the main thread. When the scan part detects that the scan flag is allowed to be True, start the scan, and finally change the scan flag back to False. The scan function first scans the eight A/D conversion channels one by one, and calculates the original voltage according to the resistance value of the voltage divider circuit, and finally forms an array for storage. Then control the CD4067 to scan the digital quantities one by one and store them in an array, and finally send the configuration and the array to the data packet generator to complete the entire scanning process.
本设计的数据包生成器在设计中是负责读取拨码开关位置,进而确定配置的。从硬件设计中得知,信号获取器使用了两个I/O口,最多只能使用四个配置,在单片机的存储器中,存储了四张表,表明了四种不同的配置。定时扫描程序会将扫描生成的数组送至数据包生成器,数据包生成器需要将数组生成一个标准格式的数据包,发送至CAN总线模块。其中数据包中的数据说明是描述A/D转换通道数据的,它使用了一个字节进行描述,当前通道存在输入为1,无输入为0。A/D扫描数组加上两个字节的数字信号扫描数组共同组成了数据内容。The data packet generator of this design is responsible for reading the position of the DIP switch in the design, and then determining the configuration. It is known from the hardware design that the signal acquirer uses two I/O ports and can only use four configurations at most. In the memory of the single-chip microcomputer, four tables are stored, indicating four different configurations. The regular scanning program will send the array generated by scanning to the data packet generator, and the data packet generator needs to generate a data packet in a standard format from the array and send it to the CAN bus module. The data description in the data packet describes the data of the A/D conversion channel. It uses one byte for description. The input of the current channel is 1, and the input of no input is 0. The A/D scan array plus the digital signal scan array of two bytes together form the data content.
本发明系统稳定性维护程序设计构成:The system stability maintenance program design of the present invention consists of:
1、使用单片机支持硬件看门狗功能,看门狗的功能是在系统启动看门狗之后,看门狗开始计时,在限定的时间内,也就是看门狗定时器溢出之前,系统必须执行“喂狗”操作,也就是清空看门狗定时器,让其重新开始计数,如果到时间系统仍然没有“喂狗”,则看门狗认为系统程序已经跑飞,会直接复位单片机,让系统重新开始工作,用以避免系统陷入死循环或者是程序错乱。本设计中因为考虑到CAN总线收发的原因,所以看门狗溢出时间约为1s,在每次系统完成扫描,通过CAN总线发出数据后,代码控制权会交还给主循环程序,由主循环程序进行“喂狗”的工作,避免溢出。如果本CAN总线节点出现错误,则系统会陷入到CAN总线发送代码中,也就是会触发看门狗执行复位操作,复位整个信号采集器;1. Use the single-chip microcomputer to support the hardware watchdog function. The function of the watchdog is that after the system starts the watchdog, the watchdog starts timing. Within the limited time, that is, before the watchdog timer overflows, the system must execute The "feed the dog" operation is to clear the watchdog timer and let it start counting again. If the system still does not "feed the dog" when the time expires, the watchdog will think that the system program has run away and will directly reset the MCU to let the system Start working again to prevent the system from falling into an infinite loop or program confusion. In this design, considering the reason of CAN bus transmission and reception, the watchdog overflow time is about 1s. After each system scans and sends data through the CAN bus, the code control right will be returned to the main loop program, which is controlled by the main loop program. Do the work of "feeding the dog" and avoid spills. If there is an error in the CAN bus node, the system will fall into the CAN bus sending code, that is, it will trigger the watchdog to perform a reset operation and reset the entire signal collector;
2、使用双电源进行供电,如果主供电电源掉电,则会启动电池电源,在启用电池电源时,系统会重新启动,启动后的系统会依照既定程序开始采集数据,但是由于主电源已经断电,所以采集到的信号全部都是0,在此种情况下,系统将会通过CAN总线发送一个掉电警报。计算中监控软件收到这个数据包后,就可以根据数据包中地址直接触发电梯掉电警报。掉电错误检测代码与看门狗一样位于系统主循环中,写在数据包生成器之后,发送给CAN总线收发程序之前。2. Use dual power supplies for power supply. If the main power supply fails, the battery power supply will be activated. When the battery power supply is enabled, the system will restart. After startup, the system will start collecting data according to the established procedures, but because the main power supply has been cut off power, so the collected signals are all 0, in this case, the system will send a power-down alarm through the CAN bus. After the monitoring software in the calculation receives this data packet, it can directly trigger the elevator power-off alarm according to the address in the data packet. The power-down error detection code is located in the main loop of the system like the watchdog, written after the data packet generator, and before sending to the CAN bus transceiver program.
本设计选用MySQL的主要原因是电梯监控系统是一个实时的系统,MySQL的数据存储速度是比较快的,所以适合用来做电梯监控系统的数据库。数据库中设计了三个部分的数据表,分别用来进行用户管理、电梯管理、报警参数管理,用户管理只使用了一张用户管理表,如表2所示;The main reason for choosing MySQL in this design is that the elevator monitoring system is a real-time system, and the data storage speed of MySQL is relatively fast, so it is suitable for use as the database of the elevator monitoring system. Three parts of data tables are designed in the database, which are used for user management, elevator management, and alarm parameter management respectively. User management only uses one user management table, as shown in Table 2;
表2用户管理表Table 2 User Management Table
电梯管理是用来管理电梯的表的结合,包括了电梯列表、配置表以及电梯数据表,电梯管理表如表3所示;Elevator management is a combination of tables used to manage elevators, including the elevator list, configuration table, and elevator data table. The elevator management table is shown in Table 3;
表3电梯管理表Table 3 Elevator Management Table
配置表是描述电梯配置的,一个电梯可能有多个配置,因为一个电梯上可能附带有多个信号获取器,一个电梯上的不同信号获取器是不可能使用一个配置的,配置表如表4所示;The configuration table describes the configuration of the elevator. An elevator may have multiple configurations, because there may be multiple signal acquirers attached to an elevator. It is impossible for different signal acquirers on an elevator to use one configuration. The configuration table is shown in Table 4 shown;
表4配置表Table 4 configuration table
电梯数据表用来存储信号获取器上传的数据的,如表5所示;The elevator data table is used to store the data uploaded by the signal acquirer, as shown in Table 5;
表5电梯数据表Table 5 Elevator Data Sheet
报警管理表用来存储报警配置信息的,使用了两张数据表,分别是报警联系方式表以及报警参数表,报警联系方式表如表6所示;The alarm management table is used to store alarm configuration information. Two data tables are used, namely the alarm contact table and the alarm parameter table. The alarm contact table is shown in Table 6;
表6报警联系方式表Table 6 Alarm Contact Form
报警参数用来允许用户设置某一个电梯的参数报警阈值,当电梯上传的数据不在报警参数范围内时,就会触发报警,参数可以由用户直接设置,报警参数表如表7所示;The alarm parameter is used to allow the user to set the parameter alarm threshold of a certain elevator. When the data uploaded by the elevator is not within the range of the alarm parameter, an alarm will be triggered. The parameter can be set directly by the user. The alarm parameter table is shown in Table 7;
表7报警参数表Table 7 Alarm parameter table
本设计中数据管理服务模块用于接收信号获取器上传的数据,并读取数据库中的配置表赋予数据含义,之后存储于数据库中的电梯数据表,最后将数据抛出给需要的模块。根据其功能,数据管理服务模块需要串口驱动模块、数据处理模块。其中串口驱动模块负责完成对CAN总线网络的接入,写入特定的缓冲区供上层程序使用;数据处理模块中分为两部分,第一部分完成对数据的含义赋予,生成一个数据的实例类,并存储数据,第二部分是将数据交给需要使用的模块。两个部分可以认为是独立存在的,串口驱动类定义如下:In this design, the data management service module is used to receive the data uploaded by the signal acquirer, and read the configuration table in the database to give the data meaning, then store it in the elevator data table in the database, and finally throw the data to the required module. According to its function, the data management service module needs a serial port driver module and a data processing module. Among them, the serial port driver module is responsible for completing the access to the CAN bus network, writing a specific buffer for use by the upper program; the data processing module is divided into two parts, the first part completes the meaning of the data, and generates a data instance class, And store the data, the second part is to hand over the data to the modules that need to be used. The two parts can be considered to exist independently, and the serial port driver class is defined as follows:
其中ComDrive是构造函数,需要传入到使用的串口号,以及传输速度,默认使用数据位8位,停止位1,无校验的方式。类的拥有者可以使用OpenCom以及CloseCom函数操作串口的开关。当上传数据时,会触发ReceiveData函数,该函数判断一下数据的合法性,如果验证通过,会检查事件ReceiveDataHandle是否有被设置过,如果设置过,则通过事件通知事件的注册者,如果没有调用过SetReceiveDataHandle,则数据会被丢弃。Among them, ComDrive is the constructor, which needs to be passed in to the serial port number used and the transmission speed. By default, the data bit is 8 bits, the stop bit is 1, and there is no checksum method. The owner of the class can use the OpenCom and CloseCom functions to operate the switch of the serial port. When uploading data, the ReceiveData function will be triggered. This function judges the validity of the data. If the verification is passed, it will check whether the event ReceiveDataHandle has been set. If it has been set, the event registrant will be notified through the event. If it has not been called SetReceiveDataHandle, the data will be discarded.
数据经由ComDrive后,数据管理服务会根据数据中的配置ID和数据生成数据实例类。After the data passes through ComDrive, the data management service will generate a data instance class according to the configuration ID and data in the data.
本设计中。主界面程序有前台界面以及后台功能之分。前台界面用来呈现电梯运行状态、参数以及提供各种功能的入口点,后台功能负责为前台界面提供支持。In this design. The main interface program is divided into foreground interface and background function. The foreground interface is used to present the elevator running status, parameters and entry points for various functions, and the background function is responsible for providing support for the foreground interface.
如图8,前台界面分为两个区域,分别是菜单功能区、电梯运行情况指示区,双击电梯则出现电梯详细的运行参数展示。其中上面菜单栏是各个功能的入口,包括用来完成一些设置的系统设置、查询电梯历史运行数据的历史记录查询、管理用户信息的用户管理以及设置报警相关信息的报警设置。下方提供了两个按钮,当电梯过多时,可以使用这两个按钮进行翻页。对于层数超过9层的电梯,则会多加两个控制按钮,查看不同层数。单击电梯的话,高楼层的情况下,会定位到当前电梯的位置,低楼层无反应。双击电梯的话,会进入到该电梯的详细参数界面上。As shown in Figure 8, the front desk interface is divided into two areas, which are the menu function area and the elevator operation status indication area. Double-click the elevator to display the detailed operation parameters of the elevator. The upper menu bar is the entrance of various functions, including system settings for completing some settings, historical record query for querying historical elevator operation data, user management for managing user information, and alarm settings for setting alarm-related information. There are two buttons below, which can be used to turn pages when there are too many elevators. For elevators with more than 9 floors, two more control buttons will be added to view different floors. If you click on the elevator, in the case of a high floor, the location of the current elevator will be located, and there will be no response on the low floor. If you double-click the elevator, you will enter the detailed parameter interface of the elevator.
如图9所示,在详细参数界面上,会给出所选电梯的详细参数,一般包括呼叫状态、运行状态、门状态、限位开关状态、变频器状态等等,如果该电梯存在一些独特的参数,也可以显示,但是需要预先在数据库中进行配置后该界面才可以自动的生成显示条目。As shown in Figure 9, on the detailed parameter interface, the detailed parameters of the selected elevator will be given, generally including call status, running status, door status, limit switch status, inverter status, etc., if the elevator has some unique The parameters can also be displayed, but the interface can automatically generate display items only after pre-configuration in the database.
主界面后台功能主要是负责完成对界面的刷新,它在完成界面的初始化后,注册了系统的数据管理服务事件通知,当电梯运行状态改变时,自然后台功能会得到通知,进而刷新界面,达到实时展示的目的。除此之外,后台功能还负责各个按钮和控件的动作处理,主界面是一个循环,是否有数据上传取决于数据管理服务模块是否通知,在没有数据通知的时候,主界面将控制权交换给操作系统,当数据管理服务模块通知有新的数据上传时,主界面收回控制权,开始继续执行,根据获取到的数据实例中的内容,更新电梯的状态,并修改界面,最后将控制权再次交给操作系统,允许用户操作。The background function of the main interface is mainly responsible for refreshing the interface. After the initialization of the interface, it registers the system's data management service event notification. When the elevator running status changes, the natural background function will be notified, and then refresh the interface to achieve for real-time display purposes. In addition, the background function is also responsible for the action processing of each button and control. The main interface is a loop. Whether there is data upload depends on whether the data management service module is notified. When there is no data notification, the main interface will exchange control rights to Operating system, when the data management service module notifies that there is a new data upload, the main interface takes back the control right and continues to execute. According to the content in the obtained data instance, the status of the elevator is updated and the interface is modified, and finally the control right is restored Hand over to the operating system to allow the user to operate.
当用户在主界面选择用户管理时,提供了如下的三个按钮,对应不同的用户管理模块部分,分别是增加用户、删除用户、修改用户密码,用户管理同样分为前台界面和后台实现,前台界面包括了三个界面,每个功能提供一个界面。后台实现是数据检查、密码加密以及对数据库的操作。When the user selects user management on the main interface, the following three buttons are provided, corresponding to different user management module parts, namely adding users, deleting users, and modifying user passwords. User management is also divided into front-end interface and background implementation. The interface includes three interfaces, each function provides an interface. The background implementation is data checking, password encryption and operations on the database.
增加用户会提供一个允许用户增加一个用户的界面,用户需要输入一个用户名以及输入密码,点击确定按钮后,如果检查通过,则会在数据库中增加一个用户,如果不通过会提示失败的原因,除了添加用户外,还有删除用户功能,删除用户参考的是Windows的账号管理功能,只能删除其他权限低于自己的用户,而不能删除自己的账号,删除用户界面提供了一个列表,列出了所有可以删除的账号,选择后点击删除就会删除选定的账号,修改用户密码界面提供了一个允许用户修改自己的密码的功能,与增加用户不同的是,修改用户密码中,用户名是不可以修改的,在界面中呈现的是不可修改的状态,用户管理模块的后台功能是连接数据库以及提供用户信息加密,由一个用户管理类实现。Adding a user will provide an interface that allows the user to add a user. The user needs to enter a user name and a password. After clicking the OK button, if the check passes, a user will be added to the database. If not, the reason for the failure will be prompted. In addition to adding users, there is also the function of deleting users. To delete users, refer to the account management function of Windows. You can only delete other users with lower permissions than your own, but you cannot delete your own account. The delete user interface provides a list. After selecting all accounts that can be deleted, click Delete to delete the selected account. The modify user password interface provides a function that allows users to modify their own passwords. The difference from adding users is that in modifying user passwords, the user name is If it cannot be modified, it is displayed in the interface as an unmodifiable state. The background function of the user management module is to connect to the database and provide user information encryption, which is implemented by a user management class.
本设计信息检查模块的功能是检查电梯的运行情况是否正常。电梯的信号多是数字量,并不是设置阈值可以解决的,所以需要由信息检查模块判断电梯是否在正常工作,检查内容包括门开关异常、楼层停靠异常、异常运行、电压电流值。当数据由数据管理服务模块送至信息检查模块时,信息检查模块会遍历上述的四个情况,只要发生了异常,就会产生异常信息,发出警报。The function of the design information checking module is to check whether the running condition of the elevator is normal. The signal of the elevator is mostly digital, which cannot be solved by setting a threshold. Therefore, it is necessary to judge whether the elevator is working normally by the information inspection module. The inspection content includes abnormal door switch, abnormal floor stop, abnormal operation, and voltage and current values. When the data is sent from the data management service module to the information inspection module, the information inspection module will go through the above four situations, and as long as an exception occurs, an abnormal message will be generated and an alarm will be issued.
本设计中GSM报警模块提供了报警支持,用户可以通过设置界面设置报警号码,当信息检查模块抛出警报试,就由GSM报警模块按照报警号码进行报警也可以通过外部调用直接产生一个警报。GSM报警器使用的是一款名称为FB200-B的报警器,该报警器使用RS232通讯协议,可以直接与计算机进行通信,只需要使用发送TTS语音的ATL指令和发送短信的ATM指令即可。In this design, the GSM alarm module provides alarm support. The user can set the alarm number through the setting interface. When the information checking module throws an alarm test, the GSM alarm module will alarm according to the alarm number. It can also directly generate an alarm through an external call. The GSM alarm uses an alarm named FB200-B. This alarm uses the RS232 communication protocol and can communicate directly with the computer. It only needs to use the ATL command to send TTS voice and the ATM command to send SMS.
本发明可以查询任意一部电梯的历史记录,其中主要是可以查看历史的报警记录,可以查看曲线图、列表两种图形。The present invention can inquire about the historical records of any elevator, mainly the historical alarm records can be viewed, and two types of graphs can be viewed: graphs and lists.
本发明采用由SQLServer提供的数据库、数据仓库以及服务器,数据挖掘引擎及以上需要自己设计实现。本设计中没有可视化用户接口,直接使用的后台输出。The present invention adopts the database, data warehouse and server provided by SQL Server, and the data mining engine and above needs to be designed and realized by oneself. There is no visual user interface in this design, and the background output is used directly.
本发明采用神经网络的数据挖掘算法,首先进行的数据清洗工作,电梯信号获取器是不断的进行数据上传工作的,为减少模型的负担,数据必须清洗掉,这个过程在数据放入数据仓库前进行,先检查本次采集数据与上一次采集数据的差异,如果无差异则直接丢弃,存在差异则放入数据仓库中。其次是数据的预处理工作,对于本文设计的电梯监控系统,需要完成的是比例变换以及数值数据转换工作。由于神经网络模型接收范围在[-1.0,0]和[0.0,1.0]之间,而电梯监控数据的范围远远超过了这个限制,所以需要进行比例变换,电梯监控系统中使用神经网络模型进行预测的是电压以及电流,电压范围是0-311V,电流范围则根据电路不同而不同,这些都需要将其映射到神经网络模型可以接受的范围内。除此之外还需要数据数值转换,电梯监控系统中使用了配置表这种形式描述电梯数据含义,而神经网络是不接受非数字数据处理的,所以需要将数据库中的数据展开,建立哈希函数,为每一个采集数据生成唯一的标识数字。The present invention adopts the data mining algorithm of the neural network. First, the data cleaning work is carried out. The elevator signal acquirer is constantly uploading the data. In order to reduce the burden on the model, the data must be cleaned. This process is performed before the data is put into the data warehouse. To proceed, first check the difference between the data collected this time and the data collected last time. If there is no difference, it will be discarded directly, and if there is a difference, it will be put into the data warehouse. The second is the preprocessing of data. For the elevator monitoring system designed in this paper, what needs to be completed is the scale transformation and numerical data conversion. Since the receiving range of the neural network model is between [-1.0, 0] and [0.0, 1.0], and the range of the elevator monitoring data is far beyond this limit, it is necessary to perform a scale transformation. The neural network model is used in the elevator monitoring system. What is predicted is voltage and current, the voltage range is 0-311V, and the current range varies according to different circuits, all of which need to be mapped to the acceptable range of the neural network model. In addition, data conversion is also required. The elevator monitoring system uses a configuration table to describe the meaning of elevator data, and the neural network does not accept non-digital data processing, so it is necessary to expand the data in the database and create a hash Function to generate a unique identification number for each collected data.
本发明采用的神经网络算法包括如下步骤:The neural network algorithm that the present invention adopts comprises the steps:
步骤一、建立BP神将网络模型。Step 1: Establish a BP god general network model.
BP网络一般是由输入层、隐层以及输出层构成,隐层可以具有多个,不同层之间采用一对多的互连方式进行连接,同一层的节点之间无连接,本设计使用的三层的BP神经网络,三层的网络深度已经可以解决一般的函数拟合问题。反向传播算法采用梯度法修正权值,要求输出函数可微,采用Sigmoid函数作为输出函数,图10为三层BP神经网络的结构图。A BP network is generally composed of an input layer, a hidden layer, and an output layer. There can be multiple hidden layers. Different layers are connected in a one-to-many interconnection mode. There is no connection between nodes in the same layer. This design uses The three-layer BP neural network, the three-layer network depth can already solve the general function fitting problem. The backpropagation algorithm adopts the gradient method to modify the weight value, and requires the output function to be differentiable, and uses the Sigmoid function as the output function. Figure 10 is the structure diagram of the three-layer BP neural network.
Xi表示输入层某一节点信号;Yh表示隐含某一节点的输出信号;Tj表示目标信号;ωih表示输入层节点i的隐含层节点h的连接权值;ωhj表示隐含层节点h的输出层节点j的连接权值;Δ表示目标信号和输出信号之间的误差;N1表示输入层节点数;N2表示隐含层节点数;N3表示输出层节点数。X i represents the signal of a certain node in the input layer; Y h represents the output signal of a hidden node; T j represents the target signal; ω ih represents the connection weight of the hidden layer node h of the input layer node i; The connection weight of the output layer node j containing the layer node h; Δ represents the error between the target signal and the output signal; N 1 represents the number of input layer nodes; N 2 represents the number of hidden layer nodes; N 3 represents the number of output layer nodes .
隐含层节点的输出为:yh=f(neth);The output of the hidden layer node is: y h = f(net h );
输出层节点的输出为:zj=f(netj);The output of the output layer node is: z j = f(net j );
误差函数为: The error function is:
定义局部梯度为: Define the local gradient as:
考虑权值ωih对误差的影响: Consider the influence of the weight ω ih on the error:
权值修正应使误差尽快地减少,修正量为:ωih(t+1)=ωih(t)+Δωih(t);The weight correction should reduce the error as soon as possible, and the correction amount is: ω ih (t+1) = ω ih (t) + Δω ih (t);
对于Sigmoid函数: For the sigmoid function:
为加快网络的收敛速度,在权值修正量中加上前一次的权值修正量,Δωih(t)=-η·δh·yh+α·Δωih(t-1)In order to speed up the convergence speed of the network, add the previous weight correction amount to the weight correction amount, Δω ih (t)=-η·δ h ·y h +α·Δω ih (t-1)
其中,θh为输入层和隐含层间的偏移量;Υj为隐含层和输出层间的偏移量;η为学习步长;α为惯性项系数;图11为BP神经网络传播算法流程图;对于网络节点数目,目前没有明确的理论关系表明节点数与结果之间的联系,通过训练样本与测试样本的实验效果,本文最后以下列公式作为确定隐含层的节点数:其中,n′为隐藏层节点数,n′i为输入层节点数,n′0为输出层节点数,c为1~10之间的数。Among them, θ h is the offset between the input layer and the hidden layer; Υ j is the offset between the hidden layer and the output layer; η is the learning step; α is the coefficient of the inertia term; Figure 11 is the BP neural network Propagation algorithm flow chart; for the number of network nodes, there is currently no clear theoretical relationship between the number of nodes and the results. Through the experimental results of training samples and test samples, this paper finally uses the following formula to determine the number of nodes in the hidden layer: Among them, n' is the number of nodes in the hidden layer, n' i is the number of nodes in the input layer, n' 0 is the number of nodes in the output layer, and c is a number between 1 and 10.
本发明中,输入信号为11个,包括:In the present invention, there are 11 input signals, including:
(1)电梯载重、(2)轿厢开关门噪声、(3)曳引机三项电流、(4)曳引机三项电压、(5)垂直振动加速度、(6)水平振动加速度、(7)垂直方向加速度、(8)垂直方向减速度、(9)主机电动机温度、(10)紧急制动器线圈温度、(11)机房温度;以上信号作为神经网络的输入向量,其中(1)-(8)等8个信号采用S型隶属函数;(9)、(10)、(11)等3个信号采用高斯型隶属函数形成“偏低”,“正常”,“偏高”等三个语言变量;因此,输入层节点数为3×3+8=17个;(1) Elevator load, (2) Car door opening and closing noise, (3) Traction machine three currents, (4) Traction machine three voltages, (5) Vertical vibration acceleration, (6) Horizontal vibration acceleration, ( 7) Vertical acceleration, (8) Vertical deceleration, (9) Main engine motor temperature, (10) Emergency brake coil temperature, (11) Machine room temperature; the above signals are used as the input vector of the neural network, where (1)-( 8) and other 8 signals adopt S-type membership function; 3 signals such as (9), (10), and (11) adopt Gaussian membership function to form three languages of "low", "normal" and "high". variable; therefore, the number of input layer nodes is 3×3+8=17;
通过分析电梯的故障原因和查阅相关文献可得到电梯的常见6个输出故障信号:(1)电梯曳引机故障、(2)回路故障、(3)门机故障、(4)电梯控制器故障、(5)三相电源输入单元故障、(6)变频器故障;By analyzing the causes of elevator failures and consulting related literature, we can get six common output failure signals of elevators: (1) Elevator traction machine failure, (2) Circuit failure, (3) Door machine failure, (4) Elevator controller failure , (5) Three-phase power input unit failure, (6) Frequency converter failure;
由上文提到的公式: From the formula mentioned above:
可知,隐含层节点数为6-20之间,当隐含层层数为20层时系统最优化,因此隐含层节点数为20;因此,网络层为3层。输入层节点数为17,该层的11个电梯故障信息作为输入信号;输出层节点数为6,该层代表了从输入层得到的故障信息经过调整权系数后的故障处理后有6个输出故障信号;隐含层节点数为20,该层应用BP神经网络算法对样本进行最优化训练。训练之前,初始偏移量和权值取(-5,5)间的数,对这十个数进行优化,得出优化解,即偏移量固定为0.5,然后进行网络训练。本设计为了提高输入向量的精确度,降低误差,并限定输出向量的范围为[-1,1],隐含层激活函数选为双曲正切函数,输出层的激活函数选为非线性对数S型函数;如表8所示,给定了一组训练样本、训练过程中各节点的值。It can be seen that the number of hidden layer nodes is between 6 and 20, and the system is optimized when the number of hidden layer layers is 20, so the number of hidden layer nodes is 20; therefore, the network layer is 3 layers. The number of nodes in the input layer is 17, and the fault information of 11 elevators in this layer is used as the input signal; the number of nodes in the output layer is 6, and this layer represents that the fault information obtained from the input layer has 6 outputs after the fault processing after adjusting the weight coefficient Fault signal; the number of nodes in the hidden layer is 20, and the BP neural network algorithm is used in this layer to optimize the training of samples. Before training, the initial offset and weight take a number between (-5,5), and optimize these ten numbers to obtain an optimized solution, that is, the offset is fixed at 0.5, and then network training is performed. In this design, in order to improve the accuracy of the input vector, reduce the error, and limit the range of the output vector to [-1, 1], the activation function of the hidden layer is selected as a hyperbolic tangent function, and the activation function of the output layer is selected as a nonlinear logarithm Sigmoid function; as shown in Table 8, a set of training samples and the values of each node in the training process are given.
表8训练样本、训练过程中各节点的值Table 8 Training samples, the value of each node in the training process
为了提高算法的学习速度,采用对应Levenberg Marquardt算法的trainlm函数进行测算,该算法的权值根据dX=-(jXT*jX+I*mu)-1*E进行修正的,其中jX为误差对权值微分的Jacobian矩阵,E为误差向量,mu为调整量。训练误差为10-4。In order to improve the learning speed of the algorithm, the trainlm function corresponding to the Levenberg Marquardt algorithm is used for measurement and calculation. The weight of the algorithm is corrected according to dX=-(jX T *jX+I*mu) -1 *E, where jX is the error pair The Jacobian matrix of weight differential, E is the error vector, and mu is the adjustment amount. The training error is 10 -4 .
假设有P对训练样本,则第p对训练样本训练误差:用均方差作为总输出误差: Assuming that there are P pairs of training samples, the training error of the p-th pair of training samples: Use the mean square error as the total output error:
其中,n表示输出层节点数,表示第p组样本输出层的第t个节点实际输出,p=1,2,3,…,p,t=1,2,3,…,n,表示第p组样本输出层的第t个节点期望输出,p=1,2,3,…,p,t=1,2,3,…,n,(Ef)2表示全部样本输出误差;如表9所示,为训练样本表;Among them, n represents the number of nodes in the output layer, Indicates the actual output of the tth node of the pth group sample output layer, p=1,2,3,...,p, t=1,2,3,...,n, Represents the expected output of the tth node of the pth group sample output layer, p=1,2,3,...,p, t=1,2,3,...,n, (E f ) 2 represents all sample output errors; As shown in Table 9, it is a training sample table;
表9训练样本表Table 9 training sample table
为了提高训练的准确性,在数据训练时对数据进行预处理,如下:In order to improve the accuracy of training, the data is preprocessed during data training, as follows:
数据预处理data preprocessing
数据处理之后,用训练函数traingdm触发。如果训练次数超过epochs,则性能函数低于goal,梯度值低于mingrad,或训练时间超过time训练就会结束。程序代码如下:After data processing, trigger with training function traindm. If the number of training times exceeds epochs, the performance function is lower than the goal, the gradient value is lower than mingrad, or the training time exceeds time and the training will end. The program code is as follows:
训练结果表明,该算法对网络进行训练非常快,迭代次数明显减少,收敛速度加快,通过样本训练和仿真,采用BP神经网络的数据挖掘算法,用于完成电梯监控系统的主动式报警功能,对于分析某些事物潜在的发展趋势和隐患,减少因电梯引发的事故的效果显著;经处理后,数据如表3所示。The training results show that the algorithm trains the network very quickly, the number of iterations is significantly reduced, and the convergence speed is accelerated. Through sample training and simulation, the data mining algorithm of BP neural network is used to complete the active alarm function of the elevator monitoring system. Analyzing the potential development trends and hidden dangers of certain things has a significant effect in reducing accidents caused by elevators; after processing, the data is shown in Table 3.
表3训练样本、训练过程中各节点的值Table 3 Training samples and the values of each node during the training process
尽管本发明的实施方案已公开如上,但其并不仅仅限于说明书和实施方式中所列运用,它完全可以被适用于各种适合本发明的领域,对于熟悉本领域的人员而言,可容易地实现另外的修改,因此在不背离权利要求及等同范围所限定的一般概念下,本发明并不限于特定的细节和这里示出与描述的图例。Although the embodiment of the present invention has been disclosed as above, it is not limited to the use listed in the specification and implementation, it can be applied to various fields suitable for the present invention, and it can be easily understood by those skilled in the art Therefore, the invention is not limited to the specific details and examples shown and described herein without departing from the general concept defined by the claims and their equivalents.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710506995.2A CN107203201A (en) | 2017-06-28 | 2017-06-28 | Elevator monitoring method based on CAN |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710506995.2A CN107203201A (en) | 2017-06-28 | 2017-06-28 | Elevator monitoring method based on CAN |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107203201A true CN107203201A (en) | 2017-09-26 |
Family
ID=59908058
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710506995.2A Pending CN107203201A (en) | 2017-06-28 | 2017-06-28 | Elevator monitoring method based on CAN |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107203201A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108958817A (en) * | 2018-06-28 | 2018-12-07 | 北京无线电测量研究所 | Bus driver method, apparatus and storage medium |
CN109292567A (en) * | 2018-02-28 | 2019-02-01 | 武汉大学 | An elevator fault prediction method based on BP neural network |
CN111327501A (en) * | 2020-02-21 | 2020-06-23 | 广州广日电梯工业有限公司 | Self-adaptive elevator bus communication method and system |
CN112783070A (en) * | 2021-01-20 | 2021-05-11 | 深圳市雷能混合集成电路有限公司 | Singlechip power-on processing method and device |
CN113905104A (en) * | 2021-12-06 | 2022-01-07 | 广东新中望信息科技有限公司 | Communication method and protocol conversion system for elevator intelligent networking |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH03279178A (en) * | 1990-03-28 | 1991-12-10 | Mitsubishi Electric Corp | Control device for elevator |
JPH0692563A (en) * | 1992-09-17 | 1994-04-05 | Hitachi Ltd | Number measuring device for elevator |
CN2851204Y (en) * | 2005-08-19 | 2006-12-27 | 天津市英克瑞电子技术有限公司 | Elevator operation monitoring device with remote interconnection function |
CN201406235Y (en) * | 2009-03-27 | 2010-02-17 | 北京市朝阳区特种设备检测所 | Dynamic intelligent monitoring device for elevator |
CN101780909A (en) * | 2009-09-16 | 2010-07-21 | 新疆大学 | Detection and diagnosis system for elevator without machine room |
CN202245575U (en) * | 2011-08-23 | 2012-05-30 | 江苏跨域信息科技发展有限公司 | LonWorks technology-based lift monitoring system |
CN202729499U (en) * | 2012-08-16 | 2013-02-13 | 浙江西屋电梯股份有限公司 | Elevator monitoring system base on interfaces of Internet of Things |
-
2017
- 2017-06-28 CN CN201710506995.2A patent/CN107203201A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH03279178A (en) * | 1990-03-28 | 1991-12-10 | Mitsubishi Electric Corp | Control device for elevator |
JPH0692563A (en) * | 1992-09-17 | 1994-04-05 | Hitachi Ltd | Number measuring device for elevator |
CN2851204Y (en) * | 2005-08-19 | 2006-12-27 | 天津市英克瑞电子技术有限公司 | Elevator operation monitoring device with remote interconnection function |
CN201406235Y (en) * | 2009-03-27 | 2010-02-17 | 北京市朝阳区特种设备检测所 | Dynamic intelligent monitoring device for elevator |
CN101780909A (en) * | 2009-09-16 | 2010-07-21 | 新疆大学 | Detection and diagnosis system for elevator without machine room |
CN202245575U (en) * | 2011-08-23 | 2012-05-30 | 江苏跨域信息科技发展有限公司 | LonWorks technology-based lift monitoring system |
CN202729499U (en) * | 2012-08-16 | 2013-02-13 | 浙江西屋电梯股份有限公司 | Elevator monitoring system base on interfaces of Internet of Things |
Non-Patent Citations (1)
Title |
---|
黄桂田: "《中国物联网发展报告》", 31 January 2013, 社会科学文献出版社 * |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109292567A (en) * | 2018-02-28 | 2019-02-01 | 武汉大学 | An elevator fault prediction method based on BP neural network |
CN108958817A (en) * | 2018-06-28 | 2018-12-07 | 北京无线电测量研究所 | Bus driver method, apparatus and storage medium |
CN111327501A (en) * | 2020-02-21 | 2020-06-23 | 广州广日电梯工业有限公司 | Self-adaptive elevator bus communication method and system |
CN111327501B (en) * | 2020-02-21 | 2022-01-14 | 广州广日电梯工业有限公司 | Self-adaptive elevator bus communication method and system |
CN112783070A (en) * | 2021-01-20 | 2021-05-11 | 深圳市雷能混合集成电路有限公司 | Singlechip power-on processing method and device |
CN112783070B (en) * | 2021-01-20 | 2024-05-07 | 深圳市雷能混合集成电路有限公司 | Singlechip power-on processing method and device |
CN113905104A (en) * | 2021-12-06 | 2022-01-07 | 广东新中望信息科技有限公司 | Communication method and protocol conversion system for elevator intelligent networking |
CN113905104B (en) * | 2021-12-06 | 2022-03-15 | 广东新中望信息科技有限公司 | Communication method and protocol conversion system for elevator intelligent networking |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10854059B2 (en) | Wireless sensor network | |
CN107203201A (en) | Elevator monitoring method based on CAN | |
EP3111433B1 (en) | Wireless sensor network | |
JP6359716B1 (en) | Diagnosing slow tasks in distributed computing | |
CN106713389A (en) | Monitoring method and system | |
CN106774062A (en) | The collection of charging pile and monitoring system and charging pile | |
CN108259270A (en) | A kind of data center's system for unified management design method | |
WO2015176389A1 (en) | Method, apparatus and system for collecting device information | |
CN103973815A (en) | Method for unified monitoring of storage environment across data centers | |
CN104477776B (en) | The crane remote hierarchical monitoring system of based role | |
CN111143167B (en) | Alarm merging method, device, equipment and storage medium for multiple platforms | |
CN107944000A (en) | Flight freight rate update method, device, electronic equipment, storage medium | |
CN109388604A (en) | A kind of hot plug control method based on PCIe, device and storage medium | |
CN105549696B (en) | Rack-mounted server system with case management function | |
CN109495383A (en) | A kind of data processing method, device, communication system and the network equipment | |
CN116723198A (en) | Multi-node server host control method, device, equipment and storage medium | |
CN112000659B (en) | A basic application system suitable for intelligent terminal equipment in distribution area | |
CN101820356A (en) | Network fault diagnosis system based on ARM-Linux | |
CN106357770A (en) | Forest ecological station data processing system on basis of technologies of internet of things | |
CN109639755A (en) | Interconnected system server decoupling method, device, medium and electronic equipment | |
CN109119151A (en) | Realize the method and device of the mutual connection of equipment room | |
CN111624962A (en) | Data computer lab distribution equipment management and control system | |
CN106708701A (en) | Central maintenance device and method based on ARINC659 bus | |
CN114664494B (en) | A Distributed Temperature Measurement Smart Cable | |
CN107682906A (en) | Inspection data communications method and system in computer room |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170926 |
|
RJ01 | Rejection of invention patent application after publication |