Modeling and Simulation of GPS Positioning and Iterative Vehicle Motion Using Kalman Filter in Vehicle Tracking System

: This research is about modelling and simulation of the RFID based Transport Highway Integrated System (THIS) using the iterative motion of the vehicle plying the highway and the application of Kalman filter to aid in effective positioning after signal transmit. This approach will help to identify drivers, vehicles and track location appropriately. The design when able to be implemented with the use of Kalman filter to filter out the noise there will be much accuracy in the vehicle position prediction on the high-way. According to the graphs obtained through Kalman algorithm it was realized that: The noise level was appreciative as compared with the actual signal from the vehicle. If the vehicle model is created based on true situation our estimated state will be close to the true value. Even when measurements are very noisy that is a 20% error will only produce a 5% inaccuracy. The position prediction of a vehicle on the high-way is better as the Gaussian white noise is eliminated, tracking to know the exact location via GPS coordinate will reduce the error margin. If you have a badly deﬁned model, you will not get a good estimate. But you can relax your model by increasing your estimated error. This will let the Kalman ﬁlter rely more on the measurement values


Introduction
In countries all over the world, the need for road safety to meet the growing demand of business men and women travelling on the high-ways. This has become a subject of worry for both the State Transport Cooperation (STC) and the Ghana Private Road Transport Union cooperation (GPRTUC) in Ghana. Facilitating effective security on the high-way for such people plying the high-way should be promoted by designing automations to aid in reducing incidences and eliminate unnecessary pressures placed on persons using the high-ways. This incidence could be in the form of robbery, accident, or mechanical fault on vehicles.
However Mamudu (2015) proposed a form of high-way transport reporting automations to the transport operator to enable their vehicle ply the high-way with less stress in cases on incidence.
However in other to report incidence happening on the high-way from vehicle the system proposed should be able to send a precise or close approximation of GPS coordinates to aid effective response. The vehicle information can be viewed on electronic maps via the Internet or specialized software [5].
This research is about modelling and simulation of the RFID based THIS using the iterative motion of the vehicle plying the highway and the application of Kalman filter to aid in effective positioning after signal transmit. RFID can be supplied as read only or read/write, does not require contact or line of sight to operate, can function under a variety of environmental conditions, and provides a high level of data integrity [8]. This approach will help to identify drivers, vehicles and track location appropriately.
This wills the following objectives: 1) To design and achieve a filter model for accurate position on high-way 2) To locate and track the current geographic position of Motion Using Kalman Filter in Vehicle Tracking System the vehicle before on high-way robbery 3) To determine effect of noise on vehicle model

Working Operation
When people talk about "a GPS," they usually mean a GPS receiver. The Global Positioning System (GPS) is actually a constellation of 27 Earth-orbiting satellites (24 in operation and three extras in case one fails) [4] [10]. The U.S. military developed and implemented this satellite network as a military navigation system, but soon opened it up to everybody else.
Each of these 3,000-to 4,000-pound solar-powered satellites circles the globe at about 12,000 miles (19,300 km), making two complete rotations every day. The orbits are arranged so that at anytime, anywhere on Earth, there are at least four satellites "visible" in the sky.
A GPS receiver's job is to locate four or more of these satellites, figure out the distance to each, and use this information to deduce its own location. This operation is based on a simple mathematical principle called trilateration. GPS receiver calculates its position on earth based on the information it receives from four located satellites [11]. This system works pretty well, but inaccuracies do pop up. For one thing, this method assumes the radio signals will make their way through the atmosphere at a consistent speed (the speed of light). In fact, the Earth's atmosphere slows the electromagnetic energy down somewhat, particularly as it goes through the ionosphere and troposphere. The delay varies depending on where you are on Earth, which means it's difficult to accurately factor this into the distance calculations. Problems can also occur when radio signals bounce off large objects, such as skyscrapers, giving a receiver the impression that a satellite is farther away than it actually is. On top of all that, satellites sometimes just send out bad almanac data, misreporting their own position [12] [13].
The GPS based Vehicle Tracking System uses GPS and GSM technologies for localization and positioning of the vehicle. It sends the data string of following information through GPRS / to the designated IP address of the server at control station [6] [7] [9]. 1) Latitude 2) Longitude 3) Vehicle ID 4) Speed of the vehicle 5) Distance travelled 6) Direction of the vehicle 7) Date and Time

Accuracy in GPS Coordinates
According to Montaser et al (2012), the coordinates from the GPS receiver is achieved through the Kalman filter. The Kalman filter removes noise by assuming a pre-defined model of a system [15]. Therefore, the Kalman filter model must be meaningful in the determination of accurate vehicle position. This filter models the satellite geometry, orbital shifts of satellites, clock errors of the satellite clocks, the tropospheric and the ionospheric effects and error calculations [14].

Methodology
The approach will use the KALMAN algorithm and the simulation approach to provide accuracy in the GPS data received. This research represents the general architecture, RFID, GPS and the system response with diagrams. The use of block, sequence and flow charts gives the design idea of its operation. On the other hand, the GPS data uses Kalman filter algorithm simulate how this RFID base vehicle system will provide accurate location of a vehicle.

Using Kalman Filter to Correct Vehicle GPS Position
The use Kalman Filter embedded on in-the-vehicle unit uses the vehicle system's dynamics model. This is the laws of physical motion. A known control inputs of in-the-vehicle system, and measurements such as the GPS, RFID to form an estimate of the vehicle's varying quantities. This state is better than the estimate obtained by using any one measurement alone especially the GPS receiver on the in-thevehicle unit.

The Operation of the Kalman Filter
This filter helps to correct factors influencing the accurate position of the vehicle plying the high-way. It is found on the in-the-vehicle unit of the vehicle. It include satellites, geometry from the GPS, shifting of satellites in space orbits, the ionospheric and the tropospheric effects and error calculation. The filter's main purpose is to reduce errors from the GPS to help increase the accuracy in the localization of the vehicle position. To provide effective coordinates from the high-way at real time, this Kalman filter is introduced on the in-the-vehicle unit as shown in the diagram below:

Determination of the Estimation Mechanism
This consists of the modeling of different parameters with respect to the vehicle variable by the laws of physical motion.

Building the Vehicle Model
In building the model, all various variable parameters should be known about the vehicle. This will also include the prior idea about the control input is required. In this research model, there is the need to know the position of the vehicle on the high-way in order to allow the appropriate response. This best input control will be acceleration and also a parameter of velocity which is always varying. This is because acceleration if a function of velocity and time.
From the equation (3.1), * * ; , is declared as a linear combination of velocity and the prior state position and the input control which is the acceleration of the vehicle on the high-way. There is also a process noise ( ) which plays a significant role in the state estimation and is considered as Gaussian. For a complete system modeling, the matrices A, B, H and the process noise has to be known. These are computed in the scenario of a vehicular movement. The main objective is to operate in the 2-D position for the vehicle but it will depend on the evaluation of 1-D as well. State variable needed in the model are velocity and position.

Iterations in Using the Kalman Filter in Vehicle
Position Correction The overall system gives a successive feedback process signal, to help to estimate and pass a correction stage where the Kalman gain is computed and then proceeded to be used to correctly estimate the position of the vehicle on the highway via GPS coordinates.  [2]. Motion Using Kalman Filter in Vehicle Tracking System

Model Process Definition
The Kalman filter removes noise by assuming a predefined model of a system [3].
In fig 3.12 below shows the model building algorithm of Kalman filter. Therefore, the Kalman filter model must be meaningful. It should be defined as follows: 1) Understand the situation: Look at the problem. Break it down to the mathematical basics. If you don't do this, you may end up doing unneeded work. 2) Model the state process: Start with a basic model. It may not work effectively at first, but this can be refined later. 3) Model the measurement process: Analyze how you are going to measure the process. The measurement space may not be in the same space as the state (e.g., using an electrical diode to measure weight, an electrical reading does not easily translate to a weight). 4) Model the noise: This needs to be done for both the state and measurement process. The base Kalman filter assumes Gaussian (white) noise, so make the variance and covariance (error) meaningful (i.e., make sure that the error you model is suitable for the situation). 5) Test the filter: Often overlooked, use synthetic data if necessary (e.g., if the process is not safe to test on a live environment). See if the filter is behaving as it should. 6) Refine filter: Try to change the noise parameters (filter), as this is the easiest to change. If necessary go back further, you may need to rethink the situation. Coordinates from the GPS receiver and the Kalman filter This was done with the use of generated GPS coordinates. The filter helps to reduce the GPS errors and increases the accuracy of the coordinates by close proximity in order to know the exact location of the vehicle.

Designing the Filter for the GPS Coordinates
To achieve the objective of the Transport Integrated Highway Security system (THIS), the coordinates from the GPS has to be able to identify accurate position of incident. Therefore Kalman filter is introduce into the vehicle unit to enable filtration of the system noise. This will help the vehicle unit to send accurate locations. To achieve this, different iterations are performed to give the best means of using Kalman filter. Various parameters are varied to suit the vehicle system. When the Kalman filter is connected to the output of the vehicle unit system it should be able to transmit information depending on: 1) The kind of incident from the driver' tag as described in chapter three of this study 2) The location of the vehicle at any given time from the highway. The location of the vehicle is sent through GPS coordinates Therefore for effective design, the filter is modeled too suit different vehicular system dynamics on the highway. This system design is modeled according to three main real-time dynamics of the vehicle plying the highway. These include: 3) The vehicle moving at constant speed with varying time 4) Vehicle moving uniformly 5) Vehicle moving at continuous speed rate These are done with the help of the time update and measurement correction cyclical iterations of the Kalman filter algorithm.

Building the Vehicle Model
In the methodology algorithm were provided to aid in the vehicle model building. The following are the process and the results obtained:

Understanding the Situation
This study considers a simple situation showing a way to measure the speed level of a vehicle on the high-way. This is shown in the figure In trying to estimate the unknown speed of vehicle on the road, the measurements obtained are from the vehicle by the "pedometer". This is an electronic device that measures the number of steps taken and thus estimate the distance of the vehicle. The vehicle could be: 1) Stationary (i.e., the average speed of the vehicle is decreasing or not changing). 2) Moving (i.e., the relative speed of the vehicle is changing over time,).

Model the State Process
This is to outline several ways to model this simple situation, showing the power of a good Kalman filter model. The first is the most basic model, the vehicle is speed (i.e., the true speed is constant L = c).
Using the equations below, Predict: Update: The state variable can be reduced to a scalar (i.e.; x x where x is the estimate of L). Assuming that the system is a constant model, therefore x 4 x so A 0 and F 1, for any t ≥ 0. the control variables B and u are neglected(i. e. both are zero) Model the measurement process In this model, we have the speed of the vehicle. This is represented by y = A B .
The value we are measuring could be a scaled measurement (e.g., a 1 m/s measurement on a pedometer could actually be about 10 m/s in the "true" level of the vehicles' speed). For simplicity, it is assumed that the measurement is the exact same scale as our state estimate C (D. E. , = 1).
Model the noise For this model, we are going to assume that there is noise from the measurement (i. e. , R = r). The process is a scalar, therefore P = p. And as the process is not well defined, we will adjust the noise (i. e. , Q = q). We will now demonstrate the effects of changing these noise parameters.

Test the Filter
You can now see that you can simplify the equations from fundamental predict and update. They simplify as follows: Predict: Update: The filter is now completely defined. Let's put some numbers into this model. For the first test, we assume the true level of the tank is L = 1. We initialize the state with an arbitrary number, with an extremely high variance as it is completely unknown: x = 0 and p = 1000. If you initialize with a more meaningful variable, you will get faster convergence. The system noise we will choose will be q = 0.0001, as we think it is an accurate model. Let's start this process. Predict: x |G = 0 p |G = 1000 + 0.0001 = 1000.0001 The hypothetical measurement we get is y = 0.9 (due to noise). We assume a measurement noise or r = 0.1.
Update: So you can see that Step 1, the initialization of 0, has been brought close to the true value of the system. Also, the variance (error) has been brought down to a reasonable value.
To brained more iterations, more steps are calculated. The next step will use the previous calculated values: Predict: x L| = 0.8999 p L| = 0.1000 + 0.0001 = 0.1001 The hypothetical measurement we get is y L 0.8 due to noise#. Update: In table 1, it represent the iterations of prediction and correction design data of Kalman gain is computed and then further use to correctly estimate the vehicle position on the highway. The measurement of the vehicle unit is represented by y as the actual output. The true value needed to be obtained is the vehicle moving at a constant speed (i.e. L=1m/s). To be able to achieve the accurate results, the modeling of the vehicle is very important. The accuracy of the position is by the use of Kalman filter.
The filter compares the input speed in time update prediction and measure the output of the vehicles' unit to estimate approximations of measurement update correction. The Filter approximates by filtering the noise of the GPS receiver's coordinates output. This is to help transmit accurate position of the vehicle on the highway. The prediction of the Kalman filter has to be able to predict the vehicle almost as the true value at which the vehicle is located after an incident signal by the driver. In designing the filter, a lot of iterations were ran to help achieve a better design with less error data transmission.
According to the iterations ran in table1; at time (t=1), the filter is said to have achieved high gain and the estimated state of 0.899 with a state variance of 0.1. This shows that the percentage error at this level by using the Kalman filter is 10% inaccuracy compare with the true value of L=1. At time (t=2) there is 15% inaccuracy. This shows much noise than the initial estimated value of C B|B 0.8999 . The Kalman filter continuous iteration in figure 6with time becomes highly appreciative to the true value. At the end of the 10 th iteration, the state estimated value by the Kalman filter is almost as the true value with 0.95% inaccuracy level.
It is seen from table 1 the value obtained clearly details that the model successfully works. After stabilization about t=4 the estimated state is within 0.05 of the true value, even though the measurements are between 0.8 and 1.2 (i.e., within 0.2 of the true value). The graph in figure 6 shows clear graphical representation of table1state estimation by the Kalman filter. Over iterative period of time the graph below was established: The graph in figure 6 shows the levels of positioning of the true value of a moving vehicle at constant speed of V 1W/Y . the vehicle unit reporting an incident from the highway has gotten a measured value of y which were taken at ten different time intervals. The figure 6 above shows that the measured values by the vehicle sending position coordinates has deviated from the true value supposed to be the actual data to transmit. Therefore, any action which is supposed to be taken by any response team will end up with a wrong localization. This will make the reported incident by the driver fruitless. In this view, a Kalman filter algorithm is used in this design to correct the accurate position transmission by the vehicle unit. This filter in figure 6 shows that is it able to filter and reduce the error level from the actual measured valued to a closest level of the true value of 1W/Y.
The establishment from the above graph shows that, if a new model is created based on true situation, our estimated state will be close to the true value. Even when measurements are very noisy that is a 20% error will only produce a 5% inaccuracy. This is the main purpose of designing this Transport Integrated security system (THIS) with the Kalman filter.

The Assumption of a Varying True Value
By using the same model i.e. static model and assuming that the vehicle is moving at a uniform rate: It is assumed that the speed of the vehicle is moving at the rate of f 0.1 per time frame. The initialization is started with L G 0. Then the measurement and process noise remains the same as: q 0.001 and r 0.1.
The iterations obtained are in the table 2.  We can now see clearly from table 2 that over time the estimated state stabilizes (i.e., the variance gets very low). At t=1 the variance was 0.1 but on getting to t=10 it reduces to 0.0103 while the estimated state improves by 35% as against at time (t=1) when the state estimated value of is of a negative percentage (-1%).
This can be easily seen on the graph in figure 7. The estimated stated value even though it was appreciating against the true value but the inaccuracy margin is very high. This will make it difficult to provide an accurate vehicle position. In figure 7, the estimated state is trailing behind the true speed. Thus is not desirable for the Kalman filter for this system. This is because the filter has to remove noise not to give an inaccurate reading. In this case the estimate has much error unexpectedly (compared to the true speed) than the noise from the measurement process.

Design Consideration to Fix the Error in the Process
Noise of 0.001 The cause of this Kalman filter error in figure 7 may be as result of two main contributions: 1) The chosen model dynamics 2) Reliability of the process model which is the chosen q value The simplest way to begin is to change the system parameters especially the q# value . The reason for the assumed q# value 0.001# was that the model chosen was thought to be of a good estimation of the true process.
However in this case the model was not a good estimator. In this vehicle dynamics we have to assume that the error margin is greater with the model process, and set it to q 0.01. When this is done the graph below was generated: The purpose of increasing the error is beneficial in figure  8. However the estimated state has still gotten some error and the inaccuracy is 10% of the true value at time ' 10YEZY# than the actual noise. To achieve a much better estimation, the model process is set again to 0.1 and the graph in figure 9 below is obtained shows a very much improved filtering: The increase variation of the model process noise is making the estimated state becomes closer to the true value. The error is less than the measurement noise. The next trial is to increase the q to 1 and the graph in figure 10 below is produced: Figure 10. Uniform varying rate model of the vehicle using q=1. Motion Using Kalman Filter in Vehicle Tracking System The graph above shows almost no difference to the measured value. There is a minor noise removal, but not much. Looking at the graph there is almost no point in having the filter. This shows that the modeling of the vehicle system needs much accuracy else the designed filter will be a waste. This research shows how important is it to run more iterations and create a reasonable system model. If the vehicle unit has to provide accurate position from the highway there has to be effective vitiation of the systems parameters.
If the process noise is varied at critical levels, there is also a possibility that the estimated state can predict an accurate coordinates for better position localization. In figure 7, figure 8, figure 9 and figure 10 shows the importance of varying the process noise (q) to keep this research design for an estimated state for accurate positioning.

Using the Kalman Filter to Simulate the Continuous Vitiation of the System
For continuous process the state transitions changes and its parameters. It parameter is derived from the velocity of 1-D vehicular movement.
The vehicle position and velocity in 1-D movement: A and B are the matrices that can be easily calculated by the laws of linear physical motion equations. By equation (1) the state estimation of the position and the velocity of the vehicle is: is the position in the horizontal axis (x-axis) and V e is the vertical axis (y-axis) which is the velocity of the vehicle in motion. Therefore the position and the velocity are given by the equations of linear motion below to aid in the calculating the values of A and B: Considering equations (10) and (11) are the relation that provides the results for A and B matrices. Also, the measurement prediction matrix H to be used is The matrix H gives the position measurement and no the velocity hence V e = 0.
The w i , which is the error processing parameter in (1) is given by the covariance of the position and velocity of the vehicle as: In determining w i , the covariance of the vehicle is taken from the time consideration of the variation parts of equations (3) and (4) which is a relation of the position and velocity of the vehicle at any particular time on the high-way and is given as:

The Process of Prediction and Correction
This is a cyclical conversion process of the prediction and correction for the location of the vehicle which is shown in figure 11. To obtain the accurate position on the high-way there has to be two main update in order to report real time incidence, these two main updates are: 1) Time and 2) Measurement

The Time Update of the Vehicle
This update analysis dependent on the time of vehicle, this will predict the position and the covariance which will be further be used in measuring stage. The equation below will help in the prediction of the covariance: u = v taken and supposed as the process noise.

The Measure Update of the Vehicle
To obtain the measurements is by the GPS receiver on the in-the-vehicle unit of the vehicle plying the high-way and is represented as . By considering the in equation (5), it has the noise measurement ( b ), hence the Kalman gain factor (w ) is used to achieve the minimum error position state estimation as: And the w = * t * ( * * t + x

Simulations of the Kalman Filter as Position Estimate Corrector Using MATLAB
Assuming that the system is in discrete form the simulation process is broken down into the following forms: 1) The in-the-vehicle unit description by the state equations as: Form the 1-D vehicle mechanism the values of A, B, and H are known by their labels M7, M8 and M6 respectively. They are declaring in the MATLAB command form. In the Appendix A and D the noise measure with initial input as zero (0). The Kalman filter has estimate the output y depending on the noisy measurements: 2) It has the minimum stead state gain M based on the processed noise covariance (Q) and the GPS sensor noise covariance (R). There is a specified vehicle model and the noise model but the sample time is set to -1 by assuming the vehicle is discrete process. This is of the expression: ƒf}W" = ƒf}W"(1, : )

Comparing the Filter Work to the Actual Vehicle Position
This comparison is done by generating some data and comparing the filter response with the actual response of the vehicle as shown in figure 12. 1) The resulting simulation model has w, v, u as its inputs and the yv and y_e as outputs: 1) SimModel. inputname: 'w', 'v', 'u' 2) SimModel. outputname: 'y', 'y_e' 2) Generate process noise and sensor noise vectors: 1) rng(10,'twister'); 2) w = sqrt(Q)*randn(length(t),1); 3) v = sqrt(R)*randn(length(t),1); 3) Finally the filter is ready to be simulated by generating a sinusoidal signal to know its behavior. This done by using LSIM: 1) out = lsim(SimModel,[w,v,u]); 2) the true response: y = out(:,1) 3) the filtered response: ye = out(:,2) 4) the measured response: yv = y + v 4) The diagram in figure 13 below shows the comparison of the filter response and actual vehicle response signal obtained. It is noticed that, the filter quickly adopts to the actual position (true value) of the vehicle. In this system, the Kalman filter was not told about any actual position of the vehicle but it was able to figure it out all by itself. Even with an unsure beginning the filter is able to reduce the covariance to its barely minimum. Therefore for a continuous varying speed of the vehicle on the highway the Kalman filter is able to show the exact If we observe in the Kalman filter response in figure 13, the green lone is the actual position (true value) of the vehicle and the red line is the average Kalman filter estimation and it is able to rightly predict the position of the vehicle sudden variations to near zero error. Comparing this to the actual signal of the vehicle output on position prediction, it can be observed that without the Kalman filter and the red line as the position tracking it can be concluded that the prediction of the position is to properly done. The error graph also shows that where velocity is varied suddenly, the error measurement is extremely high.
In this comparative analysis, the covariance error before filter is the measurement error which is: MeasErrCov = 2.2703 and the covariance error after filtering is EstErrCov = 1.1374.

Conclusion
There are two things that should be notice about the Kalman filter when use in the continuous time variation with a varying speed: 1) The model is smoother than the noisy measurement, but there is a lag behind the actual value. This is common when filtering a system that is not modelled correctly.
2) The amplitude of the filter is getting smaller and smaller. This is because the model is slowly converging to what it thinks is the truth... a constant level, which is accurate over time. If you wanted to model the sloshing properly, you would need to use an extended Kalman Filter, which also takes into consideration the non-linearity of the system.
The design when able to be implemented with the use of Kalman filter to filter the out the noise there will be much accuracy in the vehicle position prediction on the high-way. According to the graphs obtained through Kalman algorithm it was realized that: 1) The noise level was appreciative as compared with the actual signal from the vehicle in figure 13. If the vehicle model is created based on true situation, our estimated state will be close to the true value. Even when measurements are very noisy that is a 20% error will only produce a 5% inaccuracy. 2) The position prediction of a vehicle on the high-way is better as the Gaussian white noise is eliminated, tracking to know the exact location via GPS coordinate will reduce the error margin. This is known from the graphs in the previous chapter. 3) If you have a badly defined model, you will not get a good estimate. But you can relax your model by increasing your estimated error. This will let the Kalman filter rely more on the measurement values, but still allow some noise removal.