EasyManuals Logo

Renesas V850 Series User Manual

Renesas V850 Series
186 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #127 background imageLoading...
Page #127 background image
CHAPTER 4 PROGRAM LIST
Application Note U17209EJ1V0AN
130
signed int o_vua, o_vva, o_vwa ;
signed int o_vda, o_vqa ;
/* */
/****************************************************************************** /
/* Calculation processing of speed and rotor position */
/****************************************************************************** /
fcalcu( &wrm, &trm ) ;
sum_speed += ( wrm * TH_U / RPM_RADS ) ; /* Radian -> rpm */
if ( --speed_co == 0 ) {
speed_co = 100000 / TS ; /* Set 100 mSEC counter value */
now_speed = sum_speed / speed_co ;
sum_speed = 0 ;
}
wrm = now_speed * RPM_RADS / TH_U ;
wre = wrm * P ;
tre = ( trm * P + OFFSET ) % RAD ;
if ( ( stop_flag == OFF ) && ( error_flag == 0 ) ) {
s_time = TP1CNT ;
HZA0CTL0 |= 0x04; /* PWM output on */
OUT_data( WRESET, 0 ) ; /* Reset watchdog timer */
/****************************************************************************** /
/* Initial revolution processing */
/****************************************************************************** /
if ( init_flag ) {
cow = init_upco ;
if ( cow > 4 ) cow = 4;
if ( ++init_co > ( (long)up_data[ cow ] * 34000L / ( SPEED_INIT * TS ) ) ) {
init_co = 0 ;
if ( init_flag == 2 ) {
wk = cw_data[ init_pat ][0] ;
wk2 = cw_data[ init_pat++ ][1] ;
} else {
wk = ccw_data[ init_pat ][0] ;
wk2 = ccw_data[ init_pat++ ][1] ;
}
TQ0CCR1 = PWM_INIT ;
TQ0CCR2 = PWM_INIT ;
TQ0CCR3 = PWM_INIT ;
TQ0IOC0 = wk ;
TQ0IOC3 = wk2 ;
if ( init_pat >= 6 ) {
init_pat = 0 ;
if ( init_upco > 14 ) {
init_flag = 0 ;
} else {
init_upco++ ;

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Renesas V850 Series and is the answer not in the manual?

Renesas V850 Series Specifications

General IconGeneral
BrandRenesas
ModelV850 Series
CategoryInverter
LanguageEnglish