Home
        M16C/Tiny Sensor-less PMSM Driving Platform by 120
         Contents
1.                                                                                                    NEC                                                      2010     4     1                                                                                                                                                                                                                                                                                                                                                                              http   www renesas com    201044 H1H                            EIT  m ETAT  Chttp   www renesas com      DLA  http   www renesas com inguiry        KENESAS       8     10     11     12     Notice    All information included in this document is current as of the date this document is issued  Such information  however  is  subject to change without any prior notice  Before purchasing or using any Renesas Electronics products listed herein  please  confirm the latest product information with a Renesas Electronics sales office  Also  please pay regular and careful attention to  additional and different information to be disclosed by Renesas Electronics such as that disclosed through our website     Renesas Electronics does not assume any liability for infringement of patents  copyrights  or other intellectual property rights  of third parties by or arising from the use of Renesas Electronics products or technical information described in this document
2.                                                    re       Switch the output pattern 30  degree after the zero crossing  of the induced voltage                Figure 3 1 1 Time Charting    RSBJEUMO0001 0101 Rev  1 01             ae          Calcultation the actual rotation speed  from intervals between zero crossings  of the induced voltages               RENESAS    VCC       Figure 3 1 2 Three phase IGBT inverter circuit    In the 120 degree trapezoidal communication mode  three phase IGBT circuit turn on sequence  is UpWn    WnVp   VpUn    UnWp    WpVn   VnUp  two IGBT are conducted every 60 electrical  degrees  Accordingly  PWM wave have 6 output pattern switching  It is shown as the figure 3 1 1  and figure 3 1 2   Output pattern is switched when motor rotor angles 60 electrical degree every time   Zero crossings of the induced voltages is at the mid of each output pattern  30 electrical degree    In this program  the function of output pattern switching is carried out by PFCR register of  M16C62A  It can control each bit in the PFCi  i 0 to 5  to enable each one of three phase PWM  output pins  When setting the PFCi  i 0 to 5  to  0   three phase PWM output pin functions act as  I O port and can output    H    level state and    L    level state    In order to outputting PWM wave when motor rotor angles 360 electrical degrees  PFCR register  should be set based the following table                                Wn Wp Vn Vp Un Up  X X PFC5 PFC4 PFC3 PFC2 PFC1 PFCO   Patt
3.                    Figure 3 1 3 Detection of zero crossing of induced voltage and comparator output  The output pattern of the MCU depends on position information of induced voltages  The  voltages output by the inverter are compared with half the bus voltage  and the results are fed to  the MCU  The following table shows the connection between MCU pins and induced voltage                signals   Input pin BEMF signal  P1   INT3 V  BEMF  P1   INT4 W  BEMF  P1   INT5 U BEMF          Table 3 1 3 the connection of input pin and induce voltage    RSBJEUMO001 0101 Rev  1 01    11      RENESAS    In our program  when motor mode changes into turnon mode  TB1 interrupt is enabled  after the  next carrier wave cycle interrupt  motor woke mode become run mode  Every 50us  TB1  interrupts  If the TB1 interrupt request bit is set to 1  after another 50us  the TB1 interrupt request  bit is still set to 1  the zero crossing of induced voltages is detected  and it is at the mid point  30  electrical degrees  of each output pattern  Switching of the output pattern is delayed by 30  electrical degrees from zero crossing detected  The process avoid occurring wrong pulses to be  mistaken the detection of zero crossing of induced voltages because of motor demagnetization  at the point of output pattern switching  The U phase processing is shown as figure 3 1 2   When motor work mode changes into stop mode  tb1s is set to  0   TB1 interrupt stops but  interrupt enable is still open  The detectio
4.     Yes    V                BootstrapPWM processing             No                 g OutputMode  lt M TURNO       Yes    V       TurnonPWM processing                                  g OutputMode M RUN    Yes                      RunPWM processing                   a      RTI            Rev  1 01    22      RENESAS    4 5 Bootstrap Processing       BootstrapPWM      k          IDBO  lt  0x3f    IDB1   0x00    generate 3 phase PWM  p8_0   INACTIVE_LVL pd8_0   1   p8_1   INACTIVE_LVL pd8_1    p7_2   INACTIVE_LVL pd7_2  p7_3   INACTIVE_LVL pd7_3  p7_4   INACTIVE_LVL pd7_4  p7_5   INACTIVE_LVL pd7_5    1  1  1  1  1                s BootstpStep  lt  3              k          TPRC  1    PFCR register wirte enable  PFCR  PFCRTbIBoot s_BootstpStep    output  PWM wave             g_OutputMode   Turnon mode  s BootstpStep   0  s BootstpCnt   0                s_BootstpCnt  lt  400      Yes          s BootstpCnt  1             5 BootstpCn  0  s BootstpStep 1                    lt        Timer value  M CARR CNT        BootsrapeDuty  SINT 32 M CARR CN                T   gt  gt 15   Set timer values  Timer A4 register   timer value    Timer A1 register   timer value  Timer A2 register   timer value       v          StopCheck processing             Stop Reguested             g OutputMode   M TURNOFF                   RTS          RSBJEUMO0001 0101 Rev  1 01    23       RENESAS    4 6Turn on Processing       TurnonPWM       v  INI PWM DUTY       g PWMDuty M                         g PWMDuty 
5.    No license  express  implied or otherwise  is granted hereby under any patents  copyrights or other intellectual property rights  of Renesas Electronics or others     You should not alter  modify  copy  or otherwise misappropriate any Renesas Electronics product  whether in whole or in part     Descriptions of circuits  software and other related information in this document are provided only to illustrate the operation of  semiconductor products and application examples  You are fully responsible for the incorporation of these circuits  software   and information in the design of your equipment  Renesas Electronics assumes no responsibility for any losses incurred by  you or third parties arising from the use of these circuits  software  or information     When exporting the products or technology described in this document  you should comply with the applicable export control  laws and regulations and follow the procedures required by such laws and regulations  You should not use Renesas  Electronics products or the technology described in this document for any purpose relating to military applications or use by  the military  including but not limited to the development of weapons of mass destruction  Renesas Electronics products and  technology may not be used for or incorporated into any products or systems whose manufacture  use  or sale is prohibited  under any applicable domestic or foreign laws or regulations     Renesas Electronics has used reasonable care in pre
6.    lt     RSBJEUM0001 0101 Rev  1 01 32      RENESAS           v  g PreDItCnt   s DItCnt                      v  g ReloadCnt   s DItCnt  gt  gt  1  s DItCnt  0                    g SpeedTgt  gt  088g DItCntRe  g PreDltCnt          g PWMDuty   1                g SpeedTgt  gt  088g DItCntRef gt   g PreDltCnt       g PWMDuty   1                      g PWMDuty  gt M Max PWM duty           g PWMDuty  M Max PWM duty                No       g PWMDuty  lt M Min PWM duty           g PWMDuty  M Min PWM duty    h    Save current PWM duty and actual rotation  speed    v  C RTS p                                  RSBJEUM0001 0101 Rev  1 01    33      RENESAS    4 12 Calculate Rotation Speed Command Processing       C CalSpeedCnd      v    Rotation speed command input value    AD vaule M K SPEED AD_REF 2 11             V    s ADSum  Rotation speed command input          v    Average calculation counter 1                          Average calculation counter gt  16            s ADSpeed s ADSum 16  s ADSum 0  Average calculation counter 0                    lt     y    Return value 5 ADSpeed                   V      RTS            RSBJEUMO0001 0101 Rev  1 01    34    Notes regarding these materials    1  This document is provided for reference purposes only so that Renesas customers may select the appropriate  Renesas products for their use  Renesas neither makes warranties or representations with respect to the  accuracy or completeness of the information contained in this document nor grants
7.    s ReloadStg  0  Int counter  0  Int4ic 0        lt          No                V  Int3ic 0  Int5ic 0                 gt  lt               s ReloadCnt  gt 0        s ReloadCnt  1                    Rev  1 01                     RENESAS    RSBJEUM0001 0101        s ReloadCnt  0           g Stage  s ReloadStg              g Stage   0      v Yes          Output Wn phase PWM wave                      v Yes          Output Vp phase PWM wave                   Yes  v          Output Un phase PWM wave                   v Yes          Output Wp phase PWM wave                            Output Vn phase PWM wave                            Output Up phase PWM wave           gt   V       TPRCO 1    PFCR PFCRTbl g Stage           v          int4ic  amp   0x00  int3ic  amp   0x00  intdic  amp   0x00                P             RTS       Rev  1 01    31    RENESAS    4 11 PWM Duty Calculation Processing       CalPWMDuty       V  g DItCntRef  lt Tgt DIt Conv  g TargetCnt 12                    No    Yes       s DItCnt   13                       No         SpeedAct  gt  certain rotation speed     CalCnt  gt  12                                                            v Yes CalCnt  gt  12    CalCnt 0 Yes  v  v CalCnt 0  g DItCntArray CalCnt    s_DltCnt   lt   V  v g DItCntArray CalCnt    s DItCnt  CalCnt 1  v  v CalCnt 1  g AvrDItCnt  g DItCntArray i    i  0 to             CalCnt   g AvrDItCnt    12  s DItCnt   g AvrDItCnt       V  g SpeedAct Dit Act Conv s DItCnt  13                        
8.  0  A D control register 1 0x2b  Vref connect  ANO to   AN7  10bit  A D control register 2 0x05  Sample amp Hold  PO       v          RSBJEUM0001 0101    Enable Interrupts  I falg  1              v    RTS            Rev  1 01    20      RENESAS    4 3 Turn off Processing             C TurnoffPWM  Stop TB1  TA4  TA1 TA2      M CARR CNT    M MIN DUTY 120    SINT 32 M CARR CNT   gt  gt  2415   II Set time value   IDBO   Ox3f   IDB1   0x00    generate 3 phase PWM  Protect register   0x02   INVCO    0x08    output enable   Protect register   0x00    Y    p8 0  lt  INACTIVE LVL pd8 0  p8 1   INACTIVE LVL pd8 1  p7 2   INACTIVE LVL pd7 2  p7 3   INACTIVE LVL pd7 3  p7 4   INACTIVE_LVL pd7_4   1  p7 5   INACTIVE LVL pd7 5 1          ou IN IN  aa am om       V  TPRC  1   PFCR register wirte enable  PFCR  0   not output PWM wave    g SpeedCnd   0     Yes                             s StopMode 0       V  g SpeedCnd  lt 0                    lt             OutputMode  Turnoff mode               Yes    g SpeedCnd  gt  0      Yes       g OutputMode  Bootstrap mode   g MotTheta  0   s StopMode 1   Startup control counter 0   Actual rotation speed  lt  M Start Hz  Target rotation speed   M Start Hz 2    P    RTS                           RSBJEUMO0001 0101 Rev  1 01      RENESAS    4 4 PWM Interrupt Processing    RSBJEUM0001 0101       C PWMINT              OutputMode   M TURNOFF         Yes    v                TurnoffPWM processing             No                OutputMode  lt  M BOOTSTRAP    
9.  Speed Command   PWM duty cycle depends on counting values of TAi  The actual rotation speed is proportion to  PWM duty cycle  the bigger is PWM duty cycle  the faster is the actual rotation speed  In the  course of approaching rotation speed command  the carrier wave cycle pulses can be acquired  by target rotation speed every time  Every result is saved a 1dimension array including 12 data  units  Then 12 elements are added to calculate average value  a current carrier wave pulses  between zero crossings can be gotten    According to formula 3 3 1  the current actual rotation speed will be gotten  Consequently  the  PWM duty cycle is changed according to the conditions given below                 Condition Amount of change  Target rotation speed  gt  Actual rotation speed   A duty  Target rotation speed  gt  Actual rotation speed   A duty       RSBJEUM0001 0101 Rev  1 01 13    RENESAS    2 6 List of function modules                                              Module name Label name Input Output Description  Motor control main Main PWM 120slc20 PFCR          Main processing  processing  lnitialization PWMinitial       Set initial values for AD  processing conversion  zero crossing  detection  and three phase  PWM  PWM interrupt PWMint    Ei Call the turnoff  bootstrap   processing turnon and run processing  Turn off processing TurnoffPWM      Turns off the three pahse  PWM outputs and checks  whether to proceed to startup  operation  Turn on Processing TurnonPWM    Performs
10.  any license to any intellectual  property rights or any other rights of Renesas or any third party with respect to the information in this document    2  Renesas shall have no liability for damages or infringement of any intellectual property or other rights arising out  of the use of any information in this document  including  but not limited to  product data  diagrams  charts   programs  algorithms  and application circuit examples    3  You should not use the products or the technology described in this document for the purpose of military  applications such as the development of weapons of mass destruction or for the purpose of any other military  use  When exporting the products or technology described herein  you should follow the applicable export  control laws and regulations  and procedures required by such laws and regulations    4  All information included in this document such as product data  diagrams  charts  programs  algorithms  and  application circuit examples  is current as of the date this document is issued  Such information  however  is  subject to change without any prior notice  Before purchasing or using any Renesas products listed in this  document  please confirm the latest product information with a Renesas sales office  Also  please pay regular  and careful attention to additional and different information to be disclosed by Renesas such as that disclosed  through our website   http   www renesas com    5  Renesas has used reasonable care in com
11.  sample  P72 V V phase voltage  P73  V V phase voltage  P74 W W phase voltage  P73  W W phase voltage  P8 U U phase voltage  P8  U U phase voltage                   RSBJEUMO0001 0101 Rev  1 01      RENESAS    1 3 software specifications       Motor type    permanent magnet synchronous motor PMSM        Numbers of pole pairs    2       Control method    120 degree commutation using trapezoidal waves       Motor Position Detection    Detected by three phase induced voltage of motor       Carrier Frequency    5kHz       Range of Rotation  Speed Command    Single Direction  1000rpm to 7200 rpm       Error detection       The Fo signal  forced shut down signal  of the IPM is input  to the NMI pin of the MCU  Thus  if the Fo signal goes low   the three phase output is forcibly stopped and the  three phase output pins are placed in the high impedance  state        RSBJEUMO0001 0101 Rev  1 01      RENESAS    2 Description of Software    2 1 Output Pattern Switching    U BEMF    V BEMF    W BEMF    Up    Un    Vp    Wp    Wn    Pattern 5 Pattern 0   Pattern 1    Pattern 2   Pattern 3   Pattern 4   Pattern 5                                                 e pt p a pt pt p 4 pt pp  LTR 1 4                             o o  0            nn 3  banji je         Zero crossing  ae pe                                              JUUL                                                                                                                                                                   
12.  startup operation  and check run mode switch  Bootstrap processing BootstrapPWM       Charging for 3 phase IGBT  circuit  TB1 int processing TB1Int         Performs 50us timer inquiry  and detect induced voltage  Run RunPWM        Normal PWM operation  Processing processing  Run calculation Cal PwmRun        Performs sensor less control  processing and Output pattern switching  PWM duty calculation CalPWMDuty     Calculates actual rotation  processing speed and PWM duty  Stop check processing StopCheck    UNIT_16 Check whether the  Stop processing is stopped by a  check rotation speed command or  sul an error  Calculate Rotation CalSpeedCnd    UINT 16 UNIT 16 Convert AD value to rotation  Speed Command Ad rotation speed command  Input speed  Value command             RSBJEUM0001 0101    Rev  1 01    14      RENESAS    2 7 List of vrialbles                                                                                           Item Label Data Type   Resolution Description  Stop state s StopMode UINT 16 240  Output state g_OutputMode UINT_8 2 0 Operation mode  Output angle g_MotTheta UINT_16 2111  Startup control s StartCnt UINT 16 210  counter  Target rotation s TargetCnt UINT 16 240 Counter used to provide the period  speed calculation Zz  gt   2ms  of target rotation speed  counter calculation   Rotation speed g_SpeedCnd UINT_16 2M ADC input  command rpm   SpeedCnd  241  2p   number of  pole pairs X 60  Target rotation g SpeedTgt UINT 16 244 The value changed toward the r
13.  value into rotation speed  command  AD rotation speed s ADSum UINT 32 2112 16 times AD value sum  sum  zero crossing s_CalCnt UINT_8 2 0 Calculate average zero crossing  interval array pointer  RSBJEUM0001 0101 Rev  1 01 15    RENESAS       interval pulse          AD sample interval g_swtime UINT_16 2 0 Sample once every 16 carrier wave  interrupt   Induced voltage   g ChkOnCnt UINT_16 2 0 Counter used to provide a time delay   detection disable    time counter             for detect a induced voltage    zero crossing           2 8 List of Macro definition                                                                                                          Macro name Macro value Resolution Description  M_CTRL_TS 6711 2 25 Control cycle 0 0002  2425  M_K_SPEED_AD_REF 6032 2 12 A D conversion ratio  240 2 pi 1024   2112  M Sft SPEED AD RE 11  M Start Hz 419 211 Carrier wave cycle 5k  startup rotation speed  M Sft TURNON MODE   15 2 0  M_TURNON_MODE_TIM   1500 2 0 Start up time  E  M_THETA_60DEG 2145 2 11 Pi 3  2 11  M_THETA_360DEG 12868 2 11 2 Pi 2 11  M_CARR_CNT 4000 2 0 Carrier wave cycle is 5k  M_TURNOFF 0 210 Turnoff work mode  M BOOTSTRAP 1 2 0 Bootstrap work mode  M_TURNON 2 2 0 Turnon work mode  M_RUN 3 2 0 Run work mode  M INI DUTY 120 1600 215 Initial PWM duty   0 08 2415   M_MIN_DUTY_120 328 215 Min PWM duty  0 01 2115   M_MAX_DUTY_120 29488 215 Max PWM duty   0 9 2415    M_BOOT_DUTY_120 3276 215 Bootstrap PWM duty   0 1 2 15   M Sft DUTY 120 TIME   15 2 0  M_BOOT
14. I Interrupt ProCeS  N i      stisni ria ne R E E E E R bes 26  4 8 Stop Check Processing  ee 26  4 9 Run Processing avanse 27  4 10 PWM Run Calculation Processing  nn 28  4 11 PWM Duty Calculation Processing    32  4 12 Calculate Rotation Speed Command ProceSSing 34    RSBJEUMO0001 0101 Rev  1 01 6      RENESAS    1  About This Platform    1 1 The hardware block diagram         M16C Tiny   SD  P8s nNMI nSD  TT     IThree phase motor control     VP P7z TA1ourV  __     Wn  P73 TA1iN  V       We  P74 TA2ouT W     Wn  P7s TA2in  W Ii   UP P80 TA40ut U       UN  P81 TA4in  U     J                  IPM  circuit        Vv Vu VwPVec    Vous BUS in BUSour    I        Vsus  P103 AN3    leus  P102 AN    Speed Command PO1 ANO1  A D Conversion             Usemr  P17 INT5   Weemr  P16 INT4   Vsewr  P15 INT3    Induce voltage detect                          Vin Uin Win PVcc  Comparator         Sample Circuit            L   220V AC   N    N    POWER  circuit                                  1 2 The hardware resource assignment table                                                    Used SFR Function Description Used I O Port Function Description  TA1 U phase PWM wave P15  INT   IDV V phase induced voltage detection  TA2 V phase PWM wave P16 INT   IDW W phase induced voltage detection  TA4 W phase PWM wave P17 INT   IDU U phase induced voltage detection  TB1 50us cycle inquiry PO  ANO  Rotation Speed Command  TB2 Carrier wave cycle control P10  AN gt  Bus current sample  P103 AN3 Bus voltage
15. STRAPSTEP 3 Bootstrap mode step  2 9 List of constant variable  Item Label Data Type Description  Output ape switching PFCRTbI   UINT_8 Comprise 6 output pattern PWM wave  Zero crossing interval Tgt Dit Conv   UINT 8 Convert target rotation speed to  counter table zero crossing interval pulse  Actual rotation speed Dit Act Conv   UINT 8 Convert zero crossing interval pulse to actual  table rotation speed  PFCR output table for   PFCRTbIBoot   UINT 8 Include three elements for three phase IGBT  bootstrap mode circuit charging  RSBJEUM0001 0101 Rev  1 01 16      RENESAS    3 Finite State Machine of Motor Control    The state of motor control can be shown by finite state machine  FSM   The following figure is the  FSM of BLDC in this software  It concludes four states  the states can be switched to other states  under the certain conditions     o          Trunoff Bootstrap  Mode Mode       3 1 State Discription    1  Turnoff mode expresses that the rotation speed command from A D converts is 0  and MCU  will not output PWM wave  Under this mode  if rotation speed command from A D converts is  not equal to zero  motor work mode changes into bootstrap mode  the target rotation speed and  actual rotation are set to the minimum rotation speed  1000rpm    2  Bootstrap mode indicate that under the condition of single power supply for IPM module   bootstrap circuit finish the function of charging for upper arm IGBT of 3 phase IGBT circuit  This  method is implemented by MCU outputting 
16. ation Processing       PWMinitial J    v          g OutputMode  lt Turnoff mode       g Mottheta 0       s StopMode  1  g SpeedCnd 0  Set initial values for induced voltage inputs   INT4 interrupt control register  lt  0x00    INT3 interrupt control register  lt  0x00    INT5 interrupt control register   0x00    Interrupt request cause select register  0xF8    I  disable external interrupt  set both edge trigger          Set three pahse PWM initial values   ICTB2   0x01    TB2 underflow generate interrupt  Protect register   0x02  INVCO 0x44   sawtooth modulation mode  no   two active at an instance  INVC1 0x20      disable DTT  active  Protect register   0x00  Protect register   0x02  TB2SC  0x02    set three phase output forcible    cutoff by  SD pin input  IDBO   0x3f    set 3 phase output buffer register 0  IDB1   Ox3f    set 3 phase output buffer register 1  Protect register   0x00  TA1MR   0x12   one shot pulse mode  TA2MR   0x12   one shot pulse mode  TA4MR   0x12   one shot pulse mode  TB2MR   0x00   time mode  TRGSR    0x45   trigger select register TB2 trigger  TB2  M CARR CNT  TA4  TA1 TA2  M CARR CNT      M INI DUTY 120    SINT 32 M CARR CNT   gt  gt   2115    Timer B2 interrupt vector setting  Timer B2 interrupt control register   0x04  Count start flag    0x96   timer count start  Protect register   0x02  INVCO    0x08   output enable  Protect register   0x00       v       Set A D conversion initial values  A D control register 0 0x98  fAD 2  Repeat Sweep   mode
17. bootstrap duty PWM wave  In order to prove to  enough charging time of upper arm IGBT  the bootstrap mode last certain time  When three  phase IGBT circuit bootstrap mode is finished  the motor work mode changes into turnon mode   otherwise the bootstrap mode is continue    When no rotation speed command is detected or three phase motor output control timer is   disabled  the motor work mode come back turnoff mode    3  Turnon mode points motor starts to run while MCU outputs initial duty PWM wave  Output   pattern switching is forcibly implemented by controlling PWM duty changing amount to calculate   motor rotation angle  Passing 1500 carrier wave cycle interrupt  motor work mode changes into   Run mode  or it will continue turnon mode    When no rotation speed command is detected or three phase motor output control timer is   disabled  the motor work mode come back turnoff mode    4  Run mode indicates that motor works normally while MCU outputs PWM wave by inputting   certain rotation speed command  And the rotation speed command is synchronous to rotate   magnetic field frequency  so zero crossing of induced voltage can be detected accurately to  decide to output pattern stwiching by 50us timer interrupt    When no rotation speed command is detected or three phase motor output control timer is    RSBJEUM0001 0101 Rev  1 01 17      RENESAS    disabled  the motor work mode come back turnoff mode   No intervals of zero crossing of induced voltages are detected when counter 
18. c 0                         Yes         Int5i    y Yes       Int_counter 1                 nter 2        Int_cou    v Yes       CalPWMDuty Processing                   V  s ReloadStg  2  Int counter 0  Int5ic 0              lt        v  Int4ic 0  Int3ic 0                RSBJEUM0001 0101             Rev  1 01             No  y  g_OutputMode M_TURNON  g_MotTheta 0  V  idbO   Ox3f  idb1   Ox3f    stop PWM output  pfcr   0x3f    enable PWM output pins  int4ic  amp   0x00  No int3ic  amp   0x00  int5ic  amp   0x00   clear interrupt request  RTS  No    No   2   28            g Stage  2   Yes     Int4i    v Yes          Int counter 1             Yes          CalPWMDuty Processing             v  s ReloadStg  3  Int counter lt 0  Int4ic 0        lt     No             v  Int3ic 0  Int5ic 0                                  g Stage  3      Yes     Int3i    Yes    v       Int counter 1                Yes       CalPWMDuty Processing             v       s ReloadStg  3  Int counter lt 0  Int3ic 0       Dal    No             V  Int4ic 0  Int5ic 0                RSBJEUM0001 0101       Rev  1 01       29    RSBJEUM0001 0101     Int5i    y Yes          Int counter 1              Int counter 2      Yes    v          CalPWMDuty Processing                y  s_ReloadStg  5  Int_counter 0  Int5ic 0                   Int3ic 0  Int4ic 0                             g Stage  5   Yes     Int4i    Yes    y       Int_counter 1           Int_counter 2      Yes    v       CalPWMDuty Processing                
19. data books  etc        Standard     Computers  office equipment  communications equipment  test and measurement equipment  audio and visual  equipment  home electronic appliances  machine tools  personal electronic equipment  and industrial robots        High Quality     Transportation equipment  automobiles  trains  ships  etc    traffic control systems  anti disaster systems  anti   crime systems  safety equipment  and medical equipment not specifically designed for life support       Specific     Aircraft  aerospace equipment  submersible repeaters  nuclear reactor control systems  medical equipment or  systems for life support  e g  artificial life support devices or systems   surgical implantations  or healthcare  intervention  e g  excision  etc    and any other applications or purposes that pose a direct threat to human life     You should use the Renesas Electronics products described in this document within the range specified by Renesas Electronics     especially with respect to the maximum rating  operating supply voltage range  movement power voltage range  heat radiation  characteristics  installation and other product characteristics  Renesas Electronics shall have no liability for malfunctions or  damages arising out of the use of Renesas Electronics products beyond such specified ranges     Although Renesas Electronics endeavors to improve the quality and reliability of its products  semiconductor products have  specific characteristics such as the occurrence 
20. ern 0 0 0 0 0 0 0 0 1  Pattern 1 0 0 1 0 0 0 0 0  Pattern 2 0 0 0 0 0 1 0 0  Pattern 3 0 0 0 0 0 0 1 0  Pattern 4 0 0 0 1 0 0 0 0  Pattern 5 0 0 0 0 1 0 0 0                                     Table 3 1 1 PFCR correspond to different output pattern  The three phase PWM output pins have three states  PWM wave     H    and    L     the output states  depend on PFCR register  Pi register and PDi register  The output states table is shown on Table  3 1 2     RSBJEUMO0001 0101 Rev  1 01 10    RENESAS                         PFCi PDi Pi Output  0 1 0    D  0 1 1    H     1 X X PWM             Table 3 1 2 three states of output pin    2 2 Detection of Induced Voltages    Induced voltage       U                                  Vbus 2                                                                        A                                        Vbus 2 MI                            WwW                                                                                                    Vbus 2                                                                All       Comparator  Output Signal    zo dek       U                                              Switching output pattern                                                                                                                                                                                                                                                                                                                              
21. g in Run mode       RTI                                 4 8 Stop Check Processing       StopCheck                                                               Stop requested No stop requested  C RTS    RTS            RSBJEUMO0001 0101 Rev  1 01 26      RENESAS    4 9 Run Processing       RunPWM            No       g SpeedTgt  gt  set value     Yes       v                SpdDlyCnt   600                   SpdDlyCnt   300  IDBO 0x3f  IDB1 0x00    Timer value  lt M CARR CNT      g PWMDuty  SINT 32 M CAR  R CNT   gt  gt 15           Set timer values  Timer A4 register   timer value  Timer A1 register   timer value  Timer A2 register   timer value    y  s_TargetCnt 1                              s_TargetCnt gt  s_DlyCnt             s_TargetCnt 0          No          g SpeedCnd gt g SpeedTgt                     g SpeedTgt  1       g SpeedTgt  1                       gt  lt   v  Stop Check processing                              Stop Reguested         g OutputMode  lt  M TURNOFF                   h       C RTS      RSBJEUMO0001 0101 Rev  1 01       27         RENESAS    4 10 PWM Run Calculation Processing    No          C CalPWMRun               s_DItCnt  lt  preset value        Yes          s_DItCnt  1                g Stage   s ReloadStg     Yes       Yes         Int3i    v Yes                               Int counter 1              Int counter 2        v Yes       CalPWMDuty Processing                   V  s ReloadStg  1  Int counter 0  Int3ic 0                   Int4ic 0  Int5i
22. g paragraph  you should not use Renesas products for the purposes listed below     1  artificial life support devices or systems    2  surgical implantations    3  healthcare intervention  e g   excision  administration of medication  etc      4  any other purposes that pose a direct threat to human life  Renesas shall have no liability for damages arising out of the uses set forth in the above and purchasers who  elect to use Renesas products in any of the foregoing applications shall indemnify and hold harmless Renesas  Technology Corp   its affiliated companies and their officers  directors  and employees against any and all  damages arising out of such applications    9  You should use the products described herein within the range specified by Renesas  especially with respect to  the maximum rating  operating supply voltage range  movement power voltage range  heat radiation  characteristics  installation and other product characteristics  Renesas shall have no liability for malfunctions or  damages arising out of the use of Renesas products beyond such specified ranges    10  Although Renesas endeavors to improve the quality and reliability of its products  IC products have specific  characteristics such as the occurrence of failure at a certain rate and malfunctions under certain use conditions   Please be sure to implement safety measures to guard against the possibility of physical injury  and injury or  damage caused by fire in the event of the failure of a Renesas 
23. gt  M Max PWM dut       g PWMDuty  M Max PWM duty                      g PWMDuty lt  M Min PWM duty       g_PWMDuty  M Min PWM duty    g Stage   g MotTheta  60 degree  IDBO   0x3f  IDB1   0x00    generate 3 phase PWM                         V  PFCR   PFCRTbl  g Stage     v  Timer value  lt M CARR CNT        g PWMDuty  SINT 32 M CARR CNT      gt  gt 15   Set timer values    Timer A4 register   timer value  Timer A1 register  lt  timer value  Timer A2 register   timer value                                   Rotation speed command  gt 0                             Yes  V  g MotTheta  lt  M Start Hz M Start Hzx  M CNTL TS   lt     RSBJEUM0001 0101 Rev  1 01    24      RENESAS       g MotTheta  gt  360 degree    Yes    v       g MotTheta    360 degree                 lt   V       s StartCnt 1                    Exceed Pre setting  start time       g Stage  s ReloadStg           No       No              g OutputMode  lt  M Run ko    g_SpeedAct   M Start Hz   s ReloadStg g Stage   s DItCnt  Tgt Dit Conv M Start Hz 12   s DItCnt lt  lt  1    s ReloadCnt 0          v       Timer tb1 processing                   Da    y          s DItCnt 1                   y       Clear INTi  i 3 to 5  interrup request bit       y          StopCheck processing                       Stop Requested         g_OutputMode   M_TURNOFF                      hi       C RTS         RSBJEUMO0001 0101 Rev  1 01    25      RENESAS    4 7 TB1 Interrupt Processing       TB1INT    v    PWM duty calculation  processin
24. iption of Software   Describes software for motor control   Section 3 Finite State Machine of Motor Control   Describes state transition for motor control   Section 4 Control flow    Gives program flowchart     RSBJEUMO0001 0101 Rev  1 01 5      RENESAS    Contents   lAbout Ths Platforni oo 7  1 1 The hardware block diagran sccis ne De teseadent eect armani bi nie  7  1 2 The hardware resource assignment table    7  1 3 software Spo  INICAUOTI    sosser Pane wea ee eee eee  8   2 Description  of SO     GT 9  2 1 Output Pattern S witching  22 5  2  icc GREENE 9  2 2 Detection of Induced VoltageS  9 11  2 3 Calculation of Actual Rotation Speed  pe 12  2 4 Calculation of Target Rotation Speed    12  2 5 Calculation of PWM Duty Cycle 00 13  2 6 List of function modules    14  2 7 List of vrialbles sunn iso plakov vine nen aa ee a eared 15  2 8 Lastot Macro definition ore bce ija ek AA a ence eatin tae bee a es 16  2 9 Last of constant variable s r une 16   3 Finite State Machine of Motor Control  Ne 17  3 1 State  DISCHPUOD ss pe 17  3 2 Condition Description  seni ei ea bse Eni dojeti eine violet lea edi born E Ea st Qloeeandyeaine 18   4 Control OW sr ro 19  4 1 Main processing for sensor less driving of an SPMSM by 120 degree trapezoidal wave  commutation   0 19  4 2 Inualzation Processing        20  4 3 Turn ofi Processing vandre Se ee ATEN EM ila  21  4 4 PWM Interrupt Processing    nena 22  4 5 Bootstrap  Processing  0 00 ei 23  Z o Turn on POCEN EARE A E A EAA AA 24  47 TB
25. mation contained in this  document or Renesas Electronics products  or if you have any other inquiries      Note 1     Renesas Electronics    as used in this document means Renesas Electronics Corporation and also includes its majority     owned subsidiaries      Note 2     Renesas Electronics product s     means any product developed or manufactured by or for Renesas Electronics       RENESAS    M16C Tiny Sensor less PMSM Driving Platform    by 120 Degree Trapezoidal Wave Commutation    M16C Tiny    User s Manual    RSBJ    Published by  Renesas System Solutions  Beijing  Co   Ltd  Beijing Technical Center    Date  March 2008 Version 1 01   Document Number  RSBJEUM0001 0101   Copyright C   Renesas System Solutions  Beijing  Co   Ltd  Beijing Technical Center  All rights  reserved     Trademarks   a  General   All brand or product names used in this manual are trademarks or registered trademarks of their respective companies  or organizations    b  Specific   Microsoft Windows is registered trademarks of Microsoft Corporation     Pentium is a registered trademark of Intel     RSBJEUMO0001 0101 Rev  1 01 1      RENESAS    IMPORTANT INFORMATION     lt  READ this user   s manual before using this platform board    lt   KEEP the user   s manual handy for future reference   Do not attempt to use the platform board until you fully understand its layout concept     MCU     Throughout this document  the term    Platform    shall be defined as the Renesas M16C Tiny Sensor less  PMSM D
26. n of induced voltage is shown as figure 3 1 1    2 3 Calculation of Actual Rotation Speed    The actual rotation speed is calculated by interval between two zero crossings of induced  voltages  The interval comprises certain carrier wave cycle pulses  In the PWM mode  6 intervals  are passed every 360 electrical degree  So if counting the carrier wave pulses every a rotate  the  actual rotation speed can be calculated by the following formula     2n x SkHz  Actual rotation speed               3 3 1   Zero     crossing interval x 6   In the actual programming  the method of lookup table can be used  Given an array of  zero crossing interval pulses  the corresponding actual rotation speed can be calculated based  the above formula  A zero crossing interval pulses is subtracted 13  the corresponding actual  rotation speed can be looked up using the sequence number of array     2 4 Calculation of Target Rotation Speed    The target rotation speed is brought towards the current rotation speed command at a rate of 0 5  rad s every certain interval until target rotation speed is approach to the rotation speed command   If knowing current target rotation speed  the carrier wave cycle pulses between intervals of  zero crossings can be calculated using the above formula     RSBJEUMO0001 0101 Rev  1 01 12      RENESAS    2 5 Calculation of PWM Duty Cycle         Sawtooth Wave    modulation         mfl i fi    TAi    Output    Figure 3 1 4 Relationship between PWM Duty Cycle and Rotation
27. of failure at a certain rate and malfunctions under certain use conditions  Further   Renesas Electronics products are not subject to radiation resistance design  Please be sure to implement safety measures to  guard them against the possibility of physical injury  and injury or damage caused by fire in the event of the failure of a  Renesas Electronics product  such as safety design for hardware and software including but not limited to redundancy  fire  control and malfunction prevention  appropriate treatment for aging degradation or any other appropriate measures  Because  the evaluation of microcomputer software alone is very difficult  please evaluate the safety of the final products or system  manufactured by you     Please contact a Renesas Electronics sales office for details as to environmental matters such as the environmental  compatibility of each Renesas Electronics product  Please use Renesas Electronics products in compliance with all applicable  laws and regulations that regulate the inclusion or use of controlled substances  including without limitation  the EU RoHS  Directive  Renesas Electronics assumes no liability for damages or losses occurring as a result of your noncompliance with  applicable laws and regulations     This document may not be reproduced or duplicated  in any form  in whole or in part  without prior written consent of Renesas  Electronics     Please contact a Renesas Electronics sales office if you have any questions regarding the infor
28. of zero crossing  interval exceeds certain values  the motor work mode change into turnon mode     3 2 Condition Description                Condition number Description     Rotation speed command is not equal to zero    The three phase IGBT charging process is over     Motor rotation speed is synchronous to rotate magnetic field frequency after passing    some carrier wave cycle interrupts       No rotation speed command       Rotation speed command is equal to zero or three phase motor output control timer    disable       No intervals of zero crossing of induced voltages are detected       The three phase IGBT charging process is not over       Don t satisfied condition No 3 and No 6                   6      6    6 E    Always acquire accurate motor position information       RSBJEUMO0001 0101 Rev  1 01 18      RENESAS    4 Control flow    4 1 Main processing for sensor less driving of an SPMSM    by 120 degree trapezoidal wave commutation        C Main      y  Set local variable ad_input 0x0000  Set local variable Ad_speed  V  PWMlinitial processing     gt   V    ad input   0x03ff amp AD 1                                                 v  CalSpeedCnd processing                V    Ad speed is current calculate rotation speed                                                                   No  Ad speed lt  M Start Hz   Yes  v v  Rotation speed command   0 Rotation speed command   Ad speed              v          RSBJEUMO0001 0101 Rev  1 01 19      RENESAS    4 2 lnitializ
29. otation  speed     speed command value at a rate of 0 5  rad per 2 ms   Actual rotation g_SpeedAct UINT_16 2M Detect from the zero crossing  speed interval of the induced voltages  Zero crossings s_DitCnt UINT_16 240 Counter that measures the interval  interval counter between zero crossings  60      Counter clock period is the carrier  period   Delay time counter   s ReloadCnt UINT 16 2 0 Counter used to provide a time period  for switching to the from a pattern switching until detection  nest output pattem of induced voltage zero crossings is  purp enabled  Counter clock period is the  carrier period  output pattern g_Stage UINT_16 2 0 Current output pattern  Next output s_ReloadStg UINT 16 20 Next pattern that is determined based  Pattern IH   on the induced voltage zero crossing  detection   PWM duty clcye g PwmDuty UINT 16 2113  Bootstrap charge s BootstpCnt UINT 16 2 0 A period delay for charging for every  delay counter IGBT  Bootstrap charge s_BootstpStep UINT_8 2 0 Three phase IGBT circuit bootstrap  Step counter  Current g DItCntRef UINT 16 240  zero crossings  interval counter  Former g PreDitCnt UINT 16 240  zero crossings  interval counter  Zero crossing g DItCntArray  UINT 16 20 Save 12 times zero crossing interval  interval array   12    pulses  Average g_AvrDitCnt UINT_16 210  zero crossing  interval pulse  External Interrupt s IntCnt UINT 16 240 Detect two INTi interrupts for induced  counter         voltage  AD rotation speed s_ADSpeed UINT_16 2 12 Change AD
30. paring the information included in this document  but Renesas Electronics  does not warrant that such information is error free  Renesas Electronics assumes no liability whatsoever for any damages  incurred by you resulting from errors in or omissions from the information included herein     Renesas Electronics products are classified according to the following three quality grades     Standard        High Quality     and     Specific     The recommended applications for each Renesas Electronics product depends on the product   s quality grade  as  indicated below  You must check the quality grade of each Renesas Electronics product before using it in a particular  application  You may not use any Renesas Electronics product for any application categorized as    Specific    without the prior  written consent of Renesas Electronics  Further  you may not use any Renesas Electronics product for any application for  which it is not intended without the prior written consent of Renesas Electronics  Renesas Electronics shall not be in any way  liable for any damages or losses incurred by you or third parties arising from the use of any Renesas Electronics product for an  application categorized as    Specific    or for which the product is not intended where you have failed to obtain the prior written  consent of Renesas Electronics  The quality grade of each Renesas Electronics product is    Standard    unless otherwise  expressly specified in a Renesas Electronics data sheets or 
31. piling the information included in this document  but Renesas  assumes no liability whatsoever for any damages incurred as a result of errors or omissions in the information  included in this document    6  When using or otherwise relying on the information in this document  you should evaluate the information in light  of the total system before deciding about the applicability of such information to the intended application   Renesas makes no representations  warranties or guaranties regarding the suitability of its products for any  particular application and specifically disclaims any liability arising out of the application and use of the  information in this document or Renesas products    7  With the exception of products specified by Renesas as suitable for automobile applications  Renesas products  are not designed  manufactured or tested for applications or otherwise in systems the failure or malfunction of  which may cause a direct threat to human life or create a risk of human injury or which require especially high  quality and reliability such as safety systems  or equipment or systems for transportation and traffic  healthcare   combustion control  aerospace and aeronautics  nuclear power  or undersea communication transmission  If you  are considering the use of our products for such purposes  please contact a Renesas sales office beforehand   Renesas shall have no liability for damages arising out of the uses set forth above    8  Notwithstanding the precedin
32. product  such as safety design for hardware and  software including but not limited to redundancy  fire control and malfunction prevention  appropriate treatment  for aging degradation or any other applicable measures  Among others  since the evaluation of microcomputer  software alone is very difficult  please evaluate the safety of the final products or system manufactured by you    11  In case Renesas products listed in this document are detached from the products to which the Renesas products  are attached or affixed  the risk of accident such as swallowing by infants and small children is very high  You  should implement safety measures so that Renesas products may not be easily detached from your products   Renesas shall have no liability for damages arising out of such detachment    12  This document may not be reproduced or duplicated  in any form  in whole or in part  without prior written  approval from Renesas    13  Please contact a Renesas sales office if you have any questions regarding the information contained in this   document  Renesas semiconductor products  or if you have any other inquiries                                                                        RSBJEUMO0001 0101 Rev  1 01 35    
33. riving Platform by 120 Degree Trapezoidal Wave Commutation  which is for washing machine    demo and prototype design reference     Improvement Policy     Renesas System Solutions  Beijing  Co   Ltd  Beijing Technical Center  hereafter collectively referred to  as Renesas  pursues a policy of continuing improvement in design  performance  and safety of this  evaluation board  Renesas reserves the right to change  wholly or partially  the specifications  design     user   s manual  and other documentation at any time without notice     Target User of the Product     Those who have carefully read and thoroughly understood the information as well as restrictions  contained in the user   s manual should only use this product  Do not attempt to use the product until you    fully understand its mechanism     Support     Regarding support for the product  no services will be provided     RSBJEUMO0001 0101 Rev  1 01 2      RENESAS    LIMITED WARRANTY    Renesas warrants its products to be manufactured in accordance with published specifications and free  from defects in material and or workmanship  The foregoing warranty does not cover damage caused by  fair wear and tear  abnormal store condition  incorrect use  accidental misuse  abuse  neglect  corruption   misapplication  addition or modification or by the use with other hardware or software  as the case may be   with which the product is incompatible  No warranty of fitness for a particular purpose is offered  The  user assumes 
34. the entire risk of using the product  Any liability of Renesas is limited exclusively to the    replacement of defective materials or workmanship     DISCLAIMER    RENESAS MAKES NO WARRANTIES  EITHER EXPRESS OR IMPLIED  ORAL OR  WRITTEN  EXCEPT AS PROVIDED HEREIN  INCLUDING WITHOUT LIMITATION   THEREOF  WARRANTIES AS TO MARKETABILITY  MECRCHANTABILITY  FITNESS  FOR ANY PARTICULAR PURPOSE OR USE  OR AGAINST INFRINGEMENT OF ANY  PATENT    IN NO EVENT SHALL RENESAS BE LIABLE FOR ANY DIRECT  INCIDENTAL OR  CONSEQUENTIAL DAMAGES OF ANY NATURE  OR LOSSES OR EXPENSES  RESULTING   FROM ANY DEFECTIVE PRODUCT  THE USE OF ANY PRODUCT OR ITS  DOCUMENTATION  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES   EXCEPT AS EXPRESSLY STATED OTHERWISE IN THIS WARRANTY  THIS PRODUCT  IS   SOLD    AS IS     AND YOU MUST ASSUME ALL RISK FOR THE USE AND RESULTS  OBTAINED FROM THE PRODUCT     RSBJEUMO0001 0101 Rev  1 01 3      RENESAS    All Right Reserved   This user   s manual and product are copyrighted and all rights are reserved by Renesas  No part of this  user   s manual  all or part  any be reproduced or duplicated in any form  in hardcopy or machine readable    form  by any means available without Renesas   s prior written consent     Other Important Things to Keep in Mind     1  Circuitry and other examples described herein are meant merely to indicate the characteristics and  performance of Renesas Technology   s semiconductor products  Renesas assumes no responsibility for any  intellec
35. tual property claims or other problems that may result from applications based on the examples  described herein    2  No license is granted by implication or otherwise under any patents or other rights of any third party or  Renesas    3  MEDICAL APPLICATIONS  Renesas Technology   s products are not authorized for use in MEDICAL  APPLICATIONS without the written consent of the appropriate officer of Renesas Technology  Asia  Sales company   Such use includes  but is not limited to  use in life support systems  Buyers of Renesas  Technology   s products are requested to notify the relevant Renesas Technology  Asia Sales offices  when    planning to use the products in MEDICAL APPLICATIONS   Limited Anticipation of Danger   Renesas cannot anticipate every possible circumstance that might involve a potential hazard  The    warnings in this user   s manual and on the product are therefore not all inclusive  Therefore  you must use    the product safely at your own risk     RSBJEUMO0001 0101 Rev  1 01 4      RENESAS    PREFACE    About this manual    This user   s manual discusses how to use three phase motor control timer function  and a sample  application of how to implement position sensor less driving of an SPMSM by 120 degree  trapezoidal wave commutation  which is a method that makes use of the induced voltage of the  motor    This example applies to MCUs in the MC16C TinyGroup   Section 1 About this platform   Gives specification on hardware and software   Section 2 Descr
    
Download Pdf Manuals
 
 
    
Related Search
    
Related Contents
Manual de utilização do Sistema de Informação em Ciência e  fiche matiere - Ministère de l`Enseignement Supérieur, de la  Livret      Robimat - Wagner Kunststofftechnik  取扱説明書 - Honda  Instruction Manual  USER MANUAL CommRadio CR-1 Communications Receiver  Manuel d`utilisation de Paie Direct    Copyright © All rights reserved. 
   Failed to retrieve file