Page 2
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”...
Page 3
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.
Page 4
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 Driving Platform by 120-Degree Trapezoidal Wave Commutation, which is for washing machine demo and prototype design reference.
Page 5
No warranty of fitness for a particular purpose is offered. The user assumes the entire risk of using the product. Any liability of Renesas is limited exclusively to the replacement of defective materials or workmanship.
Page 6
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.
Page 7
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.
Contents 1. About This Platform ..........................7 1.1 The hardware block diagram ......................7 1.2 The hardware resource assignment table..................7 1.3 software specifications ........................8 2 Description of Software..........................9 2.1 Output Pattern Switching ........................9 2.2 Detection of Induced Voltages.......................11 2.3 Calculation of Actual Rotation Speed ...................12 2.4 Calculation of Target Rotation Speed....................12 2.5 Calculation of PWM Duty Cycle ....................13 2.6 List of function modules........................14...
1. About This Platform 1.1 The hardware block diagram M16C/Tiny (SD) /nNMI/nSD Three-phase motor control /TA1 POWER /TA1 /TA2 220V AC circuit circuit /TA2 /TA4 /TA4 PVcc Motor Potentionmeter Speed Command /AN0 A/D Conversion /INT5 BEMF Vin Uin Win PVcc...
1.3 software specifications Motor type permanent magnet synchronous motor(PMSM) Numbers of pole pairs 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 Single Direction Speed Command 1000rpm to 7200 rpm Error detection The Fo signal (forced shut-down signal) of the IPM is input...
2 Description of Software 2.1 Output Pattern Switching Pattern 5 Pattern 0 Pattern 1 Pattern 2 Pattern 3 Pattern 4 Pattern 5 U-BEMF V-BEMF Zero-crossing W-BEMF Switch the output pattern 30 Calcultation the actual rotation speed degree after the zero-crossing from intervals between zero-crossings of the induced voltage of the induced voltages...
Page 12
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.
PFCi Output “L” “H” Table 3.1.2 three states of output pin 2.2 Detection of Induced Voltages Induced voltage Vbus /2 Vbus/2 Vbus /2 30 dgr 30 dgr Comparator Switching output pattern Output Signal Zero-crossing of induced voltage 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.
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.
2.5 Calculation of PWM Duty Cycle Sawtooth Wave modulation Slow Fast Output Figure 3.1.4 Relationship between PWM Duty Cycle and Rotation 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.
2.6 List of function modules Module name Label name Input Output Description —— Motor control main Main_PWM_120slc20_PFCR( ) Main processing processing —— Initialization PWMInitial( ) Set initial values for AD processing conversion, zero-crossing detection ,and three phase —— PWM interrupt PWMInt( ) Call the turnoff, bootstrap, processing...
2.7 List of vrialbles Item Label Data Type Resolution Description Stop state s_StopMode UINT_16 Output state g_OutputMode UINT_8 Operation mode Output angle g_MotTheta UINT_16 2^11 Startup control s_StartCnt UINT_16 counter Target rotation Counter used to provide the period s_TargetCnt UINT_16 speed calculation (2ms) target...
interval pulse AD sample interval g_swtime UINT_16 Sample once every 16 carrier wave interrupt Induced voltage g_ChkOnCnt UINT_16 Counter used to provide a time delay detection disable detect induced voltage time counter zero-crossing. 2.8 List of Macro definition Macro name Macro value Resolution Description...
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.
disabled, the motor work mode come back turnoff mode. No intervals of zero-crossing of induced voltages are detected when counter of zero-crossing interval exceeds certain values, the motor work mode change into turnon mode. 3.2 Condition Description Condition number Description ①...
4 Control flow 4.1 Main processing for sensor-less driving of an SPMSM by 120-degree trapezoidal wave commutation. Main Set local variable ad_input=0x0000 Set local variable Ad_speed PWMInitial processing ad_input = 0x03ff&AD1 CalSpeedCnd processing Ad_speed is current calculate rotation speed Ad_speed< M_Start_Hz? Rotation speed command = 0 Rotation speed command = Ad_speed RSBJEUM0001-0101 Rev.
4.12 Calculate Rotation Speed Command Processing CalSpeedCnd Rotation speed command input value = AD vaule*M_K_SPEED_AD_REF/2^11 s_ADSum+=Rotation speed command input Average calculation counter+1 Average calculation counter>=16 ? s_ADSpeed=s_ADSum/16 s_ADSum=0 Average calculation counter=0 Return value=s_ADSpeed RSBJEUM0001-0101 Rev. 1.01...
Page 37
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 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.
Need help?
Do you have a question about the M16C/Tiny and is the answer not in the manual?
Questions and answers