Real Time Simulation for DC and AC Motors Based

0 downloads 0 Views 636KB Size Report
simulation of DC and AC machines is carried out on FPGAs platform and real time ... Keywords: Electric Machines, LabVIEW FPGAs, Real Time Simulation, ...
Real Time Simulation for DC and AC Motors Based on LabVIEW FPGAs Pedro Ponce*, Luis Ibarra*, Arturo Molina*, Brian MacCleery** 

*Instituto Tecnológico y de Estudios Superiores de Monterrey , Campus Ciudad de México, México México (Tel: 525554832020; e-mail: [email protected]). **National Instruments, Austin Texas USA, (e-mail: [email protected]) Abstract: Increased manufacturing expenses and increased competition have made it an automation process to improve the overall operational and energy efficiency at the manufacturing systems. Electric motors impact a wide range of manufacturing equipment, especially the manufacturing equipment that has an advance level of automation. An accurate real time simulation is required for predicting the high-quality motor performance and making the motor systems more reliable and easier to use inside of the complete manufacturing system. FPGAs for real simulation have become both increasingly powerful and increasingly affordable. As a result, the use of highly sophisticated hardware that not only could run high-fidelity simulation of electric motors but also this hardware allows getting result in real time. This paper shows real time simulation models of DC and AC machines on FPGAs in state space. Implementation of the real time numerical integration method with digital logic elements is presented and discussed using fixed point. A real-time simulation of DC and AC machines is carried out on FPGAs platform and real time results are shown. These results are compared to simulation results obtained through commercial off line simulation software. Keywords: Electric Machines, LabVIEW FPGAs, Real Time Simulation, Manufacturing System and Numerical Method. 

1. INTRODUCTION With electric motors as the driving force behind most production output, improved electric motor simulation efficiency means greater overall production efficiency. The hardware technology behind electric machine real time simulation is capable of providing with both an immediate and measurable impact on energy use and operational efficiency. Nowadays manufacturing process developments require minimum cost research, swift and confident simulated results and no risks during the testing procedure. All those characteristics are reached by real time systems which can be used to obtain direct information as stand-alone devices with proposed inputs or to be integrated with other real or simulated systems. The numerical simulation of electric machines systems necessitates sub-microsecond calculation time steps if the considered system is characterized by low time constants. Moving the computational load to an FPGA has shown to suit well the real-time simulation needs of such systems. However, many challenges remain to concretize the broad adoption of FPGA technology for the real-time simulation context. The simulation platform presented for the effective practice of FPGA modeling when the state-space approach is used. For testing big size motor is needs a safety environment to avoid any risk, thus the mechanical and electrical faults or problems require special test conditions that can be expensive. In order to get a good real time simulation approach, this paper shows the direct use of FPGAs by Fixed-Point. A complete study of real time

simulation for DC and AC motors is presented. Figure 1 shows the FPGA Xilinx board sbRIO-9612 from National Instruments that was used in this paper.

Fig.1 sbRIO-9612 from National Instruments Nowadays, FPGA and DSP boards are widely used in electric machinery investigation to emulate the plant, execute a particular control over it or monitor macKLQH¶V FRQGLWLRQV Improvements made in digital electronics led computational and electronic systems to be faster and able to run real-time VLPXODWLRQV VR WHVWLQJ DERXW PDFKLQHV¶ FRQWURO ORDG DQG performance can be validly brought by them. FPGA usage is due to its capacity to process parallel tasks and to have a good management of I/Os; results can be easily taken from dedicated pins, and excitation inputs can also be

T-203

delivered to the FPGA board in the same way at good timing rates. More complex boards, in which FPGA is associated with other ICs like microcontrollers, can also directly connect with a PC via USB e.g., making the obtained results to be easily shared between PC software and testing times are obviously reduced. Numerous simulations for different motor types have already been made confirming the validity of results and showing the way Real-Time simulations are driven. On the other hand, considering every simulation is a numerical approximation, different iterative methods can be applied depending on expected precision and timing. Besides the main RTS scope which is the application to motor design and industry solutions, there is a wide potential area if used in educational environments. This is, once the results validity and real time restrictions are found to be correct, studies over the electric machine itself or applied controllers can be taken using the FPGA platform instead a real machine. Comprehension of how the machine reacts to different inputs and the different ways the outputs are delivered can be achieved in a typical classroom using a PC interface, validation of analytical results can be also seen and knowledge can be constructed or confirmed from simulation. 7DNLQJ DGYDQWDJH RI /DE9,(:¶V SRWHQWLDO VLPXODWLRQV FDQ deliver particular results when a specific control or commutation technique is used and deeper inquiries can find their answers because all motor variables will be available for PRQLWRU DQG HYHQ JUDSK 6WXGHQW¶V TXHVWLRQV FDQ EH WRWDOO\ fulfilled and explanations can get to be supported.

armature terminals and Tl which is the load torque. The product LfIf is replaced as constant Ke. Matrix form equations can give an ordered view of the phenomenon represented; they play a huge role when iterative methods are used for generalizing n equations matrix. 2.2 Induction Motor In an induction motor, the 3-phase stator windings are designed to produce sinusoidally distributed mmf in space along the airgap periphery. Assuming uniform airgap and neglecting the effects of slot harmonics, distribution of magnetic flux will also be sinusoidal. It is also assumed that the neutral connection of the machine is open so that phase voltages, currents and flux linkages are always balanced and there are no zero phase sequence component in the system. For such machines, the notation in terms of the space state is very useful. For 3 phase induction motors in stationary reference frame the space state representation is defined as follow

2. ELECTRIC MOTOR MODELS 2.1 DC Motor By using an electrical and mechanical representation of the DC motor, it will be possible to make faster approaches to its behavior. TKH PRWRU¶V VWDWRU ±field- has a winding which generates the flux inside the machine, and the rotor ± armature- has another where the torque is generated. The PDFKLQH¶V PRYHPHQW LV DFKLHYHG EHFDXVH RI WKH ILHOG¶V IOX[ LQWHUDFWLRQ ZLWK WKH DUPDWXUH¶V FXUUHQW. There will be an induced voltage in the rotor. That voltage is represented in the circuit with the motor-like a symbol and is called Ea. We can FKRRVHWKHFXUUHQWWKURXJKWKHDUPDWXUHDQGWKHURWRU¶VVSHHG as the two state variables which will describe the complete DC motor, considering the electrical and mechanical phenomena. Having a model in this manner assumes the field current is constant, the state space model is

ª Ia º « » ¬ Z ¼

ªRa La « k ¬ J



 Lf I f

º Ia º La ª

E J

ª 1 La »« »  « ¼¬Z ¼ ¬ 0

0 º ªUaº 1 » « Tl » J ¼¬ ¼

(1)

Where k is a motor construction constant related with flux generation, J the moment of inertia of the rotor and the load and  the viscous friction coefficient. Two inputs are considered, they are Ua which is the voltage applied in

2.3 FPGA industrial applications

FPGAs for industrial motors and drives began to be used a decade ago, thus an increment of applications for modelling and controlling electric motors has been important. As result the FPGAs prices have come down in the last five years. For developing an electric drive or evaluating the performance of an electric motor, it is necessarily to have a reliable real time simulation. For the simulation stage, the electric motor is modelled and simulated with the best accuracy possible to represent the operation of the electric machines under different operating conditions. The performance of the electric motor is evaluated and some design iterations are required to optimize its performance. Simulation is usually done on workstation or PC using programs or a system. One of the main limits in a conventional simulation is that the execution of the program is not running in real time so the time constant for designing a controller could not be effective as a real time simulation and the process for moving from simulation to

T-204

implementation it is complex. It is possible to accelerate the design process by using a unique platform for both simulation and implementation. FPGAs can run in real time the electric motor models for validating the performance of the electric system under different conditions after that the controller could be added and implemented in the same platform. Although different hardware platforms have been used for implementation of real time systems, FPGAs are the most important for electric machines and drives. Also the FPGAs could simulate the power electronic stage which requires very short process time. The Xilinx FPGA used in this work can be programmed by LabVIEW which is a graphical program and it is apply in a lot of industrial applications

G5 L B:Pá?5 á Uá?5 ; G6 L B:Pá?5 E räwDá Uá?5 E räwDG5 ; G7 L B:Pá?5 E räwDá Uá?5 E räwDG6 ; G8 L B:Pá?5 E Dá Uá?5 E DG7 ;

The time at which the constants are calculated comes from an accumulative sum by the time-step constant: Pá L Pá?5 E D

(7)

At last, the solution for one equation can be given by: Uá L Uá?5 E ::G5 E tG6 E tG7 E G8 ; Û

2.4 Main Paper Contribution A real time simulation platform for DC and AC machines was developed running by LabVIEW FPGA toolkit which could be expended for different electric machines and diverse tools included in LabVIEW software could be used for getting different models and conditions. Although space state representation for electric machines is a very powerful tool, the use of matrix representation in FPGAs is not natural and some considerations have been taken for deal with it, the paper shows conventional representations that could be modified for simulating different DC and AC electric machines. The platform was evaluated against an offline simulation and the results show a good performance. The use of one platform for real time simulation of electric machines allows predicting the good industrial performance under operational conditions and disturbances, saving money and time on industrial applications. Also a control system can be included in the simulation by state space representation, then a real time electric drive can be implemented using the same FPGA real simulation platform.

(3) (4) (5) (6)

(8)

With a generalized state variable shell it would be easier to make pertinent considerations towards generalization. #55 :56 N ­ OLe ­ #á5 :á6

å ° å

#5á :5 $55 ­ ie ­ i E e ­ #áá :á $á5

å $5à ;5 ° ­ ie ­ i å $áà ;à

(9)

Notice matrix dimensions of A and B matrix are not equal, so the method must consider a proper iterative system. Some advantages of LabVIEW environment involves the dimension-restrictions applied when obtaining a value from an array, this means that asking for an inexistent value in an DUUD\ RU PDWUL[ GRHVQ¶W GULYHV WKH SURJUDP WR DQ HUURU DQG D zero value is assumed. The relation between matrix A and B in (11) allows us to permit that assumption because the result of the sum won´t be altered. Each equation will have the form presented bellow in (10): :56 L #55 :5 E ® E #5á :á E $55 ;5 E ® E $5à ;à

(10)

Without considering LabVIEW advantages, the method can be presented as: BÝ :Uá P; L Í #ÝÜ :Ü E Í $ÝÞ ;Þ

3. NUMERICAL METHOD 3.1 Numerical Method The method used is the Runge ± Kutta forth degree due to its low errors when calculating the solutions of the differential equations; it will solve every state variable at every time-step using the calculated values obtained from other state variables, so giving the 5 values implies the calculus of the first one applied to the second and so forth. All the iterations are solved and must be finished using the time step established. The method works for linear homogeneous equations of the form: @B:Pá U; L B:Pá U; @P

á

à

Ü@5

Þ@5

(11)

Using this form for (3), (4), (5) and (6) the method constants can be obtained as:

(2)

RK-4 method uses four constants to calculate the slope ZKLFK OHDGV WR WKH QH[W YDOXH RI WKH GLIIHUHQWLDO HTXDWLRQ¶V solution, those constants are calculated as follow:

T-205

á

à

G5Ý L Í #ÝÜ :Ü E Í $ÝÞ ;Þ Ü@5 á

(12)

Þ@5

à

G6Ý L Í #ÝÜ k:Ü E räwDG5Ý o E Í $ÝÞ ;Þ

(13)

G7Ý L Í #ÝÜ k:Ü E räwDG6Ý o E Í $ÝÞ ;Þ

(14)

Ü@5 á

Þ@5 à

Ü@5 á

à

Þ@5

Ü@5

Þ@5

G8Ý L Í #ÝÜ k:Ü E DG7Ý o E Í $ÝÞ ;Þ

(15)

To complete the method, it is required to use all k results in (8) for obtaining the result. To obtain the 5 results an actualization of values is considered after every j iteration, this means the new X1 value calculated will be used in the calculus of X2. This consideration derives in an important restriction, every equation must be ordered so its time FRQVWDQW LV ORZHU WKDQ WKH QH[W YDULDEOH¶V RQH 6RUWLQJ VWDWH YDULDEOHV OLNH WKLV DOORZV ³IDVWHU´ UHVSRQVHV WR EH FRQVLGHUHG IRU WKH FDOFXOXV RI ³VORZHU´ RQHV GRing otherwise would obviously affect final results. $QRWKHUGHWDLOZKHQVROYLQJWKHPRWRU¶VPRGHOLVWKDWVRPH state variables are interacting inside A matrix, so their values will change for every iteration, thus, the whole A matrix. These values must be collected at the end of all j sets of iterations and replaced inside that matrix. Iterative methods tend to diverge or find wrong values when the time-step is set WR KLJK VR WKH UHVXOWDQW IXQFWLRQ FDQ¶W EH IROORZHG VR adequate steps must be chosen in order to obtain good results. 4. FPGA IMPLEMENTATION 4.1 DC Motor

For achieving the correct implementation, the time in which the FPGA can manage to solve the needed iterations is crucial. As the iterative method has been established, the variable that has to be selected is the iteration time; the number of iterations per result is fixed. Step time stands for WKHWLPHLW¶VQHHGHGWRSHUIRUPRQHH[HFXWLRQRIWKHLWHUDWLYH method so one result is obtained; every time the system finds the solution for the n variables a step has concluded. In the offline simulation presented, it was used a step of 5ms, this means for our FPGA system, the step time must be set at that value for validation purposes. Two risks are derived from an incorrect selection of the step size. The RK-4 precision changes as the h value changes, so for big step sizes the result of the iterative method can be similar to the right response but not the same. Graver effects can be presented when the step size is even larger and the method diverges. Particularly for RK-4 method, decreasing h value tends to correct results in spite of the possible round error inherent to iterative methodologies so finding the shortest h means the best results obtained. The FPGA board used in this implementation is the National Instruments sbRIO-9612 which has a 40MHz clock, digital and analog inputs/outputs and an Ethernet port. FPGAs are widely preferred among other devices in real-time simulations due to their high throughput arithmetical capabilities which lead to a minimum iteration step when solving methods like the one that was presented above. An example on solving k3 is shown in Fig. 2. The program was designed for solving our particular two state variables problem, and precision of results is adjusted to a fixed point value of 32bits with 16bits devoted to decimals 32/16bits-, obtaining a delta -minimum step between numbers- of 1.5259E-5.

As the RK-4 method solves using different constant slopes in every cycle and the expected current response will present a high change rate, the numerical limits due to the bits used are not enough to all kinds of input variables changes, thus the particular calculation of (8), a 40/20 bits configuration is established. The manner the FPGA delivers information to the host computer is through memory FIFO stacks±shown in Fig. 3, which can hold a determined number of values until they are asked for. FIFO stacks can help in this development to figure out whether or not there is a real-time error; when FPGA ends one set of iterations, FIFO values are changed occupying one stack position. That stack position is then read in the host computer and presented as a graphic, which works as an oscilloscope -time-driven-. If after a FIFO reading, there are still values it can be assumed FPGA speed is superior to communication capabilities of Ethernet connection and host PC data management. A Boolean indicator is placed in the frontal panel to show at any time this occurs ±also it is shown in Fig. 4. The values are separeted as they can be changed when the program is running online or starting the simulation. Thus , the motor characteristics are fixed and the armature voltage and load torque can be changed even in cualitative matters using the knobs. Bollean real-time error led is also shown in this section and the time step input. The value entered for fixed values is not restricted to 32/16bits fixed point limitants but time step value is because it needs to be transferred with a compliant format. FPGA boDUG¶V F\FOH WLPH LV DGMXVWHG WR ZRUN ZLWK LQWHJHU YDOXHV which stand for milliseconds, so a correction can be made using rounding inside FPGA board and real time asked in the front panel is then correct. A stop button has been added to halt both, host computer SURJUDP DQG )3*$ ERDUG ,W DOVR DYRLG ),)2 PHPRU\¶V dismatch as executions are asked.

T-206

Fig 2. Block diagram for solving the parameter k3.

Fig.5 Reading FIFO method which reads 5 steps of each state variable in only one host PC cycle Normally matrixes are not supported into FPGA, hence calculus must be made with one-dimensional arrays which cannot be indexed as a result using values in a row-column form is not possible. An alternative way has been used in order to manage values as part of a matrix. Taking into account that they are not matrix, however; row-column indexation is possible. Fig 6 shows Matrix topology in FPGA when it is not supported matrix manipulation.

Fig 3. FIFO stacks.

One-dimension Array Cluster

Cluster

Cluster

One-dim Array

One-dim Array

One-dim Array

One-dim Array

One-dim Array

One-dim Array

One-dim Array

One-dim Array

One-dim Array

Fig. 6 Matrix-Topology in FPGA. Fig 4. Frontal panel.

4.2 Induction Motor For solving (8), a 40/20 bits configuration is established, in order to run the program in real time with enough precisions. The results obtained from every set of iterations is delivered to host PC through DMA memory FIFO stacks, which can hold a determined number of values until they are asked for. As the communication is made with an Ethernet protocol, time lags due to the protocol itself are expected. A solution for this problem is to read the FIFO stack from host PC not at every available value but every n values, this also allows us to assign shorter time-steps. Making possible to transfer the values obtained from the last 25 jiterations ±for example- over the FPGA board in one only cycle in host PC without problems, Fig. 5 shows the reading process in a FIFO.

As shown in Fig. 6, a matrix-topology can be obtained mixing clusters and arrays. We can construct a 3xn matrix with the topology presented above, where n depends on the size of the arrays contained inside clusters. Nevertheless, the first purpose of organizing values in this way is to manipulate data in an easier manner, thus the example method for reading from our array of clusters is presented in Fig. 7.

Fig.7 Reading method to get values from a matrix-like variable Using this kind of data organization can make programming easier and faster to run; an iterative method generalization is then achieved not only for math basis but )3*$¶VVROYHU The parameters of the motor can be changed only when simulation is stopped, on the other hand, Input values can be changed anytime and the effect those changes have over simulation will be presented immediately on the results.

T-207

T-208

6. CONCLUSIONS Real time simulation platform based on LabVIEW FPGA, in which the performance of simulation of an electric DC and AC motor develops in precisely the same time-scale as the corresponding behavior of the electric machine itself, has been validated and tested under different conditions, showing good results. The two main distinguishing features of the real time simulation presented are synchronization with the real time electric machine behavior via a real time clock which runs into the LabVIEW FPGA and the user interface system that allows the external systems to operate just as if they were connected to the real input voltage and load. By using this real time interface a real performance of the motor under different condition could be validated and the motor could be tested before it is installed in a manufacturing process. The state space motor representation could change according to the user requirements.

Fig.12 Simulation of a voltage drop to 50V

REFERENCES

Fig.13 Shows a load step of 15Nm and the motor response which tends to reverse turn direction at 50 Vs.

Fig.14 The voltage source in the stator is equal to 127 V and the load step of 15Nm.

Engineering, H. (2008). Choosing dsp or fpga for your application. URL www.hunteng.co.uk/dsp-fpga.htm. Jayalakshmi, K.; Ramanarayanan, V.; , "Real-time simulation of electrical machines on FPGA platform," Power Electronics, 2006. IICPE 2006. India International Conference on , vol., no., pp.259-263, 19-21 Dec. 2006 Hao Chen; Song Sun; Aliprantis, D.C.; Zambreno, J.; , "Dynamic simulation of electric machines on FPGA boards," Electric Machines and Drives Conference, 2009. IEMDC '09. IEEE International , vol., no., pp.1523-1528, 3-6 May 2009 Iordache, M.; Calomfirescu, I.; Niculae, D.; Dogaru, M.; , "Simulation of induction motor using state variables," Advanced Topics in Electrical Engineering (ATEE), 2011 7th International Symposium on , vol., no., pp.1-6, 12-14 May 2011 0LOOHU 6 DQG :HQGODQGW -  ³5HDO-Time Simulation of 3K\VLFDO 6\VWHPV 8VLQJ 6LPVFDSH´ 0DWK:RUNV Newsletter. 2011 P Ponce , F Sampe "Maquinas electricas y tecnicas de control modern," Alfaomega 2010 Sahoo, Sarat Kumar ; Das, G. Tulasi Ram ; , Vedam ; Contributions of FPGAs to industrial drives: A review, Information and Communication Technology in Electrical Sciences (ICTES 2007), 2007. ICTES. IET-UK International Conference on Issue Date : 20-22 Dec. 2007 Yakoubi, Youssef; Lenczner, Michel; Goavec-Merou, Gwenael; Couturier, Raphaël; Friedt, Jean-Michel. (2011). Diffusive Realization of a Lyapunov Equation Solution, and Its FPGA Implementation. IFAC Y. J. Zhou; T. X. Mei. (2005). FPGA based real time simulation for electrical machines. IFAC World Congress, Volume # 16 | Part# 1

T-209

Appendix A. DC Motor parameters 5D Ÿ, 5I Ÿ, La=7mH, Lf=1.3H, k=1.3 V/rad/s, J=8.4kgm-2,  and Ua=120V at no load condition is Induction Motor parameters 5V Ÿ, 5U Ÿ, Lls=2mH, Llr=2mH, Lm=69.31mH, J=0.089kgm2, B=0.005Nms and P=1. Vs=127V and Tl=3.5Nm.

T-210