<<

High Performance Embedded Software Design for Protective Relay in Digital Processors

Heung Sun Yoon, Myungha Kim, Jong Kang Park, and Jong Tae Kim Department of Electrical and Computer Engineering, Sungkyunkwan University, Suwon, South Korea

Abstract - Most measurements and protective for - The number of channels are increased with single DSP, since power systems have been implemented by embedded software processing speed is improved. in more than a single digital signal (DSP). As more complex functions required for intelligent electronic devices, - Coordination accuracy is always guaranteed within the we need to improve the existing software solutions for DSPs in designated fixed-point range, since simplification is not terms of execution time, cost and reliability. This paper applied. It is easy to change parameters to handle various suggests a fixed-point design technique for several requirements. mathematical functions in relay algorithms. By porting it to a real target system, we also evaluated that the proposed design By the result of this paper, the fixed-point can give higher speed of operations, higher sample rate and implementation in TMS320C 6416 requires additional 128 more increasing concurrent channel support capability than bytes non-volatile memory compared to the software of the existing solution. floating-point version. However, the operation speed is Keywords: protective relay, digital signal processor, fixed- improved by 53 times and the entire code memory usage is point design reduced by 25%. Furthermore, our code is running 27 times

faster than the DSP embedding the floating point unit. 1 Introduction 2 Fixed-point design of relay algorithm Protective relays have been used for preventing and minimizing damage by detecting electric power system faults In this section, the optimization of protective relay such as short circuit and ground fault in a timely manner. In algorithm, hardware specifications and each details of the today, key features of protective relay are supporting multi- fixed-point design will be covered. channel sources and high precision protection control. Furthermore, there is a trend that equipment monitoring and control, communication and prevention diagnosis are required. 2.1 Software of protective relay Requests of operation performance have been extremely enlarged in order to implement these demands [1,2]. The main difference between the digital and traditional Therefore, more than two processors have been used to analog protective relay is that the digital protective relay is implement the protective relay in the existing design [3,4,5]. implemented by software which is executed by the instruction set architecture. Most of digital protective relay features such In this paper, we proposed embedded software as protection, auto-monitoring, and man machine interface optimized fixed point design for and protective (MMI) are implemented by software. algorithms. We presented expected processing speed of processor which has floating-point operations contrast with The digital protective relay provides a number of processer which doesn’t have. And we verified that low-cost features. As shown in Fig. 1, the embedded software divided single DSP is possible to provide high-quality protective into three categories such as protective relay software, relaying by optimizing operations. interface and diagnosis software. Protective relay software include digital filter, protective algorithm, control sequence. Our design provide following advantages. Diagnosis software perform regular monitoring, auto- and self-diagnosis and MMI software which processes correction - Single DSP can provide high sample rate which is 128 value and display. Protective relay software is being samples/period or more in real-time by improving processing processed as a top priority, normal human machine interface speed so that we get more information from the electric power software and diagnosis software will perform in the free time. system. Fig 2 illustrates basic structure of protective relay software - High sample rate improves noise cancellation performance which is main subject of this paper. Voltage and current of digital filter, as the result high quality protective relay is are came from external Potential Transformer (PT), possible. Current Transformer (CT) and then these signals pass low- pass analog filter. After converting these signals by analog-to- Protective Relay S/W I/F S/W Diagnosis S/W 64KB RAM is used for level 2 program (L2P), 32 bits data are transferred from L2P to L1P in a clock. In case that 64KB RAM is used for data memory, 32 bits data are I/O Control, Digital Filter, Continuous Serial I/F, transferred to L1D in a clock. Measurement, Surveillance, Network I/F, Protective Algorithm, Auto- and Self- Display and Monitor Control Sequence diagnosis 2.3 Fixed-point design of digital filter High harmonic components of voltage and current signals which come from external analog circuit are Fig. 1 Embedded S/W for Protective Relay eliminated by the digital filter. And then, the protective algorithm can be applied. In general, speed and reliability of digital converter (ADC), timer interrupt service routines store digital protective relay are primarily determined by designing data in the internal memory buffer at specified period. digital filter. We used DFT (Discrete Fourier Transform) Unnecessary harmonic components are removed by digital filter for the relay. As shown in Fig. 4, Xre(k) and Xim(k) filter at each reading voltage and current samples. Essential which are real number and imaginary number of X(n) information to monitor and relay are extracted by measuring respectively are calculated to obtain k harmonic component root-mean-square (RMS) value, phase and frequency. by in fixed-point. N and r represent the number Instantaneous and inverse time protective algorithms are of samples and filter tap respectively. A fixed-point format executed to detect variety faults through relay co-ordination (type, W, F) in Fig.4 is composed of the data type, the property. number of total bits and the number of bits for fractional part, respectively. For example, (short, 12, 0) represents the 2.2 Target hardware specification corresponding data is a short integer type with 12-bit length and has no fractional bits. 12-bit ADC samples and In this paper, we employed TMS320C6416 processor previously stored DFT filter coefficients are calculated by based on and only supporting convolution. Final outputs come out into 32 bits fixed-point. fixed-point operations by the hardware components. Fig 3 presents the detailed internal memory structure of the 2.4 CORDIC operations processor. TMS320C6416 processor is a VLIW architecture. Internal memory of processor consists of two-level cache Embedded software of the relay was implemented by hierarchical structures (Level 1 program cache memory 4KB applying COordinate Rotation DIgital Computing (CORDIC) (L1P), level 1 data cache memory 4KB (L1D) and 64KB algorithm [6] to compute main operations of RMS, phase RAM (L2)). Level 2 64KB RAM can be used in various ways and protective algorithm based on [3]. Including the such as program cache memory or data memory or mixture. trigonometric functions and various arithmetic operations can As shown in Fig. 3, DSP Core load 256 bits program code at be calculated by CORDIC. It is not an approximated method a clock from L1P, and 32 bits data from L1D. In case that to reduce amount of computation. CORDIC algorithm has advantages in terms of efficiency and accuracy. Table 1 shows the CORDIC operations for required arithmetic Interrupt Service Meters Instantaneous operations in this study. Each arithmetic operation can be Routine (Timer) Digital and Filter RMS, Inverse-time calculated by using specific CORDIC operational modes and Storing 12-bit ADC (DFT) Phase, Protective it might need additional constant multiplication or division samples Frequency Algorithms based on fixed-point depending on the type of operation. In addition, normalization and correction operations are required

Fig. 2 Block Diagram for Digital Protective Relay S/W

Fig. 3 Memory Structure for Target Signal Processor Fig. 4 Fixed-point design for convolution in DFT filter (int, 32, 11) (int, 32, 25) (int, 32, 25) (int, 32, 25) Xre X’re x0 Normali- zation xi, yi, zi xi+1, yi+1, zi+1 y + Xim X’im 0 CORDIC

0 z0 L-bit left shift, Sign makes X’im < 0.5 x31 z31 adjustment L-bit right RMS X shift Look-up table Arithmetic (int, 32, 11) (int, 32, 11) (int, 32, 25) f(i) (non-volatile shift memory) 2.3289 Phase (int, 32, 25) (int, 32, 25)

Fig. 5 Fixed-point design for CORDIC operations Fig. 6 Fixed-point design for measuring RMS and Phase to guarantee the convergence of CORDIC iteration depending We adopted general inverse-time over current protection on the type of operation [3]. Fig. 5 illustrates the schematic of algorithm. Eq. (1) is a characteristic equation of the time- fixed-point design for main CORDIC operations. Normalized current curve. x, y, z for the convergence, are the inputs of the CORDIC -25 algorithm. Its precision ranges up to 2 and the number of  the maximum iterations is 32. T =  (1)   2.5 Measurement for RMS value and phase K and p are the constant representing the cut-off characteristics of the relay, Ir is the ratio of reference current Fig. 6 shows the RMS value and phase measurement to the fault current. Since p is a real number including . Circular-vectoring mode of CORDIC operation is fractional number, the key point of the optimization is used for the measurement of RMS value as listed in Table 1. reduction in calculation time for exponentiation. There have L-bit shift operation will be added to imply proper correction been an approximated method to estimate quickly by after output z has been obtained from normalized input x and referencing lookup table (LUT) which implies the y. The phase measurement gets the output after the similar characteristic equation. However, it causes a trade-off relation process of RMS measurement. However, the phase between the errors of operation result and the degree of measurement does not need normalization and correction of flexibility in selecting curves [3,7,8]. In this paper, the the inputs and outputs. As a result, RMS value and phas can calculation of the exponentiation are implemented by using be obtained after executing CORDIC algorithm only once. CORDIC algorithm based on the result of the study [3].

  2.6 Fixed-point design for protective algorithm   ∙   =  =  (2)

Table 1 CORDIC operational modes for protective relay Eq. (2) can be calculated by Hyperbolic-Vector and Hyperbolic-Rotation mode. Fig. 7 depicts the fixed-point Arithmetic design for protective algorithm including exponentiation. Block CORDIC operation[3,6] Operation After the calculating ratio of reference current (Iref) to RMS value (I ), algorithm mainly consists of logarithm and cos() Filter Circular-Rotation RMS exponential function. Exponentiation requires the pre- processing and the post-processing of CORDIC operation to sin() Filter Circular-Rotation guarantee the convergence in similar way as mentioned in section 2.5. Pre-process executes the normalization including (x + y) RMS meter Circular-Vector L-bit shifts and extracting fractional part, and the post-  processing provides applying correction. As shown in Fig. 7, tan( ) Phase meter Circular-Vector  two CORDIC operations, five fixed-point multiplication, a division and three addition/subtraction are executed during   protective algorithm Hyperbolic-Rotation exponentiation. Since the exponentiation is calculated in run- time without using previously stored information for time- ln(w) protective algorithm Hyperbolic-Vector current curve of Eq. (1), curve selection can be easily

(in t, 3 2 , 1 1 ) TMS320C6416. Case 3 implements floating-point operation by using TMS320C6727 which supports floating-point I re f hardware unit. Consequently, case 1 is 53 times faster than (in t, 3 2 , 1 1 ) (in t, 3 2 , 1 1 ) (in t, 3 2 , 1 1 ) case2 in terms of total execution time and four times better than case 2 in the code memory size. Specifically the I + 1 , I I r execution time of measurement and protective algorithms is RMS / r I -1 r decreased by 97% due to the use of CORDIC algorithm. In addition, Case 1 is faster than case 3 about 20 times in -L execution time and saving 50% code size. CORDIC algorithm CORDIC x 0 2 (I r+ 1 ), -L Normalization requires two LUTs which have 32 entries based on 16 bits, (h y p e rb o lic y 0 2 (I r-1 ) v e c to r) but it requires only 128 bytes in addition. It can be neglected z 0 0 L -bit left shift, z 3 1 for the overall code size. m a k e s I r-1 < 0 .5

+ L ·ln 2 3.2 Expandability of sample rate and channels (in t, 3 2 , 1 1 ) In Table 2, the input data rate is 128 samples/period. Fig. (in t, 3 2 , 1 1 ) 8 illustrates the maximum samples per period without loss of ln I r (in t, 3 2 , 1 1 ) data in real-time when the number of simultaneous input (in t, 3 2 , 1 1 ) (in t, 3 2 , 1 1 ) channel is increased as 4, 8, 12 and 16. FXP_6416, FLP_6416 Normalization and FLP_6727 are case 1, case 2 and case 3 respectively. We p X p ·ln I r L = integer in (p ln (I r)·lo g 2 e ) assumed that the digital filter of FLP_6416 and FLP_6727 F = fraction in (p ln (I r)·lo g 2 e ) use the same structure as in FXP_6416.

x 0 1 Fig. 9 illustrates the maximum samples per period with same CORDIC (in t, 3 2 , 2 5 ) y 0 1 conditions of Fig. 8 when the number of simultaneous input (h y p e rb o lic z 0 F ·ln 2 channel increases as 24, 32, 64 and 128. From the results of ro ta tio n ) y 3 1 Fig. 8 and Fig. 9, we can see the proposed software in fixed- point design enlarges the number of multi-channel source and samples per period drastically. It also leads more cost L e ft reduction in the system integration. I p (in t, 3 2 , 1 1 ) 1 .2 0 7 5 X s h ift r

Fig. 7 Fixed-point design for exponentiation in inverse-time Table 2 Execution time result of protective relay protection

case 1 2 3 4 configured by only setting the parameters K and p within the Protective relay Floating- Floating- designated precision. Fixed-point [5] Software point point TMS320C TMS320C TMS320C TMS320C DSP 3 Experimental results 6416 6416 6727 32 In this section, we discuss the complexity of operations. Floating-point X X O O The proposed fixed-point software design in section 2 was support ported into TMS320C6416 DSP. We also compared the both frequency 500 500 300 50 implementation results for fixed-point and floating-point [MHz] DSPs. We will discuss the multi-channel supporting capability for the proposed design method. Samples per period 128 128 128 24

3.1 Comparison of execution time and area Digital filter [us] 0.7 140.0 54.3 10.3 complexity Measurement [us] 2.0 200.6 69.1 Table 2 shows summarized results of relay software that Protective relay have been implemented by the fixed-point and floating-point 4.1 22.8 7.0 5.6 codes, running on two different DSPs with or without Operation [us] floating-point hardware support. Case 1 represents our work Total execution 6.9 363.1 130.6 - proposed in this paper. Case 2 implements the floating-point [us] operation by using standard libraries provided in the vendor Code size [KB] 4.1 16.0 9.4 - provided cross-compiler where the target processor is

700 5 References FXP_6416 600 FLP_6416 FLP_6727 [1] Korea Electric Association, "2011 year book," 2011. 500 [2] P.E.K. Tang, "Design and implementation of IEC61850 400 for power generating plant protection, control and 300 automation," Proc. of POWERCON, pp.1-7, 2010.

200 [3] J.K. Park, J.T. Kim and Myong-Chul Shin, A CORDIC- samles samles period per based digital protective relay and its architecture, 100 Microelectronics Reliability J., Vol. 49, No.4, pp.438-447, 2009. 0 4 8 12 16 [4] AREVA T&D, "Network Protection & Automation # of channels Guide", www.areva-td.com, 2002.

Fig. 8 Max. number of samples per period according to [5] H-S Suh and G-B Kweon, "A Study on Design of concurrent input channels numbers Digital Protective Relay for Transformer Using a DSP," J. of KIIEE, Vol.17, No.6, pp.39-46, 2003.

[6] B. Parhami, "Computer Arithmetic: Algorithms and 120 Hardware Designs," Oxford University Press New York, FXP_6416 1999. 100 FLP_6416 FLP_6727 [7] G. Benmouyal, "Design of a Digital Multi-curve Time- 80 overcurrent Relay," IEEE Trans. on Power Delivery, Vol.6, No.2, pp.656-665, 1991. 60 [8] J.C. Tan, P.G. McLaren, R.P. Jayasinghe and P.L.

# of channels 40 Wilson, "Software model for inverse time overcurrent relays incorporating IEC and IEEE standard curves," IEEE CCECE 20 2002, pp.37-41, 2002.

0 24 32 64 128 samples per period

Fig. 9 Max. number of input channels according to the given samples per period

4 Conclusions We reduced the amount of computation and memory usage by implementing fixed-point design for the protective relay in commercial DSP against conventional floating-point software. In particular, we optimized the measurement and protective algorithms which have high complexity by applying CORDIC algorithm. As a consequence, the execution time of software was improved significantly. Accuracy of the proposed software is guaranteed in designed precision, without using approximated curve models and extrapolation. The proposed software can provide more stable protective relaying by enhancing pre-processing operations such as digital filter. Further, our work is possible to reduce the number of processors. It is very advantageous in terms of cost, since it requires small amount of computation.