Home
Application Note
Contents
1. 13 5 1 Function Syniax eter ti eere ERA ERR n pr beca 14 52 External Varlables ro e E eas D n D de E OR ER E 17 6 USAGE OF LIBRARY FUNCTIONS ortas cei 18 Gd Operation FOW Emm 18 Gadd Start E OS ETE 18 6 1 2 Change Motor 19 6 1 3 Set Motor Rotation Direction rate 19 6 1 4 Stop Uno 20 6 1 5 Get ioco E o 20 64 6 Adjust Parameter APUD EPIS uM Mons aa vsa MEE 21 7 SAMPLE PROGRANM 22 8 ADDITIONAL INFORMATION U uu u u u 23 MCU AN 500067 E 14 Page 3 co FUJITSU 120 DC Inverter Control SOFTUNE C LIB Application Note V1 4 Revision History Revision History Date Author Change of Records 2009 11 20 Kevin Wang V1 0 First draft 2009 11 30 Kevin Wang V1 1 Modify 2010 01 11 Kevin Wang V1 2 Modify 2010 03 08 Kevin Wang V1 2 Modify 4 1 2010 03 30 Kevin Wang V1 3 Update motor drive waveform and back waveform 2010 12 07 Kevin Wang V1 4 Add HW description Add DTTI c file Add drive level choice function Add get motor speed function Add how to adjust parameter
2. PERFORM The following document contains information on Cypress products Although the document is marked with the name Spansion and Fujitsu the company that originally developed the specification Cypress will continue to offer these products to new and existing customers Continuity of Specifications There is no change to this document as a result of offering the device as a Cypress product Any changes that have been made are the result of normal document improvements and are noted in the document history page where supported Future revisions will occur when appropriate and changes will be noted in a document history page Continuity of Ordering Part Numbers Cypress continues to support existing part numbers To order these products please use only the Ordering Part Numbers listed in this document For More Information Please contact your local sales office for additional information about Cypress products and solutions About Cypress Cypress NASDAQ CY delivers high performance high quality solutions at the heart of today s most advanced embedded systems from automotive industrial and networking platforms to highly interactive consumer and mobile devices With a broad differentiated product portfolio that includes NOR flash memories F RAM and SRAM Traveo microcontrollers the industry s only PSoC programmable system on chip solutions analog and PMIC Power Management ICs CapSense capacitive touch sensing controlle
3. Vn OPT4 Wp Motor drive circuit OPT5 Wn NIO W Back EMF SNI1 V Back EMF SNI2 U Back DTTI Over Current Back EMF Drive Motor drive circuit Hall Sensor Drive Note OPT1 OPT2 OPT3 OPT4 OPT5 SNIO SNI1 SNI2 DTTI MCU pin Up U phase upper arm inverter switch signal Un U phase lower arm inverter switch signal Vp V phase upper arm inverter switch signal Vn V phase lower arm inverter switch signal Wp W phase upper arm inverter switch signal Wn W phase lower arm inverter switch signal H1 H2 H3 Hall sensor signal Over current Over current signal W Back EMF W phase back electromotive force V Back EMF V phase back electromotive force U Back EMF U phase back electromotive force Over Current Over current protection signal MCU AN 500067 E 14 Page 11 120 DC Inverter Control SOFTUNE C LIB Application Note V1 4 co FUJITSU Chapter 4 Library Installation 4 Library Installation 4 4 Components The library package contains 3 files File name Usage MB95F330 Motor Drive Library file contains all function modules V0 2 0 lib Dic Deal interrupt h file contains prototypes of the modules and global variables Header file contains the interrupt vector table declaration 4 2 Procedure There are 3 steps to begin using the Motor lib C library Y n F2MC 8L 8FX SOFTUNE after creation of a new project use PROJECT
4. motor speed NO Is Motor State MOTOR NORMAL Motor Set Change Speed 6 1 3 Set Motor Rotation Direction To set motor rotation direction please ensure that the motor is under ready status The following flow chart shows how to set the motor rotation direction NO Is Motor State MOTOR READY Rotation DirectionZANTI CLOCKWISE Or Rotation DirectionZCLOCKWISE MCU AN 500067 E 14 Page 19 120 DC Inverter Control SOFTUNE C LIB Application Note V1 4 FUJITSU Chapter 6 Usage of Library Functions 6 1 4 Stop Motor To stop a motor please ensure that the motor is under normal or startup status The following flow chart shows how to stop the motor Is Motor State MOTOR NORMAL Or Is Motor State MOTOR START Motor Stop 6 1 5 Get Motor Speed The following flow chart shows how to get motor actual speed Motor Get Speed MCU AN 500067 E 14 Page 20 co 120 DC Inverter Control SOFTUNE C LIB Application Note V1 4 FUJITSU Chapter 6 Usage of Library Functions 6 1 6 Adjust Parameter When we use this library to drive a new motor there are some parameters need to adjust Because of different motors need different parameters Adjust carrier frequency We can use the two functions to adjust motor carrier frequency Hall Sensor Start unsigned short duty on unsigned short period We can adjust period for motor carrier frequency when we choose hal
5. ADD MEMBER to add MB95F330 Motor Drive V0 2 0 lib and DTTI c as a member Y Include Motor h header file into C main program for external references Y Include myvect h header file into the module which uses directive pragma to generate the interrupt vector table Thus a project including Lib file is ready for the caller program MCU AN 500067 E 14 Page 12 120 DC Inverter Control SOFTUNE C LIB Application Note V1 4 Chapter 5 Library Functions and External Variables co FUJITSU 5 Library Functions and External Variables There are 5 global variables in the library v v v v v Rotation Direction Start Motor Driver Mode Motor State Drive Level There are 9 functional modules for library control v v v v v v v v v Motor Init Sensor Less Start Motor Parm Motor Set Change Speed Motor Stop Sensor Less Normal Work Hall Sensor Start Hall Sensor Normal Work Motor Get Speed MCU AN 500067 E 14 Page 13 co FUJITSU 120 DC Inverter Control SOFTUNE C LIB Application Note V1 4 Chapter 5 Library Functions and External Variables 5 1 Function Syntax extern void Motor Init void Initialize MCU resources to be ready for start and stop commands Initialize port configuration Initialize multi function timer resources Initialize speed check timer Initialize interrupt Initialize motor state to MOTOR READY em MN Syntax Input parameters extern void Sensor Less Start
6. Add more motor fail indicate This manual contains 22 pages MCU AN 500067 E 14 Page 4 120 DC Inverter Control SOFTUNE C LIB Application Note V1 4 FUJITSU CONTENTS CONTENTS REVISION HISTORY c niis 2 CONTENTS aaa nna tuna 3 REVISION HISTORY uu 4 1 INTRODUCTION up P 6 2 OPERATION PRINCIPLES AND THEORY ener triente anti u u 7 2 1 Hall Sensor Drive EST E SOUTENIR UN rM 7 2 2 iu Drive e 9 2 221 Sensorless 9 2 2 2 Normal RUN ue a eeu teret cua e xoa E i PA RR 10 3 HW DESCRIPTION 11 4 LIBRARY INSTALLATION UI III 12 Al ComponeniS eee ESOS 12 42 Procedure nsnsi 12 5 LIBRARY FUNCTIONS AND EXTERNAL VARIABLES 13 5 1 F neti n Syntax uuu 14 5 2 External 17 6 USAGE OF LIBRARY FUNCTIONS cans runi rna ne u u u 18 6 1 Operation
7. ded for use with equipment which require extremely high reliability such as aerospace equipment undersea repeaters nuclear control systems or medical equipment for life support Some of the products described in this manual may be strategic materials or special technology as defined by the Foreign Exchange and Foreign Trade Control Law In such cases the products or portions theory must not be exported without permission as defined under the law 2009 Fujitsu Semiconductor Shanghai Co Ltd MCU AN 500067 E 14 Page 2 120 DC Inverter Control SOFTUNE C LIB Application Note V1 4 FUJITSU Contents CONTENTS REVISION HISTORY II ace ce ccs 2 re pz p 3 REVISION HISTORY c 4 1 INTRODUCTION gU aa aaa sassa a a saka 6 2 OPERATION PRINCIPLES AND THEORY 7 2 1 Hall uuu 7 2 2 GMS SSS E 9 221 Sensorless Startlup nr 9 2 2 2 Normal Biete y uapa ayau a ea 10 3 HW DESGRIPTION 128100 c 11 4 LIBRARY INSTALLATION l u UU U U u a lunnatnndun 12 SOROS INS us u uuu uuu uu aaa 12 4 2 Procedure xu S 12 5 LIBRARY FUNCTIONS AND EXTERNAL VARIABLES
8. evel drive Drive Low 1 low level drive MCU AN 500067 E 14 Page 17 co 120 DC Inverter Control SOFTUNE C LIB Application Note V1 4 FUJITSU Chapter 6 Usage of Library Functions 6 Usage of Library Functions In general user should follow the following steps to control the motor Set global variables with suitable values Initialize the MCU resource Start the motor with suitable startup speed Modify motor synchronous speed accelerating speed and decelerating speed by changing values of the global variables Stop the motor S lt A lt 6 1 Operation Flow 6 1 1 Start Motor This can be done by calling the following successively using appropriate parameters Choice drive level high or low Is Driver Mode SENSOR LESS Is Start Motor TRUE Is Start Motor TRUE Is Motor State MOTOR NORMAL Is Motor State MOTOR NORMAL YES Motor Init Start Motor FALSE Sensor Less Normal Work Motor Set Change Speed Motor Init Start Motor FALSE Motor Set Change Speed Hall Sensor Start Hall Sensor Normal Work Sensor Less Start MCU AN 500067 E 14 Page 18 co 120 DC Inverter Control SOFTUNE C LIB Application Note V1 4 FUJITSU Chapter 6 Usage of Library Functions 6 1 2 Change Motor Speed To change motor speed please ensure that the motor is running under normal status The following flow chart shows how to change the
9. ime during startup 150 x 125ns gt 150 10kHz carrier frequency gt 800 x 125ns startup carrier period extern void Hall Sensor Normal Work void Control motor running normally with hall sensor drive Description Count motor speed Control motor speed Check hall sensor signal and change arm extern unsigned int Motor Get Speed void Syntax Get motor actual speed Input parameters Motor actual speed in RPM MCU AN 500067 E 14 Page 16 120 DC Inverter Control SOFTUNE C LIB Application Note V1 4 FUJITSU Chapter 5 Library Functions and External Variables 5 2 External Variables extern unsigned char Motor_ State Motor operation mode MOTOR_READY 1 motor ready for accepting start command MOTOR_START 2 motor in startup stage Value MOTOR NORMAL 3 motor in normal run stage MOTOR FAILURE 4 motor which cannot run MOTOR START FAILURE 5 motor start failed OVER CURRENT 6 motor over current extern unsigned char Rotation Direction Motor running direction ANTICLOCKWISE 0 motor anticlockwise running CLOCKWISE 1 motor clockwise running extern unsigned char Driver Mode Description Motor drive method HALL SENSOR 0 hall sensor drive SENSOR LESS 1 sensorless drive extern unsigned char Start Motor FALSE 0 the motor cannot be started TRUE 1 the motor can be started Variable extern unsigned char Drive Level Description Drive motor level choice Value Drive High 0 high l
10. inciples and Theory 2 4 Hall Sensor Drive Below is the brief working principle for MCU to drive motor with hall sensor A multi pulse generator outputs six switch signals to drive IGBT inverter Three channel hall sensor signals are detected by MCU input capture to achieve motor position One channel over current signal is output by IGBT inverter to MCU to protect the whole system MEHR Generator Phase voltage and reference levl MCU AN 500067 E 14 Page 7 120 DC Inverter Control SOFTUNE C LIB Application Note V1 4 Chapter 2 Operation Principles and Theory FUJITSU One electrical cycle is divided into 6 states The relationship between three channel hall sensor signals H1 H2 H3 and six channel inverter switch signals Up Un Vp Vn Wp Wn is shown as below State 1 N Im Q aks ia eu gt Wp Wn MCU AN 500067 E 14 Page 8 120 DC Inverter Control SOFTUNE C LIB Application Note V1 4 FUJITSU Chapter 2 Operation Principles and Theory 2 22 Sensorless Drive 2 2 1 Sensorless Startup The suggested startup method is forced startup The following is the driving pattern The marker A and A are the state change while A is the position detect mask off period used to mask off unwanted interrupt when the back EMF is very weak during startup U gt V U gt W V gt W V U W gt U W gt V W Falling V Rising U Falling W Rising V Falling U R
11. ising Up Vp Upper arm control Un Vn Lower arm control MCU AN 500067 E 14 Page 9 120 DC Inverter Control SOFTUNE C LIB Application Note V1 4 Chapter 2 Operation Principles and Theory The normal run consists of 12 different driving patterns and 6 different states The following shows the relationship between the driving patterns and the expected interrupts from the position detection circuit D position detection interrupt enable A next position detection interrupt A B commutation delay B C change arm delay C D change arm mask off period 2 2 2 Normal Run Marker explanation A position detection interrupt B change state C change chopping arm FUJITSU S3b S4a 3a S1b S2a 51 MCU AN 500067 E 14 Page 10 cO 120 DC Inverter Control SOFTUNE C LIB Application Note V1 4 FUJITSU Chapter 3 HW Description 3 HW Description The library is used for MB95F330 and MB95F390 series MCU This library only uses the multi pulse generator of MCU and it uses three interruptions 16 bit reload timer ch 1 MPG writing timer or compare match and MPG DTTI The16 bit reload timer ch 1 and the MPG writing timer or compare match interruptions are closed in the library The MPG interruption is open In order to use this library more easily the connection between MCU and motor drive circuit should be as below 1 Un OPT2 Vp
12. l sensor drive Sensor Less Start unsigned short start duty on unsigned short start_period unsigned short normal_duty_on unsigned short normal period When we choose sensorless drive we can change start period for adjusting the motor start carrier frequency and we change normal period for adjusting motor normal run carrier frequency It should keep the start duty as same as normal duty otherwise the motor can t start normally Adjust start When we choose sensorless drive maybe we should adjust some parameters to keep motor start normally There are two functions need to adjust Sensor Less Start unsigned short start duty on unsigned shori start period unsigned short normal duty on unsigned short normal period Motor Parm unsigned long speed con unsigned short csd unsigned short cad unsigned short camaskt unsigned short stmaskt r t T Ct We know when we just start motor There is no Back EMF can checked So we use a timer to help motor change arm and bring Back EMF But how long we set timer and how large duty need If the time of the timer is large or small the motor can t run normally If the duty is large the motor will over current and can t start If the duty is small the Back EMF of motor is very weak and we can t check Usually we fix one parameter adjust another one For example we fixed start duty on start duty then we change stmaskt timer We also can fix stamaskt timer then we change start duty
13. on start duty In order to keep motor can change start state to normal state When we changed start duty on we should change normal duty on to keep the start duty as same as normal duty Set speed Because of different motors have different numbers of pole pair So we should change this function for counting motor speed Motor Parm unsigned long speed con unsigned short csd unsigned short cad unsigned short camaskt unsigned short stmaskt We should change speed con according to numbers of pole pair by the follow formula speed 6000000 2x number of pole pair Improve efficiency Sometimes we find the efficiency is very low We can adjust three parameters of Motor Parm function Motor Parm unsigned long speed con unsigned short csd unsigned short cad unsigned short camaskt unsigned short stmaskt MCU AN 500067 E 14 Page 21 120 DC Inverter Control SOFTUNE C LIB Application Note V1 4 co FUJITSU Chapter 7 Sample Program 7 Sample Program Motor zip is a sample project containing source code which can drive a sensorless brushless or hall sensor DC motor with motor EV Board PN MB2146 440 E V1 2 Please refer to Motor EV Board MB2146 440 E HW User Manual Tested configuration DC motor Fulling FL28BL26 15V 8006AF Number of phases 3 Number of poles 4 Supply voltage 15VDC Minimum tested speed 1000rpm Maximum tested speed 7000rpm MCU work load 896 3096 Motor speed from 1000 rpm to 7000 rpm wi
14. prevention of over current levels and other abnormal operating conditions If any products described in this document represent goods or technologies subject to certain restrictions on export under the Foreign Exchange and Foreign Trade Law of Japan the US Export Administration Regulations or the applicable laws of any other country the prior authorization by the respective government entity will be required for export of those products Trademarks and Notice The contents of this document are subject to change without notice This document may contain information on a Spansion product under development by Spansion Spansion reserves the right to change or discontinue work on any product without notice The information in this document is provided as is without warranty or guarantee of any kind as to its accuracy completeness operability fitness for particular purpose merchantability non infringement of third party rights or any other warranty express implied or statutory Spansion assumes no liability for any damages of any kind arising out of the use of the information in this document Copyright O 2013 Spansion Inc All rights reserved Spansion the Spansion logo MirrorBit MirrorBit Eclipse ORNAND and combinations thereof are trademarks and registered trademarks of Spansion LLC in the United States and other countries Other names used are for informational purposes only and may be trademarks of their respective owners Fuji
15. rs and Wireless BLE Bluetooth Low Energy and USB connectivity solutions Cypress is committed to providing its customers worldwide with consistent innovation best in class support and exceptional system value SPANSION Colophon The products described in this document are designed developed and manufactured as contemplated for general use including without limitation ordinary industrial use general office use personal use and household use but are not designed developed and manufactured as contemplated 1 for any use that includes fatal risks or dangers that unless extremely high safety is secured could have a serious effect to the public and could lead directly to death personal injury severe physical damage or other loss i e nuclear reaction control in nuclear facility aircraft flight control air traffic control mass transport control medical life support system missile launch control in weapon system or 2 for any use where chance of failure is intolerable i e submersible repeater and artificial satellite Please note that Spansion will not be liable to you and or any third party for any claims or damages arising in connection with above mentioned uses of the products Any semiconductor devices have an inherent chance of failure You must protect against injury damage or loss from such failures by incorporating safety design measures into your facility and equipment such as redundancy fire protection and
16. th sensorless drive 29671096 Motor speed from 1000 rpm to 7000 rpm with hall sensor drive MCU AN 500067 E 14 Page 22 co 120 DC Inverter Control SOFTUNE C LIB Application Note V1 4 FUJITSU Chapter 8 Additional Information 8 Additional Information For more information on how to use MB9595330 EV Board BGM adaptor and SOFTUNE please refer to Motor EV Board MB2146 440 E HW User Manual or visit Websites English version http www fujitsu com cn fsp services mcu mb95 application notes html Simplified Chinese Version http www fujitsu com cn fss services mcu mb95 application_ notes html MCU AN 500067 E 14 Page 23
17. tsu Semiconductor Shanghai Co Ltd Application Note F2MC 8FX FAMILY 8 BIT MICROCONTROLLER MB95330 SERIES 120 HALL SENSOR SENSORLESS DC INVERTER CONTROL F2MC 8L 8FX SOFTUNE C LIBRARY APPLICATION NOTE cO FUJITSU 120 DC Inverter Control SOFTUNE C LIB Application Note V1 4 co FUJITSU Revision History Revision History Version Date Updated by Modifications 1 0 2009 11 20 Kevin Wang First draft 1 1 2009 11 30 Kevin Wang Modify 1 2 2010 01 11 Kevin Wang Modify 1 2 2010 03 08 Kevin Wang Modify 4 1 1 3 2010 03 30 Kevin Wang Update motor drive waveform and back waveform 1 4 2010 12 07 Kevin Wang Add HW description Add DTTI c file Add drive level choice function Add get motor speed function Add how to adjust parameter Add more motor fail indicate This manual contains 23 pages The products described in this manual and the specifications thereof may be changed without prior notice To obtain up to date information and or specifications contact your Fujitsu sales representative or Fujitsu authorized dealer Fujitsu will not be liable for infringement of copyright industrial property right or other rights of a third party caused by the use of information or drawings described in this manual 3 The contents of this manual may not be transferred or copied without the express permission of Fujitsu The products contained in this document are not inten
18. unsigned short start duty on unsigned short start period unsigned short normal duty on unsigned short normal period Start motor from reset with sensorless drive Motor State will be MOTOR NORMAL or MOTOR FAILURE Startup and normal run parameters are initialized start duty startup carrier frequency duty on duration in 125ns unit Start period startup carrier period in 125ns period unit Normal duty on carrier duty on duration when startup changes to normal run in 125ns unit normal duty carrier period in normal run mode Sensor Less Start 400 1600 200 800 60us on time during startup 400 x 125ns gt 60000 5kHz carrier frequency gt 1600 x 125ns startup carrier period 25us on time just after startup 200 x 125ns gt 25000 10kHz carrier frequency gt 800 x 125ns normal run carrier MCU AN 500067 E 14 Page 14 cO 120 DC Inverter Control SOFTUNE C LIB Application Note V1 4 FUJITSU Chapter 5 Library Functions and External Variables Input parameters Input parameters Input parameters extern void Motor_Parm unsigned long speed_con unsigned short csd unsigned short cad unsigned short camaskt unsigned short stmaskt Define runtime parameters with sensorless drive Define speed constant for speed checking Define commutation delay duration Define the duration between change state and change arm Define the mask off period just after change arm Define the mask off period during start
19. up speed 6000000 2us x number of pole pair csd in x100 electric angle cad in x100 electric angle camaskt in x100 electric angle stmaskt in 1us unit Motor Parm 15000000 0 200 200 2000 2 pole pair gt 60 2us x 2 15000000 0 change state delay after back zero crossing gt 0 2 change arm delay after back zero crossing gt 200 After change arm mask time 2 200 During startup 2ms 2000 x 1us gt 2000 extern void Motor Set Change Speed unsigned short speed Set or change target rotational speed in RPM whenever sensorless drive or hall sensor drive is used speed in RPM Motor Set Change Speed 6000 Set target speed to 6000rpm Stop motor without brake All driving outputs are inactivated Speed checking timer is stopped Multi function timer is reset Input capture edge detection are disabled Void MCU AN 500067 E 14 Page 15 co 120 DC Inverter Control SOFTUNE C LIB Application Note V1 4 FUJITSU Chapter 5 Library Functions and External Variables Count change arm time extern void Hall_Sensor_Start unsigned short duty_on unsigned short period Start motor from reset with hall sensor drive Motor State will be MOTOR NORMAL or Description MOTOR_FAILURE Parameters are initialized duty_on Carrier frequency duty on duration in Input parameters 125ns unit period Carrier period in 125ns period unit LOOK NENNEN Hall Sensor Start 150 800 18 75us on t
20. uuu u sea Mul A 18 B 11 1 E E 18 6 1 2 Change Motor Speed 19 6 1 3 Set Motor Rotation Direction 19 Um Mabloolteco RT 20 6 1 5 Get Motor Speed uuu l u pbi a ardeo Ret te AI ica E C 20 6 1 6 Adjust Parameter oet bna tad un tado 21 7T SAMPLE PROGRAM 22 8 ADDITIONAL INFORMATION a anni U uuu u u u u 23 MCU AN 500067 E 14 Page 5 120 DC Inverter Control SOFTUNE C LIB Application Note V1 4 co FUJITSU Chapter 1 Introduction 1 Introduction This document describes the implementation of 120 conduction hall sensor sensorless brushless DC motor control using the provided F2MC 8L 8FX SOFTUNE C library and the Fujitsu MB95F330 8 bit microcontroller The operation principles specification library installation library function description and operation of library functions are included MB95F330 series 8 bit Micro controller can be used to control the operation of a 3 phase brushless DC motor using the 120 conduction inverter control solution MCU AN 500067 E 14 Page 6 120 DC Inverter Control SOFTUNE C LIB Application Note V1 4 FUJITSU Chapter 2 Operation Principles and Theory 2 Operation Pr
Download Pdf Manuals
Related Search
Related Contents
CyKEGGParser User Manual - The Institute of Molecular Biology WinDev - Edition RLM W14 Copyright © All rights reserved.
Failed to retrieve file