Abstract:
A method for compensation of phase delays that occur in discrete sampling of an analog output signal (U S ) has the steps of subjecting the output signal (U S ) to signal processing by an anti-aliasing filter and then by a sampling member to obtain a sampling signal (U A ) that has a sampling period (T), compensating a phase delay of the sampling signal caused by the sampling member, taking into account the sampling signal of a preceding sampling period to obtain a signal (U F,K ), and compensating of the phase delay of the sampling signal caused by the anti-aliasing filter, taking into account a filter time constant (T F ) of the anti-aliasing filter, a sampling period (T A ) of the sampling member, and the sampling signal of the preceding sampling period, to obtain a signal (U SK ).

Description:
BACKGROUND OF THE INVENTION 
     The present invention relates to a method and an arrangement for compensation of phase delays[, as generically defined by the preambles to claims 1 and 8, respectively]. 
     In numerous technical applications, there is a need for converting an analog sensor signal into a digital signal. Because of the individual members of a signal detection chain used for this purpose, delays occur between the original analog signal and the digital signal that is to be further processed. 
     From German Patent Disclosure DE-OS 195 14 410, a device for detecting a pulsating variable is known, in which, to assure that a signal without oscillation would be obtained, an electronic filter is provided, which is constructed as an analog circuit and has at least one first member for differentiation and delay and one second member for multiplication of the differentiated and delayed signal, as well as a subtraction stage, in which the filtered signal can be subtracted from the unfiltered signal in order to generate a smoothed output signal. The object of this reference is to smooth a pulsating input signal; it does not address signal errors that occur from phase delays in a signal detection chain for converting a digital signal into an analog signal. 
     SUMMARY OF THE INVENTION 
     The object of the invention is a compensation, to be done in a simple way, that is, at the least possible expense for circuitry, of phase delays which occur in discrete-time sampling of an analog output signal and which lead to an error in the sampled digital signal. 
     According to the invention, effective, easy to achieve compensation of phase delays that occur in discrete-time sampling of an analog output signal is now made available. Phase delays that result from signal processing by an anti-aliasing filter as well as a sampling member are compensated for according to the invention in reverse order of their creation. 
     Expediently, the case of a further phase delay of the sampling signal, caused by an idle time, in particular an idle time which occurs in further processing of the sampling signal and by which an idle-time-delayed sampling signal is generated, a compensation of the phase delay of the sampling signal, caused by the idle time, is performed taking into account the idle time and the sampling period of the sampling member, to obtain an idle-time-compensated sampling signal, and the idle-time-compensated sampling signal is subjected to the phase shift compensations of claim 1 for the sake of further phase compensation. Thus in an effective, phase delays which occur between the sampling of the signal and its re-use (for instance in a regulator or in a correction function), can be compensated for. 
     Expediently, a phase delay caused by the sampling member, which delay can be represented by the equation          ϕ   A     =       ω   ·     1   2     ·     T   A       =         -   2     ·   π   ·   f   ·       T   A     2       -     π   ·   f   ·     T   A                                  
     in which f is the signal frequency and T A  is the sampling period of the sampling member, is corrected by means of a linear extrapolation using a correction value of the form −Y k,2 =X k +½·(x k −x k−1 ), in which x k−1 , x k  are values of the sampling signal in successive sampling periods T T,k−1 , T T,k . This correction can be performed by computer at relatively little effort or expense and represents a very good compensation for typical phase delays that occur in sampling members. 
     Expediently as well, a phase delay which is caused by the anti-aliasing filter and can be represented in the form φ F =−arctan(2·π·f·T F ), in which T F  is the filter time constant of the anti-aliasing filter, is corrected by a correction value of the form y k,3 =x k +T F /T A ·(x k −x k−1 ). This correction can also be performed inexpensively, and compensates with sufficient accuracy for a phase delay caused by an anti-aliasing filter. 
     In an advantageous embodiment of the invention, furthermore, a phase delay which is caused by the idle time T T  and can be represented in the form φ V =−arctan(2πfT F )−πfT A −2πfT T  is corrected by a correction value of the form          y     k   ,   1       =         x   k          (     1   +       T   T       T   A         )       -       x     k   -   1       ·       T   T       T   A                                  
     This clearly means that the error occurring during the idle time T T  is imposed on the sampling signal with an inverse sign in the next sampling step and thus is corrected. This compensation likewise furnishes good correction results and can be performed in a simple way. 
     Expediently, the individual phase delay compensations are performed successively, so that in all, for correcting a sampling signal during one sampling period, sampling signals of two or three preceding sampling periods are taken into account. 
     It proves to be advantageous that the individual phase delay compensations perform in reverse order from the order in which they occurred, so that partly compensated signals are also available. 
     In a preferred embodiment of the arrangement according to the invention for compensation for phase delays, the means for compensation of the phase delay caused by the sampling member, the anti-aliasing filter, or the further processing idle time, each have three parallel signal transmission channels, in which a first signal transmission channel serves to transmit an unaltered sampling signal; a second signal transmission channel, having a multiplier member, serves to transmit a sampling signal multiplied by a factor, and a third signal transmission channel, having a delay member and a multiplier member, serves to transmit a sampling signal, delayed by one sampling period and multiplied by a factor, to a summation member. 
     It proves to be expedient that the means for compensation of the phase delay caused by the sampling member, the anti-aliasing filter, or the further processing idle time, are connected in series with one another in such a way that in all, a phase-compensated output signal U S,K  is obtained, taking into account the uncompensated sampling signals of the preceding three sampling periods. 
     In a further preferred embodied of the arrangement of the invention, this arrangement has three series-connected delay members z −1 , multiplier members connected to them and parallel to one another, and a summation member for adding the output signals of the multiplier members to achieve a phase compensation for obtaining a phase-compensated sampling signal U S,K  of the form 
     
       
           U   S,K ( k )= A·U   T ( k )+ B·U   T ( k −1)+ C·U   T ( k −2)+ D·U   T ( k −3) 
       
     
     in which U T (k−i), where i=0, 1, 2, 3, represents the uncompensated sampling signal U T  delayed by i sampling periods, and A, B, C, D are system constants of the signal sampling path. Thus at little computational effort, it is possible to achieve the phase compensation of the invention, since the system constants A, B, C, D are predeterminable and do not have to be regularly re-calculated. 
     In a further preferred feature of the arrangement of the invention, this arrangement has means for turning off the phase compensation in the event that a change in the input signal within one sampling period exceeds a threshold value. As a result, severe fluctuations in the compensated signal in the event of very fast signal changes at the input to the compensation can effectively be prevented. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     The present invention will not be explained in detail in conjunction with the accompanying drawing. 
     FIG. 1 is a block circuit diagram of a signal detection chain for sampling an analog sensor signal; 
     FIG. 2 is a graph showing a phase delay that occurs by sampling with a sampling member; 
     FIG. 3 is a graph showing a signal delay that occurs in further processing because of an idle time; 
     FIG. 4 is a graph showing the compensation of the sampling delay provided according to the invention; 
     FIG. 5 is a block diagram illustrating the structure of the entire phase compensation process; 
     FIG. 6 shows a preferred arrangement for computational performance of the phase compensation of the invention; 
     FIG. 7 shows a further preferred arrangement for computational performance of the phase compensation of the invention; 
     FIG. 8 shows the course of a battery voltage during an operation of starting a motor vehicle; 
     FIG. 9 shows the course of the battery voltage of FIG. 8 after a phase compensation of the invention; 
     FIG. 10 shows a corresponding current course with and without the phase compensation of the invention; 
     FIG. 11 shows a simulated phase response of a signal path which has an anti-aliasing filter and a sampling member, without the phase compensation of the invention; and 
     FIG. 12 shows a simulated phase response of a signal path which has an anti-aliasing filter and a sampling member, with the phase compensation of the invention. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     The individual members of a signal detection chain, which is used for converting an analog sensor output signal U S  into a digital signal U T , are shown in FIG.  1 . 
     A sensor  1  generates the output signal U S . Reference numeral  2  indicates an anti-aliasing filter, which serves to prevent aliasing effects from an ensuing sampling of the signal. The anti-aliasing filter is typically embodied as a low-pass filter. In order to meet the condition of the sampling theorem, the relationship f g &lt;½·f A  must apply, in which f g  is the limit frequency of the anti-aliasing filter  2  embodied as a low-pass filter, and f A  is the sampling frequency of the following sampling member  3 . In the simplest case, this low-pass filter is a PT 1  member (proportional-idle-time member) with the transfer function            G   TP          (   s   )       =     1     1   +     s   ·     T   F                                  
     In this equation, s is the complex frequency variable s=σ+j omega, and T F  is the filter time constant. The phase delay of such a low-pass filter is φ F =−arctan(2·π·f·T F ). The output signal of the anti-aliasing filter  2  is designated as U F . 
     In the sampling member or sample member  3  downstream of the anti-aliasing filter  2 , the signal values are sampled at discrete instants t=k·T A , in which k=0, 1, 2, 3, . . . , and T A  is the sampling period of the sampling member  3 . The output signal of the sampling member is marked U A . The principle of the sampling is illustrated in FIG.  2 . It can be seen that the mean voltage  U   A  of the signal U A  is delayed relative to U F  by half the sampling period. The phase delay therefore becomes          ϕ   A     =         -   ω     ·     1   2     ·     T   A       =         -   2     ·   π   ·   f   ·       T   A     2       =       -   π     ·   f   ·       T   A     .                                  
     The signal U A  represents the actual digital signal intended for further processing. However, because of delays between the sampling task and a downstream task, such as a regulator task, a time lag occurs between the sampling and the re-use of the signal value U A  (this is known as the idle time between the sampling and a downstream function). This phase delay is φ T =−ω·T T =−2·π·f·T T . The signal (work signal) delayed by the idle time that finally results is designated as U T  in FIG.  1 . The portion of the signal detection path along which this phase delay occurs is symbolically represented by reference numeral  4 . 
     The signal delay in the sensor output signal U S  that occurs because of the signal detection path  2 ,  3 ,  4  therefore amounts in total φ V =−arctan(2πfT F )−πfT A −2πfT T . 
     Even relatively slight phase delays have a major effect on the error between the analog signal U S  and the work signal U T . If 
     
       
           U   S ( t )= Û   S ·sin(ω t ), 
       
     
     then 
     
       
           U   T ( t )= Û   T ·sin(ω t−φ   V ). 
       
     
     û S  and û T  are the amplitudes of the respective signals U S  and U T . 
     The error becomes 
     
       
           U   e ( t )= Û   S ·sin(ω t )− Û   T ·sin(ω t−φ   V ). 
       
     
     To simplify, a slight signal damping can be assumed, so that û T =û S  can be set. It thus follows that 
     
       
           U   e ( t )= Û   S ·[sin(ω t )−sin(ω t−φ   V )]=2 ·Û   S ·sin(φ V /2)·cos(ω t−φ   V /2). 
       
     
     The amplitude of the error is therefore determined by the signal amplitude û S  and the phase delay φ V . However, a reduction in the error can be done only by reducing the phase delay. Because of limited computation power in the digital processor system, however, this is often only inadequately possible. 
     The invention seeks to compensate for the incident phase delays in the simplest possible way. 
     According to the invention, the compensations for filtering, sampling and idle time are integrated into the signal path in the reverse order of their creation (see FIG.  5 ). Therefore a compensation of the idle time occurring in the further processing of the signal is treated first. It would be possible, by shifting the processing process to the task of signal detection, to minimize idle times, such as interrupt latency times. However, this takes relatively great effort and expense, so that according to the invention the attempt is made to furnish a computational compensation of the phase delay caused by the idle time. The signal delay occurring in further processing because of the idle time is shown schematically in FIG.  3 . In FIG. 3, the signal values during the intervals t=k·T A  are designated as x k−1  and x k . It can be seen that a new value x k+1  becomes effective with a delay T T  (idle time). For the time T T , the previous value x k−1  is used for calculation. To compensate for the resultant errors in the next sampling step, the value x k  is corrected with the component          x     k   ,   kor       =       (       x   k     -     x     k   -   1         )     ·         T   T       T   A       .                              
     The result for the compensated signal is thus y k =x k +x k,kor , or          y   k1     =         x   k          (     1   +       T   T       T   A         )       -       x     k   -   1       ·       T   T       T   A                                  
     It can be seen that this means that the error occurring during the idle time T T  is imposed with an inverse sign in the next sampling step and is thus corrected. 
     Both the phase delay caused by the sampling and its correction will now be explained in conjunction with FIG.  4 . It can be seen from this that because of the sampling, the output signal U F  of the anti-aliasing filter  2  is delayed by the time T A /2 on average. The goal of the compensation here is, at time t, to precalculate the value for the time t+T A /2. This is expediently done by means of a linear extrapolation taking the form          s        (     t   +       T   A     2       )       ≅       s        (   t   )       +       1   2     ·       [       s        (   t   )       -     s        (     t   -     T   A       )         ]     .                                
     By means of the compensation according to the invention, the following value is output as the corrected sampled value: 
     
       
           y   k2   =x   k +½·( x   k   −x   k−1 ). 
       
     
     Finally, the compensation of the phase delay occurring from the use of an anti-aliasing filter will now be explained in detail. 
     An anti-aliasing filter embodied as a PT 1  filter has the transfer function            G   F          (   s   )       =       1     1   +     sT   F         .                            
     The transfer behavior of G F  can be compensated for by the inverse function 
     
       
           G   F   1 ( s )=1 +sT   F . 
       
     
     This continuous-time transfer function can be converted into a discrete-time differential equation: the step response of G I   F  is            g   σ          (   t   )       =              -   1            {       1   s     ·       G   F   l          (   s   )         }            g   σ          (   t   )         =              -   1            {       1   +     sT   F       s     }            g   σ          (   t   )         =              -   1            {       1   s     +     T   F       }            g   σ          (   t   )         =     1   +       T   F     ·     δ        (   t   )                                        
     Here [I −1 ] designates the inverse Laplace transform, and δ(t) is the Dirac function. The discrete-time function of g σ (t) is 
     
       
           g   σ ( kT   A )=1 +T   F ·δ( kT   A ) 
       
     
     The z transform of this function is            G   σ          (   z   )       =       z     z   -   1       +         T   F       T   A       .                              
     G σ (z) is the z transform of the transfer response [ditto]. The z transfer behavior is obtained by dividing G σ (z) by the z transform of the step function:          σ        (   z   )       =     z     z   -   1                              
     It thus follows that            G   F   1          (   z   )       =           G   σ          (   z   )         σ        (   z   )         =       1   +         z   -   1     z     ·       T   F       T   A           =           z        (     1   +       T   F       T   A         )       -       T   F       T   A         z     =       y        (   z   )         x        (   z   )                                      
     This equation can be solved for y:          y        (   z   )       =         x        (   z   )       ·     (     1   +       T   F       T   A         )       -       z     -   1       ·       T   F       T   A       ·     x        (   z   )                                  
     By retransformation to the time range, finally, the differential equation 
     
       
           y   k3   =x   k   +T   F   /T   A ·( x   k   −x   k−1 ). 
       
     
     As already noted, it is provided according to the invention that the described compensations for filtering, sampling and idle time be integrated into the signal path in the reverse order of their cause or creation. The described idle time compensation generates a signal U A k, the downstream sampling compensation generates a signal U F,K , and the ensuing filtering compensation generates the output signal U S,K  (see FIG.  5 ). 
     A block circuit diagram for achieving these compensation functions is shown in FIG.  6 . Three series-connected phase compensation switching blocks  100 ,  110 ,  120  can be seen, each of which has three parallel signal transmission channels  50 ,  51 ,  52 ;  60 ,  61 ,  62 ; and  70 ,  71 ,  72 . In them, z −1  delay members are shown, which delay an entering signal by one sampling period T A . Elements  90 - 95  are multiplier members, which perform multiplications by the various factors shown. Adding and subtracting members  10 ,  11 ,  12  are also provided. In this version of the compensation functions, the work signal U T  is first (at  100 ) supplied unchanged, multiplied by a factor T T /T A , and delayed by one sampling period and multiplied by the factor T T /T A , to the first summation element  10 . The output signal of the summation element  10 , which corresponds to the compensated signal y k1  and U A k, respectively, is supplied (at  110 ), correspondingly unchanged, multiplied by the factor ½, and delayed by one further sampling period and multiplied by a factor ½, to a second summation element  11 . The summation element  11  generates a summation signal corresponding to the compensated signals y k2 . The overall output signal is then the signal U F,K , which in turn (at  120 ) is supplied in the same way, namely unaltered, multiplied by a factor T T /T A , and delayed by a further sampling period and multiplied by the factor T T /T A , to a third adder  12 , which generates a signal corresponding to the compensated signal y k3 . The output signal of the summation element  12 , U S,K  represents the finally compensated output signal according to the invention. 
     For calculating this compensation, the following equation is thus obtained:                  U     S   ,   K            (   k   )       =                      U   T          (   k   )       ·     [       1   ,   5     +     1   ,     5   ·       T   T       T   A           +     1   ,   5          T   F       T   A         +     1   ,   5            T   T          T   F         T   A   2           ]       -                                    U   T          (     k   -   1     )       ·     [       0   ,   5     +     2   ·       T   T       T   A         +     2   ·       T   F       T   A         +     3   ,     5   ·         T   T          T   F         T   A   2             ]       +                                    U   T          (     k   -   2     )       ·     [       0   ,     5   ·       T   F       T   A           +     0   ,     5   ·       T   T       T   A           +     2   ,     5   ·         T   T          T   F         T   A   2             ]       -                                  U   T          (     k   -   3     )       ·     [     0   ,     5   ·         T   T          T   F         T   A   2           ]                                    
     The terms in brackets represent system constants of the signal detection path. The equation can therefore be shown in the following form as well: 
     
       
           U   S,K ( k )= A·U   T ( k )+ B·U   T ( k −1)+ C·U   T ( k −1)+ C·U   T ( k −3) 
       
     
     The values U T (k−l), where l=0 to 3, represent uncompensated signals U T  delayed by l sampling periods. An equation of this structure can be realized in a simple way with the circuit arrangement shown in FIG.  7 . For the sake of simplicity, delay members T A  are shown which each delay an incoming signal by one sampling period, and multiplier members  191 - 194  are shown which multiply the values U T (k−l) by the corresponding factors A, B, C, D. The signals multiplied by the factors A, B, C, D are added by one another in an adder member  30 . 
     The circuit arrangement shown in FIG. 7 proves to be highly favorable, because the requisite computation effort for performing the phase delay compensation according to the invention is very slight. All that is required is to perform signal delays and to multiply the delayed input signals by the corresponding constants A, B, C, D, dictated by the system, and to add the resultant values together. The circuit arrangement shown in FIG. 7 can be realized highly economically in either hardware or software form. 
     In the event of very fast signal changes at the input to the compensation circuit in FIG. 7, to prevent severe fluctuations from occurring in the compensated signal, the correction is turned off (switch  40 ) if the change in the input signal U T  within one sampling step exceeds a threshold value (anwdUBTmax). A comparison of the change in the input signal with the threshold value is made in a comparator  41 . 
     A typical application of the phase compensation according to the invention will now be described in detail, in conjunction with FIGS. 8-12. In a preferred embodiment, the phase delay compensation of the invention is realized in the detection of the battery voltage, for instance for an engine control unit of a common rail system. The battery voltage supplies electric actuators, among other elements, which trigger magnet valves. Fluctuations in the battery voltage causes fluctuations in the magnet valve current. To reduce this influence, a battery voltage correction is performed, which corrects the control value upward or downward depending on the current battery voltage. This correction function is severely impaired, however, by signal delays in detecting the battery voltage. This means that fluctuations in the battery voltage itself, when corrected, lead to a current fluctuation. With the compensation according to the invention as shown, this current fluctuation can be greatly minimized. Among other effects, this also leads to a smoother rail pressure course in a common rail system. 
     In FIG. 8, the battery voltage in the starting phase of a motor vehicle is plotted over time (signal U S ). A digital signal obtained by sampling (without phase compensation according to the invention) is also shown in FIG. 8 (signal U A ). 
     In FIG. 9, the signal U S  is shown together with a signal U S,K  that is phase-compensated according to the invention. It can be seen that by means of the phase compensation of the invention, a substantially more-precise approximation to the voltage output signal of the battery (U S ) is attainable. 
     In FIG. 10, a magnet valve current I is plotted over time as a function of the battery voltage courses U A  (without compensation) and U S,K  (with compensation). It can be seen that the magnet valve current furnished by the phase compensation of the invention has substantially less fluctuation. 
     With reference to FIGS. 11 and 12, the phase delay compensation of the invention will be explained further. Here, a simulation of the signals that occur in a signal detection path with an anti-aliasing filter and a sampling member has been done. A filter time constant T F  of the anti-aliasing filter of 6 ms and a sampling period T A  of the sampling member of 10 ms have been assumed. FIG. 11 shows the phase response that occurs without the phase compensation of the invention. It can be seen that even at low frequencies (beyond 1 Hz), marked phase delays occur. 
     In FIG. 12, the phase response of the signal path phase-compensated according to the invention, that is, the signal path comprising the anti-aliasing filter, sampling member, compensation of the anti-aliasing filter, and compensation of the sampling member, is shown. It can be seen that up to frequencies of about 7 to 8 Hz, a substantially complete compensation of the incident phase delays is possible. Battery voltage fluctuations occurring during the starting process, which typically are in the range from 5 to 8 Hz, can thus be compensated for highly effectively. From FIGS. 11,  12  it can be seen that the phase compensation of the invention causes a phase increase and thus an increase in the incident idle times.