HUNGARIAN JOURNAL OF INDUSTRY AND CHEMISTRY Vol. 48(1) pp. 109–115 (2020) hjic.mk.uni-pannon.hu DOI: 10.33927/hjic-2020-16 LOCALIZATION ACCURACY IMPROVEMENT OF AUTONOMOUS VEHICLES USING SENSOR FUSION AND EXTENDED KALMAN FILTER ISTVÁN SZALAY∗1 , KRISZTIÁN ENISZ1 , HUNOR MEDVE1 , AND DÉNES FODOR1 1Research Institute of Automotive Mechatronics and Automation, University of Pannonia, Egyetem u. 10, Veszprém, 8200, HUNGARY Advanced driver assistance systems and autonomous vehicles rely heavily on position information, therefore, enhancing localization algorithms is an actively researched field. Novel algorithms fuse the signals of common vehicle sensors, the inertial measurement unit and global positioning system. This paper presents a localization algorithm for vehicle position estimation that integrates vehicle sensors (steering angle encoder, wheel speed sensors and a yaw-rate sensor) and GPS signals. The estimation algorithm uses an extended Kalman filter designed for a simplified version of the single track model. The vehicle dynamics-based model only includes calculation of the lateral force and planar motion of the vehicle resulting in the minimal state-space model and filter algorithm. A TESIS veDYNA vehicle dynamics and MathWorks Simulink-based simulation environment was used in the development and validation process. The presented results include different low- and high-speed maneuvers as well as filter estimates of the position and heading of the vehicle. Keywords: vehicle localization, extended Kalman filter, sensor fusion, dead reckoning 1. Introduction Vehicle navigation systems are important components of autonomous driving solutions. These systems acquire the position, velocity and heading of the vehicle by using on- board or externally installed sensors such as wheel speed sensors, gyroscopes, accelerometers, inertial navigation systems (INS), compasses, radio frequency receivers, etc. [1]. The two most common vehicle localization tech- niques are dead reckoning and the use of a Global Navi- gation Satellite System (GNSS), like the Global Position- ing System (GPS). In dead reckoning, distance and head- ing sensors are used to measure the vehicle displacement vector which is then integrated recursively to determine the current position of the vehicle. Measurement errors are accumulated by this integration, therefore, the accu- racy of the position estimation is constantly decreasing. On the other hand, GPS provides absolute vehicle posi- tions without the accumulation of errors associated with dead reckoning through the use of satellites as the refer- ence points. Localization methods typically integrate GPS with other sensors since GPS suffers from outages and errors. Many papers have integrated GPS with INS [2–5]. Oth- ers have integrated GPS with the inertial measurement unit (IMU) [6, 7]. This paper integrates GPS with vehicle sensors, similarly to Refs. [8–10]. The continuous avail- ∗Correspondence: szalay.istvan@mk.uni-pannon.hu ability of signals from vehicle sensors required by dead reckoning as well as the absolute positioning accuracy of GPS render them combinable to achieve better perfor- mance [8, 9]. In this paper, a vehicle localization algorithm is pre- sented that uses an extended Kalman filter (EKF) to inte- grate dead reckoning with GPS. Dead reckoning is based on a simplified version of the Single Track Model (STM) and uses a steering angle encoder, wheel speed sensors and yaw rate measurements. 2. Modeling Strategy The aim of the localization algorithm is to estimate the current position (x and y coordinates) and heading (yaw angle ψ) of the vehicle by fusing GPS measurements with dead reckoning based on vehicle sensor signals. GPS measurements provide the noisy xgps and ygps coordi- nates. Vehicle sensors provide the steering angle δ, the four wheel speed signals ωi and the yaw rate ψ̇. These measurements are available in most commercial vehicles. The lateral acceleration sensors were not used because the acceleration signal is usually less reliable and noisier than the other vehicle signals. The localization algorithm fuses these signals using an extended Kalman filter which requires an appropriate system model. The system model connects the available and estimated signals with inputs, states and outputs of the system. The simplest and most practical solution is to https://doi.org/10.33927/hjic-2020-16 mailto:szalay.istvan@mk.uni-pannon.hu 110 SZALAY, ENISZ, MEDVE, AND FODOR XE YE ~r0 ∆~r1 ∆~r2 t0TS x0 u0 noise f ( x0,u0,p0 ) = y1 = h ( x1,u1,m1 ) 1TS x1 u1 noise f ( x1,u1,p1 ) = y2 = h ( x2,u2,m2 ) 2TS x2 u2 noise Figure 1: Dead reckoning steps and propagation of the system state formulate the system model in a way that produces the true-position and heading state variables, the input vari- ables of vehicle sensor signals and the outputs of GPS signals. 3. Dead Reckoning Algorithm Dead reckoning or path integration is the process of es- timating the current position of a vehicle by using a pre- viously determined position, and projecting that position based upon known or estimated speeds over a time period and course that has elapsed. Dead reckoning is subject to cumulative errors. In continuous time, dead reckoning re- sults in the integration of the velocity vector or double in- tegration of the acceleration vector with respect to time. In discrete time of sample time TS, the equivalent of in- tegration can be written as the following in vector-sum form: ~rk = ~rk−1 + ∆~rk = ~r0 + k∑ i=1 ∆~ri (1) The equivalent coordinate form of Eq. 1 for a vehicle in planar motion is [ xk yk ] = [ xk−1 yk−1 ] + [ ∆xk ∆yk ] = [ x0 y0 ] + k∑ i=1 [ ∆xi ∆yi ] (2) In the vector form, ~rk denotes the position of the ve- hicle’s center of gravity (COG) at tk = kTS and ∆~rk stands for the displacement between tk−1 = (k − 1) TS and tk = kTS. The initial position in vector form is ~r0 and in coordinate form is [x0,y0] T (see Fig. 1). Dead reckoning is performed in the Earth-Fixed co- ordinate system XE − YE. Using the vehicle sensors, displacements in the vehicle axis system XV − YV can be calculated. To rotate the displacement into the Earth- Fixed coordinate system, changes in the heading or yaw angle ψ of the vehicle have to be tracked. The yaw angle can be estimated by integrating the yaw-rate signal ψ̇ as ψk = ψk−1 + ψ̇kTS = ψ0 + k−1∑ i=1 ψ̇iTS (3) The displacements ∆xV,k and ∆yV,k have to be calcu- lated in the vehicle axis system XV −YV. The displace- ments from the vehicle axis system to the Earth-Fixed co- ordinate system are transformed using a two-dimensional rotation matrix R(ψk−1) that rotates around the vertical axis ZE by ψk−1.[ ∆xk ∆yk ] = [ cos ψk−1 −sin ψk−1 sin ψk−1 cos ψk−1 ] ︸ ︷︷ ︸ R(ψk−1) [ ∆xV,k ∆yV,k ] (4) The simplest estimation of the longitudinal displace- ment ∆xV,k involves the estimation of the longitudinal speed vk as the average of the wheel speed signals di- vided by the effective radius of the tires R: ∆xV,k = vk−1TS, where vk−1 = R 4 4∑ i=1 ωk−1,i (5) The lateral displacement ∆yV is estimated by the second integral of the lateral acceleration, assuming an initial lat- eral velocity of zero: ∆yV,k = 1 2 ay,k−1T 2 S . (6) The lateral acceleration ay can be in the form of a sensor signal from an accelerometer or calculated based Hungarian Journal of Industry and Chemistry LOCALIZATION ACCURACY IMPROVEMENT OF AUTONOMOUS VEHICLES 111 S ~r = [ x y ] XE YE XV + ψ XW XV YV l1 l2 ~v1 ~v ~v2 ~ay O ~Fy1 ~Fy2 + ψ̇ − α2 − β − α1 + δ ZE Color coding: Velocities: ~v, ~v1, ~v2 Forces: ~Fy1, ~Fy2 Lateral acceleration: ~ay Yaw rate: ψ̇ Figure 2: The physical quantities of the single track vehicle model following [11] on the vehicle dynamics model and other vehicle sensor signals. Usually, the accelerometer signals are less reli- able and noisier than those of the steering angle, velocity and yaw-rate sensors, therefore, ay was calculated based on a vehicle model and signals from vehicle sensors, in a similar way to Ref. [9]. 4. Lateral Vehicle Dynamics As a basis for modeling the lateral vehicle dynamics, the well-known single track vehicle model defined by Riekert and Schunck [12] was used. Fig. 2 shows the physical quantities related to the single track vehicle model. This paper uses the sign conventions defined in Ref. [11]. The classical single track vehicle model includes sev- eral important simplifications. It only describes lateral motion and rotation around the vertical axis, while ne- glects vertical dynamics as well as rolling and pitching. Furthermore, the equations of motion of the single track vehicle model are linearized. To define the lateral acceleration as a function of the steering angle δ, longitudinal velocity v and yaw rate ψ̇, the lateral force equation of the model can be used: may = Fy1(α1) + Fy2(α1) (7) The linearized tire forces as the products of the cornering stiffnesses (c1 and c2) and tire slip angles (α1 and α2) are calculated as follows: Fy1(α1) = −c1α1 and Fy2(α2) = −c2α2. (8) Tire slip angles (α1 and α2) are defined by the velocity triangles of the two axles in the following nonlinear forms (see Fig. 3): tan (α1 + δ) = v sin β + ψ̇l1 v cos β (9) tan α2 = v sin β − ψ̇l2 v cos β (10) Eq. 9 corresponds to the yellow part of the velocity trian- gle corresponding to the front axle and Eq. 10 to the rear axle. The tire slip angle equations are linearized and the sideslip angle β omitted: α1 ≈ β + ψ̇l1 v − δ ≈ ψ̇l1 v −δ (11) α2 ≈ β − ψ̇l2 v ≈− ψ̇l2 v (12) The lateral acceleration ay depends on the values of the vehicle sensors according to ay ≈− c1 m ( ψ̇l1 v − δ ) + c2 m ψ̇l2 v (13) front axle XW XV ~v1 ~v ~̇ψ×~l1 + δ − β − α1 + δ + α1 rear axle XV ~v ~v2 ~̇ψ×~l2 − β − α2 Figure 3: Velocity triangles in the single track vehicle model 48(1) pp. 109–115 (2020) 112 SZALAY, ENISZ, MEDVE, AND FODOR In this way, the lateral acceleration depends on the usu- ally available cornering stiffnesses (c1 and c2), the mass and length of the vehicle (m, l1 and l2), and the signals of the vehicle sensors. If available, the lateral acceleration signal from an accelerometer can be incorporated into the sensor fusion algorithm. 5. Extended Kalman Filter Design The application of an extended Kalman filter requires a stochastic mathematical model of the system in a state- space representation including the statistical properties of the process and measurement noises [13, 14]. 5.1 State-Space Model The state-space representation includes both the state and measurement equations in vector form by introducing the functions f and h, the known input vector u, process- noise vector p and measurement-noise vector m: xk = f ( xk−1,uk−1,pk−1 ) (14) yk = h ( xk,mk ) (15) The system is time invariant, therefore, f and h are not in- dexed. The discrete-time indexing of the difference equa- tions is illustrated in Fig. 1. To estimate the vehicle’s position, the dead reckoning Eqs. 2–6 are used augmented to include the lateral accel- eration (Eq. 13) as a computed value. The resulting state equation of the discrete-time state-space model is Eq. 18. By examining Eq. 18, it can be concluded that the system is nonlinear and, therefore, a linear Kalman fil- ter is unsuitable. In this paper, an extended Kalman filter is used. The output vector y of the system includes the GPS measurements that consist of the true position and mea- surement noise m defined by the output function h: yk = [ xgps,k ygps,k ] = [ xk + mx,k yk + my,k ] = h ( xk,mk ) (16) 5.2 Jacobians The extended Kalman filter requires the Jacobians of both the state and measurement functions with respect to the state vector: Fk = ∂f ∂x ∣∣∣∣∣ x̂ + k−1 and H = ∂h ∂x ∣∣∣∣∣ x̂ + k−1 = [ 1 0 0 0 1 0 ] (17) The elements of H are constant, while the elements of Fk depend on the discrete time k, as defined by Eq. 19. The sample time TS was 100 ms, which was suffi- ciently small to capture the vehicle’s movement but not too small for GPS sampling. xk =   xk yk ψk   =   xk−1 + vk−1TS cos (ψk−1) − 1 2 ay,k−1T 2 S sin (ψk−1) + px,k−1 yk−1 + vk−1TS sin (ψk−1) + 1 2 ay,k−1T 2 S cos (ψk−1) + py,k−1 ψk−1 + ψ̇k−1TS + pψ,k−1   = f ( xk−1,uk−1,pk−1 ) (18) Fk =   1 0 −sin (ψk−1) vk−1TS − 1 2 cos (ψk−1) ay,k−1T 2 S 0 1 cos (ψk−1) vk−1TS − 1 2 sin (ψk−1) ay,k−1T 2 S 0 0 1   , uk =  ay,kvk ψ̇k   (19) 5.3 Noise model During the design of the extended Kalman filter, a time- invariant and normally distributed process as well as mea- surement noise were assumed: p ∼N ( 0,Q ) , m ∼N ( 0,R ) (20) For the development and testing of our extended Kalman filter algorithm, a TESIS veDYNA vehicle dynamics-based simulation environment was used with configurable noise models (see Section 6). Although it was possible to match the noise and covariances of the filter perfectly, the filter and noise models were tuned in a slightly different way. The measurement- and process- noise covariances for both the filter and noise models have been estimated based on the characteristics of the sensor and GPS range error statistics [15]: Q = diag ( 0.2 m2, 0.2 m2, 0.01 rad2 ) (21) R = diag ( 1.5 m2, 1.5 m2 ) (22) Hungarian Journal of Industry and Chemistry LOCALIZATION ACCURACY IMPROVEMENT OF AUTONOMOUS VEHICLES 113 Our algorithm performs the dead reckoning in the Earth- Fixed coordinate system and, therefore, no predetermined difference between the direction covariances XE and YE is present, so Q11 = Q22 and R11 = R22. The dis- placement variance of 0.2 m2 corresponds to an error of 4.5 m s−1 in the wheel speed-based velocity calculation. In the presence of non-normally distributed noise, the fil- ter is not optimal. 5.4 The extended Kalman Filter Algorithm The extended Kalman filter algorithm follows well- known steps [14]. The prediction equations are x̂−k = f ( x̂+k−1,uk−1, 0 ) (23) P−k = FkP + k−1F T k + Q (24) Calculation of the Kalman gain is Kk = P − k H T k ( HkP − k H T k + R )−1 (25) The correction equations are x̂+k = x̂ − k + Kk ( yk −hk ( x̂−k ,uk, 0 )) (26) P+k = ( I −KkHk ) P−k (27) The initial state is determined based on the first several GPS observations whilst in motion. 6. Simulation Environment The development of the localization algorithm was con- ducted in a MathWorks MATLAB/Simulink-based ve- hicle dynamics simulation environment. The TESIS ve- DYNA model library was used to model the vehicle, road system and maneuvers (Fig. 4). The advantage of our simulation platform lies in its integrated structure. Algorithms developed in MATLAB and Simulink can be integrated into the TESIS veDYNA vehicle dynamics simulation which enables Software- in-the-Loop testing and real-time Hardware-in-the-Loop analysis to be implemented by the National Instruments PXI hardware system. In our platform, real streets using GPS coordinates or map databases can be modeled. This enables the direct comparison of simulations and real-world measurements. 7. Simulation Results The extended Kalman filter was tuned and studied in sim- ulated test maneuvers during which data were collected. The test maneuvers were performed on a virtual test track that included low- and high-speed driving, accelerating, braking and cornering. The size of the test track was around 2 by 2 km and the simulated test maneuvers lasted for 528 s. Our extended Kalman filter was compared to simple dead reckoning and GPS observations. The true path, the result of dead reckoning and the position, estimated by the implementation of our extended Kalman filter, are shown in Fig. 5. Figure 4: TESIS DYNAanimation user interface 7.1 Comparison with Dead Reckoning Dead reckoning without the aid of the extended Kalman filter accumulated a large position error during the test maneuvers. The error of the dead reckoning reached 100 m, as can be seen in Fig. 5. The position estimated by our extended Kalman filter did not include error accumu- lation and performed better than dead reckoning alone. 7.2 Comparison with GPS Due to the large difference between the size of the path and the position errors, the difference between GPS ob- servations and the extended Kalman filter estimates were not as clearly visible as the error of dead reckoning (Fig. 5). Zooming in on certain parts of the path en- ables visual evaluation of a particular part of the path 0 500 1000 1500 2000 0 500 1000 1500 2000 Position, x, [m] P os it io n, y ,[ m ] True path Dead reckoning EKF estimation Figure 5: The real path, dead reckoning only and EKF estimation 48(1) pp. 109–115 (2020) 114 SZALAY, ENISZ, MEDVE, AND FODOR 0 2 4 6 8 10 12 14 16 18 20 22 24 26 −2 0 2 4 Displacement, x, [m] D is pl ac em en t, y ,[ m ] Real path GPS position EKF estimation Figure 6: The initial section of the true, estimated and GPS-observed paths (Fig. 6). To evaluate the extended Kalman filter estimate and make it numerically comparable to the GPS observa- tions, the instantaneous and average distance errors were calculated. The distance error dk of the estimation is calculated as the distance between the estimated and true positions: dk = √ (x̂k −xk) 2 + (ŷk −yk) 2 (28) The distance error dgps,k of GPS observations is dgps,k = √( xgps −x )2 + ( ygps −y )2 (29) The average distance errors are d̄ = 1 N N∑ k=1 dk and d̄gps = 1 N N∑ k=1 dgps,k (30) The distance errors of the GPS observations and the extended Kalman filter position estimates are shown in Fig. 7. The timespan of the test maneuvers was 528 s, moreover, at a sample time of 100 ms, it produced 5280 points. The average distance error of the GPS observa- tions was d̄gps = 751 mm. Our extended Kalman fil- ter reduced the average distance error significantly, d̄ = 457 mm. Besides the average values, the distributions of the distance errors are also of interest. The distance errors are discrete values whose distributions can be approxi- mated by their histograms. Such histograms are shown in (Fig. 8) with a bin width of 10 cm. 8. Conclusions In this paper, a real-time vehicle localization algorithm developed and implemented in a TESIS veDYNA vehi- cle dynamics simulation environment was presented. The localization algorithm used an extended Kalman filter to fuse GPS observations with vehicle sensor measurements of only the steering angle, yaw rate and wheel speeds. The underlying state-space model is based on planar dead reckoning that calculates the longitudinal displacement using wheel speed and lateral displacement in a simpli- fied version of the single track model. The state-space model only includes the x and y coordinates and the yaw angle ψ to minimize the model and filter algorithm. The performance of the position estimator was ana- lyzed during different high- and low-speed maneuvers. Compared to the dead reckoning and GPS observations that were not integrated, the integrated system performed significantly better. The average distance error was re- duced by 39 %. Further improvement of localization accuracy would be possible by using a more sophisticated vehicle model resulting in a more complex implementation of an ex- tended Kalman filter with a much higher computational burden. 0 100 200 300 400 500 0 1 2 3 4 Time, t, [s] D is ta nc e er ro rs ,d an d d g p s ,[ m ] GPS distance error dgps EKF distance error d GPS average d̄gps = 751 mm EKF average d̄ = 457 mm Figure 7: Distance error comparison Hungarian Journal of Industry and Chemistry LOCALIZATION ACCURACY IMPROVEMENT OF AUTONOMOUS VEHICLES 115 0 1 2 3 4 0 200 400 600 800 1000 Distance error, d, [m] C ou nt histogram of dgps histogram of d d̄gps = 751 mm d̄ = 457 mm Figure 8: Distance error histograms Acknowledgement This research was supported by the project EFOP-3.6.2- 16-2017-00002 entitled "Research of Autonomous Vehi- cle Systems related to the Autonomous Vehicle Proving Ground of Zalaegerszeg". REFERENCES [1] Karlsson, R.; Gustafsson, F.: The Future of Au- tomotive Localization Algorithms: Available, re- liable, and scalable localization: Anywhere and anytime, IEEE Signal Processing Magazine, 2017, 34(2), 60–69 DOI: 10.1109/MSP.2016.2637418 [2] Farrell, J.A.; Givargis, T.D.; Barth, M.J.: Real- time differential carrier phase GPS-aided INS, IEEE Transactions on Control Systems Technology, 2000, 8(4), 709–721 DOI: 10.1109/87.852915 [3] Qi, H.; Moore, J.B.: Direct Kalman filtering ap- proach for GPS/INS integration, IEEE Transactions on Aerospace and Electronic Systems, 2002, 38(2), 687–693 DOI: 10.1109/TAES.2002.1008998 [4] Yu, M.: INS/GPS Integration System using Adap- tive Filter for Estimating Measurement Noise Variance, IEEE Transactions on Aerospace and Electronic Systems, 2012, 48(2), 1786–1792 DOI: 10.1109/TAES.2012.6178100 [5] Liu, H.; Nassar, S.; El-Sheimy, N.: Two-Filter Smoothing for Accurate INS/GPS Land-Vehicle Navigation in Urban Centers, IEEE Transactions on Vehicular Technology, 2010, 59(9), 4256–4267 DOI: 10.1109/TVT.2010.2070850 [6] Almeida, H.P.; Júnior, C.L.N.; d. Santos, D.S.; Leles, M.C.R.: Autonomous Navigation of a Small- Scale Ground Vehicle Using Low-Cost IMU/GPS Integration for Outdoor Applications, in 2019 IEEE International Systems Conference (SysCon), 1–8 DOI: 10.1109/SYSCON.2019.8836794 [7] Yu, M.; Guo, H.; Gao, W.: Realization of Low- Cost IMU/GPS Integrated Navigation System, in 2006 Japan-China Joint Workshop on Frontier of Computer Science and Technology, 189–195 DOI: 10.1109/FCST.2006.27 [8] Kao, W.W.: Integration of GPS and dead-reckoning navigation systems, in Vehicle Navigation and In- formation Systems Conference, 1991, vol. 2, 635– 643 DOI: 10.1109/VNIS.1991.205808 [9] Rezaei, S.; Sengupta, R.: Kalman Filter-Based In- tegration of DGPS and Vehicle Sensors for Lo- calization, IEEE Transactions on Control Sys- tems Technology, 2007, 15(6), 1080–1088 DOI: 10.1109/TCST.2006.886439 [10] Hohman, D.; Murdock, T.; Westerfield, E.; Hattox, T.; Kusterer, T.: GPS roadside inte- grated precision positioning system, in IEEE 2000. Position Location and Navigation Sym- posium (Cat. No.00CH37062), 221–230 DOI: 10.1109/PLANS.2000.838306 [11] ISO 8855:2011 Road vehicles – Vehicle dynam- ics and road-holding ability – Vocabulary, Stan- dard, International Organization for Standardiza- tion, Geneva, CH, 2011 [12] Riekert, P.; Schunck, T.E.: Zur Fahrmechanik des gummibereiften Kraftfahrzeugs, Ingenieur-Archiv, 1940, 11(3), 210–224 DOI: 10.1007/BF02086921 [13] Bucy, R.S.: Linear and nonlinear filtering, Pro- ceedings of the IEEE, 1970, 58(6), 854–864 DOI: 10.1109/PROC.1970.7792 [14] Simon, D.: Optimal State Estimation: Kalman, H Infinity, and Nonlinear Approaches (Wiley- Interscience, New York, NY, USA), 2006 ISBN: 0471708585 [15] FAA William J. Hughes Technical Center: Global positioning system (GPS) standard positioning service (SPS) performance analysis report, 2019 https://www.nstb.tc.faa.gov/reports/ 48(1) pp. 109–115 (2020) https://doi.org/10.1109/MSP.2016.2637418 https://doi.org/10.1109/87.852915 https://doi.org/10.1109/TAES.2002.1008998 https://doi.org/10.1109/TAES.2012.6178100 https://doi.org/10.1109/TAES.2012.6178100 https://doi.org/10.1109/TVT.2010.2070850 https://doi.org/10.1109/TVT.2010.2070850 https://doi.org/10.1109/SYSCON.2019.8836794 https://doi.org/10.1109/FCST.2006.27 https://doi.org/10.1109/FCST.2006.27 https://doi.org/10.1109/VNIS.1991.205808 https://doi.org/10.1109/TCST.2006.886439 https://doi.org/10.1109/TCST.2006.886439 https://doi.org/10.1109/PLANS.2000.838306 https://doi.org/10.1109/PLANS.2000.838306 https://doi.org/10.1007/BF02086921 https://doi.org/10.1109/PROC.1970.7792 https://doi.org/10.1109/PROC.1970.7792 https://www.nstb.tc.faa.gov/reports/ Introduction Modeling Strategy Dead Reckoning Algorithm Lateral Vehicle Dynamics Extended Kalman Filter Design State-Space Model Jacobians Noise model The extended Kalman Filter Algorithm Simulation Environment Simulation Results Comparison with Dead Reckoning Comparison with GPS Conclusions