parallel kalman filter based time domain harmonic state estimation 160406
TRANSCRIPT
Rafael Cisneros-Magaña Aurelio Medina-Rios
“Parallel Kalman Filter Based Time Domain Harmonic State Estimation”
WORKSHOP April 6, 2016
Morelia, México
Project C0014-2014-03 247099 Institutional Links CONACYT-British Council
“Modeling, analysis and digital/physical simulation of power systems with integration of renewable energy sources; assessment of their dynamic
behavior and power quality impact”
Meeting, April 6, 2016Morelia, México
1. Introduction
The state estimation is now solved in time domain using the parallel Kalman filter (PKF). This filter is implemented using the CUDA platform and the CUBLAS library on a GPU and is applied to estimate harmonics and inter-harmonics.
The sequential parts of an algorithm are executed on the CPU while the parts that are convenient to be executed in parallel are run on the GPU using parallel functions.
2
1. Int.
3
State Space Model: dx/dt=Ax+Bu
y=Cx+Du
Measurement Model: z=Hx
Discrete time: x(k+1)=F(k)x(k)+B(k)u(k)
z(k)=H(k)x(k)
2 Methodology
4
The PKF evaluates the time domain state estimation using the following steps:
1. Data allocation in GPU memory.
2. Recursive execution of PKF on GPU.
3. The HSE result is saved.
4. The GPU memory is free when the case
study ends.
2.1 Kalman Filter using CUBLAS library
5
Initial State x0, P0
Project Error Covariance Matrix 2.- P*(k)=F(k)P(k-1)F’(k)+Q(k)
KF Gain 3.- K=P*(k)H’(k)[H(k)P*(k)H’(k)+R(k)]-1
Update State 4.- x(k)=x*(k)+K[z(k)-H(k)x*(k)]
Update Error Covariance Matrix 5.- P(k) =[I-KH(k)]P*(k)
Project State 1.- x*(k)=F(k)x(k-1)+B(k)U(k)
Allocate GPU memory and set data from CPU to GPU
2.1
6
KF Step CUBLAS functions
1 Dgemv, Daxpy
2 Dgemm, Dgeam
3 Dgemm, Dgeam, Dger, Dscal, Dtrsm
4 Dgemv, Daxpy
5 Dgemm, Dgeam
The CUBLAS functions to evaluate the KF steps are shown. These functions are implemented in the CUBLAS library to be executed in parallel form on the GPU.
3 Case Studies of Harmonic State Estimation
The IEEE 14 bus test system is modified to apply the PKF-HSE method, state space and measurement models are defined.
The test system is modified injecting harmonics and interharmonics at buses 5 and 13. Bus voltages, line and load currents are taken as state variables.
7
3.1 Case Study HSE with harmonic sources buses 5 and 13
Buses 5 and 13 receive injections of harmonics (5, 7, 11, 13). The simulation time is 0.2 s. Actual, Kalman filter estimate and difference for line currents are shown. The generators currents are estimated.
8
0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2
-0.2
0
0.2
0.4
0.6
Generator node 1
Cur
rent
( pu
)
Actual PKF Estimate PSCAD/EMTDC
0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2
-1
0
1
2
Generator node 2
Time ( s )
Cur
rent
( pu
)
Actual PKF Estimate PSCAD/EMTDC
3.1 Case Study
Table shows the harmonics injected at buses 5 and 13, the harmonic spectrum of generator currents is calculated using the DFT, the harmonic spectra agree with the injected harmonics.
9
Bus 5 13
Harmonic 5 7 11 13 5 7 11 13
Peak Value Amp
6 3 1.5 0.75 3 1.5 0.75 0.37
3 5 7 9 11 13 150
1
2
3
4
5
6
7
Harmonic Order
% F
unda
men
tal
Generator Node 1Generator Node 2
3.2 HSE of time-varying harmonics
The PKF is applied under a varying harmonics condition, Figures show the waveforms (actual, PKF estimate and PSCAD) and the harmonic spectrum for generator current at buses 1 and 2.
10
0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2
-0.2
0
0.2
0.4
0.6
0.8Generator node 1
Cur
rent
( pu
)
True PKF Estimate PSCAD/EMTDC
0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2
-1
0
1
2
Generator node 2
Time ( s )
Cur
rent
( pu
)
True PKF Estimate PSCAD/EMTDC
3.3 Case Study HSE including interharmonics.
The injected harmonics include inter-harmonics to verify the effect on the system using the PKF-HSE. Figures show actual, PKF estimate and PSCAD waveforms and the harmonic spectrum of estimated generator currents.
11
0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2
-0.2
0
0.2
0.4
Generator node 1
Cur
rent
( pu
)
True PKF Estimate PSCAD/EMTDC
0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2
-1
-0.5
0
0.5
1
1.5
2
Generator node 2
Time ( s )
Cur
rent
( pu
)
True PKF Estimate PSCAD/EMTDC
0 1 3 5 7 9 11 13 150
5
10
15
20
25
30
35
40
Harmonic Order
% F
unda
men
tal
Generator Node 1Generator Node 2
4. CPU-GPU execution time
12
EXECUTION TIME (S)
Models CPU C++ code CPU-GPU CUBLAS Speed-up
1 36.2 22.5 1.6
2 434.7 52.2 8.3
3 1965 79.1 24.8
The power system model was replicated three times to simulate larger systems, table presents the execution time. The speed-up increases with the number of models.
5. Conclusions
• The HSE-PKF has been evaluated for computational efficiency on the GPU to show speed up against the sequential execution.
• Results are successfully compared against the actual and PSCAD responses.
• A time domain harmonic state estimator based on PKF using CUDA and CUBLAS on a GPU has been presented.
13
14
Thank you!
3.4 CPU-GPU Configuration and execution time
CPU: Intel Core TM i7-3770 CPU, 3.4 GHz, 16.0 GB RAM GPU: NVIDIA GeForce GTX 680
13
NVIDIA GEFORCE GTX 680 GPU DATA
Processor Cores 1536
Clock rate 1.08 Ghz
Memory 2 GB
Memory Clock rate 3 Ghz
Memory Bus Width 256 bit
5 References
[1] J. D. Owens, M. Houston, D. Luebke, S. Green and J. E. Stone, “GPU Computing”, Proc. IEEE, vol. 96, No. 5, pp. 879-899, May 2008.[2] R. C. Dugan, M. F. McGranaghan, Surya Santoso and H. Wayne Beaty, “Electrical Power Quality”, 2nd Ed., McGraw-Hill, 2002.[3] IEEE Task Force on Harmonics Modeling and Simulation, “Interharmonics: Theory and Modeling”, IEEE Trans. Power Del., vol 22, No. 4, pp. 2335-2348, Oct., 2007.[4] J. Arrillaga, N.R. Watson and S. Chen, Power System Quality Assessment, John Wiley & Sons, 2000.[5] K. Kennedy, G. Lightbody and R. Yacamini, “Power system harmonic analysis using the Kalman filter”, IEEE Power Eng. Soc. General Meet., vol. 2, pp. 752-757, 2003. [6] NVIDIA, CUDA C Programming Guide, Version 5.0, October 2012. NVIDIA, CUDA API Reference Manual, Version 5.0, October 2012. NVIDIA, CUDA Toolkit 5.0 CUBLAS Library, April 2012.
17
2.1 Parallel Kalman Filter algorithm using CUBLAS.
7
The CUBLAS functions to implement LU are Dscal and Dger. These functions evaluate the Crout’s reduction algorithm and the Dtrsm function implements the forward and backward substitutions. This step consumes most of the time execution of the Kalman filter and is calculated each time-step of the state estimation.