当前位置:首页 >> 信息与通信 >>

无传感器的BLDC电机控制


it502.com/study 专业单片机,计算机资料网


Hsin-Chu

A Variable-Speed Sensorless System for BLDC Motor
V1.1 – Dec 8, 2005 English Version







19, Innovation First Road Tel: 886-3-578-6005




Science Park Taiwan 300 Fax: 886-3-578-4418 E-mail: mcu@sunplus.com http://www.sunplusmcu.com http://mcu.sunplus.com




R.O.C.



it502.com/study 专业单片机,计算机资料网

A Variable-Speed Sensorless System for BLDC Motor

Important Notice SUNPLUS TECHNOLOGY CO. reserves the right to change this documentation without prior notice. provided by SUNPLUS TECHNOLOGY CO. is believed to be accurate and reliable. TECHNOLOGY CO. makes no warranty for any errors which may appear in this document. Information

However, SUNPLUS Contact SUNPLUS No

TECHNOLOGY CO. to obtain the latest version of device specifications before placing your order.

responsibility is assumed by SUNPLUS TECHNOLOGY CO. for any infringement of patent or other rights of third parties which may result from its use. In addition, SUNPLUS products are not authorized for use as critical

components in life support systems or aviation systems, where a malfunction or failure of the product may reasonably be expected to result in significant injury to the user, without the express written approval of Sunplus.










Sunplus Technology Co., Ltd. PAGE 1 V1.1 – Dec 8, 2005









it502.com/study 专业单片机,计算机资料网

A Variable-Speed Sensorless System for BLDC Motor

Table of Content
PAGE

1

SPMC75F2413A BLDC controller .................................................................................................. 1 1.1 Introduction ................................................................................................................................. 1

2

Position Sensorless Control of BLDC Motor ............................................................................... 5 2.1 BLDC Motor and PWM............................................................................................................... 5 2.2 Position Sensorless Control ....................................................................................................... 7 2.3 Alignment for Absolute Position ................................................................................................. 9 2.4 Position Sensorless Control Flow............................................................................................... 9 2.5 Sensorless BLDC Drive System Implementation ..................................................................... 10

3 4 5

Experimental Results ................................................................................................................... 12 Application Example Code........................................................................................................... 14 Reference....................................................................................................................................... 22












PAGE 2



Sunplus Technology Co., Ltd.



1.2 SUNPLUS SPMC75F2413A Controller Features ...................................................................... 1



V1.1 – Dec 8, 2005

it502.com/study 专业单片机,计算机资料网

A Variable-Speed Sensorless System for BLDC Motor

Revision History
Page Revision Date By Remark Number(s)

V1.0

2004/10/26

First










Sunplus Technology Co., Ltd. PAGE 3 V1.1 – Dec 8, 2005









V 1.1

2005/12/8

Update

it502.com/study 专业单片机,计算机资料网

A Variable-Speed Sensorless System for BLDC Motor

1
1.1

SPMC75F2413A BLDC controller

Introduction

The SPMC75F2413A digital motor controller developed by SUNPLUS is well suitable for wide range of

waveform modulated output and others peripherals that need to be implemented in real product. This application note describes the fundamental theory and control topology of BLDC motor, and the position

Finally, it shows the sensorless is cost and reliability effective in comparison with the hall sensored solution through the experimental results.

1.2

SUNPLUS SPMC75F2413A Controller Features

channels of PWM waveform output and eight channels of duration calculation by input capture function. It equips the u'nSP kernel authored from SUNPLUS with few DSP instructions which can easily do

General-Purpose IO (GPIO), Position Detection Control (PDC) Timer, TPM Timer, Motor Control PWM (MCP) Timer, Compare Match Timer (CMT), Standard Peripheral Interface (SPI), UART, Analog-to-Digital

2K words SRAM memory. Following describes the detail features of SPMC75F2413A. SUNPLUS 16-bit u'nSP processor (ISA 1.2)



Operating voltage: Core: 4.5V~ 5.5V

Operating speed: Maximum 24MHz Operating temperature: -40 On-chip Memory 32KW (32K x 16) Flash 2KW (2K x 16) SRAM On-chip PLL based clock generation Watchdog timer 10-bit analog-to-digital converter 8 multiplexed input channels 10us (100kHz) conversion time Serial communication interface UART ~85







Converter (ADC) and Watchdog Timer (WDT). The memory interface includes 32K word Flash memory and



multiply-accumulate and filter operation. This MCU offers lots of dedicated peripherals such as


PAGE 1

The SUNPLUS SPMC75F2413A is well suitable for digital motor control product, supports up twenty



Sunplus Technology Co., Ltd.



sensorless detection scheme based on position detection control (PDC) timer module on SPMC75F2413A.



variable voltage and variable frequency motor drives. It supports up to two channels of six-independent PWM

V1.1 – Dec 8, 2005

it502.com/study 专业单片机,计算机资料网

A Variable-Speed Sensorless System for BLDC Motor

SPI Up to 64 GPIO pins Power management 2 power-down modes: Wait/Standby Each peripheral can be powered down independently

Five 16-bit general-purpose timers 2 for PWM, 2 for rotor speed capturing, 1 for speed loop

TIO4A-TIO4F

PWM timers support up/down count, compare match output function

TIO1A-TIO1C

TPM Timer channel 2 supports Capture/PWM compare match output function

2-ch Motor drive PWM outputs (3-phase 6-pin complementary PWM outputs) TIO3A-TIO3F work with MCP Timer channel 3, TIO4A-TIO4F work with MCP Timer

Center- or Edge-aligned PWM outputs Temporary PWM outputs shutdown with external overload protection pins

Programmable Dead time control PWM service and fault interrupt generation

The position sensorless control greatly benefits from the PDC Timer module, MCP Timer module, and



speed closed loop timer. The following describes the PDC and MCP Timers: A. PDC Timers Capability to process up to six inputs for capture or hall position input. Or six output for PWM



operation. Six timer general registers (TGRAx/TGRBx/TGRCx, x = 0, 1): three registers for each channel independently assignable PWM or input capture functions. Six timer buffer registers (TBRAx/TBRBx/TBRCx, x = 0, 1) : three registers for each channel used for PWM buffering and capture operation. Selection of eight programmable clock source: six internal clocks (FCK/1, FCK/4, FCK/16, FCK/64, FCK/256, FCK/1024), two external clocks (TCLKA and TCLKB).



Capable of driving AC induction and BLDC motors Embedded In-Circuit-Emulation Circuit



Emergency PWM outputs shutdown with external fault protection pins



channel 4


PAGE 2

Twelve 16-bit PWM outputs



PDC Timer channel 0/1 each supports 3-channel capture input TIO0A-TIO0C and

Sunplus Technology Co., Ltd.



MCP Timer channel 3 supports TIO3A-TIO3F, MCP Timer channel 4 supports


V1.1 – Dec 8, 2005

Two Compare Match Timers

it502.com/study 专业单片机,计算机资料网

A Variable-Speed Sensorless System for BLDC Motor

Programmable of timer operating modes: 1. Timer counting modes: Normal counting mode: continuous up counting. PWM function: selection of 1 output, 0 output at compare match and output hold. Input capture function: selection of issue capture at clock rising, falling, both edge, and position

2. PWM mode:

Three independent PWM output for each channel and can be provided with desired duty ratio.

PWM output for normal and up counting operation. 4. Center-aligned PWM generation mode:

5. Position detection change (PDC) module:

Programmable sample clock source for position signals input: four internal clocks source (FCK/4,

Programmable position sampling mode: selection of sample position when PWM on, regularly, and lower phase are conducting current.

Totally 14 interrupt sources:

One timer period compare match interrupt and counter overflow/underflow interrupt sources.

Position detection changes interrupt sources. Timer buffer operation:

automatically be modified.



independently assignable PWM compare match output functions. Six timer buffer registers (TBRAx/TBRBx/TBRCx, x = 3, 4) : three registers for each channel used for PWM buffering operation. Partial load of duty value of PWM generation problem prevention: provide a load control register to make the duty value for PWM could be load simultaneously. Selection of eight programmable clock source: six internal clocks (FCK/1, FCK/4, FCK/16, FCK/64, FCK/256, FCK/1024), two external clocks (TCLKA and TCLKB). Programmable of timer operating modes:





The input capture register can be consisted of double buffers. The PWM timer general register can

B. MCP Timers Capability to generate up to twelve programmable PWM waveform. Six timer general registers (TGRAx/TGRBx/TGRCx, x = 3, 4): three registers for each channel



Three TGR register compare match interrupt sources.



Programmable sampling count for position signal to avoid glitch affects the position data.


PAGE 3

FCK/8, FCK32 and FCK/128).



PWM output for normal and directional up-down counting operation.

Sunplus Technology Co., Ltd.


V1.1 – Dec 8, 2005

3. Edge-aligned PWM generation mode:



detection change event.

it502.com/study 专业单片机,计算机资料网

A Variable-Speed Sensorless System for BLDC Motor

1.

Timer counting modes:

Normal counting mode: continuous up counting. PWM compare match output function: selection of 1 output, 0 output at compare match and output hold. 2. PWM mode:

3.

Edge-aligned PWM generation mode:

PWM output for normal and up counting operation. 4. Center-aligned PWM generation mode:

Totally 10 interrupt sources, five for each channel: Timer period compare match interrupt. TGRD register compare match interrupt sources. External fault input interrupt. External overload input interrupt. PWM output short protection interrupt.

UVW phases output synchronization source select: synchronized to position data register P_POSx_DectData (x = 0, 1) change, TGRB or TGRC register compare match.

Timer buffer operation:

The input capture register can be consisted of double buffers. The PWM compare match register









can automatically be modified.



PWM duty mode selection: use TGRA or three phase are independent.


PAGE 4


V1.1 – Dec 8, 2005

Sunplus Technology Co., Ltd.





Two independent set of six-phase PWM output can be provided with desired duty ratio.

it502.com/study 专业单片机,计算机资料网

A Variable-Speed Sensorless System for BLDC Motor

2
2.1

Position Sensorless Control of BLDC Motor

BLDC Motor and PWM

The behavior of Brushless-DC (BLDC) motor is something like the DC motor but with help of electrical

permanent magnet, so it provides good motor efficiency in comparison with DC and AC induction motor. The rotor flux generated from permanent magnet can be divided two kinds of waveform: trapezoidal or sinusoidal

and main control methodology is 120-degree square wave PWM modulation. The figure 3-1 depicts the back-EMF waveform with the rotor position signals.







In above figure, the back-EMF zero crossing point and hall position edge signal phase displacement can

be 30 degree lead or lag. The EU, EV and EW signals are the three-phase back-EMF and HU, HV, and HW are the three-phase rotor position signals. The x-axis unit is the electrical degree and every one electrical revolution is 360 degree. The pole-pair of the BLDC motor defines the ratio between the electrical revolution, F and the mechanical revolution, N where F is frequency in Hz and N is the speed in rpm. This is the necessary condition need for 120-degree PWM. There are totally 4 combination of 120-degree PWM waveform: upper-leg switching, lower-leg switching, pre-sixty degree switching and post-sixty degree switching [3]. In this application note, we select the upper-leg switching PWM for waveform generation.




Figure 3-1 Back-EMF vs. hall signals
Sunplus Technology Co., Ltd. PAGE 5 V1.1 – Dec 8, 2005







back-EMF wave shape. In this application note, the controlled motor is chosen as a trapezoidal waveform



commutating phase with transistor devices. There is nearly zero wiring impedance on the rotor due to the

it502.com/study 专业单片机,计算机资料网

A Variable-Speed Sensorless System for BLDC Motor

The three phase voltage of BLDC motor is generated from the inverter circuit in figure 3-2, it behaves as the DC-to-AC conversion. The voltage and frequency of three phases can be modulated by MCP Timers on SPMC75F2413A, commutate phase according the rotor position. In the 120 degree PWM scheme, there are only two transistors device in active state and others are completely shut-down during the same commutation phase. In this example, the ST1 in upper phase performing PWM switching and ST2 in lower phase do

R, inductance L, and back-EMF e.

ST3

ST5 R R

a

ias

Vdc

+
b

ST4
ST6

ST2

Figure 3-2 Inverter stage circuit for 120-degree PWM

connection neutral voltage reference to power ground and Vp is the phase voltage reference to power ground.


Vp RI p

The formula below represents the motor terminal model shown in figure 3-2. The Vn is the star




L dI p dt ep Vn 1 3 Vp 3p1 Vp
PAGE 6


Vn

c

ics

R


L L L
+ +

ST1

eas

ebs ecs

+

For any kind of three phase motor, the sum of stator current and back-EMF are both equal to zero. The

three times faster than per-phase frequency. The following formula depicts the calculation of neutral voltage. (2)



When the specified phase is in non-conducting state, it means no current flow and this phase voltage

can be simplified as follows:



amplitude of neutral voltage of start connection is one-third of per-phase and frequency of neutral voltage is



ep

1 3 Vp 3p1

Thus, with the comparison between non-conducting phase and neutral voltage, we can obtain the back-EMF signal of the phase, and the rotor signal can be directly derived through the figure 3-1.

Sunplus Technology Co., Ltd.


n

turn-on action. The motor current flow is depicts as the blue line. Every wiring phase contains the resistance

(1)

(3)

V1.1 – Dec 8, 2005

it502.com/study 专业单片机,计算机资料网

A Variable-Speed Sensorless System for BLDC Motor

2.2

Position Sensorless Control

The rotor position signals are the necessary condition for achieving the closed-speed control and well electrical phase commutation. Without these signals feedback or incorrect, the motor current gets much larger and unstable. But in some applications field, the mounting of hall sensor is not allowed because of the high temperature or pressure or limited space. So the position sensorless control methodology [4] is need for such application.

Figure 3-3 shows the dedicated position sensorless detection hardware, it is obviously the system cost is highly saving in comparison with hall sensors, and it consist a few of low cost resistance, capacitor and one comparator device. The circuit parameters of this circuit should be well-tuned to suit the specified motor characteristics.

习 学
R115 R120 C78 R125 5 4 R128 C84 2 1 3 + LM339A 2 R133 9 8 R135 + C88 R136 C89 2 1 R137 R138 R139 3 + LM339A 14 C91 C76 IPM-MU IPM-MU R114 R119 + C77 + IC5A 7 6 3 + LM339A 2 1 1 R116


1 2 1 IC5B R126 2 1 IC5C R134 2


+5V R113 P+15V 4 IC25 3 +5V R121 P+15V 4 IC26 3 +5V R130 P+15V 4 IC27 3

HALL-1

C75



HALL-2

C81

C80

IPM-MV

IPM-MV


R124 R127 +

+

C83



HALL-3

C87 +

C86

IPM-MW

IPM-MW





R132

STAGE 1

STAGE 2

STAGE 3

STAGE 4

STAGE 5

Figure 3-4 Position detection circuit for sensorless

The above circuit can be divided into five stage and input signals are connected to the intelligent power module (IPM) device; they are IPM_MU, IPM_MV and IPM_MW. The position detection circuit is three phase independent and parameters are the same, thus we only take care one of three phases, phase U as the example. The stage 1 circuit forms the low pass filter of the incoming high frequency signal and performs the
Sunplus Technology Co., Ltd. PAGE 7 V1.1 – Dec 8, 2005

it502.com/study 专业单片机,计算机资料网

A Variable-Speed Sensorless System for BLDC Motor

voltage divider. The amplitude of phase voltage is range from positive half and negative half of DC-bus voltage. The resistors R114 and R119 reduce the voltage level to acceptable level. The equivalent resistance of R114 and R119 can be formed as a simple low pass filter in combine with C77. This filter also gets rid of high frequency signal due to the PWM switching signals and the output signal of stage 1 is trapezoidal shape reference to power ground. According to the Bode Diagram, the phase of output waveform will be lag 90

The circuit of stage 2 forms a high pass filter of filtering the DC component of stage 1 output signal. There is no PWM carrier signal at the output of this stage and signal is reference to a dc-offset not the power

basically the same as output of stage 2.

To get the neutral voltage signal of star-connection, stage 4 circuit do this task. The pseudo star

feed into the negative input of comparator device. The capacitor is C91 is used to filter the noise of neutral voltage signal. The amplitude and frequency of neutral voltage is one-third and three times faster in

comparator is depicts as figure 3-5.







The signal Vn in figure 3-5 is the neutral voltage, and Eu', Ev' and Ew' are the three phase pseudo back-EMF signals. Through the output of comparator device, we can obtain emulated position signal of BLDC motor. The output signal of stage 5 also includes the transfer the comparator signal through an isolated opto-coupler. The signals HALL-1, HALL-2, and HALL-3 do not actually match the position signal of BLDC motor. It has the inverse polarity and different phase match characteristics [3]. Also note that, this circuit is based on the back-EMF information to detect the rotor position. Thus, it is not possible to get the emulated rotor position at stalling state. The back-EMF voltage is induced when motor is in rotating state, the



Figure 3-5 Phase relationship between comparator inputs


Sunplus Technology Co., Ltd. PAGE 8 V1.1 – Dec 8, 2005



comparison of one phase voltage signal, respectively. The phase relationship between two inputs of



connection is formed by paralleling the three phase resistor R137, R138 and R139, and the neutral voltage is



ground. The stage 3 performs a further simple low pass filter of stage 2 output signal. The waveform shape is



degree in comparison with IPM_MU.

it502.com/study 专业单片机,计算机资料网

A Variable-Speed Sensorless System for BLDC Motor

faster of speed will result in larger back-EMF depend on coefficient Ke, and vice versa. So we need to let the motor running without position signals feedback and called in forced-commutating phase. After the electrical speed of rotor is ten times faster than the cut-off frequency of stage 1, there will be 90 degree shift and we should able to get the emulated position signal at opto-coupler output. The PDC Timers module can detect the position signal and select different position sampling condition to suit ones application [1].

2.3

Alignment for Absolute Position

Before the BLDC motor start to enter the forced-commutating phase, there should be a short period to let the rotor align to the user defined position. It is because we do not know the rotor position when motor is completely stopped. This methodology is achieved by applying PWM signals from MCP Timer onto one upper phase and one lower phase with certain time. The motor current will rise from zero and saturated at a level depend on applied voltage amplitude and motor's electrical time constant. It is obviously the motor current will be controlled fine at defined level when we implement a current loop controller. Different motor characteristics and load condition should be mapping to different alignment time and voltage in order to produce enough electrical torque to align at specified location.

2.4

Position Sensorless Control Flow

Figure 3-6 shows the state transition when motor is from stalling to running. First, the system driver needs to charge the bootstrap voltage in order to supply the upper phase a gate source. It is implemented by turn on all the transistor device at lower phase simultaneously with a certain time to meet the charging parameters of bootstrap circuit. Then make the rotor align to a user defined location. After all these action done successfully, one needs to make the motor start to run to an specified open loop speed without position feedback. This is achieved by increasing the PWM duty ratio value and change the pseudo position signal in





system driver. When the motor rotates and able to sample correct position signal for several times, ones can switch from non-position feedback condition to position feedback rotating state. At this stage the speed can be well controlled and also the commutating phase.








PAGE 9



Sunplus Technology Co., Ltd.




V1.1 – Dec 8, 2005

it502.com/study 专业单片机,计算机资料网

A Variable-Speed Sensorless System for BLDC Motor

Enable the Motor Drive

charge the bootstrap circuit Yes

charge time expired ?

No

Yes align the rotor to defined location

机 片
Yes

Forced commutating phase without position



Figure3-6 Position sensorless control flow



2.5

Sensorless BLDC Drive System Implementation



The position sensorless scheme is based on detection of back-EMF zero crossing point. The point of back-EMF zero crossing is generated when one of the three phase windings is not powered. When such point is detected, the corresponding commutating phase action should be happened. The isolated position signals from figure 3-4 are connected to TIO0A, TIO0C and TIO0C pins of PDC Timer 0. When a position detection change interrupt occurred, one can calculate the duration of input position to make sure if enter the synchronous state. The MCP Timer 3 output PWM waveform according to the position signal fetch from PDC Timer 0. The PWM waveform is programmable through P_TMR3_DeadTime and P_TMR3_OutputCtrl registers. There are totally eight waveform combinations in 120-degree PWM: upper-leg switching, lower-leg


Yes synchronous with correct position ? No speed closed loop running

align Time Expired


No

Sunplus Technology Co., Ltd.

PAGE 10


V1.1 – Dec 8, 2005



it502.com/study 专业单片机,计算机资料网

A Variable-Speed Sensorless System for BLDC Motor

switching, pre-sixty switching, post-sixty switching, upper-leg switching with dead-time, lower-leg switching with dead-time, pre-sixty switching with dead-time and post-sixty switching with dead-time. Figure 3-7 shows the system implementation block diagram.

220V 50 / 60Hz

+ BLDC

+ -

PDC 0 Timer

+ -

+ -

UART











Figure 3-7 Position sensorless control implementation


PAGE 11


DMC Toolkit

Sunplus Technology Co., Ltd.


SPMC75F 2413A


MCP 3 Timer

V1.1 – Dec 8, 2005

it502.com/study 专业单片机,计算机资料网

A Variable-Speed Sensorless System for BLDC Motor

3

Experimental Results

The control terminal is done through the DMC Toolkit [5][6] running on PC. When user presses the "motor 1 start" icon, the BLDC motor will start to move. In figure 4-1, the first action of motor drive is output a PWM signal to let the rotor align to the specified current. The phase current starts to rise and saturated at about 1.8A. When rotor is stalled at pre-defined location, motor drive inhibits all PWM signals output to release the motor current. If longer alignment time and without release phase current action, it may damage the motor drive board someday. After release phase, the motor drive board enters the forced commutating

speed, fetch the position signals fetched by back-EMF circuit to determine when to enter normal running phase.

Forced Commutating phase alignment phase release phase

The figure 4-2 shows the motor current waveform versus the position signal generated from figure 3-4

phase. The motor speed is 3000 rpm and from the position and current response, it shows good performance compared to hall sensor signals feedback condition.







circuit. The rising edge and falling edge of hall signal is the action point of commutating current of specified



Figure 4-1 Phase current when motor starts to move (5A/div)

Figure 4-2 Motor current and emulated position signal




PAGE 12 V1.1 – Dec 8, 2005

Sunplus Technology Co., Ltd.





phase. The motor current will become larger when speed increases. After motor is rotating above the certain



it502.com/study 专业单片机,计算机资料网

A Variable-Speed Sensorless System for BLDC Motor

The emulated position signal from sensorless circuit, there may exist certain noise on the rising and falling edge of the position signal. In figure 4-3, the glitch interval is about 144us. If there is no filter circuit to remove the glitch, the high-low transition may result in wrong phase commutation and incorrect speed information. In the PDC timer module of SPMC75F2413A, the position sampling clock, counter and condition are all programmable. In such condition, user only needs to setup the SPLCK, SPLMOD, and SPLCNT to be

Figure 4-3 Glitch on the position signal

programmable from the MCP timer module on SPMC75F2413A. The figure 4-4 shows the pre-sixty 120-degree PWM waveform without dead-time. Different waveform output is achieved by setting the

register.









DUTYMODE, POLP, WPWM, VPWM, UPWM, UOC, VOC and WOC bits in P_TMRx_OutputCtrl (x = 3, 4)

Figure 4-4 Pre-sixty PWM vs. position signal at 3000 rpm



The eight possible PWM waveform combination of 120-degree conduction topology are all


PAGE 13


Sunplus Technology Co., Ltd. V1.1 – Dec 8, 2005





able to remove this kind of glitch.

it502.com/study 专业单片机,计算机资料网

A Variable-Speed Sensorless System for BLDC Motor

4

Application Example Code

The following sample codes are developed by SUNPLUS and the control terminal is done through DMC Toolkit. The motor drive kernel API function can be reference to document [7]. In Spmc75_irq3.c, the function MC75F_MCP3_OptoMotorDrv function is used to do the position sensorless control. And in Spmc75_irq1.c, the

/* ========================================================================= */ /* File Name */ /* Project */ : AN_SPMC75_0009 : Spmc75_main.c

/* Description : main entry function of C programming */ /* Processor */ /* Author */ /* Date /* Tools */ /* Version */ /* Security */ : Chih ming Huang : SPMC75F2413A

: October 2004




*/
PAGE 14 V1.1 – Dec 8, 2005

: u'nSP IDE tools v1.16.1

/* E-Mail





*/

/* ========================================================================= */ #include "Spmc75_regs.h" #include "unspmacro.h" #include "Spmc75_control_ext.h" #include "Spmc75_dmc_uart_ext.h"

extern void DMCAPI_bTask(void);

int main(void) {

Sunplus Technology Co., Ltd.





: 1.00

: Confidential Proprietary

: MaxHuang@sunplus.com.tw







function MC75F_TPM_PDCFilter captures the interval duration and calculation the motor speed.

it502.com/study 专业单片机,计算机资料网

A Variable-Speed Sensorless System for BLDC Motor

Disable_FIQ_IRQ(); // MC75F_SFR_Init(); MC75F_Setup_DrvEn(P_IOB_Data_ADDR, 14); MC75_DMC_UART_Setup(14400); /* initialize IO and timer */ /* IOB.14 is driver enable pin */

P_TMR1_INT->B.PDCIE = 0; // INT_FIQ_IRQ(); MC75F_TPM_TimerStart(PDC0_TMR_ID); MC75F_TPM_TimerStart(MCP3_TMR_ID); MC75F_TPM_TimerStart(TPM2_TMR_ID);

MC75F_BLDC_Waveform_Set(BLDC1_ID, BLDC_WAVE_1, PWM_ACTIVE_HI); /* setup for MCP3, pre-60 120 degree PWM, PWM is active high */

MC75F_Set_SpdACC(BLDC1_ID, 500);


PAGE 15

for(;;) {

MC75_DMC_UART_Service(); DMCAPI_bTask(); }

return (1); }

/*****************************************************************************/



/* DMCAPI_bTask() : DMC tools API background task









/* acc/dec 500 rpm/sec */



/* enable FIQ/IRQ channel interrupt */ /* start TMR0 */ /* start TMR3 */ /* start TMR2 */

/*****************************************************************************/ void DMCAPI_bTask(void) { Int16 n; UInt16 m1, m2 = 0;



/* check motor run/stop signal command */ if(SPMC_DMC_Load_MotorSig(1)) MC75F_TPM_Motor_Start(BLDC1_ID); /* polling motor 1 run or stop */ /* start the motor */

Sunplus Technology Co., Ltd.


*/

V1.1 – Dec 8, 2005

it502.com/study 专业单片机,计算机资料网

A Variable-Speed Sensorless System for BLDC Motor

else { MC75F_TPM_Motor_Stop(BLDC1_ID); MC75F_ClearAlarm(); } /* stop the motor */

n = MC75F_TPM_GetSpeed(BLDC1_ID); if(n > 0) SPMC_DMC_Save_SpdNow(1, n);

n = SPMC_DMC_Load_SpdCmd(1); if(n > 0) MC75F_TPM_SetSpeed(BLDC1_ID, n);

n = MC75F_TPM_GetSpeedRef(BLDC1_ID); if(n > 0) SPMC_DMC_Save_Aux(0, n);


PAGE 16

/* setup Kp and Ki */

n = SPMC_DMC_Load_Aux(0); if(n > 0)





/* setup speed command */

/* save speed command to R0 */

MC75F_Set_SpdKp(BLDC1_ID, n);

n = SPMC_DMC_Load_Aux(1); if(n > 0)







m1 = P_TMR3_TPR->W; m2 = P_TMR3_TGRA->W;

SPMC_DMC_Save_Aux(1, 100 - EASYDIVU_32_16((100L * m2), m1)); /* display duty ratio on R1 */



MC75F_Set_SpdKi(BLDC1_ID, n);

SPMC_DMC_Save_SpdNow(2,(MC75F_TPM_GetSpeedRef(BLDC1_ID)MC75F_TPM_GetSpeed(BLDC1_ID))); /* display speed error on Speed2_Now */ } /* DMCAPI_bTask() */

Sunplus Technology Co., Ltd.



/* display current speed to Speed1_Now */



/* W0 = Kp */

/* W1 = Ki */

V1.1 – Dec 8, 2005

it502.com/study 专业单片机,计算机资料网

A Variable-Speed Sensorless System for BLDC Motor

Listing 51 Spmc75_main.c

In Listing 5-1, the communication speed is setup through MC75_DMC_UART_Setup function and is 14400 bps. The waveform for driving the BLDC motor is programmed as pre-60 120-degree PWM conduction type and in motor development board chooses a high active IPM (Intelligent Power Module)

DMCAPI_bTask function, it performs the background task for DMC Toolkit. This function is polling the motor run or stops status command from the DMC Toolkit, and always receives the speed command from the

BLDC motor, and will be controlled well by calling MC75F_TPM_SpdCalcCtrl in Spmc75_irq4.c interrupt service routine. The speed command and actual speed value will be display on User_R0 and Speed1_Now

windows.

/* ========================================================================= */ /* File Name */ /* Project */ : AN_SPMC75_0009 : Spmc75_irq6.c

/* Description : IRQ6/FIQ definition of C programming */ /* Processor */ /* Author */ /* Date

: SPMC75F series





: Chih ming Huang

: October 2004




*/
PAGE 17 V1.1 – Dec 8, 2005

/* Tools */

: u'nSP IDE tools v1.16.1



/* Version

: 1.00

*/

/* Security

: Confidential Proprietary



*/ /* E-Mail */ /* ========================================================================= */ #include "Spmc75_dmc_uart_ext.h" : MaxHuang@sunplus.com.tw

/*****************************************************************************/

Sunplus Technology Co., Ltd.



control variables, respectively. Developer can well tune the speed performance from observing the charting



monitoring window of DMC Toolkit. The speed command will be used for the reference rotating speed of the



device. All of these requirements in software are achieved by MC75F_BLDC_Waveform_Set function. In

it502.com/study 专业单片机,计算机资料网

A Variable-Speed Sensorless System for BLDC Motor

/* UART_RXINT_ISR() : UART receive buffer full interrupt */ /*****************************************************************************/ void UART_RXINT_ISR(void) {

} /* UART_RXINT_ISR() */ Listing 5-2 Spmc75_irq6.c

In Listing 5-2, the function MC75_DMC_RcvStream does the receiving message from the DMC Toolkit. It requires the IRQ6 interrupt hardware resource on the SPMC75F2413A chip and is enabled from the

/* ========================================================================= */

*/ /* Project */ : AN_SPMC75_0009

/* Description : IRQ1/FIQ definition of C programming */ /* Processor */ /* Author */

/* Date





: SPMC75F series

: Chih ming Huang

: October 2004




*/ */
PAGE 18 V1.1 – Dec 8, 2005

/* File Name

: Spmc75_irq1.c

/* Tools */

: u'nSP IDE tools v1.16.1



/* Version

: 1.00

*/

/* Security /* E-Mail

: Confidential Proprietary : MaxHuang@sunplus.com.tw



*/ /* ========================================================================= */ #include "Spmc75_regs.h" #include "Spmc75_dcspeed_ext.h" #include "Spmc75_control_ext.h"

Sunplus Technology Co., Ltd.



MC75_DMC_UART_Setup function.





MC75_DMC_RcvStream();

it502.com/study 专业单片机,计算机资料网

A Variable-Speed Sensorless System for BLDC Motor

/*****************************************************************************/ /* PDC0_PDCINT_ISR() : PDC0 position detection change interrupt */

/*****************************************************************************/ void PDC0_PDCINT_ISR(void) {

} /* PDC0_PDCINT_ISR */ Listing 5-3 Spmc75_irq1.c

The Spmc75_irq1.c does the duration calculation of three-phase hall signals and this information is used for speed control of BLDC motor.

/* ========================================================================= */ /* File Name */ /* Project */ : AN_SPMC75_0009 : Spmc75_irq3.c

*/ /* Processor */ /* Author */ /* Date

: SPMC75F series



: Chih ming Huang

/* Tools */

/* Version



*/

/* Security

*/



/* E-Mail */

/* ========================================================================= */ #include "Spmc75_regs.h" #include "Spmc75_control_ext.h"

unsigned int



: October 2004



/* Description : IRQ3/FIQ definition of C programming


PAGE 19





: u'nSP IDE tools v1.16.1

: 1.00

: Confidential Proprietary

: MaxHuang@sunplus.com.tw

ph_slice = 0;

Sunplus Technology Co., Ltd.


*/
V1.1 – Dec 8, 2005

MC75F_TPM_PDCFilter(PDC0_PDC_ID);

it502.com/study 专业单片机,计算机资料网

A Variable-Speed Sensorless System for BLDC Motor

/*****************************************************************************/ /* MCP3_TPRINT_ISR() : MCP3 period interrupt */ /*****************************************************************************/ void MCP3_TPRINT_ISR(void)

MC75F_MCP3_OptoMotorDrv();

/* sensorless MCP3 drive */

MC75F_TPM_Monitor(); else if(ph_slice == 1) MC75F_TPM_Update();

/* command filter function */

ph_slice = ++ph_slice & 0x1;

} /* MCP3_TPRINT_ISR() */

Listing 5-4 Spmc75_irq3.c

In actual motor drive condition, the PWM waveform according to rotor position signal is generated by MC75F_MCP3_OptoMotorDrv function. The active or inactive the output command to IPM device is

is active from calling the MC75F_TPM_MotorStart function, the duty ratio of PWM waveform is determined by MC75F_MCP3_OptoMotorDrv function.

/* ========================================================================= */

/* File Name



*/

/* Project

*/



/* Description : IRQ4/FIQ definition of C programming */ /* Processor */ /* Author */ /* Date : October 2004 : Chih ming Huang : SPMC75F series





monitored from MC75F_TPM_Monitor and MC75F_TPM_Update functions. When the motor run command

: Spmc75_irq4.c

: AN_SPMC75_0009




PAGE 20



/* phase slice counter from 0 to 1 */

Sunplus Technology Co., Ltd.



if(ph_slice == 0)

/* motor drive monitor */



{

V1.1 – Dec 8, 2005

it502.com/study 专业单片机,计算机资料网

A Variable-Speed Sensorless System for BLDC Motor

*/ /* Tools */ /* Version */ : 1.00 : u'nSP IDE tools v1.16.1

*/ /* E-Mail */ : MaxHuang@sunplus.com.tw

/* ========================================================================= */ #include "Spmc75_regs.h" #include "Spmc75_dcspeed_ext.h" #include "Spmc75_control_ext.h"

Unsigned int iii = 0;

/************************************************************************** ***/

/* TPM2_TPRINT_ISR() : TPM2 period interrupt */

/************************************************************************** ***/

void TPM2_TPRINT_ISR(void) {

if(iii == 0)



} /* TPM2_TPRINT_ISR() */ Listing 5-5 Spmc75_irq4.c



The speed control algorithm is done through MC75F_TPM_SpdCalcCtrl function. The sampling period of TPM2 timer in this listing is 1.0 KHz. The function MC75F_TPM_GetSpeed will return the actual speed of BLDC motor with rotating direction.



MC75F_TPM_SpdCalcCtrl(BLDC1_ID);

iii = ++iii & 0x01;






PAGE 21


V1.1 – Dec 8, 2005

Sunplus Technology Co., Ltd.





/* Security

: Confidential Proprietary

it502.com/study 专业单片机,计算机资料网

A Variable-Speed Sensorless System for BLDC Motor

5

Reference

[1] SUNPLUS, "SPMC75F2413A Programming Guide V1.40". [2] SUNPLUS, "SPMC75F2413A 16-bit Microcontroller with 2-channel Motor Driver Data Sheet". [3] Hitachi, "Technology of Small Motor". [4] Satoshi Ogasawara and Hirofumi Akagi, "An Approach to Position Sensorless Drive for Brushless dc Motors", IEEE Trans., Indus., Appli., vol. 27, no. 5, pp.928-933, Sep./Oct. 1991.

[5] SUNPLUS, "Real Time Development of Motor Control Application Using the Visualization DMC Toolkit". [6] SUNPLUS, "DMC Toolkit Library APIs Usage" [7] SUNPLUS, "BLDC Motor Drive API".










Sunplus Technology Co., Ltd. PAGE 22 V1.1 – Dec 8, 2005









相关文章:
无位置传感器BLDC电机驱动系统软件设计
无位置传感器BLDC电机驱动系统软件设计_电子/电路_工程科技_专业资料。无位置传感器BLDC电机驱动系统软件设计的英文文献毕业设计(论文)任务书题目 学生 姓名 李继军 无...
BLDC电机控制算法
在采有 BLDC 电机时,冰箱和空调 压缩机也需要无传感器控制。 死区的插入和补充许多不同的控制算法都被用以提供对于 BLDC 电机的控制。典型地,将功率晶体管用作...
BLDC电机控制算法_图文
在采有 BLDC 电机时,冰箱和空 调压缩机也需要无传感器控制。 死区的插入和补充 许多不同的控制算法都被用以提供对于 BLDC 电机的控制。典型地,将功率晶体 管用...
无位置传感器BLDC换相检测方法研究毕业设计开题报告
(3)无位置传感器 BLDC 换相检测方法研究的意义 有位置传感器相较于无位置传感器控制无刷直流电机,其自身缺点有: ①安装位置传感器会增大了电机的体积。安装位置...
无位置传感器BLDC换相检测方法研究毕业论文
无位置传感器BLDC换相检测方法研究毕业论文_工学_高等教育_教育专区。毕业论文,...电机以电子控制线路代替机械电刷和换向器实现直流电机的换相, 集 有刷直流电机...
无刷直流(BLDC)电机的构造原理及电源控制方案
运转无噪音 ? 较高的转速范围 此外,由于输出转矩与电机体积之比更高,使之在...器件应用网 霍尔传感器 和有刷直流电机不同,BLDC 电机的换向是以电子方式控制的...
...-完整的无传感器无刷直流电机控制解决方案
Silicon Labs参考设计帮助开发人员在5分钟内转动电机 -完整的无传感器无刷直流电机...BLDC )电机控制参考设计,它特别针对采用 Silicon Labs C8051F85x/6x 微控制器...
BLDC电机控制算法(瑞萨)
无传感器 BLDC 控制省去了对于霍尔传感器的需要,而是采用电机的反电 动势 (电动势) 来预测转子位置。 无传感器控制对于像风扇和泵这样的低成本变速应用至关重要。...
哈工大开题报告-无位置传感器BLDC驱动系统的变负载他控...
哈工大开题报告-无位置传感器BLDC驱动系统的变负载他控特性研究_能源/化工_工程...2.4 永磁同步电动机的控制策略任何电动机的电磁转矩都是由主磁场和电枢磁场相互...
无传感器的直流无刷电机控制器ML4435及其应用
关键词:三相直流无刷电机;无传感器;反电势取样器 ML4435 是 2001 年 3 月最新推出的电机控制器专用 IC,属于无传感器型、直流无刷(BLDC) 电动机控制系统,它比 ...
更多相关标签: