FPGA Implementation of a Fuzzy Controller for Automobile DC ... - UVigo

0 downloads 0 Views 140KB Size Report
lineal model of the converter power stage, by means of Matlab and Simulink. Then, the fuzzy controller hardware is developed through Xilinx. System Generator ...
FPGA Implementation of a Fuzzy Controller for Automobile DC-DC Converters Jacobo Alvarez#1, Alfonso Lago*2, Andres Nogueiras#3 Carlos Martinez-Peñalver#4, Jorge Marcos*5, Jesus Doval#6, Oscar Lopez#7 #

1,2,3,4,5,6,7

Department of Electronics Technology, University of Vigo Campus Lagoas-Marcosende. 36280-Vigo (Spain)

jalvarez, alago, aaugusto, penalver, acevedo, jdoval, [email protected]

Abstract— The design of synchronous multiphase DC-DC converters for automobile applications is now a very active field, because the automotive industry forecast that future power demands inside a car will oscillate between 2.5 kW and 3.5kW, keeping a dual system of 42/14V batteries. The design of controllers for the optimal behavior of such converters is a very delicate task. In this paper, an optimized fuzzy control algorithm has been developed to control a synchronous multiphase converter of 1.6kW. First, the fuzzy control algorithm is designed and verified, together with a non lineal model of the converter power stage, by means of Matlab and Simulink. Then, the fuzzy controller hardware is developed through Xilinx System Generator for Simulink, and implemented in a Spartan 3 FPGA to achieve a real-time controller.

I. INTRODUCTION Actual and future trends in car manufacturing show a rising tendency to install electrical and electronic components that provide great level of security and comfort for the users. For example, positioning systems, powerful sound equipment, conditioned air, thermal steering wheel, etc. All these equipment represents an enormous load increase for the electrical system that cannot be assumed with the present system of 14V. The automotive industry forecast that in the next years, power demands inside a car will oscillate between 2.5 kW and 3.5kW [1]. In addition to the controllers of motors, switches and protections, one of the main new components inside of the car will be one or more DC-DC converters [2]. These converters will be necessary to reduce the 42V from the battery alternator to the more usual 14V, to supply power to all the systems that initially will not be able to use 42V. The design of synchronous multiphase DC-DC converters allows improvements of the characteristics of high power systems. The automotive industry forecast that future power demands inside a car will oscillate between 2.5 kW and 3.5kW, keeping a dual system of 42/14V batteries. This is the reason why it is possible to consider developing several parallel connected converters [3] [4]. The solution proposed in this paper is based on a multiphase converter of 16 phases, that can be included in a dual power system inside a car with batteries of 42/14V. Employing such a high number of phases minimizes the passive components size in each one, and also the stress level due to lower currents.

0-7803-9729-0/06/$20.00  2006 IEEE

However, such a high number of phases implies a complex specific control scheme which must allow synchronization between phases, in order to reduce output voltage ripple of the converter and equalize output currents among all the phases. That is why the authors have chosen to develop a digital fuzzy controller to achieve this task. The properties of the fuzzy systems allow to deal with non-linear systems such as the DC-DC converters, as well as to smooth the system response [5] [6] [7]. The high computational load of the fuzzy algorithms force the use of an FPGA implementation, to achieve the desired accuracy in real-time control at the frequency of the PWM signal needed for the DC-DC converter, which will be 200 kHz. To develop all the tasks involved, the authors have used Matlab, Simulink and Xilinx System Generator for Simulink tools. These software suites allow to combine a non linear model of the multiphase DC-DC converter, developed by the authors [8] [9], with the fuzzy controller. This is very important to achieve a good understanding of the real non linear dynamic behavior of the fuzzy controller together with the power circuit, in order to compare the resulting data simulations to find the optimal fuzzy controller. First, the fuzzy algorithm has been designed and tested with the fuzzy toolbox included in Matlab. Then, the fuzzy controller hardware has been developed using the System Generator libraries from Xilinx [10]. These libraries allow to simulate the fuzzy controller hardware in Simulink together with the theoretical converter model, as well as implement it in a Xilinx FPGA. To design a fuzzy controller, the following steps must be followed. First, the feedback variables are selected among all the variables available in the converter, then the membership functions for the inputs and the outputs are designed, and finally the rule base for the fuzzy inference engine is described. II. SPECIFICATIONS The main goal of this work is to develop an optimal realtime fuzzy controller [11] [12] [13] for the DC-DC converter, that can be implemented in a FPGA. To achieve this, there are some considerations that must be taken into account.

237

FPT 2006

Fig. 1.

Block diagram of the whole system implemented in the FPGA.

The frequency of the PWM signal for the DC-DC converter will be below 200 kHz, so the controller process cycle must be faster than 5 μs to achieve real time operation. Though FPGAs allows a great degree of parallelism in the implementation of a fuzzy controller, it is necessary to reduce the total amount of hardware needed, keeping the final cost at a reasonable point. Nevertheless, to accomplish a smooth control, the controller must perform operations with an adequate precision. Specifically, the voltage error at the output must be less than 100 mV. All the previous considerations have led to the following design decisions. The number of input variables to the controller must be reduced, so only the voltage error and the error derivative in the load will be considered. This will help to reduce the hardware resources, because the fuzzy controller will process the inputs in parallel. The error, that is, the difference between the output voltage and the desired voltage, is calculated by an analog circuit, before applied to an A/D Converter and then to the controller. The number of membership functions for each variable must be also designed carefully to achieve the desired accuracy in the different control zones (soft start, load transients, stable state) while keeping the hardware resources limited. Again, a parallel implementation of the fuzzyfication process for each membership function will be implemented. The shape of the membership functions will be triangular or trapezoidal and the number of rules must also be limited, though we have developed a semi-parallel hardware implementation of the fuzzy inference engine that accelerates the computation. Each phase of the multiphase DC-DC converter only needs one variable to trigger its power devices correctly, that is, a PWM signal. These PWM signals must be activated at different times during the process cycle. These delays are also calculated digitally in the FPGA.

The controller must provide the width of these signals. To smooth out the behaviour of the converter output voltage, the fuzzy controller gives the increment (or decrement) of the width, which is called “DeltaPulseWidth”. The PWM signal for each converter will be generated digitally from this width value given by the fuzzy controller. The method for calculating the crisp width value for the PWM signals from the corresponding fuzzy output will be the centroid one. This method has the heaviest computational load of all defuzzyfication methods, but leads to the best results. Given that there is only one output, it is convenient to achieve the best precision possible. However, to reduce the final hardware of this stage, the fuzzy values for the output obtained by different rules, are combined sequentially. Therefore, the block diagram of the whole system implemented in the FPGA will be that of fig. 1, composed by the following circuits. x “ADC interface”. This circuit interfaces an external Analog to Digital serial converter which measures the error voltage. x “Derror calculator”. This circuit calculates the value of the error difference, substracting the previous stored error value from the new error value. x “Fuzzy controller”. This is the main block that will be analyzed in the following sections. x “On width prescaler”. This circuit scales the PWM signal pulse width, given by the fuzzy controller, to only 9 bits, to simplify the generation of the PWM signal. x “Simple PWM generator”. This circuit generates one PWM signal with the pulse width given by the prescaled fuzzy controller output.

238

Fuzzy Inference Engine

Crisp Inputs Error

Table I.

Crisp Outputs

Name Big Negative (BN) Medium Negative (MN) Small Negative (SN) Very Small (VS) Small Positive (SP) Medium Positive (MP) Big Positive (BP)

Delta Pulse width

Fuzzy Outputs

Fuzzy Inputs

Defuzzyfier

Fuzzyfier dError

Rule base dError Error

Input membership functions

Fig. 2.

x

SN

S

SP

BN

MLG

MLG

MLG

MN

QLG

QLG

QLG

SN

SLG

SLG

SLG

VS

SLG

C

SLS

SP

SLS

SLS

SLS

MP

QLS

QLS

QLS

BP

MLS

MLS

MLS

Membership Functions for Input Variable ‘Error’, within Range [-15, 15].

Output membership functions

Fuzzy controller for multiphase DC-DC converter.

“Multiple PWM generator”. This circuit generates 16 shifted PWM signals needed by the DC-DC converter, from the PWM reference signal given by the previous circuit.

III. DEVELOPMENT OF THE OPTIMAL FUZZY CONTROLLER ALGORITHM

In fig. 2 we can see a block diagram of the fuzzy controller with the two aforementioned inputs -error and error difference (derror)- and the output (delta pulse width). In this figure the membership functions of the input and output variables are also shown. Table 1 includes the definitions of these membership functions for the input variable “Error”. The membership functions for the error input are closer to each other near the zero value, but move away as the absolute values of the input increase. This is one of the advantages of a fuzzy controller against a conventional one. It is very easy to tune the controller for different control zones, here for the near stable state (error close to zero) against transient states. There is a table in fig. 2 that shows the rule base that defines the control algorithm and relates the inputs with the output. The abbreviations in this table correspond to those given in tables 1 and similar ones. Fig. 2 shows also a graphical representation of the resultant control surface. IV. MATHEMATICAL MODEL FOR THE WHOLE SYSTEM A non linear model of paralleled switched power converters was developed by the authors to analyze and design the whole system. This model was designed for Matlab tool and includes a non linear mathematical and simulation model of the PWM modulator, simulations blocks to model output filters, and feedback circuits to achieve a complete converter [8]. These converters can be joined together to compose a paralleled multiphase converter [9]. V. HARDWARE IMPLEMENTATION The digital system needed to implement the real-time fuzzy controller in one FPGA has four main blocks, which correspond to the fuzzyfier, the inference engine, the defuzzyfier and the main control unit. All the inner circuits in

Type Trapezoidal Triangular Triangular Triangular Triangular Triangular Trapezoidal

Definition points [-25 -20 -7 -0.9] [-1 -0.75 -0.45] [-0.5 -0.3 -0.09] [-0.1 0 0.1] [0.09 0.3 0.5] [0.45 0.75 1] [0.9 7 20 25]

that system were designed using the Xilinx “System Generator” Toolbox for Simulink. The circuits included in the System Generator library allow to simulate the controller together with the theoretical model for the DC-DC converter developed with other Simulink blocks, as well as to implement the controller in the selected FPGA. It is also possible to directly program the FPGA without leaving Simulink, to make a hardware co-simulation, which accelerates the simulation process. Nevertheless, it is also possible to obtain an intermediate VHDL description file for the whole system to optimize the FPGA implementation through the use of the Xilinx Foundation ISE tools, specific for this task. An XC3S2000 FPGA from Xilinx [14] has been used to implement the whole system (see fig. 1). This FPGA has 20,480 slices, almost 41,000 logic cells, each constituted by one 16x1 LUT (Look Up Table) and one flip-flop. The FPGA also has forty 18x18 hardware multipliers, as well as forty 18 kbits modules of dedicated dual-port RAM. Table 2 shows the FPGA logic resources used to implement the fuzzy controller developed in this article. The dedicated RAM blocks are used to implement the ROM and RAM blocks needed in the different circuits, fuzzyfier and inference engine above all. The implementation results show that it is enough room in this FPGA to try a more paralleled implementation of the fuzzy controller, which would lead to a faster process cycle. The results also indicate that it is really feasible to implement real-time fuzzy controllers in low cost FPGAs, like the Spartan 3 family from Xilinx. The process cycle time is the sum of the times that the four main blocks need to end their calculations. The total processing time (Tcycle) of any fuzzy controller implemented with these blocks is:

Tcycle

(6 * N )  (M * N  34)  (49  Q)

(1)

In a fuzzy controller with 16 inputs (M=16), 16 memberships functions for each input (N=16), any number of rules and 16 outputs (Q=16), that is, a very complex controller, the total processing cycle time will be 451 clock cycles. The fuzzy controller developed in this article, with only two inputs (M=2), a maximum of seven membership functions for the error input (N=7), nine rules and one output, the total processing time is 140 clock cycles. The implementation of this fuzzy controller in the XC3S2000 FPGA gives a minimum clock period of 9.153 ns.

239

Table II.

Resources Summary.

Target Device : xc3s2000 - fg900 - 4 Design Summary ---------------------Number of occupied Slices: 3,492 out of 20,480 Number of Slice Flip Flops: 4,758 out of 40,960 Number of 4 input LUTs: 2,733 out of 40,960 Total Number 4 input LUTs: 3,402 out of 40,960 Number of bonded IOBs: 51 out of 565 Number of Block RAMs: 39 out of 40 Number of MULT18X18s: 27 out of 40 Number of GCLKs: 1 out of 8

17% 11% 6% 8% 9% 97% 67% 12%

Total equivalent gate count for design: 2,745,562 Additional JTAG gate count for IOBs: 2,448

So, if we work at a clock frequency of 100 MHz, the total processing time is 1.4 microseconds, that is, real-time for this application. The main benefit of the FPGA implementation of the fuzzy controller is that the number of inputs and the number of rules can be increased without affecting the processing time, because they are processed in parallel, as it has been analyzed in section 3. So, the FPGA implementation has an important advantage versus a microprocessor or DSP implementation, which will process each variable and rule sequentially. This will be more obvious as these numbers increase.

Fig. 3.

Timing simulation of the PWM outputs behaviour.

ACKNOWLEDGMENT The authors wish to thank “Xunta de Galicia”, the autonomous government of Galicia (Spain) for its support to this work. REFERENCES [1]

VI. VERIFICATION RESULTS The simulations carried out have shown that, after a very short time, the error approximates to zero, and the output voltage tends to 14 V, which is the final correct value. A hardware co-simulation was also achieved. In this test, the fuzzy controller hardware is downloaded to the FPGA and the Simulink provides the input values to the FPGA and captures the output values from the FPGA. The results of this test coincide exactly with the computer simulation ones. In fig. 3 it is shown a simulation of the whole system in fig. 1, where the final sixteen PWM shifted outputs to the DC-DC converter are presented.

[2]

VII. CONCLUSIONS The main contribution of this work is the real-time FPGA implementation of an optimized complex fuzzy control algorithm for multiphase DC-DC converters in automotive applications. This controller can be used independently of the number of phases of the converter, making it suitable to be applied in a wide range of high power applications. The fuzzy algorithm has been designed having in mind the goal of developing a real-time FPGA-based controller, so the complexity has been reduced, while keeping a great degree of paralelism. Hybrid vehicles, aerospace and naval industry power systems can also benefit from the development of this algorithm. The design of the fuzzy controller blocks allows their future utilization to implement any fuzzy algorithm for other applications.

[8]

[3]

[4]

[5] [6]

[7]

[9]

[10] [11]

[12]

[13]

[14]

240

Miller, J.M., et al., "Making the Case for a Next Generation Automotive Electrical System". IEEE-SAE International Congress on Transportation Electronics. Deaborn, MI, October, 1998. Smith, Michael., "42V-enabling a technological revolution". Auto Briefing. Special Edition May 2001. Giral, R.; Maixé, J.; Martínez-Salamero, L.; Borrego C.; Fontanilles. “42 V-to-14 V Converter in Interleaved Operation for Dual Voltage Electrical Architectures in Vehicles”. 6th IEEE Workshop on Power Electronics in Transportation, (WPET 00) O. Garcia, P. Zumel, A. de Castro, J.A. Cobos, J. Uceda., “An Automotive 16 phases DC/DC Converter”. IEEE Power Electronics Specialists Conference 2004 (PESC 04). Conner , Doug, Designing a fuzzy-logic control system, EDN, March 31, 1993. Cubilot, Marta, Álvarez, Jacobo, Direct Current Motor Control based on fuzzy logic, Mechatronics 96 workshop, Guimaraes, Portugal, 1996. Manzanedo, Antonio, Álvarez, Jacobo, Fuzzy control applications development system, Mechatronics 98 workshop, Skövde, Sweden, 1998. A. Nogueiras, A. Lago, J. Doval, J. Marcos, C. M.-Peñalver. “A New Non-Linear Simulink Model Based on Heaviside Unitary Pulse Functions for Switch-Mode PWM Converter Circuits”. Proceeding of the 10th European Conference on Power Electronics and Applications (EPE 03). September, 2003. A. Nogueiras, A. Lago, J. Doval, J. Marcos and C. M. Peñalver “Nonlinear Modeling of Multi-Phase PWM Power Converters”. Proceeding of the 11th International Power Electronics and Motion Control Conference (EPE-PEMC 04). September, 2004. System Generator User Guide, Xilinx, 2005. Perry, A., Guang Feng, Yan-Fei Liu, Sen, A New Sliding Mode Like Control Method for Buck Converter, PESC 2004, Aachen, Germany, 2004. Perry, A., Guang Feng, Yan-Fei Liu, Sen, A New Design Method for PI-like Fuzzy Logic Controllers for DC-to-DC Converters, PESC 2004, Aachen, Germany, 2004. Johnson A. Asumadu and Eugene Ho, A Multivariable Fuzzy Logic Controller (MFLC) For A Buck DC-DC Converter, PESC 2004, Aachen, Germany, 2004. “Spartan 3 data sheet”, Xilinx, 2005.

Suggest Documents