Summary of the invention
The object of the invention is to the defect overcoming prior art, a kind of control method of the fluid flow control valve based on sensor network is provided.Fluid flow control valve passes through central control unit, the flow detection unit be connected with described central control unit, flow controlling unit, wireless communication unit, display unit, clock unit etc. complete the detection of flow in pipeline, the control of flow, data show, sensor network is formed between multiple flowrate control valve based on sensor network, adopt unified data transmission format and host computer to carry out wireless data communications, complete the real-time Transmission of field data.
For achieving the above object, the present invention proposes following technical scheme:
A kind of control method of the fluid flow control valve based on sensor network, to flow value in pipeline carry out Real-time Collection and and standard value carry out date comprision, by pid algorithm controlling opening of valve to make flow value consistent with standard value, this control method comprises:
The setting of standard value, central control unit receives setup parameter and the normal flow-timetable of host computer by wireless communication unit;
Real-time traffic data acquisition, central control unit sends pwm pulse signal to flow controlling unit, field power supply is provided to field coil after isolation is amplified, electrode signal linear with flow in pipeline near field coil gathers current signal value by central control unit after amplifying, and is namely obtained the real-time flow data in pipeline by computing;
Valve opening gathers, and central control unit detects the current opening value of butterfly valve by the Measuring opening sensor being arranged on butterfly valve place;
Time gathers, and central control unit gathers current time value by clock unit;
Date comprision, the data on flows that central control unit will gather, time value and butterfly valve opening value contrast with the inner normal flow-timetable prestored, and by pid algorithm to obtain butterfly valve opening regulated value;
Butterfly valve opening regulates, and aperture regulated value is sent in flow controlling unit and carried out butterfly valve opening adjustment by central control unit, makes present flow rate value consistent with normal stream value;
Data upload, when central control unit to be received by wireless communication unit that host computer sends upload the instruction of present flow rate value after, namely the parameters such as the present flow rate value of detection are sent to host computer by wireless communication unit by central control unit;
Data show, and the information such as the present flow rate value of collection, flow setting value, current flow, flow percentage, adjustment parameter are shown by display unit by central control unit;
In described flow data collector, central control unit sends pwm pulse signal and provide field power supply to field coil after isolation is amplified, magnetic field is produced in the pipeline of field coil around it, in pipeline, the liquid cutting magnetic field of flowing is to produce voltage signal, voltage signal is drawn by the electrode in channel interior isolation surface, and amplify through instrument amplifier, then by central control unit Real-time Collection current voltage value, namely obtained the real-time flow data in pipeline by computing.
In the setting of described standard value, be fixed value for flow, do not need to change in time, user can pass through the direct inlet flow value of host computer to central control unit, to guarantee that the flow value of this operation valve remains fixed value.
In the setting of described standard value, be changing value for flow, namely standard value changes in time and changes, host computer is by the instruction of m-flow curve parameter " time ", send and organize flow, time data to central control unit more, the data of central control unit according to time sequencing storage and according to each time period flow value carry out flow control.
During described butterfly valve opening regulates, aperture regulated value is sent on the driver in flow controlling unit by central control unit, rotate, thus regulating butterfly valve forward or reverse reaches corresponding opening value with Driving Stepping Motor.
Data interaction transmission is carried out by wireless communication unit between central control unit and host computer, by having the nRF905 module of wireless power amplifier function, adopt unified data transmission format and host computer to carry out wireless data communications, complete the real-time Transmission of field data.
The network-building method of wireless sensor network is also comprised in this control method, multiple flowrate control valve carries out networking by wireless communication unit, form wireless sensor network, unified data transmission format and host computer is adopted to carry out data interaction, each flowrate control valve has specific No. IP, as basic point or can forward point in sensor network, networking has been set by " networking parameter instruction " by host computer.
The fluid flow control valve based on sensor network related in this control method, comprise central control unit, the wireless communication unit be connected with described central control unit, flow detection unit, flow controlling unit, display unit and clock unit, described flow detection unit is used for uninterrupted in signal piping, and feed back to central control unit, described flow controlling unit is according to uninterrupted in central control unit signal control flow check buret, and described central control unit carries out radio communication by wireless communication unit and host computer.
Wherein, described flow detection unit comprises field coil, conductive electrode, connects the instrument amplifier of described conductive electrode, field power supply and driver for isolating.
Described flow controlling unit comprises driver, stepper motor, butterfly valve, Measuring opening sensor.
Described flow controlling unit also comprises reducer of turbodrill butterfly valve being realized to self-locking.
Described wireless communication unit adopts the nRF905 module with wireless power amplifier to realize radio communication.
Faraday's electromagnetic induction law is adopted to carry out fluid flow detection in the present invention, when the conductor perpendicular to magnetic direction does cutting magnetic line movement with certain speed, certain induction electromotive force can be produced at the two ends of conductor, the present invention is wound around field coil by flowtube outside and generates an electromagnetic field in flowtube inside, when liquid flows through in flowtube, conductive electrode on isolation surface produces certain voltage, thus flow rate of liquid change can be determined by the size detecting this induction electromotive force.
Compared with prior art, the present invention is based on the control method of the fluid flow control valve of sensor network, there is following beneficial effect:
Flowrate control valve and host computer can realize bidirectional information by wireless communication unit and exchange, instead of unidirectional flowrate control valve transmits data to host computer;
Fluid flow detects not by the density of fluid simultaneously, viscosity, temperature, the impact of pressure and conductance, and voltage signal and the flow velocity of conductive electrode detection are linear, and measuring accuracy is high, simultaneously without pressure loss, and fast operation, Measurement sensibility;
By certain data communication format between multiple flowrate control valve, mutual composition sensor network, each flowrate control valve is as the node of in network, transmission signal can be received, also can forward signal, by the direct parameters of remote control center, remove from and manually arranging one by one, sensor network removes wiring trouble from simultaneously, reduces operation cost, improves reliability.
Embodiment
Below in conjunction with accompanying drawing of the present invention, clear, complete description is carried out to the technical scheme of the embodiment of the present invention.
As shown in Figure 1, disclosed a kind of fluid flow control valve based on sensor network, for detecting in real time flow, controlling, data transmission, specifically comprise central control unit, the wireless communication unit be connected with described central control unit, flow detection unit, flow controlling unit, spare communication unit, display unit and clock unit.
Particularly, described flow detection unit is used for flow rate of liquid size in signal piping based on Faraday's electromagnetic induction law, specifically comprise the field coil being wrapped in flowtube outside, be arranged on the conductive electrode on flowtube internal insulation face, connect the instrument amplifier of described conductive electrode, field power supply and driver for isolating, described central control unit sends pwm pulse signal to driver for isolating, driver for isolating excitation coil produces magnetic field in flowtube inside, near liquid stream overexcitation coil during pipeline, continuous cutting magnetic line, thus produce the voltage be directly proportional to fluid velocity, drawn by conductive electrode and carry out signal amplification by instrument amplifier, finally carry out AD collection by central control unit.Select AD8237 as instrument amplifier in this unit, it has ultra-high input impedance, pole low-leakage current and outstanding common-mode rejection ratio (CMRR), according to the character of fluid and the scope of flow velocity, digital regulation resistance by two relative match arranges any gain between 1 to 1000, superior performance, good stability, in addition ADP2441 is selected to carry out DC/DC conversion as field power supply, effectively prevent the EMC immunity to interference of power supply on the impact of flow signal monitoring precision and stability, binary channels gate drivers chip ADuM3220 is selected to driver for isolating, make the isolation advantage between input and output with true electric current, isolated gate can be crossed over and realize voltage transitions.
Described flow controlling unit is used for fluid flow size in pilot piping, comprise driver, stepper motor, butterfly valve, Measuring opening sensor and reducer of turbodrill, described butterfly valve has valve rod and butterfly plate, stepper motor band ovable valve stem described in described driver drives rotates, thus regulate the aperture of butterfly plate to control uninterrupted, described Measuring opening sensor detects the aperture of described butterfly plate and feeds back to central control unit, and described reducer of turbodrill is arranged on valve rod, makes butterfly plate have auto-lock function, improve the handling of valve rod simultaneously, improve control accuracy.
Described wireless communication unit adopts the nRF905 module with wireless power amplifier to realize long distance wireless digital communication, nRF905 is chip communication module, support multichannel communicates, and switching time is less than 650us, data low speed enters, transmitted at high speed is gone out, send data time automatically generated data frame head and calculate CRC check and, when receiving code, address detected is carried out to code, and calculate CRC and guarantee data accuracy, radio communication is carried out by wireless communication unit between described flowrate control valve and remote control center, radio communication is carried out by wireless communication unit between described plural flowrate control valve.
Described clock unit is used for detection system current time, feed back to central control unit, described display unit adopts color LCD display, to show present flow rate setting value, current flow, flow percentage, the information such as adjustment parameter, described spare communication unit is when described wireless communication unit breaks down, and emergent alternative described wireless communication unit, adopts RS485 serial ports to communicate.
Described central control unit is for adopting STM32F103 single-chip microcomputer, it has the RISC kernel of ARM Cortex-M332 position, maximum operation frequency is 72MHz, simultaneously also built-in storer at a high speed, abundant enhancing I/O port and be connected to the peripheral hardware of two APB buses, operationally signal piping present flow rate value, the current opening value of butterfly plate and current time value, the setting flow value simultaneously prestored according to inside and current actual measurement flow value contrast, pid algorithm is adopted to regulate butterfly plate aperture according to contrast difference, thus adjust flux size, present flow rate value is shown by display unit simultaneously, and be sent to remote control center (host computer) by wireless communication unit.
The control method of disclosed a kind of fluid flow control valve based on sensor network, comprises the steps:
1. start flowrate control valve, flowrate control valve is carried out system initialization, read present flow rate settings (standard value), read networking configuration data, carry out protocol initializing, networking configuration, wireless communication unit is set to receiving mode;
2. detect the data whether communication port receives host computer transmission, if "No", carry out flow data collector and control, concrete steps are:
(1). during flow data collector, central control unit sends pwm pulse signal to driver for isolating, excitation coil produces magnetic field, the liquid cutting magnetic field of flowing is produced voltage and is drawn by conductive electrode, electrode signal gathers current signal value by central control unit after amplifying, and is namely obtained the real-time flow data in pipeline by computing;
(2). central control unit gathers the current time value of clock unit, gathers the current opening value of butterfly valve by Measuring opening sensor;
(3). central control unit is by present flow rate value, the current-time standard scale of time value and internal preset contrasts, and adopts pid algorithm and draws aperture adjusted value in conjunction with current opening value;
(4). central control unit sends a control signal to driver drives stepper motor according to aperture adjusted value, the aperture of regulating butterfly valve, thus makes flow value reach default present flow rate value;
(5). central control unit shows flow information by display unit;
3. the packet received according to communication port verifies, and as check errors, then sends " check errors " reply data bag to host computer, as correct in verified, then send " verification is correct " reply data bag and to host computer, and resolve packet;
4. the packet received according to communication port is resolved, if " uploading real time data " instruction, then gathers and uploads the real-time information such as direction, fluid flow valve, flow velocity, total amount value and work state information of real-time fluid flowing;
5. the packet received according to communication port is resolved, if " setting of controling parameters P, I, D that valve flow regulates " instruction, then and the pid parameter in real-time update system fading margin process, and carry out regulable control with new pid parameter;
6. the packet received according to communication port is resolved, if during the instruction that " sets given time, flow curve parameter ", upgrade the value (system stores at most time and the data on flows of 100 points) of the time after current time, flow curve point, and update time, flow curve regulating parameter;
7. the packet received according to communication port is resolved, if during " renewal system configuration parameter " instruction, upgrade the numbering (1-255 of operation valve, 1 byte), the gain of leading portion instrument amplifier setting (1 ~ 1000 times, 2 bytes), the data such as system clock (year, month, day, hour, min, second, 6 bytes), valve caliber (1 byte);
8. the packet received according to communication port is resolved, if during " networking parameter " instruction, upgrades networking supplemental characteristic;
Described in above-mentioned job step 2, " communication port " refers to wireless sensor module nRF905 receiving port or serial communication port, and program flow diagram is shown in shown in Fig. 2 and Fig. 5;
Networking parameter described in above-mentioned steps 8, host computer carries out on-the-spot networking configuration according to the deployment scenarios of field apparatus, multiple flowrate control valve and host computer form a sensor network, each flowrate control valve can be used as base-station node, simultaneously can as forward node, after wireless communication unit receives a frame data bag, the Frame of inside is resolved, destination address and Self address are compared simultaneously, if the same the packet sending to oneself is judged to be, once contrast is different, then carry out being forwarded to related flow control valve, program flow diagram as shown in Figure 2,
Described in a kind of control method of the fluid flow control valve based on sensor network, packet and order format are described below:
Unified data transmission format group-net communication is voluntarily adopted between flowrate control valve based on sensor network, network packet is containing a base-station node and some sensor nodes (flowrate control valve) be connected with host computer (industrial computer), each sensor node lays according to on-site actual situations, data transmission link is configured by systematic unity, and configuration information is issued to each sensor unit, in this transmission link, base-station node and each sensor node have oneself only address, in the transmission of such wireless data link, data must carry out the transmission of prescribed form, be specially:
The form of a complete frame data bag is as follows:
" packet header " 2 byte: 0x55,0xAA.
" data transfer destination location " 1 byte, for needing to send the destination-address arrived, its value 1-255 (0x01-0xFF).
" data transfer source address " 1 byte is the address, source of raw data packets, its value 1-255 (0x01-0xFF).
" instruction code " 1 byte, be " instruction " or " data " according to the value determination data bag of " instruction code ", the value of " instruction code " can be arranged according to actual needs.
" data length " 1 byte, the byte number of the valid data that expression is followed below.
" check code " 1 byte, valid data (the least-significant byte number of Data1 to Data n) sum.
" end mark " 1 byte: 0xBB.
In order to improve communication speed, coordinate nRF905 intercommunication form, the length of one frame data bag is no more than 32 bytes, in the packet (at every turn transmitting at most 32 bytes during system communication) of therefore frame 32 byte, actual valid data are 24 byte (Data1 ... Data n, n≤24).
" instruction code " 1 byte, be " instruction " or " data " according to the value determination data bag of " instruction code ", the value of " instruction code " can be arranged according to actual needs.
The relation of instruction code and data is as follows:
(1). reply data packet format
The form of a complete frame reply data bag is as follows:
Packet header " 2 bytes: 0x55,0xAA.
" data transfer destination location " 1 byte is answer party address., its value 1-255 (0x01-0xFF).
" data transfer source address " 1 byte is former take over party address.Its value 1-255 (0x01-0xFF).
" instruction code " 1 byte, " 0x5A " verification is correct, and " 0xA5 " check errors, needs to resend packet last time.
" data length " 1 byte, " 0x00 ".
" end mark " 1 byte, " 0xBB ".
(2). send the order format of " uploading real-time traffic data "
The frame data packet format that main frame sends " uploading real-time traffic data command " is as follows:
" packet header " 2 byte: 0x55,0xAA.
" data transfer destination location " 1 byte is answer party address., its value 1-255 (0x01-0xFF).
" data transfer source address " 1 byte is former take over party address.Its value 1-255 (0x01-0xFF).
" instruction code " 1 byte, " 0x81 "
" data length " 1 byte, " 0x00 ".
" end mark " 1 byte, " 0xBB ".
(3). upload " real-time traffic data " data packet format
Send out a frame real-time traffic packet from machine and mainly comprise the direction of fluid flowing, fluid flow valve, flow velocity, total amount value and work state information, be convenient to host computer management, the form that data are formed is as follows:
" packet header " 2 byte: 0x55,0xAA.
" data transfer destination location " 1 byte, for needing to send the destination-address arrived, its value 1-255 (0x01-0xFF).
" data transfer source address " 1 byte is the address, source of raw data packets, its value 1-255 (0x01-0xFF).
" instruction code " 1 byte, " 0x82 ".
" data length " 1 byte, " 0x14 " need transmit altogether the valid data of 20 bytes.A few part speed such as " flow value " of " fluid flow direction ", fluid, " flow speed value " of fluid, " the total flow value " of fluid, valve current " opening value ", system " nearly ten days frequency of power cut values ", system " always have a power failure the number of minutes for nearly ten days " is according to composition.
Data1 byte: fluid flow direction, " 0 " forward, " 1 " is reverse.
Data4, Data3, Data2: three byte composition flow values, the decimal numeral compressed code form of every byte representation two.Specific algorithm is as follows:
Data2=(Data2>>4)*10+(Data2&0x0F)
Data3=(Data3>>4)*10+(Data3&0x0F)
Data4=(Data4>>4)*10+(Data4&0x0F)
Flow value=10000*Data4+100*Data3+Data2
Data5 byte: the index (powers of 10) of flow value, values of powers=Data5-5, values of powers scope :-5-+5, the i.e. position of radix point.Value scope=the 0.00001-999999*105 of flow;
Data6 byte: flux unit
Data6 |
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
Unit |
m
3/s
|
m
3/min
|
m
3/h
|
m
3/d
|
L/s |
L/min |
L/h |
L/d |
Data6 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
Unit |
t/s |
t/min |
t/h |
t/d |
kg/s |
kg/min |
kg/h |
kg/d |
Data9, Data8, Data7: three bytes composition flow speed values, the decimal numeral compressed code form of every byte representation two (Data9 low four effectively).Specific algorithm is as follows:
Data7=(Data7>>4)*10+(Data7&0x0F)
Data8=(Data8>>4)*10+(Data8&0x0F)
Data9=(Data9&0x0F);
Flow speed value=10000*Data9+100*Data8+Data7
Flow value display precision (after reservation radix point figure place) (fixed value 3)
Value scope=00.000 ~ 99.999
Flow rate: be fixed as m/s
Data14, Data13, Data12, Data11, Data10:5 byte composition forward (or oppositely) total amount value (determining it is forward or oppositely according to the value of Data1), the decimal numeral compressed code form of every byte representation two.Specific algorithm is as follows:
Data10=(Data10>>4)*10+(Data10&0x0F)
Data11=(Data11>>4)*10+(Data11&0x0F)
Data12=(Data12>>4)*10+(Data12&0x0F)
Data13=(Data13>>4)*10+(Data13&0x0F)
Data14=(Data14>>4)*10+(Data14&0x0F)
Total amount=100000000*Data14+1000000*Data13+10000*Data12+100*Data11+ Data10;
Data15 byte: total amount unit
Data15 |
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
Unit |
0.001L |
0.01L |
0.1L |
1L |
0.001m
3 |
0.01m
3 |
0.1m
3 |
1m
3 |
Data15 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
Unit |
0.001kg |
0.01kg |
0.1kg |
1kg |
0.001t |
0.01t |
0.1t |
1t |
Data16, Data17: the current opening value of valve; The decimal numeral compressed code form of every byte representation two, specific algorithm is as follows:
Data16=(Data16>>4)*10+(Data16&0x0F)
Data17=(Data17 & 0x0F) (low four effectively)
Opening value=100*Data17+Data16
Opening value display precision (after reservation radix point figure place) (fixed value 1)
Opening value scope: 0.0 ~ 90.0 degree
Work state information transmission:
Data18 byte: nearly ten days frequency of power cut values is compressed code form, scope: 0 ~ 99 time.
Data20, Data19 byte: always have a power failure the number of minutes for nearly ten days, the decimal numeral compressed code form of every byte representation two, its worth scope is: 0 ~ 9999 minute.Specific algorithm is as follows:
Data19=(Data19>>4)*10+(Data19&0x0F)
Data20=(Data20>>4)*10+(Data20&0x0F)
Opening value=100*Data20+Data19
" check code " 1 byte, the least-significant byte number of valid data (Data1 to Data 20) sum.
" end mark " 1 byte: 0xBB.
(4). the data packet format of transmission control parameters
Flowrate control valve can carry out flow regulation according to the flow control methods (pid value) of host computer setting, and flow rate adjusting method can be divided into set-point to carry out regulating or regulating according to given time, flow curve.Flow regulation parameter instruction is divided into pid parameter to arrange and flow set-point or given time, flow curve value regulate.Packet is divided into two kinds of data, and a kind of is setting to controling parameters P, I, D parameter, and another kind is the setting of given flow value.
The setting of controling parameters P, I, D that valve flow regulates.Concrete instruction and data form is as follows:
" packet header " 2 byte: 0x55,0xAA.
" data transfer destination location " 1 byte, for needing to send the destination-address arrived, its value 1-255 (0x01-0xFF).
" data transfer source address " 1 byte is the address, source of raw data packets, its value 1-255 (0x01-0xFF).
" instruction code " 1 byte, " 0x83 ".
" data length " 1 byte, " 0x0C " need transmit altogether the valid data of 12 bytes.Be respectively the value of Valve controlling parameter P, I, D, each value accounts for 4 bytes.
Data3, Data2, Data1: the controling parameters ratio value P of three byte composition adjust flux values, the decimal numeral compressed code form of every byte representation two.Specific algorithm is as follows:
Data1=(Data1>>4)*10+(Data1&0x0F)
Data2=(Data2>>4)*10+(Data2&0x0F)
Data3=(Data3>>4)*10+(Data3&0x0F)
Ratio value P=10000*Data3+100*Data2+Data1
Data4 byte: the index (powers of 10) of ratio value P, values of powers=Data4-5, scope :-5-+5, the i.e. position of radix point.Scope=the 0.00001-999999*105 of ratio value P;
Data7, Data6, Data5: the controling parameters differential value I of three byte composition adjust flux values, the decimal numeral compressed code form of every byte representation two.Specific algorithm is as follows:
Data5=(Data5>>4)*10+(Data5&0x0F)
Data6=(Data6>>4)*10+(Data6&0x0F)
Data7=(Data7>>4)*10+(Data7&0x0F)
Differential value I=10000*Data7+100*Data6+Data5
Data8 byte: the index (powers of 10) of differential value I, values of powers=Data8-5, scope :-5-+5, the i.e. position of radix point.Scope=the 0.00001-999999*105 of differential value I;
Data11, Data10, Data9: the controling parameters integrated value D of three byte composition adjust flux values, the decimal numeral compressed code form of every byte representation two.Specific algorithm is as follows:
Data9=(Data9>>4)*10+(Data9&0x0F)
Data10=(Data10>>4)*10+(Data10&0x0F)
Data11=(Data11>>4)*10+(Data11&0x0F)
Integrated value D=10000*Data11+100*Data10+Data9
The index (powers of 10) of Data12 byte: integrated value D, values of powers=Data12-5, scope :-5-+5, the i.e. position of radix point.Scope=the 0.00001-999999*105 of integrated value D;
" check code " 1 byte, the least-significant byte number of valid data (Data1 to Data 12) sum.
" end mark " 1 byte: 0xBB.
, set the given time, flow curve parameter instruction and data form as follows, concrete instruction and data form is as follows:
" data transfer destination location " 1 byte, for needing to send the destination-address arrived, its value 1-255 (0x01-0xFF).
" data transfer source address " 1 byte is the address, source of raw data packets, its value 1-255 (0x01-0xFF).
" instruction code " 1 byte, " 0x84 ".
" data length " 1 byte, " 0x18 " (number of data points transmitted according to actual needs determines), one frame data bag can transmit at most the valid data of 24 bytes, the setting data of each timing node is made up of 8 bytes, be respectively flow value 5 byte, time 3 byte, therefore a frame data bag once can transmit the given flow set-point data of three time points, if transmit multiple spot time data, can repeatedly transmit, be that setting value and time value are different, flow control valve system can control according to time sequencing sequence automatically automatically.The form of a node data is as follows:
Data3, Data2, Data1: three byte composition given flow values, the decimal numeral compressed code form of every byte representation two.Specific algorithm is as follows:
Data1=(Data1>>4)*10+(Data1&0x0F)
Data2=(Data2>>4)*10+(Data2&0x0F)
Data3=(Data3>>4)*10+(Data3&0x0F)
Flow value=10000*Data3+100*Data2+Data1
Data4 byte: the index (powers of 10) of flow value, values of powers=Data5-5, scope :-5-+5, the i.e. position of radix point.Value scope=the 0.00001-999999*105 of flow;
Data5 byte: flux unit
Data5 |
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
Unit |
m
3/s
|
m
3/min
|
m
3/h
|
m
3/d
|
L/s |
L/min |
L/h |
L/d |
Data5 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
Unit |
t/s |
t/min |
t/h |
t/d |
kg/s |
kg/min |
kg/h |
kg/d |
Data6 byte: clock value, for the binary-coded decimal scope of compression is 0-23;
Data7 byte: minute value, for the binary-coded decimal scope of compression is 0-59;
Data8 byte: second is worth, for the binary-coded decimal scope of compression is 0-59;
Data16 ~ Data9, Data24 ~ Data17, form are the same.
" check code " 1 byte, the least-significant byte number of valid data (Data1 to Data 24) sum.
" end mark " 1 byte: 0xBB.
(5). system configuration parameter data packet format
The renewal of system configuration parameter comprises the numbering (1-255 upgrading operation valve, 1 byte), the gain of leading portion instrument amplifier setting (1 ~ 1000 times, 2 bytes), system clock (year, month, day, hour, min, second, 6 bytes), valve caliber (1 byte), need data 10 bytes.Concrete order format is as follows:
" packet header " 2 byte: 0x55,0xAA.
" data transfer destination location " 1 byte, be need send arrive destination-address, its value 1-255 (0x01-0xFF, equipment initial address be " 0xFF).
" data transfer source address " 1 byte is the address, source of raw data packets, its value 1-255 (0x01-0xFF).
" instruction code " 1 byte, " 0x85 ".
" data length " 1 byte, " 0x0A ".
Data1 byte, the numbering (address) of the equipment of new definition, its value scope is: 1-255;
Data3, Data2 two bytes, its value is the gain set-point (1 ~ 1000) of front end instrument amplifier, and every byte is that the binary-coded decimal of compression is formed.
Data4 byte is system clock " year " value, is the binary-coded decimal value of compression, scope (1 ~ 99);
Data5 byte is system clock " moon " value, is the binary-coded decimal value of compression, scope (1 ~ 12);
Data6 byte is system clock " day " value, is the binary-coded decimal value of compression, scope (1 ~ 31);
Data7 byte, for system clock " time " value, be compression binary-coded decimal value, scope (0 ~ 23);
Data8 byte, for system clock " divides " value, is the binary-coded decimal value of compression, scope (0 ~ 59);
Data9 byte is system clock " second " value, is the binary-coded decimal value of compression, scope (0 ~ 59);
Data10 byte is the valve caliber of system, is use during calculated flow rate value, and the value of Data10 is the BCD of compression, and corresponding relation sees the following form, and unit is mm.
Table 3.1 caliber correspondence table
Data10 numerical value |
Represent caliber |
Data10 numerical value |
Represent caliber |
Data10 numerical value |
Represent caliber |
0 |
3 |
15 |
200 |
30 |
1400 |
1 |
6 |
16 |
250 |
31 |
1600 |
2 |
8 |
17 |
300 |
32 |
1800 |
3 |
10 |
18 |
350 |
33 |
2000 |
4 |
15 |
19 |
400 |
34 |
2200 |
5 |
20 |
20 |
450 |
35 |
2400 |
6 |
25 |
21 |
500 |
36 |
2600 |
7 |
32 |
22 |
600 |
37 |
2800 |
8 |
40 |
23 |
700 |
38 |
3000 |
9 |
50 |
24 |
800 |
|
|
10 |
65 |
25 |
900 |
|
|
11 |
80 |
26 |
1000 |
|
|
12 |
100 |
27 |
1100 |
|
|
13 |
125 |
28 |
1200 |
|
|
(6). networking parameter instruction and data layout
Native system adopts the nRF905 of band power amplifier to realize long distance wireless digital communication, effective face-to-face communication distance more than 2000 meters, therefore, in most cases each sensor node (flowrate control valve) directly direct point-to-point communication with base-station node (industrial computer).In order to improve the reliability (preventing communication distance in practical application to be subject to the impact of many factors) of system transfers data, data transmission link is configured by systematic unity according to the actual situation that lays, and networking parameter instruction is exactly arrange each sensor node role in a network.Concrete instruction and data form is as follows:
" packet header " 2 byte: 0x55,0xAA.
" data transfer destination location " 1 byte, for needing to send the destination-address arrived, its value 1-255 (0x01-0xFF).
" data transfer source address " 1 byte is the address, source of raw data packets, its value 1-255 (0x01-0xFF).
" instruction code " 1 byte, " 0x86 ".
" data length " 1 byte, according to the length of the link structure determination data of reality, the setting of each link takies 3 bytes.
Data1, Data2, Data3 tri-byte form one group of link configuration, Data1 is " data transfer destination location or data transfer source address ", and Data2 is " forwarding data address ", and Data3 is " data transfer source address or data transfer destination location ".If there are many group links, data are arranged in order, and a frame data bag can arrange at most 8 link group.System software judges whether will forward according to the destination address of address own, data, the source address of data.
Technology contents of the present invention and technical characteristic have disclosed as above; but those of ordinary skill in the art still may do all replacement and the modification that do not deviate from spirit of the present invention based on teaching of the present invention and announcement; therefore; scope should be not limited to the content that embodiment discloses; and various do not deviate from replacement of the present invention and modification should be comprised, and contained by present patent application claim.