DSP Implementation and Simulation of IM Drive Using Fuzzy Logic

Variable-speed drives are being continually innovated. Their development is characterised by process made in various areas including power and microelectronics, control systems etc. The introduction of various vector-controlled drives has allowed the dynamic performance of AC drives to match or sometimes even to surpass that of the DC drive. Vector-controlled drives provide high-dynamic performance and they are used in many industrial applications. Induction motors are often a preferred choice in variable-speed drive applications. Nowadays low cost microprocessors enable the development of cost effective digital drives and the widespread availability of DSPs enable the development of a large variety of drives with advanced features and, of course, use of new control methods. The applications of artificial intelligence (AI) in electrical drives can lead to improved performance, enhanced tuning and adaptive capabilities. There are further possibilities for much wider range of AI-based applications in variable-speed AC and DC drives [1].


Introduction
Variable-speed drives are being continually innovated. Their development is characterised by process made in various areas including power and microelectronics, control systems etc. The introduction of various vector-controlled drives has allowed the dynamic performance of AC drives to match or sometimes even to surpass that of the DC drive. Vector-controlled drives provide high-dynamic performance and they are used in many industrial applications. Induction motors are often a preferred choice in variable-speed drive applications. Nowadays low cost microprocessors enable the development of cost effective digital drives and the widespread availability of DSPs enable the development of a large variety of drives with advanced features and, of course, use of new control methods. The applications of artificial intelligence (AI) in electrical drives can lead to improved performance, enhanced tuning and adaptive capabilities. There are further possibilities for much wider range of AI-based applications in variable-speed AC and DC drives [1].
Considerable research has been performed in the field of AI. Recent trends and advancements in this field have stimulated the development of various systems for electrical machine and drive application. Fuzzy logic control is receiving great interest worldwide. The essential part of fuzzy logic controller is a set of linguistic control rules related by the dual concepts of fuzzy implication and compositional rule of inference. Thus fuzzy logic control provides an algorithm into an automatic control strategy. Experience shows that fuzzy logic control may yield results superior to those using conventional control algorithms. A main advantage of the use of fuzzy logic is that fuzzy logic controllers can work well without having to construct any mathematical model of the process (or plant). Their application can also lead to reduced development times. In general, the application of artificial intelligence, includ-ing fuzzy logic, in drives can lead to increased performance and robustness to parameter and load variations.

Structure of vector controlled induction motor
For vectors control it is used indirect orientation on magnetic rotor flux (indirect FOC). In the paper a speed regulation of the drive is discussed. Controller uses Mamdani type of fuzzy logic (fuzzy logic controller FLC). The overall structure of the system is shown in Fig. 1. The system contains a voltage-source inverter (TFC) with PWM, induction motor, fuzzy logic controller for speed, classical PI controllers and blocks for processing signals. As shown in Fig. 1, in the induction motor (IM) drive there are four controllers: controller 1 is the speed controller, controller 2 is the torque producing stator current controller, controller 3 is the rotor magnetizing current (rotor flux) controller and controller 4 is the flux producing stator current controller.
Voltage signals of measured stator currents are transformed from the stationary reference frame [␣, ␤] into the reference frame oriented on the rotor flux linkage space vector [x,y], which is done in the Block of Vector Shift 2 (BVS2). Outputs of this block are real stator currents i 1x , i 1y , which are feedback signals to the current controllers R i1x , R i1y . The decoupling rotation voltage components u xe , u ye , which are evaluated in the Block of Decoupling Circuit (BDC), are added to the outputs of the mentioned controllers. The inverse shift (from the reference frame oriented on the rotor flux linkage space vector to the stationary reference frame) is done in the Block of Vector Shift 1 (BVS1). It is necessary to determine the oriented angle ␥, which is used in BVS1, BVS2. The angle is evaluated in the Block of Evaluation of Oriented Quantities (BEOQ). Rotor position (angle ε) is obtained by means of a speed sensor. BEOQ is based on the so-called current

Brief description of presented fuzzy controller
There are many types of fuzzy logic controllers (FLC), but now the classical structure of Mamdani type of fuzzy logic controller is used. It should be noted that, in general, this type of fuzzy logic controller contains four main parts: fuzzifier, knowledge base (rule base ϩ data base), inference engine and defuzzifier (Fig. 2). The real FLC consists of pre-processing (matching of input values) and post-processing, which is very important for tuning FLC.
Mentioned facts are used for the fuzzy logic controller in program Matlab -Simulink and the implementation to DSP.
In this case the fuzzy logic controller is used as an analogy to PI-type controller, but it is possible to set its non-linear behaviour by means of base rules in the other side of a classical PI controller.
A fuzzy controller is an expert system where a set of base rules is based on knowledge and experience of a system expert.
The result of the proposed fuzzy controller is control surface shown in Fig. 3, which is a more easily implemented, for example, as a table to the microcontroller. Figure 3 shows the highly nonlinear three-dimensional control profile. The control profile of the PI controller is simpler due to its linear nature.

DSP implementation
The DSP controlled vector drive contains single fuzzy logic controller, which is the speed controller. The DSP (digital signal processor) used is the Texas Instruments TMS320C40. The  processor works with 32-bit data in floating-point arithmetic and provides high computing power for presented control. Instruction cycle interval is 50 ns, while most instructions are performed in one machine cycle. The overall structure of the system is shown in Fig. 4 and was realised at the Technical University of Ostrava (Czech Republic). The DSP software contains the algorithms for the fuzzy controllers, vector control and control of inverter. During operation up to 8 inner drive quantities can be simultaneously shown by a D/A converter.

Simulation and experimental results
Based on the description of the presented FLC and structure of vector controlled induction motor, the fuzzy logic controller and the whole structure of the vector controlled IM in the program Matlab-Simulink were created. The conventional PI controller is replaced by a fuzzy controller, where it is possible to set its nonlinear behaviour by means of rule base in the other side of a classical PI controller. A fuzzy controller is an expert system, where the set of rule base is based on knowledge and experience of the system expert.
An extensive range of digital simulations has been performed to obtain the appropriate values of scaling factors, membership functions and rule base. Two types of simulation have been performed, the former uses direct calculation and the latter uses lookup tables. The execution time of the table lookup form was found to be approximately half of the direct form. In this way it was also possible to verify the suitability of the look-up table based on the FLC approach in the vector drive. The simulation stage was made to verify fuzzy controller features and to get information about behaviour of the drive. The used scheme of FLC is shown in Fig.  5. This stage was followed by the real-time implementation of the fuzzy logic controller considered. Entire control of the drive was implemented onto DSP.
In real implementation of the fuzzy controlled drive a fuzzy logic controller (speed controller) was implemented, the other controllers are classical PI controllers. Thus, in this case, the two inputs to the fuzzy speed controller are the speed error and the change of the speed error respectively. Figures 6 to 8 show the responses of the DSP controlled drive. It can be seen from figures in the left column that the drive runs up to 300 rpm with load. In the right column the reference rotor speed is first set to zero then to 300 rpm and then to Ϫ300 rpm. In Fig. 6 the rectangular curve is the reference rotor speed, the "trapezoidal" curve is the real angular rotor speed. Torque producing stator current is shown in Fig. 7.

Conclusion
The absence of widespread industrial application of fuzzy controllers in variable-speed drives is also related to the fact that there are no straightforward procedures for the tuning of fuzzy controllers. Only a few papers discuss implementations and mainly concentrate on simulations. However, techniques for determination of classical controller can be time-consuming and fixed controllers cannot necessarily provide acceptable dynamic performance over the complete operating range of the drive. Performance will degrade mainly because of machine non-linearity, parameter variation, etc. Considerable advantage of fuzzy controller is possibility to create a suitable controller by means of base rules. As fuzzy controllers are generally non-linear system we can achieve better regulation results. Not always the use of a fuzzy controller is a better solution. It depends on the system complexity and its linearity. For a simple linear system it is not suitable to implement a fuzzy controller. As folow from the experimental results fuzzy control brings a better utilisation of the proposed vector control. Rightness of the controller has been verified by simulations, so then the fuzzy controller has been implemented into DSP powered by Texas Instruments. The dynamics of the drive is better for the proposed controller.

Acknowledgement
The paper is based on the results of the project LN00B029, which was supported by The Ministry of Education of the Czech Republic. Run-up to 300 and reversation to Ϫ300 rpm without load