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 #75 background imageLoading...
Page #75 background image
CHAPTER 4 PROGRAM LIST
Application Note U17209EJ1V0AN
78
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 = TM3 ;
TUC00 = 0x02 ; /* Clear PWM output prohibition */
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] ;
} else {
wk = ccw_data[ init_pat++ ][0] ;
}
if ( wk & 0x01 ) {
BFCM00 = 0 ;
BFCM01 = PWM_INIT ;
BFCM02 = PWM_INIT ;
} else if ( wk & 0x04 ) {
BFCM00 = PWM_INIT ;
BFCM01 = 0 ;
BFCM02 = PWM_INIT ;
} else {
BFCM00 = PWM_INIT ;
BFCM01 = PWM_INIT ;
BFCM02 = 0 ;
}
POER0 = wk ;

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