Disclosure of Invention
The invention aims to provide a method for estimating the oil consumption of an automobile in real time based on a mobile terminal. Meanwhile, the invention also provides a device for estimating the oil consumption of the automobile in real time based on the mobile terminal.
The purpose of the invention is realized by the following technical scheme: the invention provides a real-time estimation method for automobile oil consumption based on a mobile terminal, wherein the mobile terminal is provided with an acceleration sensor and a gyroscope, and the method comprises the following steps:
step 1, acquiring X-axis data and Y-axis data of an acceleration sensor and X-axis data of a gyroscope, and obtaining vehicle running acceleration with gravity component through the X-axis data of the acceleration sensor;
step 2, obtaining the road gradient theta through the Y-axis data of the acceleration sensoraObtaining road slope θ from X-axis data of a gyroscopet(ii) a Fusing data acquired by an acceleration sensor and a gyroscope by using a Kalman data fusion method to obtain corrected acceleration a and an optimal gradient estimation value theta, and obtaining the real acceleration a of the automobile according to the corrected acceleration acar;
Step 3, the real acceleration a of the automobilecarIntegrating to obtain the running speed V of the automobilecar(T);
And 4, establishing a fuel consumption model to estimate fuel consumption in real time based on the acceleration, the speed and the road gradient.
Further, the method also comprises a step 4 of comparing the running speed V of the automobilecar(T) discretizing.
Further, the method comprises a step 5 of identifying a reference point for correcting the running speed according to the sensor data characteristics, wherein the reference point comprises a static state and a turning state.
Further, the step 4 specifically includes the following substeps:
step 41, obtaining inherent parameters of the vehicle, including a road rolling resistance coefficient f, a mechanical efficiency η of a transmission system and an air resistance coefficient C of the vehicledThe positive windward area A of the vehicle and the delivery mass m of the vehicle;
step 42, estimating the output power Pe of the automobile engine according to the intrinsic parameters of the automobile, the acceleration and the speed of the automobile and the road gradient;
step 43, establishing a fuel consumption model according to the output power Pe of the automobile engine;
and step 44, estimating the fuel consumption of the vehicle in real time by taking the intrinsic parameters of the vehicle, the running acceleration of the vehicle, the speed and the road gradient as the input of the fuel consumption model.
The other purpose of the invention is realized by the following technical scheme: a real-time estimation device for automobile fuel consumption based on a mobile terminal, wherein the mobile terminal is provided with an acceleration sensor and a gyroscope, and the device comprises:
the data acquisition module is used for acquiring X-axis data and Y-axis data of the acceleration sensor and X-axis data of the gyroscope, and acquiring vehicle running acceleration with gravity component through the X-axis data of the acceleration sensor;
a road gradient calculation module for obtaining road gradient theta according to Y-axis data of the acceleration sensoraAnd for deriving road slope θ from gyroscope X-axis datat;
The data fusion module is used for fusing data acquired by the acceleration sensor and the gyroscope by using a Kalman data fusion method to obtain corrected acceleration a and an optimal gradient estimation value theta, and obtaining the real acceleration a of the automobile according to the corrected acceleration acar;
Integral module for true acceleration a of the vehiclecarIntegrating to obtain the running speed V of the automobilecar(T);
And the fuel consumption estimation module is used for establishing a fuel consumption model to estimate the fuel consumption in real time based on the acceleration, the speed and the road gradient.
Furthermore, the device also comprises a discretization module used for measuring the running speed V of the automobilecar(T) discretizing.
Further, the device comprises a correction module for identifying a reference point for correcting the running speed according to the sensor data characteristics, wherein the reference point comprises a static state and a turning state.
The fuel consumption estimation module includes:
vehicle intrinsic parametersThe module is used for acquiring intrinsic parameters of the vehicle, including a road rolling resistance coefficient f, a mechanical efficiency η of a power train and an air resistance coefficient C of the vehicledThe positive windward area A of the vehicle and the delivery mass m of the vehicle;
the output sprinkling rate estimation module is used for estimating the output power Pe of the automobile engine according to the inherent parameters of the vehicle, the acceleration, the speed and the road gradient of the vehicle;
and the oil consumption model establishing module is used for establishing an oil consumption model according to the output power Pe of the automobile engine.
Due to the adoption of the technical scheme, the invention has the following advantages:
the invention realizes real-time estimation of the acceleration and the speed of the automobile based on the mobile terminal. Firstly, by utilizing the characteristics that a gyroscope is not easily influenced by motion acceleration and has high measurement accuracy in a short time, and an acceleration sensor does not have accumulated errors in gravity measurement inclination angles in an inertial state, an optimal gradient estimation value is estimated through an adaptive Kalman data fusion filtering algorithm, and adaptive filtering is carried out on sensor data noise, so that the gravity component of the acceleration is removed, the noise error is reduced, and more accurate vehicle running acceleration is obtained; secondly, the speed of the vehicle is estimated based on the acceleration, and the obtained acceleration, the speed and the road gradient are used as input, and a fuel consumption model is built to estimate the fuel consumption. The estimated parameters can be used for evaluating the green degree of the driving behavior of the driver, so that the driver is helped to develop green driving habits, and the fuel consumption is reduced.
Additional advantages, objects, and features of the invention will be set forth in part in the description which follows and in part will become apparent to those having ordinary skill in the art upon examination of the following or may be learned from practice of the invention. The objectives and other advantages of the invention may be realized and attained by the means of the instrumentalities and combinations particularly pointed out hereinafter.
Detailed Description
The embodiments of the present invention are described below with reference to specific embodiments, and other advantages and effects of the present invention will be easily understood by those skilled in the art from the disclosure of the present specification. The invention is capable of other and different embodiments and of being practiced or of being carried out in various ways, and its several details are capable of modification in various respects, all without departing from the spirit and scope of the present invention.
Please refer to fig. 1 to 4. It should be noted that the drawings provided in the present embodiment are only for illustrating the basic idea of the present invention, and the components related to the present invention are only shown in the drawings rather than drawn according to the number, shape and size of the components in actual implementation, and the type, quantity and proportion of the components in actual implementation may be changed freely, and the layout of the components may be more complicated.
According to the method, the data of the mobile phone sensor is acquired through the data acquisition APP, then the adaptive Kalman data fusion filtering algorithm is used for realizing real-time estimation on the road gradient and adaptive filtering on dynamic noise interference, and on the basis, more accurate automobile driving acceleration, speed and fuel consumption are estimated. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
As shown in fig. 4, the invention provides a mobile terminal-based method for estimating fuel consumption of an automobile in real time, which comprises the following steps:
the mobile phone is fixedly placed in the vehicle, so that a mobile phone coordinate system is consistent with a vehicle coordinate system (when the mobile phone is randomly placed and is inconsistent with the vehicle coordinate system, a coordinate redirection algorithm can be used to enable the mobile phone coordinate to be consistent with the vehicle coordinate system), and data are acquired through mobile phone sensor acquisition software. Specifically, the collected data includes X-axis data and Y-axis data of the acceleration sensor and X-axis data of the gyroscope.
Assuming that the Y-axis of the acceleration sensor is along the vehicle traveling direction (as shown in fig. 2), the vehicle traveling acceleration with the gravity component can be obtained by reading the Y-axis data of the acceleration sensor; the gyroscope X-axis data and the acceleration sensor X-axis data may be used for slope estimation.
Step 2: and constructing an adaptive Kalman data fusion filtering model based on the sensor data to obtain more accurate vehicle running acceleration.
Step 21: obtaining road slope theta from Y-axis data of acceleration sensoraObtaining road slope θ from X-axis data of a gyroscopetAnd then carrying out data fusion in a filter, and carrying out self-adaptive filtering on the dynamic noise interference so as to obtain an optimal road slope estimated value theta and an acceleration value a after filtering correction.
Specifically, when the automobile is in a constant speed driving state, the motion acceleration is 0. At this time, the road gradient can be accurately estimated by using the relationship between the trigonometric functions according to the components of the gravitational acceleration on the three axes. However, when the vehicle is in a variable speed driving state, the value measured by the acceleration sensor is the vector sum of the gravitational acceleration and the motional acceleration, resulting in a deviation in the road gradient estimated by the acceleration sensor. The road grade value can be obtained by performing time integration on the angular velocity measured by the X axis of the gyroscope sensor, and the road grade value is not influenced by the motion acceleration, but the accumulated error of the gyroscope sensor can influence the accuracy of grade estimation.
Therefore, the optimal road slope estimation value can be obtained by fusing the data of the gyroscope and the acceleration sensor by utilizing the characteristics that the gyroscope is not easily influenced by the motion acceleration and has high measurement accuracy in a short time and the acceleration sensor does not have accumulated errors in gravity measurement of the inclination angle in the inertial state.
The method carries out data fusion based on the simplified Sage-Husa Kalman adaptive filter, the sensor measurement noise covariance R can be obtained through experimental statistics, and the dynamic process noise of the system is difficult to determine, so that the adaptive estimation updating is carried out on the process noise covariance Q.
The expression formula described by the state equation and the observation equation of the conventional linear discrete Kalman filtering is
Wherein, x (k) is a state variable, y (k) is a system output, a is a state transition matrix, H is a measurement matrix, and w (k) and v (k) are process noise and measurement noise, respectively.
Measuring angle theta with a gyroscopetAcceleration sensor Y-axis data ayObtaining road gradient theta from Y-axis data of acceleration sensoraAnd the angular change Δ θ measured by the gyroscope within Δ ttFor the state vector of the system, the corresponding state equation and observation equation can be obtained:
wherein, thetaa=-arcsin(ay/g);θt=θt0+Δθt,θt0At an initial angle, Δ θtCan be obtained by integrating gyroscope X-axis data; w is aa(k) Is the process noise of the acceleration sensor, and has a covariance of qa(k);wt(k) Is the process noise of the gyroscope with covariance qt(k) (ii) a v (k) is measurement noise of fused data of the acceleration sensor and the gyroscope, and the covariance is r (k); v. ofa(k) Is the measurement noise of the acceleration sensor, and has a covariance of ra。
Y (k) is a system observation value, and a gyroscope measurement angle and an acceleration sensor measurement angle are added and synthesized according to weights 1-c (k) and c (k); and the other is the actual measurement value of the Y axis of the acceleration sensor.
Let us denote the motion by Δ aThe influence of dynamic acceleration on gradient estimation through the acceleration sensor is estimated by using the relative deviation of a triaxial composite vector modulus | a | and a gravity acceleration g constant measured by the acceleration sensor, a | -a-g |/g is defined, and then the measured gradient value theta of the acceleration sensor is dynamically adjusted according to the Δ aaAnd c, weight value in data fusion.
When Δ a is large, θaThe smaller the weight c of, and thetatThe greater the weight 1-c is, the greater the trust of Kalman filtering on the measurement value of the gyroscope sensor, so as to reduce the error of the slope estimation value measured by the acceleration sensor when the automobile is in a variable speed state; when Δ a is small, θaThe greater the weight c of, and thetatThe smaller the weight 1-c is, the greater the trust of the Kalman filtering on the measurement value of the acceleration sensor, so as to reduce the accumulated error of the gyro sensor in measuring the road gradient. By continuously adjusting thetaaAnd thetatThe weight value of (c) is as follows:
and predicting the current time state by using the previous time state as follows:
in the formula:
is the optimal estimated value of the last moment;
and further predicting the measured value at the current moment by using the current state predicted value as follows:
in the formula:
the state prediction value at the current moment is obtained;
the prediction error between the predicted measurement and the actual measurement is:
in the formula: y (k) is an actual measurement value;
the covariance P (k | k-1) and the system gain Kg (k) are then updated:
P(k|k-1)=AP(k-1|k-1)AT+Q(k-1) (7)
Kg(k)=P(k|k-1)HT(k)[H(k)P(k|k-1)HT(k)+R(k)]-1(8)
in the formula: r (k) is a measurement noise covariance matrix at the current moment, and Q (k-1) is a process noise covariance matrix at the previous moment.
R (k) does not carry out real-time estimation updating per se, but due to dynamic adjustment of the weight values (c 1-c (k)), the measurement noise of the fusion data of the acceleration sensor and the gyroscope is a non-stationary random process, and r (k) has time-varying property. When c is not equal to 0, the acceleration sensor has an influence factor on the slope estimation, the measurement noise of the gyroscope is effectively suppressed by the acceleration sensor, and the system measurement noise is considered to be the measurement noise of the acceleration sensor only; when c is equal to 0, the influence factor of the acceleration sensor on the slope estimation is zero, the accumulated error of the gyroscope is not effectively suppressed, and as the accumulated number of times increases, the accumulated noise of the gyroscope increases, r (k) also increases gradually, which can be specifically expressed as:
in the formula: r isaIs the measurement noise covariance of the acceleration sensor; Δ r is the measurement noise covariance increment accumulated once by the gyroscope.
Q (k) can be estimated by:
Q(k)=(1-d(k))Q(k-1)+d(k)[Kg(k)e(k)e(k)T+AP(k|k)AT](11)
in the formula:
d(k)=(1-b)/(1-bk+1) (12)
b is a forgetting factor, and the value is usually between 0.95 and 0.99;
according to the calculation results of the expressions (2) to (12), the state variable and the covariance matrix of the system are updated according to the expression (13), the posterior estimation is repeated, and the Kalman gain is rapidly converged repeatedly, so that the optimal estimation value X (k | k) of the acceleration sensor and the gyroscope sensor is found.
The acceleration after the correction of the adaptive Kalman filtering is a ═ ay(k | k); the optimal slope estimate is:
θ=(1-c(k))θt(k|k)+c(k)θa(k | k). The initialization parameters of the adaptive kalman filter are shown in table 1:
TABLE 1 initialization parameters for adaptive Kalman Filter
Step 22: and solving the gravity component on the Y axis according to the road gradient, and removing the gravity component from the filtered acceleration to obtain the real acceleration of the automobile.
As shown in figure 3, the road grade value can be selected fromCalculating the component g of gravity on the Y axisy:
gy=gsinθ (11)
Thereby removing the gravity influence of the acceleration and obtaining the real acceleration a of the automobilecar:
acar=a+gy(12)
And step 3: the vehicle speed is estimated based on the acceleration, and the speed is corrected at the reference point.
Step 31: and obtaining the running speed of the automobile by integrating the acceleration.
The real acceleration a of the automobile is obtained through the step 2carThen, the driving speed of the automobile can be obtained by calculating the integral of the acceleration along with the time:
wherein, Vcar(T) is the vehicle speed at time T; vcar(0) For the initial speed, the vehicle starts to run from a standstill, so Vcar(0) Is 0; a iscar(t) is a function of the acceleration of the vehicle at each instant t.
Since the acceleration of the automobile is acquired by a specific sampling rate, a can be obtainedcar(t) discretization, the vehicle speed calculation formula can be converted into:
wherein: k is the sampling rate of the acceleration sensor, acar(i) The value is the ith vehicle running acceleration value obtained according to the sampling value.
Step 32: and identifying reference points (stopping and turning) according to the data characteristics of the sensor, further correcting the speed and improving the estimation precision.
When the automobile is in a stop state, the speed is 0; the speed during turning can be obtained by calculating data of the gyroscope and the acceleration sensor, the speed is corrected at the reference points (the speed is corrected to be 0 in a stop state, the speed is calculated based on the data of the gyroscope and the acceleration sensor in a turning state, and then the speed obtained by integration is corrected to be recalculated), so that accumulated errors are eliminated, and the estimation precision is further improved.
①, because the Z-axis data characteristics of the acceleration sensor have large difference in the stopping and running states of the vehicle, a 1s sliding window can be set, the amplitude mean value and the amplitude standard deviation of the Z-axis data of the acceleration sensor are calculated as the data characteristics, and the threshold value is determined based on the statistical information, so as to determine whether the vehicle is in the stopping state.
②, as shown in FIG. 4, when the car turns, the running route is close to a circular arc, the car will be subject to a centripetal force, which is related to its speed, angular velocity and turning radius, the centripetal acceleration of the car can be obtained from the X-axis data of the acceleration sensor, and the angular velocity of the car can be obtained from the Z-axis data of the gyroscope, therefore, the speed of the car can be calculated according to the following formula (15).
Wherein: a isxIs the centripetal acceleration of the vehicle; w is azIs the angular velocity of the vehicle;
and 4, step 4: and establishing a fuel consumption model based on the acceleration and the speed and considering the influence of the gradient.
Step 41, acquiring corresponding vehicle intrinsic parameters (road rolling resistance coefficient f, drive train mechanical efficiency η and vehicle air resistance coefficient C) according to the automobile modeldA positive windward area A of the vehicle and a delivery mass m of the vehicle);
step 42: and (3) estimating the output power Pe of the automobile engine according to the intrinsic parameters of the automobile and by combining the acceleration, the speed and the road gradient of the automobile obtained in the steps 2 and 3:
the vehicle dynamics model is:
Ft=Ff+Fi+Faero+Fj(16)
in the formula, FtIs the driving force of the vehicle;
rolling resistance FfCan be expressed as:
Ft=mgf (16)
wherein g represents the gravitational acceleration.
Slope resistance FiCan be expressed as:
Fi=mgθ (16)
air resistance FaeroCan be expressed as:
wherein, CdExpressed as the coefficient of air resistance of the vehicle, A is expressed as the frontal area of the vehicle, VcarThe vehicle running speed; ρ is the air density, and is generally 1.2258N · s2·m-4。
Acceleration resistance FjCan be expressed as:
Fj=δmacar(16)
wherein, acarRepresents the acceleration, and delta represents the conversion coefficient of the rotating mass of the automobile.
The engine output power Pe can be expressed as:
wherein η is the vehicle driveline mechanical efficiency.
Based on the above formula, the complete form of calculating the engine output power Pe can be derived:
step 43: establishing an oil consumption model based on engine power by using a least square method;
the complexity and the accuracy of the model are comprehensively considered, and a quadratic PB fuel consumption model is adopted:
Fc=α1+α2Pe+α3Pe2(17)
wherein: and Fc is the oil consumption of the vehicle.
Specifically, the vehicle oil consumption can be synchronously acquired through equipment such as OpenXC (open capacitive center) equipment for model building, and then the model parameters α are estimated by using a least square method1、α2And α3. After the model is built, the inherent parameters of the vehicle, the running acceleration, the speed and the road gradient of the vehicle can be used as input, and the fuel consumption of the vehicle can be estimated in real time.
The invention also provides a device for estimating the fuel consumption of the automobile in real time based on the mobile terminal, wherein the mobile terminal is provided with an acceleration sensor and a gyroscope, and the device comprises:
the data acquisition module is used for acquiring X-axis data and Y-axis data of the acceleration sensor and X-axis data of the gyroscope, and acquiring vehicle running acceleration with gravity component through the X-axis data of the acceleration sensor;
a road gradient calculation module for obtaining road gradient theta according to Y-axis data of the acceleration sensoraAnd for deriving road slope θ from gyroscope X-axis datat;
The data fusion module is used for fusing data acquired by the acceleration sensor and the gyroscope by using a Kalman data fusion method to obtain corrected acceleration a and an optimal gradient estimation value theta, and obtaining the real acceleration a of the automobile according to the corrected acceleration acar;
Integral module for true acceleration a of the vehiclecarIntegrating to obtain the running speed V of the automobilecar(T)。
And the fuel consumption estimation module is used for establishing a fuel consumption model to estimate the fuel consumption in real time based on the acceleration, the speed and the road gradient.
In this embodiment, the apparatus further includes a discretization module for determining the driving speed V of the vehiclecar(T) discretizing.
In this embodiment, the apparatus further comprises a correction module for correcting the driving speed based on the sensor data characteristics and identifying a reference point, which includes a stationary point and a turning point.
In the embodiment, the fuel consumption estimation module comprises a vehicle intrinsic parameter acquisition module for acquiring intrinsic parameters of the vehicle, including a road rolling resistance coefficient f, a power train mechanical efficiency η and a vehicle air resistance coefficient CdThe positive windward area A of the vehicle and the delivery mass m of the vehicle; the output sprinkling rate estimation module is used for estimating the output power Pe of the automobile engine according to the inherent parameters of the vehicle, the acceleration, the speed and the road gradient of the vehicle; and the oil consumption model establishing module is used for establishing an oil consumption model according to the output power Pe of the automobile engine.
In the embodiment of the present invention, the functions of the data acquisition module, the road gradient calculation module, the data fusion module, the integration module, the discretization module, the correction module, and the fuel consumption estimation module can be implemented by the foregoing method, and the implementation is not repeated here.
Finally, the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions, and all of them should be covered in the protection scope of the present invention.