106
INFORMATION TO USERS This msnuctript hs k«i mpmâuoed from miaolilm wtet. UMI films th. text dimdy from the original or copy rubmitted. Thus. umir thesis and dissertation copia am in typewfiter face, whib o(h.m may be (rom any type of amputer pnnter. Tho quality d thh nproduotkn k dapmdrnt upon th. qrulity of th. copy urbmi#.d. Bmûen or indistinc! print. colorad or poor qurlity tlktstratkns and photogmphs, @nt biedtfirough, suôrtandard rnargins. ami impcop.r alignmt a n cidvemely afkt mproducüon. In the wilikely event thit tfm author did not wnâ UMI a cornpleta manuscript and them are miuing pages, these will be notd. Alw, W u~uthorizeâ copyright mateiol hid to be mmoved, a nota wiU indicata (ho deletion. Ovenue matedals (ag., rnaps, dmwings, ch.rts) are rsproduced by sectiming the original, k g i m n g at the upper kft-)iurd comr and contijnuing hom left to right in equd sediom mth smal weriaps. Photographs indude~I in îhe original rmcw)script have bem reproduoed xerogmphically in this apy. Highrr pwlw O' x Sa bbck and white photogtaghic prints am availabk for ny photogmphs of illustmtions appeadng in this copy for an additional chrip.. Contact UMI dimtly to ~ & r . Bell & Howrll Information and Lnuning 300 Nor(h Zeeô RoW, Ann A-. MI 481061 346 USA 800.52110600

INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

Embed Size (px)

Citation preview

Page 1: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

INFORMATION TO USERS

This msnuctript h s k«i mpmâuœd from miaolilm w t e t . UMI films

th. text dimdy from the original or copy rubmitted. Thus. umir thesis and

dissertation copia am in typewfiter face, whib o(h.m may be (rom any type of amputer pnnter.

Tho quality d thh nproduotkn k dapmdrnt upon th. qrulity of th. copy urbmi#.d. Bmûen or indistinc! print. colorad or poor qurlity tlktstratkns

and photogmphs, @nt biedtfirough, suôrtandard rnargins. ami impcop.r

alignmt a n cidvemely a f k t mproducüon.

In the wilikely event thit tfm author did not wnâ UMI a cornpleta manuscript

and them are miuing pages, these will be notd. Alw, W u~uthorizeâ

copyright mateiol hid to be mmoved, a nota wiU indicata (ho deletion.

Ovenue matedals (ag. , rnaps, dmwings, ch.rts) are rsproduced by

sectiming the original, kgimng at the upper kft-)iurd comr and contijnuing

hom left to right in equd sediom mth smal weriaps.

Photographs indude~I in îhe original rmcw)script have bem reproduœd

xerogmphically in this a p y . Highrr pwlw O' x Sa bbck and white

photogtaghic prints am availabk for n y photogmphs of illustmtions appeadng

in this copy for an additional chrip.. Contact UMI dimtly to ~ & r .

Bell & Howrll Information and Lnuning 300 Nor(h Zeeô RoW, Ann A-. MI 481061 346 USA

800.52110600

Page 2: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for
Page 3: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

Sensorless Flux Vector Control for a Permanent Magnet Synchronous Machine with

Cyiindrical Rotor under Severe Starting Conditions

Cnstian Anghel

A thesis submitted in conformity with the requirements for the degree of Master of Applied Science

Graduate Department of Electrical and Cornputer Engineering University of Toronto

8 Copyright by Cnstian Anghel 1997

Page 4: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

National Library BiMbîT nationale du Cana

Acquisitions and Acquisitions et Bibliographie Services services bibliographiques

395 Welhgton Street 395, rue Wellington OttrmON K1A ON4 OmwaûN K I A W Cuidr canada

The author has granted a non- exclusive licence allowing the National Library of Canada to reproduce, loan, distribute or seîl copies of this thesis in microfonn, papa or electronic formats.

The author retains ownership of the copyright in this thesis. Neither the thesis nor substantial extracts fiom it may be printed or otheiwise reproduced without the author' s permission.

L'auteur a accordé une licence non exclusive permettant à la Bibliothèque nationale du Canada de reproduire, prêter, distribuer ou vendre des copies de cette thèse sous la forme de rnicrofiche/film, de reproduction sur papier ou sur format électronique.

L'auteur conserve la propriété du droit d'auteur qui protège cette thèse. Ni la thèse ni des extraits substantiels de celle-ci ne doivent être imprimés ou autrement reproduits sans son autorisation.

Page 5: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

Sensorless Flux Vector Control

for a Permanent Magnet Synchronous Machine

with Cylindncal Rotor under Severe Starting Conditions

Master of Applied Sciaice 1997

Crilm E. Anghel

Graduate Department of Electricd and Cornputer Engineering

University of Toronto

'Ihis thesis is concemed with determining a sensorless method for the closed-loop, con-

trollcd torque sûutiip of a cyiindiical Permanent Magnet Synchronous Machine (cylindrical

PMSM).

The PMSM bas a superior power dmsity, high torque/ineda ratio and efficieucy. Flux

Vector Coatrol ( W C ) constitutes toàay's state of the axt in motor cmtrol, offerhg precise torque

regdation in a wide range of speedq dom to and including standstiu.

UQng rotor flux vector position as a reference the stator cunent is controlied in amplitude and an-

gle to achieve optimal torque. A sh& sensor (rcsolvr or encoder) is required to determine the rotor

flw position. lhis senoor increases tbe cost and size whüe decreasing the reliabiiity of the drive.

The statc of the art in controhg the PMSM is the Sensoilesr Flux Vector Control (SFVC),

which eliminates aii these proôlems as it is based exclusively ni mtasu~ed terminal voltages and

cinrrnts. Several methods operathg the PMSM without position scnsor have been reporteâ in the

litenaire. The review of the propoeed schemes iliuotmes that the SFVC of the PMSM bis limita-

tions at low pced or stmdstill.

These idesitincrticm and cmtrol schemes woxk well for d e n t pole machines, where sa-

Page 6: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

k c y is exploitcd and s e v d position idcntüic~tion mcthods ue possible. Mmy PM maohines,

how~yer ue of the cylindricai type and âue to the large air-gap the saturation tffccts are minor. For

thie important clam of machine position identification at low qeed and stmdsiill hrs not becn in-

vdgited. Oftm the proôlem of r cmtroiîed surt-up is rvoided ail together by us in^ open-loop

stut-up techniques, which provide littîe control of the torque with unnccessuily high currcnts.

lhis work will concentrate on the study of sensorles opcratiom'of a cylinàrical PMSM, as-

suming a typicd design with d a c e mounted Ne-Fe-B permanent mgnets. Sensoiless operation

at low speed and SW-up agillist high torque prescrits sevenl problems which have to be solved

for an operational drive. The position at standstill bas to be identified. This is required to start-up

with optimai torque at a minimum motor cment, thereby miniminng the inverter cumnt nting.

A method to iden* the standstili position for cyhdrical PMSM machines assumiiig ided

cylindrical behavior (Xd = Xq) is pmposed. Furthemore, closed-loop controîied toque start-up is

proposed using a structureâ adrptive flux observer, which dows the start-up with the optimal high

torque in s e v n stuting conditions with the least possible maor cumnt.

Page 7: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

Acknowledgments

Ihe author wishes to express his sincere gratitude and appreciatian to his supe~sor ,

Rofessor R Bonert, for the opportunity to perform this work and for his guidance throughout the

preparation of this thesis.

1 would also Lüre to thank to Rofessor G. Slemon for supporthg and praiding fiaancial

assistance for this work.

The author dso extends gratitude to his fiends in the Power Group for the usefirl discus-

sions during the prepuation of the thesis.

Speciai t h d s is due to my wife Carmen and daughter Ersilia for their understanding and

patience during the preparation of this thesis.

Page 8: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

Table of Contents

Acknowledgments

Table of Contents

1 introduction

1.1 Motivation

1.2 Thesis Ovewiew

2 Literature Review 4

3 Theoretical Background and Mathemrtical Model

3.1 Mathematical Mode1 of Permanent Magna Sy~chronous Machine 9

3.2 Andysis of the Steady-State and of Operation at Standstill under Load 13

3.3 Determination of the Fameters for the Permanent Magnet Synchronous Machine 19

4 Analyrb of the Machine Operation and Definition of the Position Obimer

4.1 Switched PMSM Operation Including the Standstill 24

4.2.1 Principle Definition of the Observer - Ideal Integrator 27

4.2.2 Obseiver Based on an offset Compensated Iategrator 32

4.2.3 Smictunl Adaptive Observer 35

S Determinhg Rotor Position at Standstül in r Cylindrical Machine

5.1 The Ditnculty of Position Detedon at Standdl for a Cylindrical PMSM

5.2 Position Detection Method B a d on initial Incrementai Motion

6 Proposcd Sensorless Drive System witb Cylindrical PMSM

for Stvtrc Stuting Conditions

6.1 Verifkation of the Roposed Sensodess Drive Systcm using Simulation

Page 9: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

6.2 Experimental Test Facility and Verifkation

7 Concluaiona

Rcttrtncea

Appendices

Appendix A

Appenâix B

Appendix C

Appaidix D

Appendix E

Appendix F

Appendix G

Page 10: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

1 Introduction

1 .1 Motivation

This thesis is cornemeci with d e f k g a sensorless method for the closed-loop, controlled

torque start-up of the cylùidrical Pmnaaent Magnet Synchronous Machine (cylinôrical PMSM).

The Introduction will discuss the necessity of the Sensorless Flwc Vector Control (SFVC), present

the challenges in implementing schcmes using a SFVC and provide an overview of the thesis.

The PMSM offers the following advantages: high air-gap flux density , high powedweight

d o , large torquefineida ratio, high torque capability , controlled torque at zero speed, high ef i -

cienc y and power factor (PF).

By implementing a Flux Vector Control ( W C ) for this machine we can achieve a hi@ degree of

torque control over a large operating range of the speed including the standstill. In order to imple-

ment this, the rotor position, which yields the rotor flux position, has to be known. This can be

achieved using a shaft sensor: molver or encoder. The shafi sensor is an expensive device which

increases the complexity and the size of the drive. Furthemore this sensor decreases the reliability

of the dnve due to increased susceptibility to vibration and high tnnperatures.

The state of the an in conwlling the PMSM is the Sensorless Flux Vector Control, which

eliminates dl these problems as it is based exclusively on measured terminal voltaga and currents.

However SFVC of the PMSM has limitations at low speed or standstill. Several methods for oper-

ation without position sensor of the PMSM have ken reporteâ in the literatwe and are reviewed

in [l 1. They are based on one of the following techniques:

a) position detection using the motor panuneters, terminal voltages and currents

b) position sensing ushg the back emfof the motor

c) position i n f m t i o n using the stator thid harmonic component

Page 11: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

d) position information based on the detection of the conducting intemal of free wheeling diodes

connectecl in antiparallel with the power devices

These identification and control schemes work well for salient pole machines, where saliency is

exploited and several position identification methods are possible. Many PM machines, however

are of the cylindrical type and due to the large air-gap the saturation effects are rninor. For this im-

portant class of machine position identification at low speed and standstill has not been investigat-

ed.

This work will concentrate on the study of sensorless operation of the cylindrical PMSM,

assuming a typical design with surface mounted Ne-Fe-B permanent magnets. Due to a large air-

gap the machine exhibits little saturation effects. The topic of high torque start-up required in cer-

tain cornpressor drives, will get special attention as it poses a real challenge for sensorless opera-

tion.

Sensorless operation at low speed and suut-up against high torque presents severa

lems which have to be solved for an operational drive.

First the position at standstill bas to be identified. This allows start-up with optimal torque

minimum motor c m n t thereby minimizing the inverter cunent rating.

1 prob-

at

However, the knowledge of the proper starting position is insuficient for a high torque start-up and

mn through at very low speed due to the typical observer structure which is based on the integration

of the e.m.f. to idemi@ the flux. The required ideal integrator does not work in a practical situation,

due to offsets which saturate the ideal integrator. The conventional offset compensated integrator,

on the other hand, does not work at low speeâ and cannot provide the expected controlled torque

start-up,

Many proposais for sensorless drives are exclusively for the salient pole type machines . Often the pmblem of a controlled nui-up is avoided al1 together by ushg open-loop start-up tech-

niques, which provide little contml of the torqw with unnecessarily high cunmts.

Page 12: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

This work proposes a method to identiQ the standstill position for cylindrical PM machines

assuming ideal cylindncal behavior (Xd = Xq). Furthemore, closed-loop controlled torque start-

up is proposeci using a srmcturcd adaptive flux oôsewer, which allows the start-up with the optimal

high torque in severe starting conditions with the least possible motor cumnt.

1.2 Thesis Overview

Chapter 2 will review the state of the art and discuss in detail the associated problems wirh

the existing solutions to sensorless start-up of cylinârical PMSM in seven starting conditions.

Chapter 3 will outline the required theory of the PMSM machine and provide a discussion of the

proposed initialization of the dynamic equations of the SM ai standstill. This is not reported in the

literature but requireâ to investigate severe staning conditions.

Chapter 4 will discuss the FVC and the required observer and demonstrate by simulation the draw-

backs of the ideal integrator and the compensated integrator used in ciosed-loop starting condi-

tions. A strucnued adaptive observer is proposed and its performance is demonswted.

Chapter 5 presents a methd to identify the initial position of a cylindrical PMSM using incremen-

ta1 movement which causes a typical signature in the machine current which pemits the identifi-

cation of the initial position.

In chapter 6 a drive system for severe starting is proposed and venfied by simulation. The experi-

mental verification of the current signature method aad a number of experiments with regard to the

start-up under high torcpe are also presented.

Chapter 7 concludes the thesis and includes suggestions for M e r research.

Page 13: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

2 Literature Review

This chapter presents the state of the art on SFVC of the PMSM based on the published lit-

erature. Problems encountereà in applying the existing schemes to the controlled torque start-up of

the cylindrical PMSM with high load korque are also discussed.

Numerous papen have been published on the sensorless vector control of the PMSM. Re-

cent Papen selected by the editors for their technical contribution, practical feasibility , tonal val-

ue and applicability to speed or position sensorless operation are collected in [I l . In reviewing

those papers, the following performance cntena were applied: finding the initial rotor position in

a cylindrical PMSM at standstill, the closed-loop start-up in which the torque is controlled and the

position detection methd that continuously gives accurate information fiom standstill to the de-

sired speed operation for a machine having a high load torque. The importance of continuity stems

h m the fact that assuming that the first two problems are surmounted and the machine is acceler-

ating, the integrator, which is the main meihod of position detection, will drift because of the dc

offset signal present in a practical drive system.

In the present work low frequencies (speed) are considered to be in the range of O to 5 Hz.

At low speed the terminal voltage is dorniiiated by the resistance &op and the invener noise, which

leads to an unreliable signal for the e.m.f. Consequently it is dificult to obtain an accurate infor-

mation about the rotor flux position.

Table 1.2 gives a swnmary of the proposed rnethods and their performance.

Page 14: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

Table 1: 2 Litenturc revkw summary

[13] open- Ioop, acccierating terminal voltages > 200 rpm fnquency pulses

I I I

Pl

I ~ 6 1 1 open-loop commutation 1 I > 45 rpm back e.m.f

[ 1 51

> 30 rpm open-loop , ficqucncy ramp command

open-loop undet twice rated load

[17]

[ 181

The primary conclusion of the review is that the present sensorless schemes don? offer a

method to determine the initial rotor position in a cylindrical PMSM at standstill. Most of the

methods do not addms the initial position detection. Those that address it are applicable for salient

PMSM or are trying to find "some saliency" in the cylindrical PMSM. According to the papas,

this position detection for the cylhdrical PMSM at standstill is practically impossible.

back e.m.f

L

cl91

However, [19] claims a method to detemine the rotor position at standstill based on indi-

rect saturation detection. This method is applicable particularly for small power motors and can

third harmonic

- - -

closcd-loop bascd on saliency

not mentioncd

detect the position with an accuracy of +/dl0 electrical. The method provides the start in the right

direction, but does not provide a start-up with high load torque. In this thesis a high load torque is

considered to be at least the rated torque of the machine.

Because this method assumes that some saturation will occur it is strongly dependent on the intriri-

sic properties of the machine. In the PMSM the equivalent (fictitious) rotor cumnt is 4 to 5 times

larger than the stator current b u s e the air-gap is large. This irnplies a low magnetiziag induc-

tance and a low effect of the quivalent (fictitious) rotor current in producing saturation. A very

> 100rpm

closed-loop based on saturation

- -- - - --

currcnts using a Kaiman filter

phase inductance

standstill included

> 300 rpm

back e.m.f. zero crosshg standstill included

Page 15: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

high stator cumnt is required to produee this effect. This *ces the practical applicability be-

cause in some applications the required stator current may be beyond the power source capability,

speciaily in the case were the machine has a meàiurn (1 0 - 100 A) or high current rating (1 00 - 2000

A)*

The claimed accuracy can be easily calculated Qven that the required cuirent for a start-up

h a h g an m r of 60' electrical will becorne two times larger than the current recpired if the po-

sition was lcnown without error. For a conîro1 scheme with a preset starting currmt b a s 4 on the

rotor position, this enor will reduce the torque producing capability to half of the expected value.

In the conditions of a start-up under high load torque it is desirable to have a the position detection

accuracy in the range of +/-30' electrical or less.

The method presmteû in [17], dubbed INFORM (Indirect Flux Detection by On-line Re-

actance Measunment) is based on the fact that due to the permanent magnet excitation some parts

of the PMSM, especially the stator teeh are more or less saturated (Xd > Xq). This method relies

also on the machine htrinsic characteristics and does not give a general solution valid for an ideal

cylinQica1 PMSM where it is known that Xd = Xq.

The problem of initial rotor position detection at stanâstill is avoided by one of the follow-

ing methoàs:

a) energizing two or three stator windings and expecting the rotor to align to a certain definite po-

sition [8], [20]

b) memorizing the angle at the last stop of the rotor and using it to set the current command for the

next start [2].

The performance of the proposed methods is highly dependent upon the characteristics and mag-

nitude of the load toque. To apply metbod a), when a high load torque is present, a large injected

stator currcnt is rquired due to the lack of optimal angle between stator c m t and rotor that gives

maximum possible torque. To obtain such large cments requues overrated inverters. The second

problem consists in the stress chat may appcar in the machine caused by the presence of those large

cwents in the windings.

Page 16: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

The review of the available papers suggests that the sensorless schemes don't offer a

closed-loop start-up. It was mentioned in the Introduction that the typical observer structure is

basd on the integration of the e.m.f. to identify the flux. The practical implementation of this in-

tegnuor requires a method to compensate the offset. This offset compensated integrator does not

function at very low speed and cannot provide the expecteâ controlled torque start-up.

Furthemore, the start-up against a high load torque is not addressecl in the reviewed papen.

Opm-loop strategies are typically employed to achieve the start-up of the machine.

The open-lwp strategies for start-up are hsed on injecting the currents in the motor phases cor-

responding to a certain increasing fiequency profile [2], [8] , [20]. Those will produce an acceler-

ating torque that will bring the speed of the machine to a value where the developed back e.m.f.

gives a reliable position information. At this speed the loop is closed and based on tbis position

information the required switching sequence of the inverter is established.

In [1] is shown that the above strategies have poor dynamic response, and the rotor can ex-

hibit hunting at Iow speed. Lack of reliable information about the real position of the rotor doesn't

allow us to inject these currents at an angle with respect to rotor which gives maximum torque,

making the stari-up dificult (because the torque is not fûlly controlled) especially if the load torque

is high.

In the mentioned collection [l], the ody methods claiming a closed-Ioop stan-up are the two ex-

ceptions mentioned above [17], [19]. The closed-loop start-up was possible because the rotor po-

sition at standstill was assumed to be found. (1 71 also ciaims to offer a high dynamic performance

even at standstill. The start-up with a high load torque is not mentioned in [17] and [19] .

Lwking at low speed operation, the general conclusion is that the dynamic response pre-

seats limitations resulting from the practical implementation of the observer based on the offset

compensated integrator which does not work at very low speed. This nsults in the difficulties in

controllhg the torque at low speed. The best àynamic performances is obtained with the scheme

presented in [2] where an observer that compensates the drift is implemented, this making the

closed-loop control effective down to a fiequency of 1 Hz ( 30 rpm).

The conclusion of the literaturc review presented in this chapter is that the following issues are still

Page 17: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

unresolved: the initial position detection in a cylindrical PMSM at standstill and a controlled start-

up, which does maintain optimal angle h m standstill to low speed when usual observers work.

Those are essential for severe starhg conditions. Research is necessary to solve these problems.

Solutions resulting h m this work will extmd the range of industrial applications based on sen-

sorless SC hemes.

Page 18: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

3 Theoretical Background and Mathematical Model

This chapter presents the theory necessaxy to derive the mathematical mode1 of the cylin-

drical PMSM. The analysis of standstill operation under lad, which is no< adâressed in the litera-

me, but required for a suin-up against high l a d and a method to calculate the parameters of the

PMSM is presented. These are used to analyze the operation of the PMSM.

3.1 Mathematical Model of the PMSM

The electrical and mechanical dynarnics of the synchronous machine can be predicted

from the equations which describe the three phase salient pole machine with damper windings

[Il]. By modifjhg these equations we can predict the behavior of the cylindncal rotor synchro-

nous machine, permanent magnet synchronous moton and reluctanc e motors.

The voltage equations in machine variables - a, b, c for the stator voltage equation and d, q

for the rotor voltage equation are [Il]:

The flux linkages are given by :

Page 19: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

The foliowing notations are use& v-voltage, i-clment, r-resistsnce, k-flux linkage, L-iductance.

The s and r subscripts denote variables associated whith the stator and rotor windings, respec-

tively. L, and L, are the sator and rotor self-inductances matrices. Lw is the mutual inductances

matrix and (L,,)' is the transposeci of this matriu.

These equations contain tirne-varying inductances due to the relative motion of the circuits and

circuits with varying magnetic reluctance. To eliminate the time-varying inductances the stator

equations are transformed to the rotor reference fnum.

in other words the variables associated with the fixed stator windings (voltages, currents,

and flux linkages) are replaceci with variables associated with fictitious windings, rotating syn-

chronously with the rotor, in which the inductances become constants. Thus these equations in the

rotor fiame are:

In equation (3.1.1 ') or npresents the rotor angular speed.

Equations (3.1.1 '), (3.1.2') are expanded, with the zero sequence neglected, and m s -

formd in PU in Appendix A. They are king usd in the analysis to describe the electrical behav-

ior of the PMSM. The flux Mage equations are also given in Appendix A.

To completely dexribe the electromechanical behavior of the rnache we need to add to these

equations the mechanical equations. The expression for the electromagnetic torque Te is [ 1 1 ] :

The relation between torque and rotor speed is given by:

Page 20: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

Written in PU this equation becomes:

The transformation to PU values is show in Appendix B, b and i are space phasors and Tm is the

mechanical time constant in PU. The product between A. and 1 is a vectorial product.

Figure 1 . 1 shows the reference fiames and the angles us4 in definhg the state-space of the

PMSM .

The electrical angular displacement of the rotor relative to the axis of winding A physical location

is defmed as the rotor angle 9,. This synchmnous fnune angle 9, is the angle between the stator

voltage phasor and the winding A. The angle b e ~ e e n the q axis of the rotor and the stator voltage

phasor is the load angle (machine angle) 6 (Figure 3.1).

Figure 3.1 Angles defuiition in the SM

The relation ktween the thrce angles is:

Page 21: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

It is convenient to express the above in the state-space fonn :

The flux linlcages are selected as independent variables (states). The expanded fonn of the

electrical equations (3.1.1 ') and (3.1.2') with the zero sequence neglected together with the two

mechanical equations yielâs the state-space of the synchronous machine. The equations are writ-

ten in PU using the transformations prescnted in Appendix A and Appendk B. For the PMSM

these equations are:

Page 22: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

In these equations al1 the values are in PU except the t h e which is real tirne.

The currents are given by :

Where Am,, is the flux produced by the permanent magnets; assuming that this flux would be

produced by an fictitious equivalent current i; , this current can be calculated with:

The voltage supplied to the machine is expressed as:

vds = -vs sin6

vqs = vscos6

Equations (3.1.8)-(3.1.15) will be the base of the analysis of the PMSM.

3.2 Analysis of the Steady-State

and of Operation at Standstill under Load

The following analysis will provide the initial values of the states for the computer sirnu-

lation of the permanent magnet synchronous machine. In the literature the values of the state vari-

ables are calculated assuming a steady-state 60 Hz operation point having the rated load (1 PU).

At this operating point the stator resistance is v a y small compared with the reactances and is

assumed to be zero. A methoâ ksed on the assumption that stator resistance is zero was devel-

oped and is presmted in A p p d i x C. This method gives the values of the states variables for any

operating point at any load except standstill.

The methods available in literatun and in Appendix C are iriadequate for standstill opera-

Page 23: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

tion because neglecting stator rmistance at sr + O we obtain iq, + m . The liteninire does not

give any method to calculate the state variables at or = O. At standstill the reactances are zero and

the only parameter 1eA is the stator resistance.

A general method that does not neglect stator resistance was developed thus pennining the

analysis of any type of synchronous machine at standstill unda laad torque.

Starthg h m the steady-state equations of the machine, which are obtained from (3.1.8) and

(3.1.9) setting the electrical angular velocity of the rotor or constant ar.d equal with the electrical

angular velocity of the stator voltage os. Therefore the electrical angular velocity of the rotor ref-

erence fiame becomes the electncal angular velocity of the synchronously rotating reference

hme. In the equation (3.1.8) and (3.1.9) the flux linkages are time invariant and al1 the denva-

tions will be zero:

with the flux linkages:

The suitor voltage in the rotor frame is given by:

Page 24: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

If we replace (3.2.3)-(3.2.6) in (3.2.1) and (3.2.2):

Adding to these equations the field voltage eqwition and the torque equation for steady-state the

system equations become:

The inputs associated with these equations are: the magnitude of the stator voltage v, , the field

voltage vdf, the load torque Tlwd and the parameters of the machine. The unknown variables are:

the load angle 6, the two components of the current in the machine id$, i, and the field current idf

From (3.2.7):

The torque equation (3.2.10) yields:

and:

Page 25: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

- load iqs -

From equation (3.2.8):

In (3.2.13) and (3.2.14) we introduce id, calculated with (3.2.11):

Extracting iqs from (3.2.16):

1 vscosS O, Xd v, sin 6 2 - - r ]}

Equation (3.2.1 5 ) may be written as:

Page 26: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

Equivalent with:

In whicb we introduce iqS given by (3.2.1 7):

vs cos 8

This is the equation that has to be solved for 6 . The main objective of this meihod is to find the

values of machine variables for standstill where the other rnethods fails. ïherefore in (3.2.20) we

set a, = O and the equation to be solved is:

Making the notation :

Page 27: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

The equation to be solved is:

For the cylindrical PMSM aaalyzed in the present work, Xd = Xq and equation (3.2.22) reduces

to:

Note ihat for standstill operation the angle 6 is measured clockwise fiom the q axis.

The general equation (3.2.22), which can be uscd for any type of SM, is solved substituting

cos8 = t as a third order polinomial equation.

After 6 has k e n detennined the other variables can be calculated with:

1 - Xdvs sin i5 iqs O (3.2.24)

1 +xSq(-) rs

In settiag a,,, = O the two components of stator currcnt are still defuicd.

Numerical examples are given in Appendix D for the machines used in the dynamic simulation.

Figure 3.2 shows the space phasors for a synchro~~ous machine and for a permanent m g -

net synchronous machine. In the SM the field cmnt , refemd to the stator winding with the rela-

Page 28: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

tion given in Appendix A, is about 1.5- 1.6 times larget than stator cumnt. For the PMSM the

refmad equivalent (fictituous) cunent produced by the magnet is 4-5 tirnes larger than the stator

cment. This is a very important property of the PMSM: a high equivaient current permitting the

presence of a large air gap in this machine.

SM PMSM

Figure 3.2 The Space Phasors in the SM and PMSM

Detemination of the Parameters of the PMSM

An accurate determination of machine parameters is essential in order to make a complete

dynamic a ~ l y s i s and to implement a control based on a position observer, which is in principle

the d e l of this machine in the stator refcrence fiame.

The met&od used in fiading the equivalent-circuit panuneters of the synchronous machine bas4

open-circuit test and shortîircuit test are presentcd in [ 121 p 484. This method is not usefil for a

Page 29: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

permanent magnet excited machine in which the impressed (quivalent) field current idf has a

constant value.

The method used in the present work is based on the stator voltage equation in the rotor

frame for a steady-state opemting point.

The foilowing figw describes the relations used :

Figure 3.3 - The stator current in the synchro-

nous frame and in rotor frame

The procedure to determine the parameten is:

a) To operate the machine as a grnerator with open terminais and we measure the induced e.m.f.

e . This measured induced voltage corresponds to the last tem in (3.2.8) e = I f one is

intemted in calculating the magnetiting inductance Xmd h t has to refer the fictitious field cur-

rent to the stator windings with the relation h m Appendix A :

in which iif is the caiculated fictitious field current, (measured for a synchronous machine with

field winding). Using the measureâ e.m.f. e and this refend field current the magnctizuig induc-

Page 30: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

tance is:

b) If we load the machine opcrating as a motor the stator

fiom the induced e.m.f. At no load they are in phase.

voltage is displ aceâ with the load angle

By measuring the magnitude and the phase shift with respect to voltage of the stator current we

have the two components of stator curent I , , Ip in the stator voltage reference fiame (synchro-

nous fiame). I, is the active power producing component and Ig is the reaciive power producing

component.

i,, = i,cos<p

isp = i,sincp

For ihe same operathg point we can measure the load angle 6 using a stroboscope.

Using the load angle we can calculate the current in the rotor reference frame :

which expanded in rail and imaginary components is:

ids = -ig, COS 6 - ias sin6

i,, = iSa cos 6 - iSg sin6

The stator resistance r, can bc d y measured using a Wheastone bridge.

in the equations (3.2.7) and (3 2.8) the on1 y unknowns are Xd and Xq .

Page 31: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

vs cos ô - rsi,, - e x, = Orn ids

For a cylindrical rotor machine, which is the case of the PMSM studied, Xd = X , and the equa-

tion (3.3.8) can be used to verify the accuracy of the synchronous reactance calculated with equa-

tion (3.3.7).

The calculation of the mechanical Ume constant of the rotor is based on the knowledge of

the base angular velocity, base stator cumnt, base stator voltage, number of pole pairs and the

inertia of the rotor:

The only unknown in this equation is the inertia which will be deteminate using the following

procedure.

The synchronous machine operates as a motor at rated speed n with a certain load torque TIood

which can be measured or calculated. For this experiment a DC machine operating as a generator

with resistive load was used. The equation describing ih is motion is:

Page 32: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

In this equation Tf is the fkiction toque.

In the moment we turn off the supply voltage (t = O) of the synchronous machine Te becomes zero.

in this semp the load torque is bction of speed which decays exponentialy. The the DC machine

cunent, which is recordcd using an oscilloscope, is proportional with the speeâ. The derivative

corresponds to a tangent at the decay function of the curent b w n through t = 0. v

R, is the a r m a t ~ ~ loop resistance hcluding Riad and RBnenior Measuring Ai and An defmed by this tangent, and assuming that at this speed Tiod " Tf and the

fiction torque is neglecteâ, equation (3.3.1 1) becomes:

' load J = - 2 m A n

In which we have al1 the values known:

An = measured

At = measured

Page 33: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

4 Analysis of the Machine Operation and

Definition of the Position Observer

In this chapter the SFVC of the cylindrical PMSM and the position observer required to

irnplement a SFVC dnve system for severe staning conditions are discussed.

4.1 Switched PMSM Operation Including the Standstill

Permanent magnet motors are generally classified as permanent magnet brushless dc mo-

tors with aapemidal back e.m.f. or permanent magnet synchronous moton with sinusoidal back

e.m.f. 111. The DC bnishless motor employs a switched dc power supply with the switching se-

quence king determined h m the rotor position. The permanent magnet synchronous motor uses

a sinusoida1 variable frrquency with a voltage or current regulated PWM inverter to achieve con-

trol of the motor speed and torque, whereby the fiequency is determined by the rotor position.

The electromagnetic torque in the PMSM is produced by the tendency of the magness to

a l ip with the stator m.m.f. In a cylindncal PMSM the reluctance torque is absent. In otber woràs

the intemal torque is due to the interaction between the q component (torque producing compo-

nent) of the stator current Iw, and the rotor field. A high dynamic performance without using an

excessive cumnt can be achieved if the magnetizing component Id of the stator curent is main-

tained at a constant value, ideally zero, while the torque is controlled using the quadrature com-

ponent Iq.

In order to defint and to control the torque producing component and the magnetizing component

of the stator cunent, the rotor position or simply the position of the d axis has to be known.

The litemture about the PMSM control does not give sufficinit and general applicable in-

formation about standstill operation. This opctation is important for sevcre start-up in panicular,

Page 34: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

and for a complete description of the synchronous machine dyaynics in general. Consequently

standstill operation is analyzed in the present work using both simulation and an experimental test

fac iliîy . The d y m c simulations were peifonned using the 'lnteractive Simulation Rogram" de-

veloped by Rof. Bonert in TurboPascal. This simulation tool is interactive, the parameters can be

changed while the simulation is running, a d also offers the possibility of displayhg the space pha-

sors which is a good feature for the purpose of our vector c o ~ l . The numerical integration in this

program is perfonned by a routine using a qih order Runge-Kuta numerical integration method with

variable step-width.

The initial values of the state variables for the simulation are calculated using the method

presented in section 3.2. Al1 simulations use the mathematical mode1 fkom section 3.1 and the

paramters presented in Appendix D at page 68. Figure 4.1 shows a PMSM at suiadstill having 0.85

PU load torque (rated torque).

Figure 4.1 'ïhe space phasors of the PMSM operating at standstill under load

Page 35: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

Note that the stator voltage and stator cumnt are in phase. This is the result of the absence of re-

actance as the machine is at zero electrical and mechanical angular speed. The angle between the

current and rotor position will be defined for the switched PMSM as the torque angle. This angle

is dictated by the load torque and figure 4.2 shows that increasing the l a d torque to 1.7 p.u the

torque angle changes h m 30 degrees to 60 degrees.

Figure 4.2 The vace phasors of the PMSM opetating at standstill under load

Torque conml can be achieved if the stator cunent is impressed at a known angle with re-

spect to rotor position. The goal is to obtain maximum torque with the least possible cumnt, whic h

comsponds to an angle of 90' electrical. Knowledge of the position is essential for this type of

control and the major role of the position observer is in achieving this goal .

Page 36: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

4.2.1 Principle Definition of the Rotor Flux Observer

Ideal Integrator

The preseat work is ksed on method a) presented in chapter 2. This appmach consists in

obtaining the flux linkage space phasor by integrating the back e.m.f. which i s calculated h m

rneasured terminal voltages and currents. In chapter 2 is shown that al1 the available methods have

limited dynamc response at standstill and low frequency . This is caused by the inhermt property

of the integrator of not being able to operate at zero or very low speed.

The starting point in defuiing the position observer is the stator voltage equation written in

the stator refmnce h m e . Figure 4.3 describes the angles used.

Figure 4.3 The angles used in the definition of the observer

We scait fiom the stator voltage equation written in the arbitrary refennce frame B:

Traasfomllag this equation in the stator refmnce h e S, and taking into account that in this

Page 37: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

The stator flux linkage equation in the stator frame is given by:

Where the equivalent rotor cunent phasor in the stator reference frame is in parenthesis.

If we substitute the flux linkage (4.2.3) in the voltage equation:

and we observe that L,ir = $R the rotor flux, we get:

Integrating the left side of the last equation yields:

Expressing the lest tenn in the parendiesis h m eq (4.2.4) on components (the na1 and imaginary

pan):

Page 38: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

and we split the equation (4.2.6) in real and irnaginary components, solving the equation for

and bRB :

The rotor angle in tems of the observed flux is:

+RP 6, = asin- OR

Simulation and practical experiments were used to aaalyze the behavior of this position ob-

server. This observer is an ideal integrator without any offset compensation scheme. Due to small

DC offsets which invariably exist in any practical Unplementation, an ideal inteptor will always

drift. To conservatively mode1 this effect a DC offset in the integrator input signal of 10% is intro-

duced.

Figure 4.4 shows the behavior of this observer assuMng that the initial position is known

and the ideal integrator initialitcd with the values corresponding to this position. The start-up in

closed-loop under load is achieva the motor accelerates, but the drift occurs relatively fast and by

the point 800 ms the control loop is ineffective and the motor stops. Afier drift the rotor oscillates

without the ability to accelcrate again. Figure 4.5 shows the bdiavior of this observer for a DC off-

set of 1 6%. Note that the drift occun faster within 500 ms afier the start of closed-loop operation.

With this ideai integratot without any DC offset in the input signal the expected elecOical torque

is a constant at 2.5 peu. and the speed is a ramp with constant slope.

Page 39: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

. . . . . . . . . . . . . . . . . . . . . . . . . . . ., . . . . . . . . . . I . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .... * . : . . . .:... * . . , : . . . . . . . : . . . . . . . : ;

' T-:--.-,.-.' .. . . . . . . . . . . . . .

j ., eiectncd torque .... .....**,jl DC ;.

i in the *put signal i " . . . . . . . _ . . . . . ... . . . . . . . - . . . . . . . .

_ . . _ . . . . . . . . . . *.. . . . . . . . . . . .

Figure 4.4 The electrical torque for a 10% DC offset Figure 4.5 The electrical torque for a 1 6% DC offset

Page 40: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

Figure 4.6 The electrical torque using the Ideal Integrator without initialization

Figure 4.6 shows the wavefoms associated with an attempt to start the motor without ini-

tialization of the ideal integrator. The machine does not start and only oscillates demonstrating rhat

the observer is completely useless if the initial conditions are not known. For this type of observer

a good initialization is very important, because any m r in the initial data will be "memorized"

and maintained. Being an ideal integrator this observer has no damping. If the initial error is mal1

enough that start-up is possible, the operation of the motor is degraded because the torque angle is

not o p h l for obtaining maximum torque.

To conclude, this ideal integrator is characterwd by the foliowing properties:

a) no start-up without initial values

b) no damping of the initial position error

C) if staxtcd the drift occurs relatively fast; if drift is present, the observer fails shortîy after start

Because of these characteristics the ideal integrator is usefiil only for a short t h e at stan-

up if the initial position is known. \

Page 41: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

Observer based on an Offset Compensated Integrator

The analysis in Section 4.4.1 highlights the need for offset compensation. This method con-

sists of a closeci compensation loop based on a PI regulator. The functiod block diagram of the

offset compensated integrator is shown in Figure 4.7. The two constants are KI= Kz = 5 and the

closed loop transfer fûnction of this compensated integrator is :

Figure 4.7 The block diagram of the Offset Compensated Integrator

The bode plot of this observer is shown in Figure 4.8. Note that at low frequency this ob-

server khaves like a differentiator. At w = 10 rad/s this observer becomes an integrator and the

phase enor is very close to the ideal integrator -90° phase.

Page 42: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

?

l l l l l I l l 1 l l l l I l I l l I l l I l 1 1 1 I 1 I 1 1 1 1 1 1 I I I 1 1 1 1 1 1 1 1 I 1 1 1 1 1 I I I l 1 1 1 1 1 I 1 I 1 1 1 1 1 1 I I I I l I I I I l I I l I l l 1 8 I I 1 1 1 1 1 1 I I l 1 1 1 1 1 I I I 1 1 1 1 l I I I 1 l I I I I I l I I I I I I I

l I I 1 1 1 1 1 I 1 I I l 1 1 1 I I I I I I I I I 1 I I I I I I

I I I I I l l l t 1 I I I I I I I I I I I I I I I I 1 I 1 1 1 1 1 1 I l I I I l l l t

1 I l 1 1 1 l 1 1 I I I 1 1 1 1 1 1 l l l 1 1 1 1 1 1 I I I 1 l 1 1 1 1 I I I 1 1 1 1 1 1 1 I I 1 1 1 1 1 1 I I I I l I l l ' l I I t I I l I I I I I 1 1 I I 1 1 1 I I I l I I I I I I I l 1 1 1 1 I I I 1 1 1 1 1 1 I I I I l I I I I I I 1 l I l l 1 I I I 1 1 1 1 1 1 I l I I l I I I

Frequency (radisec) - - - - - r - - . . . . . . r - - - - , ~ - . ~ ~ k J ~ * ~ . . ( ~ . J L - r - r * ~ ~ ~ ; ~ ~ r ; - ; - ; ; ; L * - ~ ~ - b - - . - r c - d - * ~ 4 d i

I I I I 1 1 1 l 1 I 1 I 1 1 1 1 1 I I I I I I l t l I I I I 1 1 1 1 1

I I I 1 I I 1 1 1 I I I I I I I

I l I l 1 1 1 1 1 I l I I l I I I I I I I l I I I I I I I l I I I

I l 1 1 I l 1 1 1 I I 1 1 I I I I I I I 1 1 1 1 1 1 I 1 l I I I l I I I l I I I

I I I l 1 1 1 l 1 I l I I I I I I I I l l l l 1 I l I I I I l I l l 1 1 I I l i l I l I I l 1 1 1 1 1 1 I 1 I l 1 1 1 1 1 1 I I I I I l 1 1 1 1 1 I I I 1 1 I I 1 1 I I I 1 1 1 1 1 1

1 O* 1 O' Frequency (radlsec)

Figure 4.8 The Bode plot of the Offset Compensateci Integrator

The simulation, depicted in Figure 4.9, shows that this offset compensated integrator is not

operational at very low speed consequmtly giving erroneous position information. With or without

initial position or load, the machine cannot start from standstill using this observer. In figure 4.9

the machine is starred and accelemted using the ideal integrator without DC offset in the input sig-

nal, only to aaalyze the ôebavior of the offset compensated integrator. In ihis figure the actual in-

temal torque that accelerates the machine is not shown. Rather the intemai torque that would be

produced if the current command were based on the offset compensated integrator is shown.

Page 43: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

Figure 4.9 The electrical torque using the Offset Cornpensateci Integrator

...................................................................................................................

Note in Figure 4.9 that shonly afier the start in approximately 100 ms, when the machine

1 .*m.

accelerates very little, 6% of rated speed, the offset compensated observer yields a valid position

information and the initial mor is quickly damped. A v e q important rernark is that the input signai

to the offset compensated integrator has 1W DC offset.

: 1

tqip '2.477 i ~ ' 1.m b 9.116; t q i p ' 0.888 i ...... .; ...... .:. . . . . S .

..............................

In conclusion, the offset compsated integrator has the following propenies:

a) unable to give mie position infomtion at vexy low speed

b) it yields reliable and continuous position information in spite of considerable DC offset,

after the machine accelerates a little,

C) àamping of emr in the initial position

. . . . . . . . . . . . ... . . . S . . 1: i : impressed statar cu&t i r( . '8.10 i ; , 2 . .

/ :

Page 44: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

4.2.3 Structural Adaptive Observer

The conclusion resulting from the analysis of the two observers in section 4.2.1 and 4.2.2

was that the ideal integretor, when concctly initialid, provides a closedloop start under high load

and during the fint stage of the start-up More significant drift occurs. Tbe offset compensated in-

tegrator does not pmvide closed-loop star<, but has g d closed-loop pedormance at frequencies

larger than 2 Hz, even if a considerable dc offset is present in signal. Over t h e this observer also

damps out any error in the initial position. The logical solution is to use both obsewers. Each will

be used in the regime where its performance is g d . The ideal integrator is used for closed-loop

start under load, and before significant drift occurs the offset compensaad integrator will take over

the closed-lwp control. The damping of the initial position error is very important now, because

when the offset compensated observer takes over the ideal observer already has some dn fi msulting

in position error. Because of this timehpeed dependent adaptation with the two observers each

working at a certain stage, the scheme is named the Structural Adaptive Observer (SAO).

Figure 4.10 shows the contmlled torque suin-up under severe conditions using the SAO.

Figure 4.10 Closecl-loop start-up using the SA0 with a DC o f k t of 10"/o

Page 45: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

- 1

Figure 4.1 1 Closed-loop start-up using the SA0 with a DC offset of 1 O?! and a position mor of 22'

In figure 4.1 1 it is assumed that the initial position was detected with an error of 22 degrees

and the DC offset in the input signal is IO%. Note that the performance of the observer is not sub-

stantially affected.

A good initialization and timely switch over fiom the ideal to the

grator are required for satisfactory operation of the SAO. At the moment

position error is acceptable as it is ultimately damped-out.

offset compensated inte-

switch over occurs some

In conclusion, the SA0 is the type of position obsewer proposai in this thesis. With the

required conditions satisfied (initial position and timely switch over from the ideal to the offset

compensated integrator), it is demmsmttd that this obsmer provides diable position informa-

tion for a controlled toque, closed-loop start-up.

Page 46: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

5 Determining rotor position at standstill in the

cylindrical PMSM

This chapter illustrates the difficulties associated with identiQing the initial position of the

cylindrical PMSM at standstill and presents the method propsed in this thesis to solve this prob-

lem.

5.1 The Difficulty of Position Detection at Standstill

for a Cylindrical PMSM

As discussed in chapter 2, a general method to find the position in the cylindrical PMSM

is not rcported in liteninire. Most of the schemes presmted in the reviewed papers do not address

the initial position detection because suui-up is achieved in open loop without controlled torque.

Those methods are discussed in chapter 2. Two of the schemes [17], [19] clairn initial position

detection. As stated in the introduction, the present work concentrates on an ideal cylindrical

machine in which Xd = Xp. The method proposed in [17] assumes that some saliency is present in

the machine. In [19] the initial position is detected based on saturation effects. Because of the spe-

cial chcteristics of the PMSM the required stator curent to produce saturation is large, there-

fore, the applicability of this methocl is restricted only to small power motors [19]. For medium

and large power rnotors this method is not applicable because the requvad inverter would have to

be oversized for the initial position detection.

The above discussion addresses the dificulty associated with the detecting of the initial

position in a cylindrical PMSM at standstill. Assuming that the ideal cylindncal PMSM is corn-

pletely motionless, there is nothing that can yield information that cm be used to idcntify its posi-

tion. Only by initial incrernental movement caa one obtain information about the initial position.

Page 47: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

5.2 Position Detection Method Based on

Initial Incremental Motion

Approaches to detect the position are generally on sensing the back e.m.f. At low fie-

quency the back e.m.f. is smail and the presence of noise makes its detection difficult. Sophisti-

caied methods based on Kalman filters [17] are used to extmct usehl information from the back

e.m.f. in the presence of noise. The results are limited.

Analysis of the stator voltage, back e.m.f. and stator current indicates that at low fie-

quency the fmt two are very small rnaking it difficult to distinpish hem fiom background noise.

However the current has approxirnately rated amplitude even for this very small voltage. This can

be easily observed fiom the voltage equation:

V, = (R, + X,)I, - E

where the reactance takes on a small value at low frequency . The stator resistance is generally

small.

The following method is based on monitoring the current amplitude and phase instead of

the back e.m.f. amplitude and phase. Small motions which are dificult to detect h m the mea-

sured induced e.m. f. will be detected by indirectly monitoring the stator current magnitude and

angle.

Note that no excessive current is requireci by this proposed method. Assuming that the

load torque is equal with the ratcd torque of the machine, the current necessary for this detection

is less than or equal to the rated curent.

This scheme is implemented by rotating the voltage phasor at a very iow kquency and

observing the magnitude of the rcsulting current phasor, at machine standstill. The machine is

Page 48: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

voltage fed, consequcatly the voltage magnitude and hquency cm be conaolled. The voltage is

such that the stator current is 1 p.u. a h build up governed by the electncal time constant of the

rotor. The voltage is typicaily very small representing only the voltage &op in the rotor resis-

mce. The load torque is 1 p.u. aiid is assurneci to be constant independent of the orientation of the

rotor. The North pole (d axis) of the permanent magna, refemd in the following as "the rotor" is

held by the load torque in an unknown position.

The cunent phasor is slowly rotated resulting in a sinusoida1 electrical torque. When the

electrical torque exceeds the load torque the mtor will move. This occurs when the current phasor

is at an angle of 90 I E elecaical de- relative to the rotor. The angle E depends on rhe load

torque and typically is less than 25 depes. A strategy to minimize this error is discussed later. In

the moment the rotor starts to move and the induced e.m.f will be subsaicted fiom the applied

voltage producing a decrease (notch) in the mapitude of the current phasor.

Looking at the phasor representation in which the current is moving on a circle with

radius equal to the current mapitude, at the mommt that the interna1 torque becomes larger than

the load torque at 90 i E degrees, a small motion identified by a notch will occur. This notch will

be named the "current signature". The rotor position is defineci by ihis current signature. The

phase angle of the stator current is continuously monitored and when a current signature occun

substracting or adding to chis angle 90 degrees gives the rotor angle. The method has proven to be

valid based on simulation and experirnentation. Figure 5.1 shows the current signature obtained

by simulation. Figure 5.2 shows the oscilloscope trace of the stator cumnt in the experimental

setup.

Page 49: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

1; û.ôW tqip 1.186 is 8.'981 i ds-1 0.684 ds-2 7.589 ! *if) . ; . . . . . . . ; . . . . .;. . . . . . . ; . . . . . . . . . . . . ; . . . . . . : . . . . . . .: . . . . . . . . . . . . . . .:. . . . . . . .:. . , . . . .uw. par

Figure 5.1 The current signature obtained by simulation

Figure 5.2 The current signature obtained experimental y

Two symmehical positions of the rotor ( displaced by 1800) will yield the same cment

signature, consequently an e m n of 180 degrees in determining the rotor position is rcalized. Fig-

ure 5.3 and 5.4 show the wo cases in which the cumnt signature is the same.

Page 50: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1: . ~ 0 . m j tcl&.754 . . . i i t a . s i . . . . . . . . . . d&z.'s92 : ds-23.586 i . . . . . . .*le.; .:..disp 8.888 ...! . , . . . . . . . . . . . ; ;. . \ . . . . . . . ' . . . . . . . . : . : . I 1 : . . - .var. par

1 f 0.0Zû t

Figure 5.3 Current Signature for rotor positioned at 1 70'

1 ~ 8 . 8 6 8 ds-1 6.367 ds-2 4.820 *10 - d i s p 0 . 8 8 8 . var. par

- - --

Figure 5.4 Current Signature for rotor positioned at 350'

Page 51: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

The first cumnt signature therefon d y yields the axis of the rotor, but not the orientation

of the rotor field. A "double c m t signature" which is based on two consecutive initial small

motions of the rotor, is used. During the h t current signature the rotor is moved slightly in a

direction which depends on the orientation of the rotor field. This is identified by the second cur-

rent signature and the rotor position is then uniquely defined. In figure 5.1 it can be seen that the

two cumnt siumtures are not symmetrical on the circle.

The following saategy is employed to obtain reliable position information using the dou-

ble current signature. For 16 known positions of the rotor the fmt and the second small move-

ments and correspondhg current notches are observed and recorded. Table 5.1 contains the rotor

position and the angle where the fiat notches occur. Each of the 16 secton having 22' and corre-

sponding to the 16 known positions, can be uniquely determined fiom the two angles at which the

notc hes occur.

Table 2: 1

Mie: Al1 the aumbers in aible rcprcsent angles in electrical degrtes.

The accuracy of rotor position calculated as explained above is 360/16= 22 degrees which

is suficient to start a machine having 1 pu. load torque with 1 p.u. cunent. Figure 5.5 shows the

flow chart used to simulate this position detection method. The inputs of this flow chart are cur-

rent magnitude and phase and the output is the rotor position.

The accuracy of the method can be increased by controlling the amplinide of the initial srnaIl mo-

tion. One idea would be to increment the rotating current phasor in s d l steps on a spiral and the

motion will occur exactly when the cumnt produces an intemal torque larger than the load torque.

This approach is feasible in the implementation of a pmctical drive systern. A suggestion for M e r

Page 52: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

experimental mearch is to define the details that will inmase the accuracy of the pmposed meth-

od.

To summarize, the pmposed method gives diable position information with suficient ac-

curacy for a controlled-torque start-up. This position is detected ftom two consecutive incremental

motions and it will be used to initialize the strucnued adaptive observer that provides a closed-loop

stari-up. The method is applicable for a high load torque using the least possible current, without

requiruig a overrated inverter.

coun tsig>20 countsig=O

Figure 5.5 Flow chart used to detect the position from wo incremental motions

Page 53: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

6 Proposed Drive System for Severe Starting Conditions

This chapter presents the cornpiete dnve system for severe starting conditions based on po-

sition detection using initial incremental motion and the Shuctural Adaptive Observer, and the

verification of the proposed method using simulation and experiments.

6.1 Verification of the Proposed Sensorless Drive System

using Simulation

The control diagram of the proposed sensorless drive system with cylindncal PMSM is pre-

sented in figure 6.1. This is the block diagram of the complete mode1 used for the simulation of the

proposed dnve system. The open-loop used for position detection is above the line repicsenting the

load torque. The closed-loop used for severe starting conditions is below tbis line. The controlled

torque, closed-loop start-up under hi@ l a d torque has three stages:

1. position detection; first initial motion and second initial motion

2. initialization of the uncompeasated observer and closed-loop start

3. switchiag to compensated observer and maintaining the closed-loop using this observer

In stage 1 the position is detected monitoring the stator current magnitude and angle. In this

stage we have a voltage fad machine, the amplitude and frequency of the stator voltage are con-

trolled. The fiequmcy of the applied voltage is 1 Hz and the amplitude is such that the stator cument

is at rated value. The cumnt is left unregulated to allow observation of the current signature of the

initial incrementai motion. During this stage the contact KI is closed and K2 is open.

In stage 2, after the itiaîization of the ideal integrator with the values corresponûing to the

detec teà position, KI is openeâ and K2 is closed. It will stay closed during the remaining operating

th. D u ~ g this stage the machine s m to accelerate in closed-loop with a controlled torquc,

based on the position information given by the ideal integrator.

Page 54: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

Figure 6.1 The Block D i a m of the drive system us4 in simulation

Before a significant drift of the integrator occurs, at an electrical frequency of 2 Hz, the ide-

al integrator is replaced with an offset compensated integrator; stage 3. The compensated integrator

will give position information during nomial operation. The reference fnime used by each control-

ler can also be seen in this figure.

Figure 6.2 shows a closed-loop start-up under high load using this scheme, base on the as-

sumption that the initial position was detected without error. The intemal torque oscillation when

the offset compensated integrator takes over c m be noticed . Figure 6.3 shows the m e start-up

procedure assuming an enor in the detection of the initial position of 22 degrees. The interna1

torque at the beginning is initially somewhat srnaller than in the previous case, but this does not

disnirb the start-up considerably. In figure 6.4 the offset compensatd integrator replaces the ideal

integrator after stan-up when a mlatively large mor built-up because of drift. It is noticed that the

offset compensates integrator will damput this error and the machine is operating with an optimal

torque angle at ratai c m t .

Page 55: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

. . . . . . . . . . . . . . . . . . . . . . " . . . . . . . . . . . . . . . . . . . . . . . . . . . . . , .

. . ~10scd.bop.sr~n~pbasedontbc:iiiitial~ed.. . : . . . .

ideal integraior until the machine3eachcS 6% -8 20 , . , . of the spced . . - . , . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . and on tùe l ofEset compeiuited . . gr 8 megrato~afierrbrt. :

1 The DC offset in t4e ob&ver*s input signal is lû??. t ime = 55.251

Figure 6.2 Closed-loop start-up after position detection using SA0

Figure 6.3 Closed-loop stari-up aAer position detection using SA0 with a delayed switch

t q i p 2.499 i~ 1.886 clri, 8,748: t q i p 8,880 s .. var. par

0.828

Page 56: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

. . . . . . . tim = 53.6064

Figure 6.4 Closed-loop start-up after position detection using SA0 assuming a position error of 22'

To conclude, the present scbeme guarantees a start-up with controlled torque, against high

load torque for the cylinârical PMSM. Errors of less than 30 degrees can be tolerated in the detect-

ed initial position or when the offset compemted integrator is switched in, without significantly

affecthg the performance of the proposed method.

6.2 Experimental Test Facility and Verification

The experimentai &ive system used for the vcrification of the proposed rneW is present-

ad in figure 6.5. In principle this block diagram pcrforms the same fuactions as the one presented

in Figure 6.1.

Page 57: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

' J ~ lis' b dWbk hini t obsew

angle . angle + cynent sig nat initializ

initiai parameters 1

- -

Figure 6.5 The Block Diagram of the experimental drive system

Ttie following hardware unit is used in the experimental test facility:

1.2.5 hp, 8 poles, cylindrical PMSM

2. Switch Mode VSI, V DC link max 300 V, Imax 25 A, 4800 pF DC link Capacitor

3. General Purpose Controller Board (M68332)

4. Isolating voltage seawxs (100V/SV)

5 . Hall curreat sensors (50All OV)

6. Antialiasing Filter

7. Philips digital stotage oscilloscope

The proposcd strategy is irnplemcnted supplying the mechine h m a three phase switch-

mode DC to AC inverter whicb bas as input a DC voltage source, asswned to be constant. This

Page 58: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

type of inverter is refemd as a voltage source inverter (VSI).

The voltage source inverter is based on sinusoidal PWM and the current is controlled by a

PI regulator. This results in the " impressed stator current" which is necessary in PMSM operation

and control. The imprcssed stator cment ailows the cumnt space phasor to be positioned in such

a rnanner as to maintain the torque angle at an optimal value.

The control of this unit is achieved with the General Rirpose Controller Board (GPCB)

which is bas4 on the M68332 microcontroller. The M68332 microcontroller is selected since it is

well suited to real time applications. It has a built-in Time Processing Unit (TPU) which performs

complex timing tasks such as PWM without CPU intervention.

The software used in the control is wnitten in the standard C Ianguage. The source program

has to be assembled, compiled and linked on a Personal Cornputer and the resulting objec t program

must be downloaded to the Controller Board via a serial link. The C program used to control the

drive system is in Appeadix F.

The variable fkquency, three phase sinusoida1 voltage at the output of this inverter is pro-

duced using sinusoidal Pulse Width Modulation. The gating signals for this are generated by the

TPU of the M68332 microcontroller. This TPU can operate independently fiom the CPU and has

1 6 timed pulse channels. The laysuts of the M6833 2 and GPCB are presented in Appendix G.

The cylindrical PMSM is a a 2.5 hp, 8 poles machine with a rated current of approximately

1 O Am, and the rated voltage of 80 V,,. The machine bas been rnodified and the exact nameplate

data was not available. A position sensor was installeci on the shafi. This provides the me rotor

position that can be compared with the position detected using the proposed method.

Before discussing the experimental verification it is important to note that the load torque

is simulated with two pieces of wood, tied together, pressing on the shaft of the machine. It is very

difficult to obtain consistent and repeatable data using this method to load the machine. The pro-

posed sm-up rnethod is based on the assumption that a constant high load torque is present on the

SM independent of direction of rotation. The loedhg obtained with the available method did not

Page 59: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

display this property. It is possible to simulate a high laid by tightening the two pieces of wood,

but the friction on the shaft is not unifonn in both directions of rotation and usually the machine

moves in one direction easier than in the 0 t h direction. Also, because the two pieces of waod are

getting very hot when the shaA starts to mm, the load becomes variable with a very random behav-

ior. Shulating the high load in a more accurate manner is left as an area for future work.

The following operathg conditions were tested and analysad:

a) the behavior of the cylindrical PMSM at standstill under load

b) a method to align the machine at a known position using a certain pattern of applied voltage

C) the possibility of using saturation for detecting the initial position

d) the proposed method of initial position detection based on incremental initial motion

e) the behavior of the ideal htegrator and offset compensated integrator

In a) the rotor position was detennined by shafi sensor. Its output was displayed together

with the stator current phasor on a digital storage oscilloscope using the X-Y display method. The

load torque was approximately 15 Nm. Supplying the machine with a low amplitude voltage of 7

V,, at nearly zero Hz allowed the aligment of the rotor with the current phasor was noticed. The

angle between the stator cumnt and rotor was dependent on the load torque. At no load, the two

displayed phasors were aligaed. As the load torque increased, the angle between the two phason

increased proportionally. During this expriment the cumnt controller in the VSI was off and we

had a voltage fed machine.

Using the position available h m the SM encoder to staxt the machine, the PI curreni.

controller was adjusted and the machine was operaied in closed-loop. The performance of the PI

controller was considered adequate for the purpose of the work if the currmt was maintained con-

stant at 10 Anns independent of load torque. When the load torque was increased the effect was

deceleration of the machine.

An efficient current conaoller is requued for the vector control whicb is based on "impressed"

stator cunent; where the magnitude and phase of current are controlled as desireci.

In the second e x m e n t the rotor was manually brought to an arbitrary position. Four dc

pulses with an amplitude of 15 Vrms wen injected in the stator windings in the following

Page 60: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

sequence : A, B, C, A .

I 1

Figure 6.6 The four DC voltage pulses and the stator current

Afkr injecting the four pulses the rotor was

always pulled to the same position, indepen-

dently of the initial position. This is the

phase A axis physical location. The voltage

pulses and the current are show in Figure

6.6.

This approach is not very practical because a

high current is necessary to align the rotor.

During this expaiment a useful effect was

noticed: an incremental motion of the rotor

resulted in a notch in the current.

The possible saturation effect c), mentioned in [19], was tested observing the current space

phasor which rotates slowly at 1 Hz and searching for an increase of the current in the direction of

the d axis. The saniration should appear on this direction kcause here the flux produced by the

stator current is superimposed with the flux produced oy the permanent mapets. The experimenr

demonstratesi that for the 2.5 hp cylindrical PMSM fiom the lab the method is not practically a p

plicable. The main reason is that the cment required to produce this effect is again too high. For

the tested machine that has a rated current of approximately I O A,, ( exact data not availabie) a

stator current of 45 A,, didn't produce the expected effect. One reason for this is the large air-

gap existing in the PMSM that implies a low magnetizing inductance and a low effect of the equiv-

alent (fictitious) rotor current in produchg this saîuration.

The method proposed in this thesis to detect the initial position was verified and confmed

d). Figure 5.2 shows the current signature obtained fkom the initial incremental movement. During

this test the difficulty to sirnulate a high l a d was noticed.

The ideal integrator was tested e) with and without initial values. When the initial values

are not provided the start-up is impossible. The initiliazation of this observer produced a stan-up

with a short acceleration followd by a loss of synchroaism due to the drift in the ideal integrator.

Once synchronism with the imprcssed cumnt is lost the rotor position only oscillated.

Page 61: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

During the testing of the offset compensated integrator e) the control loop was closed 20

ms afler the current was impressed at a 90 degrees angle with respect to rotor. By this t h e the ma-

chine has alreaày accelerated io a speed w h the compensated integrator gives accurate informa-

tion about the position. A closed-loop start-up was achieved using the shaft encoder for 20 ms at

the beginning and after that switching to the compensated observer. This observer has a good dy-

namic response in the range h m 2 Hz to 50 Hz. The speed was limited at 50 Hz because at this

value the induccd e.m.f. became large and the voltage supplied by the VSI was limited. To develop

torque the supplied stator voltage has to always be larger than the back e.m.f.

The discussed limitations of the experimen'ial test facility were noticed during the experi-

mental testing of the position detection method and of the observers. The test facility was unable

to consistently simulate the severe starting conditions in a reproducible manner.

Assuming that the experimental test facility will be built suc h that the load torque is con-

stant independent of direction of rotation or at least has a known pattern, to achieve the stan-up

under high load torque are proposed the same 3 operation stages presented for the mode1 used in

the simulation. Figure 6.5 illusuates the proposed control scheme.

In stage 1 the position is detected in open-loop by monitoring the current amplitude and

phase. The command values are the voltage magnitude and fkequency. The Frequency of the a p

plied voltage is 1 Hz. The contact Kl is in the upper position, K2 is open and K3 is closed. It can

be noticed that the PI current controller is not active, thus allowing the obsewation of the current

signature. Immeâiately aher the position is detected stage 2 is initiated and the uncompensated ob-

server is initialized. By changing KI to its lower position, closing K? and opening K3 the closed-

loop start-up is established using the position from the uncompensated observer.

The machine accelerates and before excessive drift occurs, at 2 Hz, the ideal offset compensated

integrator replaces the ideal one, stage 3. The machine will continue to operate using position in-

formation h m this compensated observer.

The proposeà schcme provides a controlled torque closed-hop start-up under high load

torque with minimum cumnt possible as well as continuous torque connol h m 2 Hz to rated

speed*

Page 62: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

7 Conclusions

The presented work demonstrates that the measursd temiinal currents and voltages, togeth-

er with the machine parameters, can be used to obtain a controlled start-up of the cylindrical PMSM

under severe conditions .

The initial position is detected by observing the notch in the stator current resulting fiom

an initial incremental motion of the rotor obtained without using excessive current in the machine.

Even if the load torque is equal to the mted torque of the machine, the detection method requires a

minimal current approximmately 20-30% higher than the rated cumnt .

The proposed method uses only the terminal cunent and does not rely upon indirect position infor-

mation which can be found if saliency or saturation exist. Because of this, the method, is applicable

to any type of SM including an ideal cylindrical PMSM.

The controlled-torque closed-loop start-up against load torque is successfûlly achieved

based on a structural adaptive observer with the smallest possible cunent. The position observer is

based on a speedtirne adaptation: at stan it acts as an ideal integrator which is initialized with the

values corresponding to the detected position and shortiy after start but before significant cirifi oc-

curs, an offset compensated integrator replaces the ideal integrator. The ideal integrator Stans to

accelerate the machine with an optimal torque angle and the offset compensated integrator contin-

ues this acceleration at the optimal torque angle. By always maintaining an optimal torque angle,

the proposed scheme provides the rat4 torque of the machine with the minimum cunent possible.

The methoà can be employed in drive systems with cylindrical PMSM, or any type of SM,

that require a controlled torque start-up &der high l a d using the rated current. It thenfore elimi-

nates the problem of designing an overrated inverter to provide high current during start-up.

Page 63: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

This thesis presents the basic method for s t h g cylindrical PMSM under severe condi-

tions. Extensive experimental work, that will enhance the proposed method and will reveal al! the

details required by a fûlly operational drive system, is suggested as M e r area of research. The

expcrience gaincd during the present work shows that a test facility able to simulate the high l a d

torque at start-up with consistent and repeaiable properties needs special attention.

Page 64: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

References

[ 1 ] K. Rajashekara, A Kawamura, K Matsuse, " Sensorless Control of AC Motor Drives", lEEE

Collection, 1 SBN-0,7803- 1 046-2

[2] G. R. Slernon and Rusong Wu, "A Permanent Magnet Motor Drive without a Shaft Sensor",

Conf. Rec. IEEE IAS Am. Mtg. pp. 553-558, 1990

[3] R. Bonert , Course Notes " Control of AC Drive Systems"

[4] R. Bonert, Personal Notes and Communication about PMSM

[5] W. Leonhard "Control of AC Machines with the Help of Microelectronics"

[6] 3. Holtz "State of the Art of Controlled AC Drives without Speed Sensor", IEEE Catalogue No.

95TH8OZ- 1995

[7] M. Naidu, B.K. Bose, "Rotor Position Estimation Scheme of a PMSM for High Performance

Variable Speed Drive", Confmnce Record of IEEE IAS Ann. Mtg. pp. 48-53,1992

[8] R. Krishnan and R. Ghosh "Starting Algorithm and Performance of a PM DC Brushless Motor

Dnve System with no Position Sensor", IEEE-PESC Conf. Records, 1989

[9] R. B. Sepe, J.H. Lang, " Real-Time Observer Based Control of a PMSM Without Mechanical

Sensors", IEEE 1 AS Ann Mtg, pp. 475-48 1, 1 99 1

(1 O] P.vas "Vector Control of AC Machines" Clarendon Press-Oxford, 1990

[l I I P. b u s e " Aaalysis of ElecAc Machineries", IEEE Press

[12] GR. Slemon, A Straughen,"Electric Machines", Addison-Wesley 1980, ISBN 0-20 1-07730-2

[13] K. Ilnika, H. Uzuhashi et al, "Microcornputer Control for Sensorless Brusheless Motor",

IEEE Trans. Indus. Applic. Vol IA-2 1, pp. 595-60 1, May/June 1995

[14] R.C.Beccera, T.M.Jahns, M.Ehsani, "Four Quadrant Sensorless Brushless ECM Dnve", IEEE

Appl. Power. E lecm. Conf. pp. 202-209, 199 1

[15] J. Moreira, "Indirect Sensing for Rotor Flux Position for PM ac Motors Operating in a Wide

Speed Range", Conf. Rec. IEEE IAS AM. Mtg. pp. 40147,1994

[16] S.Ogasawara, H. Akagi, " An Approach to Position Sensorless h i v e for Brusheless DC Mo-

tors", IEEE Tm. Ind. Appl. Vol 27 no 5 pp. 928-933, SeptOct 1991

[17] M. Schroedl, 'Seasorless Control of PMSM, Elecaic Machines and Power Sys, Vol 22, pp.

175- 1 85, Taylor & Francis Inc, Washington DC 1994

Page 65: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

[18] A. KuU<ani, "A Novel Position Seasor Elimination Technique for Interior PMSM, IEEE

Trans. Indus. Appl. Vol 28 no 1 pp. 144-1 50, JanlFeb 1992

[19] E. Cardolleti et al, " Sensorkss Position and Speed Control of a Bmsheless DC Motor From

Start-up to Nominal Speed", EPE Jouraal, Vol 2, No 1 , pp. 25-34

[20] T. Endo, F. Tajrna et al, "Microcornputer Controlied Brusheless Motor Widiout Shah Mount-

ed Position Sensor", Inter. Power. Elec. Conf, Tokyo, pp. 1477- 1486, 1983

Page 66: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

Appendix A

The cxpandcd form of equations (3.1.1 ') and (3.1.2') , with the zero sequence ncglected is:

in which df is the field winding* dk is the d axis duapcr winding and qkl. qk.2 arc the q ais dunper windings.

The rotor variables arc refend to the stator windings using the following relations, in wbich Ns is the equiv-

alent numkr of stator turm and Nj is the equivalent numkr of tums of the respective windimg.

-for cumnts:

-for voltages:

-for inductances:

(A. 10)

Page 67: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

(A. 11)

(A. 12)

(A. 13)

(A. 14)

(A. 15)

(A. 16)

(A. 17)

(A. 18)

In the following the way in which the base values and the per-unit system arc chosen is presented . The base

voltage, base c m n t and base mgular speed are chosen and the other parameters base torque, base power. base

mechanical spced, base flux linkage etc. arc derived using tk chosen parameters. This numerical example is for the

general case, synchronous machine with excitation winding and three damper windings; the data of this machine are

in Appendix D.

Jine - N j2 = ( fine ' B = mted f i ) / (&) = 21229V

41 835 - 10%~ [B = = ,-Ji = 3 . l s o l l y f i = 26221 A

ro ted

To venS, this values:

The other p.u. values arc:

Page 68: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

- PB - 835. 106 T q ~ - cg - 377

The flw linkage in PU is calculated as follows :

Therefore equatious (A.lb(A.6) in which al1 the variables, except time, are wrinen in p.u. become:

(A. 1 ')

(A. 13')

(A. 14')

(A. 15')

Page 69: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

The last six equations can k written as:

(A. 16')

(A. 17')

(A. 18')

(A. 19)

The flux linkages are choscn as state variables, thercfon we need to solve (A. 19) and (A.20) for currents:

Page 70: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

Appendix B The mechanical thne constant in p.u. is cakcdatcd using the toque equation :

where the P.U. time 1s:

and the P.U. mechanical velocity :

h m which the mechanical timc constant is :

The toque cquation in p.u., except the time which is regular tirne, is:

Page 71: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

Appendix C

The following method is vahd fot any steady-state openting point excepr standstill with load toque. We

start h m the steady-statc equations of the machine, which are obtained fiom (A.l') - (A.6') selting the electrical

anguliu velocity of the rotor a, constant and equal wiih the eleeirical angular velocity of the stator voltage W,.

Therefore the eiectrical angular vclocity of the rotor rcfercnce b e becomes the electrical angular velocity of the

synchronously rotating ~tference fiame. In the cquations (A. 1 ') - (AN) the flux linkages are time invariant and the

derivations will be zero:

'ds = rsids + om'qs (c- 1)

'ds = rs iqr - ~ r n ' d s (c.2)

'df = ' i d f (c.3) with the flux linkages:

' d s = xdids + xmdidf (c-4)

k q s = X&qs (C.3

and the stator voltage in rotor fiame:

vds = -vssin6 K.6)

vqs = vs cos8 (C.7)

If we replace (C.4)-(C.7) in (C. 1 ) and (C.2):

-vs sin ô = rsid, - ~ & ~ i ~ ~ K.8)

vscosS = r,i,, + 6)&ids + o,&idf K.9)

Using these tquations, together with the toque equation and the equation giving the relation beween the

l a d angle and the power factor (PF) we have a systan of four quatioas in which the unlnowns are idS. iqs . id/ and 6 .The equation giving the relation between the l a d angle 6 and the power factor COS^ is obtained if we trans-

fom the stator cumnt to the synchronous nfercnce fmev(vv, fiune), h m the rotor reference fiame:

which expmdcd in rcal and imagirwy compomts is:

i, = - ~ s i n 6 + i q s c o s 6

(C. 1 O)

(C. 11)

Page 72: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for
Page 73: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

Substituting(C.2l) in (C.20). with ihe notation tan9 = k :

In the last two equations the unknowm are id, and 8 . To avoid very involved calculations we set rs = O . fact

which docsn't at3ect the fml result b u s e rs in p.u. IS v e y small, the contribution of the rems containhg r,

king negligible. This assumption is valid for operating points wherc O, t 0 . Equations (C.22) and (C.23) kcome:

Equation (C.24) gives:

v , sin 6 id, cos 6 - kids sin ô = + sin5 + kcos S) -

The 0 t h nvo wknowns are:

vs sin 6 + rs ids - iqr -

" 4 7

v, cos 8 - o,&"idS - rsiqs id/ = (C.29)

~ d m d

This gives us a method to calculate the load angle, and using this, the stcady-state stator and field cumnts

for any angular velociîy and l a d except the case in which we accd toque at s<ia&till. in <bis case 0, -) 0 malwig

iqs + in (C.28)Xhc stndy-sutc fhur linkages are easy alculated with (A. 13) - (A. 18) taking in account that the

Page 74: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for
Page 75: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

Appendix D

This appcndix ptcscnts thrce numerical examples. First example a) illusttates the determination of and the

state variables for stcady-smtc operation points, including standstill. in the second example b) are calculatcd the elec-

nical parameters of a cylindncal PMSM usiog the metfrod prcsented in chaptcr 3. Tbe third example c) illustrates the

&termination of the mechanical t h e constant for a SM. - The parameters of this machine are available in [ I l ] .

Rating: 835 MVA

Line to line voltage: 26 k V

Powcr factor: 0.85

Poles: 2

Speed: 3600 - min

6 2 Combincd inenia of generator and turbine: J = 0.0658 x 10 Js

Parameters in ohms:

r, = 0.00243Q

XIs = 0.15384

Al1 the mf~nca and misuaces given in ohms are transformed in P.U.. ushg the method and the bue val-

ues prrscntcd in appmdix A and B.

YB = 21229V

Page 76: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

The mechical t h e constant of the rotor is:

To calculate the P.U. values we use the relation:

for example:

the same procedwe yields:

Page 77: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

The method prescnted in Appcndix C is used to calculate the steady-sute values for a load of 0.85 P.U. at

rated stator voltage. v, = 1 P.U. and ntcd speed o, = I P.U. Tbis spccd corresponds to a frrqueucy of 60 Hz.

The steady-state flux Iinkages are calculated <Püng in account that the cumno in Le damper windùlgs in, iqkl ,

Using the method proposcd in chapter 3 are calcuhted the scate variables at standstill, CO, = os = O, for 0.85

p.u. l a d and rated stator cumnt.

The stator voltage is:

- vs - rs 4, = 0.003 - 1 = 0.003

Page 78: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

To find out the excitation voltage wc can use the field cuncat calculated with tbe prcvious methoà :

v d , = r d , = 0.000929 - 1.539 = 0.00143

'srdf';oad 6 = acos( ) = acas 0.003 - 0.000929 - 0.85 0.003 - 1.6 1 - 0.001 43 = 69.95

vJX,dvdf

AAcr 6 has bem determineci the other variables can be calculated with:

- The following example illustrates how the parameters of the PMSM are calculated using the rnethod presented in

chaptcr 3.

a) Measund values with the machine unloadcd:

R, = 0.3 5 R measured with the Wheatstone bridge

6 = 0' ~oad angle is zero

La a three phase systcm va is lagging v,b with 3 o 0 . ~ t no load the phase shifl mcasured ktween vab and i , is

1 16'. To calculate die phase shift k n m n va and i, :

cp = 116-30 = 86'

The phosors diagram comsponding to the situation when l a d is zero is given in figure D. 1.

Page 79: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

If we load the machine using a DC machine which has a resistive load, we obtain:

i , = 16A

va, = 20v

*d

Ô = 6 x 4 = 24' mechanieal angle measwed with rhe stroboscope times the

number of pole pairs

vab is leading i, with 18', thenfore va is lagging i , wih:

Figure D. 1 The space phasors at no load

O cp = 18-30 = -12

ïhis corresponds to the figure D.2 where the dotted liaes dcpict the new position of the d and q axis.

Figure D.2 The space phasors during load application

Using the rnethod pmented in chapter 3 the following values are obtained:

i,, = i, COS^ = 16 cos 12 = 15.654 active power pmducing component

Page 80: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

The synchronous reacmcc is:

The second equation can be used to check this result. For this we have to operate the PMSM as a generator with open

t e r n i d s and to mainire the induced e.m.f.. The measmd value was cab = 30 Y.

Knowing the frequency at which the machine wes ninaing, the synchronous inductance cas be calculated wih:

The following example shows the calculation of the mechanical t h e constant.

Rated power: ! 1 kVA

Line to line voltage: 110-220 A

Power factor: 0.9

Poles: 6

Spctd: 1200 rot/min

The i n e h is detemmcd using the expression &riveci in cbpter 3:

We nin the machine at synchronous spccd and we measare the voltage and cwrent on the mistive load.

Page 81: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

We cm calculate the load toque :

1

Figure D.3 The DC machine currcnt decay function

We mm off the supply of the synchronous machine

ami we measure:

An = n-O = 1200-0 = 1200

At = 2.4s(measured) from Figure D.3

' load J = - - 2 x An - 1.037kgm2

The calculation of the mechanical time constant of the

rotor is based on the knowledge of the base angulu velocity. base stator curent, base stator voltage, number of pole \

pairs and the inertia of the rotor:

Page 82: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

Appendix E

This Appcndix presents the Pascal program used for simulation on a Personal Computer.

unit usdef; { cylindrical prrism simulation (motor), polar) inteiface uses samtype;

( samtypc &fines only types, those are : dimlr = my[1..20] of double; dim 1 i = anayf 1. .20] of intcger; name = string[30]; dimlst=array[l..30]ofname; }

const orn = 376.9911 1848; pi3 = 1.047 1976; pi = 3.1415927;

var hv,ouv,sta : text; posflg,posflg 1 : boolean; ( '***** Runge Kutta and math. variables +** *+** 1 n,ist,ier,icn,ernam,m 13n2@m4,m5 : integer, x,h,hmax,hmin,tol : double; z,y : dim 1 r, { ++++*+*+** spec. program **+$***+** 1

npp: integer; vb,ib,fb,zb,wb,tqlp,tqip,na,phiniagnet: double; vs,is,eaq,ead,fs,ws,wmjm,tql :double; iqs,iicql ,ikq2,ids,ifdkdfifa,isbemphialfa,phibe~phid,pbiq, phagalf~phimagbeta,pbialfaobs,phibetaobs :double; vqs,vkq 1 ,vkq2,v&,vf&vkbvsalfa,vsbtta :double; xq,xlcq 1 ~q2,xd,xf&xkd :double; xmd,xmq,xls,xkq 1 ~kq2,xlfd,xkd :double; rs,rlrq 1 ,rlcq2,rf&rkd :Quble; phiobs,thc~the~caIc,tbeu~stored : double; c l,c2,c3,c4,c5,c6,c7,c8,c9,bl,b2,b3,b4,b5,b6:double; b7,b8, b9:double; Dq~dtlta,&l~,del~s,epsilon: double; incr,isold: double; phiniagalfaobs,phimagktaobs,surdel~bs,cos&ltarobs:double; phimagalfaobs 1 ,pbagbctaobs! ,sin&ltprobs 1 ,cosdeltarobs 1 :double; ~~~idclmbs,&ltan,bs,pbMnagpag 1 :double; countsig,count 1 ,incrl ,incr2,&has ! ,deltas2 : double; { *+rrr+~rrrptOC&UtCS uscd *+m*e**eee 1 procedurc fm (ninteger; var zprdim 1 t; z:dim 1 t; x:doublc); p r o c h rkm(n:integer, var y:dim lr,var x,h:double;

to1:double;ist:integer; var iecintegcr); proccdurt mipinit; piocedwe calstep (pval:dim l r; pan:& l i; setflg: boolcan;

var yy:dim 1 r, var xx:dou ble); pmcdure smpout; procedure coNv 1 1 ,v f 2,ang:double;var v2 t ,v22:double); procedurr cotn(v 1 1 ,v I2,ang:doublc;var v2 1 ,v22:doublc);

Page 83: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

implementation pmedurr cotr, { x* = x l exp(-j8ang) ) var cn,sn : double; kg in cn:= cos(ang); sn:= sin(ang); v21:= vll*cn + vl2*sn; v22:= -v 1 18sn + vl2*cn;

end; procedure corn; ( x* = x exp(i*ang) ) var cn,sn : double; begin cn:= cos(ang); Sn:= sin(ang); v21:= vlf8cn - ~ 1 2 % ; v22:= v 1 1 *sa + v 128cn;

end; pmedurc fm; hsin

iqs:= z[2]/xq; ids:= (21 1) - phimagnet)/xd; co~r(ids,iqs,(z[4]),isalfa,isbeta); if posflg thcn begul is:= 1 .O; isalfa:= -is*sindeltarobs; ( equivalent to is*cos(z[4]+ 1.57);) isbeta:= is*cosdeltarobs; f equivalent to is*sin(z[4]+ 1 S7); 1 ids:= isdfa8cosdcltarobs+iskta*sindeimbs; iqs:= -isalta*sin&ltarobs+isbeta*cosdeItarobs; end; if (z[33 > 0.05) then posflgl := me ; if posflg 1 then h i n is:= 1.0; &alfa:= -is8sin&ltarobs 1 ; ( equivalent to is8cos(z[4]+ 1.57); } isbeta:= is*cosdeltarobs 1 ; { equivalent to is*sin(t[4]+ 1 57); ) i&:= isalfa*cosdeltambs 1 +isbcta*sin&ltarobs 1; iqs:= -isalfi*sindtltarobs l +isbcta*cosdeltarobs 1 ; end; vqs:= vs*cos(&lta); vds:= -vs8 sin(de1ta); zpr[l]:= (vds - rs8ids + (z[3]*z[Z]))*wb; zpfl2]:= (vqs - rs*iqs - (z[3]*z[l]))*wb; tqip:=(x[l]*iqs - z[2]*ids); if posflg then besin zpfl l]:= 0.0; zpr(2]:= 0.0; t [ l ] : = xdeids + phimagnct; z[Z]:= xqaiqs; tqip:=(z[l Iaiqs - z[2]*i&); tqip:=phimagnct+ iqs*(c~&ltrr)*cosdel~+sin(&I~)* sinâeltnrobs); if posflgl tben tqip:=phimagnct' iqs8(cos(dcltar)*cOSdeItuobs 1 +sin(&ltar)*sindcltarobs 1);

Page 84: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

end; if (abs(tqip) < tqlp) then zpr[3]:= 0.0 clsc zpr(3):= ((z[lI8 iqs - z[2I8ids) - tqlp)/m; zpr(4]:= zf3]*wb; zpr(S]:= ws8wb; &lm:= z[5] - z[4] - 1.57; { angle vs to q-axis ) deltac= z[4]; deltas:= z(S]; ws:= (2.0*pi*fs)/wb; if posflg thcn bel@ vds:= rs8ids - z[3]*z[2]; vqs:= rs8iqs + z[3]*z[l]; co~vds,vqs,(z[4]),vsalfa,vsbeta); zpfl6]:= (vsalfa - rs8isalfa + 0.0005)*wb; zpr(f]:= (vsbeta - disbeta + 0.0005)*wb; phimagalfaobs:= 2161 - xdaisalfa; phimagbetaobs:= z[7] - xd8isbcta; {observer) phimag:[email protected]+phimagbeuobs* phimagbetaobs); sindcltarobs:= (phimagbetaobdphimag); cosdel tarobs: = (phimagalfao Wphimag); zpfl8]:= z[9]; (observer d+i) zp1j9]:= -5.0*~[8] - 5.0*z[9] .t (vsalfa - disalfa + 0.0003)+wb; zpr(lO]:= z(111; zpr[l l]:= -S.O*z[ 101 - 5.08z[11] + (vsbeta - rs*isbeta + O . W U ) * wb; phimagalfaobs 1 : = 1 .O* z p ] - xd* isalfa; phimagbetaobs 1 := 1 .O*z[11] - xd* isbeta; p h a g 1 :=sqrt@himagalfaobs 1 *phimagalfaobs 1 +phimagbeiaobs 1 *phimagbetaobs 1 ); sindeltarobs 1 := (phimagbetaobs l/ptumag 1); cosdeltarobs 1 := (phimagal faobs 1 /phhag 1); end;

end; { ++8** pmedlmS *a**$ 1

($1 rbn.lib ) procedure smpinir; kgin

( 8**r+ read integration routine var. @**++ 1 rcadln(inv, h,hmax,hmin,tol,is t); writeln(ouv); wfiteln(ouv, 'h hmax hmin tol ist'); writcln(ouv, h: 12,' ',hm=: 12,' '&min: 12,' ',tol: 12,ist:J); { ******* =ad input spccial 888+**8++888*88 1 nadin(inv, v&, vqs); rcadin(inv, xq,xdrlsAkq l ,xUcq2,xLkdxlfd); readln(inv, r s ~ ~ r k â , ~ q 1 dq2); readln(inv, wb jmvb,ib,npp); (*** ***+* calculate coeficients for mutine FCN**"****** 1

ün:= (wb+wb*jm)/(l .5*vb*ib%pp8npp); { ****~+*+**** i n i u d diff. equations +*8*888+888+ 1 a:= II; ier= 0; km= 0; h:= hmin; x:= 0.0; sin&ltarobs:=û.O; cosdeltarobs:=O.O;

Page 85: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

(8**.**8*fitkl values for statc vhbles*********** 1 rtodla(inv, z[ 1 ],z[2lVz[3],2[4]~[53*z[6~~z[~); ids4.0; iqs:=û.O; phimagnct:= 2.50; z[l]:= pbagnct ; z[2]:= 0.0; epsilon:= 320.0; z[4]:= (epsiloa8pi)/ 180.0; isold:= 0.0;

end; ( no assignment of variable parameters requircd as the parameters are assigned in the SBR SAM before the first calculation takes place (pafig truc -> sctflg truc) ) { the fvst plot point is set to 0.0 for al1 variables, this is fuccd in SBR SAM and should not be altered to ensure a save start up; if the fmt sep is kept small it does not matter and usually the initial step for the Runge Kutta Routine s m with hmin )

{end initialization) procedure calstep; procedure assignpar, beg in vs:= pval[l 1; fs:= pval[2]; tqlp:= pval[3]; phimagnet:= pval[4]; (phimgnet:= xmd* ifd) hmax:= pval[5];

end; {assigapar) ksin

if setflg thcn assignpar; ( .****** solution mathematical problem, next step ***** 1

rlan(n,~,h,tol,ist,ier); { O*********** e m r h d l h g +8*0*+**804+ i f i e roO thcn ierr=icrrel; i f h < hminthen ierr:= 5; if icrr > 3 then

begin emam := ien; end; if h > hmax then h:= h12; wm:= z[3]; if (abitqip) < tqlp) thcn t[3]:= 0.0 else z[3]:= z[3]; { if (z[3]o0.0) then pdlg:=uue; was replaccd by: 1 is:= sqrt(ids8 ids + iqs'iqs); countsig:= countsig + 1 ; if (countsig > 20 ) thcn begin isold:=is; {detection of movement) countsig:= 0.0; end; qisold > is) then count 1 := 1 .O ; if (count 1 = 1 .O) and (incrl = 0.0) then bcg in &lm 1 := 2151; incrl := 1.0; end; if (count 1 = 1 .O) and (incr 1 = 1 .O) thcn

Page 86: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

dcltas2:= zfS]; if (deltas2 > deltasl+l.57) and (Q.W*isold > is) then begin &lm2:= z[S]; if (dcltasl > 0.0) and (deltas1 < 0.35) and (deltas2 > 2.65) and (deltas2 < 2.8) then &ltar= 1.57; if (deltas1 > 0.0) and (&lus1 < 0.35) and (deltas2 > 2.8) and (deltas2 < 2.95) then & l w = 4.7 1; if (deltas 1 > 0.0) and (&ltasl < 0.35) and (deltas2 > 2.95) and (&ltas2 < 3.1) thcn &ltar.= 1.95; if (deltas1 > 0.0) and (deltas1 < 0.35) and (deltas2 > 4.55) and (deltas2 < 4.75) thcn &lm= 4.31: if (deltas 1 > 0.0) and (&lus 1 < 0.35) and (deltas2 > 4.95) and (deltas2 < 5.15) thcn del-= 1.17; if (deltas1 > 0.35) and (deltas1 < 0.57) and (deltas2 > 3.2) and (deltas2 < 3.4) thcn & l m = 2.36; if (deltas1 > 0.35) and (deltasl < 0.57) and (deltas2 > 4.07) and (deltas2 < 4.27) thcn &lux= 5.5; if (dcltasl > 0.65) and (deltasl < 0.90) and (deltas2 > 3.56) and (ddtas2 < 3.76) then del== 2.74; if (deltas 1 > 0.65) and (deltasl < 0.90) and (deltas2 > 5 . 0 ) and (deltas2 < 5.2) then del== 5.88; if (deltas 1 > 1.1) and (deltas 1 < 1.35) and (deltas2 > 3.85) and (deltas2 < 4.05) then deltar= 3.14; if (deltas 1 > 1.1) and (&las 1 < 1.35) and (deltas2 > 5.37) and (deitas2 < 5.57) then deltar= 0.0; if (deltasl > 1.45) and (deltasl < 1.7) and (deltas2 > 4.26) and (deltas2 < 4.46) then & l m = 3.52; if (deltas1 > 1.45) and (deltasl < 1.7) and (deltas2 > 5.74) and (deltas2 < 5.94) then &lm= 0.39; if (deltas 1 > 1.85) and (deltas 1 < 2.15) and (deltas2 > 4.6 1 ) and (deltas2 < 4.8 1 ) then deltar= 3.93; if (deltasl > 1.85) and (deltasl < 2.15) and (deltas2 > 6.18) and (deltas2 < 6.38) then clcltac= 0.78; posflg := m e ; end; if posflg and (incr2 = 0.0) thcn

besin {z[4]:= (epsilon*pi)/ 180.0;) 2[4]:= âeltar ; co~~~magne~is*xq,(~[41),~[6I,x[7]); incr2:= 1 ; end;

if posflg then begin

&ltas2:= z[5]; z[ 1 3:= xd8ids + phimapet; 2121 := xq8iqs;

end; cotrr(vds,vq~(z[4]),vsalfo,vsbcta); com@hlmagne~O.O,(~[Q]),phima&alfqp&imigbcm); cotMz[ 1 l,z[2 ],(~[43),phirlrai,phibem); { if posflg then begin

Page 87: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

co~ids,iqs,(z[4]),isdfqisbcci); cotn@~gnc~O.o,(z[4]),phima@hphimrgbe~); cocrr(z[ lI,zI21,(2[4l),phiilkphikta); cotrr(v&,vqs,(2[4]),vsllf&~~tKm); phialfaobs:= z[6]; phibctaobs:=r[7]; end; ) { O**** step calculated - mign display variables **+****** ) %x:= x; yy[lj:= isalfa; yy[13]:= isbtta; yy(2]:= phimagalfaobs 1; yy[14]:= phimagbeiaobsl ; yy[3] := phimagaifaobs; yy(1 SI:= phianagbetaobs; yy[4]:= phialfa; yy[ 163:= phibeta; yy[5]:= phimagal fa; yy[17]:= phimagbcta; yy[V:= wm; {wni; {gnmma) yy[8]:= tqip; yy[9]:= is; yy[ IO]:= (deltas l/pi)* 180.00; (dcltarobs; {(&lta+360.O)/(Z0pi); { wm ) yy[ 1 l ]:= (deltasUpi)* l8O.00; (sindeltarobs; {tqip; f

end; (calstep) procedurc smpout; besia writch(0uv); wri teh(ouv); writeln(ouv, '1st panuneter set, and state variables'); wri teln(0uv); writeln(ouv, 'x '); writeh(ouv, x: 1 1 :6); writein(ouv, 'z[i] '); for m2:= 1 to n do writc(ouv, z[m2]: 105); {for m2:= 1 to n do writt(inv, t (mî] : 105); ) writein(0uv); z[n]:= z[n] - 2.0*pi0( int( z[n)/(2.O0pi) )); writtln(ouv, z[n]: 105); writeln(0uv);

end; {smpout) end. (usdtf)

Page 88: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

Appendix F

îhis appendix prescrits the C prognun used for the M68332 plaflorm.

/* sLnSw1 .c */ I* imc.c 141U96 by R.Boaert

changed by C.Anghe1 */

'* Program conml of SM VSI 3phase current conml using pwm control

derivcd iaifl,c and cc3 .c 3 phase symetrical pwm the cumnt controller controls the pw in each switching interval the quadrature command c m n t s isal, isbe are in stator coordinates. Thcy arc provided by the rotor field oriented control the cumnt ngulator has to bc tuned for each application ! keyb controls : f hquency in % of h a x set in program a amplitude in % of amax set in program b flux-und, b20 -> rated c toque-cmd, c47 -> rated M 29- 1 10, ibase 12.5 A v v> 10 sets rcversing toque signal v= iwr, rev.time = xxx*6.6 msec difkrcnt control modcs, selcction by fsel g10 pw control, default g21 m n t control kcybcmd -> is,f of isal and isbe g22 field oriented conmi provides isal,isbe

torquc-and and fluxund h m keyboard c,b R nm switch signal DI0 ch D s stop G 1 1 gating on in PLD ( fiom this follows -> normal start scquence :

go 3 0 0 , R, Y, G11, Y, fl, Y, a10, Y open loop voltage g03000,R,Y,Gll,Y,gZl,Y,fl,Y,alS,Y currcntconuol go 3000, R, Y, Gll , Y, g22, Y, b20, Y, CS, Y vector control )

switch names TPU channcls 10 20 30 -> s l s3 sS -> ch2 ch4 ch6 1121 31 s 4 s 6 s 2 ch3ch5 ch7 ch O switcb pend ch 1 m p l e period ch 2-7 @hg ~iuinnels ch 8-C DI0 out ch D DI0 for VSI shut &wn chE tacho pulscs chF qurdrpture tacho pulse analog outputs for display : ch4,cM -> osc. A,B in x-y mode,

displays stator currcnt vcctor in stator and rotor fiorne ch2 displays speed ch6,ch7 cos and sine of rotor flux angle

*/ #inclu& "mcmap332.h" /* hudwruc rncmory map */ /* - constants, variables */

Page 89: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

#includt "hextabls.h /* table cos,sin,sqrt .... */ /* global variables */

/* variables for data msfer to intempt routines */ unsigned short ka, loopflg; signcd int in0,in 1 ,in2,in3,in4,inJ,in6,in7,

outû,out I,out2,out3,out4,out5,out6,out7,out%,out9; unsigned int ilpcnt,

sw 1 ocnt,sw 1 Icnt,sw2ocnt,sw2lcnf sw30cnt,sw3lcnt; /* variables for tacho to intchE */

static unsigned int rcs-timflg; I* variables for table look up * I

static unsigncd int tabpos; static signcd short tabns;

/* = exteinal fiinctions O/

extern void tqsaO(},tcpla~,tepsa~,tcpla~, ppsc~pO,qsms582OJceyb_ioO;

/* = FUNCTlONS & ïNTERRüFï ROUTINES = */

/* intTPUch 1 */ ?#pnigma intcrrupt() void dio-samp0

{ /* intcrmpt TPU ch 1 for timing of sampling and U 0 through QSPI analog i/0 &ta format: for fkp 1.0 p.u. -> signed short var = *pRXDF >> 3; write fxp to ch *pTM)E = (signcd shon var fkp) > 1;

if program QSMs582 is uscd then : andogin:in7,..6,..5,..4 in0

*pRXDF,..C,..9,..6 *pRXD3 analog out : out7..6..5..4..3..2, out9..8

*pTXDE..D..B..A..8..7 +pTXD5..4 tclegr 16 bit to slave .PT=.. 1

timing : Tsw 3 kHz = 333usec, QSM 250 usec QSPI duration sec init of QSM, check with Tsw and Tsa with QSM timing Tsa = 2*Tw , ilpcnt = 1,2 QSM nin cach Tsw ilpcnt = 1 -> 1st &ta out, data in ilpcnt = O -> last ûata out, data in not used */

/* ------U-UI-.I---C---- */

ilpcnt = ilpcnt + 1 ; switch(i1pcnt) { CriSc 1 : /* tepsaO(); remove aftcr tcsting */ *pSPCR1 = Oit9025; /* start QSM single shot */

bttak; case2:

/* switch dota for next per, cohcrent write */ *pCH2p46 = sw 1 ocnt; *pCH3p4é = sw llcnc *pCH4p46 = sw2ocnt; *pCHSp46 = sw2lcnt; *pCH6p46 = sw3ocnt;

Page 90: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

/* analog out ' 1 *p'IXD7 = out2 >> 1; /* out to ch 2 */ *pTXD8 = out3 >> 1; /* out to ch 3 *l *pTXDA = out4 » 1; I* out to ch 4 */ *pTXDB = out5 » 1; l* out to ch 5 *l 'pTXDD = out6 >> 1; /' out to ch 6 csang */ *pTXDE = out7 >> 1; /* out to ch 7 snang */ *pTXD4 = out% » 1; /* out to ch 8 iptcmd */ *pTXD5 = out9 » 1; /* out to ch 9 ibecmd */

/* analog in */ in0 = *pRXD3 » 3: /* ch0 cmd value */ in4 = OpRXD6 >> 3; /* ch4 tqcmd ext */ in5 = *pRXD9 >> 3; /* ch5 spccd */ in6 = *pRXDC » 3; /* ch6 ka +/ in7 = *pRXDF >> 3; /* ch7 isb */ *pSPCR 1 = 0x9025; /* stan QSM single shot */

/* set start flag algorithm loap */ loopflg = 0x1 I l l ; tcpsa40; /* remove aher testing */

break; } /* end switch ilpcnt */ if (ilpcnt >= 2) { ilpcnt = 0; ) ka = *pCISR; *pCISR = OxFFFD; /* clear int ch 1 */

} /* end dio-samp O/

/* int for tacho IïC CHE *!

{ unsigned short k 1 ; *pHSRRO = OxCOûû; /* CHF DIO, register pin level */ *pCHEpr4 = OxFOûO; /* max cnt high */ rrs-timflg = 1 ; /* restari el & max M c */

k l = *pCISR; *pCISR = CMFFF; /* clmr int chE */ ) /* end intchE */

1 * PROGRAM */

main(void) {

J* variables general infiastnicture */ /* for keybjo */ static unsigned char letter; static uasiped char kbflg = 0x55; static signcd int val,valf;

I* for Loop and QSM sync flag */ static unsigntd int mlo; static unsigncd &on TEflg;

/* variables spec. program +/ i* flrgs for cumnt detcction md to exit the initialization of flux obs81

static unsignai short DETflg,OUTflg;

static unsigneâ int swpcrcnt,swotcnt,fsmaxt pw lcn~pw2cnt,pw3cIl~ phi I ,phiincr,phiO,phi L 20,phi240,phi90,isrng, ml~,cntdio,cntdisp,~iltsrmp~~11drp,~11tsp,~atsps,mt l ,cntZ,cnt3, modc,fsel,focontr,

Page 91: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

static signed int ams,amax,amso, v 1 g,v2g,v3g9v I r,v2r,v3r,valr,vbcr,vav 1 ,vav2,vav3, ialmQibecm~ialcmdg,ikcmdg,ialcmdf,i be~~~ldf,ialcrndo,iûecmdo, l*isa,isb,isal,isbe,+l ksc,awi,

ismag,ismagold; static unsigned short tabmg;

/* variables flux observer +/ static signed int isalo,isko,

phimagammin,phiam, test 1 ,te&,

r 13~32; static signed int awilg,auxlgalpnv,auxigkpnv,

/* variables command unit */ sîatic signed int isdcm~tqaad,tqcmdk,immiin,imnninO,isqcmbksig;

/ variables tacho +/ static unsigned int ~eltirn~tim,teXflg,caIflg,

tlip~t,mtinicnt,tatiinclltncwtdedetimcnt, w;

static unsigncd short dirbit; static signcd int tadir,speed;

1. set up and start infiasmicturc */

Page 92: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

/* set up prt F pin 3-0 for PLD control of gating */ *pPfpar = ûx00F0; lm set pin 3-0 up as pon F */ *pDdrf = OxOûûF; /+ pin 3-0 out */

/* IRQ 7-4 still operative *I /* setup parallel port M68230 on GPC-board */

pp-setupo; /* PA out,PB in,PC out for PLD conml */ /* pmgraming of PLD U14 controls of ch2..D

pin function scrting PF3 chZ..ch7 gating odoff 1 = on

2 ch3,S,6 inv for 4Q-chop 1 = inv 1 ch3,5,7 inv for VSI 1 = inv O mod with ch0 I = no mod

PC7 chD,C gating odoff 1 = on 4 chB,Agatingoa/off 1 =on 3 ch9,8 gating on/off 1 = on 2 ch9,B,C inv for Q c h o p 1 = inv 1 ch9,B,D inv for VSI 1 = inv O modwithch0 1 = no mod

for pwm control of IGBT-VSi using ch2..7 for gating -> no mod, ch3,5,7 inverted, PF3 pulses on/off -> ch8-D no inv, on, no rnod ' 1

*pPortf = 0x03; /* 0x03 off, ûxOB on */ *pPCDR = 0x99;

/* initialize and start QSM int ID $10, iniv $50 -> $140 offset no intcmpts used *! qsms5820; /* Ts = 180 + OxZ* 1.3 = 250 uscc */ /* init output data

rn one cycle to set flag, get 1. &ta */ +pTXDE = O; *pTXDD = O; *pTXDB = 0; *pT?cD8 = O; * p m 7 = O; * p m s = 0; *pTXD4 = O; *pTXM) = O; *pTXDI = O; *pSPCRl = 0x9025; /* start QSM */ TEflg = *pSPSR; /* test end of QSM cycle */ whilc ((TEflg & 0x80) = O ) { TEflg = *pSPSR;)

/* - P U set up ' 1

/* gcneral set up */ *pTMCR = 0 x W 1 ; /* 0.24 uscc; int ID $1, pttsc = 1

-> 16.7772 16 MW4 -> 0.2384185 WC

. J l 6 -> 0.9536743 ustc */ *pTICR = 0x0640; /* int req 6, intv S4x -> S 100 o f k t */

/* CAUTION 332Bug tnp at $108 ! !! */ /* dtSCfipti0n of channe1 functions : ch O SPWM mode 2 links ch 1 SPWM mode O or 1 sync to ch 4 ch 2-7 SPWM m& 1 ch 8..0 DI0 chE tacho, ITC input transition chF tacho, DI0 rcgister qurâram pulse bvcl

timing of tacho in multiples of sample tirne Tsa *I /* values for sctup of timing pattern : PWM & control */

swpcfcnt = 1398; /* 4199 = 1 kHz= fsw 1398=3-466=9kHz 9 kHz very iimittd pw cange ! *I

Page 93: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

amax = OxOEAO; /* 0.94 3 kHz M F 0 9 0.87 max for 9 kHz OxODEB

for 1 kHz OxOFAD */ /* start amplitude 1 % of amax */ x2 = (OxW28F5C2* 1) » 16; ams = (wax * x2) >> 12;

/* 7 uscc switch over time betwtcn switches */ swotcnt = 26;

/* set up initial pulsewidth pw ideal, pwo upper sw, pwl lower sw, p b c s 1,2,3

init average voltage vav 0.2 % p h c 1 at zero crossing *!

vav 1 = 0; vav2 = -am; vav3 = m s ; pw 1 cnt = (swpcrcnt l ( OxOFFF + vav 1 )) >> 1 3;

/* (swpercnt m(l-vavl)/2) >> 12 */ pw2cnt = (swpercnt l ( OxOFFF + vav2)) >> 13; pw3cnt = (swpercnt l ( OxOFFF + vav3)) >> 13; sw 1 ocnt = ((pw lcnt - swotcnt) 16)

+ ((swpercnt-pw lcnt+swotcnt) >> 1); sw llcnt = (@w lcnt + swotcnt) 16)

+ ((swpcrcnt-pw lcnt-swotcnt) >> 1); sw2ocnt = ((pw2cnt - swotcnt) « 16)

+ ((swpcrcnt-pw2cnt+swotcnt) >> 1); sw2lcnt = ((pw2cnt + swotcnt) << 16)

+ ((swpercnt-pw2cnt-swotcnt) >> 1); sw3ocnt = ((pw3cnt - swotcnt) « 16)

+ ((swpercnt-pw3cnt+swotcnt) >> 1); sw3lcnt = ((pw3cnt + swotcnt) << 16)

+ ((swpercnt-pw3cnt-swotcnt) » 1); /* set up T'PU parameter rcgistcrs */ /* ch0 SPWM mode 2 , switch interval timing */ *pCHOprO = 0x0092; /* f low, TCR 1 */ *pCHOp46 = ((swpercnt » 1) << 16) + swpercnt; /* cohennt write, hightime = swpcrcnt/2 */

*pCHûprû = Ox66OE; /* L st L cnt, dutnmy a& *! 'pCHûprA = 0; /* dclay, only on stan */

/* ch1 SPWM mode 1 , QSM algorithm timing */ *pCH 1 prO = 0x0092; /* f low, TCR 1 ' 1 /* Tsw = Tsa */

*pCH 1 p46 = ( 0x00640000 + (swpemt-200)); /* cohcrcnt writc, hightimc 25 usec, del -50 uscc */

*pCH lpr8 = 0x0200; /* a& 1, a& 2 ch 0 */ /* ch2 = switch 10, SPWM mode 1 linked */ *pCMprO = 0x0092; /* f low, TCRl */ *pCH2p46 = sw 1 ocnt; /* cohcnnt write , pw, del */ *pCHZprû = 0x0200; 1' adrl, adr2 ofch0 */

/* ch3 = switch 11, SPWM mode 1 l a d */ *pCH3prû = 0x0092; /* f low, TCR 1 */ 'pCH3p46 = sw 1 l m ; /* coherient -te, pw, &le/ *pCH3pr8 = 0x0200; /* adrl, a&2 of ch O */ /* ch4 = switch 20, SPWM mode 1 linlreâ */ *pCH4prO = 0x0092; /* f low, TCR 1 */

Page 94: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

*pCH4p46 = sw2acot; /* coherent write , pw, del */ *pCH4pr8 = 0x0200; /* a& 1, adr2 of ch O */ I* ch5 = switch 21, SPWM mode 1 ünkcd */ *pCHSprO = 0x0092; /* f low, TCR 1 */ *pCH5p46 = sw2lcnt; /* cohcrcnt write, pw, &le/ *pCHSpr8 = 0x0200; /* a&l, adr2 of ch O */

/* ch6 = switch 30, SPWM modc 1 lhkcd */ *pCH6prO = 0x0092; /* f low, TCR 1 */ *pCH6@6 = sw3ocnt; /* coherent write , pw, del */ *pCH6prû = 0x0200; /* adrl, adr2 of ch O */

/* ch7 = switch 31, SPWM mode 1 linked */ *pCHfprû = 0x0092; /* f low, TCR l * /

*pCH7p46 = sw3lcnt; /* coherent write, pw, del */ 'pCH7pr8 = 0x0200; /* adrl, adr2 of ch O */

l* ch 8.D DIO, no parameter reg. */ /* cbE ITC, tacho */ *pCHEprO = 0x0007; /* TCRl ,ris edge */ *pCHEpr2 = OxOOûE; /* no li, dummy a& +/ *pCHEpr4 = 100; /* max cnt hi@ */

/* chF DIO, register quadrature pulse */ *pCHFprO = 0x0002; P no detcct */ l* channel fiinction registers group ch E.8 */

*pCFSRO = OK8A88; /* ch E.C DIO,ITC,DlO */ *pCFSRl = 0x8888; /* ch B..8 DI0 */ **PRO = OxA555; /* ch F,E me prio, D..8 low pri * i *pHSQRO = Ox9AAA: /* ch F,E, D . 3 upd on HSR */

/* channel fiuiction registers group ch 7..0 */ *pCFSR2 = 0x7777; /* ch 7..4 SPWM *! *pCFSR3 = 0x7777; /* ch 3..0 SPWM */ *pCPRl = OxFFFF; /* ch 7..0 hi prio * l *pHSQRl = 0x5556; /* ch7..1 rn 1,chO m2 */

/* stmt TPU VO and timrng fwctions *! /* Stop chD DI0 low gating musr bc off */

*pHSRRO = 0x080; t* set up int: chE, ch 1 low-high (diesamp) */

ka = *pCISR; *pCISR = ûxBFFD, /* ciear int bit chE.1 */ *pCIER = 0x4002; /* enable chE,I int *! asm(" move.w #S2500,SR "); /* int vec ch1 offset 0x41 4 = 0x104 */

l* intializdstart c b l fiinction reg ch E.8 */ *pHSRRO = OxDFFF; /* init ch E.8 */

/* intialirtlstart chuinel function ng ch 7..0 */ 'pHSRR1 = OxAAAA; P init ch7..0 */

/* = end of set up and of init and start of TPU @/ /* initializations : loop and algorithm variables*/

/* loop flags and counts etc. */ loopflg = 0x8888; catdio = O; cntdisp = 0;cntl = 0; cnt2=û;cnt3=û; modc = 10; /* manual voltage control */ cntsamp = O;

DETflg = 1 ; OuTflg = 1;

/* rrmp limiter, cmd in %, delta 1% */ cmdin = (Ox00001852*2) » 16; /* initial incr */

Page 95: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

cmctout = cmdia; delta = 0x0029; /* 1% */ rampcnt = O; mm = 750; /* 0.5 sec */

/* initirlize incmnents for sine table read out */ fsmax = 100; /* in Hz h a x < fswll5 */ /* using a cos table the space-pbor is set to

start aligned with phase a */ phi1 =O; X I = (Oxûûû41852*2) >> 16; /* initial incr */ phiincr= ((mvpcrcnt*fsaax*x1+2) >> 10); /* Tsa=2*Tsw */

l* fkp 24.8 for becter nsolution incr = WFFF Tsa * fsine *!

phi24û = OXFFFFl3; /* sin (x+phi) pbi = -240 deg -> +120 &g look up */

phi 120 = phi240* 2; /* phi = - 120 deg -> +240 dcg */ phi90 = (k3FFF*3)+2; /* phi = -90 deg -> +270 deg */ tabflg = 0;

l* constants used in algorithms */ r3inv = 0x0000093 D; /* 1 /sqn(3) fxp */ r3 = OxOOûûlBB6; /* sqrt(3) */

r13 = 0x0555; /* 113 */

i* rotor nsistaace aad impedance in p.u.*/ rspu = 0xOA66; /* rspu = 0.65 not in pu ;vb=200*sqrt(2/3)V, ib15.0 A ' 1

lspu = 0x0440; l* lspu = 0.4 ; wb=1256.63 */

l* constants uscd in integrahon * i ci = OxOOC l;/* origrnally OxoOc 1;*/

koc = 0xO800;/*onginally 0x0048;*/ kip = 0x 1333; kii = 0xûûû2;/*orighally 0x0002;*/ LPfl = 0x7000; LNfl = k8FFF;

1' init PI ngulators isa1,isbe */ /* Plng curmt isal */

u0cual= O; wcual= O; eOcual= O; enmal= 0; klcual= 0x1112; /* gain 1, tr0.02,Ts0.67msec*/ k2cual= OxODFD; 1. use pic0 to det const */ M= O; SLUcual = 0x02000; SLLcual = OxFFFFE000; LPcual = amiut; LNcual = -amiut;

/* P h g currr~t isbc */ uûcubc=O;u~~~~bc=O; cOcubc=O; encube =O; klcuk = 0x1 112; k2cuk = OKODFD; /* use pic0 to det const */ kscube= O; SLUcuk = 0x02000; SLLcube = hFFFFE000; LPcuk = imax; LNcubc = -unar; aux = O;

Page 96: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

/* initiakations flux obscrver +/ 1' Ts = 4 msec */ ko 1 = OxûûûûFdF7; /* 16.16, (1 -Ts/2*T)/(l +Td2*T) */ ko2 = ûxOOûûBEA5; /* 16.1 6 Tmtpu*(Ts/2+T)/(l +Ts/Z*T) *!

kcu = Oxûûûûû3E4; /* 16.16 */ ko30 = k02; imrd = O; imrbe = O; h a l o = O; imrbeo = O; ealo = O; ebeo = 0; isdcmd = O; tqcmd = O; tqcmdlr = 0; isqcmd = hOFFFi8; ksig = 0x01 F4; !* lrYm *! humin0 = 0x0100: /* 6% */ immiin = immin0; speed = O; specdf = O; mtsp = O; cntsps = O;

snang = ûxF334; csang = ûxOA3D;/* values of posa1 and posbe for

black sign(rcctang1e) up)*/ i* phimagal = OxOA3DI3;

phiniagbe = W33413; ialcmdf = OxOA3D/2; ibecmdf = OxF33412; phimagam = Oxû4CC; dphialprcv = 0x0; dphibeprev = OxO; phialprev = 0 x 0 ; phibeprev = 0x0; */

aux1 = OxOFFF; /* ko3 original */ ismagold = W û û 1 ; ismag = 1;

/* = program loop = */ mlo = 2; /* LOOP */ wbile (mlo = 2) ( whilc (loopflg = 0x8888) { }

/* test for end of dio-samp int */ loopflg = 0x8888;

/* --------- ----- --.-- */

!* POLLiNG for propcr end of sample cycle if no end found -> crror, use only if timing un&r test TEflg = +pSPSR; test end of QSI cycle if ((TEflg & Or180) = O )

{ lcttcr = 'E'; ) exit to monitor *pSPSR = Ox7F; cycle fmisheâ, clear bit, go on ' 1

/* here follows the aigorithm 9 /* kcyboard activated

shut &wn offpowcr : RS -> DI0 chD this signai sâould be conwctcd to the inverter shut &wn (green light on driver - off)

Page 97: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

G -> C O I I ~ ~ O ~ S githg by PLD U14 gating control is rnhcpcndend fiom RS but S also stops gating for d c t y gating off and S is activatcd on exit with E *1

l8 position measurcment for cornparison and tests */ pos = *pPBDR; pos = @os 8); tabpos = pos; 1' a constant can bc aââcd to

c o m t couphg mgcl encoder */ am( " move.1 ,tabpos,Dû " ); mm( " TBLS.W -sintab.Dû " ): asm( " m0vc.w Dû,tabres" );

posa1 = tabres; l* al axis V asm( " move.1 -tabposJlû " ); am( " TI3LS.W -costab,DO " ); asm( " m0ve.w Dû-tabres" );

posbe = tabres; /* be axis */

/* input variables for rotor flw observer and current feedback *l

isa = in6; isb = in7; vsab = iti4«2; 1' amplification by 4 '/ vsbc = inS«2;

/+ conv is- into a1,be comp */ isal=isa; isbc = ((isa .t isb + isb) l r3inv)>> 12;

/+ conv vs- into al,be comp */ vsal = vsab; vsbe = ((vsab + vsbc + vsbc) ' r3inv)>>12;

/* cuncnt vector placing based on measurrd position */ amsa = 0; /* option to change amplitude */ isong = (in080xFFFF) » 12;

/* angle of cumnt Ieading rotor pos in0 is anaiog control value +- IV *!

tabpos = pos + isang; am( " move.1 ,tabpos,DO " ); a m ( " 'TBLS.W shtab,Dû " ); asm( " m0ve.w M),tabres" );

ialcmdf = ((ams+amsa)*~bm)>> 12; /* al axis */ asm( " movc.1 -mbpos,Dû '* ); am( " TBLS.W -mtab,DO " ); am( " m0vc.w Dû,tabres" );

i h d f = ((ams+amsa)*tab~)» 12; /* bc axis */

p u I I - rotor position observer -- */

/* volage phasor is brought to a per pbasc b i s V-ph =(llsqri(3))*(1/2 -j*sq11(3)/2) * l

vsaltr = ((vsab + vsbc)*r3inv)»l2; vsbctr = ((vsbc vsab)*r13)>> 1 2;

Page 98: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

/* -- initiahtion observer using shaft sensor - */

if (Oüïflg = 1 ) { cntl =cntl + 1; phialprcv = -posai; /* 18Ckîeg leading*! phibeprcv = -posbe; if (cnt 1 = 20) (OUTflg = 0; ) !

) l* end mode 23 */ dphial= posal;/*vsaltr - ((isal+rspu)» 12) ; */ dphibe = posbe;/*vsbea - ((isbc*rspu)» 12) ; */

dphial = dphial - ocmpal; dphibe = dphik - ocmpbe;

!* integrator */ phiai = phialpnv + ((ci (ciphial+ dphialprev))» 12); phibe = phibcprev + ((ci (dphibe + dphibcprev))>> 12); dphialpnv = dphial;

âphibeprcv = dpbibe; /* offset compensation cal. by Pi ng.

PIrcg using scpcratc proponional and inregml part, integral part with extcndet wordlength, no overflow protection for now @/ /* offsct compal *l auxlg = auxlgalprev + ((kii*@hial+phialprev))<<4); phialprcv = phial; auxlgalprev = auxlg; auxlg = auxlg» 16; aux = auxlg; /* 4.12 fxp <- 4.28 fxp */ ofrgo = ((kipopbial)>> 12) + aux; P prop + int */ if (ofkgo > LPfl) { 0-0 = LM; ) if (OMO < LNfl) { ofigo = LNfl; ) ocmpal= *oc o h o ) » 12;

/* end offset ocmpai *l /* offsct compbe */ auxlg = awdgbeprtv + ((kii*(phibe+phibeprcv))«4); phibcpnv = phik; auxlgkprcv = awlg; auxlg = auxlg» 1 6; aux = auxlg; /* 4.12 fxp <- 4.28 fxp O /

ofrgo = ((kipephibe)>> 12) + aux; /+ prop + int */ if (ofrgo > LM) ( ofrgo = LM; ) if (ofigo < LNfl) ( 0-0 = LNfl; ) ocmpbc = @oc o h o ) » 12;

/* end offset ocmpk */ phiaiprrv = phial; phibeprcv = phibc;

snang = phial; 1' cos &lr */ c m g = phibe; /* sin &ir *!

Page 99: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

ialcmdo = csang; ibccmdo = - m g ;

if (mode = 23) {

if(0üïflg =1) /* dwing this timt the (ref h m obs)*4 */

{ cnt3 =cm3 + 1; ialcmdo = csang«4; iôecmâo = -snang«r); if (mt3 = 50) {Oüïflg = O;) ;

if (OUTflg = 1) /* d u h g this time the (nf h m obs)*3 */

cnt2 = cnt2 + 1 ; ialcmdo = csang« 1 ; ibecmdo = -snang« 1 ; if (cnt2 = 6000) {Oüïflg = O; ) 1

if (OUTflg -1) /* time needed for current to built up +/

{ cntl =cm1 + 1; ialcmdo = -posbe; ikcmdo = posal; if (cnt 1 = 20) {OUTflg = 0; ) 1

) I* end mode 23 */ /* the flux calculatcd above is the total flux in the machine

and we need only the rotor flw */ /* phimagal = phial - ((ispu*isal)» 12);

phimagk = phibc - ((lspuoisbe)» 12); */

/* genemting commands for voltage or cwrcnt control open hop ! ! ! v lg,v2g,v3g ialcmdg,ibecmdg */

phi1 = phi 1 + phiincr; /* phi 360 &g. -> FFFF '1 /* accumulation of phiincr at higber molution */ phi0 = @hi 1 » 8);

tabpos = phi@ tabtrig = tabpos; /* sync triggcr */ if ((tabtrig < OxOEûû)&&(tabflg = 0))

{ tabflg = 1; tepla00; ) if ((tabtrig > ûxOFOO)&&(tabflg = 1)) ( tabflg = 0; ) /* table nad out signai 4.12 1 .O p.u. */

as@ " movc.1 ,tabpos,DO " ); 1' cos@) */ asm( " TBLS.W - c o s o b ~ " ); asm( " m0ve.w DO,tabresm );

v 1 g = ((ams+amsa) tabrcs) » 1 2; idcmdg = vlg; iabpos = pbi0 + phi 120; /* cos(x- 120) *I am( " move.1 ,trbpss,Dû " ); mm( " TBLS.W -comb,DO " );

Page 100: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

am( " m0ve.w DO,tabnsw ); v2g = ((ams+amsa) tabrcs) >> 12; tabpos = phi0 .t phi240; /* cos@-240) */

a m ( " movc.1 ,tabpos,Dû " ); asm( " ïBLS.W -costab,Dû " ); asm( " m0ve.w M),tabrts" );

v3g = ((ams+amsa) tabrcs) » 12; tabpos = phi0 + phi90 ; /* COS(X-90) -> ccw rotation of cmd vaiue

phi0 - phi90 -> cw rotation *I a m ( " move.1 ,tabpos,DO " ); am( " ïT3LS.W ,costab,Dû " ); asm( " m0ve.w Dû-tabres" );

ibecmdg = ((ams+amsa) tabm) » 12; /* select keyb or field-oriented current cmd

for currcnt regulator */ switch(modc)

( case 10: ialcrad = ialcmdg; ibecmd = ibecmdg; break; case 2 1 : ialcmd = ialcmdg; ibecmd = ibecmdg; break; case 22: ialcmd = ialcmdf; ibecrnd = ibecmdf; break; casc 23: ialcmd = ialcmdo; ibecmd = ibecmdo; break;

) /* end switch mode */ I* ------- al1 outputs here ----- */

i* display of measured cumnts in a l ,k */ cntdup = cntdisp + 1; switcti(cntdisp) { case 1 : out4 = posal; out5 = posbe; break; case 2: out4 = 0; out5 = 0; break; casc 3: out4 = ialcmd« 1; out5 = ibtcrnd<< 1; break;

/* shifted to sec diffcnncc h m isal,isbe * l case 4: out4 = O; out5 = 0; break; case 7: out4 = vsaltr: out5 = vsbetr; break;

case 8: out4 = 0; out5 = O;br&; case 5: out4 = phial>>2; out5 = phibe>>2; break; casc 6: out4 = 0; oud = O; cntdisp = 0; break;

) /* end switch cntdisp */

out2 = phial; out3 = phibe; out8 = posai; out9 = posbe;

/* out8 = ialcmd; out9 = ibecmd; */ I* ------- ----------.----- */

if(mode > 20) /* thcn do cwrent reg */ f /* m n t rcgulators al, bt

before lcaving current ngulator, set cmds to zero and wpit until is and speed zero or s&ut program ncw V

!* P k g current isa18/ encual= ialcmd - isal; aux = enmal - ((Ucuil*eûcual) » 1 2); aux = ( k l d * a u x ) » 12; ksc=Irscud; whilc (((aux < SLUcual) && (aux > SLLcuû)) && (ksc > 0))

{aux=(aux« 1); ksc=ksc- 1; )

Page 101: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

uncual= uûcual+ aux; if (uncual> LPcual) ( uncual= LPcual; ) if (uncual < LNcual) { uncual= LNcual; )

/* end regulator isal*/ uOcual = uncual; eOcwl= encual;

/*if (isal > ialcmd + Ox0050*ialcmd) {vair = OxOE lO*uncual; )

if ( h l < ialcmd - OxOOSO*iaicmd) (vair = uncul+ 0x01 908uncual ; ) * I vair = uncual;

l* Pimg current isbe */ encubt = ibccmd - isbe; aux = encube - ((Icîcube*eOcube) >> 12); aux = (klcubc*aux) » 12; lrsc = kscube; wfiile (((aux < SLUcuk) Btgt ( a u > SLLcube)) && (ksc > O))

(awr=(aux<< 1); k=k- 1 ; ) uncube = uOcuk + aux; if (uncube > LPcube) { uncube = LPcube; ) if (uncube < LNcube) { uncube = LNcube; )

/* end rtgulator isbe */ u h b e = uncube; &cube = encubc;

/*if (isbe > ibecmd + Ox005O*ibecmd) {vber = OxOE 1 O*uncube; )

if (isbe < ikcmd - OxOOSO*ibecmd) (vber = uncube + OxO 1 90' uncube ; } */ vber = uncube;

) l8 end curnnt reg '1 elsc ( vair 4: vber = 0; ) /* conversion al,be -> v t r,v2r,v3r ' 1

vlr = valq v2r = ((vbePr3inv)>> 1 2); v3r = ((-vber'r3inv)>> 12);

l* select pw-cmd voltage or from curnnt rcgulator */ if (mode = 10)

{ vav 1 -v 1 g; vav2=v2g; vav3=v3g; I* vxg < amax */ } clse

{ vavl=v lr, vav2=v2r, vav3-3r, /+ vxr < arnax */ ) /* update PWM pulscwidlh +/

/+ lirnit of max pw mut cnfotced befotc ! +/ pwlmt = (swpmnt *(ûxOFFF + vavl)) -13;

I* (swpcmt '(1-vavl)/2) » 12 */ pwlcnt = (swpercnt * ( OXOFFF + vav2)) » 13; pw3cnt = (swpcmt ( OXOFFF + vav3)) » 13; swlocnt = ((pwlcnt - swotcnt) « 16)

+ ((swpcrcnt-pw 1 cnt+swotcnt) » 1 ); sw 1 lcnt = ((pw lcnt + swotcnt) << 16)

+ ((swptrcnt-pwlcnt-swotcnt) » 1); sw2ocnt = ((pw3cnt - swotcnt) « 16)

+ ((swpercnt-pw2cat~0tcnt) » 1);

Page 102: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

sw2lcat = ((pw2cnt + swotcat) 16) + ((swpercnt-pw2mt-wotcnt) » 1);

sw3ocnt = ((pw3cnt - swotcnt) « 16) + ((swpetcat-pw3cnt+swotcnt) » 1);

sw3lcnt = ((pw3cnt + swotcnt) << 16) + ((swpercnt-pw3cnt-wotcnt) >> 1 );

l* end PWM control*/

l* revcrsing toque cm& generator, using cntdio, set 1 s t case in DI0 higher than in toque generator */

if ((rcntm > 10) && (mode = 22)) f if(cntdio>(lO*rcnûn))

( tqcmdk = -tqcm& cntdio = O;

1 1

,'+ -* ----------- ------ '1

/* DI0 ch 8 9, slow event timing, not used in this program *! cntdio = cntdio + 1; sw itch(cntdi0)

f case 1 :

*pHSRRO = 0x0001; !* ch 8 hi@ */ break; casez :

*pHSRRO = 0x0004; I* ch 9 high */ break; case 3 :

*pHSRRO = 0x0002; t* ch 8 low */ break; case f 0000 : *pHSRRO = 0x0008; !* ch 9 low */ cntdio = O;

brcak; ) /* end switch cntdio +/

/ keyboard i/0 handling */ /* al1 keyboard U 0 done at end of algonthm, as it is

uncritical in timing, and if once beyond sample rime it is uniikely to cause problcms */

if (kbflg = OxAA) f switch(1etter) ( case ('8') : /* mode sclectim *!

iqvalL- 10) ( m& = 10; ) if(va1- 21) ( modc = 21; ) iqvale 22) ( modc = 22; )

bitak; case ('R') : l* Run chD DI0 hi@ *! *pHSRRO = OnW.

break; crsc(S0: *pHSRRO = OltO800; /* Stop chD DI0 low */ *pPortf = 0x03; /* gating off'ao inv */

bmk;

Page 103: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

case ('G') : *pPonf = 0x03; IW gating 0f'f.m inv 9 if (val = 1 1)

{ *pPottf = &OB; /* gating on */ ) break; case ('f) : /* sine tiequcmcy control */ /* input in xxxx % of fsmax */ if (val > 99) { val = 99; ) if (val < 0) { val = 0; ) x l = ((ûxûû28FSC2* val) + (0x0004 1 8Wvalf)) >> 16; phiincr = ((swpercnPfsnax*xl*2) » 10); /* Tsa=2*Tsw */

!* constant f ip 24.8 for resolution fmax set to 100 Hz at init */

break; case ('a') : /* sine amplinide control *!

/* input in xxxx % of amax */ if (val > 99) { val = 99; ) if (val < 0) ( val = 0; ) x 1 = ((Oxû028F5C2*val) + (OxOOO4 1 8Wvalf)) >> 16; ams=(x l % m a ) > > 12;

break; /+ b,c input commands for field orientation +/ case ('b') : !* id command in p.u. */ /* input in xxx.x % of rnax */ if (val > 25) ( val = 25; ) if (val < 5) ( val = 5; ) isdcmd = ((Ox0028FSC2+val) + (0x0004 1893*valf)) >> 16;

break; ew (Y) : /* toque command in p.u. */ !* input in xxx.x % of rnax */ if (val > 99) ( val = 99; ) if (val < -99) { val = -99; ) isqcmd = ((Ox0028FSC2*val) + (ûxOOO4 1893*valf)) >> 16;

break; case ('va) : /* sctting ramp spccd

cnt = 1 -> 1% incr every Tsa / /* input in xxx cnt, rnax 999 -> 0.66 sec +/ if (val < 2) [ val = 2; ) m m = val;

break; case ('p') : /* manipulation of k03, rotor time constant

uscd to change ko3 in observer */ /* input in XXJCJI % of 1 p.u. */ if (val > 200) ( val = 200; ) if (val < 0) ( val = 0; ) aux 1 = ((OK0028FSC2*val) + (0x0004 1 89Pvalf)) » 16;

bteak; ] /* c d switch letter */

kbflg = 0x55; 1

/* test for new input ' 1 kcybJo(8tlrbflg&le~,&val,&valf); l* keyboud interface, input in succesive loop cycles

ltcyboud input, nq. time < 40 uscc,

Page 104: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

placing at end of bop, means update of variables in ncxt laop; it avoids cumulative extra loop timc for keybjo routine and! update p t o c e h */

if (îettcr = 'E') I* exit to 332Bug */ { mlo = O; letter = M E ; *pHSRRO = 0x0800; /* Stop chD DI0 low */ *pPortf = 0x0 1 ; /* gating off40 inv */ )

l* loop cxecution length indicator */ tepsa40;

) l* end program LOOP mlo = 2 */ ) I* end main */

1. - , -- END MAIN PROGRAM - "

Page 105: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for
Page 106: INFORMATION TO USERS - tspace.library.utoronto.ca · for a Permanent Magnet Synchronous Machine ... (Xd = Xq) is pmposed ... These identification and control schemes work well for

GPC-board Version 3.0 Uofr, Uof KA