Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Faster Time to Market using Scilab/XCOS/X2C for motor control algorithm development

721 views

Published on

Rapid Prototyping becomes very popular for faster algorithm development. With a graphical representation of the algorithm and the possibility to simulate complete designs, engineers can help to reduce the time to market. A tight integration with MPLAB-X IDE allows the combination with standard C-coding to easily get mass production code. This solution was used to optimise a sensorless field oriented controlled PMSM motor driven pump efficiency. A model for closed loop simulation was developed using X2C blocks [1][2] for the FOC algorithm based on the existing application note AN1292 [3]. Enhancements to the original version were implemented and verified with simulation. The X2C Communicator was used to generate code of the new algorithm. With the online debugging capabilities and the scope functionality the algorithm was further tuned and optimized to achieve the highest possible efficiency of the pump.

Published in: Engineering
  • DOWNLOAD THAT BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book that can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer that is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story That Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money That the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths that Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

Faster Time to Market using Scilab/XCOS/X2C for motor control algorithm development

  1. 1. 1www.esi-group.com Copyright © ESI Group, 2019. All rights reserved.Copyright © ESI Group, 2019. All rights reserved. www.esi-group.com Faster Time to Market using Scilab/XCOS/X2C for motor control algorithm development Christoph Baumgartner, Microchip Technology Inc. Scilab Conference 2019
  2. 2. 2www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. Class Agenda • Rapid Prototyping Overview • Develop and simulate your application • IDE integration (MPLAB X, MCC, Harmony3) • Run and verify your model on your target platform • Sensorless field oriented control demo • Summary
  3. 3. 3www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. Rapid Prototyping Commercial: Matlab/Simulink + Microchip Toolboxes OPENSOURCE: SCILAB/Xcos + X2C
  4. 4. 4www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. the Goal..... Simulate a physikal system .1 Generate code from the simulation .2 Verify simulation and real world .3 variable load Dynamometer algorithm motor
  5. 5. 5www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. Rapid Prototyping - birds view MPLAB XSCILAB / XCOS / X2C X2C communicator simulation (PC) realtime UART verification code generation hardware
  6. 6. 6www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. Installation MCHP_X2C_V6.xx.yy Select which modules you want to install: • X2C • X2C Demos • X2C MCC Library • X2Cscope (C-project UART debugging) • X2Cscope MCC library • X2Cscope demo projects • X2Cscope library projects • X2C Harmony 2 • MHC2 X2C integration • Harmony 2 X2C demos • X2C Harmony 3 • MHC3 X2C integration • Harmony 3 X2C demos • Activate X2C in Scilab
  7. 7. 7www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. Structure of X2C Model INports X2C housekeeping X2C Blocks Model OUTports
  8. 8. 8www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. X2C Libraries OPENSOURCE
  9. 9. 9www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. MCHP MC library We have developed a MC libraries with • 16bit fract • 32bit fract • 32bit float The library is available for free. dsPIC implementation uses the original MCLib.
  10. 10. 10www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. Building Process MPLAB X or with batch file right after code generation
  11. 11. 11www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. Realtime Tuning/Debugging Interfaces: UART USB/CDC Ethernet CAN
  12. 12. 12www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. Documentation Automatic documentation using MikTex and doxygen
  13. 13. 13www.esi-group.com Copyright © ESI Group, 2019. All rights reserved.  Generated code is human readable  Instant online parameter update to target  Simulation with “target code” in XCOS  Automated documentation generation  Virtual oscilloscope  Comprehensive libraries  Multiple fixed and floating point implementations  Inbuilt parameter conversion  Parameter upload (from target), incl. model  MISRA conformity of blocks (X2C library only)  Multirate model support  ANY 16 and 32 bit device from Microchip is supported  Fully integrated into MPLAB Harmony3 and MCC  UART, USB-CDC,TCPIP, CAN support  dsPIC specific MClibrary X2C Highligths
  14. 14. 14www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. Miktex Software packages X2C Library blocks (from LCM) Scilab XCOS X2C Communicator Model code X2C.c X2C.h Framework project Peripheral driver MPLAB X MCC Harmony2/3 doxygen PDF documentation
  15. 15. 15www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. Workflow (existing project + compileandflash.bat) 1. Start MPLAB X + open project + MCC 2. Goto X2C MCC library [MPLAB X] 3. Open model [MPLAB X-X2C MCC lib] 4. Start the Communicator [XCOS] 5. Develop the model [XCOS] 6. Transform Model and push to communicator [XCOS] 7. Generate C-code (automatically executes the post process batch for compiling and programming) [Communicator] 8. {Verify UART settings [Communicator]} 9. {Connect to hardware [Communicator]} 10. {Start Scope [Communicator]} 11. Modify block parameters [Communicator or XCOS] 12. Restart at 5 4 6 1 2 3 7 9 10
  16. 16. 16www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. DEMO 1. Click on X2C 2. Open the Scilab model
  17. 17. 17www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. 1st Demo (continued) Execute initProject.sce & Simulate your model with run.sce Play with parameters and simulate again !!!
  18. 18. 18www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. 1st Demo (continued) 1st start the communicator 2nd transfer the model to the communicator
  19. 19. 19www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. Automatic programing from X2CCommunicator Make sure you have generated code with MCC, this has updated the „compileandflash.bat“ file with your compiler and programmer settings. Add the compileandflash.bat from the .X project directory as a Post-Generate script in the X2CCommunicator settings The next time you generate model code it will automatically compiled and programmed.
  20. 20. 20www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. 1st Demo (continued) Parameters can also be modified by clicking onto a model block. Even changing with the mousewheele is possible.
  21. 21. 21www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. Code structure main init communicate mainTask() Inports.x handling *Outports.y handling X2C_update(); interrupt: execution rate: X2C_sampletime Model execution Communication with the scope.
  22. 22. 22www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. Class Summary • Today we covered: • Rapid Prototyping based on SCILAB/X2C • Develop a model • Simulate and generate code • Verify the simulation results on the real hardware • POWERFULL INTEGRATION in MICROCHIP IDE
  23. 23. 23www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. don‘t forget: WE spin motors!!!
  24. 24. 24www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. LEGAL NOTICE SOFTWARE: You may use Microchip software exclusively with Microchip products. Further, use of Microchip software is subject to the copyright notices, disclaimers, and any license terms accompanying such software, whether set forth at the install of each program or posted in a header or text file. Notwithstanding the above, certain components of software offered by Microchip and 3rd parties may be covered by “open source” software licenses – which include licenses that require that the distributor make the software available in source code format. To the extent required by such open source software licenses, the terms of such license will govern. NOTICE & DISCLAIMER: These materials and accompanying information (including, for example, any software, and references to 3rd party companies and 3rd party websites) are for informational purposes only and provided “AS IS.” Microchip assumes no responsibility for statements made by 3rd party companies, or materials or information that such 3rd parties may provide. MICROCHIP DISCLAIMS ALL WARRANTIES, WHETHER EXPRESS, IMPLIED, OR STATUTORY, INCLUDING ANY IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY DIRECT OR INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL, OR CONSEQUENTIAL LOSS, DAMAGE, COST, OR EXPENSE OF ANY KIND RELATED TO THESE MATERIALS OR ACCOMPANYING INFORMATION PROVIDED TO YOU BY MICROCHIP OR OTHER THIRD PARTIES, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE POSSIBLITY OF SUCH DAMAGES OR THE DAMAGES ARE FORESEEABLE. PLEASE BE AWARE THAT IMPLEMENTATION OF INTELLECTUAL PROPERTY PRESENTED HERE MAY REQUIRE A LICENSE FROM THIRD PARTIES. TRADEMARKS: The Microchip name and logo, the Microchip logo, AnyRate, AVR, AVR logo, AVR Freaks, BeaconThings, BitCloud, CryptoMemory, CryptoRF, dsPIC, FlashFlex, flexPWR, Heldo, JukeBlox, KEELOQ, KEELOQ logo, Kleer, LANCheck, LINK MD, maXStylus, maXTouch, MediaLB, megaAVR, MOST, MOST logo, MPLAB, OptoLyzer, PIC, picoPower, PICSTART, PIC32 logo, Prochip Designer, QTouch, RightTouch, SAM-BA, SpyNIC, SST, SST Logo, SuperFlash, tinyAVR, UNI/O, and XMEGA are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. ClockWorks, The Embedded Control Solutions Company, EtherSynch, Hyper Speed Control, HyperLight Load, IntelliMOS, mTouch, Precision Edge, and Quiet-Wire are registered trademarks of Microchip Technology Incorporated in the U.S.A. Adjacent Key Suppression, AKS, Analog-for-the-Digital Age, Any Capacitor, AnyIn, AnyOut, BodyCom, chipKIT, chipKIT logo, CodeGuard, CryptoAuthentication, CryptoCompanion, CryptoController, dsPICDEM, dsPICDEM.net, Dynamic Average Matching, DAM, ECAN, EtherGREEN, In-Circuit Serial Programming, ICSP, Inter-Chip Connectivity, JitterBlocker, KleerNet, KleerNet logo, Mindi, MiWi, motorBench, MPASM, MPF, MPLAB Certified logo, MPLIB, MPLINK, MultiTRAK, NetDetach, Omniscient Code Generation, PICDEM, PICDEM.net, PICkit, PICtail, PureSilicon, QMatrix, RightTouch logo, REAL ICE, Ripple Blocker, SAM-ICE, Serial Quad I/O, SMART-I.S., SQI, SuperSwitcher, SuperSwitcher II, Total Endurance, TSHARC, USBCheck, VariSense, ViewSpan, WiperLock, Wireless DNA, and ZENA are trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. SQTP is a service mark of Microchip Technology Incorporated in the U.S.A. Silicon Storage Technology is a registered trademark of Microchip Technology Inc. in other countries. GestIC is a registered trademark of Microchip Technology Germany II GmbH & Co. KG, a subsidiary of Microchip Technology Inc., in other countries. All other trademarks mentioned herein are property of their respective companies. © 2017, Microchip Technology Incorporated, All Rights Reserved.
  25. 25. 25www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. Thank you

×