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.

X2C -a tool for model-based control development and automated code generationfor microprocessors

1,190 views

Published on

Peter Dirnberger, Stefan Fragner

Nowadays, the market demands compact, stable, easy maintain-and customizable embedded systems. To meet these requirements, afast, simple and reliable implementation of control algorithms is crucial. This paper demonstrateshow model-based design with the help of Scilab/Xcosand X2C, developed by LCM,simplifiesand speedsup the development and implementation of controlalgorithms. As an example, acontrol schemefor a bearingless motoris presented.

Published in: Engineering
  • Be the first to comment

  • Be the first to like this

X2C -a tool for model-based control development and automated code generationfor microprocessors

  1. 1. 1www.esi-group.com Copyright © ESI Group, 2019. All rights reserved.Copyright © ESI Group, 2019. All rights reserved. www.esi-group.com Model-based control development and automated code generation Peter Dirnberger, Linz Center of Mechatronics GmbH Scilab Conference 2019
  2. 2. 2www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. Content of the presentation • Short introduction • What is X2C • Structure • X2C Libraries • X2C Communicator • Building process • Online Debugging and Tuning (X2C Scope) • Example: Control of a bearingless motor with X2C • What is a bearingless motor • Position control • Speed control • Km transformation matrix • Power fail • Benefits of X2C
  3. 3. 3www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. Introduction • Linz Center of Mechatronics GmbH (LCM) • R & D service provider • Transfers research results into industrial application • Founded 2001 • 110 Employees • 3 Business Areas • Drives • Electrical Drives • Hydraulic Drives • Mechanics & Control • Sensors & Communication • Peter Dirnberger • I live in Linz, Austria • I have studied Mechatronics at the Johannes Kepler University • Since 2005 I have been working at LCM – Electrical Drives Vienna Linz Salzburg Munich AUSTRIA Praha www.lcm.at
  4. 4. 4www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. Structure of a X2C control model X2C-Hardware-Outports (OUT)X2C-Hardware-Inports (IN) X2C-Blocks X2C-Function-Blocks Target (ANSI C) Model Boot loader (optional) PC (Xcos) X2C Communicator Model Frame program Application IN OUT
  5. 5. 5www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. Ready-made and tested blocks X2C Libraries General Control Math MotorControl BearinglessMotorControl MotorSensorless StateControl X2C libraries of the free version Additional X2C libraries
  6. 6. 6www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. X2C Block Select block implementation: • Boolean • 8 bit fixed point • 16 bit fixed point • 32 bit fixed point • 32 bit floating point • 64 bit floating point Input/change of a control parameter by • typing a value • pressing the arrow buttons • turning the mouse wheel Parameters can also be defined by variables.
  7. 7. 7www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. X2C Communicator Setup communication via • Serial • CAN • Ethernet
  8. 8. 8www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. Building Process download to target (X2C boot loader required) create code (X2C.c/X2C.h) compilation (with target IDE)
  9. 9. 9www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. Online parameter tuning Tuning of a control parameter by • typing a value • pressing the arrow buttons • turning the mouse wheel • by a double click on the block in the Xcos model • by X2C Communicator GUI In both cases the parameters can be determined online when the Communicator is connected to the target.
  10. 10. 10www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. Debugging – X2C Scope – a virtual oscilloscope trigger modes sampling time The monitoring of • block inputs • block outputs • global variables • memory addresses is possible Gain and offset values simplify interpretation, the signal can be converted into physical quantities
  11. 11. 11www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. Content of the presentation • Short introduction • What is X2C • Structure • X2C Libraries • X2C Communicator • Building process • Online Debugging and Tuning (X2C Scope) • Example: Control of a bearingless motor with X2C • What is a bearingless motor • Position control • Speed control • Km transformation matrix • Power fail • Benefits of X2C
  12. 12. 12www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. Bearingless motor Drive Radial bearing Axial bearing Power Electronics Axial bearing Radial bearing Bearingless Motor Power Electronics Backup bearing • Magnetically supported drive • Drive and suspension are decoupled • Separate design/optimization of drive and bearings is possible • Mechanical and electrical hardware demands are quite high • “Bearingless” motor • Compact system (mechanically and electrically) • Drive and suspension system are coupled • More complex control structure is needed Silber S.: „Beiträge zum lagerlosen Einphasenmotor“, Dissertation, Johannes Kepler University Linz, 2000
  13. 13. 13www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. Bearingless slice motor Slice rotor = diameter of the rotor is large in comparison to its length Advantage: three of the six degrees of freedom can be stabilized passively by reluctance forces • axial position • two tilting directions Only the radial position of the rotor must be controlled actively to levitate the rotor Barletta N., Schöb R.: “Design of a bearingless blood pump”, Proc. 3rd Int. Symp. Magnetic Suspension Technology (ISMST), pp 265-274, 1995
  14. 14. 14www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. Bearingless slice motor • Axial position - stabilized passively Gruber W., Amrhein W., Haslmayr M.: “Bearingless segment motor with five stator elements - design and optimization”, IEEE Trans. Industry Applications, vol. 45, 2009 Gruber W., Amrhein W., Stallinger T.: "Bearingless segment motor with buried magnets", JSME Journal of System Design and Dynamics, vol. 3, no. 5, pp. 704-716, 2009 • Radial position – must be controlled actively • Determine radial positon via position sensors • With the five stator coils, forces are applied to center the rotor in the middle • Torque – in addition a conventional rotating field is generated with the five stator coils (like a standard PMSM) • Two tilting directions - stabilized passively x y
  15. 15. 15www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. Bearingless slice motor Gruber W., Silber S.: “20 Years Bearingless Slice Motor - its Developments and Applications”, ISMB15, 2016 Most common design variants
  16. 16. 16www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. X2C control scheme for bearingless motor control in Xcos Position controlx y
  17. 17. 17www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. X2C control scheme for bearingless motor control in Xcos Speed control Rotor angle and speed determination
  18. 18. 18www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. X2C control scheme for bearingless motor control in Xcos Km transformation matrix 0 180 360 -20 0 20 0 180 360 -20 0 20 0 180 360 -500 0 500 0 180 360 -20 0 20 0 180 360 -20 0 20 0 180 360 -500 0 500 0 180 360 -20 0 20 0 180 360 -20 0 20 0 180 360 -500 0 500 0 180 360 -20 0 20 0 180 360 -20 0 20 0 180 360 -500 0 500 0 180 360 -20 0 20 0 180 360 -20 0 20 0 180 360 -500 0 500 φ[°] Fx [A /N]turns Fy [A /N]turns T turns[A /Nm] i1i5i4i3i2 Calculate target values for the five coils currents from the demanded force and torque values Silber S., Amrhein W.: "Power optimal current control scheme for bearingless PM motors", Proc. 7th International Symp. on Magnetic Bearings (ISMB), pp. 401-406, 2000 • The Km matrix results from inverting the Tm matrix. • To determine the Tm matrix, the rotor is centered and each phase is energized one after the other. The phase-related resulting forces acting on the rotor in x- and y-direction as well as the torque are determined as a function of the rotor angular position and arranged in matrix form as Tm. x y
  19. 19. 19www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. X2C control scheme for bearingless motor control in Xcos Current control
  20. 20. 20www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. X2C control scheme for bearingless motor control in Xcos Power failure - what now? In order to keep the levitation of the rotor stable, energy is required.  Use of the energy stored in the rotation of the rotor
  21. 21. 21www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. Content of the presentation • Short introduction • What is X2C • Structure • X2C Libraries • X2C Communicator • Building process • Online Debugging and Tuning (X2C Scope) • Example: Control of a bearingless motor with X2C • What is a bearingless motor • Position control • Speed control • Km transformation matrix • Power fail • Benefits of X2C
  22. 22. 22www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. time Benefits of using X2C Conclusion unit test design coding X2C Model Block time specification acceptance test integration test
  23. 23. 23www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. Benefits of using X2C Conclusion • Graphical design of the control scheme with pre-designed and pre-tested blocks • X2C Scope - a virtual oscilloscope intuitive tool for online data visualization and debugging • Instant online parameter update from Xcos to target • Simulation with “target code” in Xcos • Automated documentation generation for projects • Comprehensive libraries with pre-tested blocks • Independent of target • Multiple fixed and floating point implementations • Inbuilt parameter conversion (e.g. continuous time to discrete time) • Generated code is easily readable
  24. 24. 24www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. Thank you This work has been supported by the COMET-K2 Center of the Linz Center of Mechatronics (LCM) funded by the Austrian federal government and the federal state of Upper Austria https://x2c.lcm.at/ x2c@lcm.at

×