DRM029, 3-Phase PM Synchronous Motor Control with Quadrature

DRM029, 3-Phase PM Synchronous Motor Control with Quadrature

Freescale Semiconductor, Inc.

Designer Reference Manual — 3-Ph PM SMC with Quadrature Encoder

Section 6. System Setup

6.1 Contents

6.2

Operational Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

6.3

Application Set-Up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

6.4

PM Synchronous Motor versus BLDC Motor . . . . . . . . . . . . . . 58

6.5

DSP56F805EVM Set-Up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

6.6

Projects Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

6.7

Application Build & Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . 62

6.2 Operational Modes

This BLDC Motor Control Application with Hall Sensors 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-1

for application states.

DRM029 — Rev 0

MOTOROLA System Setup

For More Information On This Product,

Go to: www.freescale.com

Designer Reference Manual

53

System Setup

Freescale Semiconductor, Inc.

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

Figure 6-2. USER and PWM LEDs at DSP56F805EVM

Designer Reference Manual

54 System Setup

For More Information On This Product,

Go to: www.freescale.com

DRM029 — Rev 0

MOTOROLA

Freescale Semiconductor, Inc.

System Setup

Operational Modes

Application State

Stopped

Running

Fault

Table 6-1. Motor Application States

Motor State

Stopped

Spinning

Stopped

Green LED State

Blinking at a frequency of 2Hz

On

Blinking at a frequency of 8Hz

2. PC master software (Remote) Operating Mode

The drive is controlled remotely from a PC through the SCI 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. MC master software enables to set the required speed of the motor

PC master software displays the following information:

• Required Speed

• Actual Speed

• Amplitude

• DC-Bus Voltage

• RUN/STOP Switch Status

• Application Mode

Start the PC master software window’s application,

BLDC_synchro_pm_quad_encoder.pmp.

Figure 6-3

illustrates the PC

master software control window after this project has been launched.

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 File

Reload.

DRM029 — Rev 0

MOTOROLA System Setup

For More Information On This Product,

Go to: www.freescale.com

Designer Reference Manual

55

System Setup

Freescale Semiconductor, Inc.

Figure 6-3. PC Master Software Control Window

6.3 Application Set-Up

Figure 6-4

illustrates the hardware set-up for the Synchronous PM

Motor Control Application with Quadrature Encoder.

Designer Reference Manual

56 System Setup

For More Information On This Product,

Go to: www.freescale.com

DRM029 — Rev 0

MOTOROLA

Freescale Semiconductor, Inc.

System Setup

Application Set-Up

DRM029 — Rev 0

MOTOROLA

Figure 6-4. Set-up of the BLDC Motor Control Application using DSP56F805EVM

The system consists of the following components:

• BLDC Motor IB23810

– supplied in kit ECMTREVAL - Evaluation Motor Board Kit

• EVM Motor Board:

– supplied in kit with IB23810 Motor: ECMTREVAL - Evaluation

Motor Board Kit

• DSP56F805 Board:

System Setup

For More Information On This Product,

Go to: www.freescale.com

Designer Reference Manual

57

Freescale Semiconductor, Inc.

System Setup

– 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

For detailed information, refer to the dedicated application note (see

References).

6.4 PM Synchronous Motor versus BLDC Motor

The application SW is targeted for PM Synchronous motor with sine-wave Back-EMF shape. In this particular demo application the

BLDC motor is used instead. This is due to the availability of the BLDC motor supplied as ECMTREVAL. Although the Back-EMF shape of this motor is not ideally sine-wave, it can be controlled by the application SW.

The drive parameters will be even better when PMSM motor with exactly sine-wave Back-EMF shape is used.

6.5 DSP56F805EVM Set-Up

To execute the Synchronous PM Motor Control with Quadrature

Encoder, the DSP56F805EVM board requires the strap settings shown in

Figure 6-5

and

Table 6-2

.

Designer Reference Manual

58 System Setup

For More Information On This Product,

Go to: www.freescale.com

DRM029 — Rev 0

MOTOROLA

Freescale Semiconductor, Inc.

System Setup

DSP56F805EVM Set-Up

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

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

JG9

1

JG3

2

JG18

7

8

JG17

3

1

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-2. 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

DRM029 — Rev 0

MOTOROLA System Setup

For More Information On This Product,

Go to: www.freescale.com

Designer Reference Manual

59

Freescale Semiconductor, Inc.

System Setup

Jumper Group

JG10

JG11

JG12

JG13

JG14

JG15

JG16

JG17

JG18

Table 6-2. 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 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

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

NOTE:

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.6 Projects Files

The Synchronous PM Motor Control application is composed of the following files:

...\bldc_synchro_pm_quad_encoder_sa\bldc_synchro_pm_qua

d_encoder_sa.c, main program

...\bldc_synchro_pm_quad_encoder_sa\bldc_synchro_pm_qua

d_encoder_sa.mcp, application project file

....\bldc_synchro_pm_quad_encoder_sa\ApplicationConfig\app

config.h, application configuration file

...\bldc_synchro_pm_quad_encoder_sa\SystemConfig\ExtRam

\linker_ram.cmd, linker command file for external RAM

Designer Reference Manual

60 System Setup

For More Information On This Product,

Go to: www.freescale.com

DRM029 — Rev 0

MOTOROLA

Freescale Semiconductor, Inc.

System Setup

Projects Files

...\bldc_synchro_pm_quad_encoder_sa\SystemConfig\Flash\li

nker_flash.cmd, linker command file for Flash

...\bldc_synchro_pm_quad_encoder_sa\SystemConfig\Flash\fl

ash.cfg, configuration file for Flash

...\bldc_synchro_pm_quad_encoder_sa\PCMaster\bldc_synchr

o_pm_quad_encoder.pmp, PC master software file

These files are located in the application directory.

Motor Control algorithms used in the application:

...\controllers.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

In stand-alone application, all the necessary resources (algorithms and peripheral drivers) are part of the application project file:

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

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

...\bldc_synchro_pm_quad_encoder_sa\src\pc_master_suppor

t, folder for PC master software source files

...\bldc_synchro_pm_quad_encoder_sa\src\algorithms\, folder for algorithms

DRM029 — Rev 0

MOTOROLA System Setup

For More Information On This Product,

Go to: www.freescale.com

Designer Reference Manual

61

Freescale Semiconductor, Inc.

System Setup

6.7 Application Build & Execute

When building the Synchronous PM Motor Control Application with

Quadrature Encoder, the user can create an application that runs from internal Flash or External RAM. To select the type of application to build, open the bldc_synchro_pm_quad_encoder.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 Synchronous PM Motor

Control Application with Quadrature Encoder and all needed Metrowerks and Quick_Start libraries.

Designer Reference Manual

62 System Setup

For More Information On This Product,

Go to: www.freescale.com

DRM029 — Rev 0

MOTOROLA

Freescale Semiconductor, Inc.

System Setup

Application Build & Execute

DRM029 — Rev 0

MOTOROLA

Figure 6-7. Execute Make Command

To execute the Synchonous PM Motor 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 directory:

<...>\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 BLDC motor will be spinning.

System Setup

For More Information On This Product,

Go to: www.freescale.com

Designer Reference Manual

63

Freescale Semiconductor, Inc.

System 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 an Undervoltage fault occurs, the green LED will blink at a frequency of 8Hz.

Designer Reference Manual

64 System Setup

For More Information On This Product,

Go to: www.freescale.com

DRM029 — Rev 0

MOTOROLA

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