
Physical Mo deling with Mo delica and Dymola and Real-Time Simulation with Simulink and Real Time Workshop 1 2 2 H. Elmqvist , M. Otter , and C. Schlegel 1 Dynasim AB, ResearchPark Ideon, S{223 70 Lund, Sweden, email: [email protected] 2 DLR, P.O.B. 1116, D-82230 Wessling, Germany, email: [email protected]/[email protected] 1 Intro duction A new language for physical mo deling called Mo delica has b een develop ed in an international e ort. An overview of the Mo delica language will b e given in the context of mo deling and simulating a complex industrial system: hardware-in-the-lo op simulation of an automatic gearb ox. The electronic control unit hardware has b een tested against a simulated mo del of the gearb ox. Several to ols have b een used to solve the problem. The rst issue is the mo deling. Writing the equations from scratchwould be very tedious. A structuring of the mo del according to the physical comp onents and b eing able to reuse available submo dels is essential. The new Mo delica mo deling language and a mo del library for drive trains have b een used. The graphical environment of Dymola has b een used for comp osing the mo del. The natural graphical repre- sentations are shown b elow. Ecient co de is essential for real-time simulation. The Mo delica translator of Dymola has b een used to symb olically translate the di erential-algebraic equations DAE to explicit state space form and to generate C co de in S function MEX le format. The S-function has b een used for oine simulation in Simulink whichwas also used for con guring the interface to the control hardware. Real Time Workshop has b een used for generation of the co de for dSPACE hardware. The time for the evaluation of one Euler step is 0.65 ms on a 300 MHz DEC alpha pro cessor. 2 Mo delica - A Uni ed Ob ject-Oriented Language for Physical Sys- tems Mo deling A new language for physical mo deling called Mo delica has b een develop ed in an international e ort. The main ob jectiveistomake it easy to exchange mo dels and mo del libraries. The design approach builds on non-casual mo deling with true ordinary di erential and algebraic equations and the use of ob ject-oriented constructs to facilitate reuse of mo deling knowledge. There are already several mo deling language based on these ideas available from universities and small companies. There is also signi cant exp erience of using them in various applications. The aim of the Mo delica e ort is to unify the concepts and design a new uniform language for mo del representation. The work started in the continuous time domain since there is a common mathematical framework in the form of di erential-algebraic equation DAE systems. The short range goal was to design a mo deling language based on DAE systems with some discrete event features to handle discontinuities and sampled systems. The design should allowanevolution to a multi-formalism, multi-domain, general-purp ose mo deling language. There are presently ab out 15 memb ers from 13 universities and industries in six countries in the Mo delica design group. H. Elmqvist is the chairman. Information on the Mo delica e ort, including mo deling requirements, rationale and de nition of the Mo delica language, is available on WWW at http://www.Dynasim.se/Mo delica/. The activity started in Septemb er 1996 as an e ort within the ESPRIT pro ject "Simulation in Europ e Basic ResearchWorking Group SiE-WG". In February 1997 the Mo delica design e ort b ecame a Technical Com- mittee within the Federation of Europ ean Simulation So cieties, EUROSIM. The rst version of the Mo delica language de nition was nished in Septemb er 1997. The work is now fo cused on the design of standard function and mo del libraries. An overview of the Mo delica language will b e given in the context of mo delling an automatic gearb ox. 1 3 Hardware-in-the-lo op Simulation of Gearb oxes Comfort standards regarding gearshift of automatic gearb oxes of vehicles increase p ermanently. Gearshift comfort is mainly in uenced by control of the switching elements of a gearb ox: Clutches and freewheels. Control is p erformed mostly by an electronic control unit ECU. Fine tuning of the ECU and the switching elements is essential to optimize gearshift comfort. Hardware-in-the-lo op HIL simulation is used more and more in order to sp eed up the development cycle. For the problem treated, such a setup consists of the ECU-hardware and a realtime simulation of all other comp onents interacting dynamically with it: The whole drive train of engine, hydro dynamic torque converter, gearb ox, di erential gearb ox and longitudinal dynamics of the vehicle. Mo deling such a system is dicult since the structure of the system varies during each gearshift: Dep ending on the actual control, di erent wheels and freewheels are engaged or disengaged. The integrator has to b e stopp ed and the new structure has to b e determined in accordance to the actual forces imp osed on the gearwheels by the switching elements. In the example treated, the automatic gearb ox has 6 switching elements leading to 6 2 = 64 p ossible con gurations of the system. It is shown how suchavariable structure system can b e mo deled with Mo delica. The Mo delica-translator of the simulation environment Dymola, together with Dymola's symb olic engine, is used to generate ecientcode suited for realtime simulation which e.g. requires a state space form of the mo del. A new technique, which meets the realtime requirements like xed sampling time, is used to iteratively nd a consistent con guration after a gearshift. Therefore a hardware-in-the-lo op HIL simulation of automatic gearb oxes b ecomes p ossible. The eciency of the generated co de and the sampling frequency necessary to repro duce oine simulation results enables the usage of digital signal pro cessors. 4 Mo del of Automatic Gearb ox Gearshift dynamics can only be simulated if the input- and output-torques of the gearb ox represent a real- life vehicle maneuver. Therefore, at least the engine and the longitudinal dynamics of the vehicle has to b e mo deled. A Mo delica mo del of such a system is given in gure 1as a comp osition or ob ject diagram using Dymolas ob ject diagram editor. Every icon in the comp osition diagram is an instance of a Mo delica class and represents a comp onentof the drive train. Mechanical anges of the comp onents are mo delled by Mo delica connector classes and are characterized by small square boxes in the icons. A line between two connectors de nes a rigid, mechanical coupling between the resp ective comp onents. Dashed lines respresent directed signal ow connections. car=1700 gear=13.5 FS Wind: cw=0.33 AutoGear ThrottlePos JMotorPump=0.28 Jturbine=0.034 1 TS TS Engine converter ECU ControlBox Figure 1: Comp osition diagram of vehicle drive train. The driving part of the system in gure 1 consists of the engine, the torque converter and appropriate inertias. Engine and converter are mo deled by tables. The driven part incorp orates the automatic gearb ox, the mass of 2 the car, and aero dynamic forces. Comp onent \ControlBox" represents the ECU which generates the gearshift signals. For oine simulations simple ramp functions are used. During HIL simulations these signals are generated by the hardware ECU and fed to the simulation pro cessor via appropriate interfaces like digital IO and CAN bus. Fix1 Fix2 Fix3 C8=0.12 C6=0.12 C12=0.12 Shaft1=2e-3 Shaft2=2e-3 S S C4=0.12 C5=0.12 C11=0.12 P1=110/50 P2=110/50 P3=120/44 Figure 2: Comp osition diagram of automatic gear b ox \AutoGear". In gure 2 the Mo delica mo del of the automatic gearb ox comp onent \AutoGear" is shown. It is set up by three standard planetary wheelsets, by shafts to mo del wheel inertias, by clutches and by combined clutch/freewheel elements = one-way clutches. 5 Mo delica Mo dels of Basic Drive Train Library Comp onents In the previous section the vehicle drive train mo del was built up by the connection of basic comp onents, like shafts and clutches, using comp osition diagrams. The most imp ortant comp onents from the available drive train library are now discussed in more detail. All drive train comp onents have mechanical anges which are used to connect comp onents rigidly together and which are de ned by the following Mo delica connector class a connector class is a class usable in connections: connector DriveCut Ang ul ar V el ocity : w "angular velo city of cut"; Ang ul ar Accel er ation: a "angular acceleration of cut"; ow T orque : t "cut-torque"; end DriveCut; The keyword ow indicates that the Torque variables should be summed to zero at a connection p oint. In other words, Torques are through variables. Connector class DriveCut de nes the three variables \w,a,t" using basic typ e classes de ned in the Mo delica base library typ e classes are classes which do not have equations: typ e Ang ul ar V el ocity = Real q uantity =\AngularVelo city", unit =\1/s"; typ e Ang ul ar Accel er ation = Real q uantity =\AngularAcceleration", unit =\1=s2"; typ e T orque = Real q uantity =\Torque", unit ="N.m"; All the three variable typ es are real variables with a de ned quantity and unit.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages5 Page
-
File Size-