Power converter with integrated control of reactive power and voltage harmonics Master’s thesis in Systems, Control and Mechatronics MARKUS NILSSON GABRIEL NYMAN DEPARTMENT OF ELECTRICAL ENGINEERING CHALMERS UNIVERSITY OF TECHNOLOGY Gothenburg, Sweden 2024 www.chalmers.se www.chalmers.se Master’s thesis 2024 Power converter with integrated control of reactive power and voltage harmonics MARKUS NILSSON GABRIEL NYMAN Department of Electrical Engineering Division of Electric Power Engineering Chalmers University of Technology Gothenburg, Sweden 2024 Power converter with integrated control of reactive power and voltage harmonics MARKUS NILSSON, GABRIEL NYMAN © MARKUS NILSSON, GABRIEL NYMAN, 2024. Supervisors: Filip Karlsson, Aros Electronics AB Urban Lundgren, Aros Electronics AB Examiner: Torbjörn Thiringer, Department of Electrical Engineering Master’s Thesis 2024 Department of Electrical Engineering Division of Electric Power Engineering Chalmers University of Technology SE-412 96 Gothenburg Telephone +46 31 772 1000 Cover: Visualization of AC voltage with high harmonic content and an out-of-phase current, that is altered into a voltage without harmonics and a current in phase with the voltage. Typeset in LATEX, template by Kyriaki Antoniadou-Plytaria Printed by Chalmers Reproservice Gothenburg, Sweden 2024 iv Power converter with integrated control of reactive power and voltage harmonics MARKUS NILSSON, GABRIEL NYMAN Department of Electrical Engineering Chalmers University of Technology Abstract With increased decentralized renewable energy production, it has become increas- ingly difficult for electricity providers to ensure adequate power quality. Local, distributed reactive power production and active voltage harmonic mitigation could be a step towards easier implementation of sustainable energy production, and im- proved control of power quality within microgrids. This thesis investigates the ability to integrate these functions into power electronics with other main purposes, with- out compromising the original function. A power converter for industrial mechanical loads was equipped with two proposed control schemes. One scheme relies on mea- surements of the current into a facility and a PI controller to minimize the total reactive power. The other mitigates harmonics by emitting a sinusoidal current that is slowly altered until an optimal amplitude and phase shift is found. The optimum corresponds to inducing a voltage in anti-phase with the harmonics, and is determined by using a Kalman filter to estimate the amplitude of different har- monics. The control schemes were investigated in a simulation environment and by implementation in a physical power converter. Simulations and measurements showed that both control schemes mainly work as intended, when used separately and when combined. The power converter managed to provide up to 14 kVAr for reactive power control while decreasing the 5th and 7th harmonic 79 % and 50 % respectively. The mechanical load’s power supply was not compromised in any of the investigated scenarios. A more stable power factor could be achieved by optimizing the current limitation scheme of the reactive power controller. Keywords: control, power quality, reactive power, power factor, voltage harmonics, power converter, Kalman filter. v Acknowledgements We would like to extend our sincere gratitude to our supervisors at Aros Electronics AB, Filip Karlsson and Urban Lundgren. Their support and commitment through- out the master thesis have been invaluable. Without their help, the progress reached within the project would not have been possible. We would also like to thank our examiner Professor Torbjörn Thiringer. His thoughtful advice provided guidance on many occasions. Markus Nilsson & Gabriel Nyman, Gothenburg, June 2024 vii List of Acronyms Below is the list of acronyms that have been used throughout this thesis listed in alphabetical order: AC Alternating Current APF Active Power Filter DC Direct Current DQ Direct Quadrature FF Feed Forward FFT Fast Fourier Transform PWM Pulse Width Modulation RMS Root Mean Square RPC Reactive Power Compensator RTOS Real Time Operating System THD Total Harmonic Distortion ix Contents List of Acronyms ix 1 Introduction 1 1.1 Problem background . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.2 Previous work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.3 Purpose & Aim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.4 Delimitation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2 Theory 5 2.1 Three-phase electric grid . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.1.1 Reactive power . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.1.2 Harmonics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.1.3 Total Harmonic Distortion (THD) . . . . . . . . . . . . . . . . 6 2.1.4 DQ0 transformation . . . . . . . . . . . . . . . . . . . . . . . 6 2.2 Power converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.2.1 Controlled three-phase full bridge rectifier . . . . . . . . . . . 8 2.2.2 LCL filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.3 Control strategies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2.3.1 PI-controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2.3.2 Cascade control . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2.3.3 Anti Windup . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 2.3.4 Real-time control . . . . . . . . . . . . . . . . . . . . . . . . . 10 2.3.5 Distributed control . . . . . . . . . . . . . . . . . . . . . . . . 11 2.3.6 Kalman filter . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 3 Case set-up 13 3.1 Modeling of power converter . . . . . . . . . . . . . . . . . . . . . . . 13 3.1.1 LCL filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 3.1.2 Three-phase full bridge . . . . . . . . . . . . . . . . . . . . . . 14 3.1.3 DC link . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 3.1.4 Load . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 3.1.5 Existing control scheme . . . . . . . . . . . . . . . . . . . . . 15 3.1.6 Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 3.2 Modeling of environment . . . . . . . . . . . . . . . . . . . . . . . . . 16 3.2.1 Power grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 3.2.2 Voltage harmonics . . . . . . . . . . . . . . . . . . . . . . . . 17 xi Contents 3.2.3 Inductive load . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 3.2.4 Measurements . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 3.3 Control of reactive power . . . . . . . . . . . . . . . . . . . . . . . . . 19 3.3.1 Control scheme . . . . . . . . . . . . . . . . . . . . . . . . . . 20 3.3.2 Current limitations . . . . . . . . . . . . . . . . . . . . . . . . 20 3.4 Control of voltage harmonics . . . . . . . . . . . . . . . . . . . . . . . 21 3.4.1 Harmonic Estimation . . . . . . . . . . . . . . . . . . . . . . . 22 3.4.2 Phase Shift Estimation . . . . . . . . . . . . . . . . . . . . . . 23 3.4.3 Harmonic Amplitude Control . . . . . . . . . . . . . . . . . . 24 3.4.4 Resulting disturbances for the current controller . . . . . . . . 24 3.5 Combined control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 3.6 Hardware implementation . . . . . . . . . . . . . . . . . . . . . . . . 26 3.6.1 Control of reactive power . . . . . . . . . . . . . . . . . . . . . 26 3.6.2 Control of voltage harmonics . . . . . . . . . . . . . . . . . . . 27 3.6.3 Test set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 3.7 Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 3.7.1 Measurement equipment . . . . . . . . . . . . . . . . . . . . . 29 3.7.2 Performance metrics . . . . . . . . . . . . . . . . . . . . . . . 29 3.7.3 Load cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 3.7.4 Test cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 4 Results & Discussion 33 4.1 Reactive power control . . . . . . . . . . . . . . . . . . . . . . . . . . 33 4.1.1 Case 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 4.1.2 Case 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 4.2 Harmonic control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 4.2.1 Case 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 4.2.2 Case 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 4.3 Combined harmonic and reactive power compensation . . . . . . . . . 44 4.3.1 Case 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 4.3.2 Case 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 4.4 Potential improvements . . . . . . . . . . . . . . . . . . . . . . . . . . 50 4.4.1 Reactive power control . . . . . . . . . . . . . . . . . . . . . . 50 4.4.2 Voltage harmonic control . . . . . . . . . . . . . . . . . . . . . 50 4.5 Distributed control . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 4.5.1 Reactive power control . . . . . . . . . . . . . . . . . . . . . . 51 4.5.2 Voltage harmonic control . . . . . . . . . . . . . . . . . . . . . 51 4.6 Ethical and environmental aspects . . . . . . . . . . . . . . . . . . . . 52 5 Conclusion 53 5.1 Future work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 Bibliography 55 xii 1 Introduction 1.1 Problem background Society is currently experiencing a transition towards a larger proportion of renew- able energy in the electric power grid. The increase in renewable energy from solar panels and wind turbines leads to a change in the grid architecture [1]. Since elec- tricity is now produced in many locations around the grid, instead of only centralized in large power plants, it is more difficult for the electricity providers to control the power flow and ensure power quality. A possible solution to better control the power and power quality would be to further distribute the controlling measures around the grid. Local control of power quality will also be a necessity if microgrids are going to be relevant in the future [2]. Two of the issues that would need to be addressed locally, which are already of concern today, are the production of reactive power and the mitigation of voltage harmonics. Reactive power is mainly caused by inductive loads such as large electric machines, and cannot be converted into mechanical work. Thus, it only creates losses and is unwanted. Generally, the reactive power allowed to be drawn by a commercial con- sumer is regulated by the utility provider, with additional fees when exceeded [3][4]. To conform with the provider’s regulations, large industries typically employ reac- tive power compensators (RPCs) to cancel out the inductive effects of the facility’s equipment. These can include switched capacitor banks, STATCOMS, active power filters (APFs), and other products [5][6][7]. The RPCs can be expensive and use materials that could otherwise be avoided. Thus, both economic and environmental gains could be reached if the reactive power compensation was instead integrated into existing power electronic devices in the facility. Assuming that the added func- tionality does not compromise the devices’ performance. Furthermore, harmonic voltage distortions on the power grid is a common issue. Harmonics are periodic waveform components with frequencies that are multiples of the fundamental frequency. Voltage harmonics can cause additional losses, heating issues, blown capacitor bank fuses, etc, with the most significant harmonics being the 5th, 7th, 11th, or 13th [8][9]. Among other things, harmonics are caused by non-linear loads connected to the grid, such as switching electronics [2]. Harmonics can also be introduced by renewable energy production, such as solar power and wind turbines [10]. The integration of voltage harmonic mitigation into existing power electronic devices would further increase the benefit of these devices. 1 1. Introduction Within this project, the integration of reactive power control and voltage harmonic control into an existing power converter will be investigated. The chosen power converter is a three-phase AC-DC controlled rectifier, which has a peak power of 40 kW. An important aspect is to not compromise on the original performance, and the power converter’s main purpose as a power supply must be prioritized at all times. The project investigates the ability to mitigate reactive power and voltage harmonics within a facility, but the practice could be extended to include several facilities or a microgrid. 1.2 Previous work The use of power electronic converters to actively control reactive power and har- monic voltages is already a widely researched field [11]. However, these filters are separate and proprietary products, with the sole purpose of improving the power quality in the vicinity. An area where less research has been conducted is to extend existing power converters with additional control schemes for reactive power and harmonics, while simultaneously fulfilling its primary objective. The project will be based on an existing power converter developed by Aros Elec- tronics AB that is used to power industrial mechanical loads. The converter is bidi- rectional, allowing energy to flow back into the power grid when the load is braking. The product’s main components are an LCL filter, a three-phase full bridge recti- fier, and a 700-780 V DC link with a large capacitor. The full bridge is controlled to maintain a constant voltage level at the DC link capacitor and has a switching frequency of 50 kHz. 1.3 Purpose & Aim This master thesis aims to extend the power converter’s control scheme with a dy- namic reactive power compensation that corrects deviations in power factor caused by other equipment in the facility. Along with the reactive power control, the power converter will be equipped with a voltage harmonic mitigation controller, while sup- plying a sufficient DC voltage for the mechanical load at the converter output. The project includes the following objectives: • Develop a control algorithm for the power converter that minimizes reactive power within a subgrid. • Develop a control algorithm for the power converter that reduces the grid volt- age’s 5th and 7th harmonic components. 2 1. Introduction • Investigate the possibility of controlling both reactive power and voltage har- monics simultaneously in the same power converter. • Ensure that the added control schemes do not compromise the supply of power to the mechanical load. • Implement the control schemes in a physical power converter to investigate the performance and limitations of suggested controllers and compare them to simulated results. 1.4 Delimitation • The thesis work revolves around the existing power converter developed by Aros Electronics with the goal of investigating how the existing hardware can be accompanied by new software to enhance its capabilities. The project there- fore refrains from investigating any hardware modifications or modifications to the existing current controller. • Simulation models will be limited to certain ideal characteristics such as ideal components for modeling, and ideal voltage harmonics. • Voltage harmonics are assumed to be constant and symmetrical sine waves on all three phases. 3 1. Introduction 4 2 Theory 2.1 Three-phase electric grid 2.1.1 Reactive power In AC electric circuits, inductances and capacitances are energy-storing components. Energy flows into a capacitance when the voltage magnitude across it increases, and flows out when the voltage magnitude decreases [12]. In an inductance, energy flow is instead governed by the current magnitude. When the current magnitude in- creases, energy increases within the inductor. The energy is then released once the magnitude decreases. The average energy transferred over one cycle of the AC source is zero for ideal inductors and capacitors. However, the energy flowing between the source and the energy-storing components is at twice the frequency of the source. The peak instantaneous flow of energy between these components is called reactive power [13]. Reactive power affects the total power draw of an electrical component but cannot perform mechanical work. Therefore, the presence of reactive power only causes additional resistive losses in cables and components. The reactive power Q is mathematically defined as Q = VrmsIrms sin θ (2.1) where Vrms is the effective voltage across the load, Irms is the effective current through the load and θ is the angle between the voltage and current [12]. When connected, an inductor will absorb the reactive power generated by a capacitor [13]. If the reactive power generated and absorbed is equal and canceled, no reactive power will be present and the angle θ will be zero. This is also called unity power factor, since the power factor cos(θ) equals one. 2.1.2 Harmonics The desirable frequency of a power system is either 50 or 60 Hz. However, in practice, the voltage on the grid contains many components that are different integer multiples of the fundamental frequency [8]. These undesirable components are called voltage harmonic distortions, or simply harmonics [9]. Harmonics occur when loads draw nonsinusoidal currents from the grid which induce voltage over the grid’s impedances [8]. The distortions are periodic signals that continuously distort the voltage and 5 2. Theory current waveforms. The harmonic components of a periodic waveform V (t) can be described using Fourier series [14]. V (t) = V0 + ∞∑ n=1 ( an cos (2πnt T ) + bn sin (2πnt T )) (2.2) where V0 is the average of the waveform V (t), an and bn are the rectangular Fourier coefficients, and T is the period of the fundamental frequency. The amplitude of a harmonic signal An can be calculated with An = √ a2 n + b2 n (2.3) and the phase angle in the equivalent sine form is found with ϕn = tan−1 ( bn an ) (2.4) This yields the continuous representation of the nth harmonic component Vn(t) in sine form. Vn(t) = An sin (2πnt T + ϕn ) (2.5) 2.1.3 Total Harmonic Distortion (THD) Total harmonic distortion (THD) is a performance criterion describing the degree of harmonic pollution in a periodic signal [15]. The THD of a signal x(t) is defined as THD[x(t)] = √∑∞ n=2 a2 n + b2 n a2 1 + b2 1 (2.6) where an and bn are the fourier coefficients of x(t). To calculate THD numeri- cally in practice, the infinite THD sum is truncated when the remaining harmonic components are considered negligible [15]. 2.1.4 DQ0 transformation The Direct-quadrature-zero (DQ0) transformation is commonly used for the control of three-phase drives and inverters. The transformation was originally formulated with the synchronous machine in mind, where the three-phase input signals instead were quantized in terms of magnetic flux in phase with the rotor, and flux in quadra- ture with the rotor [16]. The DQ0 domain is a rotating reference frame, meaning that the D- and Q-axes rotate along with the electrical angle of the machine’s ro- tor. The result is a conversion from periodic a-b-c signals into constants when in symmetrical steady-state [17]. The additional 0 component is equivalent to the zero sequence component in three-phase. 6 2. Theory The power-invariant DQ0 transformation is described as  d q 0  = √ 2 3  − sin (θ) − sin ( θ − 2π 3 ) − sin ( θ + 2π 3 ) cos (θ) cos ( θ − 2π 3 ) cos ( θ + 2π 3 ) 1√ 2 1√ 2 1√ 2   a b c  (2.7) with the inverse  a b c  = √ 2 3  − sin (θ) cos (θ) 1√ 2 − sin ( θ − 2π 3 ) cos ( θ − 2π 3 ) 1√ 2 − sin ( θ + 2π 3 ) cos ( θ + 2π 3 ) 1√ 2   d q 0  (2.8) The instantaneous active power p(t) and reactive power q(t) can be calculated with the D- and Q components as p(t) = vdid + vqiq + v0i0 q(t) = vqid − vdiq (2.9) If the angle θ in 2.7 is in phase with the voltage on phase a, the vd component will be constant 0. The power equations can then be simplified into p(t) = vqiq + v0i0 q(t) = vqid (2.10) The active power draw is thus solely dependent on the Q-component and the zero sequence component. The amount of reactive power is governed by the amount of D-current drawn, assuming vq stays constant. The three-phase currents can be represented as ia(t) = √ 2I cos (ϕ(t)) ib(t) = √ 2I cos ( ϕ(t) − 2 3 π ) ic(t) = √ 2I cos ( ϕ(t) + 2 3 π ) (2.11) where I is the RMS current. Combined with the transformation in 2.7, the magni- tudes of the D-, and Q-currents translate to RMS through the following relations id = √ 3I sin(ϕ) cos(θ) − √ 3I cos(ϕ) sin(θ) iq = √ 3I cos(ϕ) cos(θ) + √ 3I sin(ϕ) sin(θ) (2.12) where it follows that if the currents and voltages are displaced by 90◦, id will be related to the current’s RMS value by a factor of √ 3. If the currents and voltage instead are completely in synch, iq will have the same relation to the current’s RMS value. 7 2. Theory 2.2 Power converter 2.2.1 Controlled three-phase full bridge rectifier Controlled three-phase rectifiers are used in a wide variety of applications [18]. An important advantage of controlled rectifiers compared to diode rectifiers is that current can flow back into the grid when needed. This allows for example the breaking energy of electrical machines to be used by other grid-connected devices. One of the most common types of controlled rectifiers uses transistors in a full bridge layout [19]. An example of such a circuit can be seen in Fig. 2.1. The transistors are controlled by pulse width modulation (PWM), which by fast switching and a chosen duty cycle creates a mean voltage corresponding to the duty cycle [18]. The voltage causes a difference in potential over the filter compared to the grid voltage, which generates a current. Control logic Grid voltage DC+ DC- Filter Figure 2.1: Example of three-phase full bridge rectifier circuit. 2.2.2 LCL filter When using three-phase PMW controlled rectifiers, the grid connected current input usually includes an inductive filter stage that reduces current harmonics [19]. A suitable filter type for high power rectifiers is the LCL filter, which performs well with relatively small inductance and capacitance values. The LCL filter consists of the components inductor-capacitor-inductor, as the name suggests. An example of a three-phase version of the filter, with delta-connected capacitors is shown in Fig. 2.2. 8 2. Theory Figure 2.2: Example of three-phase LCL-filter with delta-connected capacitors. 2.3 Control strategies 2.3.1 PI-controller One of the most common control schemes is the PI-controller [20]. It minimizes the error e(t) between an observed quantity and a corresponding reference by incorpo- rating proportional and integral control action. The proportional action adds direct feedback of the error multiplied by a gain Kp to the control action u(t), while the integral action integrates the error over time with a gain Ki. This can be described as u(t) = Kp e(t) + Ki ∫ t 0 e(τ)dτ (2.13) To implement the PI-controller in a digital environment, a discretized version is needed [20]. The discretization assumes that the signal is piecewise constant with the sampling time ∆t. The integral then becomes a sum up to the current discrete sample k as u(k) = Kp e(k) + Ki k∑ l=0 e(l)∆t (2.14) The gains Kp and Ki are tuned with regards to the plant at hand and are not necessarily equal in the continuous and discrete domains. 2.3.2 Cascade control Cascade control is used when several controlled systems are connected so that the output of one affects another. An overview of such a system is shown in Fig. 2.3. Cascade control is only viable when the outer system is significantly slower than the inner system [20]. The outer controller calculates a reference for the inner controller, which calculates a control signal for the inner plant, which in turn affects the outer plant. 9 2. Theory Controller 1 + - + - Controller 2 Plant 2 Plant 1ref y Figure 2.3: Overview of a system which allows cascade control. 2.3.3 Anti Windup Anti windup is a strategy to avoid integral windup in a controller with integral action [21]. Integral windup is caused by a saturated control signal. When the control signal is saturated, the error between measurement and reference will not decrease. The integral action will however keep integrating the error and thus increase the control signal. The control signal will then be kept over the saturation limit when it is no longer desired. Anti windup counteracts this by feeding back the difference between the signal before saturation and the saturated signal with a gain H to the integral error [21]. An example of a PI-controller with anti windup can be seen in Fig. 2.4. 𝐾௣ + - + - Plantref y 𝐾௜ 𝐻 1 𝑠 + + u û -+ Figure 2.4: Flow chart of PI-controller with anti windup. 2.3.4 Real-time control Real-time control refers to when a control scheme is implemented in hardware to run continuously and react to changes in the system. The control scheme is often imple- mented in one or several processors using a real-time operating system (RTOS) [22]. The RTOS executes predetermined tasks and schedules them by evaluating assigned properties of the tasks, such as execution frequency and priority [23]. Real-time con- trol introduces issues such as variations in time between task executions called jitter, and delays between sampling of measurements and actual control output [22]. There are also real-time control requirements regarding the execution time and execution frequency of the tasks. If the sum of total execution times for all tasks exceeds the time they are supposed to be executed within, problems arise. Those problems can include lower execution frequencies, tasks that do not execute, and software crashes. 10 2. Theory 2.3.5 Distributed control Distributed control is the practice of using multiple units to control the same system [24]. This usually requires communication either between controller units or between each unit and a master controller. Furthermore, distributed control often creates additional challenges regarding real-time control [22]. The main reason is that the communication introduces additional time-varying delays between the execution of tasks, which further constrains the real-time requirements. 2.3.6 Kalman filter The Kalman filter is a model-based state observer that reconstructs the states x in a state-space model based on the measurement y and input u [25]. The filter consists of a process model and a measurement model influenced by process and measurement noise respectively. The disturbances are modeled as stochastic processes, and under the assumption that the disturbances are white Gaussian noise, it can be shown that the Kalman filter is the optimal state observer in the least-square sense [26]. Consider the discrete-time state space model x(k + 1) = Ax(k) + Bu(k) + w(k), x0 = N (x0, P0) y(k) = Cx(k) + v(k) (2.15) where the process noise w(k) and measurement noise v(k) are assumed to be nor- mally distributed with zero mean, and with covariances Q and R respectively [26]. The discrete-time filter consists of a correction x̂(k|k) and a prediction x̂(k + 1|k) for each time step. x̂(k|k) = x̂(k|k − 1) + L(k) [y(k) − Cx̂(k|k − 1)] , x̂(0|0) = x0 x̂(k + 1|k) = Ax̂(k|k) + Bu(k) (2.16) The prediction equation predicts the next states based on the previously estimated states. The correction equation adjusts the most recent prediction once a new measurement is available. The adjustment is governed by the Kalman filter gain L(k). The filter gain is time-varying and is defined as L(k) = P (k)C⊤ [ CP (k)C⊤ + R ]−1 (2.17) where P (k) is the state error covariance matrix E [ (x(t) − x̂(t))(x(t) − x̂(t))⊤ ] . If the state space model is observable, and the covariance matrices Q, R are posi- tive semidefinite, P (k) and L(k) converge to the filtering algebraic riccati equation solution [26] L = PC⊤ [ CPC⊤ + R ]−1 P = APA⊤ − APC⊤[CPC⊤ + R]−1CPA⊤ + Q (2.18) A Kalman filter which uses the static gain L is called a stationary Kalman filter [26]. The stationary filter can be beneficial for real-time applications since L can be calculated offline, and the dependency on P is removed. 11 2. Theory 12 3 Case set-up The bidirectional power converter available in the project, and the surrounding elec- trical elements, were modeled in Mathworks’ simulation software Simulink and the additional software Simscape. In the simulation environment, new control schemes regarding reactive power and voltage harmonics were implemented and tested. The best-performing control schemes were then implemented in the converter. Evalua- tion of the control schemes was performed both in simulations and using the physical power converter. 3.1 Modeling of power converter A selection of the most important components in the power converter were modeled in the simulation software. Among the parts that were excluded are components used for filtering, supplying power to other devices, and operational safety. An overview of the created power converter model can be found in Fig. 3.1. LCL filter 3 phase full bridge Mechanical load Control logic Measurements PWM signal DC Link 𝐶஽஼ Power grid Measurements Figure 3.1: Overview of the power converter structure. 13 3. Case set-up 3.1.1 LCL filter The LCL filter is an important part of the power converter since the current through the filter corresponds to the current in and out of the converter, which is the main controlled variable. The impedances in the filter, with definitions in Fig. 3.2, can be seen in Tab. 3.1. Furthermore, the current i1 and voltage vLCL are measured by sensors in the converter. The voltage vLCL is measured compared to protective earth. 𝐿ଶ 𝐿ଶ 𝐿ଶ 𝐿ଵ 𝐿ଵ 𝐿ଵ 𝐶௅஼௅ 𝐶௅஼௅𝐶௅஼௅ 3 phase full bridge Power grid 𝑖ଵ,஼ 𝑖ଵ,஻ 𝑖ଵ,஺ 𝑣௅஼௅,஺ 𝑣௅஼௅,஻ 𝑣௅஼௅,஼ Figure 3.2: LCL filter with definitions of component names, currents, and voltages. Table 3.1: Parameters of the LCL filter model. Parameter Value L1 132 µH RL1 10 mΩ L2 3 µH RL2 1 mΩ CLCL 4 µF RCLCL 5 mΩ 3.1.2 Three-phase full bridge The three-phase full bridge converts the three-phase currents in the LCL filter to a DC current on the DC link. It can also convert currents in the opposite direction. The bridge consists of silicon carbide MOSFET transistors. The transistors were modeled as an ideal switch in parallel with an ideal diode, which were connected in series to a resistance. The model can be seen in Fig. 3.3. The resistance Rt was chosen to be the internal resistance of the transistors in the converter, 50 mΩ. 3.1.3 DC link The DC link, connecting the bridge and the mechanical load, has a capacitor that acts as an energy buffer. The capacitor has a capacitance of CDC = 480 µF. The voltage is typically around 740 V, but is allowed to vary between 700 V and 780 V. The DC voltage is measured by a sensor in the converter. 14 3. Case set-up 𝐷𝐶 + 𝐷𝐶 − LCL filter 𝑅௧ 𝑅௧ 𝑅௧ 𝑅௧ 𝑅௧ 𝑅௧ Figure 3.3: Model of three-phase full bridge. 3.1.4 Load The mechanical load was modeled as an ideal current source. By defining the load by the power draw, the current at every moment was simply calculated as iload = Pload VDC (3.1) 3.1.5 Existing control scheme The existing control scheme in the power converter consists of a current controller and a function that calculates the current reference. The resulting current reference is calculated to maintain a predetermined DC-link voltage vDC,ref . If the mechanical load consumes more power than the converter draws from the grid, the voltage de- creases, which increases the current reference, and vice versa. The controller ensures that the drawn or emitted current is always in phase with the grid voltage, which means that the power converter acts as a purely resistive load. This is performed by estimating the voltage phase angle θ, using the voltage measured in the LCL filter. The angle is then fed to the current reference generation to create a reference current in phase with the voltage. Fig. 3.4 shows an overview of the existing control scheme. 3.1.6 Limitations The power converter has physical limitations regarding current output and DC volt- age, which are also considered in the simulations. There are two current limits, the first is a limit of the current draw of 25 A RMS per phase over time. This is enforced by fuses. The second is a limit of the instantaneous current through the converter to protect the internal components. The limit is set to a peak current of 75 A RMS per phase. The DC voltage has both an upper and a lower limit. The voltage must not reach under 680 V since it is the lowest voltage the mechanical load requires to 15 3. Case set-up Plant 𝑣௅஼௅ Current controller Reference generation 𝑣஽஼,௥௘௙ 𝑣஽஼ 𝑖௥௘௙ 𝑖ଵ Phase estimation θ θ Figure 3.4: Flow chart of the existing control scheme. operate correctly. The upper limit is 800 V, which is the rated maximum voltage of the capacitor. The limitations were also modeled in the simulation environment. 3.2 Modeling of environment The environment around the power converter was modeled as divided into two sec- tions. One represents the grid of the facility where reactive power and voltage harmonics are controlled, and one represents the power grid outside the facility. A representation of the simulation model can be seen in Fig. 3.5. Furthermore, the total current the facility draws from the grid, igrid was measured at the intersection between the factory grid and the outside grid. Electric power grid Facility grid Inductive load Power converter 𝑅௚௥௜ௗ 𝐿௚௥௜ௗ 𝑅௚௥௜ௗ 𝑅௚௥௜ௗ 𝐿௚௥௜ௗ 𝐿௚௥௜ௗ 𝐸஼ 𝐸஻ 𝐸஺ 𝑖௚௥௜ௗ,஺ 𝑖௚௥௜ௗ,஻ 𝑖௚௥௜ௗ,஼ Figure 3.5: Overview of the simulated environment. 3.2.1 Power grid The electric power grid was modeled as three ideal sinusoidal voltage sources, con- nected in series with a resistor and an inductor each. The resistor and inductor model the grid impedance, which corresponds to the impedance of the transmission 16 3. Case set-up lines and the transformers in the grid. The used values for grid impedance were based on an estimation of the real grid impedance at Aros Electronics, where the practical experiments were performed. The estimated values were used to achieve a high correlation between simulations and measurements. The used grid impedance corresponds to a relatively strong grid and the values can be found in Tab. 3.2. Table 3.2: Grid impedance used in the simulations. Parameter Value Rgrid 200 mΩ Lgrid 200 µH In the case where there are no voltage harmonics on the grid, the ideal voltage sources produce three 50 Hz sinusoidal phase-shifted voltages. These are defined as EA =Asin(ωt + φ50Hz) EB =Asin(ωt − 2 3 π + φ50Hz) EC =Asin(ωt + 2 3 π + φ50Hz) (3.2) The amplitude A was chosen such that the phase voltage in the facility was 230 V RMS. φ50Hz corresponds to the phase shift of the 50 Hz sine wave, ω is 2π · 50, and t is the time. 3.2.2 Voltage harmonics When voltage harmonics were incorporated into the analysis, they were defined to be created directly at the voltage source. The signals were defined as the previous ideal sine wave, with two added symmetrical sine waves corresponding to the 5th and 7th harmonic, i.e., 250 Hz and 350 Hz respectively. The signals are described with the corresponding amplitudes and phase shifts as EA =Asin(ωt + φ50Hz) + A5thsin(5ωt + φ5th)+ A7thsin(7ωt + φ7th) EB =Asin(ωt − 2 3 π + φ50Hz) + A5thsin(5ωt − 2 3 π + φ5th)+ A7thsin(7ωt − 2 3 π + φ7th) EC =Asin(ωt + 2 3 π + φ50Hz) + A5thsin(5ωt + 2 3 π + φ5th)+ A7thsin(7ωt + 2 3 π + φ7th) (3.3) The parameters for harmonic amplitude and phase shift were chosen to create a similar voltage to what was measured at Aros Electronics. This yielded amplitudes and phase shifts as seen in Tab. 3.3. A comparison between the measured voltage 17 3. Case set-up and the generated can be found in Fig. 3.6. The differences mainly depend on that there are other harmonics than the 5th and 7th in the measured voltage. Table 3.3: Parameters for the generated voltage harmonics. Parameter Value A5th 5.2 V φ5th -0.75 rad A7th 4.5 V φ7th 1.65 rad Figure 3.6: Measured and generated grid voltage. 3.2.3 Inductive load To create reactive power consumption in the facility for the power converter to mit- igate, an ideal parallel inductive load was added to the facility grid. The inductive load represents all other electric components in the facility, which could include large induction machines or other predominantly inductive loads. To model a change in grid current, and thereby reactive power consumption, a second parallel inductive load was introduced. The second load could be connected and disconnected using ideal switches, as seen in Fig. 3.7. Both parallel loads are balanced, with resistance and inductance as specified in Tab. 3.4. Table 3.4: Parameters for the two parallel inductive loads. Parameter Value Lind,1 43.9 mH Rind,1 4.60 Ω Lind,2 72.5 mH Rind,2 2.28 Ω 18 3. Case set-up Power converter Power grid 𝐿௜௡ௗ,ଵ 𝐿௜௡ௗ,ଶ 𝑅௜௡ௗ,ଵ 𝑅௜௡ௗ,ଶ Figure 3.7: Schematic of the inductive parallel loads. The chosen inductive parallel loads corresponds to, when converted to the DQ- domain, a D-current that equals 15 √ 3 A before the additional load and 25 √ 3 A after. This means that the inductive components of the current are 15 A RMS and 25 A RMS respectively. These values were chosen to test the current limitations of the reactive power control scheme. A single power converter is able to counteract 15 A RMS, while 25 A RMS is over the limit. 3.2.4 Measurements To create a more realistic scenario for the controller, noise and transport delay were added to all measurements used by the controller. The delay time was chosen to be one switch period, i.e. 2 µs. Although the delay is excessive compared to the real power converter, it also functions as a model of other delays in the system. Mainly the computational delay in the power converter, which the simulations don’t consider. As discretization, zero-order hold was applied to all signals. The same period, 2 µs was used. The added noise was a Gaussian noise corresponding to the accuracy of the physical voltage and current sensors respectively. 3.3 Control of reactive power To control the reactive power consumed by an inductive load in the facility, a method that utilizes the existing control scheme was implemented. The reference generation was changed to be affected by two components, the DC link voltage and a separate PI controller that controls the reactive power. The reactive power is controlled by controlling the D-current of the power converter, since it equals a current that is 90° out of phase with the voltage. An overview of the implemented control scheme can be found in Fig. 3.8, where id,grid,ref = 0 since it corresponds to unity power factor. It is important to note that the control scheme requires a fast measurement of the current at the main fuses of the facility, where the facility is connected to the power grid outside. 19 3. Case set-up PI controller 𝑖ௗ,௚௥௜ௗ,௥௘௙ 3 phase → DQ 𝑖௚௥௜ௗ θ Plant Current controller Reference generation 𝑣஽஼,௥௘௙ 𝑣஽஼ 𝑖௥௘௙ 𝑖ଵ θ 𝑖ௗ,௥௘௙ Phase estimation θ 𝑣௅஼௅ Figure 3.8: Flow chart of the control scheme with reactive power control. 3.3.1 Control scheme The controller chosen to minimize the grid D-current was a PI controller tuned to be significantly slower than the current controller in the power converter. A PI controller was chosen since it is computationally inexpensive and still manages to perform the task well. It was tuned to be relatively slow since it allows for stable cascade control, and because reactive power control is not a time-sensitive operation. The PI controller uses the grid current as an input. The D-current of the facility grid is calculated by the estimated voltage angle, which was used with Eq. 2.7 to calculate the D-current. The PI controller then calculates an output as if the current was a DC current. The resulting id,ref is saturated, fed to the reference generation, and converted back into the three-phase domain using Eq. 2.8. It is then added to the existing reference, before being fed to the current controller as a part of iref . The energy used for the power factor correction is obtained by consuming more current from the grid. The existing reference generation regulates this. When the power converter emits D-current, the DC link voltage decreases, which causes the current reference in phase with the voltage to increase, thus keeping the DC link voltage close to the desired value. 3.3.2 Current limitations When controlling reactive power, the current limits of the power converter must still be regarded. When a current limit is reached, the current used to control reactive power must be lowered, since the mechanical load’s power supply must always be prioritized. The current was limited by saturating the D-current reference. Since the power converter has a current limit of 25 A RMS over time, the D-current was limited to 20 √ 3 A, corresponding to 20 A RMS, to allow some margin. The maxi- mum current would then equal a reactive power of about 14 kVAr. To ensure that the power supply to the load is not compromised during peak power 20 3. Case set-up usage, another limitation was created. The second limit depends on the part of the current reference that is in phase with the voltage, which can be regarded as a Q-current reference. The limitation was chosen to be 25 √ 3 − iq,ref A, meaning that the Q-current can reach up to 5 √ 3 A without the reactive power becoming limited. Above that, the D-current limit decreases linearly with the increased Q-current. The limited D-current reference id,ref can then be expressed as id,ref = min(id,ref,P I , 20 √ 3, 25 √ 3 − iq,ref ) (3.4) where id,ref,P I is the calculated output of the PI controller. To ensure that the PI controller for the reactive power control does not keep integrating an error after saturation is reached, anti-windup was also implemented. 3.4 Control of voltage harmonics Voltage harmonics are controlled by emitting a periodic current from the power converter, which matches the frequency of the harmonic in question. The current propagates through the grid impedance, thus inducing a voltage over the impedance. If the induced harmonic voltages are in anti-phase to the original harmonics, they will cancel. This technique requires: (1) Harmonic signal measurement or estima- tion. (2) Knowledge of the resulting gain and phase shift between the full bridge reference voltage and the induced voltage. The harmonic control scheme was imple- mented in parallel with the existing control scheme. An overview of the implemented control structure that handles the harmonic control is shown in Fig. 3.9. Harmonic controller 𝑖ிி Plant + Current controller Reference generation 𝑣஽஼,௥௘௙ 𝑣஽஼ 𝑖௥௘௙ 𝑖ଵ θ - + 𝑣௛௔௥௠ Phase estimation θ 𝑣௅஼௅ Figure 3.9: Flow chart of the control scheme with control of voltage harmonics. The voltage harmonic controller continuously estimates the chosen voltage harmon- ics with a Kalman filter. At the same time, a sinusoidal current with the same frequency as the chosen harmonic is emitted from the power converter. The phase shift and amplitude of the current are then changed to investigate what values give the lowest estimated voltage harmonic. Furthermore, the calculated resulting cur- rent is subtracted from the measured current as a feed-forward (FF) term to decrease disturbances in the current controller. An overview of the control scheme is shown in Fig. 3.10. 21 3. Case set-up 𝑣௅஼௅ Harmonic controller 𝑣௛௔௥௠ 𝑖ிி Kalman filter × 𝑠𝑖𝑛 Phase control Amplitude control Current calculation Figure 3.10: Flow chart of voltage harmonics control scheme. 3.4.1 Harmonic Estimation A stationary Kalman filter was chosen as the real-time harmonic signal estimator. Given a signal containing several sinusoidal components of different frequencies, the Kalman filter estimates states corresponding to the sinusoidal waveforms of a cho- sen set of frequencies. This corresponds to a bandpass filter which removes all other frequencies except the chosen. Plotting the states against the time axis then reveals the waveform of the specific frequency components. A clear advantage of using a Kalman filter instead of a bandpass filter is the ability to tune the filter bias towards measurements or modeled dynamics. A Kalman filter specified to estimate one signal component with the angular fre- quency ω has the state representation x1(k) = A(k) sin(kωT + φ(k)) x2(k) = A(k) cos(kωT + φ(k)) (3.5) with the dynamics [ x1(k + 1) x2(k + 1) ] = [ cos(ωT ) sin(ωT ) − sin(ωT ) cos(ωT ) ] [ x1(k) x2(k) ] + w(k) (3.6) [ y(k) ] = [ 1 0 ] [ x1(k) x2(k) ] + v(k) (3.7) where ω is the angular frequency of the component to be estimated, and T is the sample time. The amplitude of the harmonic component can be extracted using the mathematical identity A(k) = √ (A(k) sin(kωT + φ))2 + (A(k) cos(kωT + φ))2) = √ x2 1(k) + x2 2(k) (3.8) 22 3. Case set-up 3.4.2 Phase Shift Estimation The control output from the harmonic controller is a sinusoidal voltage added to the existing PWM voltage reference, which results in a current with the same frequency. Since the grid impedance is unknown, it is not possible to calculate the phase shift between the current output of the power converter and the induced voltage over the grid impedance. This is instead estimated by sweeping all possible phase shifts. To estimate the phase shift, the harmonic controller first outputs a compensating current with an arbitrary phase and amplitude, while the frequency matches the one on the voltage harmonic to be mitigated. A sweep is then performed by linearly increasing the phase shift of the mitigating current until 2π is reached. Given that the induced voltage over the grid impedance is not negligible in contrast to the har- monic voltage, a change in the amplitude of the estimated harmonic signal should be observed. The phase shift that minimizes the estimated harmonic voltage can therefore be found by letting the phase angle φ of the controller output sweep the interval [0, 2π]. Instead of iteratively changing the phase shift, the same result can be achieved by letting the controller output a sinusoidal wave of a slightly higher frequency ω0 +ω∆ than the frequency of interest ω0. This is equivalent to letting a wave with frequency ω0 slide with a constantly changing phase shift, where the speed corresponds to ω∆. The phase shift that gives the lowest estimated amplitude of the voltage harmonics can then be selected. Fig. 3.11 shows an ideal phase estimation cycle that success- fully captures the phase shift which gives the lowest estimated harmonic amplitude. Figure 3.11: Phase shift of the controller output voltage, and the resulting ideal estimated voltage harmonic. 23 3. Case set-up 3.4.3 Harmonic Amplitude Control Once a satisfactory phase shift has been found, it remains to find an amplitude of the control signal which minimizes the voltage harmonic component. This is implemented in a similar way to the phase shift estimation. A scaling variable γ which linearly scales the control signal is initially set to zero. Since it is assumed that a close value, although not perfect, of the phase shift already has been found, a linear increase of γ will initially dampen the estimated amplitude of the harmonic voltage. The scaling variable will further increase linearly until the harmonic amplitude no longer decreases. To maintain robustness against disturbances, the search ends when a new lowest harmonic amplitude has not been found during a predetermined time. The controller then selects the scaling that results in the lowest harmonic voltage amplitude. Fig. 3.12 shows an ideal cycle where the optimal phase shift and amplitude are found using the estimated voltage harmonics. Figure 3.12: Phase shift of the emitted current, and the ideal resulting estimated voltage harmonic. 3.4.4 Resulting disturbances for the current controller One problem when implementing the control of voltage harmonics was that the re- sulting currents affected the main current controller. More specifically, the current for harmonic mitigation was measured in the LCL filter and fed to the current con- troller, which registered a deviation from the references, and therefore tried to cancel out these. This was mitigated by subtracting the calculated resulting harmonic cur- rent from the measured current i1. The current can be calculated since the voltage reference from the harmonic controller vharm, the voltage over the capacitors in the LCL filter vLCL, and the impedance between the two are known. The impedance consists of the inductor L1, the internal resistance RL1, and the series resistance of 24 3. Case set-up the transistors Rt. The resulting calculated current using the jω-method is then iharm(jω) = vLCL(jω) − vharm(jω)√ (RL1 + Rt)2 + (ωharmL1)2e j arctan ( ωharmL1 RL1+Rt ) , (3.9) where ωharm is the angular frequency of the harmonic in question in rad/s. The current caused by one harmonic control output, iharm is defined in the same direction as i1. This results in a current that depends on a time-delayed voltage iharm(t, ωharm) = vLCL t − arctan ( ωharmL1 RL1+Rt ) ωharm − vharm t − arctan ( ωharmL1 RL1+Rt ) ωharm  √ (RL1 + Rt)2 + (ωharmL1)2 (3.10) The resulting FF term, corresponding to the total current created by the harmonic controller, is a sum of all harmonic mitigating currents as found in the relation iF F (t) = ∑ ωharm iharm(t, ωharm) (3.11) 3.5 Combined control Since the control of voltage harmonics was implemented separately from the existing control scheme, while the reactive power control was more integrated, combining the two controllers did not propose large direct challenges. The resulting control structure can be found in Fig. 3.13. However, one indirect problem that arose was that the same effect of harmonic control on the measured current i1 can be seen in the grid voltage igrid. The same calculated FF component iF F was then subtracted from the measured grid current to reduce disturbances. Harmonic controller 𝑖ிி Plant + Current controller Reference generation 𝑣஽஼,௥௘௙ 𝑣஽஼ 𝑖௥௘௙ 𝑖ଵ θ - + 𝑣௛௔௥௠ PI controller 𝑖ௗ,௚௥௜ௗ,௥௘௙ 𝑖ௗ,௥௘௙ 3 phase → DQ 𝑖௚௥௜ௗ θ - + Phase estimation θ 𝑣௅஼௅ Figure 3.13: Flow chart of the control scheme with reactive power control. 25 3. Case set-up 3.6 Hardware implementation The two control schemes for reactive power and voltage harmonics were implemented independently in hardware using two different methods. The reactive power con- troller was implemented separately from the power converter microcontrollers, in a Python program running on a PC with direct communication to the power con- verter. The program calculates the saturated reference current îd,ref as the control action and transmits it to the power converter through the CAN protocol. The voltage harmonics controller was implemented directly in the power converter mi- crocontroller. 3.6.1 Control of reactive power The reactive power controller requires current measurement at the factory main fuses. It proved difficult to communicate the measurements to the power converter in real-time, which meant that the measurements were outdated upon arrival. In- stead of directly wiring a current measurement into the power converter, grid voltage and current measurements were fed into an external PC. The voltage and current waveforms were obtained using a digital oscilloscope with a USB interface to trans- fer waveforms to the PC in real-time. The real-time measurements were processed in a Python program which transforms the current into the DQ domain. Fig. 3.14 shows a flow chart of the control scheme. The oscilloscope was set to capture a waveform of 0.1 s, with a sample rate of 12500 samples/s. The transfer of measurements from the oscilloscope to the PC over USB causes a delay of about 0.1-0.2 s. Only the voltage and current measurements from a single phase were considered to decrease measurement delays. The captured current waveform was then replicated and shifted 120◦ and 240◦ respectively to approximate the two other phases. Since the phase shift delays the waveforms, all data points cannot be used for the DQ transformation. To perform the DQ transformation, a phase angle of the voltage is required. The voltage phase angle is found using sinu- soidal regression on the voltage waveform. The phase shift and angular frequency of the wave are extracted from the fitted sine wave, and each sample is associated with a specific angle. The DQ transformation is then applied to all points in the current waveform. An average of the id,grid measurement is calculated and passed as input to the controller. Using the average of the current waveform does not cause any loss of information since only one controller output can be calculated after each waveform is acquired. The controller is a discrete PI controller, as in the simulations. However, since there is a significant delay between capturing measurements and applying control action, the controller was differently tuned. Once the control action is calculated, the reference id,ref in the converter is replaced with the new reference. After the controller has given a new control action, it immediately polls new data from the oscilloscope, and the process is repeated. 26 3. Case set-up Request measurements from Oscilloscope Phase finder DQ transformation Controller 𝑖𝑑,𝑟𝑒𝑓 Override 𝑖𝑑,𝑟𝑒𝑓 in power converter 𝐸𝐴 ϴ 𝑖𝑑,𝑔𝑟𝑖𝑑 , 𝑖𝑞,𝑔𝑟𝑖𝑑 𝑖𝑔𝑟𝑖𝑑,𝐴 Figure 3.14: Flow chart of the hardware implemented control scheme for reactive power control. 3.6.2 Control of voltage harmonics The control of voltage harmonics was implemented in the power converter by adding functions to the existing program executed by a proprietary RTOS in the microcon- troller. However, since the possibility of adding computations and still maintaining the real-time requirements was limited, some compromises were made. The most prominent change was regarding the harmonic estimation using a Kalman filter. Since the Kalman filter uses matrix multiplication, which has a relatively high com- putational complexity, the calculations could not be made for every voltage sample. The voltage and current are normally sampled every switching period, i.e. with a frequency of 50 kHz. Instead, every other sample from a single phase was used, and the calculations were made once every millisecond. Thus, the estimated harmonic amplitude was given with a frequency of 1 kHz, where the Kalman filter considered data with a sampling frequency of 25 kHz. The use of only one phase voltage works well if the assumption that the harmonics are symmetrical holds. To compensate for the less accurate estimations, and other delays created by the real-time control soft- ware, the sequence of finding phase and amplitude scaling was made longer. This was achieved by decreasing the rate of change for the phase shift and amplitude scaling sweeps, giving the Kalman filter more time to adapt to changes. Another change to ensure the real-time requirements was regarding the calculation frequency of the generated harmonic voltage. It was found to be too computationally 27 3. Case set-up expensive to calculate the harmonic voltage vharm, and by extension the calculated current iF F , at every sampling point. A change was then made to make these calculations every 10th sampling point, corresponding to a computation frequency of 5 kHz. Furthermore, the amplitude scaling was limited to 5 since larger harmonic currents were observed to generate too much heat in the DC-link capacitor and surrounding components. It was also decided that no other current limitations would be needed since the harmonic current creates both more and less current periodically. Thus, not increasing the average current significantly. 3.6.3 Test set-up The test set-up around the power converter was designed to emulate a similar en- vironment as the one created in simulations. Therefore, a total of three identical power converters were used. One that performs the actual control of reactive power and voltage harmonics, one that emulates an inductive load by emitting a current that lags the voltage, and a last one that emulates the current drawn by the me- chanical load. A power converter was chosen to act as an inductive load since it is easier to control and quickly change the reactive power draw, which was achieved by switching on and off another inductive load in the simulations. The load-emulating power converter was used by connecting the DC output to the DC output of the controlling power converter. The load emulator can then emit current to the grid that corresponds to the current draw of a mechanical load, thus decreasing the DC link voltage of the controlling power converter and making it draw the same amount of current. The current emitted back into the grid by the load emulator corresponds to the mechanical work of the physical load. Only the current drawn by the controlling power converter and the one that emulates the inductive load were measured. Since the current of the load emulator is supposed to be converted into mechanical work, and therefore not present in a real scenario, it should not be measured. A representation of the set-up is found in Fig. 3.15. Facility grid equivalent Inductive load Controller Mechanical load emulator Measurements 3 phase wall outlet DC Connection Figure 3.15: Description of the test set-up. 28 3. Case set-up There are however some limitations to the test set-up compared to the simulations. For example, the voltage harmonics to be mitigated are not generated in a controlled way and are therefore depending on the other devices connected to the grid at the time of the measurement. The grid impedance, and therefore the necessary current amplitude to mitigate the harmonics is also not controlled. Furthermore, since power used by the emulated load is fed back into the power grid, no significant changes in voltage amplitude will be created. If the power would instead be converted into mechanical work, the increase in current through the grid impedance would decrease the grid voltage at the facility. 3.7 Evaluation 3.7.1 Measurement equipment To measure voltage and current at the three-phase outlet, a Rhode & Schwarz RTH1002 Scope Rider digital oscilloscope was used. The scope was connected to a Micsig CP2100B current clamp and Rhode & Schwarz RT-ZI10 voltage probes. All other quantities were measured internally in the power converter with a measurement resolution of one decimal. The resolution was limited by the internal memory of the power converter. 3.7.2 Performance metrics To evaluate the performance of the reactive power controller, the D-component of the grid current was the main performance metric. A grid D-current equal to zero would correspond to a power factor equal to one, meaning a perfectly functioning reactive power controller. However, other performance metrics are needed to accu- rately evaluate the performance of the voltage harmonic controller. 29 3. Case set-up Sequential FFT To investigate the voltage harmonics and evaluate whether the Kalman filter gives an accurate estimation of the harmonics, fast Fourier transform (FFT) was used. An FFT was calculated every 50 Hz period, i.e. every 20 ms. The calculated ampli- tudes of the components around 250 Hz and 350 Hz were then extracted to use for comparison with the 5th and 7th harmonic estimations of the Kalman filter. THD The THD was used to describe the overall harmonic content in the voltage. The THD was calculated every 20 ms from the results of the sequential FFT according to Eq. 2.6. 3.7.3 Load cycle To evaluate whether the changes in the control structure impact the mechanical load’s power delivery, a load power cycle was used. The load cycle was used to test the converter during development. Other load cycles were also used, but only the one that proved most challenging was used in this project. The load cycle reaches the maximum power usage of 40 kW and returns 20 kW of power directly afterward. The cycle can be observed in Fig. 3.16. Figure 3.16: Load cycle for testing the power converter at peak load. 3.7.4 Test cases Six test cases were defined to evaluate the performance of the reactive power control and the voltage harmonic control. Two test cases were dedicated to each one of the three control schemes, reactive power control, harmonic control, and combined control. One of these two cases was used to test control performance during idle operation, and the other during the load cycle. 30 3. Case set-up Case 1 The first test case was used to evaluate the reactive power control when the me- chanical load is idle. It was done by observing the start of the controller on an inductive grid, increasing the parallel inductive load, and then decreasing it again. In the simulation, the additional parallel load was added by closing the switches in Fig. 3.7. When using the hardware, the load was altered by changing the D-current reference of the parallel-connected power converter. Since the delay in the commu- nication is large, the timing of the added parallel load for the measured case does not coincide with the timing in the simulation. The added parallel load makes the D-current on the grid go from 15 √ 3 A to 25 √ 3 A, which means that the D-current in the power converter should be limited during the load step. The actions of case 1 and the corresponding times can be found in Tab. 3.5. Table 3.5: Actions in case 1. Time [s] Action 0.0 Start measurement 1.0 Start controller 2.5 Add parallel load 4.0 Remove added parallel load 6.0 Stop measurement Case 2 The second case was used to test the reactive power control during peak power draw from the load. The evaluation was done by starting the controller before starting the measurement, and then measuring while running the load cycle in Fig. 3.16. The controller should be limited by the total current drawn during the load cycle. Case 3 Case 3 was used to test the voltage harmonic controller. The controller was eval- uated by measuring the grid voltage during the control sequence defined in section 3.4.3 for both the 5th and 7th harmonic simultaneously. The time to perform the sequence differs between simulation and measurement since the sequence was made longer in the hardware implementation as described in section 3.6.2. However, both controllers still sweep the phase shift and amplitude scaling, while estimating the voltage harmonic amplitude. Case 4 The fourth case was similar to case 2 since it evaluates the controller performance during the load cycle. In the same way, the control sequence was performed before measuring, and the time-axis of the measurements correspond to the time-axis of the load cycle shown in Fig. 3.16. 31 3. Case set-up Case 5 Case 5 investigated the combined control of reactive power and voltage harmonics. The start of the reactive power controller was made before the measurement started, and the actual test was to perform the harmonic control sequence while the reactive power controller was active. Case 6 The final test case was performed to investigate the combined control during peak load. Both controllers were started before the measurements and the time-axis cor- responds to the times of the load cycle. 32 4 Results & Discussion 4.1 Reactive power control 4.1.1 Case 1 The simulated response for test case 1 is shown in Fig. 4.1. Although a noisy signal is observed, it is clear that the current id,grid manages to reach a value close to zero quickly after the controller is started. Note that the id,ref current corresponds to the reference D-current in the power converter LCL filter, while id,grid is the measured D-current within the facility grid. The controller output becomes saturated around t = 2.5 s due to the current limitation scheme, since the additional external load draws more than 20 √ 3 = 34.6 A D-current. A significant overshoot is recorded at the load step due to an aggressively tuned controller, but the current quickly recovers and no other stability issues appear in conjunction with the saturation. Figure 4.1: Simulated reactive power control of external time-varying inductive load. Fig. 4.2 shows the same scenario with the hardware implemented controller. Here the measured current id,grid contains more noise. This is expected due to a significant increase in noise in the real current compared to the simulated current. A comparison 33 4. Results & Discussion is illustrated in Fig. 4.3 where both simulated and measured voltages and currents are shown. The figure shows one 50 Hz period, after the reactive power controller has stabilized. An important difference is that no Q-current is drawn in the measured case, which is a known limitation of the test set-up. Figure 4.2: Measured reactive power control of external time-varying inductive load. Figure 4.3: Simulated and measured voltage and current waveforms during reactive power control. Fig. 4.3 shows that the noise and harmonics in the measured current are much larger 34 4. Results & Discussion than in the simulated current. However, since the hardware implemented reactive power controller takes an average of the current during 0.1 s, the irregularities do not affect the control performance. The averaging instead acts as a filtering of the measurements. The computational delay of calculating the average over the most recent measurement sequence is negligible compared to the delay of the measure- ment oscilloscope. Fig. 4.2 further shows that the controller is saturated when the external load draws more than 34.6 A D-current. However, the controller takes more time to react due to the significant measurement delay. This results in a far greater overshoot period when the load changes, compared to the simulated case. 4.1.2 Case 2 The simulated currents in case 2 are seen in Fig. 4.4. Here, the shape of the load cycle is visible in the current iq,grid. No step of the external load is present, but the reactive power controller in this scenario is instead limited by the increasing iq,grid, caused by the load emulator. When the mechanical load decelerates, the controller can fully compensate for the external load for a short period before the controller prioritizes returning the braking energy. When the load is back to the idle value, the converter can once again provide the reactive power consumed by the external load. Most importantly, the performance of the mechanical load is not compromised since the load cycle can be performed without discrepancies. Figure 4.4: Simulated reactive power control of external inductive load during load cycle. In the hardware, id,grid has a slightly different shape compared to the simulation. Similarly to the simulation, the reactive power controller is limited when the load 35 4. Results & Discussion starts drawing current. Since the controller is slower, this is achieved in two large steps of the control action instead of a smooth transition. Once iq,grid transitions to braking, the controller is not fast enough to react to the suddenly available leftover power capacity of the converter, as the controller in the simulation does. This is not considered an issue or limitation of the controller since it is unnecessary to perform power factor correction on such a fast time scale. Figure 4.5: Measured reactive power control of external inductive load during the load cycle. As in case 1, it is clear that the simulations differ slightly from the measurements. There are several reasons for this, although the most notable are connected to how the inputs are measured. In the simulations, measurements are taken ideally at a high sampling rate. There are also minimal distortions in the current, and an accurate estimation of the voltage phase angle is available. The current id,grid can therefore be calculated accurately and often, yielding good operating conditions for the controller. In the hardware version, waveform data is captured through an oscilloscope for 0.1s, transmitted to a computer which performs the DQ transformation on the current waveform and then finally delivers the input to the controller. This method works, albeit slowly, to demonstrate the concept. Another solution could be to directly sup- ply the converter with fast and accurate measurements of the grid current, which is notably difficult. With the assumption that the voltage in the LCL filter is roughly the same as in the rest of the facility, the converter itself could perform the DQ transformation and reactive power control. However, this approach would most likely not be viable, even if the power converter’s hardware were changed, since the required communication speed would be unnecessary for such simple calculations. 36 4. Results & Discussion The reactive power control scheme is based on the current id,grid. This is not nec- essary but convenient since the current limitation scheme and current controller reference are defined in ampere. However, the controller could just as well be imple- mented with phase-angle or power factor as the controlled variable. This adjustment would not require the DQ transformation to be calculated, which could be beneficial if the controller were to be implemented in a microcontroller, but requires too large changes in the existing current control scheme to be investigated within this project. 4.2 Harmonic control 4.2.1 Case 3 The initial simulation for control of voltage harmonics also showed interesting re- sults. As seen in Fig. 4.6, the estimated amplitude of the voltage harmonics be- haves similarly to what was expected, although of course not as well as the ideal case shown in Fig. 3.12. The estimated harmonic amplitudes in Fig. 4.6 have a clear sinusoidal shape during the phase sweep, and are lowered when increasing the amplitude scaling. However, around 0.8 s when the estimated best phase is reached, the 5th harmonic reaches a value lower than the previous best, and the 7th reaches a value that is not the lowest reached. The reason could be that the two harmonics are not completely detached. The Kalman filter can not completely separate the signals, and since one current with two harmonic components compensates for both harmonics, they are affected equally by external disturbances. Figure 4.6: Simulated Kalman estimation of harmonics, together with the corre- sponding phase shift and amplitude scaling of the counteracting harmonic voltage. Figure 4.6 also shows that with almost identical increases in amplitude scaling, the estimated 5th harmonic is lowered more than the 7th. This implies that the chosen 37 4. Results & Discussion phase shift for the 7th harmonic is not as close to the true value as the one selected for the 5th. One reason for not finding a phase shift closer to the ideal one could once again be that the harmonics are not completely detached from each other. An- other reason could be the delay between changes in the voltage and changes in the Kalman filter estimation. Since the Kalman filter was tuned to be biased towards the model, the delay could be significant. A simple way to decrease the effect of the delay would be to make the control sequence slower, thus making the delay less significant relative to the changes in phase shift and amplitude scaling. When comparing the Kalman estimations to the sequential FFT found in Fig. 4.7, it is clear that they are very similar. The actual value of the harmonic amplitude does not perfectly correspond, but changes in amplitude over time correspond well. Since the controller’s objective is to find a control input that minimizes the harmonic amplitude, it is of greater importance to have accurate estimations of changes in am- plitude than the actual amplitude value. The sequential FFT therefore shows that the Kalman filter estimations function well as the basis for the control scheme. Fig. 4.7 also shows that the THD is substantially affected by the harmonic control. The THD was decreased by 58 % when comparing before and after the control sequence. If the algorithm had found a better phase shift for the 7th harmonic, the THD would likely have decreased further. Figure 4.7: Simulated harmonic voltage amplitudes and THD from sequential FFT. The voltage harmonic control sequence using the hardware implementation is found in Fig. 4.8. The estimated harmonic amplitudes show a similar behavior as the sim- ulated equivalent. However, the hardware implementation finds phase shifts close to the ideal value for both harmonics. This can be concluded since the estimated amplitudes between 4 s and 5 s are about the same, or better than the previous best 38 4. Results & Discussion value. It can also be observed that both estimated amplitudes decrease when the amplitude scaling increases, which also suggests that good phase shifts were found. A contributing factor to the improved phase shift estimation might be the slower control sequence, which decreases the impact of the Kalman filter delay. Figure 4.8: Kalman estimation of harmonics extracted from the power converter, together with the corresponding phase shift and amplitude scaling of the counter- acting harmonic voltage reference. Furthermore, Fig. 4.8 shows that the amplitude scaling for the 5th and 7th har- monic are identical. The reason is that the amplitude scaling limit of 5, set to protect the internal components, was reached. This implies that more harmonic compensation could be achieved with the same strategy if more current could be used. Additionally, less harmonic compensation is reached with a larger amplitude scaling compared to the simulations, suggesting that less current is emitted for the same scale factor. The sequential FFT of the measured voltage, found in Fig. 4.9, further shows that the Kalman estimations are accurate enough to use for the control scheme. The shape of the estimated 5th and 7th harmonic amplitude is once again very similar to the amplitude found by the FFT. One difference is that the FFT of the measure- ment contains more noise than the simulated counterpart. The main reason is most likely the increased noise present in the measured signals. Furthermore, the FFT only considers one 50 Hz period at the time, without information regarding prior harmonic content. The THD in Fig. 4.9 is 32 % lower after the harmonic control than before, which is less than the simulated case. This is mainly due to two factors. The first is that the 5th harmonic was mitigated more in the simulated case. The second and most important reason is that there are other harmonics than the 5th and 7th in the 39 4. Results & Discussion measured voltage. Fig. 4.10 shows two FFTs of one period each, before and after harmonic control. It is clear that the 5th and 7th harmonics are decreased, while other harmonics are still significant. Extending the control scheme to handle other harmonics would likely decrease the THD further. Figure 4.9: The resulting harmonic voltage amplitudes and THD from sequential FFT of measured voltage. Figure 4.10: Frequency content of the measured grid voltage, made from FFT of a single 50 Hz period, before and after control of voltage harmonics. The decrease in amplitude of the 5th and 7th harmonics, and the decrease in THD 40 4. Results & Discussion can be seen in Tab. 4.1. The numbers are extracted from the sequential FFT, where points before and after the control sequence are compared, both in the simulated and measured case. The table shows that the hardware simulation manages to suppress the 5th harmonic more, while the hardware implementation suppresses the 7th more. This further suggests that the simulation did not find an accurate phase shift for the 7th harmonic. Table 4.1: Decrease in harmonic content, when comparing before and after the control sequence. Quantity Decrease - Sim. Decrease - Meas. Ampl. 5th harmonic 78 % 50 % Ampl. 7th harmonic 41 % 65 % THD 58 % 32 % The difference in voltage and current, before and after control of voltage harmonics is seen in Fig. 4.11. It shows that the voltage shape is altered slightly in both simu- lation and measurements, while the measured voltage still includes visual harmonics. The currents before harmonic control differ in amplitude since there is nothing in the physical test set-up for case 3 that consumes current. After harmonic control, the simulated and measured currents are quite similar, except for the underlying 50 Hz wave in the simulations. Although the phase shifts and amplitudes are not the same, the similarity suggests that the generated harmonics represent the real voltage well and that the physical controller implementation works similarly to the simulated controller. It is again clear that the amplitude of the harmonic compo- nents in the current is lower in the measurements than in the simulations, while it was previously shown that the amplitude scaling is higher. Figure 4.11: Voltage and current before and after harmonic control for simulated and measured data. 41 4. Results & Discussion The voltage harmonic controller implemented in the physical power converter relies heavily on the assumption that the voltage harmonics are symmetrical on the three phases since only the A-phase voltage is used for the Kalman estimation. Fig. 4.12 shows the 5th and 7th harmonics for each phase using a sequential FFT. In the figure, it is clear that the C-phase has a lower 5th harmonic component than the other two phases, while the 7th harmonic has similar amplitudes in all phases. However, the difference for the 5th harmonic does not seem to affect the controller performance since the amplitudes change similarly during the control sequence. Because the 7th harmonic also reacts similarly to the control sequence, it can be deduced that the respective phase shifts of the 5th and 7th harmonics are similar in the three phases. Thus, the assumption that the harmonics are symmetrical holds sufficiently well in the environment of the measurements. Figure 4.12: The harmonic voltage amplitude from sequential FFT of measured data for all three phases. 4.2.2 Case 4 The fourth test case investigates the voltage harmonic controller’s performance dur- ing the load cycle. The harmonic amplitudes from sequential FFT and the THD are shown in Fig. 4.13. In the period where the mechanical load is active, between 0.5 s and 3 s, the harmonics in both simulation and measurements are affected. The measured voltage is affected more, which was expected since it was shown in Fig. 4.3 that the real current contains more harmonics than the simulated. The current harmonics then affect the voltage harmonics when the currents are sufficiently large. However, it is noteworthy that the 5th harmonic increases during acceleration of the mechanical load, while the 7th decreases. The most likely reason for this is that the unwanted current harmonics have phase shifts corresponding to mitigating the 7th harmonic while amplifying the 5th, and the effect becomes larger with a larger cur- rent. 42 4. Results & Discussion The most important result in Fig. 4.13 is that the harmonic amplitudes in both simulations and measurements are returned to the same level after the load cycle. Consequently, the harmonic controller maintains its function during the load cy- cle, and afterwards. The changes during the load cycle would likely exist without harmonic control since they are possibly caused by harmonics in the current. Fur- thermore, because the load cycle was executed successfully while performing voltage harmonic control, no over-current protection was triggered. Thus the idea that no further current limitations for the harmonic control were required appears to be correct. Figure 4.13: Voltage harmonic amplitude during load cycle for simulated and measured voltage, using sequential FFT. Fig. 4.14 shows the harmonic content of the voltage at three interesting points. The first is before harmonic control, meaning at the beginning of case 3. The second is at t = 1.7 s of case 4, where large deviations in harmonic amplitudes are observed. The last one is after the load cycle is finished. In the figure, it can be observed that, although the amplitude of the 5th harmonic is higher at t = 1.7 s than after control, both harmonics are still lower than they would have been without any harmonic control. Therefore, it is clear that the harmonic control dampens the harmonics, even when the load consumes maximum power. Fig. 4.14 also shows changes in other harmonics, mainly the 11th and 13th. However, it is difficult to draw any conclusions from the changes since higher harmonics were observed to change significantly over time, even without any harmonic control or mechanical load. 43 4. Results & Discussion Figure 4.14: Harmonic content of voltage at three different times, acquired using FFT. 4.3 Combined harmonic and reactive power com- pensation 4.3.1 Case 5 The harmonic control sequence when combined with reactive power control is shown in Fig. 4.15 and Fig. 4.16. The first figure shows the simulated scenario, while the second shows measurements and data from the physical power converter. The gen- eral shape of the harmonic amplitudes closely resembles the equivalent graphs Fig. 4.7 and Fig. 4.9 in case 3, especially for the simulated cases. As in case 3, the controllers perform similarly regarding the final amplitudes of the 5th and 7th har- monics after the phase and amplitude sweeps. However, the hardware implemented controller from case 3 has more success in suppressing the 7th harmonic compared to case 5. The opposite is true for the 5th harmonic. The sinusoidal shapes that appear on the harmonic amplitudes during the initial phase sweeps of the measured data differ slightly between case 3 and 5. This is observed when comparing Fig. 4.9 and 4.16. Even though the scaling of the com- pensating current is the same, the overall difference in amplitude during the phase sweep in case 5 is far greater. The amplitude for the 7th harmonic briefly reaches zero amplitude. This suggests that the converter’s current controller counteracts the generated harmonic reference currents less when it also has to control reactive power. An improved iF F generation might give more uniform results between the cases. However, it is difficult to draw more conclusions without further investigation of the converter’s existing current controller. 44 4. Results & Discussion Figure 4.15: Simulated FFT of harmonics, together with the corresponding phase shift and amplitude scale of the counteracting harmonic voltage. Figure 4.16: The harmonic voltage amplitude from FFT of measured data, to- gether with the corresponding phase shift and amplitude scale of the counteracting harmonic voltage. Tab. 4.2 shows the controller’s impact on the voltage harmonics. The simulated controller has very similar performance compared to the simulation in case 3 as shown in Tab. 4.1. However, the performance of the simulated controller and the hardware implementation is also very similar in the case of combined control. This further suggests that the current controller in case 3 is counteracting the harmonic 45 4. Results & Discussion control, while this effect is decreased in case 5. Furthermore, the effect on the THD is similar to what was expected, where the measured scenario achieves less decrease since the real voltage contains more harmonics than the simulated voltage. Table 4.2: Decrease in harmonic content, when comparing before and after the control sequence. Quantity Decrease - Sim. Decrease - Meas. Ampl. 5th harmonic 79 % 79 % Ampl. 7th harmonic 47 % 50 % THD 60 % 26 % When investigating the control of reactive power, the current id,grid now contains larger oscillations than before, as shown in Fig. 4.17. In the measured data, the amplitude of the oscillations follows the general shape of the harmonic amplitude estimations in Fig. 4.16. In both the simulated and measured case, the current id,grid is centered around 0 A. This indicates that the reactive power controller is effective, even when combined with voltage harmonic control. Figure 4.17: Controlled variable id,grid, average id,avg and controller output id,ref for simulated and measured case. 4.3.2 Case 6 The harmonic amplitudes when both controllers are active during the load cycle are shown in Fig. 4.18. The behavior is similar to case 4, Fig. 4.13, but with larger changes in the harmonics during load. In the simulations, the amplitudes are very similar, and the only notable differences are slightly more prominent changes at 46 4. Results & Discussion 1 s and 2 s. The measured signals have larger differences. Here, the 5th harmonic increases rapidly when the load cycle starts at 0.5 s and has a higher amplitude until around the time where the reactive power controller is no longer saturated. The amplitude during the load cycle is overall greater than observed in case 4, Fig. 4.13. The 7th harmonic also behaves differently. In Fig. 4.13 the amplitude of the harmonic decreases with around 50%, whereas in Fig. 4.18 it increases instead. In case 5 the harmonics appeared more sensitive to variations in the compensating harmonic current. The same reasoning could explain the different behavior in case 6 compared to case 4, that the existing current controller has a different effect on the harmonic currents when also controlling reactive power. Since the harmonic miti- gation was greater when D-current was emitted, it is logical that the effect would decrease when the D-current was limited because of saturation. Figure 4.18: Voltage harmonic amplitude during load cycle for simulated and measured voltage, using sequential FFT. The harmonic content of the voltage at three chosen times can be seen in Fig. 4.19. There, it can be observed that the amplitude of the 5th harmonic at t = 1.15 s is slightly higher than before control of voltage harmonics. This means that the combined control scheme, during a short time and peak load, results in an increase of the 5th voltage harmonic rather than mitigation. Even if the 7th harmonic is still dampened and close to the amplitude after control, the increase in the 5th harmonic shows that further investigation regarding combined control must be performed to create a more robust control scheme. 47 4. Results & Discussion Figure 4.19: Harmonic content of voltage at three different times, acquired using FFT. In Fig. 4.20, the simulated and measured voltages over the DC link are shown. In neither simulation nor implementation does the DC link voltage deviate more than 20V from the reference value. The simulated voltage is less noisy and the deliberate voltage oscillations are mostly constant. The measured voltage contains more noise but does not deviate further from the reference than the simulated voltage. The effect of the load cycle is also more prominent in the measurements than in the simulation. As in case 5, the measured signals in the DQ domain, shown in Fig. 4.21, contain more noise than without the harmonic controller. Apart from this, the simulation is very similar to the equivalent figures, Fig. 4.4 and Fig. 4.5, in case 2. A difference in the measured data of case 6 compared to Fig. 4.5 is that the hardware implemented controller reacts to the available current capacity when iq,grid crosses the x-axis. The controller holds this output even though the limitation is exceeded. This behavior stems from the slow sample rate of the measurements. The limitation scheme has some extra margin to avoid tripping the internal current limitation in the converter for these kinds of situations. Faster measurements would allow faster control and tighter margins, thus making it possible to couteract more reactive power when limited. 48 4. Results & Discussion Figure 4.20: Simulated and measured DC link voltage during load cycle with reactive power and harmonic control. Figure 4.21: Controlled variable id,grid, controller output id,ref and iq,grid, id,avg for simulated and measured case. 49 4. Results & Discussion 4.4 Potential improvements During the project, there were several limitations related to the existing power converter and its control structure. By making changes to the product and the control schemes, benefits for controlling reactive power and voltage harmonics might follow. 4.4.1 Reactive power control One of the main limitations regarding the control of reactive power was the ability to emit D-current during demanding power draw from the mechanical load. The reactive power compensation was considered to be a separate entity from the load’s power supply since alternatives would mean too large changes in the existing con- trol structure. If the reactive power control was instead implemented directly into the power converter’s current controller, the existing current limitations could be utilized to accurately determine how much current is available at all times during the load’s operation. The result would be less frequent saturation of the D-current, and therefore less frequent fluctuations in the grid power factor. 4.4.2 Voltage harmonic control Several improvements could also be made regarding the voltage harmonic control. One clear improvement would be to extend the control scheme to include other harmonics, which was shown to be beneficial in Fig. 4.10. However, this would require more computational power in the power converter since the Kalman filter is computationally expensive. Another improvement could be made by replacing the DC-link capacitor and surrounding components to handle more harmonic currents. This change would make it possible to mitigate more harmonics with one power converter. Furthermore, a strategy to handle changes in grid harmonics would be needed. Al- though an assumption that the voltage harmonics did not change over time was made, it cannot hold in reality over longer time spans. A simple way to implement adaptation to changes would be to periodically make small changes in phase shift and amplitude scaling for all harmonics, to see if a lower estimated voltage ampli- tude was reached. Such a method would adapt to changes relatively slowly, but would not generate large temporary changes in the grid harmonics. It was also assumed that the voltage harmonics are symmetrical, which was proved to be accurate enough in the environment of the tests. If the assumption does not hold in some environments, it would be possible to estimate and control harmonics on the three phases individually. It would require more computational power and a neutral wire connected to the power converter. The neutral connector would ensure that the currents going in and out of the three-phase full bridge must not sum to zero, which means that a non-symmetrical current could be emitted. The neutral 50 4. Results & Discussion wire would also enable the power converter to perform other types of power quality services, such as mitigating biased phase voltages. 4.5 Distributed control The control schemes added to the power converter could enable several units to cooperate using distributed control. Although distributed control schemes were not explicitly investigated within the project, some implications could be deduced from the results received and the methods used. 4.5.1 Reactive power control A potential obstacle when implementing distributed control is the need for com- munication between devices. Communication is however already required for the delivery of grid current measurements to the power converter. The simulated power converter had access to real-time readings of the grid current, which proved difficult to recreate in practice. Since it was shown that effective reactive power control could be achieved with significantly slower communication, relatively slow communication should be enough for distributed control as well. Control of reactive power with several units could potentially cause instabilities if each unit tries to perform control independently. The solution could be to have one unit or an external device that chooses how much D-current all units should emit and communicates the result. It could also be possible for each unit to communicate that a current limit is reached, meaning that other units can maintain the power factor while the load for the first unit is too high. Furthermore, when more converters are added to a facility, each power converter needs to emit less D-current to maintain the desired reactive power. Then, the fluctuations in power factor would be less significant when one unit reaches a current limit. 4.5.2 Voltage harmonic control Distributed control of voltage harmonics would also require communication between units. The main reason is that the phase shifts and amplitude scaling given from a control sequence would be inaccurate if another unit performed a control sequence simultaneously. One way to handle the issue would be for one unit to find the best phase shift and amplitude scaling, and share the values with the other units. It is possible for several units to accurately use the same phase shift since it is currently defined in relation to the phase angle of the grid voltage’s 50 Hz component. Another way would be to let different units handle different harmonics. Then, each power converter must only estimate one harmonic amplitude which saves computations, and the generated harmonic current should only affect the estimations of the same unit. 51 4. Results & Discussion 4.6 Ethical and environmental aspects As in all types of development, it is important to consider the environmental and ethical consequences of this project. The environmental impact is considered to be mostly positive. The integration of reactive power control and voltage harmonic mitigation in an existing product, or a product that would have been produced any- way, means that the need for products designed only for this purpose is decreased. As a consequence, the environment is positively impacted by the decreased need for materials, production, transport, installation, etc. Which in turn leads to decreased material depletion, carbon dioxide emission, particle emissions, and more. From a long-term perspective, the practice of integrating more functions into ex- isting products could reduce the need for some products and services. This could lead to a reduced demand for workers in some sectors, and the loss of employment is greatly impactful for the individual. It is still possible that some work opportuni- ties would be created regarding the added software of the multifunctional products, although there might not be as many. However, the risk of replacing jobs with tech- nology is not a unique problem and is present in almost all types of development. Furthermore, the use of localized reactive power generation and voltage harmonic mitigation facilitates the use of local energy production with renewable sources. Lo- cal production of reactive power enables an environment with high controllability compared to more traditional, centralized control. This would be beneficial for the development of microgrids since such grid architectures could require all power qual- ity services to be performed locally. Voltage harmonics from for example switching electronics and solar cells could also be mitigated close to the source. However, the possibility of local harmonic mitigation brings a question about responsibility. Is it still the power providers’ responsibility to mitigate harmonics? If so, could consumers receive benefits for mitigating harmonics, and therefore fees for causing harmonics? The market itself would most likely regulate this in the future. 52 5 Conclusion The project aimed at extending an existing power converter with additional control schemes to control reactive power and voltage harmonics. A simulation model of the converter and associated mechanical load was created, and new control algorithms were designed for the model. Ultimately, the control schemes were also realized in a physical converter. The designed controllers proved mainly satisfactory in both sim- ulations and in measurements. The control schemes successfully provided reactive power and mitigated voltage harmonics, while prioritizing the supply of power to an emulated mechanical load. Thus, localized control of reactive power and voltage harmonics using power electronics with other purposes was deemed possible, and an interesting area for further investigation. Overall, the simulated power converter and the physical converter with added con- trol schemes showed similar dynamics and results. Therefore, it was considered viable to regard conclusions drawn from simulated results as mostly accurate. Both simulations and measurements proved that it was possible for one power converter to continuously provide up to 14 kVAr for accurate reactive power control, both when acting separately and when combined with voltage harmonic control. When performing harmonic control in the combined case, the simulations showed a 79 % decrease in the 5th harmonic and a 47 % decrease in the 7th. The measurements were very similar, showing a 79 % and 50 % decrease respectively. In all investigated scenarios, the power supply to the mechanical load was main- tained. This is important since it is crucial to maintain the original function of the device if additional control schemes are going to be implemented. The reactive power control maintains the mechanical load’s operation by decreasing the controller output when the load’s power usage is high. The limitation scheme could however be better optimized to decrease fluctuations in reactive power and still ensure a sufficient supply of power to the load. For the voltage harmonic control, no addi- tional limitations depending on the mechanical load were imposed. However, the measurements showed notable differences in harmonic content during demanding power draw from the load. This could partly be explained by unwanted harmon- ics in the power converter current, but further investigations regarding the existing current controller and the harmonic control scheme are necessary to fully determine the cause. Overall, the harmonic control was deemed successful since it mitigates harmonics well in idle operation, and does not impose any constraints on the load’s power supply. 53 5. Conclusion 5.1 Future work There is much left to investigate regarding the effects of integrating control of re- active power and voltage harmonics in power converters. In this thesis, the control was constrained by internal current limitations and the requirement to maintain the DC link voltage within a specified interval. However, the effect of having significant oscillations in the DC link voltage was never considered. Studying the impact of voltage fluctuations on the overall lifetime of the converter’s components is there