Kalman Filter Synchronization

Single Phase Kalman Filter Synchronization component in Schematic Editor, which generates an output signal whose phase is related to the phase of an input signal and another signal with a 90 degree phase difference.

Figure 1. Kalman Filter Synchronization component icon

Description

The Kalman Filter Grid Synchronization algorithm is based on three main blocks. The first one is an observer, that contains the model of the grid and whose input is the error between the model output and the grid voltage. The single-phase grid is modeled as:

[ x 1 ( k + 1 ) x 2 ( k + 1 ) ] = [ cos ( w ( k ) T s ) sin ( w ( k ) T s ) sin ( w ( k ) T s ) cos ( w ( k ) T s ) ] [ x 1 ( k ) x 2 ( k ) ] + [ γ 1 ( k ) γ 2 ( k ) ]

y = [ 1 0 ] [ x 1 ( k ) x 2 ( k ) ] + v ( k )

A state observer for this model can be defined as follows:

[ x ^ 1 ( k + 1 ) x ^ 2 ( k + 1 ) ] = [ cos ( w ( k ) T s ) sin ( w ( k ) T s ) sin ( w ( k ) T s ) cos ( w ( k ) T s ) ] [ x ^ 1 ( k ) x ^ 2 ( k ) ] + K k ( y k F x ^ ( k 1 ) )

The second block contains the Kalman Filter algorithm, which finds the optimum gains for the observer to track the grid voltage at its output.

Finally, the third block is an algorithm that identifies the frequency, whose output is the reference to tune the observer model on the fundamental frequency (identified grid frequency). The base of the frequency identification algorithm, in state space, is given by:

[ x ω 1 ( k + 1 ) x ω 2 ( k + 1 ) ] = [ 0 1 1 2 cos ( w ( k ) T s ) ] [ x ω 1 ( k ) x ω 2 ( k ) ] + [ 0 K ω ] e ( k )

y ω ( k ) = [ 1 cos ( ω ( k ) T s ) ] [ x ω 1 ( k ) x ω 2 ( k ) ] + K ω e ( k )

This dynamic system works with error identification and grid frequency signal update equations, as detailed in [1] to generate the frequency signal that is used by the state observer.

Behavior and Features

The Kalman Filter Synchronization presents quick convergence and an accurate phase signal equivalence to the grid signal.

In the initial sampling steps the Kalman gain converges very quickly to optimum values, after which it is no longer needed to run the Kalman Filter algorithm. From this point, the synchronization algorithm behaves like a state observer with optimum gains.

Therefore, it is required to feed the input voltage at the first run of the synchronization algorithm to guarantee the correct convergence of filter gains. During the first three to five sampling steps the output signal can present undesirable peaks, so it is a good practice to wait for some samples to start using the synchronized signal.

Although the identified frequency of the input signal is available as an output, it is an internal signal of the algorithm and should not be taken as an exact measurement of the input signal frequency.

Ports

  • Vgrid (in)
    • Sinusoidal input of the single-phase system from which the phase and frequency is intended to be extracted.
      • Supported types: real.
      • Vector support: no.
  • sin(wt) (out)
    • Value of the trigonometric function ‘sin’ applied to the value of the phase of the single-phase system.
      • Supported types: real.
      • Vector support: no.
  • cos(wt) (out)
    • Value of the trigonometric function ‘cos’ applied to the value of the phase of the single-phase system.
      • Supported types: real.
      • Vector support: no.
  • f[Hz] (out)
    • Frequency (Hz) of the single-phase input system.
      • Supported types: real.
      • Vector support: no.
  • Amplitude (out)
    • Peak amplitude of the output signals, Amplitude = sin ( ω t ) 2 + cos ( ω t ) 2 .
      • Supported types: real.
      • Vector support: no.

Properties

Figure 2. Kalman Filter Synchronization component properties
  • Q matrix gain
    • Kalman Filter state covariance matrix gain.

  • R matrix gain
    • Kalman Filter measurement covariance matrix gain.
  • Grid Frequency (Hz)
    • Is the frequency value used to initialize the frequency identification algorithm.
  • Output normalized
    • If checked, the output will be normalized. Otherwise the output signal will have the same amplitude as the input signal.

  • Execution rate
    • Type in the desired signal processing execution rate. This value must be compatible with other signal processing components of the same circuit: the value must be a multiple of the fastest execution rate in the circuit. There can be up to four different execution rates, but they must all be multiple of the basic simulation timestep. To specify the execution rate, you can use either decimal (e.g. 0.001) or exponential values (e.g. 1e-3) in seconds. Alternatively, you can type in ‘inherit’ in which case the component will be assigned execution rate based on the execution rate of the components it is receiving input from.

References>

[1] Cardoso, R.; de Camargo, R.F.; Pinheiro, H.; Gründling, H.A.: 'Kalman filter based synchronisation methods', IET Generation, Transmission & Distribution, 2008, 2, (4), p. 542-555, DOI: 10.1049/iet-gtd:20070281IET Digital Library, https://digital-library.theiet.org/content/journals/10.1049/iet-gtd_20070281