您的当前位置:首页正文

bldc_3pwm_drv

2024-03-03 来源:榕意旅游网
 Description

BLDC_3PWM_DRV Three-phase BLDC PWM DriverThis module generates the 6 switching states of a 3-ph power inverter used to drive a 3-ph BLDC motor. These switching states are determined by the input variable CmtnPointer. The module also controls the PWM duty cycle by calculating appropriate values for the compare registers. The duty cycle values for the PWM outputs are determined by the input DutyFunc.

CmtnPointerPWM1(PWM2)PWM3(PWM4)DutyFuncBLDC_3PWM_DRVPWMH/WPWM5(PWM6)MfuncPeriod

Availability

This 16-bit module is available in one interface format:

1) The C interface version

Module Properties Type: Target Dependent, Application Independent

Target Devices: x281x or x280x

C Version File Names: f281xbldcpwm.c, f281xbldcpwm.h (for x281x) f280xbldcpwm.c, f280xbldcpwm.h (for x280x) IQmath library files for C: N/A

Item Code Size□ (x281x/x280x) Data RAM xDAIS ready

0 words• No C version

Comments

115/464 words

IALG layer not implemented

XDAIS component No Multiple instances

Yes

Reentrancy Yes

Each pre-initialized PWMGEN structure consumes 9 words in the data memory

Code size mentioned here is the size of the init() and update() functions

Digital Control Systems (DCS) Group

Texas Instruments

1

C Interface C Interface

Object Definition

The structure of PWMGEN object is defined by following structure definition

typedef struct { Uint16 CmtnPointer; // Input: Commutation (or switching) state pointer input (Q0) int16 MfuncPeriod; // Input: Duty ratio of the PWM outputs (Q15) Uint16 PeriodMax; // Parameter: Maximum period (Q0) int16 DutyFunc; // Input: PWM period modulation input (Q15) Uint16 PwmActive; // Parameter: 0 = active low, 1 = active high (0 or 1) void (*init)(); // Pointer to the init function void (*update)(); // Pointer to the update function } PWMGEN;

typedef PWMGEN *PWMGEN_handle;

Item Name Description

CmtnPointer Commutation (or switching) state Inputs

Format Q0

Range(Hex)

0 - 5

Outputs PWMGEN

parameter

pointer input

MfuncPeriod Duty ratio of the PWM outputs DutyFunc PWM period modulation input PWMx Output signals from the 6 PWM (x=1,2,3,4,5,6) pins in EVA on the x2812eZdsp. PeriodMax PWM Period in CPU clock cycles PwmActive 0 = PWM active low

1 = PWM active high

Q15 8000-7FFF Q15 8000-7FFF N/A 0-3.3 V Q0 Q0

8000-7FFF 0 or 1

Special Constants and Data types PWMGEN

The module definition is created as a data type. This makes it convenient to instance an interface to the PWMGEN driver. To create multiple instances of the module simply declare variables of type PWMGEN.

PWMGEN_handle

User defined Data type of pointer to PWMGEN module

PWMGEN_DEFAULTS

Structure symbolic constant to initialize PWMGEN module. This provides the initial values to the terminal variables as well as method pointers.

Methods

void F281X_EV1_BLDC_PWM_Init(PWMGEN *); void F281X_EV1_BLDC_PWM_Update(PWMGEN *);

void F280X_BLDC_PWM_Init(PWMGEN *); void F280X_BLDC_PWM_Update(PWMGEN *);

Digital Control Systems (DCS) Group

Texas Instruments

2

C Interface

This default definition of the object implements two methods – the initialization and the runtime compute function for PWMGEN generation. This is implemented by means of a function pointer, and the initializer sets this to F281X_EV1_BLDC_PWM_Init and F281X_EV1_BLDC_PWM_Update functions for x281x or F280X_BLDC_PWM_Init and F280X_BLDC_PWM_Update functions for x280x. The argument to this function is the address of the PWMGEN object.

Module Usage

Instantiation

The following example instances one PWMGEN object PWMGEN pwm1;

Initialization

To Instance pre-initialized objects

PWMGEN pwm1 = PWMGEN_DEFAULTS;

Invoking the computation function pwm1.init(&pwm1); pwm1.update(&pwm1);

Example

The following pseudo code provides the information about the module usage.

main() { pwm1.PeriodMax = 7500; // PWM frequency = 20 kHz, clock = 150 MHz

pwm1.init(&pwm1); // Call init function for pwm1

}

void interrupt periodic_interrupt_isr() { pwm1.CmtnPointer = (int)(CmtnPointer1); // CmtnPointer1 is in Q0 pwm1.DutyFunc = (int)_IQtoIQ15(DutyFunc1); // DutyFunc1 is in GLOBAL_Q pwm1.update(&pwm1); // Call update function for pwm1 }

Digital Control Systems (DCS) Group

Texas Instruments

3

Technical Background

Technical Background

Figure 1 shows the 3-phase power inverter topology used to drive a 3-phase BLDC motor. In this arrangement, the motor and inverter operation is characterized by a two phases ON operation. This means that two of the three phases are always energized, while the third phase is turned off. This is achieved by controlling the inverter switches in a periodic 6 switching or commutation states. The bold arrows on the wires in Figure 1 indicate the current flowing through two motor stator phases during one of these commutation states. The direction of current flowing into the motor terminal is considered as positive, while the current flowing out of the motor terminal is considered as negative. Therefore, in Figure 1, Ia is positive, Ib is negative and Ic is 0.

Q1Q3Q5IaIbQ2Q4Q6BLDCIcShuntResistorADCINx

Figure 1: Three Phase Power Inverter for a BLDC Motor Drive

In this control scheme, torque production follows the principle that current should flow in only two of the three phases at a time and that there should be no torque production in the region of Back EMF zero crossings. Figure 2 depicts the phase current and Back EMF waveforms for a BLDC motor during the two phases ON operation. All the 6 switching states of the inverter in Figure 1 are indicated in Figure 2 by S1 through S6. As evident from Figure 2, during each state only 2 of the 6 switches are active, while the remaining 4 switches are turned OFF. Again, between the 2 active switches in each state, the odd numbered switch (Q1or Q3 or Q5) are controlled with PWM signal while the even numbered switch (Q2 or Q4 or Q6) is turned fully ON. This results in motor current flowing through only two of the three phases at a time. For example in state S1, Ia is positive, Ib is negative and Ic is 0. This is achieved by driving Q1 with PWM signals and turning Q4 fully ON. This state occurs when the value in the commutation state pointer variable, CmtnPointer, is 0. Table 1 summarizes the state of the inverter switches

Digital Control Systems (DCS) Group

Texas Instruments

4

Technical Background

and the corresponding values of the related peripheral register, the commutation pointer and the motor phase currents.

S1 S2 S3 S4 S5 S6 EaPhase A Ia θ Eb Phase B Ibθ Ec Phase C Ic θ Figure 2: Phase Current and Back EMF Waveforms in 3-ph BLDC Motor control

State CmtnPointer ACTR Q1 Q2 Q3 Q4 Q5 Q6 Ia Ib Ic S1 0 00C2 PWM S2 1 0C02 PWMS3 2 0C20 OFF S4 3 002C OFF S5 4 020C OFF S6 5 02C0 OFF

OFF OFF ON OFF OFF OFF OFF PWM OFF ON PWM OFF ON OFF OFF OFF OFF ON

OFF OFF +ve -ve 0 OFF ON +ve 0 -ve OFF ON 0 +ve -ve OFF OFF -ve +ve 0 PWMOFF -ve 0 +ve PWMOFF 0 -ve +ve Table 1: Commutation States in 3-ph BLDC Motor control

Digital Control Systems (DCS) Group

Texas Instruments

5

因篇幅问题不能全部显示,请点此查看更多更全内容