DRM021, 3-Phase ACIM Volt per Hertz Using 56F80x Control

DRM021, 3-Phase ACIM Volt per Hertz Using 56F80x Control

Freescale Semiconductor, Inc.

56800

Hybrid Controller

3-Phase ACIM

Volt per Hertz

Control

Using 56F80x

Designer Reference

Manual

DRM021/D

Rev. 0, 03/2003

MOTOROLA.COM/SEMICONDUCTORS

For More Information On This Product,

Go to: www.freescale.com

Freescale Semiconductor, Inc.

For More Information On This Product,

Go to: www.freescale.com

Freescale Semiconductor, Inc.

3-Phase ACIM V/Hz Control

Using 56F80x

Designer Reference Manual — Rev 0

by: Jaroslav Musil

Motorola Czech Systems Laboratories

Roznov pod Radhostem, Czech Republic

Original code by Petr Uhlir.

DRM021 — Rev 0

MOTOROLA

For More Information On This Product,

Go to: www.freescale.com

Designer Reference Manual

3

Freescale Semiconductor, Inc.

Revision history

Date

January

2003

To provide the most up-to-date information, the revision of our documents on the World Wide Web will be the most current. Your printed copy may be an earlier revision. To verify you have the latest information available, refer to: http://www.motorola.com/semiconductors

Revision

Level

The following revision history table summarizes changes contained in this document. For your convenience, the page number designators have been linked to the appropriate location.

Revision history

Description

Page

Number(s)

1 Initial release N/A

Designer Reference Manual

4

For More Information On This Product,

Go to: www.freescale.com

DRM021 — Rev 0

MOTOROLA

Freescale Semiconductor, Inc.

Designer Reference Manual — 3-Phase ACIM V/Hz Control

List of Sections

Section 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

Section 2. Control Theory . . . . . . . . . . . . . . . . . . . . . . . . 17

Section 3. System Concept . . . . . . . . . . . . . . . . . . . . . . . 23

Section 4. Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

Section 5. Software Design . . . . . . . . . . . . . . . . . . . . . . . 41

Section 6. Application Setup . . . . . . . . . . . . . . . . . . . . . . 57

Appendix A. References . . . . . . . . . . . . . . . . . . . . . . . . . . 71

Appendix B. Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73

DRM021 — Rev 0

MOTOROLA

For More Information On This Product,

Go to: www.freescale.com

Designer Reference Manual

5

List of Sections

Freescale Semiconductor, Inc.

Designer Reference Manual

6

For More Information On This Product,

Go to: www.freescale.com

DRM021 — Rev 0

MOTOROLA

Freescale Semiconductor, Inc.

Designer Reference Manual — 3-Phase ACIM V/Hz Control

Table of Contents

Section 1. Introduction

1.1

Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

1.2

Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

1.3

Motorola DSP Advantages and Features . . . . . . . . . . . . . . . . . 13

Section 2. Control Theory

2.1

Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

2.2

Target Motor Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

2.3

Volt per Hertz Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

2.4

Speed Close Loop System . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

Section 3. System Concept

3.1

System Design Concept . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

Section 4. Hardware

4.1

Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

4.2

Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

4.3

The High Voltage Hardware Set . . . . . . . . . . . . . . . . . . . . . . . . 27

4.4

DSP56F805EVM Control Board . . . . . . . . . . . . . . . . . . . . . . . . 29

4.5

3-Phase AC BLDC High Voltage Power Stage. . . . . . . . . . . . . 34

4.6

Optoisolation Board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

4.7

Motor-Brake Specifications. . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

DRM021 — Rev 0

MOTOROLA

For More Information On This Product,

Go to: www.freescale.com

Designer Reference Manual

7

Table of Contents

Freescale Semiconductor, Inc.

Section 5. Software Design

5.1

Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

5.2

Data Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

5.3

State Diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

Section 6. Application Setup

6.1

Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

6.2

Application Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

6.3

Application Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63

6.4

Project Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

6.5

Application Build & Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

Appendix A. References

Appendix B. Glossary

Designer Reference Manual

8

For More Information On This Product,

Go to: www.freescale.com

DRM021 — Rev 0

MOTOROLA

Freescale Semiconductor, Inc.

Designer Reference Manual — 3-Phase ACIM V/Hz Control

List of Figures

Figure Title Page

2-1 Torque-Speed Characteristic at Const. Voltage & Frequency . 18

2-2 3- Phase Inverter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

2-3 Pulse Width Modulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

2-4 Volts per Hertz Control Method . . . . . . . . . . . . . . . . . . . . . . . . 21

2-5 Closed Loop Control System . . . . . . . . . . . . . . . . . . . . . . . . . . 22

3-1 System Concept . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

4-1 High Voltage HW System Configuration. . . . . . . . . . . . . . . . . . 28

4-2 Block Diagram of the DSP56F805EVM . . . . . . . . . . . . . . . . . . 30

4-3 DSP56F805EVM Jumper Reference . . . . . . . . . . . . . . . . . . . . 31

4-4 Connecting the DSP56F805EVM Cables . . . . . . . . . . . . . . . . . 32

4-5 3-Phase AC High Voltage Power Stage . . . . . . . . . . . . . . . . . . 35

5-1 Data Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

5-2 Volt per Hertz Ramp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

5-3 3-ph Waveforms with DC-Bus Voltage Ripple Elimination . . . . 46

5-4 Sinewave generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

5-5 3-ph Sine Waves with 3rd Harm. Injection, Amp. = 100% . . . . 48

5-6 3-ph Sine Waves with 3rd Harm. Injection, Amp. = 50% . . . . . 49

5-7 State Diagram - General Overview. . . . . . . . . . . . . . . . . . . . . . 52

5-8 State - Application State Machine. . . . . . . . . . . . . . . . . . . . . . . 53

6-1 RUN/STOP Switch and UP/DOWN Buttons . . . . . . . . . . . . . . . 59

6-2 USER and PWM LEDs at DSP56F805EVM. . . . . . . . . . . . . . . 60

6-3 PC Master Software Control Window . . . . . . . . . . . . . . . . . . . . 62

6-4 Set-up of the 3-Phase ACIM V/Hz Control Application. . . . . . . 64

6-5 DSP56F805EVM Jumper Reference . . . . . . . . . . . . . . . . . . . . 65

6-6 Target Build Selection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

6-7 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

DRM021 — Rev 0

MOTOROLA

For More Information On This Product,

Go to: www.freescale.com

Designer Reference Manual

9

List of Figures

Freescale Semiconductor, Inc.

Designer Reference Manual

10

For More Information On This Product,

Go to: www.freescale.com

DRM021 — Rev 0

MOTOROLA

Freescale Semiconductor, Inc.

Designer Reference Manual — 3-Phase ACIM V/Hz Control

List of Tables

Table Title Page

3-1 Motor / Drive Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

4-1 DSP56F805EVM Default Jumper Options . . . . . . . . . . . . . . . . 31

4-2 Electrical Characteristics of Power Stage. . . . . . . . . . . . . . . . . 36

4-3 Electrical Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

4-4 Motor - Brake Specifications. . . . . . . . . . . . . . . . . . . . . . . . . . . 39

6-1 Motor--Brake Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

6-2 Motor Application States. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

6-3 DSP56F805EVM Jumper Settings . . . . . . . . . . . . . . . . . . . . . . 65

DRM021 — Rev 0

MOTOROLA

For More Information On This Product,

Go to: www.freescale.com

Designer Reference Manual

11

List of Tables

Freescale Semiconductor, Inc.

Designer Reference Manual

12

For More Information On This Product,

Go to: www.freescale.com

DRM021 — Rev 0

MOTOROLA

Freescale Semiconductor, Inc.

Designer Reference Manual — 3-Phase ACIM V/Hz Control

Section 1. Introduction

1.1 Contents

1.2

Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

1.3

Motorola DSP Advantages and Features . . . . . . . . . . . . . . . . . 13

1.2 Introduction

This section describes the design of a 3-phase AC induction motor drive with volt per hertz control in closed loop (hereinafter called V/Hz OL). It is based on Motorola’s 56F80x digital signal processor (DSP), which is dedicated for motor control applications. The system is designed as a motor control system for driving medium power, 3-phase AC induction motors. The part is targeted toward applications in both industrial and home appliance industries, such as washing machines, compressors, air conditioning units, pumps, or simple industrial drives. The software design takes advantage of Quick_Start developed by Motorola.

The drive introduced here is intended as an example of a 3-phase AC induction motor drive. The drive serves as an example of AC V/Hz motor control system design using Motorola DSP.

This document includes the basic motor theory, system design concept, hardware implementation, and software design, including the PC Master visualization tool inclusion.

1.3 Motorola DSP Advantages and Features

The Motorola DSP56F805 is well suited for digital motor control, combining the DSP’s calculation capability with MCUs controller features on a single chip. This DSP offers a rich dedicated peripherals

DRM021 — Rev 0

MOTOROLA Introduction

For More Information On This Product,

Go to: www.freescale.com

Designer Reference Manual

13

Freescale Semiconductor, Inc.

Introduction

set, such as pulse width modulation (PWM) modules, analog-to-digital converter (ADC), timers, communication peripherals (SCI, SPI, CAN), on-board flash and RAM.

The DSP56F805, provides the following peripheral blocks:

• Two pulse width modulator modules (PWMA & PWMB), each with six PWM outputs, three current status inputs, and four fault inputs, fault tolerant design with deadtime insertion, supports both center- and edge- aligned modes

• Two 12-bit, analog-to-digital convertors (ADCs), supporting two simultaneous conversions with dual 4-pin multiplexed inputs, ADC and can be synchronized by PWM modules synchronized

• Two quadrature decoders (Quad Dec0 & Quad Dec1), each with four inputs, or two additional quad timers A & B

• Two dedicated general purpose quad timers totalling 6 pins: Timer

C with 2 pins and Timer D with 4 pins

• CAN 2.0 A/B module with 2-pin ports used to transmit and receive

• Two serial communication interfaces (SCI0 & SCI1), each with two pins, or four additional MPIO lines

• Serial peripheral interface (SPI), with configurable 4-pin port, or four additional MPIO lines

• Computer operating properly (COP) timer

• Two dedicated external interrupt pins

• Fourteen dedicated multiple purpose I/O (MPIO) pins and 18 multiplexed MPIO pins

• External reset pin for hardware reset

• JTAG/on-chip emulation (OnCE™)

• Software-programmable, phase lock loop-based frequency synthesizer for the DSP core clock

• Memory configuration

– 32252

× 16-bit words of program flash

– 512

× 16-bit words of program RAM

Designer Reference Manual

14 Introduction

For More Information On This Product,

Go to: www.freescale.com

DRM021 — Rev 0

MOTOROLA

Freescale Semiconductor, Inc.

Introduction

Motorola DSP Advantages and Features

– 2K

× 16-bit words of data RAM

– 4K

× 16-bit words of data flash

– 2K

× 16-bit words of boot flash

The pulse-width-modulation (PWM) block offers high freedom in its configuration enabling to control the AC induction motor in efficient way.

The PWM block has the following features:

• Three complementary PWM signal pairs, or six independent PWM signals

• Features of complementary channel operation

• Deadtime insertion

• Separate top and bottom pulse width correction via current status inputs or software

• Separate top and bottom polarity control

• Edge-aligned or center-aligned PWM reference signals

• 15-bits of resolution

• Half-cycle reload capability

• Integral reload rates from one to 16

• Individual software-controlled PWM output

• Programmable fault protection

• Polarity control

• 20-mA current sink capability on PWM pins

• Write-protectable registers

The PWM outputs are configured in the complementary mode in this application.

DRM021 — Rev 0

MOTOROLA Introduction

For More Information On This Product,

Go to: www.freescale.com

Designer Reference Manual

15

Introduction

Freescale Semiconductor, Inc.

Designer Reference Manual

16 Introduction

For More Information On This Product,

Go to: www.freescale.com

DRM021 — Rev 0

MOTOROLA

Freescale Semiconductor, Inc.

Designer Reference Manual — 3-Phase ACIM V/Hz Control

Section 2. Control Theory

2.1 Contents

2.2

Target Motor Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

2.3

Volt per Hertz Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

2.4

Speed Close Loop System . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

2.2 Target Motor Theory

The AC induction motor is a workhorse of an adjustable speed drive systems. The most popular type is the 3-phase, squirrel-cage AC induction motor. It is maintenance-free, lower noise and efficient motor.

The stator is supplied by a balanced 3-phase AC power source.

The synchronous speed n s

of the motor is given by

n s

=

120 f

s p

]

(2-1)

where f s

is the synchronous stator frequency in Hz, and p is the number of stator poles. The load torque is produced by slip frequency. The motor speed is characterized by a slip s r

:

s r

=

(

n s n s n r

)

=

------ -

s

(2-2)

where n r

is the rotor mechanical speed and n sl

is the slip speed, both in rpm.

Figure 2-1

illustrates the torque characteristics and corresponding slip. As it can be seen from Equation 2-1 and

Equation 2-2

the motor speed is controlled by variation of a stator frequency with influence of the load torque.

DRM021 — Rev 0

MOTOROLA Control Theory

For More Information On This Product,

Go to: www.freescale.com

Designer Reference Manual

17

Control Theory

Freescale Semiconductor, Inc.

Motor Torque

0

1

0

Load Torque

0.5

Working

Point s r n r

0 n s

Slip

Speed

Motor Generator

Figure 2-1. Torque-Speed Characteristic at Const. Voltage &

Frequency

In adjustable speed applications the AC motors are powered by inverters. The inverter converts DC power to AC power at required frequency and amplitude. The typical 3-phase inverter is illustrated in

Figure 2-2

.

Designer Reference Manual

18 Control Theory

For More Information On This Product,

Go to: www.freescale.com

DRM021 — Rev 0

MOTOROLA

Freescale Semiconductor, Inc.

Control Theory

Target Motor Theory

+ DC-Bus

C

+

T

1

T

2

- DC-Bus

T

3

T

4

T

5

T

6

Ph. A

Ph. B

Ph. C

3-Phase

AC Motor

Figure 2-2. 3- Phase Inverter

The inverter consists of three half-bridge units where the upper and lower switch is controlled complementarily - meaning when the upper one is turned-on, the lower one must be turned-off and vice versa. As the power device’s turn-off time is longer than its turn-on time, some dead-time must be inserted between the turn-off of one transistor of the half-bridge and turn-on of it's complementary device. The output voltage is mostly created by a pulse width modulation (PWM) technique where an isosceles triangle carrier wave is compared with a fundamental-frequency sine modulating wave, and the natural points of intersection determine the switching points of the power devices of a half bridge inverter. This technique is shown in

Figure 2-3

. The 3-phase

voltage waves are shifted 120 o

to each other and thus a 3-phase motor can be supplied.

DRM021 — Rev 0

MOTOROLA Control Theory

For More Information On This Product,

Go to: www.freescale.com

Designer Reference Manual

19

Control Theory

Freescale Semiconductor, Inc.

Generated

Sine Wave

PWM Carrier

Wave

1

0

ωt

-1

1

PWM Output T

(Upper Switch)

1

0

1

PWM Output T

(Lower Switch)

2

0

ωt

ωt

Figure 2-3. Pulse Width Modulation

The most popular power devices for motor control applications are

Power MOSFETs and IGBTs.

A Power MOSFET is a voltage controlled transistor. It is designed for high frequency operation and it has a low voltage drop, thus it has low power losses. However, the saturation temperature sensitivity limits the

MOSFET application in high power applications.

An insulated gate bipolar transistor (IGBT) is a bipolar transistor controlled by a MOSFET on its base. The IGBT requires low drive current, has fast switching time, and is suitable for high switching frequencies. The disadvantage is its higher voltage drop of the bipolar transistor, causing higher conduction losses.

2.3 Volt per Hertz Control

Volt per Hertz control methods is the most popular method of Scalar

Control, controls the magnitude of the variable like frequency, voltage or

Designer Reference Manual

20 Control Theory

For More Information On This Product,

Go to: www.freescale.com

DRM021 — Rev 0

MOTOROLA

Freescale Semiconductor, Inc.

Control Theory

Speed Close Loop System current. The command and feedback signals are DC quantities, and are proportional to the respective variables.

The purpose of the volt per hertz control scheme is to maintain the air-gap flux of AC Induction motor in constant in order to achieve higher run-time efficiency. In steady state operation the machine air-gap flux is approximately related to the ratio V s

/f s

, where V s

is the amplitude of motor phase voltage and f s

is the synchronous electrical frequency applied to the motor. The control system is illustrated in

Figure 2-4

. The characteristic is defined by the base point of the motor. Below the base point the motor operates at optimum excitation because of the constant

V s

/f s

ratio. Above this point the motor operates under-excited because of the DC-Bus voltage limit.

A simple close-loop volts/hertz speed control for an induction motor is the control technique targeted for low performance drives. This basic scheme is unsatisfactory for more demanding applications where speed precision is required.

Volt per Hertz Characteristic

100%

Motor Base

Point

Amplitude

Base

Frequency

Frequency

Frequency

Figure 2-4. Volts per Hertz Control Method

Frequency

2.4 Speed Close Loop System

To improve the system performance, a closed-loop volts per hertz control was introduced. In this method a speed sensor measures the actual motor speed and the system takes this input into consideration. A

DRM021 — Rev 0

MOTOROLA Control Theory

For More Information On This Product,

Go to: www.freescale.com

Designer Reference Manual

21

Control Theory

Freescale Semiconductor, Inc.

number of applications use the closed-loop volts per hertz method because of its simple and relatively good speed accuracy, but it is not suitable for systems requiring servo performance or excellent response to highly dynamic torque/speed variations.

Figure 2-5

illustrates the general principle of the speed PI control loop.

Reference

Speed

(Omega_required)

-

Speed

Error

PI

Controller

Corrected

Speed

(Omega_command)

Controlled

System

Figure 2-5. Closed Loop Control System

Actual Motor

Speed

(Omega_actual)

The speed closed loop control is characterized by the measurement of the actual motor speed. This information is compared with the reference speed while the error signal is generated. The magnitude and polarity of the error signal correspond to the difference between the actual and required speed. Based on the speed error the PI controller generates the corrected motor stator frequency in order to compensate for the error.

In a case of AC V/Hz closed loop application, the feedback speed signal is derived from incremental encoder using the quadrature decoder. The speed controller constants have been tuned experimentally according to the actual load.

Designer Reference Manual

22 Control Theory

For More Information On This Product,

Go to: www.freescale.com

DRM021 — Rev 0

MOTOROLA

Freescale Semiconductor, Inc.

Designer Reference Manual — 3-Phase ACIM V/Hz Control

Section 3. System Concept

3.1 System Design Concept

The system is designed to drive a 3-phase AC induction motor. The application meets the following performance specifications:

• Targeted for DSP56F80XEVM platforms

• Running on 3-phase ACIM motor control development platform at variable line voltage 115 - 230V AC

• Control technique incorporates

– motoring and generating mode

– bi-directional rotation

– V/Hz speed close loop

• Manual Interface (Start/Stop switch, Up/Down push button speed control, LED indication)

• PC Master Interface (motor start/stop, speed set-up)

• Power stage identification

• Overvoltage, undervoltage, overcurrent, and overheating fault protection

Motor Characteristics:

The introduced AC drive is designed as a DSP system that meets the following general performance requirements:

Table 3-1. Motor / Drive Specifications

Motor Type

Speed Range:

Base Electrical Frequency:

Max. Electrical Power:

Delta Voltage (rms):

4 poles, three phase, star connected, squirrel cage AC motor (standard industrial motor)

< 5000 rpm

50 Hz

180 W

200V (Star)

DRM021 — Rev 0

MOTOROLA System Concept

For More Information On This Product,

Go to: www.freescale.com

Designer Reference Manual

23

Freescale Semiconductor, Inc.

System Concept

Drive Characteristics:

Load Characteristic:

Transducers:

Speed Range

Line Input:

Max. DC Bus Voltage

Control Algorithm

Optoisolation

Type

IRC -1024 pulses per rev.

<2250 rpm @ 230 V

<1200 rpm @ 115 V

230V / 50Hz AC

115V / 60Hz AC

400 V

Close Loop Control

Required

Varying

The DSP runs the main control algorithm. According to the user interface input and feedback signals, it generates 3-phase PWM output signals for the motor inverter.

A standard system concept is chosen for the drive, and illustrated in

Figure 3-1

. The system incorporates the following hardware boards:

• Power supply rectifier

• 3-phase inverter

• Feedback sensors: speed, DC-bus voltage, DC-bus current, temperature

• Optoisolation

• Evaluation board DSP56F805

Designer Reference Manual

24 System Concept

For More Information On This Product,

Go to: www.freescale.com

DRM021 — Rev 0

MOTOROLA

Freescale Semiconductor, Inc.

System Concept

System Design Concept

Line

Voltage

230V/50Hz

Three-Phase Inverter Rectifier

~

=

DC-Bus

Isolation Barrier

Temperature

&

DC-Bus Voltage

Temperature,

Current &

Voltage Sensing

Optoisolation

Optoisolation

Over Current

&

Over Voltage

PWM

3-ph

AC M

IRC

Temperature

& Voltage

Processing

ADC

Faults

Processing

PI

DC Bus Voltage

Regulator

V/Hz

V1

DC-Bus

V2

Ripple

Cancel.

PWM

Generator with

Dead Time

F

Speed

Set-up

Speed

Command

Processing

DSP56F80x

+

E

-

Actual Speed Speed Processing

(Incremental Decoder)

Figure 3-1. System Concept

The Control Process:

When the start command is accepted, using the Start/Stop switch, the state of the inputs is periodically scanned. According to the state of the

DRM021 — Rev 0

MOTOROLA System Concept

For More Information On This Product,

Go to: www.freescale.com

Designer Reference Manual

25

System Concept

Freescale Semiconductor, Inc.

control signals (Start/Stop switch, speed up/down buttons or PC Master set speed) the speed command is calculated using an acceleration/deceleration ramp.

The comparison between the actual speed command and the measured speed generates a speed error E. The speed error is brought to the speed PI controller that generates a new corrected motor stator frequency. With the use of the V/Hz ramp the corresponding voltage is calculated and then DC-bus ripple cancellation function eliminates the influence of the DC-bus voltage ripples to the generated phase voltage amplitude. The PWM generation process calculates a 3-phase voltage system at the required amplitude and frequency, includes dead time.

Finally the 3-phase PWM motor control signals are generated.

The DC-bus voltage and power stage temperature are measured during the control process. They are overvoltage, undervoltage, and overheating protection of the drive. Both undervoltage protection and overheating are performed by ADC and software while the DC-bus overcurrent and overvoltage fault signals are connected to PWM fault inputs.

If any of the above mentioned faults occurs, the motor control PWM outputs are disabled in order to protect the drive and the fault state of the system is displayed in PC Master control page.

Designer Reference Manual

26 System Concept

For More Information On This Product,

Go to: www.freescale.com

DRM021 — Rev 0

MOTOROLA

Freescale Semiconductor, Inc.

Designer Reference Manual — 3-Phase ACIM V/Hz Control

Section 4. Hardware

4.1 Contents

4.2

Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

4.3

The High Voltage Hardware Set . . . . . . . . . . . . . . . . . . . . . . . . 27

4.4

DSP56F805EVM Control Board . . . . . . . . . . . . . . . . . . . . . . . . 29

4.6

Optoisolation Board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

4.7

Motor-Brake Specifications. . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

4.2 Introduction

The motor control system is designed to drive the 3-phase AC motor in a speed close loop.

The designed software is capable to run only on high voltage HW set described below.

Other power module boardswill be denied due to board identification build in SW. This feature protects misuse of the HW module.

4.3 The High Voltage Hardware Set

The system configuration is shown in

Figure 4-1.

DRM021 — Rev 0

MOTOROLA Hardware

For More Information On This Product,

Go to: www.freescale.com

Designer Reference Manual

27

Freescale Semiconductor, Inc.

Hardware

L

N

PE

Black

Light Blue

Green-Yellow

U3

J11.1

J11.2

3ph AC/BLDC

High Voltage

Power Stage

J14

40w flat ribbon cable, gray

+12VDC

GND

U2

J1

JP1.1 JP1.2

Optoisolation

Board

ECOPT

J13.1 J13.2 J13.3

MB1

AM40V

Motor-Brake

SG40N

ECOPTHIVACBLDC

J5

Incremental Encoder

Baumer Electric

BHK16.05A

1024-I2-5

ECMTRHIVAC

Hall Sensor

Encoder

00126A

Not used in application

J2

40w flat ribbon cable, gray

U1

J1

Controller Board

Encoder Conn. Table

Controler Conn.

DSP56F803

DSP56F805

DSP56F807

J2

J23

J4

6 pin conn.

AMP A2510

Incremental Encoder Cable -> Connector Table

Cable Wire Color Desc.

Brown

White, Shielding

Green

Yellow

Pink

Unused

+5VDC

Ground and Shielding

Phase A

Phase B

Index

Unused

Figure 4-1. High Voltage HW System Configuration

All the system parts are supplied and documented according to the following references:

• U1 - Controller board for DSP56F805:

– supplied as: DSP56805EVM

– described in: DSP56F805EVMUM/D DSP Evaluation Module

Hardware User’s Manual

• U2 - 3-ph AC/BLDC high voltage power stage

– supplied in kit with optoisolation board as:

ECOPTHIVACBLDC

– described in: MEMC3BLDCPSUM/D - 3 Phase Brushless DC

High Voltage Power Stage

• U3 - Optoisolation board

– supplied with 3-ph AC/BLDC high voltage power stage as:

ECOPTHIVACBLDC

Designer Reference Manual

28 Hardware

For More Information On This Product,

Go to: www.freescale.com

DRM021 — Rev 0

MOTOROLA

Freescale Semiconductor, Inc.

Hardware

DSP56F805EVM Control Board

– or supplied alone as: ECOPT - optoisolation board

– described in: MEMCOBUM/D Optoisolation board User’s

Manual

• MB1 motor-brake AM40V + SG40N

– supplied as: ECMTRHIVAC

WARNING:

It is strongly recommended to use an opto-isolation (optocouplers and optoisolation amplifiers) during the development time to avoid any damage to the development equipment.

NOTE:

The detailed description of individual boards can be found in comprehensive users’ manuals belonging to each board. The user manual incorporates the schematic of the board, description of individual function blocks and bill of materials. Individual boards can be ordered from Motorola as a standard product from http://mot-sps.com/motor/devtools/index.html.

This section describes the design of the software blocks of the drive. The software will be described in terms of data flow and state diagrams.

4.4 DSP56F805EVM Control Board

The DSP56F805EVM facilitates the evaluation of various features present in the DSP56F805 part. The DSP56F805EVM can be used to develop real-time software and hardware products based on the

DSP56F805. The DSP56F805EVM provides the features necessary for a user to write and debug software, demonstrate the functionality of that software and interface with the customer's application-specific device(s).

The DSP56F805EVM is flexible enough to allow a user to fully exploit the

DSP56F805's features to optimize the performance of their product, as shown in

Figure 4-2

.

DRM021 — Rev 0

MOTOROLA Hardware

For More Information On This Product,

Go to: www.freescale.com

Designer Reference Manual

29

Freescale Semiconductor, Inc.

Hardware

RESET

LOGIC

MODE/IRQ

LOGIC

DSub

25-Pin

Program Memory

64Kx16-bit

Data Memory

64Kx16-bit

Memory

Expansion

Connector(s)

JTAG

Connector

Parallel

JTAG

Interface

Low Freq

Crystal

DSP56F805

RESET SPI

MODE/IRQ

Address,

Data &

Control

SCI #0

SCI #1

CAN

TIMER

GPIO

JTAG/OnCE

PWM #1

A/D

PWM #2

XTAL/EXTAL 3.3 V & GND

4-Channel

10-bit D/A

RS-232

Interface

Peripheral

Expansion

Connector(s)

DSub

9-Pin

CAN Interface

Debug LEDs

PWM LEDs

Over V Sense

Over I Sense

Zero Crossing

Detect

Primary

UNI-3

Secondary

UNI-3

Power Supply

3.3V, 5.0V & 3.3VA

Figure 4-2. Block Diagram of the DSP56F805EVM

4.4.1 DSP56F805EVM Configuration Jumpers

Eighteen jumper groups, (JG1-JG18), shown in

Figure 4-3

, are used to

configure various features on the DSP56F805EVM board.

Table 4-1

describes the default jumper group settings.

Designer Reference Manual

30 Hardware

For More Information On This Product,

Go to: www.freescale.com

DRM021 — Rev 0

MOTOROLA

Freescale Semiconductor, Inc.

Hardware

DSP56F805EVM Control Board

JG6

3

1

JG15

JG1

JG2

1

3

1

3

1

3

9

6

3

JG10

7

4

1

JG14

3

2

1

JG12

3

2

1

JG13

8 7

USER

9

6

3

JG10

PWM

J2

1

7

4

J23

1

JG14

JG17

JG6

1

Y1

2

3

1

JG12

JG15

1

JG1 JG2

JG18

J24

3

2

1

JG13

DSP56F805EVM JTAG

1

JG16

J29

JG4

1

U1

JG9

1

JG3

LED3

S4

GP1

S1

P3

IRQA

S/N

S5

GP2

S2

S6

JG7

RUN/STOP

S3

1

JG11

P1

U9

IRQB RESET

U15

JG5

U10

JG8

P1

J31

2

1

JG4

3 1

JG16

JG8

JG5

JG9

1

JG3

2

JG18

JG17

7

8

3

1

JG11

JG7

Figure 4-3. DSP56F805EVM Jumper Reference

JG4

JG5

JG6

JG7

JG8

JG9

JG10

JG11

Jumper

Group

JG1

JG2

JG3

Table 4-1. DSP56F805EVM Default Jumper Options

Comment

PD0 input selected as a high

PD1 input selected as a high

Primary UNI-3 serial selected

Secondary UNI-3 serial selected

Enable on-board Parallel JTAG Host Target Interface

Use on-board crystal for DSP oscillator input

Selects DSP’s Mode 0 operation upon exit from reset

Enable on-board SRAM

Enable RS-232 output

Secondary UNI-3 Analog Temperature Input unused

Use Host power for Host Target Interface

Jumpers

Connections

1–2

1–2

1–2, 3–4, 5–6 &

7–8

1–2, 3–4, 5–6 &

7–8

NC

2–3

1-2

1–2

1–2

1–2

1–2

DRM021 — Rev 0

MOTOROLA Hardware

For More Information On This Product,

Go to: www.freescale.com

Designer Reference Manual

31

Freescale Semiconductor, Inc.

Hardware

Jumper

Group

JG12

JG13

JG14

JG15

JG16

JG17

JG18

Table 4-1. DSP56F805EVM Default Jumper Options (Continued)

Comment

Primary Encoder Input Selected

Secondary Encoder Input Selected

Primary UNI-3 3-Phase Current Sense Selected as Analog Inputs

Primary UNI-3 Phase A Over-Current Selected for FAULTA1

Secondary UNI-3 Phase B Over-Current Selected for FAULTB1

CAN termination unselected

Use on-board crystal for DSP oscillator input

Jumpers

Connections

2–3, 5–6 & 8–9

2–3, 5–6 & 8–9

2–3, 5–6 & 8–9

1–2

1–2

NC

1–2

An interconnection diagram is shown in

Figure 4-4

for connecting the

PC and the external 12V DC power supply to the DSP56F805EVM board.

Parallel Extension

Cable

DSP56F805EVM

PC-compatible

Computer

Connect cable to Parallel/Printer port

P1

P2

External

12V

Power with 2.1mm, receptacle connector

Figure 4-4. Connecting the DSP56F805EVM Cables

Perform the following steps to connect the DSP56F805EVM cables:

1. Connect the parallel extension cable to the Parallel port of the host computer.

2. Connect the other end of the parallel extension cable to P1, shown in

Figure 4-4

, on the DSP56F805EVM board. This provides the connection which allows the host computer to control the board.

Designer Reference Manual

32 Hardware

For More Information On This Product,

Go to: www.freescale.com

DRM021 — Rev 0

MOTOROLA

Freescale Semiconductor, Inc.

Hardware

DSP56F805EVM Control Board

3. Make sure that the external 12V DC, 4.0A power supply is not plugged into a 120V AC power source.

4. Connect the 2.1mm output power plug from the external power supply into P2, shown in

Figure 4-4

, on the DSP56F805EVM board.

Apply power to the external power supply. The green Power-On LED,

LED10, will illuminate when power is correctly applied.

DRM021 — Rev 0

MOTOROLA Hardware

For More Information On This Product,

Go to: www.freescale.com

Designer Reference Manual

33

Freescale Semiconductor, Inc.

Hardware

4.5 3-Phase AC BLDC High Voltage Power Stage

Motorola’s embedded motion control series high-voltage (HV) ac power stage is a 180-watt (one-fourth horsepower), 3-phase power stage that will operate off of dc input voltages from 140 to 230 volts and ac line voltages from 100 to 240 volts. In combination with one of the embedded motion control series control boards and an optoisolation board, it provides a software development platform that allows algorithms to be written and tested without the need to design and build a power stage. It supports a wide variety of algorithms for both ac induction and brushless dc (BLDC) motors.

Input connections are made via 40-pin ribbon cable connector J14.

Power connections to the motor are made on output connector J13.

Phase A, phase B, and phase C are labeled PH_A, Ph_B, and Ph_C on the board. Power requirements are met with a single external 140- to

230-volt dc power supply or an ac line voltage. Either input is supplied through connector J11. Current measuring circuitry is set up for 2.93 amps full scale. Both bus and phase leg currents are measured. A cycle-by-cycle over-current trip point is set at 2.69 amps.

The high-voltage ac power stage has both a printed circuit board and a power substrate. The printed circuit board contains IGBT gate drive circuits, analog signal conditioning, low-voltage power supplies, power factor control circuitry, and some of the large, passive, power components. All of the power electronics which need to dissipate heat are mounted on the power substrate. This substrate includes the power

IGBTs, brake resistors, current sensing resistors, a power factor correction MOSFET, and temperature sensing diodes.

Figure 4-5

shows a block diagram.

Designer Reference Manual

34 Hardware

For More Information On This Product,

Go to: www.freescale.com

DRM021 — Rev 0

MOTOROLA

Freescale Semiconductor, Inc.

Hardware

3-Phase AC BLDC High Voltage Power Stage

HV POWER

INPUT

SWITCH MODE

POWER SUPPLY

PFC CONTROL dc BUS BRAKE

3-PHASE IGBT

POWER MODULE

SIGNALS

TO/FROM

CONTROL

BOARD

GATE

DRIVERS

3-PHASE AC

TO

MOTOR

PHASE CURRENT

PHASE VOLTAGE

BUS CURRENT

BUS VOLTAGE

MONITOR

BOARD

ID BLOCK

ZERO CROSS

BACK-EMF SENSE

Figure 4-5. 3-Phase AC High Voltage Power Stage

The electrical characteristics in

Table 4-2

apply to operation at 25

°C with a 160-Vdc power supply voltage.

DRM021 — Rev 0

MOTOROLA Hardware

For More Information On This Product,

Go to: www.freescale.com

Designer Reference Manual

35

Freescale Semiconductor, Inc.

Hardware

Table 4-2. Electrical Characteristics of Power Stage

Characteristic

dc input voltage ac input voltage

Quiescent current

Min logic 1 input voltage

Max logic 0 input voltage

Input resistance

Analog output range

Bus current sense voltage

Bus voltage sense voltage

Peak output current

Brake resistor dissipation

(continuous)

Brake resistor dissipation

(15 sec pk)

Total power dissipation

Symbol

Vdc

Vac

I

CC

V

IH

V

IL

R

In

V

Out

I

Sense

V

Bus

I

PK

P

BK

P

BK(Pk)

P diss

Min

140

100

2.0

0

10 k

563

Typ

160

208

70

8.09

Max

230

240

0.8

3.3

2.8

50

100

85

V mV/A mV/V

A

W

W

W

Units

V

V mA

V

V

4.6 Optoisolation Board

Motorola’s embedded motion control series optoisolation board links signals from a controller to a high-voltage power stage. The board isolates the controller, and peripherals that may be attached to the controller, from dangerous voltages that are present on the power stage.

The optoisolation board’s galvanic isolation barrier also isolates control signals from high noise in the power stage and provides a noise-robust systems architecture.

Signal translation is virtually one-for-one. Gate drive signals are passed from the controller to the power stage via high-speed, high dv/dt, digital optocouplers. Analog feedback signals are passed back through

HCNR201 high-linearity analog optocouplers. Delay times are typically

Designer Reference Manual

36 Hardware

For More Information On This Product,

Go to: www.freescale.com

DRM021 — Rev 0

MOTOROLA

Freescale Semiconductor, Inc.

Hardware

Motor-Brake Specifications

250 ns for digital signals, and 2

µs for analog signals. Grounds are separated by the optocouplers’ galvanic isolation barrier.

Both input and output connections are made via 40-pin ribbon cable connectors. The pin assignments for both connectors are the same. For example, signal PWM_AT appears on pin 1 of the input connector and also on pin 1 of the output connector. In addition to the usual motor control signals, an MC68HC705JJ7CDW serves as a serial link, which allows controller software to identify the power board.

Power requirements for the controller side circuitry are met with a single external 12-Vdc power supply. Power for power stage side circuitry is supplied from the power stage through the 40-pin output connector.

The electrical characteristics in

Figure 4-3

apply to operation at 25

°C, and a 12-Vdc power supply voltage.

Table 4-3. Electrical Characteristics

Characteristic

Power Supply Voltage

Symbol

Vdc

Min

10

70

(1)

Typ

12

200

(2)

Max

30

500

(3)

Units

V

Quiescent Current

Min Logic 1 Input Voltage

I

CC

V

IH

2.0

— — mA

V

Max Logic 0 Input Voltage

Analog Input Range

Input Resistance

Analog Output Range

Digital Delay Time

Analog Delay Time t t

V

IL

V

R

In

V

In

Out

DDLY

ADLY

0

0

10

0.25

2

0.8

3.3

3.3

— k

V

V

V

µs

µs

1. Power supply powers optoisolation board only.

2. Current consumption of optoisolation board plus DSP EMV board (powered from this power supply)

3. Maximum current handled by dc/dc converters

Notes

dc/dc converter

HCT logic

HCT logic

4.7 Motor-Brake Specifications

The AC induction motor-brake set incorporates a 3-phase AC induction motor and attached BLDC motor brake. The AC induction motor has four

DRM021 — Rev 0

MOTOROLA Hardware

For More Information On This Product,

Go to: www.freescale.com

Designer Reference Manual

37

Hardware

Freescale Semiconductor, Inc.

poles. The incremental position encoder is coupled to the motor shaft, and position Hall sensors are mounted between motor and brake. They allow sensing of the position if required by the control algorithm. Detailed motor-brake specifications are listed in

Table 4-4

.

Designer Reference Manual

38 Hardware

For More Information On This Product,

Go to: www.freescale.com

DRM021 — Rev 0

MOTOROLA

Freescale Semiconductor, Inc.

Hardware

Motor-Brake Specifications

.

Table 4-4. Motor - Brake Specifications

Set Manufactured

Motor Specification:

Brake Specification:

Position Encoder e

EM Brno, Czech Republic

Motor Type:

AM40V

3-Phase AC Induction Motor

Pole-Number:

Nominal Speed:

Nominal Voltage:

Nominal Current:

Brake Type:

4

1300 rpm

3 x 200 V

0.88 A

SG40N

3-Phase BLDC Motor

Nominal Voltage:

Nominal Current:

Pole-Number:

Nominal Speed:

Type:

Pulses per Revolution:

3 x 27 V

2.6 A

6

1500 rpm

Baumer Electric

BHK 16.05A 1024-12-5

1024

DRM021 — Rev 0

MOTOROLA Hardware

For More Information On This Product,

Go to: www.freescale.com

Designer Reference Manual

39

Hardware

Freescale Semiconductor, Inc.

Designer Reference Manual

40 Hardware

For More Information On This Product,

Go to: www.freescale.com

DRM021 — Rev 0

MOTOROLA

Freescale Semiconductor, Inc.

Designer Reference Manual — 3-Phase ACIM V/Hz Control

Section 5. Software Design

5.1 Contents

5.2

Data Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

5.2.1

Acceleration/Deceleration Ramp . . . . . . . . . . . . . . . . . . . . . 42

5.2.2

5.2.3

Speed Measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

PI Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

5.2.4

5.2.5

5.2.6

V/Hz Ramp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

PWM Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

Fault Control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

5.3

State Diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

5.3.1

Initialization. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

5.3.2

5.3.3

Application State Machine . . . . . . . . . . . . . . . . . . . . . . . . . . 52

Check Run/Stop Switch . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

5.3.4

5.3.5

5.3.6

5.3.7

5.3.8

5.3.9

PWM A Reload ISR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

PWM A Fault ISR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

ADC End Of Scan ISR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

ADC High And Low Limit ISR’s . . . . . . . . . . . . . . . . . . . . . . 54

Quad Timer D1 Compare ISR . . . . . . . . . . . . . . . . . . . . . . . 55

Quad Timer D2 ISR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

5.2 Data Flow

DRM021 — Rev 0

MOTOROLA

The requirements of the drive dictates the software gather some values from the user interface and sensors, process them and generate

3-phase PWM signals for the inverter.

The control algorithm of a closed loop AC drive is described in

Figure 5-1

. The control algorithm contains the processes described in

the following subsections. The detailed description is given to the subroutines 3-phase PWM calculation and the volt per hertz control algorithm.

Software Design

For More Information On This Product,

Go to: www.freescale.com

Designer Reference Manual

41

Software Design

Freescale Semiconductor, Inc.

Temperature

(A/D)

DC-Bus Voltage

(A/D)

PC

MASTER

u_dc_bus

SPEED

SETTING

Omega_desired

Temperature

Acceleration/Deceleration Ramp

Omega_required

PI Controller

INCREMENTAL

ENCODER

Speed Measurement

Omega_actual

Fault Control

Drive Fault Status

PWM Faults

(OverVoltage/OverCurrent)

Omega_command

V/Hz Ramp

AmplitudeVoltScale

DC-Bus Voltage Ripple Elimination

Amplitude

PWM Generation

PVAL0

PVAL2 PVAL4

Figure 5-1. Data Flow

5.2.1 Acceleration/Deceleration Ramp

The process calculates the new actual speed command based on the required speed according to the acceleration/deceleration ramp. The desired speed is determined either by push buttons or by the PC Master.

During deceleration the motor can work as a generator. In the generator state the DC-bus capacitor is charged and its voltage can easily exceed its maximal voltage. Therefore, the voltage level in the DC-bus link is controlled by a resistive brake, operating in the case of overvoltage.

Designer Reference Manual

42 Software Design

For More Information On This Product,

Go to: www.freescale.com

DRM021 — Rev 0

MOTOROLA

Freescale Semiconductor, Inc.

Software Design

Data Flow

The process input parameter is Omega_desired, the desired speed.

The process output parameter is Omega_required, used as an input parameter of the PWM generation process.

5.2.2 Speed Measurement

The speed measurement process uses the on-chip quadrature decoder.

The process output is MeasuredSpeed, and is only used as an information value in PC Master.

5.2.3 PI Controller

The PI controller process takes the input parameters, actual speed command Omega_required, and actual motor speed, measured by an incremental encoder Omega_actual. The PI controller calculates a speed error and performs the speed PI control algorithm. The output of the PI controller is a frequency of the first harmonic sine wave to be generated by the inverter: Omega_command.

5.2.4 V/Hz Ramp

The drive is designed as a volt per hertz drive. It means, the control algorithm keeps the constant motor’s magnetizing current (flux) by varying the stator voltage with frequency. The commonly used volt per hertz ramp of a 3-phase AC induction motor is illustrated in

Figure 5-2.

DRM021 — Rev 0

MOTOROLA Software Design

For More Information On This Product,

Go to: www.freescale.com

Designer Reference Manual

43

Software Design

Freescale Semiconductor, Inc.

V (%)

V base

Base

Point

V boost

V start

Start

Point

Boost

Point f boost f base f (Hz)

Figure 5-2. Volt per Hertz Ramp

The volt per hertz ramp is defined by the following parameters:

• Base point - defined by f base

(usually 50Hz or 60Hz)

• Boost point- defined by V boost

and f boost

• Start point - defined by V start

at the zero frequency

The ramp profile fits to the specific motor and can be easily changed to accommodate different ones.

Process Description

The voltage ripple elimination process eliminates the influence of the

DC-bus voltage ripples to the generated phase voltage sine waves. In fact, it lowers the 50 or 60Hz acoustic noise of the motor. Another positive aspect due to this function is that the generated phase voltage. is independent of the level of DC-bus voltage. So, the application is well adaptable in worldwide power supply system.

The process is performed by the ElimDCVoltRipple function, converting the phase voltage amplitude (AmplitudeVoltScale) to the sine wave amplitude (Amplitude) based on the actual value of the DC-bus voltage

Designer Reference Manual

44 Software Design

For More Information On This Product,

Go to: www.freescale.com

DRM021 — Rev 0

MOTOROLA

Freescale Semiconductor, Inc.

Software Design

Data Flow

(u_dc_bus) and inverse value of the modulation index

(ModulationIndexInverse).

The modulation index is the ratio between the maximum amplitude of the first harmonic of the phase voltage (in voltage scale) and half of DC bus voltage (in voltage scale) which is defined by the following formula:

m i

=

( )

------------------------

=

2

DCBus

3

(5-1)

The modulation index is specific to a given 3-phase generation algorithm and in the case of the application, it is 1.27.

NOTE:

The result of the modulation index is based on the third harmonic injection PWM technique.

The first chart in

Figure 5-3

demonstrates how the Amplitude (in scale of generated sine wave amplitude) is counter-modulated in order to eliminate the DC-bus ripples. The second chart delineates the duty cycles generated by one of the 3-phase wave generation functions. The third chart contains symetrical sine-waves of the phase-to-phase voltages actually applied to the 3-phase motor.

DRM021 — Rev 0

MOTOROLA Software Design

For More Information On This Product,

Go to: www.freescale.com

Designer Reference Manual

45

Software Design

Freescale Semiconductor, Inc.

0.90

0.80

0.70

0.60

0.50

0.40

0.30

0.20

0.10

0.00

u_dc_bus [%U max]

AmplitudeVolt Scale [%U max]

Amplitude [%Ampl max]

150

100

50

-100

-150

-50

0

0.40

0.30

0.20

0.10

0.00

0.90

0.80

0.70

0.60

0.50

PhA-PhB [V] PhB-PhC [V]

DutyCycle.PhaseA

DutyCycle.PhaseB

DutyCycle.PhaseC

PhC-PhA [V]

Figure 5-3. 3-ph Waveforms with DC-Bus Voltage Ripple Elimination

5.2.5 PWM Generation

Process Description

This process generates a system of 3-phase sine waves with addition of the third harmonic component shifted by 120 o

to each other using

Designer Reference Manual

46 Software Design

For More Information On This Product,

Go to: www.freescale.com

DRM021 — Rev 0

MOTOROLA

Freescale Semiconductor, Inc.

Software Design

Data Flow

Gen3PhWaveSine3rdHIntp function from the motor control function library.

The function is based on a fix wave table describing the first quadrant of sine wave stored in data memory of the DSP. Due to the symmetry of the sine function, the data in other quadrants are calculated using the data of first quadrant. It saves the data memory. The sine wave generation for the phase A, simplicity, is explained in

Figure 5-4

The phases B and C are shifted by 120 o

with respect to the Phase A

.

0x7fff

ActualPhase(n)

PhaseIncrement

ActualPhase(n-1)

0x4000

DRM021 — Rev 0

MOTOROLA

(DutyCycle.PhaseA)

0x8000 = -180 o

0x0000

0

Figure 5-4. Sinewave generation

0x7fff = 180 o

Each time the waveform generation function is called, ActualPhase from the previous step is updated by PhaseIncrement, and according to the calculated phase the value of sine is fetched from the sine table (using the function SinPIx from the algorithms library). Then it’s multiplied by the amplitude and passed to the PWM. For the explanation of the a

3-phase waveform generation with the 3rh harmonic addition, see the following formulas.

Software Design

For More Information On This Product,

Go to: www.freescale.com

Designer Reference Manual

47

Software Design

Freescale Semiconductor, Inc.

PWMA

PWMB

=

=

PWMC

=

3

3

3

⋅ sin

α

+

6

⋅ sin 3

α

 sin

( α 120

0

)

+

6

⋅ sin 3

α

 sin

( α 240

0

)

+

6

⋅ sin 3

α

(5-2)

Where PWMA, PWMB and PWMC are calculated, dutycycles passed to the PWM driver and the amplitude determines the level of the phase voltage amplitude.

The process that is performed in the PWM reload callback function:

isrPWM_A_Reload is accessed regularly at the rate given by the set

PWM reload frequency. This process is repeated often enough to compare it to the wave frequency. Wave length comparisons are made to generate the correct wave shape. Therefore, for the 16kHz PWM frequency, it is called each 4th PWM pulse, thus the PWM registers are updated in the 4kHz rate (each 250

µsec).

Figure 5-5

shows the dutycycles generated by the

Gen3PhWaveSine3rdHIntp function when Amplitude is 1 (100%).

Designer Reference Manual

48

1.2

1.1

1.0

0.9

0.8

0.7

0.6

0.5

0.4

0.3

0.2

0.1

0.0

-0.1

-0.2

1st Harmonic A

1st Harmonic B

1st Harmonic B

3rd Harmonic

DutyCycle.PhaseA

DutyCycle.PhaseB

DutyCycle.PhaseC

Figure 5-5. 3-ph Sine Waves with 3rd Harm. Injection, Amp. = 100%

DRM021 — Rev 0

MOTOROLA Software Design

For More Information On This Product,

Go to: www.freescale.com

Freescale Semiconductor, Inc.

Software Design

Data Flow

Figure 5-6

defines the dutycycles generated by the

Gen3PhWaveSine3rdHIntp function when Amplitude is 0.5 (50%).

1.2

1.1

1.0

0.9

0.8

0.7

0.6

0.5

0.4

0.3

0.2

0.1

0.0

-0.1

-0.2

1st Harmonic A

1st Harmonic B

1st Harmonic B

3rd Harmonic

DutyCycle.PhaseA

DutyCycle.PhaseB

DutyCycle.PhaseC

Figure 5-6. 3-ph Sine Waves with 3rd Harm. Injection, Amp. = 50%

Input process:

Amplitude - obtained from DC-bus ripple elimination process

Omega_required - obtained from acceleration/deceleration ramp process

Output process:

Results calculated by the Gen3PhWaveSine3rdHIntp function are directly passed to the PWM value registers using the PWM driver.

5.2.6 Fault Control

This process is responsible for the fault handling. The software accommodates five fault inputs: the overcurrent, the overvoltage, the undervoltage, the overheating and the wrong identified hardware.

DRM021 — Rev 0

MOTOROLA Software Design

For More Information On This Product,

Go to: www.freescale.com

Designer Reference Manual

49

Freescale Semiconductor, Inc.

Software Design

Overcurrent: In the case of the overcurrent in DC-Bus link, the external hardware provides a rising edge on the fault input pin FAULTA1 of the

DSP. This signal immediately disables all the motor control PWM’s outputs (PWM1 - PWM6) and sets the DC_Bus_OverCurrent bit of

DriveFaultStatus variable.

Overvoltage: In the case of the overvoltage in DC-bus link, the external hardware provides a rising edge on the fault input pin FAULTA0 of the

DSP. This signal immediately disables all motor control PWM’s outputs

(PWM1 - PWM6) and sets the DC_Bus_OverVoltage bit of the

DriveFaultStatus variable.

Undervoltage: The DC-bus voltage sensed by the ADC is compared with the limit within the software. In the case of the undervoltage after a period defined by UNDERVOLTAGE_COUNT all the motor control

PWM outputs are disabled and the DriveFaultStatus variable is set to

DC_Bus_UnderVoltage.

Overheating: The temperature of the power module sensed by the ADC is compared with the limit within the software. In the case of the overheating after a period defined by OVERHEATING_COUNT all the motor control PWM outputs are disabled and the DriveFaultStatus variable is set to OverHeating.

Wrong Hardware: In the case the wrong hardware is identified (a different power module or missing an optoisolation board) during initialization, the DriveFaultStatus variable is set to Wrong_Hardware.

If any of the above mentioned faults occurs, program run into infinite loop and waits for reset. Fault is signalled by user LEDs on the controller board and on the PC Master control screen.

5.3 State Diagram

The general state diagram incorporates the main routine entered from reset, and the interrupt states. The main routine includes the initialization of the DSP and the main loop. The main loop incorporates the initialization state, the application state machine and the check run/stop switch state.

Designer Reference Manual

50 Software Design

For More Information On This Product,

Go to: www.freescale.com

DRM021 — Rev 0

MOTOROLA

Freescale Semiconductor, Inc.

Software Design

State Diagram

The interrupt states provides calculation of the actual speed of motor, the PWM reload interrupt, the ADC service, the limit analog values handling, the overcurrent and the overvoltage PWM fault handler, and so on.

5.3.1 Initialization

The main routine provides the initialization of the DSP:

• Initializes the PLL clock

• COP and LVI are disabled

• Identifies the connected hardware

• Initializes the analog-to-digital converter

• Initializes the timers for the speed ramp and the LED handler

• Initializes the PWM module:

– Center aligned complementary PWM mode, positive polarity

– Sets callback for the PWM reload to (every 4th. PWM pulse)

– Sets callback for the PWM faults

– Sets the PWM modulus - (defines the PWM frequency)

– enables the fault interrupts

• Sets-up I/O ports (push buttons, switch, brake)

• Initializes the quadrature decoder for the speed measurement

• Initializes algorithms (V/Hz look-up table, sinewave generator)

• Enables interrupts

The board identification routine identifies the connected power stage board by decoding the identified message sent from the power stage. If the wrong power stage is identified, the program goes to the infinite loop, displaying the fault status on the LED. The state can be left only by the

RESET.

DRM021 — Rev 0

MOTOROLA Software Design

For More Information On This Product,

Go to: www.freescale.com

Designer Reference Manual

51

Software Design

Freescale Semiconductor, Inc.

reset

Quad Timer D1 for LED handling Interrupt

Initialization

done

Application

State Machine

done

Check

Run/Stop Switch

done

ADC A high or low limit Interrupt

ADC A

High or Low Limit Int.

Subroutine

done

ADC A end of scan Interrupt done

ADC A

Interrupt

Subroutine

Quad Timer D1

LED

Subroutine

done

Quad Timer D2 for Speed Ramp Interrupt done

Quad Timer D2

Speed Ramp

Subroutine

PWM A Reload Interrupt

PWM A

Reload Interrupt

Subroutine

done

PWM A Fault Interrupt done

PWM A

Fault Interrupt

Subroutine

Figure 5-7. State Diagram - General Overview

5.3.2 Application State Machine

This state controls the main application functionalities, depicted in

Figure 5-8 .

Designer Reference Manual

52 Software Design

For More Information On This Product,

Go to: www.freescale.com

DRM021 — Rev 0

MOTOROLA

Freescale Semiconductor, Inc.

Software Design

State Diagram

Application State Machine - Begin

Test

Drive Fault Status

NO_FAULT

Test

Application Mode

RUN STOP

FAULT

Emergency Stop

RESET

Enable PWM

Calculate V/Hz Ramp

done

Speed = 0

Disable PWM

done

Application State Machine - End

Figure 5-8. State - Application State Machine

5.3.3 Check Run/Stop Switch

In this state, the Run/Stop switch is checked according to the Application

Mode setting; whether set to RUN or STOP.

5.3.4 PWM A Reload ISR

This subroutine is called at the PWM A reload interrupt. It provides:

• The measurement of the actual speed (MeasuredSpeed)

• The elimination of DC-bus voltage ripples (ElimDCBVoltRipple function)

• The calculation of the waveform generator

(Gen3PhWaveSine3rdHIntp function)

DRM021 — Rev 0

MOTOROLA Software Design

For More Information On This Product,

Go to: www.freescale.com

Designer Reference Manual

53

Freescale Semiconductor, Inc.

Software Design

• The update of PWM value registers

• The Start of the ADC conversion

The name of the callback function in the code: void

isrPWM_A_Reload(void).

5.3.5 PWM A Fault ISR

This disables the PWM module and sets DriveFaultStatus |=

DC_Bus_OverVoltage or DC_Bus_OverCurrent according to the fault input pin level in the case of the overvoltage or the overcurrent in the

DC-Bus line.

The name of the callback function in the code: void

isrPWM_A_Fault(void).

This subroutine is called at the PWM A Fault Interrupt.

5.3.6 ADC End Of Scan ISR

The following analog inputs are read:

• DC-Bus Voltage

• DC-Bus Current

• Temperature of the Power Stage Module

Also the detection of faults caused by the overheating and the undervoltage is performed in this subroutine.

The name of the callback function in the code: void

isrADC_A_EndOfScan(void).

This subroutine is called at the ADC conversion completion.

5.3.7 ADC High And Low Limit ISR’s

This subroutine turns on and off the resistive brake in the DC-Bus link.

When the actual voltage of DC-Bus u_dc_bus is higher than

Designer Reference Manual

54 Software Design

For More Information On This Product,

Go to: www.freescale.com

DRM021 — Rev 0

MOTOROLA

Freescale Semiconductor, Inc.

Software Design

State Diagram

BRAKE_HIGH_LIMIT the brake is turned on. When the actual voltage of

DC-Bus u_dc_bus is lower than BRAKE_LOW_LIMIT the brake is turned off.

The Name of the callback function in the code: void

isrADC_A_Limit(void).

5.3.8 Quad Timer D1 Compare ISR

This subroutine takes care of the LED handling.

The name of the callback function in the code: void isrQT_D1(void).

Access frequency is defined by constant TMR_1_PERIOD in definition section of program.

5.3.9 Quad Timer D2 ISR

This subroutine takes care of Speed ramp calculation.

Name of callback function in code: void isrQT_D2(void).

Access frequency is defined by constant TMR_2_PERIOD in the definition section of the program.

DRM021 — Rev 0

MOTOROLA Software Design

For More Information On This Product,

Go to: www.freescale.com

Designer Reference Manual

55

Software Design

Freescale Semiconductor, Inc.

Designer Reference Manual

56 Software Design

For More Information On This Product,

Go to: www.freescale.com

DRM021 — Rev 0

MOTOROLA

Freescale Semiconductor, Inc.

Designer Reference Manual — 3-Phase ACIM V/Hz Control

Section 6. Application Setup

6.1 Contents

6.2

Application Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

6.3

Application Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63

6.3.1

Application Set-Up Using DSP56F805EVM . . . . . . . . . . . . . 64

6.4

Project Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

6.5

Application Build & Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

6.2 Application Description

This application performs a principal control of the 3-phase AC Induction motor using the DSP56F805 processor. The control technique sets the speed ([rpm], [Hz]) of the magnetic field and calculates the phase voltage amplitude according to a V/Hz table. This table is private to the application and reflects AC induction motor parameters (Base

Voltage/frequency; Boost Voltage/frequency; DC Boost Voltage).The incremental encoder is used to derive the actual rotor speed.

The closed loop system is characterized by a feedback signal (Actual speed), derived from a quadrature decoder in the controlled system.

This signal monitors the actual behavior of the system, and is compared with the reference signal (Required Speed). The magnitude and polarity of the resulting error signal are directly related to the difference between required and actual values of the controlled variable, which may be the speed of a motor. The error signal is amplified by the controller, and the controller output makes a correction to the controlled system, reducing the error signal.

Overcurrent, Overvoltage, Undervoltage, and Overheating protections are provided.

DRM021 — Rev 0

MOTOROLA Application Setup

For More Information On This Product,

Go to: www.freescale.com

Designer Reference Manual

57

Application Setup

Freescale Semiconductor, Inc.

The Volt per Hertz control algorithm is calculated on the Motorola

DSP56F805. The algorithm generates the 3-phase PWM signals for AC induction motor inverter according to the user-required inputs, measured and calculated signals.

The concept of the ACIM drive incorporates the following hardware components:

• AC induction motor--brake set

• 3-phase AC/BLDC high voltage power stage

• DSP56F805EVM boards

• Optoisolation box which is connected between the Power stage board and the DSP56F805EVM

The AC induction motor--brake set incorporates a 3-phase AC induction motor and attached BLDC motor brake. The AC induction motor has four poles. The incremental position sensor (encoder) is coupled on the motor shaft. The detailed motor--brake specifications are listed in

Table 6-1

.

This 3-Phase AC Induction Motor V/Hz Control Application can operate in two modes:

1. Manual Operating Mode

The drive is controlled by the RUN/STOP switch (S6). The motor speed is set by the UP (S2-IRQB) and DOWN (S1-IRQA) push buttons; see

Figure 6-1

If the application runs and motor spinning

is disabled (i.e., the system is ready) the USER LED (LED3, shown in

Figure 6-2

) will blink. When motor spinning is enabled,

the USER LED is On. Refer to

Table 6-2

for application states.

Table 6-1. Motor--Brake Specifications

Set Manufactured

EM Brno, Czech Republic

Designer Reference Manual

58 Application Setup

For More Information On This Product,

Go to: www.freescale.com

DRM021 — Rev 0

MOTOROLA

Freescale Semiconductor, Inc.

Application Setup

Application Description

Table 6-1. Motor--Brake Specifications

Motor Specification

Brake Specification

Position Sensor

(Encoder)

Motor Type

Pole-Number

Nominal Speed

Nominal Voltage

Nominal Current:

Brake Type

Pole-Number

Nominal Speed

Nominal Voltage

Nominal Current

Type

Pulses per revolution

AM40V

3-Phase AC Induction Motor

4

1300 rpm

3 x 200V

0.88A

SG40N

3-Phase BLDC Motor

6

1500rpm

3 x 27V

2.6 A

Baumer Electric

BHK 16.05A 1024-12-5

1024

Figure 6-1. RUN/STOP Switch and UP/DOWN Buttons

DRM021 — Rev 0

MOTOROLA Application Setup

For More Information On This Product,

Go to: www.freescale.com

Designer Reference Manual

59

Application Setup

Freescale Semiconductor, Inc.

Figure 6-2. USER and PWM LEDs at DSP56F805EVM

Application State

Table 6-2. Motor Application States

Motor State

Stopped

Running

Fault

Stopped

Spinning

Stopped

Green LED State

Blinking at a frequency of 2Hz, red led status is off

On, red led status is off

Blinking at a frequency of 8Hz, red led status is on

2. PC master software (Remote) Operating Mode

The drive is controlled remotely from a PC through the SCI

Designer Reference Manual

60 Application Setup

For More Information On This Product,

Go to: www.freescale.com

DRM021 — Rev 0

MOTOROLA

DRM021 — Rev 0

MOTOROLA

Freescale Semiconductor, Inc.

Application Setup

Application Description communication channel of the DSP device via an RS-232 physical interface. The drive is enabled by the RUN/STOP switch, which can be used to safely stop the application at any time. PC master software enables to set the required speed of the motor.

PC master software displays the following information:

• Applied Voltage

• Required Voltage

• Speed

• RUN/STOP Switch Status

• Application Mode

Measured quantities include:

• DCBus voltage

• Power module temperature

• Rotor speed

The faults used for drive protection:

• Overvoltage (PC master software error message = Overvoltage

fault)

• Undervoltage (PC master software error message = Undervoltage

fault)

• Overcurrent (PC master software error message = Overcurrent

fault)

• Overheating (PC master software error message = Overheating

fault)

• Wrong-hardware (PC master software error message = Wrong

HW used)

Start the PC master software window’s application, 3acim_vhz.pmp.

Figure 6-3

illustrates the PC master software control window after this

project has been launched.

Application Setup

For More Information On This Product,

Go to: www.freescale.com

Designer Reference Manual

61

Freescale Semiconductor, Inc.

Application Setup

NOTE:

If the PC master software project (.pmp file) is unable to control the application, it is possible that the wrong load map (.elf file) has been selected. PC master software uses the load map to determine addresses for global variables being monitored. Once the PC master software project has been launched, this option may be selected in the

PC master software window under Project/Select Other Map FileReload.

Figure 6-3. PC Master Software Control Window

Designer Reference Manual

62 Application Setup

For More Information On This Product,

Go to: www.freescale.com

DRM021 — Rev 0

MOTOROLA

Freescale Semiconductor, Inc.

Application Setup

Application Setup

6.3 Application Setup

Figure 6-4

illustrates the hardware set-up for the AC Induction Motor

V/Hz Control Application.

The system consists of the following components:

• AC Induction motor Type AM40V, EM Brno s.r.o., Czech Republic

• Load Type SG 40N, EM Brno s.r.o., Czech Republic

• Encoder BHK 16.05A1024-12-5, Baumer Electric, Switzerland

• 3-ph. AC BLDC HV Power Stage 180 W

• Optoisolation Board

• DSP56F805 Board:

– DSP56F805 Evaluation Module, supplied as DSP56F805EVM

– or DSP56F805 Controller Board

• The serial cable - needed for the PC master software debugging tool only.

• The parallel cable - needed for the Metrowerks Code Warrior debugging and s/w loading.

DRM021 — Rev 0

MOTOROLA Application Setup

For More Information On This Product,

Go to: www.freescale.com

Designer Reference Manual

63

Application Setup

Freescale Semiconductor, Inc.

Figure 6-4. Set-up of the 3-Phase ACIM V/Hz Control Application

6.3.1 Application Set-Up Using DSP56F805EVM

To execute the AC Induction Motor V/Hz Control, the DSP56F805EVM

board requires the strap settings shown in

Figure 6-5

and

Table 6-3

.

Designer Reference Manual

64 Application Setup

For More Information On This Product,

Go to: www.freescale.com

DRM021 — Rev 0

MOTOROLA

Freescale Semiconductor, Inc.

Application Setup

Application Setup

JG6

3

1

1

3

JG15

JG1

JG2

9

6

3

JG10

7

4

1

JG14

3

2

1

JG12

3

2

1

JG13

1

3

1

3

JG9

USER

9

6

3

JG10

PWM

7

4

1

JG14

Y1

J23

JG17

JG6

1

3

2

1

JG12

1

JG15

1

JG1 JG2

JG18

J24

3

2

1

JG13

DSP56F805EVM

1

JG16

JTAG

J29

U1

JG9

1

JG3

LED3

S4

GP1

S1

P3

IRQA

S/N

S5

GP2

S2

S6

RUN/STOP

S3

JG7

1

JG11

P1

U9

IRQB RESET

U15

JG5

U10

JG8

JG4

1

P1

3

1

1

JG3

2

JG18

7

8

JG17

JG11

8

2

JG4

3 1

1

JG16

JG8

JG7

7

JG5

Figure 6-5. DSP56F805EVM Jumper Reference

Jumper Group

JG1

JG2

JG3

JG4

JG5

JG6

JG7

JG8

JG9

Table 6-3. DSP56F805EVM Jumper Settings

Comment

PD0 input selected as a high

PD1 input selected as a high

Primary UNI-3 serial selected

Secondary UNI-3 serial selected

Enable on-board parallel JTAG Command Converter

Interface

Use on-board crystal for DSP oscillator input

Select DSP’s Mode 0 operation upon exit from reset

Enable on-board SRAM

Enable RS-232 output

Connections

1-2

1-2

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

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

NC

2-3

1-2

1-2

1-2

DRM021 — Rev 0

MOTOROLA Application Setup

For More Information On This Product,

Go to: www.freescale.com

Designer Reference Manual

65

Freescale Semiconductor, Inc.

Application Setup

Jumper Group

JG10

JG11

JG12

JG13

JG14

JG15

JG16

JG17

JG18

Table 6-3. DSP56F805EVM Jumper Settings

Comment

Secondary UNI-3 Analog temperature input unused

Use Host power for Host target interface

Primary Encoder input selected for quadrature encoder signals

Secondary Encoder input selected

Primary UNI-3 3-Phase Current Sense selected as Analog

Inputs

Secondary UNI-3 Phase A Overcurrent selected for FAULTA1

Secondary UNI-3 Phase B Overcurrent selected for FAULTB1

CAN termination unselected

Use on-board crystal for DSP oscillator input

Connections

NC

1-2

2-3, 5-6, 8-9

2-3, 5-6, 8-9

2-3, 5-6, 8-9

1-2

1-2

NC

1-2

When running the EVM target system in a stand-alone mode from Flash, the JG5 jumper must be set in the 1-2 configuration to disable the command converter parallel port interface.

6.4 Project Files

Designer Reference Manual

66

The 3-Phase AC Induction Motor V/Hz Control application is composed of the following files:

...\3acim_vhz_sa\3acim_vhz.c, main program

...\3acim_vhz_sa\3acim_vhz_sa.mcp, application project file

...\3acim_vhz_sa\ApplicationConfig\appconfig.h, application configuration file

...\3acim_vhz_sa\SystemConfig\ExtRam\linker_ram.cmd,

linker command file for external RAM

...\3acim_vhz_sa\SystemConfig\Flash\linker_flash.cmd, linker command file for Flash

...\3acim_vhz_sa\SystemConfig\Flash\flash.cfg, configuration file for Flash

DRM021 — Rev 0

MOTOROLA Application Setup

For More Information On This Product,

Go to: www.freescale.com

Freescale Semiconductor, Inc.

Application Setup

Project Files

...\3acim_vhz_sa\PCMaster\3acim_vhz.pmp, PC Master software file

These files are located in the application folder.

Motor Control algorithms used in the application:

...\controller.c, .h: source and header files for PI controller

...\ramp.c, .h: source and header files for ramp controller

...\sinquad.c, .h: source and header files with the sine look-up table

...\trigon.c, .h: source and header files for sine calculation funcion

...\mcgen.c, .h: source and header files for three-phase sine wave generation

...\lut.c, .h: source and header files for look-up table algorithm

...\ripelim.c, .h: source and header files for DC bus voltage ripple elimination algorithm

Other functions used in the application:

...\boardId.c, .h: source and header files for the board identification function

This application runs stand-alone, i.e. all the needed files are concentrated in one project folder. Quick_Start libraries are:

...\3acim_vhz_sa\src\include, folder for general C-header files

...\3acim_vhz_sa\src\dsp56805, folder for the device specific source files, e.g. drivers

...\3acim_vhz_sa\src\pc_master_support, folder for PC master software source files

...\3acim_vhz_sa\src\algorithms\, folder for algorithms

DRM021 — Rev 0

MOTOROLA Application Setup

For More Information On This Product,

Go to: www.freescale.com

Designer Reference Manual

67

Freescale Semiconductor, Inc.

Application Setup

6.5 Application Build & Execute

When building the 3-Phase AC Induction V/Hz Control Application, the user can create an application that runs from internal Flash or External

RAM. To select the type of application to build, open the

3acim_vhz_sa.mcp project and select the target build type, as shown in

Figure 6-6

A definition of the projects associated with these target build

types may be viewed under the Targets tab of the project window.

Figure 6-6. Target Build Selection

The project may now be built by executing the Make command, as shown in

Figure 6-7

This will build and link the 3-Phase AC Induction

Motor V/Hz Control Application and all needed Metrowerks.

Designer Reference Manual

68 Application Setup

For More Information On This Product,

Go to: www.freescale.com

DRM021 — Rev 0

MOTOROLA

Freescale Semiconductor, Inc.

Application Setup

Application Build & Execute

DRM021 — Rev 0

MOTOROLA

Figure 6-7. Execute Make Command

To execute the 3-Phase AC Induction Motor V/Hz Control application, select Project\Debug in the CodeWarrior IDE, followed by the Run command. For more help with these commands, refer to the

CodeWarrior tutorial documentation in the following file located in the

CodeWarrior installation folder:

<...>\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf

If the Flash target is selected, CodeWarrior will automatically program the internal Flash of the DSP with the executable generated during Build.

If the External RAM target is selected, the executable will be loaded to off-chip RAM.

Once Flash has been programmed with the executable, the EVM target system may be run in a stand-alone mode from Flash. To do this, set the

JG5 jumper in the 1-2 configuration to disable the parallel port, and press the RESET button.

Once the application is running, move the RUN/STOP switch to the RUN position and set the required speed using the UP/DOWN push buttons.

Pressing the UP/DOWN buttons should incrementally increase the motor speed until it reaches maximum speed. If successful, the induction motor will be spinning.

Application Setup

For More Information On This Product,

Go to: www.freescale.com

Designer Reference Manual

69

Freescale Semiconductor, Inc.

Application Setup

NOTE:

If the RUN/STOP switch is set to the RUN position when the application starts, toggle the RUN/STOP switch between the STOP and RUN positions to enable motor spinning. This is a protection feature that prevents the motor from starting when the application is executed from

CodeWarrior.

You should also see a lighted green LED, which indicates that the application is running. If the application is stopped, the green LED will blink at a 2Hz frequency. If any fault occurs, the green LED will blink at a frequency of 8Hz.

Designer Reference Manual

70 Application Setup

For More Information On This Product,

Go to: www.freescale.com

DRM021 — Rev 0

MOTOROLA

Freescale Semiconductor, Inc.

Designer Reference Manual — 3-Phase ACIM V/Hz Control

Appendix A. References

DRM021 — Rev 0

MOTOROLA

1. Bose, K. B. (1997). Power Electronics and Variable Frequency

Drives, IEEE Press, ISBN 0-7803-1061-6, New York.

2. Caha, Z.; Cerny, M. (1990). Elektricke pohony, SNTL, ISBN

80-03-00417-7, Praha.

3. Subrt, J. (1987). Elektricke regulacni pohony II, VUT Brno, Brno.

4. Vas, P. (1998). Sensorless Vector and Direct Torque Control,

Oxford University Press, ISBN 0-19-856465-1, New York.

5. Motorola, Inc. (2000). DSP56800 Family Manual,

DSP56F800FM/D, Rev. 1.

6. Motorola, Inc.(2001). DSP56F80x User’s Manual,

DSP56F801-7UM/D, Rev. 3.0.

7. Motorola, Inc. (2001). DSP Evaluation Module Hardware User’s

Manual, DSP56F805EVMUM/D, Rev. 3.0.

8. Motorola, Inc. (2001). DSP Evaluation Module Hardware User’s

Manual, DSP56F803EVMUM/D, Rev. 3.0.

9. Motorola, Inc. (2001). DSP Evaluation Module Hardware User’s

Manual, DSP56F807EVMUM/D, Rev. 0.

10. Motorola Software Development Kit documentation available on the web page: www.motorola.com

11. CodeWarrior for Motorola DSP56800 Embedded Systems,

CWDSP56800, Metrowerks 2001

12. DSP56F805 Evaluation Module Hardware User’s Manual,

DSP56F805EVMUM/D, Motorola 2001

13. Evaluation Motor Board User’s Manual, MEMCEVMBUM/D,

Motorola

14. 3-Phase AC BLDC High-Voltage Power Stage,

References

For More Information On This Product,

Go to: www.freescale.com

Designer Reference Manual

71

References

Freescale Semiconductor, Inc.

ECOPTHIVACBLDC, Motorola

15. Motorola Embedded Motion Optoisolation Board User’s Manual,

MEMCOBUM/D, Motorola 2000

16. User Manual for PC master software, Motorola 2001

17. DSP56800_Quick_Start User’s Manual, MCSL 2002

18. Motor Control Algorithms Description, MCSL 2002

Designer Reference Manual

72 References

For More Information On This Product,

Go to: www.freescale.com

DRM021 — Rev 0

MOTOROLA

Freescale Semiconductor, Inc.

Designer Reference Manual — DRM021

DRM021 — Rev 0

MOTOROLA

Appendix B. Glossary

AC — Alternating Current.

ADC — See “analogue-to-digital converter”.

brush — A component transfering elektrical power from non-rotational terminals, mounted on the stator, to the rotor

BLDC — Brushless dc motor.

commutation — A process providing the creation of a rotation field by switching of power transistor (electronic replacement of brush and commutator)

commutator — A mechanical device alternating DC current in DC commutator motor and providing rotation of DC commutator motor

COP — Computer Operating Properly timer

DC — Direct Current.

DSP — Digital Signal Prosessor.

DSP56F80x — A Motorola family of 16-bit DSPs dedicated for motor control.

DT — see “Dead Time (DT)”

Dead Time (DT) — short time that must be inserted between the turning off of one transistor in the inverter half bridge and turning on of the complementary transistor due to the limited switching speed of the transistors.

duty cycle — A ratio of the amount of time the signal is on versus the time it is off. Duty cycle is usually represented by a percentage.

GPIO — General Purpose Input/Output.

Glossary

For More Information On This Product,

Go to: www.freescale.com

Designer Reference Manual

73

Freescale Semiconductor, Inc.

Glossary

Hall Sensors - A position sensor giving six defined events (each 60 electrical degrees) per electrical revolution (for 3-phase motor)

HV — High Voltage (115 V AC or 230 V AC)

interrupt — A temporary break in the sequential execution of a program to respond to signals from peripheral devices by executing a subroutine.

input/output (I/O) — Input/output interfaces between a computer system and the external world. A CPU reads an input to sense the level of an external signal and writes to an output to change the level on an external signal.

JTAG — Interface allowing On-Chip Emulation and Programming.

LED — Light Emitting Diode

logic 1 — A voltage level approximately equal to the input power voltage

(V

DD

).

logic 0 — A voltage level approximately equal to the ground voltage

(V

SS

).

LV — Low Voltage (12 V DC)

PI controller — Proportional-Integral controller.

phase-locked loop (PLL) — A clock generator circuit in which a voltage controlled oscillator produces an oscillation which is synchronized to a reference signal.

PM — Permanent Magnet

PMSM - Permanent Magnet Synchronous Motor.

PWM — Pulse Width Modulation.

Quadrature Decoder — A module providing decoding of position from a quadrature encoder mounted on a motor shaft.

Quad Timer — A module with four 16-bit timers.

reset — To force a device to a known condition.

Designer Reference Manual

74 Glossary

For More Information On This Product,

Go to: www.freescale.com

DRM021 — Rev 0

MOTOROLA

Freescale Semiconductor, Inc.

Glossary

RPM — Revolutions per minute.

SCI — See "serial communication interface module (SCI)."

serial communications interface module (SCI) — A module that supports asynchronous communication.

serial peripheral interface module (SPI) — A module that supports synchronous communication.

software — Instructions and data that control the operation of a microcontroller.

software interrupt (SWI) — An instruction that causes an interrupt and its associated vector fetch.

SPI — See "serial peripheral interface module (SPI)."

timer — A module used to relate events in a system to a point in time.

DRM021 — Rev 0

MOTOROLA Glossary

For More Information On This Product,

Go to: www.freescale.com

Designer Reference Manual

75

Glossary

Freescale Semiconductor, Inc.

Designer Reference Manual

76 Glossary

For More Information On This Product,

Go to: www.freescale.com

DRM021 — Rev 0

MOTOROLA

Freescale Semiconductor, Inc.

For More Information On This Product,

Go to: www.freescale.com

Freescale Semiconductor, Inc.

HOW TO REACH US:

USA/EUROPE/LOCATIONS NOT LISTED:

Motorola Literature Distribution;

P.O. Box 5405, Denver, Colorado 80217

1-303-675-2140 or 1-800-441-2447

JAPAN:

Motorola Japan Ltd.; SPS, Technical Information Center,

3-20-1, Minami-Azabu Minato-ku, Tokyo 106-8573 Japan

81-3-3440-3569

ASIA/PACIFIC:

Motorola Semiconductors H.K. Ltd.;

Silicon Harbour Centre, 2 Dai King Street,

Tai Po Industrial Estate, Tai Po, N.T., Hong Kong

852-26668334

TECHNICAL INFORMATION CENTER:

1-800-521-6274

HOME PAGE: http://motorola.com/semiconductors

Information in this document is provided solely to enable system and software implementers to use Motorola products. There are no express or implied copyright licenses granted hereunder to design or fabricate any integrated circuits or integrated circuits based on the information in this document.

Motorola reserves the right to make changes without further notice to any products herein. Motorola makes no warranty, representation or guarantee regarding the suitability of its products for any particular purpose, nor does Motorola assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation consequential or incidental damages. “Typical” parameters which may be provided in Motorola data sheets and/or specifications can and do vary in different applications and actual performance may vary over time. All operating parameters, including “Typicals” must be validated for each customer application by customer’s technical experts.

Motorola does not convey any license under its patent rights nor the rights of others. Motorola products are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other applications intended to support or sustain life, or for any other application in which the failure of the Motorola product could create a situation where personal injury or death may occur. Should Buyer purchase or use Motorola products for any such unintended or unauthorized application, Buyer shall indemnify and hold Motorola and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that Motorola was negligent regarding the design or manufacture of the part.

Motorola and the Stylized M Logo are registered in the U.S. Patent and Trademark

Office. digital dna is a trademark of Motorola, Inc. All other product or service names are the property of their respective owners. Motorola, Inc. is an Equal

Opportunity/Affirmative Action Employer.

© Motorola, Inc. 2003

DRM021/D

For More Information On This Product,

Go to: www.freescale.com

Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project