CN109596684A - A kind of detection of gas with multiple constituents device and method based on RS485 network - Google Patents
A kind of detection of gas with multiple constituents device and method based on RS485 network Download PDFInfo
- Publication number
- CN109596684A CN109596684A CN201910039660.3A CN201910039660A CN109596684A CN 109596684 A CN109596684 A CN 109596684A CN 201910039660 A CN201910039660 A CN 201910039660A CN 109596684 A CN109596684 A CN 109596684A
- Authority
- CN
- China
- Prior art keywords
- gas
- data
- value
- neural network
- sensor
- 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.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01N—INVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
- G01N27/00—Investigating or analysing materials by the use of electric, electrochemical, or magnetic means
- G01N27/26—Investigating or analysing materials by the use of electric, electrochemical, or magnetic means by investigating electrochemical variables; by using electrolysis or electrophoresis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/047—Probabilistic or stochastic networks
-
- G—PHYSICS
- G08—SIGNALLING
- G08C—TRANSMISSION SYSTEMS FOR MEASURED VALUES, CONTROL OR SIMILAR SIGNALS
- G08C17/00—Arrangements for transmitting signals characterised by the use of a wireless electrical link
- G08C17/02—Arrangements for transmitting signals characterised by the use of a wireless electrical link using a radio link
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L1/00—Arrangements for detecting or preventing errors in the information received
- H04L1/004—Arrangements for detecting or preventing errors in the information received by using forward error control
- H04L1/0056—Systems characterized by the type of code used
- H04L1/0061—Error detection codes
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L2012/40208—Bus networks characterized by the use of a particular bus standard
- H04L2012/40228—Modbus
Abstract
The invention discloses a kind of detection of gas with multiple constituents device and methods based on RS485 network, including multiple gas sensors, MAX485 interface module, MCU controller, YL-500IL wireless data transmission module, the USART1 interface of MCU controller is connect with MAX485 interface module, the USART2 interface of MCU controller is connect with YL-500IL wireless data transmission module, MAX485 interface module is connect with RS485 bus, multiple parallel carries of gas sensor are in RS485 bus, circuit in the MAX485 interface module uses automatic transceiving circuit, for realizing the transmitted in both directions of information flow.The present invention can guarantee that the data of multicomponent gas sensor acquisition will not mutually be interfered, while can carry out stable wireless transmission to the data of acquisition.
Description
Technical field
The present invention relates to a kind of detection of gas with multiple constituents device and method, specifically a kind of multiple groups based on RS485 network
Divide gas-detecting device and method.
Background technique
Since some special screnes need while detecting the content of multiple gases, and it can be transmitted and be examined by wireless remote
The gas information of survey.Such as: scene of fire, toxic and harmful gas leak scene etc. have the place of security threat to personnel.At this
A little places, safe and efficient, reliable detection of gas with multiple constituents equipment will have big advantage.Currently, detection single kind
Gas sensor has very much, such as: CITY, Alphasense, Honeywell etc..But each sensor only has detection single
The function of one gas content, there is presently no the Integrated Solutions of multiple gases sensor.Additionally, due to existing electrochemical gas
Sensor will appear interference when measuring multicomponent gas, so, develop a kind of efficient, reliable, quick multicomponent gas biography
Sensor Integrated Solution is particularly important.
And realize the measurement and wireless transmission of multicomponent gas content, it is primarily present both sides problem: 1) multicomponent gas
It avoids interfering with each other when body sensor networks are built and later data handles;2) how the collected data of gas sensor carry out
Stable wireless transmission.
Summary of the invention
The multicomponent gas inspection based on RS485 network that in view of the above existing problems in the prior art, the present invention provides a kind of
Device and method is surveyed, can guarantee that the data of multicomponent gas sensor acquisition will not mutually be interfered, while can be to the data of acquisition
Carry out stable wireless transmission.
To achieve the goals above, the technical solution adopted by the present invention is that: a kind of multicomponent gas based on RS485 network
Detection device, including multiple gas sensors, MAX485 interface module, MCU controller, YL-500IL wireless data transmission module, MCU
The USART1 interface of controller is connect with MAX485 interface module, and the USART2 interface and YL-500IL of MCU controller are without line number
Transmission module connection, MAX485 interface module are connect with RS485 bus, and multiple parallel carries of gas sensor are in RS485 bus.
Further, the circuit in the MAX485 interface module uses automatic transceiving circuit, for realizing the double of information flow
To transmission.
Further, the gas sensor is 8.
A kind of detection of gas with multiple constituents method based on RS485 network, specific steps are as follows:
A, gas sensor network is built based on RS485;
B, resolution ratio, address and the check code of 8 gas sensors are set;Ground station control system instructs modified address
It is wirelessly sent to YL-500IL wireless data transmission module, and passes to MCU controller, after MCU controller receives instruction, according to finger
It enables content successively send unlock instruction and modification data command to each gas sensor in sequence, completes each gas sensing
It modifies the address of device;
Ground station control system will modify resolution ratio instruction and be wirelessly sent to YL-500IL wireless data transmission module, and pass to
MCU controller after MCU controller receives instruction, is successively sent to each gas sensor in sequence according to command content
Unlock instruction and modification data command complete the resolution ratio modification of each gas sensor;The data frame of above-mentioned each instruction is equal
There are two the CRC16 check codes of byte for band;
C, when carrying out detection of gas with multiple constituents, MCU controller waits the times according to modified 8 gas sensor addresses
It is spaced to send to MAX485 module and reads data command, MAX485 module passes 8 gases using Modbus-RTU communications protocol
Sensor interrupts the data frame for receiving each gas sensor and returning by the serial ports free time, and data frame is passed to MCU controller;
Untreated data are sent the data to ground station control system by YL-500IL wireless data transmission module by last MCU controller
System;
D, ground station control system receive after data according to the selected gas with various sensor of different application scene into
Then the gas concentration value that each sensor measures is calculated according to built data model in row data modeling;
E, the data obtained in step D are filtered by Kalman filtering algorithm, are finally obtained filtered
Actual gas concentration value.
Further, scene of fire gaseous detection applications scene, specific process are as follows: used 8 are selected in the step D
A gas sensor is respectively as follows: methane, ammonia, carbon monoxide, chlorine, benzene, hydrogen sulfide, hydrogen chloride, hydrogen fluoride;
Due to there is the gas of above 8 kinds of components in the scene, cross one another influence, therefore each sensing between various gases
The correspondence gas concentration of device measurement is clearly inaccuracy;It, can be to known 8 kinds of gas in the case where securing gas component
The sample of concentration measures, and is modeled by gas concentration of the linear neural network to each component;
If linear neural network algorithm haves three layers altogether, respectively input layer, middle layer and output layer;Input layer is respectively first
Alkane, ammonia, carbon monoxide, chlorine, benzene, hydrogen sulfide, hydrogen chloride, hydrogen fluoride, the measured value of totally 8 gas sensors, output layer
Respectively methane, ammonia, carbon monoxide, chlorine, benzene, hydrogen sulfide, hydrogen chloride, hydrogen fluoride, the concentration value of totally 8 kinds of gas, intermediate
Layer is the adjustment layer of input layer, which is that multivariate regression linearly inputs, and it is as follows that formula is arranged in middle layer:
In formula (1): I meets 0≤x1+x2+L+x8≤2;x1、x2、L、x8The respectively number of combinations of integer 0;
By above-mentioned 8 kinds of gas sensor variable Xs1,X2,L,X8Instead of according to formula (1), multicomponent gas sensing data
One-dimensional matrix is arranged in blending algorithm middle layer:
X45×1For 45 × 1 matrix,Methane, ammonia, L, hydrogen fluoride are respectively indicated, totally 8 kinds of gas
The concentration measurement of body, middle layer to the weight matrix between output layer are W8×45, determine the power between middle layer and output layer
After value W, the sensor sample value of real-time measurement calculates step using linear neural network and obtains concentration output;
The nominal data of every kind of gas takes 7 groups respectively, i.e., to 78Group data, according to formula (2), (3) by marked gas concentration,
Measure gas concentration normalization.
In formulaFor m-th of sample neural network output, input normalized value;Xim、PmFor m-th of sample i-th
The input of a sensor, output calibration value;Xmax、Xmin, Pmax、PminFor sensor input is maximum, minimum value, output is maximum, most
Small calibration value;
According to 8 kinds of gas sensor data blending algorithm structures, linear neural network is organized into following formula:
C8×1=W8×45X45×1 (4)
X in formula (4)i(i=1,2, L, 45) can be by the data in table 1 according to one-dimensional matrix X45×1It can be calculated;wi,j(i=
1,2;J=1,2, L, 45) it is linear neural network weight;ci(i=1,2, L, 8) is that neural network estimates 8 kinds of gas concentrations
Evaluation;
Evaluated error are as follows:
esti m(k)=Pi m-Ci m(k) (5)
Weight tune updates:
In formula: Ci m(k) the output estimation value of m-th of sample of neural network is walked for kth;Pi mIt is defeated for m-th of sample of calibration point
Enter the desired output of value and i-th of neural network output;esti mIt (k) is evaluated error, kth step neural network output is estimated
The difference of evaluation and desired output;wij(k) when being walked for kth, j-th of connection weight;ηijFor Studying factors;Its selection influences
To the stability and convergence rate of iteration.
The learning procedure of neural network is: designed linear neural network is used, it will be in standard sample database As the input of network,As the output desired value of network, according to formula (5), (6) training wi,j
(i=1,2;J=1,2, L, 45), the initial value of weight chooses the random number between (- 1,1);By the input in standard sample database
Output data is sequentially brought into neural network, by successive ignition with new weight, until the estimated value of neural network output valve
Error mean square value is lower than setting value, and learning process terminates at this time;Weight is that neural network reads data fusion coefficients, in order to guarantee
Convergence rate and stability, in learning process, Studying factors ηij(i=1,2;J=1,2, L, 45) it is taken as parameter, become from 0.95
To 0.4;Gas concentration measurement model is obtained in turn, wherein W known to weight matrix8×45, input X45×1For (prediction) square to be measured
Battle array, model expression such as formula (4);
Finally, according to formula (3) renormalization to get arrive true gas concentration.
Further, the specific filtering of the step E are as follows:
Since the carbonomonoxide concentration rule that changes with time is similar to normal distribution, the data that step D is obtained
Carry out normal distribution fitting:
Kalman filtering processing is Linear system model, is fitted with second order polynomial to above-mentioned data, obtains outlet
Property expression formula;
SCO=at2+bt+c (8)
In formula: a, b, c are the datum obtained according to different application scene;
According to Kalman filtering algorithm, it is necessary first to determine state difference equation and its measurement mapped out of linear system
Equation.
Xt=AXt-1+BUt-1+Wt-1 (9)
Zt=HXt+Vt (10)
X: the state vector of system;
A: transition matrix;
U: system input;
B: the matrix of state is converted the input into;
W: system noise;
Z: measured value;
H: the transition matrix of state variable to measured value;
V: measurement noise
State vector X is defined according to formula (8), (9), (10)t, A, B, U:
U=[- 0.0010096]
For gas sensor measured value, that is, gas concentration, therefore obtain Z, H:
Z=[zk]
H=[1 0]
For the system noise W and measurement noise V in state equation, it is assumed that obey following multivariate Gaussian distribution, and W, V
It is independent from each other;Wherein Q, R are the covariance matrix of noise variance, and Q, R can be obtained according to measurement sample statistics analysis;
P (w)~N (0, Q)
P (v)~N (0, R)
The step of above-mentioned model is carried out Kalman filtering is as follows:
Wherein P is estimated valueWith true value xkCovariance matrix;Loop iteration is multiple, i.e., after acquisition Kalman filtering
Gas concentration value.
Compared with prior art, the present invention uses gas sensor, MAX485 interface module, MCU controller, YL-500IL
Wireless data transmission module combines mode, is based on the multiple electrochemical gas sensors of RS485 system integrating, logical by Modbus-RTU
Letter mode is written and read sensor, to be effectively reduced the occupancy of MCU resource, while using CRC16 check code in number
According to being verified in transmission process, it is ensured that read the accuracy of data.Sensor is carried out according further to different application scene
Modeling, and Kalman filtering is carried out to the data of reading, to improve the reliability of sensor measurement data.Pass through no line number
Transmission data, to improve the flexibility ratio that module uses.
Detailed description of the invention
Fig. 1 is electric principle connection figure of the invention;
Fig. 2 is work flow diagram of the invention;
Fig. 3 is 8 kinds of gas sensor data blending algorithm structural schematic diagrams in the present invention.
Specific embodiment
The present invention will be further described below.
As shown, a kind of detection of gas with multiple constituents device based on RS485 network, including multiple gas sensors,
MAX485 interface module, MCU controller, YL-500IL wireless data transmission module, USART1 interface and the MAX485 of MCU controller connect
The connection of mouth mold block, the USART2 interface of MCU controller connect with YL-500IL wireless data transmission module, MAX485 interface module and
The connection of RS485 bus, multiple parallel carries of gas sensor are in RS485 bus.
Further, the circuit in the MAX485 interface module uses automatic transceiving circuit, for realizing the double of information flow
To transmission.
Further, the gas sensor is 8.
A kind of detection of gas with multiple constituents method based on RS485 network, specific steps are as follows:
A, gas sensor network is built based on RS485, and data modeling is carried out to a variety of different application scenes;
B, resolution ratio, address and the check code of 8 gas sensors are set;Ground station control system instructs modified address
It is wirelessly sent to YL-500IL wireless data transmission module, and passes to MCU controller, after MCU controller receives instruction, according to finger
It enables content successively send unlock instruction and modification data command to each gas sensor in sequence, completes each gas sensing
It modifies the address of device;
Table 1 sends unlock instruction
0x00 | 0x06 | 0x00 | 0x11 | 0x00 | 0x18 | 0xD8 | 0x14 |
General modified address | Modify command word | Address H | Address L | Data H is written | Data L is written | CRC16 | CRC16 |
Table 2 sends modification data
0x00 | 0x06 | 0x00 | 0x13 | 0x00 | 0x03 | 0x39 | 0xDF |
General modified address | Modify command word | Address H | Address L | Data H is written | Data L is written | CRC16 | CRC16 |
Ground station control system will modify resolution ratio instruction and be wirelessly sent to YL-500IL wireless data transmission module, and pass to
MCU controller after MCU controller receives instruction, is successively sent to each gas sensor in sequence according to command content
Unlock instruction and modification data command complete the resolution ratio modification of each gas sensor;The data frame of above-mentioned each instruction is equal
There are two the CRC16 check codes of byte for band;
Table 3 sends unlock instruction
0x01 | 0x06 | 0x00 | 0x11 | 0x00 | 0x18 | 0xD9 | 0xC5 |
Device address | Modify command word | Address H | Address L | Data H is written | Data L is written | CRC16 | CRC16 |
Table 4 sends modification data
0x01 | 0x06 | 0x00 | 0x1E | 0x00 | 0x01 | 0x28 | 0x0C |
Device address | Modify command word | Address H | Address L | Data H is written | Data L is written | CRC16 | CRC16 |
Note: module can be stablized in 30s after modification resolution ratio, and the use pattern of dynamic modification resolution ratio is please after the modification
30s reads data.Dynamic modification resolution ratio is used in the case where high concentrations of gas range is unable to reach.
C, when carrying out detection of gas with multiple constituents, MCU controller waits the times according to modified 8 gas sensor addresses
It is spaced to send to MAX485 module and reads data command, MAX485 module passes 8 gases using Modbus-RTU communications protocol
Sensor interrupts the data frame for receiving each gas sensor and returning by the serial ports free time, and data frame is passed to MCU controller;
Untreated data are sent the data to ground station control system by YL-500IL wireless data transmission module by last MCU controller
System;
Read gas sensor data:
Table 5 reads data command
0x01 | 0x03 | 0x00 | 0x00 | 0x00 | 0x01 | 0x84 | 0x0A |
Serial communication address | Reading order word | Initial address H | Initial address L | Length H | Length L | CRC16 | CRC16 |
6 sensor of table replys data
0x01 | 0x03 | 0x02 | 0x00 | 0x08 | 0xB9 | 0x82 |
Serial communication address | Reading order word | Data length | Data H | Data L | CRC16 | CRC16 |
Data H, L are the hexadecimal data of two bytes in table 6, and decimal value combination resolution ratio can be obtained by
Gas concentration value.Such as: resolution ratio 0.1, gas concentration data value are 0x0008, it can be deduced that gas concentration value is
0.8ppm。
Read gas sensor resolution ratio:
Table 7 reads resolution ratio instruction
0x01 | 0x03 | 0x00 | 0x1E | 0x00 | 0x01 | 0xE4 | 0x0C |
Serial communication address | Reading order word | Initial address H | Initial address L | Length H | Length L | CRC16 | CRC16 |
8 sensor replying instruction of table
0x01 | 0x03 | 0x02 | 0x00 | 0x03 | 0xF8 | 0x45 |
Serial communication address | Reading order word | Data length | Data H | Data L | CRC16 | CRC16 |
The data of two bytes of data H, L are written in table 8, decimal value indicates the accurate decimal of sensor resolution
Point digit.Such as: 0x0003, decimal value 1, expression are accurate to 3 decimals after decimal point, i.e. resolution ratio is 0.001.
Read gas sensor temperature data:
The instruction of 9 read through model temperature of table
0x01 | 0x03 | 0x00 | 0x01 | 0x00 | 0x01 | 0xD5 | 0xCA |
Serial communication address | Reading order word | Initial address H | Initial address L | Length H | Length L | CRC16 | CRC16 |
The instruction of 10 sensor recovery temperature of table
0x01 | 0x03 | 0x02 | 0x00 | 0x14 | 0xB8 | 0x4B |
Serial communication address | Reading order word | Data length | Data H | Data L | CRC16 | CRC16 |
The data of two bytes of data H, L in table 10, decimal value indicate sensor temperature.Such as: 0x0014, ten
Binary value is 20, indicates that temperature is 20 DEG C.
D, ground station control system receive after data according to the selected gas with various sensor of different application scene into
Then the gas concentration value that each sensor measures is calculated according to built data model in row data modeling;In the step D
Select scene of fire gaseous detection applications scene, specific process are as follows: used 8 gas sensors are respectively as follows: methane, ammonia
Gas, carbon monoxide, chlorine, benzene, hydrogen sulfide, hydrogen chloride, hydrogen fluoride;
Due to there is the gas of above 8 kinds of components in the scene, cross one another influence, therefore each sensing between various gases
The correspondence gas concentration of device measurement is clearly inaccuracy;It, can be to known 8 kinds of gas in the case where securing gas component
The sample of concentration measures, and is modeled by gas concentration of the linear neural network to each component;
If linear neural network algorithm haves three layers altogether, respectively input layer, middle layer and output layer;Input layer is respectively first
Alkane, ammonia, carbon monoxide, chlorine, benzene, hydrogen sulfide, hydrogen chloride, hydrogen fluoride, the measured value of totally 8 gas sensors, output layer
Respectively methane, ammonia, carbon monoxide, chlorine, benzene, hydrogen sulfide, hydrogen chloride, hydrogen fluoride, the concentration value of totally 8 kinds of gas, intermediate
Layer is the adjustment layer of input layer, which is that multivariate regression linearly inputs, and it is as follows that formula is arranged in middle layer:
In formula (1): I meets 0≤x1+x2+L+x8≤2;x1、x2、L、x8The respectively number of combinations of integer 0;
By above-mentioned 8 kinds of gas sensor variable Xs1,X2,L,X8Instead of according to formula (1), multicomponent gas sensing data
One-dimensional matrix is arranged in blending algorithm middle layer:
X45×1For 45 × 1 matrix,Methane, ammonia, L, hydrogen fluoride are respectively indicated, totally 8 kinds of gas
The concentration measurement of body, middle layer to the weight matrix between output layer are W8×45, determine the power between middle layer and output layer
After value W, the sensor sample value of real-time measurement calculates step using linear neural network and obtains concentration output;
The nominal data of every kind of gas takes 7 groups respectively, i.e., to 78Group data, according to formula (2), (3) by marked gas concentration,
Gas concentration normalization is measured, as shown in table 1.
In formulaFor m-th of sample neural network output, input normalized value;Xim、PmFor m-th of sample i-th
The input of a sensor, output calibration value;Xmax、Xmin, Pmax、PminFor sensor input is maximum, minimum value, output is maximum, most
Small calibration value;
1 neural network input and output standard sample database of table
According to the 8 of Fig. 3 gas sensor data blending algorithm structures, linear neural network is organized into following formula:
C8×1=W8×45X45×1 (4)
X in formula (4)i(i=1,2, L, 45) can be by the data in table 1 according to one-dimensional matrix X45×1It can be calculated;wi,j(i=
1,2;J=1,2, L, 45) it is linear neural network weight;ci(i=1,2, L, 8) is that neural network estimates 8 kinds of gas concentrations
Evaluation;
Evaluated error are as follows:
esti m(k)=Pi m-Ci m(k) (5)
Weight tune updates:
In formula: Ci m(k) the output estimation value of m-th of sample of neural network is walked for kth;Pi mIt is defeated for m-th of sample of calibration point
Enter the desired output of value and i-th of neural network output;esti mIt (k) is evaluated error, kth step neural network output is estimated
The difference of evaluation and desired output;wij(k) when being walked for kth, j-th of connection weight;ηijFor Studying factors;Its selection influences
To the stability and convergence rate of iteration.
The learning procedure of neural network is:, will be in 1 Plays sample database of table using linear neural network designed by Fig. 1
's As the input of network,As the output desired value of network, according to formula
(5), (6) training wi,j(i=1,2;J=1,2, L, 45), the initial value of weight chooses the random number between (- 1,1);By standard
Inputoutput data in sample database is sequentially brought into neural network, by successive ignition with new weight, until neural network
The estimate error mean-square value of output valve is lower than setting value, and learning process terminates at this time;Weight is that neural network reading data are melted
Collaboration number, in order to guarantee convergence rate and stability, in learning process, Studying factors ηij(i=1,2;J=1,2, L, 45) it takes
For parameter, 0.4 is changed to from 0.95;Gas concentration measurement model is obtained in turn, wherein W known to weight matrix8×45, input X45×1For
(prediction) matrix to be measured, model expression such as formula (4);
Finally, according to formula (3) renormalization to get arrive true gas concentration.
E, the data obtained in step (4) are filtered by Kalman filtering algorithm, after finally obtaining filtering
Actual gas concentration value;The specific filtering of the step E are as follows:
Since the carbonomonoxide concentration rule that changes with time is similar to normal distribution, the data that step D is obtained
Carry out normal distribution fitting:
Kalman filtering processing is Linear system model, is fitted with second order polynomial to above-mentioned data, obtains outlet
Property expression formula;
SCO=at2+bt+c (8)
In formula: a, b, c are the datum obtained according to different application scene;
According to Kalman filtering algorithm, it is necessary first to determine state difference equation and its measurement mapped out of linear system
Equation.
Xt=AXt-1+BUt-1+Wt-1 (9)
Zt=HXt+Vt (10)
X: the state vector of system;
A: transition matrix;
U: system input;
B: the matrix of state is converted the input into;
W: system noise;
Z: measured value;
H: the transition matrix of state variable to measured value;
V: measurement noise
State vector X is defined according to formula (8), (9), (10)t, A, B, U:
U=[- 0.0010096]
For gas sensor measured value, that is, gas concentration, therefore obtain Z, H:
Z=[zk]
H=[1 0]
For the system noise W and measurement noise V in state equation, it is assumed that obey following multivariate Gaussian distribution, and W, V
It is independent from each other;Wherein Q, R are the covariance matrix of noise variance, and Q, R can be obtained according to measurement sample statistics analysis;
P (w)~N (0, Q)
P (v)~N (0, R)
The step of above-mentioned model is carried out Kalman filtering is as follows:
Wherein P is estimated valueWith true value xkCovariance matrix;Loop iteration is multiple, i.e., after acquisition Kalman filtering
Gas concentration value.
Claims (6)
1. a kind of detection of gas with multiple constituents device based on RS485 network, which is characterized in that including multiple gas sensors,
MAX485 interface module, MCU controller, YL-500IL wireless data transmission module, USART1 interface and the MAX485 of MCU controller connect
The connection of mouth mold block, the USART2 interface of MCU controller connect with YL-500IL wireless data transmission module, MAX485 interface module and
The connection of RS485 bus, multiple parallel carries of gas sensor are in RS485 bus.
2. a kind of detection of gas with multiple constituents device based on RS485 network according to claim 1, which is characterized in that institute
The circuit in MAX485 interface module is stated using automatic transceiving circuit, for realizing the transmitted in both directions of information flow.
3. a kind of detection of gas with multiple constituents device based on RS485 network according to claim 1, which is characterized in that institute
Stating gas sensor is 8.
4. a kind of detection of gas with multiple constituents method according to claim 1 based on RS485 network, which is characterized in that tool
Body step are as follows:
A, gas sensor network is built based on RS485;
B, resolution ratio, address and the check code of 8 gas sensors are set;Ground station control system instructs modified address wireless
It is sent to YL-500IL wireless data transmission module, and passes to MCU controller, after MCU controller receives instruction, according in instruction
Hold and successively send unlock instruction and modification data command to each gas sensor in sequence, completes each gas sensor
Address modification;
Ground station control system will modify resolution ratio instruction and be wirelessly sent to YL-500IL wireless data transmission module, and pass to MCU
Controller after MCU controller receives instruction, successively sends unlock to each gas sensor in sequence according to command content
Instruction and modification data command, complete the resolution ratio modification of each gas sensor;The data frame of above-mentioned each instruction has
The CRC16 check code of two bytes;
C, when carrying out detection of gas with multiple constituents, MCU controller is according to modified 8 gas sensor addresses, constant duration
It is sent to MAX485 module and reads data command, MAX485 module is using Modbus-RTU communications protocol to 8 gas sensors
The data frame for receiving each gas sensor and returning is interrupted by the serial ports free time, and data frame is passed into MCU controller;Finally
Untreated data are sent the data to ground station control system by YL-500IL wireless data transmission module by MCU controller;
D, ground station control system is counted after receiving data according to the selected gas with various sensor of different application scene
According to modeling, the gas concentration value that each sensor measures then is calculated according to built data model;
E, the data obtained in step D are filtered by Kalman filtering algorithm, are finally obtained filtered true
Gas concentration value.
5. the detection of gas with multiple constituents method according to claim 4 based on RS485 network, which is characterized in that the step
Scene of fire gaseous detection applications scene, specific process are as follows: used 8 gas sensors are respectively as follows: first are selected in rapid D
Alkane, ammonia, carbon monoxide, chlorine, benzene, hydrogen sulfide, hydrogen chloride, hydrogen fluoride;
It is modeled by gas concentration of the linear neural network to each component;
If linear neural network algorithm haves three layers altogether, respectively input layer, middle layer and output layer;Input layer is respectively methane, ammonia
Gas, carbon monoxide, chlorine, benzene, hydrogen sulfide, hydrogen chloride, hydrogen fluoride, the measured value of totally 8 gas sensors, output layer are respectively
Methane, ammonia, carbon monoxide, chlorine, benzene, hydrogen sulfide, hydrogen chloride, hydrogen fluoride, the concentration value of totally 8 kinds of gas, middle layer are defeated
Enter the adjustment layer of layer, which is that multivariate regression linearly inputs, and it is as follows that formula is arranged in middle layer:
In formula (1): I meets 0≤x1+x2+L+x8≤2;x1、x2、L、x8The respectively number of combinations of integer 0;
By above-mentioned 8 kinds of gas sensor variable Xs1,X2,L,X8Instead of according to formula (1), multicomponent gas Data Fusion of Sensor
One-dimensional matrix is arranged in algorithm middle layer:
X45×1For 45 × 1 matrix,L、Methane, ammonia, L, hydrogen fluoride are respectively indicated, totally 8 kinds of gas is dense
Measured value is spent, middle layer to the weight matrix between output layer is W8×45, after determining the weight W between middle layer and output layer,
The sensor sample value of real-time measurement calculates step using linear neural network and obtains concentration output;
The nominal data of every kind of gas takes 7 groups respectively, i.e., to 78Group data, according to formula (2), (3) by marked gas concentration, measurement
Gas concentration normalization;
In formulaFor m-th of sample neural network output, input normalized value;Xim、PmIt is passed for m-th i-th of sample
The input of sensor, output calibration value;Xmax、Xmin, Pmax、PminFor sensor input maximum, minimum value, output maximum, most small tenon
Definite value;
According to 8 gas sensor data blending algorithm structures, linear neural network is organized into following formula:
C8×1=W8×45X45×1(4)
X in formula (4)i(i=1,2, L, 45) can be by the data in table 1 according to one-dimensional matrix X45× 1 can be calculated;wi,j(i=1,
2;J=1,2, L, 45) it is linear neural network weight;ci(i=1,2, L, 8) is estimation of the neural network to 8 kinds of gas concentrations
Value;
Evaluated error are as follows:
esti m(k)=Pi m-Ci m(k)(5)
Weight tune updates:
In formula: Ci m(k) the output estimation value of m-th of sample of neural network is walked for kth;Pi mFor m-th of sample input value of calibration point,
It is also the desired output of i-th of neural network output;esti m(k) be evaluated error, kth walk neural network output estimation value with
The difference of desired output;wij(k) when being walked for kth, j-th of connection weight;ηijFor Studying factors;
The learning procedure of neural network is: designed linear neural network is used, it will be in standard sample databaseL、As the input of network,L、As the output desired value of network, according to formula (5), (6) training wi,j(i=
1,2;J=1,2, L, 45), the initial value of weight chooses the random number between (- 1,1);By the input and output in standard sample database
Data are sequentially brought into neural network, by successive ignition with new weight, until the estimate error of neural network output valve
Mean-square value is lower than setting value, and learning process terminates at this time;Weight is that neural network reads data fusion coefficients, in learning process
In, Studying factors ηij(i=1,2;J=1,2, L, 45) it is taken as parameter, 0.4 is changed to from 0.95;And then obtain gas concentration measurement
Model, wherein W known to weight matrix8×45, input X45×1For moment matrix to be measured, model expression such as formula (4);
Finally, according to formula (3) renormalization to get arrive true gas concentration.
6. the detection of gas with multiple constituents method according to claim 4 based on RS485 network, which is characterized in that the step
The specific filtering of rapid E are as follows:
Since the carbonomonoxide concentration rule that changes with time is similar to normal distribution, the data that step D is obtained are carried out
Normal distribution fitting:
Above-mentioned data are fitted with second order polynomial, obtain linear representation;
SCO=at2+bt+c(8)
In formula: a, b, c are the datum obtained according to different application scene;
According to Kalman filtering algorithm, it is necessary first to determine state difference equation and its measurement side mapped out of linear system
Journey.
Xt=AXt-1+BUt-1+Wt-1(9)
Zt=HXt+Vt(10)
X: the state vector of system;
A: transition matrix;
U: system input;
B: the matrix of state is converted the input into;
W: system noise;
Z: measured value;
H: the transition matrix of state variable to measured value;
V: measurement noise
State vector X is defined according to formula (8), (9), (10)t, A, B, U:
U=[- 0.0010096]
For gas sensor measured value, that is, gas concentration, therefore obtain Z, H:
Z=[zk]
H=[1 0]
For the system noise W and measurement noise V in state equation, it is assumed that obey following multivariate Gaussian distribution, and W, V are phases
It is mutually independent;Wherein Q, R are the covariance matrix of noise variance, and Q, R can be obtained according to measurement sample statistics analysis;
P (w)~N (0, Q)
P (v)~N (0, R)
The step of above-mentioned model is carried out Kalman filtering is as follows:
Wherein P is estimated valueWith true value xkCovariance matrix;Loop iteration is multiple, i.e. gas after acquisition Kalman filtering
Bulk concentration value.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910039660.3A CN109596684B (en) | 2019-01-16 | 2019-01-16 | Multi-component gas detection device and method based on RS485 network |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910039660.3A CN109596684B (en) | 2019-01-16 | 2019-01-16 | Multi-component gas detection device and method based on RS485 network |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109596684A true CN109596684A (en) | 2019-04-09 |
CN109596684B CN109596684B (en) | 2021-02-05 |
Family
ID=65966072
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910039660.3A Active CN109596684B (en) | 2019-01-16 | 2019-01-16 | Multi-component gas detection device and method based on RS485 network |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109596684B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110133410A (en) * | 2019-05-31 | 2019-08-16 | 国网河北省电力有限公司石家庄供电分公司 | Diagnosis Method of Transformer Faults and system based on Fuzzy C-Means Cluster Algorithm |
CN113341066A (en) * | 2021-05-24 | 2021-09-03 | 西南石油大学 | Multi-sensor fusion technology-based on-line detection method and system for tetrahydrothiophene concentration |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106706862A (en) * | 2017-02-23 | 2017-05-24 | 北京工业大学 | In-car pollution gas monitoring device based on GSM (Global System for Mobile Communications) communication technology |
CN106780085A (en) * | 2016-12-12 | 2017-05-31 | 山东华福智慧能源科技有限公司 | Safe and intelligent poultry cultivation greenhouse system and method |
CN207964706U (en) * | 2018-03-20 | 2018-10-12 | 苏州天地衡遥感科技有限公司 | Unmanned plane multicomponent gas sensing system |
-
2019
- 2019-01-16 CN CN201910039660.3A patent/CN109596684B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106780085A (en) * | 2016-12-12 | 2017-05-31 | 山东华福智慧能源科技有限公司 | Safe and intelligent poultry cultivation greenhouse system and method |
CN106706862A (en) * | 2017-02-23 | 2017-05-24 | 北京工业大学 | In-car pollution gas monitoring device based on GSM (Global System for Mobile Communications) communication technology |
CN207964706U (en) * | 2018-03-20 | 2018-10-12 | 苏州天地衡遥感科技有限公司 | Unmanned plane multicomponent gas sensing system |
Non-Patent Citations (3)
Title |
---|
卢冠钟: "《船舶电气与自动化(下册:船舶自动化)》", 31 March 2014, 大连海事大学出版社 * |
邓鹏 等: "基于RS485通信的远程数据采集与控制系统设计", 《无线互联科技》 * |
韩世进 等: "基于RS-485的多路数据采集系统", 《现代电子技术》 * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110133410A (en) * | 2019-05-31 | 2019-08-16 | 国网河北省电力有限公司石家庄供电分公司 | Diagnosis Method of Transformer Faults and system based on Fuzzy C-Means Cluster Algorithm |
CN113341066A (en) * | 2021-05-24 | 2021-09-03 | 西南石油大学 | Multi-sensor fusion technology-based on-line detection method and system for tetrahydrothiophene concentration |
CN113341066B (en) * | 2021-05-24 | 2022-04-08 | 西南石油大学 | Multi-sensor fusion technology-based on-line detection method and system for tetrahydrothiophene concentration |
Also Published As
Publication number | Publication date |
---|---|
CN109596684B (en) | 2021-02-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP7154295B2 (en) | Motion detection based on machine learning of radio signal characteristics | |
JP7174073B2 (en) | Training data for motion detection systems using data from sensor devices | |
CN108171259A (en) | A kind of wisdom tip water quality monitoring system and method based on NB-IoT | |
CN109060023B (en) | Data quality control method and system for micro environment monitoring | |
CN104793651B (en) | The ammonia spraying amount control method of SNCR flue gas denitrification systems in manufacture of cement | |
CN109596684A (en) | A kind of detection of gas with multiple constituents device and method based on RS485 network | |
CN106310472B (en) | Ventilator calibrator (-ter) unit and ventilator calibration system | |
CN107945804A (en) | Task management and measurer data extraction system and its method based on speech recognition | |
CN113537063B (en) | Forest environment remote sensing monitoring method and terminal based on comprehensive remote sensing technology | |
CN109030566B (en) | Laboratory gas leakage diagnosis device and method | |
CN112733386B (en) | Multi-component reactive solute transport parameter inversion method based on deep neural network | |
CN108446531A (en) | Receptor Si and Al reconstructing method based on actual measurement derived components spectrum and Source apportionment | |
CN112611688A (en) | Automatic calibration device and method for atmosphere monitoring equipment | |
CN116382472A (en) | Multi-mode data-based wearable remote real-time monitoring system and method for electric power operators | |
CN107273659A (en) | A kind of trajectory predictions method for space junk photoelectric tracking based on RANSAC algorithm improvements | |
CN103411628A (en) | Processing method for random drift error of MEMS gyroscope | |
CN110967728B (en) | Gridding area multi-mode neutron dose monitoring method | |
CN105974058B (en) | The method of quick detection preservative water preperation based on electronic nose-artificial neural network | |
CN114544868B (en) | Gas detection method and system for eliminating influence of interference gas | |
CN107944417A (en) | Task management and measurer data extraction system and its method based on image recognition | |
CN114705177A (en) | Fiber-optic gyroscope attitude measurement data processing method based on error analysis | |
CN111475770B (en) | Component correction method and system for triaxial acceleration coordinate system | |
CN106767773A (en) | A kind of indoor earth magnetism reference map construction method and its device | |
CN112541569A (en) | Sensor online training system and method based on machine learning | |
CN108289127A (en) | A kind of Internet of things system for Medical Devices comprehensively monitoring |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20230419 Address after: Floor 5, No. 10, Lane 1555, Jinsha Jiangxi Road, Jiading District, Shanghai, 201803 Patentee after: SHANGHAI ROYALVIEW REMOTE SENSING ENGINEERING TECHNOLOGY CO.,LTD. Address before: 215000 78 Keling Road, science and Technology City, high tech Zone, Suzhou City, Jiangsu Province Patentee before: SUZHOU TDH REMOTE SENSING TECHNOLOGY CO.,LTD. |