收藏 分享(赏)

如何在matlab中使用NXP MCU的工具箱和数学函数库以及其他调试工具.pdf

上传人:精品资料 文档编号:9632947 上传时间:2019-08-19 格式:PDF 页数:145 大小:5.52MB
下载 相关 举报
如何在matlab中使用NXP MCU的工具箱和数学函数库以及其他调试工具.pdf_第1页
第1页 / 共145页
如何在matlab中使用NXP MCU的工具箱和数学函数库以及其他调试工具.pdf_第2页
第2页 / 共145页
如何在matlab中使用NXP MCU的工具箱和数学函数库以及其他调试工具.pdf_第3页
第3页 / 共145页
如何在matlab中使用NXP MCU的工具箱和数学函数库以及其他调试工具.pdf_第4页
第4页 / 共145页
如何在matlab中使用NXP MCU的工具箱和数学函数库以及其他调试工具.pdf_第5页
第5页 / 共145页
点击查看更多>>
资源描述

1、External UseTMHands-On Workshop: Motor Control Toolbox for MagniV -MATLAB/Simulink Modeling and Code Generation AMF-ACC-T1114S E P T . 2 0 1 5Mike Doidge | MCD Toolbox ManagerJohn H. Floros | Field Application EngineerTMExternal Use 1Agenda Overview: 20 minutes Introduction and Objectives Motor Cont

2、rol Development Toolbox: Library blocks, FreeMASTER, and Bootloader Hands-On Demo: 50 minutes Motor Kit (Describe Freescale 3-Phase Motor Kit) Convert simple model to run on Motor Kit with MCD Toolbox and use FreeMASTER Model Based Design: 10 minutes Model Based Design Steps: Simulation, SIL, PIL an

3、d ISO 26262 SIL/PIL Hands-On Demo Step 2 & 3 of MBD Motor Control: 20 minutes FOC Sensor-less control and how to use it to turn a motor Motor Control Hands-On Demo: 80 minutes Implement FOC Sensor-less Motor Control on Motor Kit Run software from the model and use FreeMASTER to monitor Summary and Q

4、&A: 10 minutesTMExternal Use 2Introduction: What Do We Do? One of the Automotive Tools Enablement & Engineering groups objectives is to develop software enablement tools to assist our customers with rapid prototyping and accelerate algorithm development on their target Freescale MCU This includes so

5、ftware tools that automatically generate peripheral initialization code through GUI configuration, to generating peripheral driver code from a Model Based Design environment like SimulinkTMExternal Use 3Introduction: Model Based Design (MBD) Model Based Design is becoming more common during the norm

6、al course of software development to explain and implement the desired behavior of a system. The challenge is to take advantage of this approach and get an executable that can be simulated and implemented directly from the model to help you get the product to market in less time and with higher qual

7、ity. This is especially true for electric motor controls development in this age of hybrid/electric vehicles and the industrial motor control application space. Many companies model their controller algorithm and the target motor or plant so they can use a simulation environment to accelerate their

8、algorithm development. The final stage of this type of development is the integration of the control algorithm software with target MCU hardware. This is often done using hand code or a mix of hand code and model-generated code. Motor Control Development Toolbox allows this stage of the development

9、to generate 100% of the code from the model.TMExternal Use 4Introduction: Motor Control Development Toolbox The Motor Control Development Toolbox includes an embedded target supporting Freescale MCUs and Simulink plug-in libraries which provide engineers with an integrated environment and tool chain

10、 for configuring and generating the necessary software, including initialization routines, device drivers, and a real-time scheduler to execute algorithms specifically for controlling motors. The toolbox also includes an extensive Automotive Math and Motor Control Function Library developed by Frees

11、cales renowned Motor Control Center of Excellence. The library provides dozens of blocks optimized for fast execution on Freescale MCUs with bit-accurate results compared to Simulink simulation using single-precision math. The toolbox provides built-in support for Software and Processor-in-the-Loop

12、(SIL and PIL), which enables direct comparison and plotting of numerical results.MathWorks products required for MC Toolbox: MATLAB (32-Bit or 64-Bit)* Simulink MATLAB Coder Simulink Coder Embedded Coder*Earlier released products only support 32-bitTMExternal Use 5Introduction: Reduce Development Ti

13、me With MBDand MC ToolboxSystem RequirementsModeling/ SimulationRapid PrototypeTarget MCU ImplementationHIL TestingFunctional TestingTimeUse software-based model vs. paper-based method, and start testing at very earliest stage.Convert model to SIL and now can test ANSI-generated software. Can also u

14、se MC library with SIL testing.With MC library and MC Toolbox, test Model using target MCU and compiler through PIL testing.With MC Toolbox, auto-generate code for direct interface of peripherals for target hardware without any manual hand code.Now that more testing on target has occurred earlier in

15、 the process, HIL testing time is reduced.Fewer defects found in this phase of testing, where finding defects is expensive.Using Freescales Motor Control Development Toolbox with Model Based Design and you can reduce development time from this.Reduce Time from This. . .TMExternal Use 6Introduction:

16、Reduce Development Time With MBDand MC ToolboxSystem RequirementsModeling/ SimulationRapid PrototypeTarget MCU ImplementationHIL TestingFunctional TestingTimeTo This!TMExternal Use 7Objectives After this Hands-On Workshop, you will be able to: Use the Motor Control Development Toolbox to auto-genera

17、te and build software for the MCU directly from the MATLAB/Simulink environment. Configure the MCU peripherals required to implement three phase motor control using the MCU and the low-voltage Three Phase Motor Control Kit. Implement FOC Motor Control from a model based design environment and auto g

18、enerate the code to run the brushless DC Motor provided with the Motor Kit. Know how Motor Control Toolbox can help with your motor control development projects and Freescale MCUs.TMExternal Use 8Objectives Exposure to Freescales hardware/software enablementSignal Visualizationand Data Acquisition T

19、oolModel-based designDriver configurationAssignment to pinsInitialization setupMotor Control Development Toolboxwith Simulink MTRCKTSBNZVM128BLDC Motor Control Dev KitTMExternal Use 9Agenda Overview: 20 minutes Introduction and Objectives Motor Control Development Toolbox: Library blocks, FreeMASTER

20、, and Bootloader Hands-On Demo: 50 minutes Motor Kit (Describe Freescale 3-Phase Motor Kit) Convert simple model to run on Motor Kit with MCD Toolbox and use FreeMASTER Model Based Design: 10 minutes Model Based Design Steps: Simulation, SIL, PIL and ISO 26262 SIL/PIL Hands-On Demo Step 2 & 3 of MBD

21、 Motor Control: 20 minutes FOC Sensor-less control and how to use it to turn a motor Motor Control Hands-On Demo: 80 minutes Implement FOC Sensor-less Motor Control on Motor Kit Run software from the model and use FreeMASTER to monitor Summary and Q&A: 10 minutesTMExternal Use 10MCToolboxLibrary for

22、 S12ZVMMCToolboxPeripheral block librarySimulink LibrariesMCD Toolbox: Toolbox Library ContentsTMExternal Use 11PeripheralsMCD Toolbox: Toolbox Library ContentsConfiguration/Modes Compiler Options CodeWarrior Wind River DIAB Green Hills Cosmic IAR GCC RAM/FLASH targets Simulation Modes Normal Accele

23、rator Software in the Loop (SIL) Processor in the Loop (PIL) MCU Option Multiple packages Multiple Crystal frequenciesUtility FreeMASTER Interface Data acquisition / Calibration Customize GUI Profiler Function Exec. time measurement Available in PIL Available in standalone Memory Read and Write MPC5

24、643L MPC567xK MPC574xP S12ZVM KV10Z KV31/30 KV4x 56F82xx / 56F84xxMCUs SupportedNOTE: Peripheral Block and compiler availability is dependant on which MCU is use. General ADC conversion Digital I/O PIT timer ISR Communication Interface CAN driver SPI driver I2C Motor Control Interface Cross triggeri

25、ng unit PWM eTimer block(s) Sine wave generation ADC Command List GDU (Gate Drive Unit) PTU (Prog Trigger Unit) TIM Hall Sensor Port FTM (Flex Timer Module) PDB (Programmable Delay Block)TMExternal Use 12General Motor Control LibraryGeneral Function LibraryGeneral Digital Filters LibraryMathematical

26、 LibraryMCD Toolbox: Auto Math and Motor Control Library ContentsTMExternal Use 13MLIB Trigonometric Functions GFLIB_Sin, GFLIB_Cos, GFLIB_Tan GFLIB_Asin, GFLIB_Acos, GFLIB_Atan, GFLIB_AtanYX GFLIB_AtanYXShifted Limitation Functions GFLIB_Limit, GFLIB_VectorLimit GFLIB_LowerLimit, GFLIB_UpperLimit P

27、I Controller Functions GFLIB_ControllerPIr, GFLIB_ControllerPIrAW GFLIB_ControllerPIp, GFLIB_ControllerPIpAW Interpolation GFLIB_Lut1D, GFLIB_Lut2D Hysteresis Function GFLIB_Hyst Signal Integration Function GFLIB_IntegratorTR Sign Function GFLIB_Sign Signal Ramp Function GFLIB_Ramp Square Root Funct

28、ion GFLIB_SqrtGFLIB Finite Impulse Filter GDFLIB_FilterFIR Moving Average Filter GDFLIB_FilterMA 1st Order Infinite Impulse Filter GDFLIB_FilterIIR1init GDFLIB_FilterIIR1 2nd Order Infinite Impulse Filter GDFLIB_FilterIIR2init GDFLIB_FilterIIR2GDFLIB Clark Transformation GMCLIB_Clark GMCLIB_ClarkInv

29、 Park Transformation GMCLIB_Park GMCLIB_ParkInv Duty Cycle Calculation GMCLIB_SvmStd Elimination of DC Ripples GMCLIB_ElimDcBusRip Decoupling of PMSM Motors GMCLIB_DecouplingPMSMGMCLIB Absolute Value, Negative Value MLIB_Abs, MLIB_AbsSat MLIB_Neg, MLIB_NegSat Add/Subtract Functions MLIB_Add, MLIB_Ad

30、dSat MLIB_Sub, MLIB_SubSat Multiply/Divide/Add-multiply Functions MLIB_Mul, MLIB_MulSat MLIB_Div, MLIB_DivSat MLIB_Mac, MLIB_MacSat MLIB_VMac Shifting MLIB_ShL, MLIB_ShLSat MLIB_ShR MLIB_ShBi, MLIB_ShBiSat Normalisation, RoundFunctions MLIB_Norm, MLIB_Round Conversion Functions MLIB_ConvertPU, MLIB_

31、ConvertMCD Toolbox: Auto Math and Motor Control Library ContentsTMExternal Use 14MCD Toolbox: RAppID Bootloader UtilityThe RAppID Bootloader works with the built-in Boot Assist Module (BAM) included in the Freescale Qorivva and also supports S12 MagniV, Kinetis, and DSCs family of parts. The Bootloa

32、der provides a streamlined method for programming code into FLASH or RAM on either target EVBs or custom boards. Once programming is complete, the application code automatically starts.Modes of OperationThe Bootloader has two modes of operation: for use as a stand-alone PC desktop GUI utility, or fo

33、r integration with different user required tools chains through a command line interface (i.e. Eclipse Plug-in, MATLAB/Simulink, )MCUs SupportedMPC5534, MPC5601/2D, MPC5602/3/4BC, MPC5605/6/7B, MPC564xB/C, MPC567xF, MPC567xK, MPC564xL, MPC5604/3P, MPC574xP, S12ZVM, KV10, KV3x, KV4x, 56F82xx and 56F8

34、4xx.Graphical User Interface Command LineStatus given in two stages: Bootloader download, then application programmingTMExternal Use 15FreeMASTER Run Time Debugging Tool User-friendly tool for real-time debug monitor and data visualization Completely non-intrusive monitoring of variables on a runnin

35、g system Display multiple variables changing over time on an oscilloscope-like display, or view the data in text form Communicates with an on-target driver via USB, BDM, CAN, UART Establish a Data Trace on Target Set up buffer (up to 64 KB), sampling rate and trigger Near 10-s resolutionhttp:/ Use 1

36、6MCD Toolbox: Summary of Application SupportExternal HardwareSystem InfrastructureOn-Chip PeripheralsPINSExternal ConnectionsApplication SWDriversDriversEfficientReflecting the chip featuresFreeMasterSupportDocumentationSYSTEM APPLICATIONTarget PlatformAPIMC library setAlgorithmLibrariesGFLIBGeneral

37、 functionsGDFLIBDigital filteringGMCLIB Motor ControlAPIBootloaderSupportUser Application Software TMExternal Use 17Motor Control Development ToolboxAny Questions?TMExternal Use 18Agenda Overview: 20 minutes Introduction and Objectives Motor Control Development Toolbox: Library blocks, FreeMASTER, a

38、nd Bootloader Hands-On Demo: 50 minutes Motor Kit (Describe Freescale 3-Phase Motor Kit) Convert simple model to run on Motor Kit with MCD Toolbox and use FreeMASTER Model Based Design: 10 minutes Model Based Design Steps: Simulation, SIL, PIL and ISO 26262 SIL/PIL Hands-On Demo Step 2 & 3 of MBD Mo

39、tor Control: 20 minutes FOC Sensor-less control and how to use it to turn a motor Motor Control Hands-On Demo: 80 minutes Implement FOC Sensor-less Motor Control on Motor Kit Run software from the model and use FreeMASTER to monitor Summary and Q&A: 10 minutesTMExternal Use 19Motor Kit: MTRCKTSBNZVM

40、128 BLDC Motor Control Kit The kit includes a 4 pole-pair count motor, which means that every single mechanical revolution equals four electrical revolutions. State changes in Hall sensors is every 60 degrees electrical.http:/ Use 20Motor Kit: XS12ZVMx12EVBGDU / 3-phase bridge accessMotor connectorI

41、/O Port access(for example PWM / TIM / ECLK)LIN interfaceADC inputs12 V supplyUSB-to-SCIinterfaceResolver interfaceHall interfaceResetBDM interfaceUser LEDsPower indicatorLEDsCAN optionOSBDMCurrent Sense ResistorsUser SwitchesPotentiometerTMExternal Use 21BLDC MotorPhase AHall SensorsS12ZVMAnalogGat

42、eDriveUnitS12ZVMDigitalPhase BPhase CATIMHall Sensor PortVb+Vb-PMFPotADCPWMSCIRAppID BL Utility LEDsDOSwitchesGPIOCurrent FeedbackMotor Kit: System DiagramTMExternal Use 22VREG(8pin)LIN phy(8pin)MCUorDSC(48pin)Gate Driver(48pin)Op-ampsDiscrete Solution20+3+2+S12ZVM Solution: 50 fewer solder joints -

43、 4 to 6 cm2 PCB spaceMotor Kit: S12ZVM for BLDC Motor Control4 cm1 in.64 pinTMExternal Use 23Motor Kit: Shrink Your Application Standard MCU Multiple analog IC Saves up 30% space Simplifies manufacturingTraditional Solutions System in PackageTMExternal Use 2410 Billion Electric Motors Shipped Global

44、ly in 20132.5 Billion in Automobiles, 30 Per Car Average source: IMS Research, 2013C i r c u l a r p u m p fo r h e a ti n ga n d c o o l i n g w a te r c i r c u i tEn g i n e c o o l i n g fa nSta r te rA l te r n a to r , g e n e r a t o rSte e r i n g w h e e l ,a d j u s tm e n tSc a v e n g i

45、n g p u m p ,high - p r e s s u r e p u m pH e a d l i g h t r a n g ea d j u s tm e n t u n i tH e a ti n g fa nC o o l i n g fa n fo r a i rc o n d i ti o n i n g s y s te mC i r c u l a r p u m p fo r s ta ti o n a r y h e a ti n g s y s te mMo to r fo r s ta ti o n a r y h e a ti n g s y s te mH

46、 e a ti n g a n d a i r c o n d i ti o n i n g s y s te mA B S p u m p W i n d o w w i n d e rA r i a l d r i v eI d l e p o s i ti o na d j u s tm e n t s y s te mT a i l g a te c l o s i n gR e a r w i n d s c r e e nw i p e rF u e l p u m pEr g o n o m i c b a c k r e s t,h e a d r e s t a d j u

47、s tm e n tH e a d l i g h t c l e a n i n gH e a d l i g h t ti l ti n gW i p e r sSl i d i n g r o o fMi r r o r a d j u s tm e n t C e n tr a l l o c k i n g s y s te mD o o r c l o s i n gB e l t s y s te mSe a t c o n tr o lH e a d r e s t a d j u s tm e n tBackrest ad j u st men tR e a r s e a

48、t a d j u s tm e n tC o n v e r ti b l e r o o fA c ti v e s u s p e n s i o nEPS d r i v eTMExternal Use 25Motor Kit: S12ZVM Family BLDC/PMSM/SR motor controlKey Features: S12Z CPU 50 MHz bus speed 6 ch. Gate Drive Unit (GDU) with 50-150 nC total Gate Charge drive capability, incl charge pump for High-Side, Bootstrap diodes for charging external bootstrap capacitors Embedded Vreg with switchable 5V/20 mA sensor supply LIN PHY, LIN2.1 / 2.2 / J2602 compliant Dual 12-bit li

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 企业管理 > 管理学资料

本站链接:文库   一言   我酷   合作


客服QQ:2549714901微博号:道客多多官方知乎号:道客多多

经营许可证编号: 粤ICP备2021046453号世界地图

道客多多©版权所有2020-2025营业执照举报