The content of the invention
It is an object of the invention to the defect for overcoming prior art, there is provided a kind of fluid flow control based on sensor network
The control method of valve processed.Fluid flow control valve is by central control unit, the flow inspection being connected with the central control unit
Survey unit, flow controlling unit, wireless communication unit, display unit, clock unit etc. and complete the detection of flow, flow in pipeline
Control, data display, sensor network is constituted between multiple flow control valves based on sensor network, using unified number
RFDC is carried out according to transformat and host computer, the real-time Transmission of field data is completed.
To achieve 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, is adopted in real time to flow value in pipeline
Collect and carry out date comprision with standard value, should by pid algorithm controlling opening of valve so that flow value is consistent with standard value
Control method includes:
The setting of standard value, central control unit receives the setup parameter and normal stream of host computer by wireless communication unit
Amount-timetable;
Real-time traffic data acquisition, central control unit sends pwm pulse signal to flow controlling unit, amplifies through isolation
Field power supply is provided magnet exciting coil afterwards, and nearby the interior electrode signal linear with flow of pipeline is amplified for magnet exciting coil
Current signal value is gathered by central control unit, is to obtain the real-time flow data in pipeline by computing;
Valve opening is gathered, and central control unit detects that butterfly valve is current by the Measuring opening sensor at butterfly valve
Opening value;
Time gathers, and central control unit gathers current time value by clock unit;
Date comprision, central control unit is by the data on flows of collection, and time value and butterfly valve opening value and inside are pre-
Normal flow-the timetable deposited is contrasted, and by pid algorithm to obtain butterfly valve opening regulated value;
Butterfly valve opening is adjusted, and aperture regulation value is sent into and butterfly valve opening tune is carried out in flow controlling unit by central control unit
Section so that present flow rate value is consistent with normal stream value;
Data are uploaded, when central control unit receives the upload present flow rate of host computer transmission by wireless communication unit
After value instruction, the parameters such as the present flow rate value of detection are sent to host computer by central control unit by wireless communication unit;
Data display, central control unit is by the present flow rate value of collection, flow setting value, current flow, flow percentage
Shown than information such as, adjusting parameters by display unit;
In the flow data collector, central control unit sends pwm pulse signal after isolation amplification to magnet exciting coil
Field power supply is provided, magnet exciting coil produces the liquid cutting magnetic field of flowing in magnetic field, pipeline to produce in the pipeline around it
Voltage signal, voltage signal is drawn by the electrode in channel interior isolation face, and is amplified by instrument amplifier, then in
Centre control unit gathers current voltage value in real time, is to obtain the real-time flow data in pipeline by computing.
In the setting of the standard value, it is fixed value for flow, is not required to change over time and change, user can lead to
Cross host computer and directly input flow value to central control unit, fixed value is remained with the flow value for ensuring the control valve.
It is that changing value, i.e. standard value are changed over time and changed for flow in the setting of the standard value, it is upper
Machine can send multigroup flow, time data to central control unit, center control by the instruction of m- flow curve parameter " when "
Unit processed stores according to time sequencing and carries out flow control according to the data of each period flow value.
In the butterfly valve opening regulation, central control unit sends aperture regulation value the driving to flow controlling unit
On device, rotated with Driving Stepping Motor, so that regulating butterfly valve forward or reverse reaches corresponding opening value.
Data interaction is carried out by wireless communication unit between central control unit and host computer, by with wireless
The nRF905 modules of power amplifier function, carry out RFDC using unified data transmission format and host computer, complete scene
The real-time Transmission of data.
Also include the network-building method of wireless sensor network in the control method, multiple flow control valves pass through radio communication
Unit carries out networking, forms wireless sensor network, carries out data interaction using unified data transmission format and host computer, often
Individual flow control valve has specific No. IP, can be led in sensor network as basic point or forwarding point, networking by host computer
Cross " networking parameter instruction " setting completion.
The fluid flow control valve based on sensor network being related in this control method, including central control unit, with
The wireless communication unit of the central control unit connection, flow detection unit, flow controlling unit, display unit and clock list
Member, the flow detection unit is used for uninterrupted in signal piping, and feeds back to central control unit, and the flow control is single
Member according to central control unit signal control flowtube in uninterrupted, the central control unit by wireless communication unit with
Host computer carries out radio communication.
Wherein, the flow detection unit includes magnet exciting coil, and conductive electrode connects the instrument amplification of the conductive electrode
Device, field power supply and driver for isolating.
The flow controlling unit includes driver, stepper motor, butterfly valve, Measuring opening sensor.
The flow controlling unit also includes the reducer of turbodrill that self-locking is realized to butterfly valve.
The wireless communication unit uses the nRF905 modules with wireless power amplifier to realize radio communication.
Fluid flow detection is carried out using Faraday's electromagnetic induction law in the present invention, when the conductor perpendicular to magnetic direction
When doing cutting magnetic line movement with certain speed, certain induced electromotive force can be produced at the two ends of conductor, the present invention passes through stream
Winding magnet exciting coil produces electromagnetic field inside flowtube outside buret, when liquid flows through out of flowtube, leading on isolation face
Electrode produces certain voltage, so that flow rate of liquid change can be by detecting that the size of the induced electromotive force is determined.
Compared with prior art, the control method of the fluid flow control valve of the invention based on sensor network, with such as
Lower beneficial effect:
Flow control valve can realize that bidirectional information is exchanged with host computer by wireless communication unit, rather than unidirectional stream
Control valve transmits data to host computer;
Fluid flow detection simultaneously is not by the density of fluid, viscosity, temperature, the influence of pressure and conductance, conductive electricity
The voltage signal and flow velocity of pole detection are linear, and measurement accuracy is high, while no pressure is lost, arithmetic speed is fast, and measurement is steady
It is fixed;
By certain data communication format between multiple flow control valves, a sensor network is mutually constituted, it is each
Individual flow control valve all as a node in network, can receive transmission signal, also can forward signal, pass through remote control
The direct arrange parameter in center, removes one by one setting manually from, while sensor network removes wiring trouble from, reduces operation cost, carries
High reliability.
Embodiment
Below in conjunction with the accompanying drawing of the present invention, the technical scheme to the embodiment of the present invention carries out clear, complete description.
As shown in figure 1, a kind of disclosed fluid flow control valve based on sensor network, for flow
Detection in real time, control, data transfer are carried out, central control unit is specifically included, what is be connected with the central control unit is wireless
Communication unit, flow detection unit, flow controlling unit, spare communication unit, display unit and clock unit.
Particularly, the flow detection unit, which is based on Faraday's electromagnetic induction law, is used for flow rate of liquid in signal piping
Size, specifically includes the magnet exciting coil being wrapped in outside flowtube, the conductive electrode on flowtube internal insulation face, even
Connect the instrument amplifier of the conductive electrode, field power supply and driver for isolating, the central control unit is to driver for isolating
Pwm pulse signal is sent, driver for isolating excitation coil produces magnetic field inside flowtube, and liquid flow overexcitation coil is attached
During nearly pipeline, continuous cutting magnetic line, so as to produce the voltage being directly proportional to fluid velocity, is drawn and passed through by conductive electrode
Instrument amplifier carries out signal amplification, finally carries out AD collections by central control unit.In this unit instrument is used as from AD8237
Table amplifier, it has ultra-high input impedance, extremely low leakage current and outstanding common-mode rejection ratio (CMRR), according to the property of fluid
With the scope of flow velocity, any gains between 1 to 1000 can be set by the digital regulation resistances of two relative matchings, superior performance,
Stability is good, carries out DC/DC conversion as field power supply from ADP2441 in addition, effectively prevents the EMC immunity to interference convection current of power supply
The influence of signal monitoring precision and stability is measured, binary channels gate drivers chip ADuM3220 is selected to driver for isolating, made
There is the isolation advantage of true electric current between must inputting and exporting, voltage conversion can be realized across isolated gate.
The flow controlling unit is used for fluid flow size in control piper, including driver, stepper motor, butterfly valve,
Measuring opening sensor and reducer of turbodrill, the butterfly valve have valve rod and butterfly plate, and the driver drives the stepper motor
Band ovable valve stem is rotated, so as to adjust the aperture control uninterrupted of butterfly plate, the Measuring opening sensor detects the butterfly plate
Aperture simultaneously feeds back to central control unit, and the reducer of turbodrill is arranged on valve rod so that butterfly plate has auto-lock function, simultaneously
Improve the handling of valve rod, improve control accuracy.
The wireless communication unit uses the nRF905 modules with wireless power amplifier to realize long distance wireless digital communication,
NRF905 is chip communication module, supports multichannel communication, and switching time is less than 650us, and data low speed enters, and sends out at a high speed
Be shot out, send data when automatically generated data frame head and calculate CRC check and, receive code when code is entered row address inspection
Surveying, and calculate CRC ensures data accuracy, is entered between the flow control valve and remote control center by wireless communication unit
Radio communication is carried out by wireless communication unit between row radio communication, the plural flow control valve.
The clock unit is used for detecting system current time, feeds back to central control unit, and the display unit is used
Color LCD display, to show present flow rate setting value, current flow, flow percentage, the information such as adjusting parameter is described standby
With communication unit in the case where the wireless communication unit breaks down, meet an urgent need and substitute the wireless communication unit, use
RS485 serial ports is communicated.
The central control unit is to use STM32F103 single-chip microcomputers, and it possesses in ARM Cortex-M332 RISC
Core, maximum operating frequency is 72MHz, while the also built-in memory of high speed, abundant enhancing I/O ports and is connected to two
The peripheral hardware of APB buses, operationally signal piping present flow rate value, the current opening value of butterfly plate and current time value, while basis
The setting flow value and currently practical measurement flow value that inside prestores are contrasted, according to contrast difference using pid algorithm to butterfly
Plate aperture is adjusted, so as to adjust uninterrupted, while present flow rate value is shown by display unit, and passes through channel radio
Letter unit is sent to remote control center (host computer).
A kind of control method of disclosed fluid flow control valve based on sensor network, including following step
Suddenly:
1. starting flow control valve, flow control valve is subjected to system initialization, present flow rate arranges value (standard is read
Value), read networking configuration data, carry out protocol initializing, networking configuration, wireless communication unit is set to reception pattern;
2. whether detection COM1 receives the data of host computer transmission, flow data collector and control are carried out if "No"
System, is concretely comprised the following steps:
(1) during flow data collectors, central control unit sends pwm pulse signal to driver for isolating, excitation line
Circle produces magnetic field, and the liquid cutting magnetic field of flowing produces voltage and drawn by conductive electrode, and electrode signal is amplified by center
Control unit gathers current signal value, is to obtain the real-time flow data in pipeline by computing;
(2) central control units gather the current time value of clock unit, and gathering butterfly valve by Measuring opening sensor works as
Preceding opening value;
(3) central control units are by present flow rate value, and the current-time standard scale of time value and internal preset is carried out pair
Than using pid algorithm and with reference to current opening value so as to draw aperture adjusted value;
(4) central control units send a control signal to driver Driving Stepping Motor according to aperture adjusted value, adjust butterfly
The aperture of valve, so that flow value reaches default present flow rate value;
(5) central control units show flow information by display unit;
3. the packet received according to COM1 is verified, such as check errors, then " check errors " response is sent
Packet is verified correctly to host computer, such as, then sends " verification is correct " reply data bag and solved to host computer, and to packet
Analysis;
4. the packet received according to COM1 is parsed, if " upload real time data " is instructed, then gather simultaneously
Upload the real time information such as direction, fluid flow valve, flow velocity, total amount value and the work state information of real-time fluid flowing;
5. the packet received according to COM1 is parsed, if " control parameter P, I, D of valve flow regulation
Setting " instruction, then the pid parameter during real-time update system fading margin, and control is adjusted with new pid parameter;
6. the packet received according to COM1 is parsed, if " setting given time, flow curve ginseng
During number " instruction, time after current time is updated, (system stores up to time and the stream of 100 points to the value of flow curve point
Measure data), and renewal time, flow curve regulation parameter;
7. the packet received according to COM1 is parsed, if during " renewal system configuration parameter " instruction, more
When the numbering (1-255,1 byte) of new control valve, the gain setting (1~1000 times, 2 bytes) of leading portion instrument amplifier, system
The data such as clock (year, month, day, hour, min, second, 6 bytes), valve caliber (1 byte);
8. the packet received according to COM1 is parsed, if during " networking parameter " instruction, updating networking ginseng
Number data;
" COM1 " refers to wireless sensor module nRF905 receiving ports or serial communication described in above-mentioned job step 2
Shown in port, program flow diagram as Fig. 2 and Fig. 5;
Networking parameter described in above-mentioned steps 8, host computer carries out live networking according to the deployment scenarios of field apparatus and configured,
Multiple flow control valves and host computer constitute a sensor network, and each flow control valve can be as base-station node, simultaneously
Internal data frame can be parsed, simultaneously as forward node, after wireless communication unit receives a frame data bag
Destination address is compared with Self address, is if the same judged to being sent to the packet of oneself, once contrast is different,
Then carry out being forwarded to related flow control valve, program flow diagram is as shown in Figure 2;
Packet and instruction format are retouched described in a kind of control method of the fluid flow control valve based on sensor network
State as follows:
Unified data transmission format voluntarily group-net communication, network are used between flow control valve based on sensor network
Include a base-station node being connected with host computer (industrial computer) and some sensor nodes (flow control valve), each sensor
Node is laid according to on-site actual situations, and data transmission link is configured by systematic unity, and configuration information is issued to each sensing
Device unit, in this transmission link, base-station node and each sensor node have the only address of oneself, such wireless
In data link transmission, 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, to need to be sent to the destination-address reached, its value 1-255 (0x01-
0xFF)。
" data transfer source address " 1 byte, is the source address of raw data packets, its value 1-255 (0x01-0xFF).
" instruction code " 1 byte, is " instruction " or " data ", " instruction according to the value determination data bag of " instruction code "
The value of code " can be configured according to actual needs.
" data length " 1 byte, represents the byte number of valid data being followed by.
" check code " 1 byte, the least-significant byte number of valid data (Data1 to Data n) sum.
" end mark " 1 byte:0xBB.
In order to improve communication speed, coordinate nRF905 intercommunication forms, of length no more than 32 byte of a frame data bag,
Therefore actually active data are 24 bytes in the packet (system at most transmits 32 bytes every time when communicating) of the byte of a frame 32
(Data1 ... Data n, n≤24).
" instruction code " 1 byte, is " instruction " or " data ", " instruction according to the value determination data bag of " instruction code "
The value of code " can be configured according to actual needs.
The relation of instruction code and data is as follows:
(1) reply datas bag form
The form of a complete frame reply data bag is as follows:
The byte of packet header " 2: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 recipient address.Its value 1-255 (0x01-0xFF).
" instruction code " 1 byte, " 0x5A " verification is correct, and " 0xA5 " check errors are, it is necessary to resend last time packet.
" data length " 1 byte, " 0x00 ".
" end mark " 1 byte, " 0xBB ".
(2) sends the instruction format of " uploading real-time traffic data "
The frame data bag form 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 recipient address.Its value 1-255 (0x01-0xFF).
" instruction code " 1 byte, " 0x81 "
" data length " 1 byte, " 0x00 ".
" end mark " 1 byte, " 0xBB ".
(3) uploads " real-time traffic data " data packet format
A frame real-time traffic the packet mainly direction including flow of fluid, fluid flow valve, flow velocity, total amount are sent out on slave
Value and work state information, are easy to host computer to manage, and the form that data are constituted is as follows:
" packet header " 2 byte:0x55、0xAA.
" data transfer destination location " 1 byte, to need to be sent to the destination-address reached, its value 1-255 (0x01-
0xFF)。
" data transfer source address " 1 byte, is the source address of raw data packets, its value 1-255 (0x01-0xFF).
" instruction code " 1 byte, " 0x82 ".
" data length " 1 byte, " 0x14 ", which has altogether, need to transmit the valid data of 20 bytes." fluid flow direction ", fluid
" flow value ", " flow speed value " of fluid, " the total flow value " of fluid, valve current " opening value ", system " have a power failure time for nearly ten days
A few part speed such as numerical value ", system " nearly ten days total power failure the number of minutes " are according to composition.
Data1 bytes:Fluid flow direction, " 0 " is positive, and " 1 " is reverse.
Data4、Data3、Data2:Three bytes constitute flow value, per two decimal numeral packed BCD of byte representation
Code form.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 bytes:The index (10 powers) of flow value, values of powers=Data5-5, values of powers scope:- 5-+5, i.e. decimal point
Position.Value scope=0.00001-999999*105 of flow;
Data6 bytes:Flux unit
Data6 |
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
Unit |
m3/s |
m3/min |
m3/h |
m3/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 constitute flow speed value, per two decimal numeral packed BCD of byte representation
Code form (low four of Data9 is 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 (retaining digit after decimal point) (fixed value 3)
It is worth scope=00.000~99.999
Flow rate:It is fixed as m/s
Data14、Data13、Data12、Data11、Data10:Positive (or reverse) total amount value of 5 bytes composition (according to
It is positive or reverse that Data1 value, which is determined), per the decimal numeral compressed code form of byte representation two.Specific algorithm is such as
Under:
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 bytes:Total amount unit
Data15 |
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
Unit |
0.001L |
0.01L |
0.1L |
1L |
0.001m3 |
0.01m3 |
0.1m3 |
1m3 |
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;Per the decimal numeral compressed code form of byte representation two, tool
Body 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 (retaining digit after decimal point) (fixed value 1)
Opening value scope:0.0~90.0 degree
Work state information is transmitted:
Data18 bytes:Nearly ten days frequency of power cut values, are compressed code form, scope:0~99 time.
Data20, Data19 byte:Nearly ten days total power failure the number of minutes, per two decimal numeral packed BCD of byte representation
Code form, its be worth scope be: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) data packet format of transmission control parameters
The flow control methods (pid value) that flow control valve can be set according to host computer carry out Flow-rate adjustment, Flow-rate adjustment
Method can be divided into set-point and be adjusted or be adjusted according to given time, flow curve.Flow-rate adjustment parameter instruction point
Set and be adjusted with flow set-point or given time, flow curve value for pid parameter.Packet is divided into two kinds of data,
A kind of setting for control parameter P, I, D parameter, another setting for given stream value.
Control parameter P, I, D of valve flow regulation setting.Specific instruction and data format are as follows:
" packet header " 2 byte:0x55、0xAA.
" data transfer destination location " 1 byte, to need to be sent to the destination-address reached, its value 1-255 (0x01-
0xFF)。
" data transfer source address " 1 byte, is the source address of raw data packets, its value 1-255 (0x01-0xFF).
" instruction code " 1 byte, " 0x83 ".
" data length " 1 byte, " 0x0C ", which has altogether, need to transmit the valid data of 12 bytes.Respectively Valve controlling parameter P,
I, D value, each value account for 4 bytes.
Data3、Data2、Data1:The control parameter ratio value P of three byte composition regulation flow values, per byte representation
Two decimal numeral compressed code forms.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 bytes:Ratio value P index (10 powers), values of powers=Data4-5, scope:- 5-+5, i.e. decimal point position
Put.Ratio value P scope=0.00001-999999*105;
Data7、Data6、Data5:The control parameter differential value I of three byte composition regulation flow values, per byte representation
Two decimal numeral compressed code forms.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 bytes:Differential value I index (10 powers), values of powers=Data8-5, scope:- 5-+5, i.e. decimal point position
Put.Differential value I scope=0.00001-999999*105;
Data11、Data10、Data9:The control parameter integrated value D of three byte composition regulation flow values, per table of bytes
Show two decimal numeral compressed code forms.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
Data12 bytes:Integrated value D index (10 powers), values of powers=Data12-5, scope:- 5-+5's, i.e. decimal point
Position.Integrated value D scope=0.00001-999999*105;
" check code " 1 byte, the least-significant byte number of valid data (Data1 to Data 12) sum.
" end mark " 1 byte:0xBB.
, the setting given time, flow curve parameter instruction and data form it is as follows, specific instruction and data format are such as
Under:
" data transfer destination location " 1 byte, to need to be sent to the destination-address reached, its value 1-255 (0x01-
0xFF)。
" data transfer source address " 1 byte, is the source address of raw data packets, its value 1-255 (0x01-0xFF).
" instruction code " 1 byte, " 0x84 ".
" data length " 1 byte, " 0x18 " (the data points transmitted according to actual needs are determined), a frame data bag is most
The valid data of transmittable 24 bytes, the setting data of each timing node are made up of 8 bytes, respectively the byte of flow value 5,
The byte of time 3, therefore a frame data bag once can transmit the given flow set-point data at three time points, if to transmit many
Point time data then can be transmitted repeatedly, and simply setting value and time value are different, and flow control valve system can root automatically
Automatically controlled according to time sequencing sequence.The form of one node data is as follows:
Data3、Data2、Data1:Three bytes constitute given stream value, per the decimal numeral compression of byte representation two
Binary-coded decimal form.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 bytes:The index (10 powers) of flow value, values of powers=Data5-5, scope:- 5-+5, i.e. decimal point position
Put.Value scope=0.00001-999999*105 of flow;
Data5 bytes:Flux unit
Data5 |
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
Unit |
m3/s |
m3/min |
m3/h |
m3/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 bytes:Clock value, is 0-23 for the binary-coded decimal scope of compression;
Data7 bytes:Minute value, is 0-59 for the binary-coded decimal scope of compression;
Data8 bytes:Second value, be 0-59 for the binary-coded decimal scope of compression;
Data16~Data9, Data24~Data17, form are ibid.
" 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 parameters data packet format
The renewal of system configuration parameter includes updating the numbering (1-255,1 byte) of control valve, leading portion instrument amplifier
Gain setting (1~1000 times, 2 bytes), system clock (year, month, day, hour, min, second, 6 bytes), valve caliber (1 byte),
Need 10 bytes of data.Specific instruction form is as follows:
" packet header " 2 byte:0x55、0xAA.
" data transfer destination location " 1 byte, to need to be sent to the destination-address reached, its value 1-255 (0x01-
0xFF, equipment initial address for " 0xFF).
" data transfer source address " 1 byte, is the source address of raw data packets, its value 1-255 (0x01-0xFF).
" instruction code " 1 byte, " 0x85 ".
" data length " 1 byte, " 0x0A ".
Mono- byte of Data1, the numbering (address) of the equipment newly defined, its value scope is:1-255;
Two bytes of Data3, Data2, its value is the gain set-point (1~1000) of front end instrument amplifier, per byte
Constituted for the binary-coded decimal of compression.
Mono- byte of Data4, is system clock " year " value, for the binary-coded decimal value of compression, scope (1~99);
Mono- byte of Data5, is system clock " moon " value, for the binary-coded decimal value of compression, scope (1~12);
Mono- byte of Data6, is system clock " day " value, for the binary-coded decimal value of compression, scope (1~31);
Mono- byte of Data7, be system clock " when " value, for the binary-coded decimal value of compression, scope (0~23);
Mono- byte of Data8, is that system clock " divides " value, for the binary-coded decimal value of compression, scope (0~59);
Mono- byte of Data9, is system clock " second " value, for the binary-coded decimal value of compression, scope (0~59);
Mono- byte of Data10, is the valve caliber of system, is used to calculate during flow value, and Data10 value is compression
BCD, corresponding relation see the table below, and unit is mm.
The caliber corresponding table of table 3.1
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) networkings parameter instruction and data format
The system realizes long distance wireless digital communication using the nRF905 with power amplifier, 2000 meters of effective face-to-face communication distance with
On, therefore, in most cases each sensor node (flow control valve) is directly directly point-to-point with base-station node (industrial computer)
Communication.In order to improve the reliability (preventing that communication distance is influenceed by many factors in practical application) that system transmits data, number
Configured according to transmission link by systematic unity according to actually laying situation, networking parameter instruction is exactly to set each sensor node in net
Role in network.Specific instruction and data format are as follows:
" packet header " 2 byte:0x55、0xAA.
" data transfer destination location " 1 byte, to need to be sent to the destination-address reached, its value 1-255 (0x01-
0xFF)。
" data transfer source address " 1 byte, is the source address of raw data packets, its value 1-255 (0x01-0xFF).
" instruction code " 1 byte, " 0x86 ".
" data length " 1 byte, according to the length of actual link structure determination data, the setting of each link takes 3
Individual byte.
The byte of Data1, Data2, Data3 tri- constitutes one group of link configuration, and Data1 is " data transfer destination location or number
According to transmission source address ", Data2 is " forwarding data address ", and Data3 is " data transfer source address or data transfer destination
Location ".If multigroup link, then data are arranged in order, and 8 link groups at most can be set in a frame data bag.System software root
Judge whether to forward according to the source address of the address of itself, the destination address of data, data.
The technology contents and technical characteristic of the present invention have revealed that as above, but those skilled in the art still may base
Make a variety of replacements and modification without departing substantially from spirit of the present invention, therefore, the scope of the present invention in teachings of the present invention and announcement
The content disclosed in embodiment should be not limited to, and various replacements and modification without departing substantially from the present invention should be included, and is this patent Shen
Please claim covered.