Abstract:
A brake controller is disclosed for a towed vehicle braking system. The controller is adapted to be mounted in a towing or a towed vehicle having a longitudinal axis for generating a braking control signal to the towed vehicle braking system. The controller comprises an inertial sensor including plural sensor axes adapted to be mounted in an undefined orientation relative to the longitudinal axis for generating sensor data associated with each sensor axis. The controller also comprises a memory device for storing the sensor data associated with each sensor axis and a processor for processing the sensor data with the braking control signal to evaluate orientation of the inertial sensor relative to the longitudinal axis. In particular the brake controller is adapted to control activation of the towed vehicle braking system in a manner that is relatively insensitive to acceleration of the vehicle in a lateral direction and to orientation of the inertial sensor without prescribing a mounting orientation of the brake controller relative to the towing or towed vehicle. A method of operating a brake controller for a towed vehicle braking system is also disclosed.

Description:
TECHNICAL FIELD 
       [0001]    The present invention relates to a brake controller for an accelerometer based towed vehicle braking system and a method of operating the brake controller. 
       BACKGROUND OF INVENTION 
       [0002]    Towed vehicles such as trailers of various classes have different braking systems. Commonly, trailers with weights between 750 kg and 3.5 tons have electromagnetic braking systems or hydraulic braking systems controlled by electromagnetic actuators. For both of these systems the braking force in the trailer is controlled by an electrical signal from the towing vehicle. 
         [0003]    Historically, the level of trailer braking was controlled by a simple manual adjustment of output level. More recently, trailer braking systems exist that attempt to provide a simpler user experience by providing trailer braking proportional to towing vehicle braking. One common way to implement this is to use an accelerometer or pendulum to measure vehicle braking force and to apply proportional force with the trailer brakes. Known products using an accelerometer to measure vehicle braking force have been required to be installed in a particular orientation to allow braking force to be measured along a single axis. 
         [0004]    However a difficulty may arise because the accelerometer may measure not only the braking deceleration, but also artefacts. Artefacts that may be measured include i) noise from road; ii) gravity, adjusted by pitch and roll of the vehicle; iii) centripetal acceleration; and iv) acceleration due to pitch and roll, assuming that the accelerometer is not placed at the centroid of the vehicle. Designs for brake controllers exist that compensate for (ii) by eliminating components not in the horizontal plane. However, such systems are sensitive to lateral acceleration of the vehicle since they do not compensate for (ii) or for horizontal components of (i) or (iv). Existing systems that measure only forward acceleration require mounting at a specific angle to the vehicle axes. 
         [0005]    The present invention may provide a brake controller for a towed vehicle braking system and a method for operating the brake controller. The controller and method may include an acceleration model to minimise the above mentioned artefacts and/or to provide more optimal calculation of deceleration. The controller and method may include one or more feedback algorithms for measurement, calibration and/or validation of direction and consequent calculation of deceleration/braking force in a forward direction. 
         [0006]    The controller and method may also include one or more algorithms for automating generation of parameters for the acceleration model. 
         [0007]    A reference herein to a patent document or other matter which is given as prior art is not to be taken as an admission that that document or matter was known or that the information it contains was part of the common general knowledge in Australia or elsewhere as at the priority date of any of the disclosure or claims herein. Such discussion of prior art in this specification is included to explain the context of the present invention in terms of the inventor&#39;s knowledge and experience. 
         [0008]    Throughout the description and claims of this specification the words “comprise” or “include” and variations of those words, such as “comprises”, “includes” and “comprising” or “including, are not intended to exclude other additives, components, integers or steps. 
       SUMMARY OF INVENTION 
       [0009]    According to one aspect of the present invention there is provided a brake controller for a towed vehicle braking system, said controller being adapted to be mounted in a towing or a towed vehicle having a longitudinal axis for generating a braking control signal to said towed vehicle braking system, said controller comprising: an inertial sensor including plural sensor axes adapted to be mounted in an undefined orientation relative to said longitudinal axis for generating sensor data associated with each sensor axis; a memory device for storing said sensor data associated with each sensor axis; and a processor for processing said sensor data with said braking control signal to evaluate said orientation of said inertial sensor relative to said longitudinal axis; whereby said brake controller is adapted to control activation of said towed vehicle braking system in a manner that is relatively insensitive to acceleration of said vehicle in a lateral direction and to said orientation of said inertial sensor without prescribing a mounting orientation of said brake controller relative to said towing or towed vehicle. 
         [0010]    The brake controller may include additional circuitry for control and measurement of braking systems and/or vehicle status. 
         [0011]    The processor may be adapted to perform feedback calibration on the sensor data to facilitate determining a forward direction vector of said vehicle in a frame of reference of said inertial sensor and/or to reduce effects of said acceleration of said vehicle in said lateral direction. The calibration may include single shot calibration, continuous calibration or continuous checking of calibration to facilitate determining a forward direction vector of said vehicle in a frame of reference of said inertial sensor and/or to reduce effects of said acceleration of said vehicle in said lateral direction. The processor may perform cross-correlation of the sensor data with the braking control signal and/or a brake light signal such that a direction of maximum correlation is used as an estimate of the longitudinal axis. The cross correlation may be performed using vector mathematics and/or a filtering process may be followed by filtering in an angular or vector domain. In some embodiments the cross-correlation may be performed using filtering in an angular or vector domain. The towed vehicle may include a trailer. The inertial sensor may include a multi-axis accelerometer. The multi-axis accelerometer may be adapted to sense braking forces on the towed and towing vehicles. The brake controller may be mounted in the towing or towed vehicle. 
         [0012]    According to a further aspect of the present invention there is provided a method of operating a brake controller for a towed vehicle braking system, wherein said controller is adapted to be mounted in a towing or a towed vehicle having a longitudinal axis for generating a braking control signal to said towed vehicle braking system, said method comprising: mounting an inertial sensor including plural sensor axes in an undefined orientation relative to said longitudinal axis for generating sensor data associated with each sensor axis; storing said sensor data associated with each sensor axis in a memory device; and processing said sensor data with said braking control signal to evaluate said orientation of said inertial sensor relative to said longitudinal axis; whereby said brake controller is adapted to control activation of said towed vehicle braking system in a manner that is relatively insensitive to acceleration of said vehicle in a lateral direction and to said orientation of said inertial sensor without prescribing a mounting orientation of said brake controller relative to said towing or towed vehicle. 
     
    
     
       BRIEF DESCRIPTION OF DRAWINGS 
         [0013]    A preferred embodiment of the present invention will now be described with reference to the accompanying drawings wherein: 
           [0014]      FIG. 1  shows a trailer braking system including a vehicle mounted brake controller; 
           [0015]      FIG. 2  shows a braking system and brake controller with a calibration algorithm for calculating a desired value of acceleration; 
           [0016]      FIG. 3  shows a braking system and brake controller with an algorithm for feedback chain calibration; and 
           [0017]      FIG. 4  shows a braking system and brake controller with an algorithm for performing on-line calibration. 
       
    
    
     DETAILED DESCRIPTION 
       [0018]      FIG. 1  shows a trailer braking system including a brake controller  10  mounted in a towing vehicle (not shown) with wires leading back to a towed vehicle such as a trailer  11 . Controller  10  is associated with a remote head  12  for providing potentiometer based gain control, a pushbutton for status control and one or more LEDs for displaying status of the braking system. Brake controller  10  is adapted to operate trailer brakes  13  based on sensed deceleration of the towing vehicle. Brake controller  10  includes a multi-axis inertial sensor/accelerometer  14  for sensing deceleration to the towing vehicle along a plurality of directional axes. Brake controller  10  includes an input  15  from the towing vehicle brake light circuit for determining when the vehicle brakes are applied. 
         [0019]    Brake controller  10  includes a microprocessor or microcontroller  16  that is responsive to the sensed deceleration to supply power to trailer brakes  13  that may be a function of the sensed deceleration. Microcontroller  16  is adapted to execute one or more algorithms stored in an associated memory such as RAM and/or ROM  17  to facilitate measurement and/or validation of direction and/or calculation of acceleration and/or braking force in a forward or towing direction. 
         [0020]    Known controllers of this type need to be compensated for artefacts as discussed above. The known controllers also have been required to be installed in a predetermined orientation to allow braking force to be measured along a single axis or alternatively have needed to be manually compensated for mounting orientation relative to the towing vehicle, or alternatively may have an increased sensitivity to lateral acceleration. 
         [0021]    Described below are an acceleration model and algorithms that may facilitate measurement and/or validation of direction and/or consequent calculation of deceleration and braking force in a forward direction to reduce or remove effects of lateral acceleration and/or other artefacts of a measurement process. 
       Acceleration Model 
       [0022]    In the following discussion, there may be three different reference frames with different basis vectors. In an external reference frame three directions may be denoted, namely X ext ={{right arrow over (x)} ext , {right arrow over (y)} ext , {right arrow over (z)} ext }. 
         [0023]    In the towing vehicle&#39;s reference frame, three directions may be denoted, namely) X car ={{right arrow over (x)} car , {right arrow over (y)} car , {right arrow over (z)} car }. 
         [0024]    In an accelerometer reference frame, the basis may be denoted as X acc ={{right arrow over (x)}, {right arrow over (y)}, {right arrow over (z)}}. Conversion between the reference frames may be performed by rotation matrices Q car : X ext →X car  and Q acc : X car →X acc . In the following discussion, it is assumed that Q car  may vary with time, and that Q acc  is fixed but unknown. 
         [0025]    Measurement from the accelerometer may be modelled as: 
         [0000]        {right arrow over (a)}   total   ={right arrow over (a)}   f   +{right arrow over (g)}+{right arrow over (a)}   c   +{right arrow over (a)}   l   +{right arrow over (n)}+{right arrow over (o)}   (1)
 
         [0000]    wherein:
 
{right arrow over (a)} f =A desired . {right arrow over (x)} car  denotes acceleration due to braking or acceleration of a vehicle/trailer system and A desired  denotes desired input to a braking control. During normal braking A desired  may be expected to lie in the range 0≦A desired 
 
         [0000]    
       
         
           
             
               ≤ 
               
                 4.5 
                  
                 
                   m 
                   
                     s 
                     2 
                   
                 
               
             
             ; 
           
         
       
     
         [0000]    {right arrow over (g)} denotes acceleration due to gravity and is approximately equal to 9.81 
         [0000]    
       
         
           
             
               
                 
                   m 
                   
                     s 
                     2 
                   
                 
                 · 
                 
                   
                     z 
                     → 
                   
                   ext 
                 
               
               ≈ 
               
                 9.81 
                  
                 
                   
                     m 
                     
                       s 
                       2 
                     
                   
                   · 
                   
                     
                       z 
                       → 
                     
                     car 
                   
                 
               
             
             ; 
           
         
       
     
         [0000]    {right arrow over (a)} c  denotes centripetal acceleration of the vehicle and is equal to 
         [0000]    
       
         
           
             
               
                 v 
                 2 
               
               r 
             
             · 
             
               
                 
                   y 
                   → 
                 
                 car 
               
               . 
             
           
         
       
     
         [0000]    Based on a sample of curves including radius r equal to 10 m and velocity v equal to 
         [0000]    
       
         
           
             2 
              
             
               m 
               s 
             
           
         
       
     
         [0000]    for a slow suburban corner, and radius r equal to 200 m and velocity v equal to 
         [0000]    
       
         
           
             30 
              
             
               m 
               s 
             
           
         
       
     
         [0000]    for a wide rural curve, {right arrow over (a)} c  may be expected to lie in the range 
         [0000]    
       
         
           
             
               0 
               ≤ 
               
                  
                 
                   
                     a 
                     → 
                   
                   c 
                 
                  
               
               ≤ 
               
                 4.5 
                  
                 
                   m 
                   
                     s 
                     2 
                   
                 
               
             
             ; 
           
         
       
     
         [0000]    {right arrow over (a)} l  denotes acceleration due to changes in roll and pitch of the vehicle and uneven road surface. It may be in any direction, depending on the kind of movement and the location of the accelerometer relative to the towing vehicle. This may be expected to include transients with ∥{right arrow over (a)} l |&gt;&gt;∥{right arrow over (g)}∥. Duration of transients may be expected to be less than 200 ms. This may be expected to increase with speed. Some transients may also occur due to engine noise, passenger movement and/or driver movement. Acceleration {right arrow over (a)} c  will likely have zero mean over periods of less than 1 second;
 
{right arrow over (n)} denotes measurement noise of the accelerometer. This is expected to be independently Gaussian distributed in each axis with a Brownian spectrum. The level of the noise is generally also specified in the data-sheet for the accelerometer; and
 
{right arrow over (o)} denotes offset of the accelerometer. This may generally be non-zero and is composed of two main contributions, namely: raw offset, which may be relatively constant in X acc  and gain non-linearity and cross-axis sensitivity acting on gravity, which may vary with Q car .
 
         [0026]      FIG. 2  shows a braking system and brake controller with a calibration algorithm for calculating the aforesaid desired value of acceleration (A desired ) from a combined acceleration signal ({right arrow over (a)} total ). The calibration algorithm may derive a scalar value A desired  from the aforesaid measurement {right arrow over (a)} total . The calibration algorithm may include two steps as described below, namely offset component removal and scalar conversion. 
       Offset Component Removal 
       [0027]    The first step is to remove accelerator offset components including components which relate to x-axis sensitivity to gravity. Since {right arrow over (a)} c , {right arrow over (a)} l , and {right arrow over (n)} are zero-mean processes with relatively high bandwidths, a local average {right arrow over (μ)} local  of measured acceleration ({right arrow over (a)} total ) may be a good estimator of {right arrow over (g)}+{right arrow over (o)} if Q car  is constant over the averaging period, so that {right arrow over (g)}+{right arrow over (o)}−{right arrow over (μ)} local ≈{right arrow over (0)}. 
         [0028]    In many circumstances, this assumption can be made for on-road travel and a high pass filter may be applied with cut-off above the bandwidth of {right arrow over (a)} c , {right arrow over (a)} 1 , and {right arrow over (n)}, but below the bandwidth of the transformation matrix Q car , to reduce or remove the offset components. 
         [0029]    However, this has a potential to cause problems such as drift when a constant level of braking is applied, due to a component of braking acceleration falling outside of the bandwidth of the high pass filter. To avoid or at least minimize this problem a high pass filter may be implemented as shown in  FIG. 2 . 
         [0030]    Measured acceleration may be continuously averaged to estimate local average {right arrow over (μ)} local , and then frozen at the start of braking to prevent drift due to direct current (DC) component of braking. The steps of the process are described below. 
         [0031]    Referring to  FIG. 2 , total acceleration  20  consists of a summation of Trailer+vehicle Brakes block  21 , which corresponds to acceleration {right arrow over (a)} f  in equation (1), plus impairments block  22  which includes non-braking components of acceleration in equation (1). Total acceleration  20  is measured by the accelerometer in acceleration measurement block  23 . 
         [0032]    The output of acceleration measurement block  23  ({right arrow over (a)} total ) is filtered with low-pass filter  24  to provide an estimate {right arrow over (μ)} local , of {right arrow over (g)}+{right arrow over (o)}. The bandwidth of low-pass filter  24  is less than 1 Hz to reject short-term variations in Q car  due to change in road camber and/or slope. 
         [0033]    The filtered acceleration is then gated at gate  25  via brake light signal  26 . When there is no brake light signal  26  {right arrow over (μ)} local  is allowed to vary. When brake light signal  26  is asserted, then low pass filter  24  continues to operate, but its output will be discarded at gate  25 . Only the last estimate of {right arrow over (μ)} local  from before the brake lights were asserted is used. Subtracting the last estimate of {right arrow over (μ)} local  provides low pass filtered data in acceleration before braking block  27 . 
         [0034]    The low-pass filtered data from block ({right arrow over (μ)} local ) is then subtracted from the output of acceleration measurement block  23  to form an implicit high-pass filter. The output of this implicit high-pass filter provides an unbiased estimate  28  of {right arrow over (a)} total  with biases or constant offset components removed. 
         [0035]    The offset removal step produces a vector output {right arrow over (a)} total -{right arrow over (μ)} local , and is followed by a scalar conversion step which may produce a scalar estimate of acceleration Â desired . 
       Scalar Conversion 
       [0036]    In order to estimate a forward component of the acceleration common, Euclidean vector projection using the Euclidean inner product (also known as dot product) may be used to estimate A desired  as follows: 
         [0000]        Â   desired   ={right arrow over (x)}   car ·( {right arrow over (a)}   total −{right arrow over (μ)} local )  (2)
 
         [0000]    wherein the operatorS is the Euclidean inner product and ∥{right arrow over (x)} car ∥=1. 
         [0037]    Substituting in equation (1), with its associated definitions, we have: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       A 
                       ^ 
                     
                     desired 
                   
                   = 
                   
                     
                       
                         
                           x 
                           → 
                         
                         car 
                       
                       · 
                       
                         ( 
                         
                           
                             
                               A 
                               desired 
                             
                             · 
                             
                               
                                 x 
                                 → 
                               
                               car 
                             
                           
                           + 
                           
                             
                               
                                 v 
                                 2 
                               
                               r 
                             
                             · 
                             
                               
                                 y 
                                 → 
                               
                               car 
                             
                           
                         
                         ) 
                       
                     
                     + 
                     
                       
                         
                           x 
                           → 
                         
                         car 
                       
                       · 
                       
                         ( 
                         
                           
                             
                               a 
                               → 
                             
                             l 
                           
                           + 
                           
                             n 
                             → 
                           
                         
                         ) 
                       
                     
                     + 
                     
                       
                         
                           x 
                           → 
                         
                         car 
                       
                       · 
                       
                         ( 
                         
                           
                             g 
                             → 
                           
                           + 
                           
                             o 
                             → 
                           
                           - 
                           
                             
                               μ 
                               → 
                             
                             local 
                           
                         
                         ) 
                       
                     
                   
                 
               
               
                 
                   ( 
                   3 
                   ) 
                 
               
             
           
         
       
     
         [0038]    Since X car  is orthonormal, we know that {right arrow over (x)} car ·{right arrow over (x)} car −1, {right arrow over (x)} car ·{right arrow over (y)} car =0 and {right arrow over (x)} car ·{right arrow over (y)} car =0, so that the centripetal acceleration is eliminated. 
         [0000]        Â   desired   =A   desired   +{right arrow over (x)}   car ·( {right arrow over (a)}   l   +{right arrow over (n)} )+ {right arrow over (x)}   car ·( {right arrow over (g)}+{right arrow over (o)}−{right arrow over (μ)}   local )≈ A   desired   +{right arrow over (x)}   car ·( {right arrow over (a)}   l   +{right arrow over (n)} )  (4)
 
         [0039]    In addition and assuming that and if are isotropic, the RMS magnitude of {right arrow over (x)} car ·({right arrow over (a)} l +{right arrow over (n)}) will be reduced by a factor of √{square root over (3)} from ∥{right arrow over (a)} l +{right arrow over (n)}∥ due to reduction in dimension. Based on empirical vibration profiles (e.g. as specified in MIL-STD 810G Table 514.6C-VI), the assumption of isotropic vibration is likely to be a worst-case assumption. 
       Algorithm for Calculating Calibration Coefficients 
       [0040]    In order to perform calculations for estimating A desired  from a measurement of {right arrow over (a)} total ) the following values are required: 
         [0000]    Offset vector: {right arrow over (μ)} local  
 
Direction vector: {right arrow over (x)} car  
 
         [0041]    Since all estimation data is acquired in the X acc  basis, with Q car  and Q acc  unknown, the algorithm for acquiring offset and direction vectors may also operate in this basis. 
         [0042]    The algorithm for measuring offset vector {right arrow over (μ)} local  may comprise a simple low-pass filter as shown in  FIG. 2 . 
         [0043]    Two algorithms for measuring {right arrow over (x)} car  are suggested below. The algorithms have in common that they rely on feedback from a brake output and/or a brake light input to accelerometer measurement. They are also able to determine if a calibrated direction is valid in the presence of impairments during calibration, as given in equation (1). 
         [0044]    The algorithms differ in the signal that they generate and the method used to calculate direction from feedback. The first algorithm is suitable for single shot calibration and is described below under the heading FEEDBACK CALIBRATION WITH SPECIAL SIGNAL. 
         [0045]    The second algorithm may be suitable for continuous calibration or checking of calibration and is described below under the heading FEEDBACK CALIBRATION USING NORMAL BRAKING SIGNALS. 
         [0000]    Feedback Calibration with Special Signal 
         [0046]    Based on equation (1), the only component of the measured signal that depends significantly on the output signal is {right arrow over (a)} f  A desired ·{right arrow over (x)} car . Therefore, a good estimate {right arrow over (x)} car  may be obtained by correlating the measured signal with the input signal. 
         [0047]    However, since the braking force is always greater than 0, the braking acceleration always has a non-zero mean, and may be confused with other non-zero mean signals such as {right arrow over (g)} and {right arrow over (o)}. Therefore the DC component of the correlation should be ignored. This may be implemented by superimposing a zero-mean test or reference signal on a DC braking component and then correlating the feedback with the test or reference signal. The zero-mean signal will ensure that the DC component of the measurement is removed during the correlation process. 
         [0048]    Any zero-mean test or reference signal may be used for this purpose but a higher computational efficiency may be achieved by using an offset sinusoidal signal. A signal processing flow chart for this is shown in  FIG. 3 . In  FIG. 3 , a sinusoidal signal is generated as the real part of the output of complex-valued numerically controlled oscillator (NCO)  30 . NCO  30  may be implemented via a numerically simple operation, 
         [0000]    
       
         
           
             
               
                 
                   A 
                   NCO 
                 
                  
                 
                   
                     ∏ 
                     
                       i 
                       = 
                       0 
                     
                     
                       t 
                       
                         t 
                         0 
                       
                     
                   
                    
                   
                       
                   
                    
                   
                      
                     
                       j 
                        
                       
                           
                       
                        
                       2 
                        
                       
                           
                       
                        
                       π 
                        
                       
                         f 
                         
                           f 
                           s 
                         
                       
                     
                   
                 
               
               = 
               
                 
                   A 
                   NCO 
                 
                  
                 
                    
                   
                     j 
                      
                     
                         
                     
                      
                     2 
                      
                     
                         
                     
                      
                     π 
                      
                     
                         
                     
                      
                     ft 
                   
                 
               
             
             , 
           
         
       
     
         [0000]    with the accumulator normalised to a magnitude of 1 at intervals in order to remove cumulative quantisation error. 
         [0049]    A DC offset component  31  may be added to the output of NCO  30  to ensure that the braking signal  32  is non-negative (i.e. ∥DC∥≧A NCO ) so that no zero-crossings in the braking signal  32  are sent to Trailer Brakes  33 . 
         [0050]    As described above with reference to  FIG. 2 , total acceleration ({right arrow over (a)} total ) is measured by the accelerometer in acceleration measurement block  23  (refer equation (1)). For numerical stability, the signal is then high-pass filtered to remove the gravity component (which is much larger than the feedback signal component) as described with reference to  FIG. 2 . 
         [0051]    The filtered real vector measurement  34  is then multiplied in complex mixer stage  35  with the conjugate of the complex scalar output of NCO  30 . The output of complex mixer stage  35  is accumulated in accumulator block  36  until it passes a confidence threshold provided via confidence algorithm block  37 . This output of confidence algorithm block  37  is then converted to a usable Forward Direction Vector in block  38 . 
         [0052]    The trailer brakes are assumed to be a linear time invariant (LTI) system. Basic physical analysis (not presented here) suggests that this may be a suitable first-order approximation. 
         [0053]    As in  FIG. 2 , Impairments block  22  comprises non-braking components of acceleration in equation (1). Low pass filter  24  also has the same implementation and function as in  FIG. 2 . 
         [0054]    Complex mixer stage  35  combined with accumulator block  36  remove the effect of LTI group delays (e.g. introduced by springs in the towing vehicle), by converting to a phase offset as shown in equation (5) below. 
         [0000]        e   j2πft ·    e   j2πf(t-t     0     )   = e   j2πft   ·e   −j2πf(t-t     0     )   =e   j2πft     0     (5)
 
         [0055]    Accumulator block  36  sums the output of complex mixer stage  35  to obtain an estimate: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       estimate 
                       → 
                     
                      
                     
                       ( 
                       t 
                       ) 
                     
                   
                   = 
                   
                     
                       ∑ 
                       
                         i 
                         = 
                         0 
                       
                       
                         t 
                         
                           t 
                           0 
                         
                       
                     
                      
                     
                         
                     
                      
                     
                       
                         
                           acceleration 
                           l 
                         
                         → 
                       
                       · 
                       
                          
                         
                           
                             
                               - 
                                
                             
                             · 
                             2 
                           
                            
                           
                               
                           
                            
                           π 
                            
                           
                               
                           
                            
                           
                             f 
                             · 
                             t 
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   6 
                   ) 
                 
               
             
           
         
       
     
         [0056]    A threshold based on noise level may be used to determine when calibration is complete. Assuming a measurement noise distribution independent of time and an LTI braking system, then by using the Central Limit theorem it may be shown that the statistical distribution of this estimation will converge to: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       estimate 
                       → 
                     
                      
                     
                       ( 
                       t 
                       ) 
                     
                   
                   = 
                   
                     ∼ 
                     
                        
                       
                         ( 
                         
                           
                             
                               t 
                               
                                 t 
                                 0 
                               
                             
                              
                             G 
                              
                             
                               F 
                               → 
                             
                           
                           , 
                           
                             
                               t 
                               
                                 t 
                                 0 
                               
                             
                              
                             
                               σ 
                               0 
                               2 
                             
                           
                         
                         ) 
                       
                     
                   
                 
               
               
                 
                   ( 
                   7 
                   ) 
                 
               
             
           
         
       
     
         [0000]    wherein:
 
         ({right arrow over (μ)}, σ 2 ) is a multivariate complex Gaussian distribution with mean {right arrow over (μ)} and uniform variance {right arrow over (μ)};
 
         [0000]    
       
         
           
             t 
             
               t 
               0 
             
           
         
       
     
         [0000]    is the number or samples cumulated. Note that the coefficient 
         [0000]    
       
         
           
             t 
             
               t 
               0 
             
           
         
       
     
         [0000]    is not an exact value, but a reasonable estimate of the coefficient of σ 2 , estimated using an assumption of white noise.
 
σ 0  is the root-mean-square (RMS) noise;
 
G is a complex gain factor due to time delays (converted to a complex phase per equation (4)), trailer gain and the level of the output; and
 
{right arrow over (F)} is the forward direction vector.
 
         [0057]    Confidence Algorithm block  37  may then determine when accumulator block  36  has reached a desired accuracy based on the comparison 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                          
                         
                           
                             estimate 
                             → 
                           
                            
                           
                             ( 
                             t 
                             ) 
                           
                         
                          
                       
                       2 
                     
                     &gt; 
                     
                       
                         
                           
                             ( 
                             
                               3 
                                
                               
                                   
                               
                                
                               
                                 σ 
                                 ^ 
                               
                             
                             ) 
                           
                           2 
                         
                         
                           
                             tan 
                             2 
                           
                            
                           
                             ( 
                             
                               θ 
                               limit 
                             
                             ) 
                           
                         
                       
                       · 
                       
                         n 
                         samples 
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   8 
                   ) 
                 
               
             
           
         
       
     
         [0000]    wherein {circumflex over (σ)} is the estimated signal variance, which is calculated from a sample set prior to calibration or from a pre-calculated value based on worst-case road noise, and θ limit  is the target angular accuracy of the calculation. 
         [0058]    The final step is processed in Forward Direction Vector block  38  to remove phase offset from accumulator  36  and to convert to a real vector. This real vector is the estimate of {right arrow over (x)} car  as required by equation (2) for calibration. 
       Feedback Calibration Using Normal Braking Signals 
       [0059]    As noted above, the DC offset of normal braking signals may be difficult to distinguish from other DC offsets (e.g. gravity, accelerometer offset). This means that calibration based on normal braking as described above may be difficult to realize in practice. To address this problem an on-line calibration algorithm may be used to perform measurements on normal braking. The on-line calibration algorithm may use a measure of change of braking at the start of a braking period to generate a single braking direction estimate per braking event. Such a measure may effectively be a single estimate of cross correlation between a brake control signal and deceleration of the vehicle. The on-line calibration algorithm may use a statistical analysis algorithm to combine the estimates to provide a more accurate estimate or to provide a measure of confidence in the estimates. 
       On-Line Calibration Algorithm 
       [0060]      FIG. 4  shows a braking system and brake controller with an algorithm for performing on-line calibration. 
         [0061]    Normal Braking Algorithm block  40  is a placeholder for the algorithm used to control the Trailer+vehicle brakes block  21 . Normal Braking Algorithm block  40  may include a fall-back timed algorithm if no direction calibration is available or a normal inertial feedback algorithm if this calibration algorithm is being used as a check. 
         [0062]    Trailer+vehicle Brakes block  21 , Impairments block  22  and Acceleration Measurement block  23  blocks are similar to corresponding numbered blocks described with reference to  FIG. 2 . 
         [0063]    Low pass filter  41  may have a bandwidth between 1 Hz and 5 Hz. This bandwidth is higher than low pass filter  24  for {right arrow over (μ)} local  to reduce filter delay and provide a faster estimate of change in acceleration. 
         [0064]    A delay gate may be used to select direction samples for on-line calibration. Switch  42  may be controlled by brake light input  43 . The output of low pass filter  41  is normally stored in acceleration before braking block  43 , but immediately after braking, the output will be discarded for a time t delay +t phase , wherein t delay  is a worst-case expected delay on the trailer brakes (approximately 0.5 s for slack in couplings and suspension) and t phase  is the group delay of low pass filter block  41 . After this time, one sample of filter output will be stored in acceleration at start of braking block  44 . Further samples will be discarded until the end of braking. The difference between blocks  43  and  44  may provide a sample of acceleration in the direction of braking. The low pass filter after the delay gate may also be implemented as a discrete-time integrator (summation). 
         [0065]    A one dimensional weighted histogram of acceleration may be generated and used to determine azimuth. Vector basis block  45  represents a 2-D vector basis embedded in X acc . It may be derived by starting with an estimate of gravity direction vector {circumflex over ({right arrow over (Z)} ext , generated in gravity estimate block  46  from a long term average of the accelerometer output. The two basis vectors are both orthogonal to {circumflex over ({right arrow over (Z)} ext  and may be generated using a Gram-Schmidt process. 
         [0066]    The output of vector basis block  45  is subjected to a convert to angle operation in block  47 . Convert to angle block  47  may include a simple atan2 operation on the measurement, projected into the 2-D vector basis. For small microcontrollers that may be used in these applications, the algorithms presented in X. Girones, C. Julia, and D. Puig, “Full quadrant approximation for the arctangent function,” IEEE Signal Processing Magazine, vol. 30, no. 1, pp. 130-135, January 2013 may be suitable. 
         [0067]    The output of convert to angle block  47  is subjected to a binning step in block  48 . The “binning” step may consist of adding a score based on magnitude of the acceleration measurement to a histogram bin corresponding to the calculated angle of the vector. Due to a possibility of braking in reverse, the bins may be wrapped on a half-interval [0, π) instead of over the whole angular range. 
         [0068]    The output of binning block  48  is subjected to confidence algorithm block  49 . Confidence algorithm block  49  may determine when the angular measurement is suitable for use, This may be based on peak bin (interpolated), compared with mean bin. 
         [0069]    The output of confidence algorithm step  49  is subjected to Forward Direction Vector block  50 . Forward Direction Vector block  50  may convert angle estimation to a vector estimating {right arrow over (x)} car  X acc  by converting from the test vector basis to X acc . 
         [0070]    As an alternative to the operations of [00064] to [00068], a modified Kalman filter may be used to determine a forward direction vector as follows, Input to the filter may be the difference vectors of [00063] normalised as follows: 
         [0000]    
       
         
           
             
               Δ 
                
               
                   
               
                
               
                 
                   a 
                   ^ 
                 
                 meas 
               
             
             = 
             
               
                 Δ 
                  
                 
                     
                 
                  
                 
                   
                     a 
                     ^ 
                   
                   meas 
                 
               
               
                  
                 
                   Δ 
                    
                   
                     
                       a 
                       ^ 
                     
                     meas 
                   
                 
                  
               
             
           
         
       
     
         [0000]    Braking measurements taken while the vehicle is braking may by comparison with the Kalman state estimate be as follows: 
         [0000]    
       
         
           
             
               Δ 
                
               
                   
               
                
               
                 
                   a 
                   ^ 
                 
                 in 
               
             
             = 
             
               { 
               
                 
                   
                     
                       
                         Δ 
                          
                         
                           
                             a 
                             ^ 
                           
                           meas 
                         
                          
                         
                             
                         
                          
                         if 
                          
                         
                             
                         
                          
                         
                            
                           
                             
                               Δ 
                                
                               
                                 
                                   a 
                                   ^ 
                                 
                                 meas 
                               
                             
                             - 
                             
                               k 
                               → 
                             
                           
                            
                         
                       
                       ≤ 
                       
                          
                         
                           
                             Δ 
                              
                             
                               
                                 a 
                                 ^ 
                               
                               meas 
                             
                           
                           + 
                           
                             k 
                             → 
                           
                         
                          
                       
                     
                   
                 
                 
                   
                     
                       
                         
                           - 
                           Δ 
                         
                          
                         
                           
                             a 
                             ^ 
                           
                           meas 
                         
                          
                         
                             
                         
                          
                         if 
                          
                         
                             
                         
                          
                         
                            
                           
                             
                               Δ 
                                
                               
                                 
                                   a 
                                   ^ 
                                 
                                 meas 
                               
                             
                             - 
                             
                               k 
                               → 
                             
                           
                            
                         
                       
                       &gt; 
                       
                          
                         
                           
                             Δ 
                              
                             
                               
                                 a 
                                 ^ 
                               
                               meas 
                             
                           
                           + 
                           
                             k 
                             → 
                           
                         
                          
                       
                     
                   
                 
               
             
           
         
       
     
         [0000]    The sample covariance input may be calculated as inversely proportional to the magnitude of the measurement ∥Δ{right arrow over (a)} meas ∥. The Kalman filter may be calculated according its normal definitions (refer R. E. Kalman, “A New Approach to Linear Filtering and Prediction Problems”, Transactions of the ASME—Journal of Basic Engineering, vol 82, series D, pp. 35-45, 1960) except that for ease of implementation the state estimate and state covariance estimate may be forced to be fully diagonal and the state estimate may be normalized to a vector magnitude of 1 after each step and the estimated state covariance corrected by the same factor. The estimated state vector output may be an estimate of the forward direction vector, and the state covariance may be an estimate of the accuracy of the forward direction vector. The process covariance input may be decreased to allow more accurate estimation, or increased to allow rapid convergence of the filter when the unit may have been moved. 
         [0071]    Finally, it is to be understood that various alterations, modifications and/or additions may be introduced into the constructions and arrangements of parts previously described without departing from the spirit or ambit of the invention.