scieee AI-readable full text Open interactive document viewer

Performance Improvement of a Buck Converter using Kalman Filtering

Adriano Jorge Moreira Pereira

Full text

FACULDADE DE ENGENHARIA DA UNIVERSIDADE DO PORTO Performance Improvement of a Buck Converter using Kalman Filtering Adriano Pereira Mestrado Integrado em Engenharia Eletrotécnica e de Computadores Supervisor: Prof. Cândido Duarte (FEUP) Co-Supervisor: Witold Gora (Infineon Technologies AG) October 30, 2015 c Adriano Pereira, 2015 ii Abstract Switching mode power supplies (SMPS) are widely used in power management systems due to the high efficiency that they can achieve. When comparing the two methods of controlling an SMPS, i.e. voltage-mode and current control, the latter offers an easier compensation loop implementation and faster response to load changes. However, a current sensor is required, at the inductor or the input. This sensing scheme increases the overall bill of materials of the system, the converter footprint, and makes the system more sensitive to several noise sources. With the constant development of integrated circuits such as microcontrollers, it is possible nowadays to develop new control techniques in terms of hardware and software synergies. This provides a shift in performance to higher levels by the deployment of advanced digital signal processing algorithms, breaking the barriers imposed by technological limits of the today’s semiconductor hardware components. The present dissertation aims at investigating the implementation of an extended Kalman filter (EKF) to improve the performance of a synchronous buck converter. The proposed EKF is based on a mathematical model of the buck converter, which takes into consideration several parasitics such as the inductor and capacitor equivalent series resistors. The goal is to take the advantages of using an observer type filter as the EKF in order to reduce the impact of noise sources, for instance thermal noise or any other type of Gaussian distributed noise. In the proposed EKF approach, the inductor current is estimated with no additional hardware and used as a parameter for the predictive control. The EKF algorithm has been implemented on an Infineon XMC microcontroller controlling a synchronous buck converter. Experimental results demonstrate an accurate estimation of the inductor current and reveal fast step responses. iii iv Resumo Fontes de Alimentação de modo de comutação (FAMC) são vastamente usadas em sistemas de gestão de energia devido à grande eficiência que conseguem atingir. Comparando os dois métodos de controlar uma FAMC, i.e. o modo de tensão e o modo de corrente, o último oferece um anel de compensação mais rápido e uma resposta mais rápida quando a carga é alterada. No entanto este método requer um sensor de corrente na entrada ou na bobine. A medição de corrente aumenta o custo de produção do sistema e torna o sistema mais sensível a várias fontes de ruído. Com o desenvolvimento constante de circuitos integrados como microcontroladores, hoje em dia é possível desenvolver novas técnicas de controlo tirando partido das sinergias entre hardware e software. Estas técnicas proporcionam um aumento do desempenho, pois permitem desenvolver algoritmos avançados de processamento de sinal, quebrando as barreiras impostas pelos limites tecnológicos dos componentes de hardware existentes hoje em dia. Esta dissertação tem como objetivo investigar a implementação de um filtro de Kalman estendido para melhorar a performance de um buck converter síncrono. O filtro de Kalman estendido proposto é baseado num modelo matemático do conversor buck, que tem em consideração parâmetros parasitas tais como as resistências em série equivalentes da bobine e do condensador. O objetivo é tirar partido das vantagens de usar um observador tal como o filtro de Kalman estendido de modo a reduzir o impacto das fontes de ruído, como por exemplo ruído térmico ou qualquer outro tipo de ruído Gaussiano. Usando a abordagem proposta a corrente na bobine é estimada sem qualquer hardware adicional e usada como parâmetro para controlo preditivo. O algoritmo do filtro de Kalman estendido foi implementado num microcontrolador Infineon XMC, usado para controlar um conversor buck síncrono. Resultados experimentais demonstram uma estimação exata da corrente na bobine e revelam rápidas respostas ao degrau. v vi Acknowledgments First of all I would like to thank my supervisor, Cândido Duarte, for his support, availability and scientific experience and to my co-supervisor, Witold Gora for the industrial background and guidance trough all the thesis. Moreover, I would like to thank all the engineers from the industrial microcontrollers division from Infineon Technologies, for receiving me during part of the thesis development. In special, I would like to thank Eng. Pedro Costa for his guidance and constant support in the diverse phases of the thesis and Eng. Pablo Yélamos for his valuable inputs. Furthermore, I wish to express my gratitude to all my family and friends that supported and helped me not just during this dissertation, but during all my life. Finally I would like to thank my girlfriend Mariana for her constant support and for her patience during all this time. Adriano Pereira vii xiv LIST OF FIGURES List of Tables 1.1 Brief description of the problem . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.2 Brief description of the proposed solution . . . . . . . . . . . . . . . . . . . . . 4 2.1 Pros and cons of power converter control modes . . . . . . . . . . . . . . . . . . 11 2.2 Brief comparison of control modes . . . . . . . . . . . . . . . . . . . . . . . . . 15 4.1 Buck converter design specifications . . . . . . . . . . . . . . . . . . . . . . . . 27 4.2 Buck converter parameter specifications . . . . . . . . . . . . . . . . . . . . . . 27 xv xvi LIST OF TABLES Abbreviations ACC Average Current Control ADC Analog-to-Digital Converter CCM Continuous Conduction Mode CCU8 Capture/Compare Unit 8 CMC Current Mode Control CS Control Switch DCM Discontinuous Conduction Mode DSP Digital Signal Processor EKF Extended Kalman Filter EMI Electromagnetic Interference ESR Equivalent Series Resistor FPGA Field-Programmable Gate Array IDE Integrated Development Environment KF Kalman Filter HRPWM High Resolution Pulse Width Modulation PCB Printed Circuit Board PCC Peak-Current Control PI Proportional-Integral PWM Pulse Width Modulation SMPS Switching Mode Power Supply SS Synchronous Switch SSA State Space Averaging VADC Versatile Analog-to-Digital Converter VCC Valley-Current Control VMC Voltage Mode Control xvii Chapter 1 Introduction One of the most important problems that electrical engineers had to solve was the energy transportation, from production site to the end users, such as factories, public illumination or houses. In order to provide an efficient transportation (with minimum power losses) engineers came to the conclusion that one solution could pass by having different levels of voltages across the distribution network. Nowadays, those levels normally vary between hundreds of kV and a few hundreds of V, with three or four layers in between. This implies the need for devices that are capable of increasing/decreasing the voltage across the distribution network. Those devices are part of an important area in electrical engineering, which is power conversion. Power conversion, however, is not limited to energy transportation systems, which mainly rely on AC-AC converters (transformers). Power conversion systems can be also AC-DC, DCAC or DC-DC. These last converters can be categorized in linear regulators and switching-mode power supplies (SMPS). Until recent years, linear regulators were the most common solution used, featured by low ripple and fast transient response. The main problems with linear regulators are their adaptability and the efficiency, which is relatively low. For instance, for a typical input-to- output ratio of 12 V to 3.3 V, the efficiency is in the order of 3.3/12≃28 % [1]. On the other hand, modern SMPS can theoretically achieve an efficiency of 100% at any voltage ratio, meaning that if the target is power efficiency, then SMPS are the answer. Numerous topologies exist for the design of SMPS, such as buck, boost, buck-boost, half-bridge or full-bridge. The most known and the one studied in this dissertation is the buck converter. The most classic circuit for a buck converter comprises four main components: an inductor, a capacitor, a transistor acting as a control switch (CS) and a freewheel diode, which conducts when the switch is off. To further improve the efficiency, the freewheel diode is replaced by another switch, with the purpose of reducing the power losses of the diode with a lower conduction resistance of the additional switch [2]. This switch, usually named synchronous switch (SS), only conducts when the main switch is not conducting, requiring a synchronization between both control signals. The diagram of a synchronous buck converter is depicted in the Fig. 1.1a. For the present dissertation, only the operation in continuous conduction mode (CCM) will be assumed, i.e. when the buck converter operates with the inductor current always above zero, which 1 2Introduction Vin Vout Co CiSS CS iL control signals L s2 s1 (a) s1 off s1 on s2 off s2 on iout iL(t) 0Ts2Ts3Ts vout (t) (b) Figure 1.1: Synchronous buck converter (a) circuit, and (b) illustrative waveforms. is its most common usage – discontinuous conduction mode (DCM) will not be addressed here. The inductor current and output voltage relation for several switching times Tsare represented in Fig. 1.1b. The elimination of the noisy contributions in SMPS can be quite troublesome. In fact, noise can manifest due to several sources in a buck converter. Input noise can be dominant because it can be propagated directly into the output. This can be due to the finite input capacitance or a significant value of its equivalent series resistance (ESR) [3]. Other noise mechanisms originate from a non-optimized design of the printed circuit board (PCB). For instance, input-to-output noise injection can arise from the input lead inductance, which in conjunction with the input capacitor 1.1 Problem Statement 3 Table 1.1: Brief description of the problem. Problem Current-mode control +Faster transient response −Requires current sensor, which increases cost can cause ringing effects. At the output, also the finite output capacitance can represent a noise source, as well as its ESR, which lead to an undesirable ripple behavior [3]. In general, the suppression of such noise contributions is not straightforward. The probability distribution of the noise processes mentioned above is not usually known. Some noise can be Gaussian if associated with conductor resistivity, but most of the phenomena mentioned mainly produce a constant ripple behavior at fixed frequency. Typically, the latter case is often mitigated by using good quality (expensive) passive devices in conjunction with a careful layout of the PCB. On the other hand, eliminating Gaussian noise is not easy, since it is not concentrated at a single frequency. This problem is also addressed in the present dissertation. 1.1 Problem Statement The most intuitive way for controlling the output voltage is to measure the output voltage, compare it to the predefined reference voltage, and introduce a negative feedback loop into the system – this is generally called voltage-mode control. Another way to maintain a constant voltage at the output consists on controlling the inductor current value (peak, valley, average, etc.) [4]. Electrical principles tell us that current is faster than its voltage, so if the current changes are sensed first than voltage, then it should act on the control loop much faster. For these reasons, in industry current-mode control is often preferred to improve the transient response, and reduce the controller complexity as well. On a buck converter, the current is typically sensed on the inductor. In order to measure a current in an electronic circuit, a shunt resistor and a high-gain amplifier is typically employed, which due to the current discontinuities must be extremely wide band to avoid signal distortion. Alternatively, a current transformer can also be used, but in any case, the overall production cost is increased. Furthermore, the existence of current sensing circuitry also increases the system footprint and power dissipation. The present work specifically addresses these limitations by using a “current sensorless” approach in which the hardware for current sensing can be omitted and current can still be estimated. As the sensorless current estimation avoids additional hardware, noise immunity is required in the estimation process, otherwise the resulting current will be inaccurate. Table 1.1 provides a summary for the problem addressed. 4Introduction Table 1.2: Brief description of the proposed solution. Proposed solution Approach: Predictive current control based on current estimation with EKF Targets: Better performance than conventional voltagemode control with the same number of components Improved noise immunity inherent to KF processing, with similar performance compared to other predictive methods, and similar computation requirements as well. 1.2 Proposed Solution In recent years some methods where proposed to overcome the aforementioned drawbacks. To eliminate the need for the current sensing hardware, prediction techniques have been developed for the estimation of parameters of the buck converter. For the prediction of the inductor current, current observers can be used [5]. However, for typically noisy systems such as non-isolated converters, estimation based on Kalman filtering (KF) is preferable [6]. KF is a state estimator, introduced in 1960 by Rudolf Kalman [7], which allows the extraction of useful information in noisy signals. It can be regarded as a kind of observer, although it relies on a stochastic process rather than deterministic. For nonlinear processes, extended Kalman filtering (EKF) is usually adopted. This dissertation proposes a method to implement a current control algorithm in a synchronous buck converter using EKF. In the proposed solution the inductor current is estimated, avoiding the use of current sensor hardware. Moreover, since the proposed approach relies on KF, as long as the noise is Gaussian distributed, noise reduction can also be achieved when compared with other types of predictive approaches. Table 1.2 gives a brief summary of the proposed solution. 1.3 Objectives of this Dissertation SMPS where originally controlled with analog loops. However, with increasing processing capability at reduced areas and more competitive prices of integrated circuits such as microcontrollers, digital signal processors or field-programmable gate arrays, led to a increasing growth in the digital control methods. These allow the use of more complex functions, which cannot be implemented in fully-analog approaches [8]. The present dissertation addresses current-mode control performed in the digital domain with a microcontroller from Infineon Technologies. In specific, the objectives for this dissertation can be summarized as follows: •Investigate and develop a current estimation algorithm, based on a model of the buck converter circuit and its input and output voltages; •Design and tune a control loop that uses the current estimation algorithm to control a synchronous buck converter; 1.4 Structure of the Dissertation 5 •Implement an optimized and efficient control loop in a experimental setup, in order to prove the theoretical concept. The proof of concept is implemented in the a buck converter evaluation kit from Infineon Technologies, which uses the XMC4200 microcontroller (ARM-M4-based architecture). To aid in the code development and debug, the new DAVE4 IDE is used, launched as productive version in July 2015 by Infineon. 1.4 Structure of the Dissertation Following the brief introduction to the dissertation goals, the present document is organized as follows. •Next chapter contains an overview of SMPS control methods an their evolution. Voltage control mode, current control mode and its sensorless implementation, the predictive current control are described, analyzed and compared. The literature review for predictive current control is also done in this chapter. •Chapter 3 provides a theoretical derivation and development of a predictive current control algorithm based on EKF. The model of a synchronous buck converter, the EKF tuning and the control loop design will be described. •In Chapter 4, the simulations and proof-of-concept experiments are presented, including a description of the hardware and conditions of operation of the converter. A comparison is performed between the expected values (from the analysis in Chapter 3) and the measurement results. •The final chapter gives a critical analysis of the obtained results, as well as a comparison with other methods present in the literature. Finally, the fulfillment of objectives is discussed, followed by suggestions for future work. 12 Overview of Buck Converter Control 2.3 Predictive Current Control The classical control methods described in the last two sections are the most used and the most mature today. In the recent years, a new trend appeared, which instead of measuring the inductor current, tries to estimate it, eliminating the need for additional sensors – this is called predictive current control. Predictive current control uses the often called current observers to substitute the current measurement circuit. A current observer is nothing more than an algorithm that uses a model of the system and measurements of one or more system variables to estimate the current value. In the case of the buck converter, normally the input and output voltages are measured and used to estimate the inductor current value. One of the first methods that tried to predict the inductor current was presented in [18], which relied on the measurement of the inductor voltage. This voltage would then be integrated and represent the inductor current value. Nowadays, two main methodologies are employed to derive a model for the inductor current: one is based in the known equations for the inductor current slopes, which are calculated based on buck converter measured voltages (input and output) and circuit intrinsic parameters, such as the inductor value; the other one, instead of modeling only the current, takes into account the model for the complete system. Usually the second approach is computationally expensive when compared to the first one, because more variables are considered in addition to the one that needs to be estimated. Buck converters, as any other electronic circuit, has its own non-idealities and parasitics due to the components and intrinsic work principle, being the modeling of the complete system an advantage – the cross influences are better represented. Next, a review of existent methods is presented for predictive current control, using both methodologies described above. The performance of these methods will be evaluated and compared, not only between them, but also with state of the art control methods (VMC and CMC). A digital control method for DC-DC boost converters operating in CCM is studied by Mattavelli [19]. The resistive parasitics of the circuit are not considered, so the derived model for the system only estimates changes in the value of the inductor current. Prediction of the inductor current variations is done through a state observer, measuring in the first implementation only the output voltage. The proof-of-concept algorithm was implemented in a FPGA and developed in VHDL, being the hardware a 100 W boost converter, with an input voltage of 24 V, output of 48 V and switching frequency of 180 kHz. Experimental results show good adaptability of the method to load variations but struggles with input voltage disturbances, which lead to the implementation of an input voltage feed-forward algorithm. Simulations and experimental results proved the better performance over the initial method to input voltage changes. The results were also compared with a conventional voltage mode control method, showing better performance when the input voltage is feed-forwarded. Two methods that do not require current measurement are proposed by Beccuti et al. [20]. The method extracts the current information using the known system variables, such as the input voltage, output voltage and the duty cycle. In the second approach the authors propose an EKF to 2.3 Predictive Current Control 13 estimate the inductor current and the capacitor voltage and claim that this compensates the computation time delay, accounts the switching behavior of the converter and reduces the measurement noise. The experimental algorithms are implemented in a fixed-point DSP that control a boost converter operating at 100 kHz and with variable input and output voltages. Both algorithms show good adaptability to line and load changes, while the algorithm implemented with EKF is capable to provide a more accurate and less noisy current estimation. Qiu et al. [21] propose a general approach to 3 different types of SMPS – buck, boost and buckboost converters – operating in continuous conduction mode. The average current control strategy tries to implement a first-order low pass filter based on the sampling of the input and output voltages to estimate the current, using the last one to compare with the current reference provided by the voltage loop. Current regulation is achieved in two steps: in the first switching cycle the valley current is adjusted, being the average value regulated in the subsequent cycle. Experimental results are evaluated in a boost converter, being the input and output voltages, respectively, 12 V and 24 V, with a 100 kHz switching frequency. A TMS320F2812 DSP system was used as control hardware. The results showed a 200 µs step response to both step load or input voltage changes. In addition to this fact, the current reference is achieved in two switching cycles with the proposed control algorithm. A similar method is presented in [5], proposing a current observer for predictive current control of a buck converter. In the first implementation the current observer is based in the equations of the inductor current slopes, without considering any parasitics in the system. The author observes that with the ideal equations the method would diverge and proposes an optimal current observer, having into consideration the parasitic parameters of the circuit, such as the freewheel diode voltage drop and the inductor series resistance, achieving the desired convergence of the method. The control loop used in [5] applies controls the valley current with trailing edge modulation, claiming that it can eliminate the current error in less than two switching cycles. The experimental setup consists in a buck converter, controlled by a DSP that steps down the voltage from 10 V to 6 V with a switching frequency of 100 kHz. Results indicate that the step response of the proposed method rounds the 200 µs, showing a 2 times faster response when compared to a regular VMC loop, implemented using a PI controller. Zhang et al. [22] develop a method using an EKF for estimating the inductor current in a boost converter. The boost converter is modeled using state-space averaging and in the first implementation modeled with a fixed load. This modeling is not suitable to a buck converter in normal mode of operation, because the load is always changing (otherwise there would not be a necessity for the control loop). To overcome this issue, a load estimation algorithm is proposed, rewriting the load as a function of the inductor current and the output voltage. The complete control algorithm is depicted in Fig. 2.4. The proof-of-concept is done in a boost converter that steps up the current from 5 V to 15 V with a switching frequency of 100 kHz. Experimental results prove that the method is able to estimate the current with a 5 % error within steady state and 10 % error in the transient response of 33 %. Finally the author highlights the fact that this method is less affected by electromagnetic 14 Overview of Buck Converter Control L CVout + - R ADC Vout Current Loop Driver Extended Kalman Filter S PWM Voltage Loop ADC Vin Vin + - IlVout Iref d D Figure 2.4: Boost converter control algorithm. [22] interference (EMI) noise than other predictive control methods, giving the fact that EKF can effectively filter out the noise from the output voltage, reducing then its influence on the control loop. This premise, however, is not verified using using any simulation or experimental result. 2.4 Summary An overview of the buck converter control methods was performed in this chapter. In sections 2.1 and 2.2 the classic control modes for SMPS were described. VMC is the most common one due to it’s simplicity (only has one control loop) but shows slow transient response and doesn’t provide a natural current limitation. CMC overcomes the voltage mode limitations sensing the inductor current, which increases the overall cost of production of the device. Table 2.2 summarizes the principles of operation of the different methods. Different implementations of CMC also have limitations: PCC and VCC suffer from subharmonic oscillation at some duty cycles, requiring slope compensation and have an inherent limitations on duty cycles. Average-Current Control solves some of the problems of PCC and VCC but the measurement of the average current is more difficult. The drawbacks in the current measurement led to a different digital method for controlling SMPS: the Predictive Current Control. Mattavelli [19] proposes a model for the variations of 2.4 Summary 15 Table 2.2: Brief comparison of control modes. Method Operation principle VMC Duty cycle proportional to output voltage CMC Converter acts as a current source •PCC Control switch turned off when peak iLis achieved •VCC Control switch turned on when valley values iLis achieved •ACC Average current value of iLtries to achieve the reference value the system and uses it to control a boost converter. Experimental results show that the control algorithm achieves better results than the voltage mode control only if the input voltage is feedforwarded. Beccuti et al. [20] present two different methods of controlling DC-DC converters: in the first the inductor current is derived from the system known or measured variables, such as the duty cycle and the input voltage and output voltage; the second one considers the whole system model and is implemented using EKF. This approach shows better accuracy and noise immunity in the current estimation. Qiu et al. [21] propose a generalized method for buck, boost and buck-boost topologies, verifying the algorithm with a boost converter. Results show a step response of 200 µs and a current error elimination in two switching cycles. Run et al. [5] present a similar method that uses the inductor current slopes equations to control a buck converter. It achieves a transient response two times faster than the regular voltage mode controller using a PI. Zhang et al. [22] use an EKF as a current observer for a boost converter, proposing a load estimation algorithm to improve the results. An accuracy of 5 % is achieved in steady state while in steady state the load error is never bigger than 10 %. 16 Overview of Buck Converter Control Chapter 3 EKF Based Predictive Current Control Predictive current control is a method to control SMPS, but unlike other control methods it is not limited only to the design and tuning of control loops. This chapter provides the theoretical derivation of a control loop for a synchronous buck converter in three parts. In the first section a model of the buck converter is be presented, considering some important parasitic parameters that try to represent the circuit with reasonable accuracy. On the second section an augmented state EKF for both inductor current and load estimation is proposed. Furthermore, the equations for the state propagation and output are derived. The third section studies the control loop design and tuning using the current observer developed in the first two sections. 3.1 Modeling the Buck Converter The typical operation of SMPS is considered as “time variant” due to the fact that a different time-invariant system can be derived for each switching cycle [23]. One way to simplify the analysis and modeling of SMPS is applying state-space averaging (SSA). This method has been around since the seventies [24,25] and since then it has found a relatively widespread use. Besides our target topology, which is a buck converter operating in CCM, SSA has been applied to almost any sort of switching-mode power converter [23,26]. The approach relies on the assumption that the circuit time constants are much longer when compared to the switching frequency 1/Ts. From this, a simple but relatively accurate model can be obtained for DC and small-signal analyzes of buck converters. The technique can be applied as follows. First, the system is formulated as in any other linear system, i.e. one defines the states of the system, which usually are voltages or currents of the elements that can store energy, such as capacitors and inductors, respectively – e.g. x(t)=[iL(t),vC(t)]T. Considering the synchronous buck converter represented in Fig. 3.1, during ton the Kirchhoff current and voltage equations are as follows. 17 18 EKF Based Predictive Current Control L S1 C Vout + - R Driver S2 Vin + - Rc Rl Figure 3.1: Synchronous buck converter circuit with parasitics (Rland Rc). vin(t) = RLvL(t)+Ld dtiL(t) + vC(t) + RCCd dtvC(t)(3.1) iL(t) = Cd dtvC(t)+ 1 Rout vC(t)+RCCd dtvC(t).(3.2) This set of differential equations express the evolution of the capacitor voltage vC(t)and the inductor current iL(t)across the time. Representing the equations (3.1) and (3.2) in order to d dtiL(t) and d dtiL(t), respectively, the result is d dtiL(t) = −RL L+RCRout L(Rout +RC)iL(t)−Rout L(Rout +RC)vC(t)+ vin(t) L(3.3) d dtvC(t) = Rout C(Rout +RC)iL(t)−1 C(Rout +RC)vC(t).(3.4) KF relies on an algorithm that uses the state-space form to perform the estimation of the states. Equations (3.3) and (3.4) are formulated in a way that it is very simple to identify the statespace variables, i.e. the states x(t)are iL(t)and vC(t), and the input to the system u(t)is vin(t). Writing the mentioned equations in the state-space form, using as reference the general state-space equation ˙ x1(t) = A1x(t) + B1u(t), the sate space model during ton is given by "d dtiL(t) d dtvC(t)#=  −RL L+RCRout L(Rout+RC)−Rout L(Rout+RC) Rout C(Rout+RC)−1 C(Rout+RC) "iL(t) vC(t)#+"1 L 0#vin(t)(3.5) The same analysis is then performed for the circuit during toff. The model is very similar to the one during ton, except for the fact that the signal vin(t)is not considered as an input anymore. If we consider the state-space model during toff to be ˙ x2(t) = A2x(t)+B2u(t), then A2=A1and B2= [0,0]T. Unifying both state-spaces is the next step, using SSA. State variations of the buck converter across one switching period Tscan be represented joining in the same equation the ton and toff state 3.2 Extended Kalman Filter Design 19 space representations. Considering δ=ton/Tsand the equation that describes the whole switching period as ˙ x(t) = δ˙ x1(t)+(1−δ)˙ x2(t)(3.6) = [δA1+(1−δ)A2]x(t)+[δB1+(1−δ)B2]u(t),(3.7) The state-space averaged model for a synchronous buck converter considering the parasitic parameters is given by "d dtiL(t) d dtvC(t)#=  −RL L+RCRout L(Rout+RC)−Rout L(Rout+RC) Rout C(Rout+RC)−1 C(Rout+RC) "iL(t) vC(t)#+"δ L 0#vin(t)(3.8) However, the derived model is a continuous time state-space model, which is inappropriate to implement in a discrete control algorithm, such as the one implemented in a microcontroller. A discrete state-space model of ˙ x(t) = Ax(t)+Bu(t)can be calculated by x(k+1) = eAT+ZT τ=0 eATdτB(3.9) or by a small-step approximation considering that eAT≈I+AT. Using the approximation, the discrete state-space model of the buck converter is given by "iL(k+1) vC(k+1)#=  1−RL L+RCRout L(Rout+RC)Ts−Rout Ts L(Rout+RC) Rout Ts C(Rout+RC)1−Ts C(Rout+RC) "iL(k) vC(k)#+"δTs L 0#vin(k).(3.10) 3.2 Extended Kalman Filter Design KF is applied to linear systems, described in the form of a state space model, generically represented as xk+1=Axk+Buk+wk(3.11) zk=Hk+vk(3.12) where xis the system state variable, uis the system input vector, zis the measurement, Ais the state transition matrix, His the observation matrix and wand vthe process and measurement noises, respectively. The state transition matrix Acan be seen as the description of the system dynamics – the relation between the current and the next system state. Hshows the relationship between the measured values and the state of the system. Given this state model, KF makes use of a state prediction relying on the past estimated states. The algorithm is divided in two main phases, which are the prediction and estimation. Considering the system state xkat the instant k, prediction phase takes the information until k−1 and predicts 20 EKF Based Predictive Current Control the state xk. The estimation phase accounts the measurement of the state, zkand corrects the predicted value. The prediction phase has into account the system state vector and produces an estimation for both the state and covariance, using ˆ x− k=Aˆ xk−1+Buk(3.13) P− k=APk−1AT+Q(3.14) where Pis the error covariance matrix and Qis the process noise covariance. The superscript ’-’ means that the value is predicted, while the ’ˆ’ superscript means an estimated value. In the estimation process, three main steps are executed. During the first one, the Kalman gain is calculated as follows Kk=P− kHT(HP− kHT+R)−1(3.15) where Kis the Kalman gain and Ris the measurement noise covariance. The second step computes the state estimation, using the measured value to update the previously predicted state ˆ xk=ˆ x− k+Kk(zk−Hˆ x− k)(3.16) where zis the measurement. In this process, the final value of the estimation is calculated. In the next step, the error covariance is computed. This value needs to be updated for the next cycle iteration Pk=P− k−KkHP− k(3.17) This concludes the algorithm. A more compact form in algorithm is presented in (3.1). Algorithm 3.1: Kalman Filter Init: Intialize ˆ x0,P0 Input: Measurement zk Output: Estimation ˆ xk 1for k←0to ndo 2ˆ x− k=Aˆ xk−1+Buk 3P− k=APk−1AT+Q 4Kk=P− kHT(HP− kHT+R)−1 5ˆ xk=ˆ x− k+Kk(zk−Hˆ x− k) 6Pk=P− k−KkHP− k 7end The model derived in the previous section is the base model for the current estimation algorithm. Nevertheless the dependency of the model on the load resistor Rout arises a limitation to this model – in a buck converter the load is not known and varies with time. To overcome this limitation, a estimation of two variables is performed, namely the inductor current iLand the load resistor Rout. One way to do this double estimation is considering Rout as an additional state that 3.2 Extended Kalman Filter Design 21 will be estimated alongside iL. The model of the buck converter until now was linear, hence suitable to implement with the standard KF algorithm. But if the load is estimated it will become nonlinear, due to the state multiplication. EKF becomes then the most appropriate state estimator to apply to this model, considering its capability of handling with nonlinear models. This method assumes a new model for the system, given by xk+1=f(xk,uk)+wk(3.18) zk=h(xk)+vk(3.19) which represents a minimal change in the KF algorithm, represented in (3.2). Algorithm 3.2: Extended Kalman Filter Init: Intialize ˆ x0,P0 Input: Measurement zk Output: Estimation ˆ xk 1for k←0to ndo 2ˆ x− k=f(ˆ xk−1,uk−1) 3P− k=APk−1AT+Q 4Kk=P− kHT(HP− kHT+R)−1 5ˆ xk=ˆ x− k+Kk(zk−h(ˆ x− k)) 6Pk=P− k−KkHP− k 7end However, the EKF has one important drawback, i.e. the algorithm can diverge if the initial estimate is wrong, or if the system is incorrectly modeled. This happens because EKF applies a linearization to the model in the form of A≡d f dx ˆ x− k ,(3.20) H≡dh dx ˆ xk .(3.21) In order to do the parameter estimation an augmented model needs to be derived from the final state-space model represented in (3.10). The buck converter load will now change in time, being now called Rout(t). The model for the new state can be considered constant or slowly varying, i.e. dRout(t)/dt=0. The discrete equations that represent the state transition of the system are given 28 Experimental Results Figure 4.1: Infineon XMC buck converter kit. The buck converter board has Infineon BSZ060NE2LS OptiMOS power MOSFETs, BOURNS SRF1280-330M inductors and PANASONIC electrolytic capacitors. Alongside these specifications and components, the board also has a step-load switch, which can be used to easily introduce a load-step in the buck converter. Lastly, the inductor current can be sensed using the built-in current sensing circuit, composed by a 15 mΩshunt resistor and a LM358D operational amplifier. XMC4200 has a diverse set of peripherals that can be used to do SMPS control. The ones used in this project are the timers, in specific the capture/compare unit 8 (CCU8) that provides signals with 12.8 ns resolution is used with an high-resolution pulse width modulation (HRPWM) module, generating then PWM waves with a resolution of 150 ps and the versatile analog-to-digital converter (VADC), having a 12 bit resolution. The HRPWM module is used to generate the control signal for the control switch, as well as the inverted signal for the synchronous switch, implementing also a dead time interval to avoid short circuits in the circuit. VADC is used to sample the input and output voltages, having some data accumulation features that will be discussed later. The platform used to configure the peripherals, write the code and download it to the microcontroller is DAVE4, an Eclipse based integrated development environment (IDE) developed by Infineon and launched as productive version on July 2015. DAVE has a set of APPs that can be 2The shunt resistance presence described means that the buck converter circuit has an additional resistor in series with the inductor, which can be added to the inductor winding resistance on table 4.2. So in practical implementation, the shunt resistor is added to this parameter. 4.1 Setup Description 29 configured in a GUI interface, allowing a faster and intuitive peripheral configuration. The APP used in this dissertation was the buck converter control, released as beta version. This APP allows the configuration of the buck converter switching frequency, control rate of the control loop, ADC channels to be converted, providing also overload protection. The APP diagram is shown in Fig. 4.2, were some peripherals referred above are also represented. Figure 4.2: Diagram of the peripherals used by the microcontroller unit. Debugging was done using the Eclipse plugin winIDEA Open, developed by iSYSTEMS, which allows logging of the debug variables in a text file format, which can be easily processed, analyzed and plotted in MATLAB. The data logging was done using 4 arrays that can store all the important variables for the algorithm: output voltage, input voltage, duty cycle and inductor current. The first tree are inputs to the algorithm and the inductor current is logged as a reference for the estimation parameters. Each value is logged once per switching cycle until the 1500th switching cycle is hit – an observed number of cycles that allow the buck converter voltage to achieve steady state. The debugger is then paused and the arrays exported to a text file, which is processed and exported to a MATLAB data file. All the simulations are done in MATLAB, allowing a simple and quick prototyping, tuning and data analysis. As the considered device is a synchronous buck converter, the control PWM waves for both the control and synchronous switch have to be synchronized and cannot be turned on/off at the same time, due to the short circuit possibility. On the other hand, the dead time should not be too long, because it will lead to unwanted power losses. Modeling the behavior of the buck converter in the dead time is not straightforward because there are many parasitic capacitances and, moreover, the behavior is not the same for all the load resistors. This difficulties led to an offline fixed dead time adjustment, which was performed following these steps: •The dead time was initialized with 200 ns; •The dead time value was decreased by a 12.5 ns and the duty cycle value was logged; 30 Experimental Results •The supramentioned step is repeated while the duty cycle value continues decreasing; •When the duty cycle value increases, the optimal dead time is achieved. These steps were performed to both rising and falling dead times, leading to a optimized dead times of 25 ns for both dead times. 4.2 Current Estimation Simulations During this simulations, the tuning of the EKF was done evaluating the performance results with the parameter variations. This tuning was done following the considerations made in the section 3.2. The first determined parameter was the measurement noise covariance, R, which can be extracted from the output voltage calculating the standard deviation of the signal, using for instance the command std from MATLAB. This matrix is a single value: 0.602. To determine the initial estimation vector, x0, the initial current was analyzed in diverse experiments, which lead to very different results Therefore, the chosen value for the inductor current initial estimation result was 0. For the specified simulations, the tested loads are 0.5Ωand 1 Ω, then the initial estimate for the load was the mean value of these – 0.75 Ω. The initial estimate for the capacitor voltage will be the first value of the output voltage, defining then x0= [0,vout(1),0.75]T.(4.1) Is important to note that an accurate initial estimation provides to EKF a faster convergence time in the first instants of the algorithm execution, but is not determinant to the algorithm convergence or stability in the long term. The remaining parameters to tune are the noise process covariance matrix Qand the error covariance P. First the Qmatrix was fixed and Pwas adjusted assuming the considerations made in 3.2 and taking into consideration the algorithm results. The final matrices are Q=   1 0 0 0 1.5 0 0 0 1   (4.2) P=   10 0 0 010 0 0 10   .(4.3) After the initial EKF tuning, some simulations with real data were done. The first simulation assumed a constant load of 0.5Ωand evaluated the accuracy of the estimation, comparing it to the real data. Fig. 4.3 shows the obtained results, in a time interval of 15 ms. 4.2 Current Estimation Simulations 31 Time (s) 0.00 0.15 0.30 0.45 0.60 0.75 0.90 1.05 1.20 1.35 1.50 Current (A) 0 0.5 1 1.5 2 2.5 3 3.5 4 #10-2 Real Approximation (a) Time (s) 0.00 0.15 0.30 0.45 0.60 0.75 0.90 1.05 1.20 1.35 1.50 Resistance (+) 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 #10-2 Real Approximation (b) Figure 4.3: EKF estimations and comparison with the real values for a 0.5Ωload: (a) inductor Current (b) load Resistor. Analyzing the obtained results, the final average value for the estimated current is 3.454 A, while for the real current is 3.495 A, giving a final estimation error of 1.17 %. For the load the estimation error is 2.92 %, which represents a considerably large error in comparison with the current error. However the plotted data shows that in the first EKF iterations the load is unknown and presents a large error comparing to the steady state values. The steady state errors for both estimations are: inductor current – 0.90 %; load resistor – 0.14 %. EKF is a recursive algorithm and contains a element that acts like a memory, the Kalman gain. This gain is calculated in each iteration of the algorithm and represents the confidence in the predicted value, i.e. how much the measurement will influence the final estimation. Gain values will tend to a constant value, lower than the value at the beginning of the filter initialization, meaning that sudden measurement changes will slowly affect the next estimates. The second simulation was done assuming a step load on the buck converter, in order to test the behavior described above. Results with a step load from 0.5Ωto 1 Ωwere evaluated and are represented in Fig. 4.4. Results show that the filter slowly adapts to the load change, taking about 3.4 ms in order to converge to the real value. Standard buck converters take a few hundreds of microseconds to regulate the output voltage, meaning that if the delay of the estimation is in the range of milliseconds, the whole estimation time could be in the range of tens of milliseconds, being unacceptable to most of buck converter control requirements. To overcome this issue a dynamic error covariance update is implemented. Section 3.2 mentions that the error covariance matrix Pdetermines the error between the estimated value and the measured value, tending to be lower with the EKF execution. The proposed approach suggests the reset of this variable to the initial value when a certain threshold is crossed. The chosen threshold is the measured output voltage: when this voltage suffers a change of 10 % comparing to the last switching cycle, the error covariance matrix is updated to the initial value, 32 Experimental Results Time (s) 0.00 0.15 0.30 0.45 0.60 0.75 0.90 1.05 1.20 1.35 1.50 Current (A) 0 0.5 1 1.5 2 2.5 3 3.5 4 #10-2 Real Approximation (a) Time (s) 0.00 0.15 0.30 0.45 0.60 0.75 0.90 1.05 1.20 1.35 1.50 Resistance (+) 0.4 0.5 0.6 0.7 0.8 0.9 1 1.1 #10-2 Real Approximation (b) Figure 4.4: EKF estimations and comparison with the real values for a 0.5Ωto 1 Ωstep load: (a) Inductor Current (b) Load Resistor. already presented in 4.3. Results of the same simulation with the proposed method are presented in Fig. 4.5, achieving improved transient response of the algorithm. Time (s) 0.00 0.15 0.30 0.45 0.60 0.75 0.90 1.05 1.20 1.35 1.50 Current (A) 0 0.5 1 1.5 2 2.5 3 3.5 4 #10-2 Real Approximation (a) Time (s) 0.00 0.15 0.30 0.45 0.60 0.75 0.90 1.05 1.20 1.35 1.50 Resistance (+) 0.4 0.5 0.6 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 #10-2 Real Approximation (b) Figure 4.5: EKF estimations and comparison with the real values for a 0.5Ωto 1 Ωstep load with dynamic error covariance update: (a) inductor Current (b) load Resistor. As stated in Chapter 2, when compared to other common predictive control methods, EKF shows better performance when the output voltage is affected by noise. The voltage that serves as input to the control loop is filtered first, having a minimum influence in the current estimation algorithm. To evaluate the performance improvement achieved by EKF in this situation, noise was artificially injected in the output voltage and the results were evaluated. Two different magnitudes of noise were injected in the output signal: one with a distribution given by X∼N(0,0.001)and other given by Y∼N(0,0.005). The results were evaluated and are represented in Fig. 4.6. Results show that EKF is capable of reducing significantly the impact of the output voltage noise in the control loop response. In Fig. 4.6a the oscillations without EKF can achieve the 4.3 Implementation of the Algorithm in the Microcontroller 33 Time (s) 0.00 0.15 0.30 0.45 0.60 0.75 0.90 Output Voltage (V) 1.7 1.72 1.74 1.76 1.78 1.8 1.82 1.84 1.86 1.88 1.9 #10-2 Without Kalman Filter With Kalman Filter (a) Time (s) 0.00 0.15 0.30 0.45 0.60 0.75 0.90 Output Voltage (V) 1.7 1.72 1.74 1.76 1.78 1.8 1.82 1.84 1.86 1.88 1.9 Without Kalman Filter With Kalman Filter (b) Figure 4.6: Output voltage values when affected by noise: (a) distribution X (b) distribution Y. 15 mV mark, while with EKF the oscillations never go up from 5 mV; in Fig. 4.6b oscillations in the voltage without EKF can achieve almost 90 mV and with EKF the oscillations drop to around 15 mV. This shows the effectiveness of the proposed method when the output voltage is affected by noise, reducing its influence on the control loop. This simulation concludes this section and in the next section the algorithm will be implemented in the microcontroller unit and the results will be evaluated and compared to the results obtained in this section. 4.3 Implementation of the Algorithm in the Microcontroller The executed simulations were planned and coded to enable the prototyping and tuning of the algorithm in a simple way, having also an intuitive way to evaluate the results. Implementing this algorithm on the microcontroller, however, has its own set of challenges, not considered at simulation time. Microcontrollers do not have by default a way to do matrix operations that are required to the EKF execution. The first thought was to implement a generic library that could be used to do this operations, such as add, multiply or invert matrices. EKF algorithm was implemented in the microcontroller using the created library and performance tests revealed that for this algorithm the execution time was near to 200 µs, meaning that the algorithm would run every 20th cycle, which is an unacceptable control period leading to very slow response times to load changes. To overcome this issue an optimized version of EKF is developed – a single function that treats all the matrix operations as simple arithmetic operations, considering the individual elements of each matrix. Optimizing the EKF algorithm lead to a 14 µs execution time of the algorithm. Another problem that was not considered until now is the measurement of the output voltage. Ideally this voltage is measured in a point that represents the average value of the wave, but this calibration is hard to do and the mentioned point is variable with the load. In this implementation 34 Experimental Results the feature of data accumulation of the VADC is used, allowing the accumulation of 2 conversion results in the same result register (the module allows up to 4 conversions to be stored). Using this feature is possible get a more precise value for the output voltage, without the need for a software low-pass filter (like a moving average filter). After implementing these changes and the full algorithm in the microcontroller, experiments with the real setup were performed. The voltage and current loop, as well as reading conversion values and updating the duty cycle take 8 µs, which added to the EKF execution time (14 µs) make a total of (22 µs), meaning that the whole control algorithm will run every third switching cycle. In the first experiment a sweep load was applied to evaluate the accuracy of the estimation in steady state. The applied sweep was form 0.5Ωto 2 Ωwith a step of 0.1Ωand the results are depicted in Fig. 4.7. As can be observed, both current and load estimations are below 1 %, proving the accuracy of the implemented algorithm for different loads. Load (+) 0.5 1 1.5 2 Estimated Inductor Current Error (%) 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 Estimated Load Error (%) 0.08 0.10 0.12 0.14 0.16 0.18 0.20 0.22 0.24 iL R Figure 4.7: Accuracy of the inductor current and load resistor estimations with a sweep load. The second performed experiment was done with a step load from 0.5Ωto 1 Ωand the results were logged and plotted using MATLAB (Fig. 4.8). Comparing the measured results with the simulated ones on 4.5 it can be seen that the response times are bigger than the simulation results. These results are understandable due to the fact that the control loop in the microcontroller only runs in a interval of 3 switching cycles, delaying then the estimation. Nevertheless the measured step response shows a similar behavior when compared to the simulated one, meaning that in the normal buck converter operation the delay of the estimation will be lower than the delay on the beginning. To evaluate the overall performance of the buck converter a set of experiments were performed to evaluate the response of the output voltage and the inductor current. Fig. 4.9 represents output voltage and inductor current response in the test setup described above, which is, a step load from 0.5Ωto 1 Ωand from 1 Ωto 0.5Ω. 4.3 Implementation of the Algorithm in the Microcontroller 35 Time (s) 0.00 0.15 0.30 0.45 0.60 0.75 0.90 1.05 1.20 1.35 1.50 Current (A) 0 0.5 1 1.5 2 2.5 3 3.5 4 #10-2 Real Approximation (a) Time (s) 0.00 0.15 0.30 0.45 0.60 0.75 0.90 1.05 1.20 1.35 1.50 Resistance (+) 0.4 0.5 0.6 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 #10-2 Real Approximation (b) Figure 4.8: Voltage and current step response to a step load from: (a) 0.5Ωto 1 Ω(b) 1 Ωto 0.5Ω. (a) (b) Figure 4.9: EKF estimations and comparison with the real values for a step load in the MCU: (a) inductor Current (b) load Resistor. Results show that the voltage takes about 200 µs to stabilize, showing the ability of the algorithm to correct the load change and maintain a constant voltage of 1.8 V. The next experimental test was done to evaluate the line regulation capabilities of the proposed algorithm. To perform this evaluation the buck converter board was supplied with a DC power supply, were the input voltage was intentionally changed to evaluate the algorithm response. As stated in section 4.1, the input voltage of this synchronous buck converter is usually 12 V, but in this test the voltage at some point of the simulation intentionally dropped down to 10 V and the results are depicted in Fig. 4.10. The results confirm that the algorithm is able to adapt to input voltage changing, showing a response time of about 100 µs, nearly half of the time that the algorithm takes to respond to load changes. This behavior can be explained due to different types of variables that are in considera- 36 Experimental Results Figure 4.10: Voltage response to a sudden input voltage drop to 10 volt. tion, that is, a change in the load resistor, Rout, and a change in the input voltage, Vin. If the state space model derived in Chapter 3is analyzed, Rout is a state and Vin is an input. The states are affected by the Kalman gain and as it was mentioned previously this element acts like a memory, showing ’inertia’ when the state value quickly changes. The input voltage is not affected by any gain and does not enter in any EKF variables calculation – Vin is just part of the system model and any change will affect quickly the response of the algorithm. Chapter 5 Conclusions and Future Work In this chapter a balance of the work performed in this dissertation is done, comparing this to the state of the art approaches. Future work suggestions are presented at the end. 5.1 Fulfillment of the Objectives The objective of this work was improving the performance of a synchronous buck converter using a KF. The nonlinear version of KF, EKF, can be used to design a predictive current control loop that do not need current sensors, reducing also the impact of the noise in the control loop. First of all, an overview of buck converter control methods was done. Voltage mode control was the first used method due to its simplicity but slow transient response an poor line regulation lead to the appearance of the current mode control. CMC and its variants (peak, valley, average, etc.) have their own pros and cons, but they all require current measurement that is not always straightforward. Predictive current control appeared then as a sensorless (no need to measure the inductor current) method, to overcome the difficulties in measuring the current. A literature review containing the predictive current control methods was performed, which served as base to all the work. Then the theoretical derivation of the whole predictive current control algorithm based on EKF was done, consisting in 3 main parts: deriving the buck converter model, tune the EKF and design the control loop. In order to derive the model a method of state-space averaging was employed, which allows a division of the buck converter operation in two states that are merged to provide the system model. The system also has in consideration some parasitic parameters in order to improve the accuracy of the model. The EKF equations and parameters are defined after the model is derived and the combination between them composes the current observer, which will be responsible to estimate the inductor current, as well as the output voltage. In the last part the control loop is designed, based on the equations of the inductor current slopes. Next an experimental setup was assembled to test the predictive current control algorithm. Simulations and experiments show an overall estimation error of the current and resistor of approximately 1 %, while considering the steady state, this error drops to less than 1 %. The output 37