Abstract:
An opportunistic calibration method continuously monitors a smartphone orientation and compensates for its variation, as necessary. The method relies on the probabilistic fusion of built-in sensors; in particular, the GPS, accelerometer, gyroscope, and magnetometer. The calibration method may utilize a state-machine approach along with an orientation stability detection algorithm to keep track of the smartphone orientation over time and to coordinate the calibration process in an opportunistic manner. An orientation calibration method may rely mainly on the probabilistic fusion of GPS and magnetometer sensory data.

Description:
BACKGROUND 
       [0001]    The ubiquity of modern smartphones, along with their powerful sensing, processing, and communication capabilities, has made them an attractive platform to realize the next generation of the telematics solutions. The sensory data provided by a smartphone are typically measured with respect to the smartphone&#39;s frame of reference. Thus, for the smartphone sensory data to be useful in telematics applications, they must be re-oriented to align with the vehicle&#39;s frame of reference, a process known as smartphone calibration. Most importantly, this enables a proper association of the 3D accelerometer data of the smartphone to the lateral and longitudinal acceleration of the vehicle without any user intervention. In contrast to the telematics dongle devices commonly deployed today, which are permanently affixed to the body of the vehicle, the smartphone orientation might easily vary while the vehicle is being driven. Accordingly, the calibration process must be estimating the smartphone orientation opportunistically. In fact, a recent study argues that partial information availability is the main difference between the new smartphone-based and the conventional dongle-based telematics solutions. This signifies the requirement for the development of novel telematics solutions capable of exploiting smartphone data in an opportunistic manner. 
         [0002]    Nonetheless, much of the related work is based on the assumption that the smartphone orientation is held constant while driving using a mount. This has the drawbacks of requirement for a mount accessory and also the user inconvenience of placing and removing the smartphone in and out of the vehicle mount, hence restricting the applicability significantly. 
         [0003]    In the last decade, the concept of Usage-Based Insurance (UBI) has emerged as a type of automobile insurance whereby the costs of automotive insurance are dependent upon the type of vehicle used and its usage characteristics including duration of driving, distance, and behavior. Some automotive insurance carriers currently provide options to determine premiums based upon information gathered by in-vehicle sensors. These sensors are packaged inside a black box dongle device attached to the diagnostics port of the vehicle. A recent trend in UBI market aim at replacing the dongle devices with a mobile application running on a smartphone. The key advantage of using smartphones for the UBI application is elimination of the initial cost associated with the device hardware. However, deploying smartphones for UBI involves several challenging problems. In particular, the smartphones are not attached to the vehicle body and thus their relative orientation to the vehicle frame of reference is not known and varying at all time. This makes calibration of smartphone orientation an essential enabler of the smartphone-based UBI technology. 
       SUMMARY 
       [0004]    The proposed opportunistic calibration method avoids making the above-mentioned unrealistic assumptions. Moreover, some of the most well-known calibration methods in the literature advocate deployment of harsh acceleration/braking events to achieve orientation calibration and avoid magnetometers due to their susceptibility to electromagnetic interference. In contrast, the proposed calibration method proposes a solution to tackle the electromagnetic interference issue of the magnetometer. 
         [0005]    Optionally, the calibration method provides a state-machine approach along with an orientation stability detection algorithm to keep track of the smartphone orientation over time and to coordinate the calibration process in an opportunistic manner. 
         [0006]    As another option, an orientation calibration method relies mainly on the probabilistic fusion of GPS and magnetometer sensory data. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0007]    The drawings can be briefly described as follows: 
           [0008]      FIG. 1A  is a schematic of a smartphone that can be used to implement the present invention. 
           [0009]      FIG. 1B  illustrates the relationship of the smartphone reference system and the vehicle&#39;s reference system. 
           [0010]      FIG. 2  illustrates an architectural overview of the proposed method. 
           [0011]      FIG. 3  illustrates an example state machine for governing the coordination of the modules of  FIG. 2 . 
           [0012]      FIG. 4  illustrates the set of sensory data collected during the stable and instable states. 
           [0013]      FIGS. 5 to 7  illustrate the rates of rotation, the normalized angular motion power, the roll and pitch Euler angles, and the corresponding orientation stability status for an exemplary test scenario, respectively. 
           [0014]      FIG. 8  illustrates the collected GPS course vs. magnetometer heading sensory data for an exemplary test scenario. 
           [0015]      FIGS. 9 and 10  illustrate the corresponding yaw estimate weights over time and the resultant weighted histogram of the yaw candidates fitted with two Gaussian components, respectively. 
           [0016]      FIG. 11  provides a pseudocode representation of the proposed yaw estimation algorithm. 
       
    
    
     DETAILED DESCRIPTION 
       [0017]      FIG. 1A  is basic schematic of a smartphone  10 . The smartphone  10  includes a processor  12  and electronic storage  14 . The smartphone  10  includes one or more of a plurality of sensors, such as GPS  16  (meaning more generally any type of GNSS), magnetometer  18 , three-axis accelerometer  20  and gyros  22 . Other sensors could be used instead of or in addition to these sensors. As is well-known, the smartphone  10  includes many other elements, such as communication circuits, including a cell communication circuit  26 , Bluetooth  24 , Wifi, NFC, and other user interface elements, such as a touchscreen, various buttons, microphone, speakers, etc. A suitable example of a commercially available smartphone  10  is the iPhone 5s, iPhone 6 and iPhone 6s. 
         [0018]    The proposed calibration algorithm relies on the Euler angle representation of smartphone orientation. Accordingly, it objective is to estimate the relative pitch φ, roll θ, and yaw ψ rotation angles that are required to re-orient the smartphone&#39;s  10  reference system [Xp Yp Zp] to the vehicle&#39;s  28  frame of reference [Xv Yv Zv]. A pictorial representation of these three angles is provided in  FIG. 1B . 
         [0019]      FIG. 2  illustrates an architectural overview of the proposed method. The proposed method includes three main components, namely, the orientation stability detection  30 , the relative orientation estimation  32 , and the accelerometer re-orientation  34  modules. The operation of the calibration method is controlled by the status of an external trip start/end detection module, i.e., the calibration method runs only during a trip. Each of the three main components require a subset of the available sensory data of the smartphone&#39;s embedded sensors. In particular, the orientation stability detection  30  method requires the angular rates of rotation and Euler angles of the gyroscope  22 . The GPS  16 , magnetometer  18 , and accelerometer  20  sensory data are deployed by the relative orientation estimation module  32 . Lastly, the re-orientation module  34  operates on the raw accelerometer data  20  and maps from the smartphone  10  to the vehicle&#39;s  28  frame of reference. 
         [0020]    The coordination of the aforementioned modules is governed by a state-machine involving four states as shown in  FIG. 3 . Upon being started at the trip start mode  38  the orientation stability detection module  30  is launched and the mode defaults to the instable orientation  40 . Once the orientation is detected to be stable, the mode transitions into stable  42  and the sensory data required by the relative orientation estimation  32  module are collected. The set of sensory data collected during the stable and instable states are illustrated in  FIG. 4 . As soon as the smartphone  10  orientation is detected to be instable  40 , the relative orientation estimation module  32  is launched using the sensory data collected during the stable mode  42 . This process is repeated until the end of trip is detected wherein the mode is transitioned into trip end  44  and the stability detection module  30  is stopped. 
         [0021]    A two-stage algorithm detects the instability of smartphone  10  orientation. The algorithm relies on both the rates of rotation and the roll and pitch Euler angles provided by gyroscope  22 . Let the normalized recent power of the rates of rotation sensory data ω at time t, P rotation , to be defined within a predefined window of time W rotation  as 
         [0000]    
       
         
           
             
               
                 
                   
                     P 
                     rotation 
                     t 
                   
                   = 
                   
                     
                       
                         
                           
                             ∑ 
                             
                               t 
                               = 
                               
                                 t 
                                 - 
                                 
                                   W 
                                   rotation 
                                 
                               
                             
                             t 
                           
                            
                           
                             ω 
                             
                               x 
                               , 
                               t 
                             
                             2 
                           
                         
                         + 
                         
                           ω 
                           
                             y 
                             , 
                             t 
                           
                           2 
                         
                         + 
                         
                           ω 
                           
                             z 
                             , 
                             t 
                           
                           2 
                         
                       
                       
                         
                           f 
                           rottaion 
                         
                         · 
                         
                           W 
                           rotation 
                         
                       
                     
                     . 
                   
                 
               
               
                 
                   ( 
                   1 
                   ) 
                 
               
             
           
         
       
     
         [0022]    where f rotation  denotes the sampling rate of gyroscopic data. Then the initial smartphone&#39;s orientation detection can be obtained as 
         [0000]    
       
         
           
             
               
                 
                   { 
                   
                     
                       
                         
                           potentially 
                            
                           
                               
                           
                            
                           instable 
                         
                       
                       
                         
                           
                             if 
                              
                             
                                 
                             
                              
                             
                               P 
                               rotation 
                             
                           
                           ≥ 
                           
                             Thr 
                             SAM 
                           
                         
                       
                     
                     
                       
                         stable 
                       
                       
                         otherwise 
                       
                     
                   
                 
               
               
                 
                   ( 
                   2 
                   ) 
                 
               
             
           
         
       
     
         [0023]    where Thr SAM  denotes the preset significant angular motion (SAM) threshold value. 
         [0024]    The main challenge however is setting the appropriate Thr SAM  as a very high value could lead to inability to detect instability, whereas a very low value could result in a large number of false positives. To deal with this issue, the proposed stability detection algorithm  30  operates in two steps. First, a low threshold value, empirically set to 4, is used to detect all potential instabilities. Next, a validation step is performed to eliminate false positives. The validation process relies on the observation that if the smartphone&#39;s orientation has indeed varied due to instability, there has to be a noticeable variation in the recent average roll  φ   t  and pitch  θ   t  Euler angles computed within a predefined window of time W Euler  angles. In other words, a potentially instable orientation is considered valid, if the difference between the last and the new  φ   t  or  θ   t  is more than a preset significant angular variation (SAV) threshold Thr SAV . 
         [0025]      FIGS. 5 to 7  illustrate the rates of rotation, the normalized angular motion power, the roll and pitch Euler angles, and the corresponding orientation stability status for an exemplary test scenario, respectively. The smartphone  10  is placed in a cup holder and changes its orientation twice during the trip. The first variation occurs when the smartphone  10  moves slightly within the cupholder during a sharp turn. The second variation occurs when the user picks up the smartphone to turn off its screen. As shown in  FIG. 5 , there are a large number of potential instability periods during the trip, according to the normalized angular motion power data. Nonetheless, the validation step of the proposed algorithm is able to successfully filter out the false alarm detections. As shown, only two instability periods, which correspond to significant variation to the roll or pitch Euler angles and occur at about 950 and 1250 seconds into the trip, are detected. The stable orientation time periods beyond two minutes constitute a mini-trip. Accordingly, there are three detected mini-trips for the exemplary test scenario results shown in  FIG. 7 . 
         [0026]    The roll and pitch Euler angles directly affect the reading of the gravity vector on the smartphone  10 . This means estimating these two angles require a reliable estimate of the gravity vector, which can be obtained using the median of the raw accelerometer data collected during a mini-trip. Mathematically speaking, given the estimated gravity vector during a mini-trip as [g x  g y  g z ] T , the roll φ and pitch θ angles can then be estimated as below 
         [0000]    
       
         
           
             
               
                 
                   φ 
                   = 
                   
                     arctan 
                      
                     
                       ( 
                       
                         
                           g 
                           y 
                         
                         
                           g 
                           z 
                         
                       
                       ) 
                     
                   
                 
               
               
                 
                   ( 
                   3 
                   ) 
                 
               
             
             
               
                 
                   θ 
                   = 
                   
                     arctan 
                     ( 
                     
                       
                         g 
                         x 
                       
                       
                         
                           
                             g 
                             y 
                             2 
                           
                           + 
                           
                             g 
                             z 
                             2 
                           
                         
                       
                     
                     ) 
                   
                 
               
               
                 
                   ( 
                   4 
                   ) 
                 
               
             
           
         
       
     
         [0027]    Estimating the yaw angle of the smartphone  10  w.r.t. the vehicle  28  is a challenging problem. Unlike the roll and pitch angles, the yaw angle variations do not affect the gravity vector measured by the smartphone  10 . Moreover, estimating the yaw angle requires knowledge of the vehicle&#39;s motion direction. 
         [0028]    Estimating the yaw angle of the smartphone  10  w.r.t. the vehicle  28  is a challenging problem. Unlike the roll and pitch angles, the yaw angle variations do not affect the gravity vector measured by the smartphone  10 . Moreover, estimating the yaw angle requires knowledge of the vehicle&#39;s motion direction. The proposed yaw estimation algorithm relies on the GPS  16  course and magnetometer  18  heading data. The vehicle&#39;s motion direction relative to the Earth&#39;s magnetic north is provided by the GPS  16  course. The magnetometer  18  data represents the heading of the smartphone  10  relative to the Earth&#39;s magnetic north. So, theoretically the yaw angle ψ is just the difference between the heading and course data, i.e., ψ t =heading t −course t . However, the GPS  16  course and magnetometer  18  heading are typically unreliable due to sensor noise. In particular, the magnetometer  18  heading is notoriously noisy and susceptible to local interference. 
         [0029]    To overcome these challenges, a Gaussian mixture model (GMM) based probabilistic inference algorithm is proposed to estimate the yaw angle. The GPS  16  and magnetometer  18  data are typically provided at 1 Hz rate. This means a large number of candidate yaw estimates can be collected during a minitrip. The set of yaw angle estimates obtained during a minitrip can be considered as a particle cloud representation of a probabilistic distribution. Accordingly, to infer the yaw angle a Gaussian mixture model (GMM) involving two components can be fitted to the histogram of the yaw angle estimates. The rationale behind choosing two Gaussians for the GMM fitting procedure is to allow for one Gaussian to be positioned around the true estimates of the yaw angle while the other Gaussian is intended to be positioned around the invalid yaw estimates, obtained due to noise. On the other hand, the yaw estimates obtained using GPS  16  and magnetometer  18  data are reliable only when the cross-correlation between these two signals is high. This observation can be leveraged to further enhance the robustness of the proposed GMM-based inference algorithm. The enhancement is achieved by assigning a weight to each of the yaw angle estimates. The weights are computed using the cross-correlation of the GPS  16  course and magnetometer  18  heading within the temporal vicinity of each estimate. 
         [0030]    The algorithm  1  presented in  FIG. 11  provides a pseudocode representation of the proposed yaw estimation algorithm. As shown, the first step is to filter out the invalid GPS and magnetometer data. Next, the candidate yaw estimate particles are computed. The weight assigned to each particle is obtained using the Pearson correlation coefficient (PCC) of the GPS course of magnetometer heading data within a predefined window of time W PCC . The candidate yaw particles are then resampled according to their weight using a stochastic resampling procedure. The particles with negative weight are simply discarded. The histogram of the resampled yaw estimate particles is then computed and fitted with a Gaussian mixture model (GMM) involving two components. Let GC* to denote the Gaussian component (GC) with the larger weight, and w(GC), μ(GC), and σ(GC) to represent the weight, mean, and covariance of a Gaussian component. In addition, the mode of the histogram H is denoted by mode(H). The last step involves applying a set of heuristic rules to obtain the final estimate of the yaw angle ψ as 
         [0000]    
       
         
           
             
               
                 
                   
                     ψ 
                     ^ 
                   
                   = 
                   
                     { 
                     
                       
                         
                           
                             
                               if 
                                
                               
                                   
                               
                                
                               
                                 w 
                                  
                                 
                                   ( 
                                   
                                     GC 
                                     * 
                                   
                                   ) 
                                 
                               
                             
                             ≥ 
                             
                               Thr 
                               MNW 
                             
                           
                         
                       
                       
                         
                           
                             
                               if 
                                
                               
                                   
                               
                                
                               
                                 σ 
                                  
                                 
                                   ( 
                                   
                                     GC 
                                     * 
                                   
                                   ) 
                                 
                               
                             
                             ≤ 
                             
                               Thr 
                               MNC 
                             
                           
                         
                       
                       
                         
                           
                             return 
                              
                             
                                 
                             
                              
                             
                               μ 
                                
                               
                                 ( 
                                 
                                   GC 
                                   * 
                                 
                                 ) 
                               
                             
                           
                         
                       
                       
                         
                           else 
                         
                       
                       
                         
                           
                             return 
                              
                             
                                 
                             
                              
                             
                               mode 
                                
                               
                                 ( 
                                 H 
                                 ) 
                               
                             
                           
                         
                       
                       
                         
                           else 
                         
                       
                       
                         
                           
                             
                               if 
                                
                               
                                   
                               
                                
                               
                                 
                                   w 
                                    
                                   
                                     ( 
                                     
                                       GC 
                                       1 
                                     
                                     ) 
                                   
                                 
                                 
                                   σ 
                                    
                                   
                                     ( 
                                     
                                       GC 
                                       1 
                                     
                                     ) 
                                   
                                 
                               
                             
                             &gt; 
                             
                               
                                 w 
                                 ( 
                                 
                                   GC 
                                   2 
                                 
                                  
                                 
                                     
                                 
                                 ) 
                               
                               
                                 σ 
                                 ( 
                                 
                                   GC 
                                   2 
                                 
                                  
                                 
                                     
                                 
                                 ) 
                               
                             
                           
                         
                       
                       
                         
                           
                             return 
                              
                             
                                 
                             
                              
                             
                               μ 
                                
                               
                                 ( 
                                 
                                   GC 
                                   1 
                                 
                                 ) 
                               
                             
                           
                         
                       
                       
                         
                           else 
                         
                       
                       
                         
                           
                             return 
                              
                             
                                 
                             
                              
                             
                               μ 
                                
                               
                                 ( 
                                 
                                   GC 
                                   2 
                                 
                                 ) 
                               
                             
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   5 
                   ) 
                 
               
             
           
         
       
     
         [0031]    where the Thr MNW  and Thr MNC  denote the minimum non-ambiguous weight (MNW) and maximum non-ambiguous covariance (MNC) thresholds for the GC* to be considered as the representation of the valid yaw estimate distribution, respectively. These thresholds are determined empirically. 
         [0032]      FIG. 8  illustrates the collected GPS course vs. magnetometer heading sensory data for an exemplary test scenario. The corresponding yaw estimate weights over time and the resultant weighted histogram of the yaw candidates fitted with two Gaussian components are shown in  FIGS. 9 and 10 , respectively. As shown in  FIG. 9 , the proposed weighting approach is able to successfully discern the time periods where the GPS course and magnetometer heading are both reliable form those whereby they become noisy. For instance, the estimated weights become very small and even negative for the time periods about 25, 150, and 225 seconds into the trip. The GM fitting mechanism yields two Gaussian components positioned around −60′ and 0′. As expected, the former GC representing the true yaw estimate contains a much larger mass of particles, and hence a larger weight. 
         [0033]    In accordance with the provisions of the patent statutes and jurisprudence, exemplary configurations described above are considered to represent a preferred embodiment of the invention. However, it should be noted that the invention can be practiced otherwise than as specifically illustrated and described without departing from its spirit or scope.