Q fixed point representation method of height sensor of umbrella opener

文档序号:1685450 发布日期:2020-01-03 浏览:36次 中文

阅读说明:本技术 一种开伞器的高度传感器的q定点表示方法 (Q fixed point representation method of height sensor of umbrella opener ) 是由 钟廷伟 李维 沈小飞 冯友权 贾晓迪 李志刚 沈天驹 于 2019-10-23 设计创作,主要内容包括:本发明公开了一种开伞器的高度传感器的Q定点表示方法,高度传感器的电压值v=kx+b,包括以下步骤:求得k的Q定位表达式及k的Q定点位数;确定x的Q定点位数,b的Q定点位数;将高度传感器在相应温度下标定的k,带入k的Q定点表达式中Qk;将高度传感器在相应温度下标定的b,带入b的Q定点表达式中Qb;若采集的当前温度超出高度传感器的温度边界值,则取边界值对应的Qk和Qb值,若采集的当前温度没有超出高度传感器的温度边界值,则利用线性插值求得当前温度下的Qk和Qb值;计算得到Qx,求得高度传感器对应的当前静压值;并求得当前高度值。提高了系统运算的可靠性,提高了开伞器的稳定性和反应效率。(The invention discloses a Q fixed point representation method of a height sensor of an umbrella opener, wherein the voltage value v of the height sensor is kx + b, and the Q fixed point representation method comprises the following steps: solving a Q positioning expression of k and a Q fixed point digit of k; determining the Q fixed point digit of x and the Q fixed point digit of b; bringing k calibrated by the height sensor at corresponding temperature into a Q fixed point expression of the k; b, substituting b calibrated by the height sensor at a corresponding temperature into Qb in a Q fixed point expression of b; if the acquired current temperature exceeds the temperature boundary value of the height sensor, the Qk and Qb values corresponding to the boundary value are taken, and if the acquired current temperature does not exceed the temperature boundary value of the height sensor, the Qk and Qb values at the current temperature are obtained by linear interpolation; calculating to obtain Qx, and obtaining a current static pressure value corresponding to the height sensor; and the current height value is obtained. The reliability of system operation is improved, and the stability and the reaction efficiency of the parachute opening device are improved.)

1. A Q fixed point representation method of a height sensor of an umbrella opener is characterized in that a voltage value v of the height sensor is kx + b (1), wherein x is a static pressure value of the height sensor, k and b are coefficient values of the height sensor, and a conversion relation between the voltage value v of the height sensor and a voltage AD value N of the height sensor is represented as

Figure FDA0002244195480000011

the Q fixed point representation method of the height sensor of the umbrella opener comprises the following steps:

s1, obtaining a Q fixed point digit expression of k according to the formula (1) and the formula (2), and obtaining the Q fixed point digit of k according to the value range of the height sensor and the voltage calibration range of the height sensor;

s2, solving a Q fixed point digit expression of x and a Q fixed point digit expression of b, and determining the Q fixed point digit of x and the Q fixed point digit of b;

s3, substituting k calibrated by the height sensor at corresponding temperature into Qk in a Q fixed-point digit expression of k;

b calibrated by the height sensor at corresponding temperature is substituted into Qb in a Q fixed point digit expression of b;

s4, acquiring the temperature of the current height sensor, if the acquired current temperature exceeds the temperature boundary value of the height sensor, taking the Qk and Qb values corresponding to the boundary value, and if the acquired current temperature does not exceed the temperature boundary value of the height sensor, obtaining the Qk and Qb values at the current temperature by using linear interpolation;

s5, collecting the current voltage AD value N of the height sensor;

s6, substituting N, Qk and Qb into a formula to calculate Qx, and thus obtaining a current static pressure value corresponding to the height sensor;

and S7, obtaining the current height value according to the current static pressure value of the height sensor.

2. The method for representing the Q fixed point of the height sensor of the umbrella opener according to claim 1, wherein in step S1, the specific process of calculating the Q fixed point digit expression for k is as follows:

substituting equation (2) into equation (1) yields:

Figure FDA0002244195480000012

Figure FDA0002244195480000013

Wherein Vref is 3, N is the acquired AD value, and the range of N is 0-4095;

rewrite equation (3) to:

Figure FDA0002244195480000014

the Q fixed point digit number expression on k according to formula (4) is

Figure FDA0002244195480000015

3. The method as claimed in claim 2, wherein the Q fixed point number of the b is expressed as Q fixed point number in step S2

Figure FDA0002244195480000021

the Q fixed point digit expression of x is x multiplied by 2QQx, where Q is 8.

4. The method for representing the Q fixed point of the height sensor of the parachute opening device according to claim 2, wherein the specific process of determining the number of the Q fixed points of k in the step S1 comprises the following steps:

1) v. theh、vlRepresenting the maximum and minimum values, x, of the nominal voltage of the height sensormaxAnd xminRepresenting the maximum and minimum values of the sensor measurement, respectively, substituted into equation (1), yields:

vh=kxmax+ b (formula a)

vl=kxmin+ b (formula b)

2) Subtracting the formula b from the formula a to obtain:

k=(vh-vl)/(xmax-xmin) (formula c)

3) Substituting equation c into a portion of the Q-fixed expression of k (4096V)ref) /(4095 × k) gives:

Figure FDA0002244195480000022

wherein xmaxIs 102, xminIs 15, vhIs 3, vlIs 0, Vref-3;

4) the number of corresponding Q-site bits of (4096 × Vref)/(4095 × k) is 7, and the number of Q-site bits of k is found to be Q-15-7-8 in combination with the Q-site expression of k.

5. The Q fixed point representation method of the umbrella opener' S height sensor according to claim 1, wherein in step S3,

k-0.02813314 calibrated with a height sensor at a temperature of-55 ℃ to bring in QkFormula, resulting in Qk 27292;

b-0.0076477 calibrated with a height sensor at a temperature of-55 ℃ to bring in QbThe formula yields Qb 83.

6. The method for representing the Q fixed point of the height sensor of the umbrella opener according to claim 1, wherein in step S7, the specific formula for calculating Qx is as follows:

Figure FDA0002244195480000023

Technical Field

The invention relates to a Q fixed point representation method of a height sensor of an umbrella opener.

Background

The parachute opening device needs to collect height data in real time, and when the height is smaller than or equal to a preset parachute opening height, a parachute opening instruction is output. Because the parachute opening device adopts the chip TMS320F2812, the parachute opening device only supports fixed-point operation. Although the TI provides a solution, that is, a C language floating point operation library is provided, a floating point operation function is written, a specific operation is completed in the function by a fixed point operation, and the calculation is completed and then stored as a floating point number. Due to the adoption of a function library mode, on one hand, the scheme is slow in operation and is not suitable for the items of the parachute opening device needing to analyze the current height in real time. On the other hand, floating point data processing may be abnormal due to undefined NAN of floating point numbers. Floating point numbers should be avoided for critical, important software.

Disclosure of Invention

The technical problem to be solved by the invention is to provide a Q fixed point representation method of a height sensor of an umbrella opener, aiming at the defects in the prior art, so that the reliability of system operation is improved, and the stability and the reaction efficiency of the umbrella opener are improved.

The technical scheme adopted by the invention for solving the technical problems is as follows:

a Q fixed point representation method for a height sensor of an umbrella opener is disclosed, wherein a voltage value v of the height sensor is kx + b (1), wherein x is a static pressure value of the height sensor, k and b are coefficient values of the height sensor, and a conversion relation between the voltage value v of the height sensor and a voltage AD value N of the height sensor is as followsWherein v is a voltage value of the height sensor, and N is a voltage AD value of the height sensor;

the Q fixed point representation method of the height sensor of the umbrella opener comprises the following steps:

s1, obtaining a Q fixed point digit expression of k according to the formula (1) and the formula (2), and obtaining the Q fixed point digit of k according to the value range of the height sensor and the voltage calibration range of the height sensor;

s2, solving a Q fixed point digit expression of x and a Q fixed point digit expression of b, and determining the Q fixed point digit of x and the Q fixed point digit of b according to experience;

s3, substituting k calibrated by the height sensor at corresponding temperature into Qk in a Q fixed-point digit expression of k;

b calibrated by the height sensor at corresponding temperature is substituted into Qb in a Q fixed point digit expression of b;

s4, acquiring the temperature of the current height sensor, if the acquired current temperature exceeds the temperature boundary value of the height sensor, taking the Qk and Qb values corresponding to the boundary value, and if the acquired current temperature does not exceed the temperature boundary value of the height sensor, obtaining the Qk and Qb values at the current temperature by using linear interpolation;

s5, collecting the current voltage AD value N of the height sensor;

s6, substituting N, Qk and Qb into a formula to calculate Qx, and thus obtaining a current static pressure value corresponding to the height sensor;

and S7, obtaining the current height value according to the current static pressure value of the height sensor.

According to the above technical solution, in step S1, the specific calculation process of performing the Q fixed point digit expression on k is as follows:

substituting equation (2) into equation (1) yields:

Figure BDA0002244195490000021

and writing the formula into a form with x on the left to obtain

Wherein Vref is 3, N is the acquired AD value, and the range of N is 0-4095;

rewrite equation (3) to:

Figure BDA0002244195490000023

the Q fixed point digit number expression on k according to formula (4) is

Figure BDA0002244195490000024

According to the above technical solution, in the step S2, the Q fixed point digit expression of b is

Figure BDA0002244195490000025

Wherein Q is 15;

the Q fixed point digit expression of x is x multiplied by 2QQx, where Q is 8.

According to the above technical solution, in step S1, the determining the Q fixed point digit of k specifically includes the following steps:

1) v. theh、vlRepresenting the maximum and minimum values, x, of the nominal voltage of the height sensormaxAnd xminRepresenting the maximum and minimum values of the sensor measurement, respectively, substituted into equation (1), yields:

vh=kxmax+ b (formula a)

vl=kxmin+ b (formula b)

2) Subtracting the formula b from the formula a to obtain:

k=(vh-vl)/(xmax-xmin) (formula c)

3) Substituting equation c into a portion of the Q-fixed expression of k (4096V)ref) /(4095 × k) gives:

Figure BDA0002244195490000026

wherein xmaxIs 102, xminIs 15, vhIs 3, vlIs 0, Vref-3;

4) the number of corresponding Q-site bits of (4096 × Vref)/(4095 × k) is 7, and the number of Q-site bits of k is found to be Q-15-7-8 in combination with the Q-site expression of k.

According to the above technical solution, in the step S3,

k-0.02813314 calibrated with a height sensor at a temperature of-55 ℃ to bring in QkFormula, resulting in Qk 27292;

b-0.0076477 calibrated with a height sensor at a temperature of-55 ℃ to bring in QbThe formula yields Qb 83.

According to the above technical solution, in the step S7, the specific formula for calculating Qx is as follows:

Figure BDA0002244195490000031

the invention has the following beneficial effects:

the invention designs a Q fixed point representation method aiming at the characteristics of height sensor data of an parachute opening device, the method directly obtains a final static pressure value by adopting Q fixed point operation on an acquired height AD signal, thereby measuring and calculating the corresponding height, having high operation speed and high efficiency, being suitable for projects of the parachute opening device and a controller adopting a fixed point chip, avoiding the possible NAN abnormal condition by adopting floating point number, improving the reliability of system operation and improving the stability and the reaction efficiency of the parachute opening device.

Drawings

FIG. 1 is a flow chart of a Q-point representation of the height sensor of the parachute opener in an embodiment of the present invention;

Detailed Description

The present invention will be described in detail below with reference to the accompanying drawings and examples.

Referring to fig. 1, in an embodiment of the present invention, a Q-fixed point representation method for a height sensor of an umbrella opener is provided, where a voltage value v of the height sensor is kx + b (1), where x is a static pressure value of the height sensor, a corresponding altitude value can be calculated from the static pressure value of the height sensor, k and b are coefficient values of the height sensor, and a transition between the voltage value v of the height sensor and a voltage AD value N of the height sensor is calculatedHas a relation of

Figure BDA0002244195490000032

Wherein v is a voltage value of the height sensor, and N is a voltage AD value of the height sensor;

the Q fixed point representation method of the height sensor of the umbrella opener comprises the following steps:

s1, obtaining Q fixed point digit expression of k according to formula (1) and formula (2)

Figure BDA0002244195490000033

Q and k, obtaining the Q fixed point digit of k as 8 digits according to the value range of the height sensor and the voltage calibration range of the height sensor;

s2, solving a Q fixed point digit expression of x and a Q fixed point digit expression of b, and determining that the Q fixed point digit of x is 8 digits and the Q fixed point digit of b is 15 digits according to experience;

s3, substituting k calibrated by the height sensor at the corresponding temperature into Q fixed-point digit expression of k, where Qk is 256 × 4096 × 3/(4095 × k);

b, substituting b calibrated by the height sensor at a corresponding temperature into a Q fixed-point digit expression of b, wherein Qb is 4095 multiplied by 32768 multiplied by b/(4096 multiplied by 3);

s4, acquiring the temperature of the current height sensor, if the acquired current temperature exceeds the temperature boundary value of the height sensor, taking the Qk and Qb values corresponding to the boundary value, and if the acquired current temperature does not exceed the temperature boundary value of the height sensor, obtaining the Qk and Qb values at the current temperature by using linear interpolation;

s5, collecting the current voltage AD value N of the height sensor;

s6, substituting N, Qk and Qb into a formula to calculate Qx, and thus obtaining a current static pressure value corresponding to the height sensor;

and S7, obtaining the current height value according to the current static pressure value of the height sensor.

Further, in step S1, the specific calculation process of performing the Q fixed point bit table expression on k is as follows:

substituting equation (2) into equation (1) yields:

Figure BDA0002244195490000041

and writing the formula into a form with x on the left to obtain

Figure BDA0002244195490000042

Wherein Vref is 3, N is the acquired AD value, and the range of N is 0-4095;

rewrite equation (3) to:

the Q fixed point digit number expression on k according to formula (4) is

Figure BDA0002244195490000044

Further, in the step S2, the Q fixed point digit of b is expressed as

Figure BDA0002244195490000045

Wherein Q is 15;

the Q fixed point digit expression of x is x multiplied by 2QQx, where Q is 8.

Further, in step S1, the specific process of determining the Q fixed-point number of k includes the following steps:

1) v. theh、vlRepresenting the maximum and minimum values, x, of the nominal voltage of the height sensormaxAnd xminRepresenting the maximum and minimum values of the sensor measurement, respectively, substituted into equation (1), yields:

vh=kxmax+ b (formula a)

vl=kxmin+ b (formula b)

2) Subtracting the formula b from the formula a to obtain:

k=(vh-vl)/(xmax-xmin) (formula c)

3) Substituting equation c into a portion of the Q-fixed expression of k (4096V)ref) /(4095 × k) gives:

Figure BDA0002244195490000051

wherein xmaxIs 102, xminIs 15, vhIs 3, vlIs 0, Vref-3;

4) the number of corresponding Q-bits of (4096 × Vref)/(4095 × k) is 7 bits (i.e., 128 to the power of 7 of 2), and the number of Q-bits fixed for k is found to be Q15-7-8 in conjunction with the Q-fixed expression for k, because data representation is considered to be represented by 16 bits, i.e., 2 bytes, with the sign bit of the highest bit removed, and the remaining data is only 15 bits available.

Further, in said step S3,

k-0.02813314 calibrated with a height sensor at a temperature of-55 ℃ to bring in QkFormula, resulting in Qk 27292;

b-0.0076477 calibrated with a height sensor at a temperature of-55 ℃ to bring in QbThe formula yields Qb 83.

Further, the height sensor temperature [ -55,70 [ -55]Obtaining Q corresponding to temperature points by linear interpolation at intervals of 5 DEG CkAnd Qb

Further, in step S7, the specific formula for calculating Qx is:

Figure BDA0002244195490000052

therefore, Qk and Qb are calculated, N is collected through a hardware AD module, Qx can be calculated through substitution, and then Qx/256 is an actual physical value (static pressure Kpa).

The present invention will be described in further detail below by way of specific embodiments:

(1) v. theh、vlRepresenting the maximum and minimum values, x, of the nominal voltage of the sensormaxAnd xminRepresenting maximum and minimum values of sensor measurements, respectivelyv ═ kx + b, yielding:

vh=kxmax+ b (formula 1)

vl=kxmin+ b (formula 2)

Equation 2 minus equation 1 yields:

k=(vh-vl)/(xmax-xmin) (formula 3)

Substituting equation 3 into (4096 × V)ref) /(4095 × k), yields:

Figure BDA0002244195490000053

since it can be represented by only 7 bits, Q of k is 15 to 7 or 8 (S1);

(2) q of static pressure x is 8, Q of b is 15 (S2);

(3) substituting the formula of Qk with k being 0.02813314 calibrated by the sensor at-55 degrees to obtain Qk being 27292 (S3);

(4) substituting b-0.0076477 calibrated at-55 degrees by the sensor into the Qb formula to obtain Qb-83 (S4), and obtaining Qk and Qb of each temperature point according to the steps (3) and (4) by taking the temperature [ -55,70] as an interval of 5 degrees (S4);

(5) collecting a current temperature value t, wherein t is assumed to be 28 degrees (S5);

(6) and judging whether the temperature exceeds the boundary (S6), if not, calculating the sum Qk and Qb at the temperature by linear interpolation,

Figure BDA0002244195490000061

wherein Qk25、Qb25And Qk30、Qb30Qk, Qb of 25 degrees and 30 degrees, respectively (S8);

(7) collecting a static pressure sensor N value, and assuming that N is 3120 (S9);

(8) by substituting N, Qk and Qb into the Qx calculation formula

Qx=Qk×(8N-Qb)/215=27726×(8×3120-60)/215=21068(S10);

(9) Static pressure Ps=Qx/256=82Kpa(S11)。

A method of Q-pointing representation of a height sensor, comprising: the scheme converts the physical value (floating point number) of the height sensor and the voltage value (floating point number) of the height sensor into a formula v ═ kx + b, and converts the voltage value of the height sensor and the AD value into a formula

Figure BDA0002244195490000062

Q fixed point method formula derivation is carried out in combination;

the Q fixed point value of x is 8, the Q fixed point value of k determines the Q value according to the value range (15 Kpa-102 Kpa) of a height sensor and the voltage range (VL-VH) calibrated by a static pressure sensor, and the Q fixed point value of B is 15;

the data length of the invention adopts 16-bit Q fixed point representation, and takes the most significant bit as a sign bit;

according to the current temperature, linear interpolation is adopted to obtain Qk and Qb;

after Q is determined, the acquired AD value of the sensor is substituted into a calculation formula to obtain the Qx of the final sensor, and the Qx is divided by 256 to obtain the final value of the sensor.

The above is only a preferred embodiment of the present invention, and certainly, the scope of the present invention should not be limited thereby, and therefore, the present invention is not limited by the scope of the claims.

10页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种塔吊基础倾斜报警装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!