Summary of the invention
The deficiency existing for prior art, the invention provides a kind of method and system of reflective indoor positioning, reaching simple in structure, beacon apparatus deployment density is low, conveniently realize beacon apparatus from the object such as disposing, calculated amount is little, precision is high.A method for reflective indoor positioning, the method comprises the following steps:
Step 1: start the beacon apparatus that is placed on flooring, the temperature sensor module of each beacon apparatus inside is carried out temperature survey, and enters immediately radiofrequency signal accepting state;
Step 2: the communication module of destination apparatus to be positioned receives after the Location Request of its host apparatus, sends radiofrequency signal and ultrasonic signal to beacon apparatus, and radiofrequency signal is wherein carried the identify label number information of destination apparatus to be positioned;
Step 3: beacon apparatus initialization, making timer record value is zero, and enter Real-Time Monitoring radiofrequency signal state: when beacon apparatus receives after radiofrequency signal, detect immediately whether receive the identify label number information that radiofrequency signal carries identical with the identify label number information of destination apparatus to be positioned, if identical, do not abandon, return to the radio frequency reception state of waiting for; If identical, once find range;
Step 4: all beacon apparatus are detecting from destination apparatus transmission to be positioned after the ultrasonic signal of roof reflector, record ultrasound wave time of arrival, and beacon apparatus numbering, temporal information and temperature information are packaged into packet, according to beacon apparatus number order, by packet, the form by wireless telecommunications sends to data collector successively, and temperature information is wherein that beacon apparatus measures by beacon apparatus internal temperature sensor module when starting;
Step 5: data collector sends the data message of receiving to position calculating apparatus, first position calculating apparatus calculates indoor medial temperature according to the temperature information of each beacon apparatus, then calculates the aerial velocity of propagation of ultrasound wave; Temporal information according to the aerial velocity of propagation of ultrasound wave and each beacon apparatus, calculates the roof plan mirror image of device to be positioned and the distance of each beacon apparatus;
Step 6: position calculating apparatus is according to the roof plan mirror image of indoor coordinate system, beacon apparatus coordinate and the beacon apparatus set up in advance and the distance of destination apparatus to be positioned, calculate the planimetric coordinates of the roof plan mirror point of destination apparatus to be positioned, it has identical planimetric coordinates with destination apparatus to be positioned, so far completes one-time positioning.
In said method described in step 5, calculate the aerial velocity of propagation of ultrasound wave, its computing formula is as follows:
V=331.5+0.607T
In formula: V is the aerial velocity of propagation of ultrasound wave;
T is average indoor temperature;
The described time recording according to the aerial velocity of propagation of ultrasound wave and each beacon apparatus, calculates the roof plan mirror image of device to be positioned and the distance of each beacon apparatus, and its computing formula is as follows:
D
i=V×Tim
i+ε
In formula: D
ifor the roof plan mirror image of each beacon apparatus and the distance of destination apparatus to be positioned;
Tim
ifor ultrasonic signal is propagated the time that arrives each beacon apparatus from destination apparatus to be positioned;
ε is the compensated distance factor.
The system of reflective indoor orientation method of the present invention, comprises host apparatus, position calculating apparatus and mobile device, also comprises beacon apparatus, destination apparatus to be positioned and data collector, wherein:
Beacon apparatus: for received RF signal with through the ultrasonic signal of roof plan transmitting, by the processor of beacon apparatus inside, measure ultrasonic signal and from destination apparatus to be positioned, propagate into the time of arrival of beacon apparatus, and temperature information and beacon apparatus number information that above-mentioned temporal information, beacon apparatus internal temperature sensor module are measured are packaged into Packet Generation to data collector;
Destination apparatus to be positioned: the positioning command sending for receiving host apparatus, and send radiofrequency signal and ultrasonic signal to beacon apparatus;
Data collector: for receiving the radiofrequency signal of sending from beacon apparatus, and above-mentioned radiofrequency signal is sent to position calculating apparatus.
Described beacon apparatus comprises temperature sensor module, ultrasound wave receiver module, the processor module of beacon apparatus and the radio-frequency module of beacon apparatus, wherein:
Temperature sensor module: for measures ambient temperature, and temperature information is passed to the processor module of beacon apparatus inside;
Ultrasound wave receiver module: for receive from destination apparatus to be positioned, send through roof plan transmitting ultrasonic signal, and ultrasonic signal is passed to the processor module of beacon apparatus inside;
The processor module of beacon apparatus: arrive the time of beacon apparatus for measuring the ultrasonic propagation sending from destination apparatus to be positioned, and become data packet delivery to radio-frequency module above-mentioned temporal information, the temperature information of temperature sensor module measurement and the node serial number information package of beacon apparatus;
The radio-frequency module of beacon apparatus: for receiving and send radiofrequency signal, receive the radiofrequency signal sending from destination apparatus to be positioned, and radiofrequency signal is passed to the processor module of beacon apparatus inside; To comprise temporal information, the temperature information of temperature sensor module measurement and the Packet Generation of beacon apparatus number information to data collector.
Described destination apparatus to be positioned comprises radio-frequency module, ultrasound wave transmitter module, the communication module of destination apparatus to be positioned and the processor module of destination apparatus to be positioned of destination apparatus to be positioned, wherein:
The radio-frequency module of destination apparatus to be positioned: for sending radiofrequency signal, the radiofrequency signal that includes identify label number information is sent to beacon apparatus;
Ultrasound wave transmitter module: for sending ultrasonic signal to beacon apparatus;
The communication module of destination apparatus to be positioned: for realizing the processor module of destination apparatus to be positioned and communicating by letter of host apparatus;
The processor module of destination apparatus to be positioned: for receiving host apparatus positioning command; Control radio-frequency module and send radiofrequency signal; Control ultrasonic wave module and send ultrasonic signal.
Described data collector comprises the processor module of the radio-frequency module of data collector, the communication module of data collector and data collector, wherein:
The radio-frequency module of data collector: for receiving the radiofrequency signal that comprises packet sending from beacon apparatus, and radiofrequency signal is passed to data collector internal processor module;
The communication module of data collector: for realizing communicating by letter of processor module and position calculating apparatus;
The processor module of data collector: receive beacon apparatus packet, the node serial number information of temporal information, temperature information and beacon apparatus is sent to position calculating apparatus.
Advantage of the present invention:
The method and system of a kind of reflective indoor positioning of the present invention, wherein, beacon apparatus is placed on ground location, is convenient to realize beacon apparatus and disposes, and can wait device to realize from disposing by mobile robot; Ultrasonic signal arrives beacon apparatus after the reflection of plane roof, and ultrasonic signal is twice in the reach expansion on ground, has reduced the deployment density of beacon apparatus; Data transmission is all by wireless, and beacon apparatus can work alone, and a little less than system, coupled, is convenient to dispose; By the identify label number (ID) to signal, identify, increased the antijamming capability of system; This system accuracy is high, and average positioning error is less than 5cm; This system locating speed is fast, has higher location frequency; Beacon apparatus and destination apparatus to be positioned are simple in structure, and volume is little, conveniently installs and carries.
Embodiment
Below in conjunction with accompanying drawing, embodiments of the invention are further described.
The system that is an embodiment of the present invention as Fig. 3 forms and principle of work schematic diagram, and this system comprises beacon apparatus, destination apparatus to be positioned, host apparatus, mobile device, data collector and position calculating apparatus.Wherein, host apparatus (can be the processor on handheld personal computer machine, embedded device or mobile robot, what in the present embodiment, adopt is the processor on mobile robot) the destination apparatus data input pin to be positioned that positioning command passed to by data output end, described host apparatus is arranged on one end of mobile device, and destination apparatus to be positioned is arranged on the other end of mobile device.Destination apparatus to be positioned sends radiofrequency signal and ultrasonic signal to beacon apparatus, described ultrasonic signal by indoor roof plane reflection after, pass to beacon apparatus, beacon apparatus is placed on flooring (placement location does not have specific requirement), its position is measured acquisition in advance, and the coordinate data of beacon apparatus is kept in the coordinate system of position calculating apparatus (can be handheld personal computer or embedded computer, in the present embodiment, calculation element adopts embedded computer) foundation.Data collector passes to the information of the beacon apparatus of collecting by data output end the data input pin of position calculating apparatus.In embodiments of the present invention, in order to make destination apparatus to be positioned obtain positional information accurately, destination apparatus to be positioned needs at least in the sensing range of three beacon apparatus.The sensing range of radiofrequency signal generally can be full of whole room, therefore its sensing range can be ignored, and ultrasonic signal generally has certain effect angle, ultrasonic signal its radius of action expansion after roof reflector is twice, and concrete dispositions method is different and different with the position of beacon apparatus.
Fig. 4 is the beacon apparatus sensing range schematic diagram of the embodiment of the present invention, and beacon apparatus is placed on the situation of ceiling relatively, and the perception radius expansion of ultrasonic sensor is twice, and deployment density reduces greatly.For example: for same area to be positioned, if beacon apparatus on ceiling, positioning system needs 100 beacon apparatus, the beacon apparatus of the present embodiment is placed on ground only needs 25 can meet the demands.Because destination apparatus to be positioned is placed on ground, it is convenient to dispose, and easily realizes the Dynamical Deployment of beacon apparatus, is especially applicable to mobile robot at zone of ignorance Dynamical Deployment fixer network.
Fig. 5 is the beacon apparatus structured flowchart of an embodiment of the present invention, the CC2430 cake core of the processor adopting LiaoTI company in the present embodiment in beacon apparatus processor module 503.Due to the embedded high performance 2.4GHz direct sequence spread spectrum of CC2430 chip (DSSS) radio-frequency (RF) transceiver core, therefore no longer need in the present embodiment independent radio-frequency module 504; The ultrasound wave receiving circuit of the present embodiment ultrasound wave receiver module 505 has adopted the CX20106A type infrared radiation receiving circuit special integrated chip of Sony Corporation, and processor P 1_5 pin connects the output terminal of ultrasound wave receiving circuit; The DS18B20 type one line digital temperature sensor processed that the present embodiment temperature sensor module 502 adopts DALLAS company to produce, processor P 1_4 pin connects the output terminal of temperature sensor module 502; Power module 501 adopts the LM7805 power supply voltage stabilizing chip of National Semiconductor, the LM1117 power supply voltage stabilizing chip of National Semiconductor, and adopt 7.2V lithium battery or 5 to save 1.5V batteries, the processor module 503 that is beacon apparatus by 3.3V voltage output end, temperature sensor module 502 provide operating voltage, by 5V voltage output end, provide operating voltage for ultrasound wave receiver module 505.
Fig. 6 is beacon apparatus power module 501 circuit theory diagrams of an embodiment of the present invention, and the present embodiment adopts 7.2V lithium battery input power, first by electric capacity, carries out filtering, then by the 5V voltage of LM7805 power supply voltage stabilizing chip stable output.A 5V power supply wherein road is exported to the CX20106A chip in ultrasound wave receiver module 505, separately leads up to the 3.3V voltage of LM1117 power supply voltage stabilizing chip stable output, for processor module 503 and the temperature sensor module 502 of beacon apparatus provides operating voltage.
Fig. 7 is the present embodiment beacon apparatus temperature sensor module 502 circuit theory diagrams.This temperature sensor relatively obtains measurement temperature by the counting of low-temperature coefficient crystal oscillator and high-temperature coefficient crystal oscillator, and compensate and revise non-linear in thermometric process by slope totalizer, finally by the Data Transport Protocol output processed of a simple line, measure temperature, above-mentioned measurement temperature is exported to the P1_4 pin of processor CC2430 chip by the output terminal of temperature sensor module 502.
Beacon apparatus processor module 503 circuit theory diagrams of Fig. 8 an embodiment of the present invention, the CC2430 chip of processor adopting LiaoTI company in the present embodiment; By 16 bit timing devices of processor inside, measure the time of arrival of ultrasonic signal, and above-mentioned temporal information, the temperature information of DS18B20 measurement and the number information (example: three beacon apparatus number information are respectively No. 1, No. 2, No. 3) of beacon apparatus are packaged into packet, and pass to radio-frequency module.The principle of work that described radio-frequency module receives signal is: receive after radiofrequency signal, low noise amplifier through processor inside amplifies, and the in-phase signal of receiving and quadrature phase signal frequency reducing are converted to intermediate-freuqncy signal, filter out after I/Q (inphase quadrature) signal remaining in intermediate-freuqncy signal, amplify intermediate-freuqncy signal, then by ADC (A-D converter) digitizing, automatic gain is controlled, the filtration of channel, separate spread spectrum, symbol is relevant to be processed with byte of sync, and set frame starts to define symbol, processor can start to define symbol by frame and judge whether to receive radiofrequency signal.The inner CC2430 chip of processor module 503 deposits the data buffering of receiving in RX FIFO (reception first-in first-out) queue of 128 bytes, user reads the data in RX fifo queue by the special function register of processor inside, completes the reception of radio-frequency signal detection and data.Radiofrequency signal is sent by the radio-frequency module in the CC2430 chip of processor module 503 inside equally, its principle of work is: by deposit data among the TX of 128 bytes FIFO (transmission first-in first-out), the frame homing sequence sending and frame start to define symbol and are automatically produced by the radio-frequency module in the inner CC2430 chip of processor module 503, each symbol is used IEEE (Institute of Electrical and Electric Engineers) 802.15.4 sequence spreading to expand to 32 chip sequences, output in the inner DAC of processor, signal through DAC conversion, by radio-frequency module internal simulation low-pass filter, deliver to the inner 90 ° of I/Q phase shift frequency upconversion frequency mixer of radio-frequency module, last radiofrequency signal is fed to antenna by radio-frequency module internal power amplifier and is sent.
Fig. 9 is beacon apparatus ultrasound wave receiver module 505 circuit theory diagrams of an embodiment of the present invention, and processor receives the signal from ultrasound wave receiver module 505 by P1_5 pin.Ultrasound wave receiving transducer in ultrasound wave receiver module 505 has adopted customized wide-angle ultrasound wave receiving transducer, its center resonant frequency is 40 ± 2.0KHz, acoustic pressure in transmission is greater than 105dB, be greater than-74dB of receiving sensitivity, launching beam angle is 60 °, working temperature is-40~+ 80 ℃, and operating voltage is 300~500VP-P.In order to increase the stability of system, the present embodiment ultrasound wave receiving circuit has adopted the CX20106A type infrared radiation receiving circuit special integrated chip of Sony Corporation, after prime amplifier, limiting amplifier, bandpass filter, wave detector, integrator and the shaping circuit of signal by chip internal, signal is passed to processor CC2430 chip.
Figure 10 is the destination apparatus structured flowchart to be positioned of the present embodiment, processor in the processor module 1003 of destination apparatus to be positioned adopts the CC2430 cake core of LiaoTI company equally, an embedded high performance 2.4GHz radio-frequency (RF) transceiver core, is used its embedded radio-frequency module to replace independent radio-frequency module; In addition,, by UART (Universal Asynchronous Receiver & dispensing device) realization of processor CC2430 cake core inside and the command communication of host apparatus, replace independent communication module 1005; Processor CC2430 chip passes through P1_4 pin to ultrasound wave transmitter module 1001 transmitted signals; Calculation element provides 5V power supply for power module 1002, and power module 1002 adopts LM1117 voltage stabilizing chips, and 3.3V output terminal provides stable 3.3V operating voltage to processor CC2430 chip, and calculation element provides 5V operating voltage for ultrasound emission module 1001.
The processor module 1003 of the destination apparatus to be positioned of the present embodiment is the same with the processor module 503 in beacon apparatus, all adopts the CC2430 chip of LiaoTI company; By the P1_4 mouth of processor CC2430 chip, control ultrasound wave transmitter module 1001 and send ultrasonic signal; By UART (Universal Asynchronous Receiver & dispensing device) realization of processor inside and the command communication of host apparatus, replace independent communication module 1005; By controlling radio-frequency module, to beacon apparatus, send radiofrequency signal, its principle of work is consistent with the processor module 503 in beacon apparatus, at this, no longer repeats.
Figure 11 is destination apparatus ultrasound wave transmitter module to be positioned 1001 circuit theory diagrams of an embodiment of the present invention.Processor CC2430 chip is controlled ultrasound wave transmitter module 1001 transmitting ultrasonic signals by P1_5 pin.Ultrasound wave transmitter module 1001 has adopted customized wide-angle ultrasound wave transmitting probe equally, its center resonant frequency is 40 ± 2.0KHz, acoustic pressure in transmission is greater than 105dB, be greater than-74dB of receiving sensitivity, launching beam angle is 60 °, working temperature is-40~+ 80 ℃, and operating voltage is 300~500VP-P.Processor CC2430 chip produces the 40KHz square-wave pulse in 20 cycles, by P1_4 pin, send to ultrasound wave transmitter module 1001, square-wave pulse signal is sent into transistor base in ultrasound wave transmitter module 1001 circuit, then the high-frequency step-up transformer that its pulse signal is added to ultrasound wave transmitter module 1001 inside carries out the amplification of voltage signal, make voltage magnitude be increased to 300V, the secondary coil of high-frequency step-up transformer and transmitter form resonant tank, thereby make transmitter send ultrasonic signal.This circuit has improved the moment emissive power of ultrasound wave emission sensor, and has lower system power dissipation.
Figure 12 is destination apparatus to be positioned, the data collector power module circuitry schematic diagram of an embodiment of the present invention.Because power module 1002 and host apparatus are used in conjunction with, so can obtain 5V power supply from host apparatus, first the 5V power supply of the power circuit input of device to be positioned passes through capacitor filtering, then exports to the stable 3.3V operating voltage of processor CC2430 chip by LM1117 voltage stabilizing chip.Host apparatus provides 5V operating voltage for ultrasound wave transmitter module 1001.
Figure 13 is the data collector structured flowchart of an embodiment of the present invention.Processor in data collector internal processor module 1302 adopts the CC2430 cake core of LiaoTI company equally, in addition, by UART (Universal Asynchronous Receiver & dispensing device) realization of processor CC2430 cake core inside and the data communication of position calculating apparatus, replace independent communication module 1304; Processor CC2430 chip passes through P1_4 pin to ultrasound wave transmitter module 1303 transmitted signals; Position calculating apparatus provides 5V power supply for power module 1301, and power module 1301 adopts LM1117 voltage stabilizing chips, and 3.3V output terminal provides stable 3.3V operating voltage to processor CC2430 chip.
The processor module 1302 of the data collector inside of the present embodiment is the same with the processor module 503 in beacon apparatus, all adopts the CC2430 chip of LiaoTI company; By controlling radio-frequency module, receive the radiofrequency signal sending from beacon apparatus, its principle of work is consistent with the processor module 503 in beacon apparatus, at this, no longer repeats.
Power module 1301 principle of work of data collector inside are identical with destination apparatus internal electric source module to be positioned 1002 principle of work, at this, no longer repeat.
Figure 14 is the process flow diagram of the method for the reflective indoor positioning of an embodiment of the present invention, the method utilizes ultrasound wave and radio-frequency technique the system based on consisting of beacon apparatus, destination apparatus to be positioned, host apparatus, mobile device, data collector and position calculating apparatus to realize self-align to indoor moving device, comprises the following steps:
Step 1: start the beacon apparatus that is placed on flooring, the temperature sensor module of each beacon apparatus inside is carried out temperature survey, and enters immediately radiofrequency signal accepting state;
Step 2: the communication module of destination apparatus to be positioned receives after the Location Request of its host apparatus, sends radiofrequency signal and ultrasonic signal to beacon apparatus, and radiofrequency signal is wherein carried the identify label number information of destination apparatus to be positioned;
Step 3: beacon apparatus initialization, making timer record value is zero, and enter Real-Time Monitoring radiofrequency signal state: when beacon apparatus receives after radiofrequency signal, detect immediately whether receive the identify label number information that radiofrequency signal carries identical with the identify label number information of destination apparatus to be positioned, if identical, do not abandon, return to the radio frequency reception state of waiting for; If identical, once find range;
Step 4: all beacon apparatus are detecting from destination apparatus transmission to be positioned after the ultrasonic signal of roof reflector, record ultrasound wave time of arrival, and beacon apparatus numbering, temporal information and temperature information are packaged into packet, according to beacon apparatus number order, by packet, the form by wireless telecommunications sends to data collector successively, and temperature information is wherein that beacon apparatus measures by beacon apparatus internal temperature sensor module when starting;
Step 5: data collector sends the data message of receiving to position calculating apparatus, first position calculating apparatus calculates indoor medial temperature according to the temperature information of each beacon apparatus, then calculates the aerial velocity of propagation of ultrasound wave; Temporal information according to the aerial velocity of propagation of ultrasound wave and each beacon apparatus, calculates the roof plan mirror image of device to be positioned and the distance of each beacon apparatus;
Step 6: position calculating apparatus is according to the roof plan mirror image of indoor coordinate system, beacon apparatus coordinate and the beacon apparatus set up in advance and the distance of destination apparatus to be positioned, calculate the planimetric coordinates of the roof plan mirror point of destination apparatus to be positioned, it has identical planimetric coordinates with destination apparatus to be positioned, so far completes one-time positioning.
In the present embodiment, data collector by the Packet Generation of collecting to position calculating apparatus, i the environment temperature T that beacon apparatus is measured that position calculating apparatus obtains
i, by the measurement temperature to each beacon, average, obtain environment medial temperature T.Specific formula for calculation is as formula (1), and n is the beacon apparatus number of the beacon apparatus data received,
In formula: T is environment medial temperature, unit degree Celsius;
T
ibe i the environment temperature that beacon apparatus is measured, unit degree Celsius;
N is the beacon apparatus number of the beacon apparatus data received.
According to formula (2), calculate hyperacoustic velocity of propagation at this temperature,
V=331.5+0.607T (2)
In formula: V: be the aerial velocity of propagation of ultrasound wave, the m/s of unit.
Figure 15 is the plane roof mirror image of destination apparatus to be positioned and the distance schematic diagram of each beacon apparatus of an embodiment of the present invention, according to the time T imi recording (S of unit of the aerial velocity of propagation of ultrasound wave and each beacon apparatus, wherein i is beacon apparatus numbering) calculate the plane roof mirror image of destination apparatus to be positioned and the distance D i (m of unit of each beacon apparatus, wherein i is beacon apparatus numbering), its computing formula (3) is:
D
i=V×Tim
i+ε (3)
In formula: ε: be the compensated distance factor;
D
i: the level crossing picture of destination apparatus to be positioned and the calculating distance of i beacon apparatus, be destination apparatus to be positioned and beacon apparatus through the bee-line of roof reflector;
Tim
i: be the transmission time of ultrasonic signal from destination apparatus to be positioned to beacon apparatus.
When system works, because circuit devcie postpones and software delay can produce a fixing distance error, because influence factor is more and complicated, be difficult to direct measurement, the present embodiment has adopted experimental technique acquisition.By being recorded in different count values of demarcating the upper timer of distance, and go out the straight-line equation L apart from d and time t by least square fitting, thereby obtain compensated distance factor ε.Experiment under too much group different temperatures is relatively found that the compensated distance factor ε finally trying to achieve differs and is less than 0.5cm.Finally, by many group experiment averaged, finally try to achieve ε=5.24.Test data in the time of 14.6 ℃ is as shown in table 1, in the situation that there is measuring error, calculates to try to achieve distance and demarcate error between distance be less than 1cm by L.
Table 1 is demarcated test data and the error of calculation under distance
The distance computing formula of finally trying to achieve in the present embodiment, is
d=340.36t+5.24 (4)
In formula: d is: at 14.6 ℃, destination apparatus to be positioned is to the calculating distance of a certain beacon apparatus;
T is: at 14.6 ℃, and the travel-time of ultrasonic signal from destination apparatus to be positioned to a certain beacon apparatus.
The beacon apparatus coordinate of known acquisition coverage information is (x1, y1, z1), (x2, y2, z2), and (x3, y3, z3) ..., (xn, yn, zn), because beacon apparatus is placed on ground location, therefore z1=z2=z3 ...=zn; The distance that destination apparatus to be positioned is mirrored between respective beacon device about roof is respectively d1, d2, and d3 ..., dn.Suppose that destination apparatus to be positioned is (x, y, z) about the coordinate of roof mirror image, the X-axis of destination apparatus coordinate to be positioned, the numerical value of Y-axis equate with destination apparatus mirror image to be positioned, its two dimensional surface coordinate is (x, y).By cartesian coordinate system middle distance formula, there is following formula:
From first equation, starting to deduct respectively an equation thereafter obtains:
The linear equation of above formula represents that mode is: AX=b, wherein:
Use the least square estimation method to obtain
A
TAX=A
Tb (7)
The coordinate of trying to achieve destination apparatus to be positioned according to formula (7) is:
In the present embodiment, step 5 adopts arrival mistiming distance-finding method (TDOA) to find range, ranging process is: initiation beacon device, whether in predefined detection time of section (in the present embodiment detection time section is 30ms), detect in real time ultrasonic signal arrives, if ultrasonic signal being detected arrives, record the time this moment, be designated as Tim
i, and wait for section arrival finish time detection time; Before detection time, section finished, if ultrasonic signal do not detected, this seasonal Tim
i=0, be invalid data.
The maximum distance that the ultrasound wave launched by transmitting probe of described ultrasound examination time period can be propagated within the scope of receiving transducer receiving sensitivity and time of consuming is determined.Because native system is generally applied in indoorly, so the ultimate range of measuring generally in 10m, is calculated with hyperacoustic velocity of propagation under normal temperature, the ultrasound examination time period is about 30ms.This window time is less, and measuring distance is shorter; More can cause positioning time elongated, location frequency reduces.
In the present embodiment, select radiofrequency signal as time synchronizing signal, the aerial velocity of propagation of radio frequency is 3.0 * 108m/s, propagating the 10m time used is 0.033us, within this period, hyperacoustic propagation distance is 1.1 * 10-3cm, be far smaller than the distance accuracy of 1cm, therefore using it as time synchronizing signal.
Figure 16 is the beacon apparatus workflow diagram of an embodiment of the present invention.
Step 1: after beacon apparatus powers on, carry out initialization, after beacon apparatus powers on, receiving trap is completed to initialization, start processor internal clocking, it is input pattern that the ultrasound wave of set handling device receives IO (I/O) mouthful P1_5, and the P0_2 of set handling device, P0_3 mouth are serial communication multiplexer mode, set handling device timer internal is 16 bit timing patterns, starts USART and radio-frequency module;
Step 2: by beacon apparatus internal temperature sensor module testing environment temperature;
Step 3: initialization processor timer internal record value is 0;
Step 4: processor enters the receiving mode state that frame starts to define symbol (being detected interrupt flag bit IRQ_SFD) in CC2430 chip that detects, while interrupt flag bit being detected, start timer and start timing, thereby judge whether to receive radiofrequency signal, if receive, perform step 5; If do not receive, return to step 4 and continue to wait for reception;
Step 5: whether identify label number (ID) information in the radiofrequency signal data that judgement receives is correct, if mistake is abandoned this range finding, returns and waits for received RF signal state, performs step 4; If correct, perform step 6;
Step 6: start timer;
Step 7: processor judges whether to receive ultrasonic signal, if ultrasonic signal detected, preserves timer numerical value, and waits for that overflow value (being the value of ultrasound examination time period, value 30ms in the present embodiment) arrives; If ultrasonic signal do not detected, timer is waited for the arrival of overflow value;
Step 8: timer value is assigned to timer and preserves variable;
Step 9: judge whether timer overflow value 30ms arrives, if do not arrive, repeated execution of steps 9 waits for that overflow value arrives; If arrive, timer enters and overflows interruption, stops detecting ultrasonic signal, performs step 10;
Step 10: the order according to beacon apparatus numbering is carried out corresponding delay;
Step 11: send beacon apparatus numbering, temperature and time information to data collector, described temporal information equates with timer record value information;
Step 12: carry out after corresponding delay according to beacon apparatus numbering, circulation enters next round distance measuring states.
Figure 17 is the destination apparatus workflow diagram to be positioned of an embodiment of the present invention.
Step 1: host apparatus is given after destination apparatus power supply to be positioned, first initialization CC2430 chip system, startup processor internal clocking, the P0_2 of set handling device, P0_3 mouth are serial communication multiplexer mode, start radio-frequency module and communication module etc., and identify label number (ID) information of this destination apparatus to be positioned of initialization, after completing, destination apparatus to be positioned enters the measured coomand modes such as serial ports;
Step 2: processor judges whether to receive the range finding order of host apparatus, if do not receive, returns and continues execution step 2 wait receptions, if receive, performs step 3;
Step 3: send radiofrequency signal;
Step 4: after radiofrequency signal is sent completely, processor sends to ultrasound wave transmitter module the pulse signal that the frequency in 20 cycles is 40KHz immediately, controls ultrasound wave transmitter module transmitting ultrasonic signal;
Step 5: time delay 50ms.So far a ranging process completes, and destination apparatus to be positioned enters launch readiness and waits for range finding order next time.