CN103712599B - A kind of relative height measurement mechanism and method - Google Patents

A kind of relative height measurement mechanism and method Download PDF

Info

Publication number
CN103712599B
CN103712599B CN201310740218.6A CN201310740218A CN103712599B CN 103712599 B CN103712599 B CN 103712599B CN 201310740218 A CN201310740218 A CN 201310740218A CN 103712599 B CN103712599 B CN 103712599B
Authority
CN
China
Prior art keywords
neural network
weights
relative height
threshold value
value
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.)
Active
Application number
CN201310740218.6A
Other languages
Chinese (zh)
Other versions
CN103712599A (en
Inventor
张加宏
付洋
李敏
姚佳慧
黄秦
李猛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Huagong Engineering Construction Supervision Co., Ltd.
Original Assignee
Nanjing University of Information Science and Technology
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Nanjing University of Information Science and Technology filed Critical Nanjing University of Information Science and Technology
Priority to CN201310740218.6A priority Critical patent/CN103712599B/en
Publication of CN103712599A publication Critical patent/CN103712599A/en
Application granted granted Critical
Publication of CN103712599B publication Critical patent/CN103712599B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01CMEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
    • G01C5/00Measuring height; Measuring distances transverse to line of sight; Levelling between separated points; Surveyors' levels
    • G01C5/06Measuring height; Measuring distances transverse to line of sight; Levelling between separated points; Surveyors' levels by using barometric means
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/086Learning methods using evolutionary algorithms, e.g. genetic algorithms or genetic programming

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Data Mining & Analysis (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Physiology (AREA)
  • Artificial Intelligence (AREA)
  • Remote Sensing (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Feedback Control In General (AREA)

Abstract

The invention discloses a kind of relative height measurement mechanism, the array gas pressure sensor module, power module, LCD MODULE, the serial communication modular that comprise host computer, microprocessor module and be connected respectively with microprocessor module.Adopt the method that described measurement mechanism is measured, in host computer, complete genetic algorithm optimization BP neural network and gained weights, threshold value and relative height computing formula are transferred to microprocessor module; Array gas pressure sensor module gathers air pressure and temperature transfers to microprocessor module, microprocessor module calculates relative height after processing the air pressure received and temperature, result is transferred to LCD MODULE carries out showing, host computer stores.The present invention, by software and hardware combining, is conducive to restraint speckle, recovery, enhancing and extraction useful signal, has higher accuracy and stability.

Description

A kind of relative height measurement mechanism and method
Technical field
The present invention relates to a kind of relative height measurement mechanism and method, particularly a kind of relative height measurement mechanism based on genetic algorithm optimization BP neural network and method.
Background technology
In daily life and production run, the relative height vertical height of any two points (in the space) is for being indispensable basic parameter us, such as, relative height is lived at us, building, science and technology, even military affairs all have a wide range of applications, as field exploration, building ground elevation carrection, unmanned robot and the navigation of target missile height etc.In general, the measurement for relative height has three kinds of conventional methods usually, the first: traditional machinery is directly measured; The second: the measurement utilizing GPS; The third: is based on the indirect inspection of pneumatically-sensed electronic device.The limited precision of traditional mechanical measurement device, volume is large, carries inconvenience.The measurement of GPS can reach good accuracy requirement, but cost is higher.Comparatively speaking, the electronic device based on pneumatically-sensed relative height has to be applied widely.
Present stage, for utilizing air pressure to calculate relative height, people generally adopt standard pressure altitude formula.But there is larger defective in standard pressure altitude conversion formula, such as, atmospheric pressure around measurement point does not meet the atmospheric state of ideal standard, and (pressure is 1013.25hPa, temperature is 15 DEG C), adopt standard pressure altitude formula comparatively large by the impact of the extraneous factors such as temperature, wind speed, humidity, thus cause elevation carrection to produce larger error.In addition, be all generally adopt single-sensor to measure, because certain some air pressure may to alter a great deal and sensor dispatches from the factory the slightly difference such as parameter, these factors all add measuring error.
Summary of the invention
Technical matters to be solved by this invention is to provide a kind of relative height measurement mechanism and method, is conducive to restraint speckle, recovery, enhancing and extraction useful signal, has higher accuracy and stability.
The present invention is for solving the problems of the technologies described above by the following technical solutions:
A kind of relative height measurement mechanism, the array gas pressure sensor module, power module, LCD MODULE, the serial communication modular that comprise host computer, microprocessor module and be connected with microprocessor module respectively; Described host computer is connected with described microprocessor module by described serial communication modular; Described power module is that modules is powered.
Adopt a measuring method for relative height measurement mechanism described above, comprise the following steps:
Step 1, described microprocessor module sends startup command to described array gas pressure sensor module, described array gas pressure sensor module gathers air pressure and the temperature data of n different testing location, and transferring to described microprocessor module, the air pressure received and temperature data are sent in described host computer by described microprocessor module;
Step 2, described host computer sets up BP neural network by the air pressure that receives and temperature data, being optimized BP neural network according to the principle of genetic algorithm and completing its training study process, the relative height computing formula obtained be sent in described microprocessor module, concrete steps are as follows:
201, using the atmospheric pressure value P that collects and temperature value t as input quantity P kthe parameter of=(P, t); Choose a reference mark, record the relative height △ H of each testing location, it can be used as output quantity C kthe parameter of=(△ H); The input quantity P of same testing location kwith output quantity C kthere is mapping corresponding relation, obtain the test data set that n has above-mentioned mapping relations thus, it can be used as test sample book stored in database; N is natural number, and K is any one group in n group test sample book, K=1,2 ..., n;
202, be normalized test sample book, all data are all converted into the number between [0,1] by employing minimax method, and normalization formula is as follows:
χ k=(χ kmin)/(χ maxmin)
In formula, χ minfor the minimum number in data sequence; χ maxfor the maximum number in data sequence;
According to normalization formula by input quantity P kwith output quantity C kall convert normalized input quantity P ' to kwith output quantity C ' k, finally obtain normalized test sample book and database;
203, according to the mapping corresponding relation of input quantity and output quantity in the test sample book after normalization, set up the BP neural network of three etale topology structures, specific as follows:
The input layer of setting BP neural network is 2, and output layer neuron is 1, and hidden layer neuron is 6; Wherein the activation function of input layer and hidden layer all chooses tansig type function, and output layer activation function chooses pureline type function; Connection weights between input layer and hidden layer are W ij, the threshold value of hidden layer is θ j, the connection weights between hidden layer and output layer are W jq, the threshold value of output layer is θ q; I is input layer number, i=1,2; J is node in hidden layer, j=1,2 ..., 6; Q is output layer nodes, q=1;
Tansig type function is defined as
f ( χ ) = 2 1 + exp ( - 2 S j ) - 1
In formula, S jthe input of j hidden layer node, a ifor the matrix that atmospheric pressure value and temperature value are formed;
Pureline type function is linear function, and wherein, independent variable is the output of hidden layer node, and dependent variable is the output of output layer node;
204, using the neural network of BP described in step 3 as blackbox model, set up with the input variable of the input quantity in test sample book described in step 1 for BP neural network, relative height value using correspondence as the BP neural network prediction model of output variable;
205, random initializtion is carried out to the weights W in BP neural network prediction model and threshold value θ, makes BP neural network model have the most basic predicted condition; W, θ are respectively W ijand W jq, θ jand θ qgeneral name;
206, from normalized database, transfer input quantity P ' k, as the input variable of BP neural network prediction model with most fundamental forecasting condition, thus obtain and input variable P ' kthe prediction output quantity Y ' of the relative height that the BP neural network prediction model that mapping pair is answered exports kdata group;
207, the threshold value determined by test sample book normalized described in step 202 and the scope of weights, according to initial threshold value and the weights of the principle Optimized BP Neural Network forecast model of genetic algorithm, specific as follows:
A. using the threshold value of random initializtion many groups BP neural network prediction model and the weights initial population as genetic algorithm, Population Size rule of thumb presets, and encodes to this initial population, and setting largest optimization algebraically was 50 generations;
B. the ideal adaptation degree function of the initialization population sample of the genetic algorithm of Optimized BP Neural Network forecast model initial threshold and weights is configured to:
F = k Σ j = 1 N ( T j - Y j )
In formula, N is the node that network exports, N=1; T jfor the desired output of a BP neural network jth node; Y jfor the prediction of a jth node exports; K is coefficient, k=1;
The numerical value of the fitness F of each individuality in initial population is calculated according to ideal adaptation degree function formula;
C. according to roulette method, namely based on the selection strategy of fitness ratio, from the multiple individuality of initialization population, select multiple optimization individualities that corresponding ideal adaptation degree F numerical value is relatively large, carry out intersecting, mutation operation, the new individuality of generation is as first filial generation weights W 1with threshold value θ 1the individuality of population, specific as follows:
Interlace operation adopts real number bracketing method, a kth chromosome a kwith l chromosome a lin j' position interlace operation method be:
a kj'=a kj'(1-b)+a i'j'b;
a lj'=a lj'(1-b)+a kj'b;
In formula, a kj'for a kth chromosomal j' position; a ij'be i-th chromosomal j' position; a lj'be l chromosomal j' position; B is the random number between [0,1];
Mutation operation is the jth of individuality ' ' ' ' the individual gene a that chooses i-th i' ' j' ' make a variation, be specially:
When r is more than or equal to 0.5,
a i''j''=a i''j''+(a i''j''-a max)*f(g);
When r is less than 0.5,
a i''j''=a i''j''+(a min-a i''j'')*f(g);
Wherein, r is the random number between [0,1]; a maxand a minbe respectively gene a i' ' j' ' the upper bound and lower bound; F (g)=r 2(1-g/G max); r 2it is a random value; G is current iteration number of times; G maxit is maximum evolution number of times;
D. first filial generation weights W is used 1with threshold value θ 1the new individual individuality replacing initial population of population, repeat the genetic algorithm of step a to step c to the optimizing process of first filial generation population at individual, until ideal adaptation degree function described in step b is basicly stable constant or when reaching the evolutionary generation of setting, terminate optimizing process, and obtain initialization complete last in generation population individuality, namely obtain the initial weight W that initialization is complete 2with threshold value θ 2;
208, to optimize complete initial weight and threshold value BP neural network prediction model carry out training study, specific as follows;
I. the test sample book transferred from normalized database, input quantity P ' wherein kwith output quantity C ' khave and map corresponding relation really; With the input quantity P ' of identical test sample book kbring in BP neural network prediction model, and by weights W complete for initialization 2with threshold value θ 2as new initial threshold and the weights of BP neural network; The prediction output quantity Y ' now obtained by BP neural network j, this predicts output quantity Y ' jwith relative height desired throughput T jbetween there is error;
II. set up the error back propagation model of BP neural network, construct one by relative desired throughput T jwith the prediction output quantity Y ' of BP neural network prediction model jthe objective function formed: the process of this minimization of object function is made to be exactly the process of BP neural network error back propagation;
III. carry out computing with the objective function of gradient descent method to BP neural network error back propagation, make the initial weight W of BP neural network prediction model 2with threshold value θ 2optimize further; According to gradient descent method, with the increase of iterations, the error of objective function will progressively reduce, until error meets the accuracy requirement preset, terminate the optimizing process of initial threshold and weights;
IV. through step III calculating repeatedly and reduce error, when error finally meets the accuracy requirement preset, obtain weights W and the threshold value θ of one group of optimum, using weights W now and threshold value θ as the final weights and threshold of BP neural network prediction model, the training study of BP neural network prediction model completes;
209, by the BP neural network prediction model completing training study, obtain prediction output quantity and relative height, and its computing formula and model final weights W, threshold value θ are transferred in described microprocessor module; Relative height formula is as follows:
△H=purelin{tansig(p*W 1j+t*W 2jj)*W j1q}
In formula, W 1jand W 2jbe respectively air pressure P and temperature t corresponding by the weights of hidden layer to input layer; W 3jfor output layer is to the weights of hidden layer; θ qfor output layer threshold value;
Step 3, array-type sensor module described in described microprocessor module order reads compensating parameter, and is transmitted back in described microprocessor module by the air pressure of collection and temperature value and compensating parameter; Described microprocessor module is compensated air pressure and temperature value by compensating parameter, averages, and be normalized mean value after the air pressure after compensation and temperature value are removed maximin;
Step 4, applies the relative height computing formula that described microprocessor module receives, and calculates corresponding normalized compensation air pressure and temperature value obtains relative height value; The relative height value calculated is carried out renormalization process, obtains actual relative height;
Step 5, the air pressure of renormalization, temperature and relative height after compensating are sent to that host computer carries out storing, LCD MODULE shows by described microprocessor module respectively.
As a preferred embodiment of the present invention, described microprocessor module selects the microcontroller of MSP430F149 model.
As a preferred embodiment of the present invention, described array gas pressure sensor module selects BMP085 model baroceptor to form the square formation of 3*3.
As a preferred embodiment of the present invention, described LCD MODULE selects LCD12864 model.
As a preferred embodiment of the present invention, described serial communication modular selects RS232 serial communication chip.
As a preferred embodiment of the present invention, described power module selects 7133 voltage stabilizing chips.
The present invention adopts above technical scheme compared with prior art, has following technique effect:
(1) hardware utilize BMP085 baroceptor to form the square formation of 3*3, adopt array multi-point average metering system, effectively eliminate measuring error that the defect due to sensor individuals itself brings and decrease the stochastic error or reproducibility error that produce due to sensor chip creep, significantly reducing the impact of year drift;
(2) software adopts the BP neural network algorithm based on genetic algorithm optimization carry out temperature drift and nonlinear compensation to measuring-signal, inhibit the impact of noise, enhance useful signal, optimize measurement data;
(3) control treatment is carried out by the MSP430F149 microcontroller of low-power consumption, form a set of more accurate relative height measurement mechanism, be conducive to restraint speckle, recovery, enhancing and extraction useful signal, measure based on single baroceptor than traditional and utilize the measuring system of standard pressure altitude formulae discovery relative height to have higher accuracy and stability, also can be extended to fields of measurement widely;
(4) in view of the low cost of BMP085 baroceptor, the high precision of this device and stability make it have higher commercial value.
Accompanying drawing explanation
Fig. 1 is structure drawing of device of the present invention.
Fig. 2 is the peripheral circuit diagram of BMP085 baroceptor.
Fig. 3 is the floor map of array baroceptor.
Fig. 4 is power module circuitry figure.
Fig. 5 is method flow diagram of the present invention.
Fig. 6 is the topology diagram of BP neural network.
Fig. 7 is the method flow diagram of genetic algorithm optimization BP neural network.
Fig. 8 is the relative height comparison diagram that relative height actual value, output relative height value of the present invention and standard pressure altitude computing formula calculate.
Fig. 9 is the error of output relative height value of the present invention and the error comparison diagram of standard pressure altitude computing formula calculating.
Embodiment
Below in conjunction with accompanying drawing, technical scheme of the present invention is described in further detail:
As shown in Figure 1, a kind of relative height measurement mechanism, the array gas pressure sensor module, power module, LCD MODULE, the serial communication modular that comprise host computer, microprocessor module and be connected respectively with microprocessor module; Described host computer is connected with described microprocessor module by described serial communication modular.
As shown in Figure 2, the integrated digital baroceptor BMP085 of temperature compensation capability that what described gas pressure sensor module selected BOSCH company to produce have, the supply voltage of this digital pressure sensing chip is 1.8V ~ 3.6V, it has super low-power consumption, high precision (under low-power consumption mode, resolution is 0.06hPa) and high reliability, its economy and applicability all meet the requirement of the design, the output of BMP085 is directly proportional to additional pressure, measurement range is 300 ~ 1100hPa, calibration numeral completely exports, after completing sampling, directly data are sent to MSP430F149 by I2C bus.
As shown in Figure 3, described array gas pressure sensor module selects BMP085 baroceptor to form the square formation of 3*3.
The signal disturbing caused to eliminate power supply unstable, the present invention selects 7133 chips and peripheral circuit to form source of stable pressure, and Absorbable organic halogens exports 5V and 3.3V and powers to each module, as shown in Figure 4.
As shown in Figure 5, a kind of measuring method adopting relative height measurement mechanism described above, comprises the following steps:
Step 1, after device for opening power supply, whole system carries out initialization, comprises clock initialization, port initialization, liquid crystal display initialization, serial ports initialization, BMP085 sensor initializing and closes house dog; MSP430F149 is by port analog I 2c port communications, I 2sCL with SDA of C is connected with the IO port of microcontroller respectively, the low and high level Simulation with I of IO port 2the sequential of C communication, makes I 2c communication can effectively work;
Step 2, MSP430F149 microcontroller sends enabling signal to BMP085 sensor; Sensor carries out the measurement of air pressure and temperature, and transfers to MSP430F149 microcontroller after converting uncompensated air pressure and temperature value to numerical signal by built-in A/D converter; The air pressure received and temperature data are sent in host computer by MSP430F149 microcontroller;
Step 3, described host computer sets up BP neural network by the air pressure that receives and temperature data, being optimized BP neural network according to the principle of genetic algorithm and completing its training study process, the relative height computing formula obtained be sent in described microprocessor module, concrete steps are as follows:
301, using the atmospheric pressure value P that collects and temperature value t as input quantity P kthe parameter of=(P, t); Choose a reference mark, record the relative height △ H of each testing location, it can be used as output quantity C kthe parameter of=(△ H); The input quantity P of same testing location kwith output quantity C kthere is mapping corresponding relation, obtain the test data set that n has above-mentioned mapping relations thus, it can be used as test sample book stored in database; N is natural number, and K is any one group in n group test sample book, K=1,2 ..., n;
302, be normalized test sample book, all data are all converted into the number between [0,1] by employing minimax method, and normalization formula is as follows:
χ k=(χ kmin)/(χ maxmin)
In formula, χ minfor the minimum number in data sequence; χ maxfor the maximum number in data sequence;
According to normalization formula by input quantity P kwith output quantity C kall convert normalized input quantity P ' to kwith output quantity C ' k, finally obtain normalized test sample book and database;
303, according to the mapping corresponding relation of input quantity and output quantity in the test sample book after normalization, set up the BP neural network of three etale topology structures, as shown in Figure 6, specific as follows:
The input layer of setting BP neural network is 2, and output layer neuron is 1, and hidden layer neuron is 6; Wherein the activation function of input layer and hidden layer all chooses tansig type function, and output layer activation function chooses pureline type function; Connection weights between input layer and hidden layer are W ij, the threshold value of hidden layer is θ j, the connection weights between hidden layer and output layer are W jq, the threshold value of output layer is θ q; I is input layer number, i=1,2; J is node in hidden layer, j=1,2 ..., 6; Q is output layer nodes, q=1;
Tansig type function is defined as
f ( χ ) = 2 1 + exp ( - 2 S j ) - 1
In formula, S jthe input of j hidden layer node, a ifor the matrix that atmospheric pressure value and temperature value are formed;
Pureline type function is linear function, and wherein, independent variable is the output of hidden layer node, and dependent variable is the output of output layer node;
304, using the neural network of BP described in step 3 as blackbox model, set up with the input variable of the input quantity in test sample book described in step 1 for BP neural network, relative height value using correspondence as the BP neural network prediction model of output variable;
305, random initializtion is carried out to the weights W in BP neural network prediction model and threshold value θ, makes BP neural network model have the most basic predicted condition; W, θ are respectively W ijand W jq, θ jand θ qgeneral name;
306, from normalized database, transfer input quantity P ' k, as the input variable of BP neural network prediction model with most fundamental forecasting condition, thus obtain and input variable P ' kthe prediction output quantity Y ' of the relative height that the BP neural network prediction model that mapping pair is answered exports kdata group;
307, the threshold value determined by test sample book normalized described in step 2 and the scope of weights, according to initial threshold value and the weights of the principle Optimized BP Neural Network forecast model of genetic algorithm, as shown in Figure 7, and complete the training study of BP neural network prediction model; Specific as follows:
A. using the threshold value of random initializtion many groups BP neural network prediction model and the weights initial population as genetic algorithm, Population Size rule of thumb presets, and encodes to this initial population, and setting largest optimization algebraically was 50 generations;
B. the ideal adaptation degree function of the initialization population sample of the genetic algorithm of Optimized BP Neural Network forecast model initial threshold and weights is configured to:
F = k Σ j = 1 N ( y j - o j )
In formula, N is the node that network exports, N=1; y jfor the desired output of a BP neural network jth node; o jfor the prediction of a jth node exports; K is coefficient, k=1;
The numerical value of the fitness F of each individuality in initial population is calculated according to ideal adaptation degree function formula;
C. according to roulette method, namely based on the selection strategy of fitness ratio, from the multiple individuality of initialization population, select multiple optimization individualities that corresponding ideal adaptation degree F numerical value is relatively large, carry out intersecting, mutation operation, the new individuality of generation is as first filial generation weights W 1with threshold value θ 1the individuality of population, specific as follows:
Interlace operation adopts real number bracketing method, a kth chromosome a kwith l chromosome a lin j' position interlace operation method be:
a kj'=a kj'(1-b)+a i'j'b;
a lj'=a lj'(1-b)+a kj'b;
In formula, a kj'for a kth chromosomal j' position; a ij'be i-th chromosomal j' position; a lj'be l chromosomal j' position; B is the random number between [0,1];
Mutation operation is the jth of individuality ' ' ' ' the individual gene a that chooses i-th i' ' j' ' make a variation, be specially:
When r is more than or equal to 0.5,
a i''j''=a i''j''+(a i''j''-a max)*f(g);
When r is less than 0.5,
a i''j''=a i''j''+(a min-a i''j'')*f(g);
Wherein, r is the random number between [0,1]; a maxand a minbe respectively gene a i' ' j' ' the upper bound and lower bound; F (g)=r 2(1-g/G max); r 2it is a random value; G is current iteration number of times; G maxit is maximum evolution number of times;
D. first filial generation weights W is used 1with threshold value θ 1the new individual individuality replacing initial population of population, repeat the genetic algorithm of step a to step c to the optimizing process of first filial generation population at individual, until ideal adaptation degree function described in step b is basicly stable constant or when reaching the evolutionary generation of setting, terminate optimizing process, and obtain initialization complete last in generation population individuality, namely obtain the initial weight W that initialization is complete 2with threshold value θ 2;
308, to optimize complete initial weight and threshold value BP neural network prediction model carry out training study, specific as follows;
I. the test sample book transferred from normalized database, input quantity P ' wherein kwith output quantity C ' khave and map corresponding relation really; With the input quantity P ' of identical test sample book kbring in BP neural network prediction model, and by weights W complete for initialization 2with threshold value θ 2as new initial threshold and the weights of BP neural network.The prediction output quantity Y ' now obtained by BP neural network j, this predicts output quantity Y ' jwith relative height desired throughput T jbetween there is error;
II. set up the error back propagation model of BP neural network, construct one by relative desired throughput T jwith the prediction output quantity Y ' of BP neural network prediction model jthe objective function formed: the process of this minimization of object function is made to be exactly the process of BP neural network error back propagation;
III. carry out computing with the objective function of gradient descent method to BP neural network error back propagation, make the initial weight W of BP neural network prediction model 2with threshold value θ 2optimize further; According to gradient descent method, with the increase of iterations, the error of objective function will progressively reduce, until error meets the accuracy requirement preset, terminate the optimizing process of initial threshold and weights;
IV. through step g calculating repeatedly and reduce error, when error finally meets the accuracy requirement preset, obtain weights W and the threshold value θ of one group of optimum, using weights W now and threshold value θ as the final weights and threshold of BP neural network prediction model, the training study of BP neural network prediction model completes;
309, by the BP neural network prediction model completing training study, obtain prediction output quantity and relative height, and its computing formula and model final weights W, threshold value θ are transferred in described microprocessor module; Relative height formula is as follows:
△H=purelin{tansig(p*W 1j+t*W 2jj)*W j1q}
In formula, W 1jand W 2jbe respectively air pressure P and temperature t corresponding by the weights of hidden layer to input layer; W 3jfor output layer is to the weights of hidden layer; θ qfor output layer threshold value;
Step 4, MSP430F149 microcontroller order BMP085 sensor reads E 211 compensating parameters of PROM, air pressure and temperature value and compensating parameter are sent in MSP430F149 microcontroller to BMP085 by MSP430F149 microcontroller; Described MSP430F149 microcontroller is compensated air pressure and temperature value by compensating parameter, averages, and be normalized mean value after the air pressure after compensation and temperature value are removed maximin;
Step 5, the relative height computing formula that application MSP430F149 microcontroller receives, calculates corresponding normalized compensation air pressure and temperature value obtains relative height value; The relative height value calculated is carried out renormalization process, obtains actual relative height;
Step 6, the air pressure of renormalization, temperature and relative height after compensating are sent to that host computer carries out storing, LCD MODULE shows by MSP430F149 microcontroller respectively.
Below to be further described the present invention in conjunction with example:
Using Nanjing Information engineering Univ's Electronics and Information Engineering institute subject building (below referred to as the large No. two subject buildings of letter, south) as measuring object.The large No. two subject buildings one of letter, south have five floor, and every one deck is on average approximately 4.04m, and overall height is about 20.2323m.In order to the convenience measured, select stair to be the place tested, using the ground of ground floor as test basic point (namely testing zero point), have chosen 26 place's relative height testing locations.Often locate testing location take 8 times measure sample (comprising temperature and atmospheric pressure value), obtain atmospheric pressure value herein and temperature after being gone by the maxima and minima of atmospheric pressure value often locating to measure sample (wherein atmospheric pressure value is accurate to 0.001hPa except averaging, temperature is accurate to 0.01 DEG C), and the relative height △ H(recording each testing location is accurate to 0.0001m).
The temperature recorded by testing location respectively and atmospheric pressure value are as the input quantity P measuring sample k, using relative height value as the output quantity C measuring sample k, show that corresponding weights and threshold is according to step 3:
W 1 j = 2.2079 1.4675 - 2.5283 - 1.0323 - 0.2514 1.878 , W 2 j = 0.2608 - 0.7638 0.1838 1.9342 0.6537 0.7811 , W j 1 = - 2.1073 2.9851 0.6531 2.8472 - 2.3171 1.0144 , θ j = 2.5758 - 1.2952 - 0.3681 2.2179 - 0.4702 1.5427 , θ q = 0.3334
By the weights and threshold of gained and computing formula △ H=purelin{tansig (p*W 1j+ t*W 2j+ θ j) * W j1+ θ qstored in MSP430F149 microcontroller.
Other 18 places apparatus of the present invention being placed into the large No. two subject buildings of letter, south are measured, and relative height value and air pressure and temperature are write down.
According to barometric leveling principle, under standard atmospheric conditions, standard pressure altitude computing formula is as follows:
H = T 0 β [ ( P P 0 ) - βR / g - 1 ] + Ho
In formula, R=287.05287m 2/ (s 2k), air special gas constant is represented; G=9.80665m 2/ s 2represent free-fall acceleration; β represents the vertical rate of temperature, highly when 0 ~ 11km, and β=-0.0065K/m; T 0, P 0, H 0distinguish the temperature of reference planes, atmospheric pressure value and height, under standard atmosphere condition (namely pressure is 1013.25hPa, and temperature is 15 DEG C), mean sea level gets following value: P 0=1013.25hPa, T 0=288.15K, H 0be the height of mean sea level, be defined as 0m.
Corresponding parameter value is substituted in standard pressure altitude computing formula, can obtain:
H = - 4433.8 [ ( P 1013.25 ) 0.190263102 - 1 ]
Can the atmospheric pressure value of measurement be brought into criterion calculation formula like this thus obtain relative height value.
Finally the relative height that measured relative height actual value, output relative height value of the present invention and standard pressure altitude computing formula calculate is depicted as broken line graph, as shown in Figure 8.The relative height value that output relative height value of the present invention and standard pressure altitude computing formula calculate and actual value obtain error and are depicted as broken line graph, as shown in Figure 9.
As seen from the experiment, the error of the relative height value that the present invention exports obviously reduces, and has higher precision relative to the calculated value of standard pressure altitude computing formula.
The above; be only the embodiment in the present invention; but protection scope of the present invention is not limited thereto; any people being familiar with this technology is in the technical scope disclosed by the present invention; the conversion or replacement expected can be understood; all should be encompassed in and of the present inventionly comprise within scope, therefore, protection scope of the present invention should be as the criterion with the protection domain of claims.

Claims (6)

1. adopt a measuring method for relative height measurement mechanism, array gas pressure sensor module, power module, LCD MODULE, serial communication modular that this device comprises host computer, microprocessor module and is connected with microprocessor module respectively; Described host computer is connected with described microprocessor module by described serial communication modular; Described power module is that modules is powered, and it is characterized in that, measuring method comprises the following steps:
Step 1, described microprocessor module sends startup command to described array gas pressure sensor module, described array gas pressure sensor module gathers air pressure and the temperature data of n different testing location, and transferring to described microprocessor module, the air pressure received and temperature data are sent in described host computer by described microprocessor module;
Step 2, described host computer sets up BP neural network by the air pressure that receives and temperature data, being optimized BP neural network according to the principle of genetic algorithm and completing its training study process, the relative height computing formula obtained be sent in described microprocessor module, concrete steps are as follows:
201, using the atmospheric pressure value P that collects and temperature value t as input quantity P kthe parameter of=(P, t); Choose a reference mark, record the relative height △ H of each testing location, it can be used as output quantity C kthe parameter of=(△ H); The input quantity P of same testing location kwith output quantity C kthere is mapping corresponding relation, obtain the test data set that n has above-mentioned mapping relations thus, it can be used as test sample book stored in database; N is natural number, and K is any one group in n group test sample book, K=1,2 ..., n;
202, be normalized test sample book, all data are all converted into the number between [0,1] by employing minimax method, and normalization formula is as follows:
χ k=(χ kmin)/(χ maxmin)
In formula, χ minfor the minimum number in data sequence; χ maxfor the maximum number in data sequence;
According to normalization formula by input quantity P kwith output quantity C kall convert normalized input quantity P ' to kwith output quantity C ' k, finally obtain normalized test sample book and database;
203, according to the mapping corresponding relation of input quantity and output quantity in the test sample book after normalization, set up the BP neural network of three etale topology structures, specific as follows:
The input layer of setting BP neural network is 2, and output layer neuron is 1, and hidden layer neuron is 6; Wherein the activation function of input layer and hidden layer all chooses tansig type function, and output layer activation function chooses pureline type function; Connection weights between input layer and hidden layer are W ij, the threshold value of hidden layer is θ j, the connection weights between hidden layer and output layer are W jq, the threshold value of output layer is θ q; I is input layer number, i=1,2; J is node in hidden layer, j=1,2 ..., 6; Q is output layer nodes, q=1;
Tansig type function is defined as
f ( χ ) = 2 1 + exp ( - 2 S j ) - 1
In formula, S jthe input of j hidden layer node, a ifor the matrix that atmospheric pressure value and temperature value are formed;
Pureline type function is linear function, and wherein, independent variable is the output of hidden layer node, and dependent variable is the output of output layer node;
204, using the neural network of BP described in step 203 as blackbox model, set up with the input variable of the input quantity in test sample book described in step 1 for BP neural network, relative height value using correspondence as the BP neural network prediction model of output variable;
205, random initializtion is carried out to the weights W in BP neural network prediction model and threshold value θ, makes BP neural network model have the most basic predicted condition; W, θ are respectively W ijand W jq, θ jand θ qgeneral name;
206, from normalized database, transfer input quantity P ' k, as the input variable of BP neural network prediction model with most fundamental forecasting condition, thus obtain and input variable P ' kthe prediction output quantity Y ' of the relative height that the BP neural network prediction model that mapping pair is answered exports kdata group;
207, the threshold value determined by test sample book normalized described in step 202 and the scope of weights, according to initial threshold value and the weights of the principle Optimized BP Neural Network forecast model of genetic algorithm, and complete the training study of BP neural network prediction model; Specific as follows:
A. using the threshold value of random initializtion many groups BP neural network prediction model and the weights initial population as genetic algorithm, Population Size rule of thumb presets, and encodes to this initial population, and setting largest optimization algebraically was 50 generations;
B. the ideal adaptation degree function of the initialization population sample of the genetic algorithm of Optimized BP Neural Network forecast model initial threshold and weights is configured to:
F = k Σ j = 1 N ( T j - Y j , )
In formula, N is the node that network exports, N=1; T jfor the desired output of a BP neural network jth node; Y' jfor the prediction of a jth node exports; K is coefficient, k=1;
The numerical value of the fitness F of each individuality in initial population is calculated according to ideal adaptation degree function formula;
C. according to roulette method, namely based on the selection strategy of fitness ratio, from the multiple individuality of initialization population, select multiple optimization individualities that corresponding ideal adaptation degree F numerical value is relatively large, carry out intersecting, mutation operation, the new individuality of generation is as first filial generation weights W 1with threshold value θ 1the individuality of population, specific as follows:
Interlace operation adopts real number bracketing method, a kth chromosome a kwith l chromosome a lin j' position interlace operation method be:
a kj'=a kj'(1-b)+a i'j'b;
a lj'=a lj'(1-b)+a kj'b;
In formula, a kj'for a kth chromosomal j' position; a i'j'be i-th chromosomal j' position; a lj'be l chromosomal j' position; B is the random number between [0,1];
Mutation operation chooses i-th " jth of individuality " individual gene a i" j" make a variation, be specially:
When r is more than or equal to 0.5,
a ij”=a ij”+(a ij”-a max)*f(g);
When r is less than 0.5,
a ij”=a ij”+(a min-a ij”)*f(g);
Wherein, r is the random number between [0,1]; a maxand a minbe respectively gene a i" j" the upper bound and lower bound; F (g)=r 2(1-g/G max); r 2it is a random value; G is current iteration number of times; G maxit is maximum evolution number of times;
D. first filial generation weights W is used 1with threshold value θ 1the new individual individuality replacing initial population of population, repeat the genetic algorithm of step a to step c to the optimizing process of first filial generation population at individual, until ideal adaptation degree function described in step b is basicly stable constant or when reaching the evolutionary generation of setting, terminate optimizing process, and obtain initialization complete last in generation population individuality, namely obtain the initial weight W that initialization is complete 2with threshold value θ 2;
208, to optimize complete initial weight and threshold value BP neural network prediction model carry out training study, specific as follows;
I. the test sample book transferred from normalized database, input quantity P ' wherein kwith output quantity C ' khave and map corresponding relation really; With the input quantity P ' of identical test sample book kbring in BP neural network prediction model, and by weights W complete for initialization 2with threshold value θ 2as new initial threshold and the weights of BP neural network; The prediction output quantity Y ' now obtained by BP neural network j, this predicts output quantity Y ' jwith relative height desired throughput T jbetween there is error;
II. set up the error back propagation model of BP neural network, construct one by relative desired throughput T jwith the prediction output quantity Y ' of BP neural network prediction model jthe objective function formed: the process of this minimization of object function is made to be exactly the process of BP neural network error back propagation;
III. carry out computing with the objective function of gradient descent method to BP neural network error back propagation, make the initial weight W of BP neural network prediction model 2with threshold value θ 2optimize further; According to gradient descent method, with the increase of iterations, the error of objective function will progressively reduce, until error meets the accuracy requirement preset, terminate the optimizing process of initial threshold and weights;
IV. through step III calculating repeatedly and reduce error, when error finally meets the accuracy requirement preset, obtain weights W and the threshold value θ of one group of optimum, using weights W now and threshold value θ as the final weights and threshold of BP neural network prediction model, the training study of BP neural network prediction model completes;
209, by the BP neural network prediction model completing training study, obtain prediction output quantity and relative height, and its computing formula and model final weights W, threshold value θ are transferred in described microprocessor module; Relative height formula is as follows:
△H=purelin{tansig(p*W 1j+t*W 2jj)*W j1q}
In formula, W 1jand W 2jbe respectively air pressure P and temperature t corresponding by the weights of hidden layer to input layer; W j1for output layer is to the weights of hidden layer; θ qfor output layer threshold value;
Step 3, array-type sensor module described in described microprocessor module order reads compensating parameter, and is transmitted back in described microprocessor module by the air pressure of collection and temperature value and compensating parameter; Described microprocessor module is compensated air pressure and temperature value by compensating parameter, averages, and be normalized mean value after the air pressure after compensation and temperature value are removed maximin;
Step 4, applies the relative height computing formula that described microprocessor module receives, and calculates corresponding normalized relative height value; The relative height value calculated is carried out renormalization process, obtains actual relative height;
Step 5, the air pressure of renormalization, temperature and relative height after compensating are sent to that host computer carries out storing, LCD MODULE shows by described microprocessor module respectively.
2. measuring method according to claim 1, is characterized in that, described microprocessor module selects the microcontroller of MSP430F149 model.
3. measuring method according to claim 1, is characterized in that, described array gas pressure sensor module selects BMP085 model baroceptor to form the square formation of 3*3.
4. measuring method according to claim 1, is characterized in that, described LCD MODULE selects LCD12864 model.
5. measuring method according to claim 1, is characterized in that, described serial communication modular selects RS232 serial communication chip.
6. measuring method according to claim 1, is characterized in that, described power module selects 7133 voltage stabilizing chips.
CN201310740218.6A 2013-12-27 2013-12-27 A kind of relative height measurement mechanism and method Active CN103712599B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310740218.6A CN103712599B (en) 2013-12-27 2013-12-27 A kind of relative height measurement mechanism and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310740218.6A CN103712599B (en) 2013-12-27 2013-12-27 A kind of relative height measurement mechanism and method

Publications (2)

Publication Number Publication Date
CN103712599A CN103712599A (en) 2014-04-09
CN103712599B true CN103712599B (en) 2015-10-28

Family

ID=50405762

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310740218.6A Active CN103712599B (en) 2013-12-27 2013-12-27 A kind of relative height measurement mechanism and method

Country Status (1)

Country Link
CN (1) CN103712599B (en)

Families Citing this family (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105091935A (en) * 2014-05-16 2015-11-25 北京光徽德润航空技术有限公司 Multifunctional digital air pressure gauge
CN104134097B (en) * 2014-07-01 2016-06-15 哈尔滨工业大学 A kind of severe cold area office building form energy-saving design method based on GANN-BIM model
CN104444814B (en) * 2014-11-10 2017-01-11 长沙海川自动化设备有限公司 Height detection device and equipment asset statistical system and method
CN105865417A (en) * 2015-01-19 2016-08-17 上海丽恒光微电子科技有限公司 Height measuring method, height measuring instrument and wearable device
CN105987681B (en) * 2015-01-29 2018-05-04 青岛海洋地质研究所 Seashore wetland earth's surface elevation dynamic change and accretion speed measurement method
CN104748722B (en) * 2015-03-13 2017-09-08 中国科学院光电研究院 Utilize the elevation location method of satellite positioning information real time calibration barometric leveling result
CN104792316A (en) * 2015-03-21 2015-07-22 云升军 Automatic ocean observation device
CN105371820A (en) * 2015-12-22 2016-03-02 南京科技职业学院 Altitude altimeter
CN105915891B9 (en) * 2016-05-06 2018-08-24 哈尔滨工程大学 A kind of imaging sensor key parameter test method based on details in a play not acted out on stage, but told through dialogues variance signal
CN106444825B (en) * 2016-09-05 2020-05-08 天津远度科技有限公司 Aircraft, control terminal, aircraft control method and control device
CN106225769B (en) * 2016-09-30 2020-01-21 深圳市富微科创电子有限公司 Aircraft height setting method and system
CN107314756A (en) * 2016-12-15 2017-11-03 天津同创达科石油科技有限公司 Rig electronics anticollision system based on atmospheric pressure
CN106767763A (en) * 2017-03-15 2017-05-31 北方工业大学 Environment compensation device and method for plane attitude measurement sensor
CN109141355B (en) * 2018-08-28 2021-10-01 广东小天才科技有限公司 Relative height measuring method based on multiple sensors and wearable equipment
CN110645957B (en) * 2019-10-23 2021-10-15 航宇救生装备有限公司 Q fixed point representation method of height sensor of umbrella opener
CN110926688A (en) * 2019-11-21 2020-03-27 歌尔股份有限公司 Air pressure detection method and system
CN111750823A (en) * 2020-05-29 2020-10-09 深圳市梦网物联科技发展有限公司 Helmet height positioning method and system
CN114608523B (en) * 2021-12-30 2023-09-15 西南科技大学 High-precision and high-stability barometric height measurement system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103034238A (en) * 2012-12-28 2013-04-10 杭州电子科技大学 Automatic navigation flight control system based on cross-flow fan
CN103344218A (en) * 2013-06-18 2013-10-09 桂林理工大学 System and method for measuring altitude of low-altitude unmanned plane

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103034238A (en) * 2012-12-28 2013-04-10 杭州电子科技大学 Automatic navigation flight control system based on cross-flow fan
CN103344218A (en) * 2013-06-18 2013-10-09 桂林理工大学 System and method for measuring altitude of low-altitude unmanned plane

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
基于ATmega16单片机的微型气象探测系统设计;杨镇博等;《现在电子技术》;20130601;第36卷(第11期);第106-109页 *
基于BMP085气压传感器及BP算法的高度测量研究与实现;梁胜展等;《传感技术学报》;20130531;第26卷(第5期);第654-659页 *
基于BMP085的一种便携式海拔高度测量系统设计;王俊彩等;《传感器与微系统》;20111231;第30卷(第12期);第123-125页 *

Also Published As

Publication number Publication date
CN103712599A (en) 2014-04-09

Similar Documents

Publication Publication Date Title
CN103712599B (en) A kind of relative height measurement mechanism and method
Krishnamurthy Predictability of weather and climate
CN100538276C (en) A kind of MEMS gyroscopes error compensation method for micro satellite based on integrated neural network
Mba et al. Application of artificial neural network for predicting hourly indoor air temperature and relative humidity in modern building in humid region
CN105258839A (en) Array type air pressure measurement compensation device and method based on quantum particle swarm wavelet neural network
CN102297687B (en) Calibrating method for electronic compass
JP5871635B2 (en) Solar radiation amount calculation device, control method and program for solar radiation amount calculation device
CN101630376A (en) Soft-sensing modeling method and soft meter of multi-model neural network in biological fermentation process
Maity et al. Importance analysis of local and global climate inputs for basin‐scale streamflow prediction
JP6697116B2 (en) Solar cell inspection device, inspection system, inspection method, and program
CN115034152B (en) Nonlinear reduced-order prediction method and device for data-driven fluid-solid coupling system
CN104915509B (en) Large deformation flexible body dynamic stress metrical information conversion method based on neutral net
CN110347671A (en) The method for constructing wind energy on the sea data bank and offshore wind power generation amount database
CN112862178A (en) Ocean station water level space-time prediction method and device based on deep learning
Zhu et al. Online modelling and calculation for operating temperature of Silicon‐Based PV modules based on BP‐ANN
CN105824987A (en) Wind field characteristic statistical distributing model building method based on genetic algorithm
Dunbar et al. Ensemble‐based experimental design for targeting data acquisition to inform climate models
Hsu et al. Ocean Surface Flux Algorithm Effects on Tropical Indo‐Pacific Intraseasonal Precipitation
CN112883478B (en) Steel structure displacement prediction method, device, terminal equipment and system
CN103217507A (en) Wireless intelligent carbon sequestration monitoring system
Du et al. On the ability to design engineering experiments
Zaszewski et al. A low-cost automatic system for long-term observations of soil temperature
Musa et al. Micro-controller Based Mobile Weather Monitor System
CN105184072A (en) Data interpolation method and apparatus
Choudhary et al. Artificial neural network based solar radiation estimation: a case study of Indian cities

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20190415

Address after: 211100 Yingxia Garden, Rhine East County Garden, Jiangning District, Nanjing City, Jiangsu Province, 9-102

Patentee after: Jiangsu Ruitou Intellectual Property Operations Co., Ltd.

Address before: 210044 Ning six road, Pukou District, Nanjing, Jiangsu Province, No. 219

Patentee before: Nanjing University of Information Science and Technology

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20190428

Address after: 510000 in Wushan South China University of Technology, Tianhe District, Guangzhou City, Guangdong Province

Patentee after: Guangdong Huagong Engineering Construction Supervision Co., Ltd.

Address before: 211100 Yingxia Garden, Rhine East County Garden, Jiangning District, Nanjing City, Jiangsu Province, 9-102

Patentee before: Jiangsu Ruitou Intellectual Property Operations Co., Ltd.

TR01 Transfer of patent right