DSP Based Embedded Code Generation for PMSM ...

83 downloads 0 Views 731KB Size Report
control the 3 phase inverter. Both Park transformation module and inverse Park transformation module need the rotor flux location (theta). This rotor flux location ...
16th International Power Electronics and Motion Control Conference and Exposition

Antalya, Turkey 21-24 Sept 2014

DSP Based Embedded Code Generation for PMSM Using Sliding Mode Controller Cem MORKOÇ Graduate School of Sciences BilecikùeyhEdebali University Bilecik, TURKEY [email protected]

Yasemin ÖNAL Electrical-Electronic Engineering BilecikùeyhEdebali University Bilecik, TURKEY [email protected],

Abstract—This study presents a Digital Signal Processor (DSP) based embedded code generation which is obtained automatically in PSIM software for Permanent Magnet Synchronous Motor (PMSM) control system. The simulation model of the PMSM control system is developed in PSIM environment using Motor Control Blocks and Embedded Target for TI 28335 block. This control block diagram is send to SimCoder to generate C-code that is ready to run on the DSP hardware, SimCoder also creates the complete project files for the TI Code Composer Studio development environment where the code will be compiled, linked, and uploaded to the DSP using High Voltage Motor Control-PFC Kit. So, embedded code generation provides a very quick way to design a motor drive system from user specifications also programming greatly simplifies the generation, prototyping and modification of DSP based design, thus decreasing the development cycle time. Key Words-PMSM ; DSP; Embedded Code Generation; PSIM

I.

INTRODUCTION

Because of high capacity and qualification in industry, the permanent magnet synchronous motor (PMSM) has greatly accepted between the various types of alternative current motors. The PMSM's have been increasingly applied for drive applications, such as robotics and weapon servo-control systems, due to their high power density, torque to inertia ratio and high efficiency [1]. But, the rotor speed and back indication it are measured by a speed sensor or an optical encoder to the controller to provide the precision speed control in traditional PMSM control technics. Some inspection technics like this nonlinear control for speed and position control of PMSMs become a substantial issue and changing sensorless control tactics have been researched, such as, neural networks control, adaptive fuzzy control, the sliding mode observer [2-4]. Lately, with fast evolvements of the system-on-chip, a high-capacity digital signal processor (DSP) has become a general field of research in the area of the digital control for alternative controls [5]. For this reason, The DSP based controller is used for PMSM control system[6-9]. It is likely to improve a fast prototyping system where DSP algorithms are designed and represented in block diagrams and applied in real-time without any confidential training in a confidential assembly language for the target DSP processor. In such situations, algorithm builders will be capable to assess the cost and capacity of their ideas as soon as possible, leading

Metin KESLER Computer Engineering BilecikùeyhEdebali University Bilecik, TURKEY [email protected]

to f design confirmation and attestation of concepts. This was the motivation for the improvement of the fast prototyping system to high speed DSP improvement [10-12]. In this study, DSP based embedded code generation in PSIM software environment is presented. PMSM control system is firstly developed in PSIM environment using Motor Control Blocks and Embedded Target for TI 28335 block. This block diagram is send to SimCoder to generate C-code, SimCoder also creates the complete project files for the TI Code Composer Studio development environment where the code will be compiled, linked, and uploaded to the DSP using High Voltage Motor Control-PFC Kit. So, embedded code generation provides a very quick way of design a motor drive system from user specifications also programming greatly simplifies the generation, prototyping and modification of DSP based design, thus decreasing the development cycle time. II.

MATHEMATICAL MODEL OF A PMSM

In the traditional two-axis d-q synchronous rotary reference frame can be defined as in (1-2); ௗ௜೏ ௗ௧ ௗ௜೜ ௗ௧

ൌെ

ோ ݅ ௅೏ ௗ

൅ ‫ݓ‬௘ ݅௤ ൅

ൌ െ‫ݓ‬௘ ݅ௗ െ

ோ ݅ ௅೜ ௤

ଵ ܸ ௅೏ ௗ

െ ‫ݓ‬௘

ట೑ ௅೜

(1)



ଵ ܸ ௅೜ ௤

(2)

where ‹ୢ ǡ ‹୯ is the stator current in the d-axis and q-axis, ୢ ǡ ୯ is the stator voltage in the d-axis and q-axis, ɗ୤ is the magnetic flux linkage of the magnet of the rotor, ୢ ǡ ୯ is the inductance in the d axis and q axis, ™ୣ is the electrical angular speed, R is the phase winding resistance. ୣ is the electromagnetic torque, p is the pole pair number of the motor and can be defined as in (3). [13] ଷ

ܶ௘ ൌ ‫݌‬൫߰௙ ‫ܫ‬௤ ൅ ൫‫ܮ‬ௗ െ ‫ܮ‬௤ ൯݅ௗ ݅௤ ൯ ଶ

(3)

In this paper the vector control attitude is used to the current control turn of the PMSM drive system. The basic idea of this approach is to control AC motor like DC motor by transforming stator currents to rotating d-q axis currents. q axis current is in direct proportion to motor torque. Flux is constant taken due to the permanent magnet. In this way, Control of the

‹,((( PEMC 2014

472

16th International Power Electronics and Motion Control Conference and Exposition

motor torque of the DC motors is done by controlling single current (‹୯ ) as DC motors [14]. Then, while the d-axis current is forced to zero electromagnetic torque can be abbreviated as in (4) ଷ

ܶ௘ ൌ ‫݌‬൫߰௙ ‫ܫ‬௤ ൯

(4)



Considering the mechanical load, dynamic equation of the electromechanical system can be defined as in (5) ௗ௪೘ ௗ௧



்೐ ି்ಽ ି஻௪೘

(5)



Where୐ is the load torque, is the inertial value,  is the damping coefficient and ™୫ is rotor mechanical speed in angular frequency, which is related to the rotor electrical speed as in (6) ‫ݓ‬௠ ൌ ‫ݓ‬௘ Ȁ‫݌‬

(6)

III.

CONTROLLER DESIGN OF PMSM

The block diagram of the field oriented control method with sliding mode controller for PMSM control is shown in Fig.1. Primarily, two motor phase currents are measured. The Clarke transformation module in Fig.1 is fed by these measurements (ib and ic). These two elements of the current isĮ and isȕ are the inputs of the Park transformation module. The isd and isq elements are analogized to the references id (the flux reference) and iq(the torque reference). The outputs of the current regulators are Vd and Vq. They are applied to the inverse Park transformation module. The outputs of this projection are VĮ and Vȕ, which are the elements of the stator vector voltage in the (Į, ȕ) stationary orthogonal reference frame. These are the inputs of the space vector PWM. The outputs of this block are the signals that control the 3 phase inverter. Both Park transformation module and inverse Park transformation module need the rotor flux location (theta). This rotor flux location is acquired from sliding mode observer [15].

IV.

Antalya, Turkey 21-24 Sept 2014

EMBEDDED CODE GENERATION AND PSIM SIMULATION MODEL OF PMSM CONTROL SYSTEM

The process of embedded code generation is signified in Fig. 2. Overall system model generated by using motor control and Embedded Target for TI F28335 blocks from PSIM library and SimCoder sub-programme of PSIM. Afterwards, TI Code Composer Studio generates suitable C codes from this model and sends DSP by emulator which is exist on High Voltage Motor Control-PFCKit. The DSP algorithms are presented using PSIM block sets. It is used to motor control blocks which includes a number of suggest templates for induction motor or linear and nonlinear PMSM. Such as PMSM drive system includes space vector PWM current control, and maximum torque per amper (MTPA), dynamic torque limit control, speed control. With Motor control blocks and embedded target for TI 28335 are used to make all of the PMSM control system. SimCoder is used to generate C-code from the embedded target for TI 28335 block diagram through the Code Composer Studio(CCS) and downloads the operable codes into the TMS320F28335 in High Voltage Motor Control-PFC Kit, together with other supporting files.

Figure2. The process of embedded code generation

Figure 1. Block diagram of DSP based SMC for PMSM drive

PEMC 2014

The simulation model, which is developed in PSIM for PMSM control system with SMC method, is shown in Fig.3. In this figure upper bloks which are connected with red lines represent High Voltage Motor Control-PFCKit and its componenets and PMSM. Lower bloks which are connected with black lines represent DSP and its modules and FOC Control Algorithm. The sub-block is given in Fig.4. In this subblock, simulation model of FOC control algorithm with SMO which is described in third section represented. The simulation model, which is developed in PSIM for PMSM control system with SMC method, is shown in Fig.3. There is a block which named Parameter File. This block saves all parameters that used in overall model by variables. So, all parameters can be changed and seen from this window which shown in Table1. The sub-block is given in Fig.4. Not only performing the code

473

16th International Power Electronics and Motion Control Conference and Exposition

generation, first hardware target configuration should be defined for Code Composer Studio, but also on the simulation control block, the hardware target should be set to F2833x. PSIM generates not only the code but also all the required project files for four configurations: RAM Debug, RAM Release, Flash Release, and Flash RAM Release.

Antalya, Turkey 21-24 Sept 2014

(multiplexed) analog to-digital converter (ADC), of up to 12bits resolution, working at conversion rate of up to 25 MHz or more and having 2 simultaneous sample-and-holds. The power of the PMSM is 0.4KW, 8 poles, the rating speed is 3000rpm, base peak phase voltage 236V and current 20A. The variables of the motor are: Rs=2.35ohm, Ls=0.0065H.

Control of Motor 560k

1u

A

Table 1. Parameter File block window

A A

560k

220u 220u

PMSM

Ia

In Out

V nm V wm In

2*3.14159/(60*Wmb)

Out DSP Clock F28335

0.005

9.09k

0.005

0.005

Stator Resistance

RS(Ohm)

4,7

Stator Inductance

LS(Hr)

0,0133

MotorFreq (Hz)

10K

T

1/MotorFreq

SpdFreq(Hz)

1K

MinDelta

0,0000305

SpdKp

0,5

SpdKi

T*100,2

SpdKd

0

SpdKc

0,2

idKp

1

idKi

T*10,04

idKd

0

idKc

0,2

iqKp

1

iqKi

T*10,04

iqKd

0

iqKc

0,2

spdEstFc

2,5

spdEstFb

200

spdEstRpm

3000

smoCg

0,25

smoFg

0,105708

Motor PWM Switching Frequency

File

Period

SCI Config F28335

Speed Loop Frequency ADC

Vdcbus

A0 A1 A2 A3 A4 A5 A6 A7 B0 B1 B2 B3 B4 B5 B6 B7

V_ia V_ib

D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 D10 D11 D12 D13 D14 D15

Speed Change Step

PMSM Control Algorithm ia

Ta

K

3-ph PWM up u un

ib

Tb

K

v

Vdcbus

Tc

K

vp vn

w

wp wn

spdPID Parameter Values

F28335

F28335

START

GPIO31 GPIO34

ZOH

LOOP_I Stop PWM

LOOP_SP

DOUT D0 D1 D2 D3 D4 D5 D6 D7

D0 D1 D2 D3 D4 D5 D6 D7

F28335

F28335

idPID Parameter Values

Start PWM

1

z

F28335

Figure 3. PSIM simulation model of PMSM control system with embedded code generation Current PID

matic 

IqRef1 in

SCI F28335

Iq ref: 0.15 p.u

SCI F28335

MUX

0

PID/w reset V ref fb clr

ZOH

out

SCI F28335

0

MUX

ZOH

MUX

pid_Iq_ref

ON_sw

TI DMC

0.3

ZOH Loop_spd

gain

1

offset

Ramp Cntl

Loop_i

0

MUX

flag TI DMC

1

z

Loop_spd

out

SCI F28335

Speed_est

Theta_set

Ta Tb Tc

SpdEst Parameter Values

Clarke

ia

al a offset

SMO Parameter Values

be b TI DMC

ib

Speed_ref TI DMC

SCI F28335

MUX

Speed Cal Wr theta rpm TI DMC

SpdEst

u u

out

SCI F28335

sin cos

Loop_spd

SMO Theta_est out

SCI F28335

1

z

The inverter has 6 sets of IGBT power transistors. The collector-emitter voltage of the IGBT is rating 600V, the gateemitter voltage is rating 320V, and the collector current is rating 20A DC and in short time (1ms) is 40A.

Loop_i

out

freq

Loop_i

PID Reg3 pid1_iq ref out SCI fb F28335 TI DMC Park d al be

SVPWM Inverse Park SV Gen (DQ) d al al Ta q Tb sin cos be be Tc TI DMC TI DMC

Ramp Gen

RmpCtrl ON_sw

pid1_id

sin q cos TI DMC

RmpGen

Speed reference setting. Initial value: 0.25 p.u

 

fb TI DMC

iqPID Parameter Values

Ta Tb Tc

PID Reg3 ref

MUX

Loop_i

Speed PI

SpeedRef1 in

0.05

SMO v theta al be z i al al be be pu TI DMC

VOLT Phase Voltage va v1 vb v2 vc v3 al be

vdc

1

z 1

z 1

z

Vdcbus

TI DMC

Figure 4. Thesub-block diagram of PMSM control algorithm

V.

EXPERIMENTAL SYSTEM AND RESULTS

The overall block diagram of PMSM control system is illustrated in Fig.1, and its experimental system is shown in Fig. 6. The experimental system includes a TMS320F28335 DSP controller, a voltage source IGBT inverter and a PMSM The TMS320F28335 involve multiple channels of 16-bit pulse-width modulators (HR-EPWM) with high resolution 8bit part with probability to arrange the PWM in remainder of the digital clock ("micro-steps"). Such PWM works at clock high frequencies and can be used as precise digital-to-analog converters (DAC). Such DSP chips also involve multi channel

PEMC 2014

Figure 6. Experimental setup

474

16th International Power Electronics and Motion Control Conference and Exposition

Fig.7 shows the experimental results of the Theta that is output of the SMO, phase a current and phase b current. Fig.8 shows the experimental results of the Space Vector Generator Unit duty ratio. These three voltages transformed 6 PWM signals which control IGBT power transistors of inverter.

Antalya, Turkey 21-24 Sept 2014

Ta

Tb

Tc

Theta

Figure 9.Three phase line voltages phase a (Ta-blue), phase b (Tb-cyan), phase c (Tc-purple) and Theta (green)

Figure 7. Phase a current (red), phase b current (black) and Theta(green)

Figure 10.Experimental results for speed variation, reference speed(green) and estimated speed (red) open loop

Figure 8. Phase a voltage (Ta-red), phase b voltage (Tb-green) and phase c voltage (Tc-red)

Fig.9 shows three phase line voltages (Ta, Tb and Tc) and teta signal obtained from output of SCI communication interface. Fig.10 shows experimental results on open loop for the reference speed and estimated speed which is generated by Sliding Mode Observer. Fig.11 shows experimental results on closed loop for the reference speed and estimated speed which is generated by Sliding Mode Observer.

PEMC 2014

Figure 11.Experimental results for speed variation, reference speed (green) and estimated speed (red) closed loop

475

16th International Power Electronics and Motion Control Conference and Exposition

VI.

CONCLUSION

This study presents a model based embedded code generation for PMSM control system in PSIM environment. DSP based embedded code is automatically produced using motor control blocks, embedded target for TI 28335 and SimCoder in PSIM environment. This produced embedded code is loaded DSP using High Voltage Motor Control-PFC Kit by via Code Composer Studio CCS2000. The any changes on model is quickly realized using the model based embedded code generation and control algorithm. All of the system work properly as shown from the results which is obtained from output of SCI communication interface with four channel DAC by oscilloscope and output of SPI communication interface by PSIM. Changes of the values of variables as speed reference effects on measured results also on PMSM in real time. A lot of changes which required for obtain an optimum system can be done very quickly and easily while developing the control system. Finally, embedded code generation provides a very quick way to design a motor drive system from user specifications; also programming greatly simplifies the generation, prototyping and modification of DSP based design, thus decreasing the development cycle time. REFERENCE [1]

[2]

[3]

C.Elmas, O.Ustun. "A hybrid controller for the speed control of a permanent magnet synchronous motor drive". Control Engineering Practice, vol. 16, no.4, pp. 260-270, 2008. Y. S. Kung, Member, IEEE, and M. H. Tsai, “FPGA-Based speed control IC for PMSM drive with adaptive fuzzy control,” IEEE Transactions On Power Electronics, vol. 22, no. 6, pp. 2476-2486, November 2007. V. Q. Leu, H. H. Choi, and J. W. Jung, “LMI-based sliding mode speed tracking control design for surface-mounted permanent magnet synchronous motors,” Journal of Electrical Engineering & Technology Vol. 7, No. 4, pp. 513-523, 2012

PEMC 2014

[4]

[5]

[6]

[7]

[8]

[9]

Antalya, Turkey 21-24 Sept 2014

K. Paponpen, and M. Konghirun, “An Improved Sliding Mode Observer for Speed Sensorless Vector Control Drive of PMSM,” IPEMC 2006, Power Electronics and Motion Control Conference, CES/IEEE 5th International, Shangai, vol. 2, pp. 1-5, 2006. Y.S. Kung, Member, IEEE, “Design and implementation of a highperformance PMLSM drives using DSP chip,” IEEE Transactions on Industrial Electronics, vol. 55, no. 3, pp. 1341-1351, March 2008. J.W. Jung, T.H. Kim, and H.H. Choi, “Speed control of a permanent magnet synchronous motor with a torque observer: a fuzzy approach”,IET Control Theory and Applications, vol. 4, pp. 2971-2981, Dec. 2010. S. Li , M. Zhou and X. Yu “Design and implementation of terminal sliding mode control method for PMSM speed regulation system”, IEEETrans. Industrial Informatics, vol. 9, no. 4, pp.1879 1891 2013 H. H. Choi , N. T.-T. Vu and J.-W. Jung “Digital implementation of an adaptive speed regulator for a PMSM”, IEEE Trans. Power Electron., vol. 26, no. 1, pp.3 -8 2011 F. F. M. El-Sousy “Robust adaptive wavelet-neural-network slidingmode control for a DSP-based PMSM drive system”, J. Power Electron., vol. 10, no. 5, pp.518 -527 2010

[10] K.H.Hong, W.S. Gan, Y. K. Chong, K. K. Chew, C. M. Lee, T. Y. Koh, “An integrated environment for rapid prototyping of DSP algorithms using Matlab and Texas Instruments’ TMS320C30, in Microprocessors and Microsystems, Volume 24, Issue 7, pp. 349–363, 1 November 2000. [11] C. Morkoç, and M. Kesler, “Rapid prototyping of PMSM control system and automatic generating of DSP embedded codes,” ELECO '2012 Elektrik - Elektronik ve Bilgisayar Mühendisli÷i Sempozyumu, Bursa, Turkey, pp. 51-54, 29 November - 01 December 2012. [12] M. Kesler, M. Uçar, and E Özdemir, “ Rapid prototyping of shunt active power filter control algorithm, which involves otomatic embedded code generation,” ELECO '2006 Elektrik - Elektronik ve Bilgisayar Mühendisli÷i Sempozyumu, Bursa, Turkey, pp. 181-185, 6December 10 December 2012. [13] Karabacak, M., “Sürekli mÕknatÕslÕ senkron motorun do÷rusal olmayan ve uyarlamalÕ geri adÕmlÕ hÕz denetimi”, Sakarya Üniversitesi Fen Bilimleri Enstitüsü, Sakarya, 2012. [14] K. SarÕo÷lu, M. Gökaúan, S. Bo÷osyan, Asenkron Motorlar ve Kontrolu, Birsen yayÕnlarÕ, 2003 [15] B. Akin, and M. Bhardwaj, Sensorless Field Oriented Control of 3-Phase Parmanent Magnet Synchronous Motors, Texas Instruments, Application Notes.

476

Suggest Documents