Analyzing the coupling process of distributed mixed real-virtual prototypes
The ongoing connection and automation of vehicles leads to a closer interaction of the individual vehicle components, which demands for consideration throughout the entire development process. In the design phase, this is achieved through co-simulati…
Authors: Peter Baumann, Lars Mikelsons, Oliver Kotte
ANAL YZING THE COUPLIN G PROCESS OF DISTRIB UTED MIXED REAL-VIR TUAL PROTOTYPES Peter Baumann Lars Mikelsons Dieter Schramm Oliver Kotte Chair for Mechatronics Chair for Mechatronics Rob ert Bos ch Gm bH Univ ers ity of Aug s burg Univ ers ity of Duisbur g-Essen peter. bauma nn5@de.bosch.com Augsburg, Germany Duisburg, Germany oliver .kott e@de.bosch.com lars.m ikels ons@informatik.uni-augsburg.de schram m@ime ch.de KEYW ORDS Computer Aided Engineer ing, XiL, Co-Simulation, Real- Time, Time- Delay Compensation ABSTRA CT The ongoing connection and automation of vehicles leads to a closer interaction of the individua l vehicle comp o- nent s, which demands fo r consideration throughout the ent ire developmen t process. In the design pha se, this is achiev ed through co-simulation o f comp one nt mo d- els. How ever, complex co-simulation environment s are rarely (r e -)used in the verification and v alidation phases, in which mixed rea l-virtual prototypes (e.g. Hardware- in-the-Lo op) are alrea dy av ailable. One rea son for this are coupling error s such as time-delays, which inevita bly o ccur in co-simulation of vir tual and real-time systems, and which influence system b ehavior in an unknown and generally detrimen tal w ay . This con tribution in tro duces a nov el, ada ptive metho d to co mpens ate for constant time-delays in p otentially highly nonlinear, spatially dis- tributed mixed real- virtual prototypes, using small feed- forward neur al netw orks. Their optimal initialization with resp ect to defined freq uency do main featur e s r esults from a-prior i frequency domain analysis of the ent ire cou- pled system, including co upling faults a nd comp ensation metho ds. A linear and a nonlinear e xample demonstr ate the metho d and emphasize its suitabilit y for nonlinear sys- tems due to o nline training a nd a daptation. As the com- pens ation metho d req uires knowledge only o f the band- widths, the prop osed metho d is a pplicable to distributed mixed r eal-virtua l pro totypes in gener al. INTR ODUCTION Current tr e nds in the automotive sector like c onnected and autono mous driving functions are leading to a clos er coupling of different vehicle domains. This is for example the case in the developmen t of an emerge ncy brake assis - tants throug h the in terac tio n o f long itudinal control a nd brake manag ement. In order to enable a time- and cost- efficient dev elopment o f such cross-domain v ehicle func- tions, the int era ctions of the domains must be co nsidered at an early stage of the development pro cess . Sim ula- tion exp erts interconnect the different simulation mo d- els, by coupling v arious to ols using the metho ds of co- simulation [9]. This wa y co mplex cro ss-domain mo del- in-lo op (MiL) co-s im ulations ar e implemented. Since the mo deling a nd integration effort to set up such co- simulations is high, the demand is coming up to use the same co-simulation environment not only during the de- sign phase, but a lso in the verification and v alidation phase of the developmen t pro cess. In those phases, fir st comp onents o f the vehicle are av a ilable as real ha rd- ware on test benches. Coupled to the ex isting MiL co- simulation, detailed mixed real- virtual prototypes ar e re- alized to test the hardware or softw are in op en context un- der realistic (e.g. traffic) conditions. But, due to the rea l- time requir ement, couplings b etw een simulation mo dels and ha r dware (HiL) alwa ys co me with co upling faults (e.g. time-delay or measurement noise ). If, in addition, the unchanged mo dels from the MiL co- s im ulation are to be used, the coupling fa ults even increase, since the mo d- els can generally not be compiled on a real-time op er ating system, but run on a standard Windows PC. F urthermore, there are use ca ses for cross- company co llab oratio n using mixed real- v irtual pro totypes, since the co mplex it y of the systems is increasing and their handling requires a wide range of different c o mpe tencie s , which mo st companies do not have in house. The additional dis ta nce b etw een the coupled systems in those use cases further increases the co upling faults a nd their negative effect o n the ov erall coupled sys tem. This contribution addr e s ses the time-delays in distributed mixed real-vir tual prototypes, by propos ing a nov el, ada p- tive comp ensation metho d combined with a detailed ana l- ysis of the dynamic effects a s imulator dis tribution has on the ov erall system. After cov ering related w ork from the fields of distributed mixed r eal-virtual pr ototypes a nd coupling fault comp ensa tion, the comp ensa tion method based o n a feedforward neural netw ork is pre s ented. The results of the following analysis of the ov erall s ystem in frequency domain are then used for an optimal comp en- sation method design. Finally , the applicability of the metho dology on a nonlinear e xample is shown. RELA TED WORK Recently the developmen t of mixed rea l-virtual proto- t yp es in the automotive sector gained some mo men tum through the releas e of the Distributed Co -Simulation Pro - to col (DCP) [12]. The DCP is designed to standardize the coupling o f real-time or non real- time s imu lator s and th us reducing the integration effort o f s pa tially distributed pro- totypes. In literature many exa mples for the transition from vir - tual to r eal tes ting using mixed real-vir tual prototype s can b e found. A to olchain fo r a seamless transition from a MiL co-s im ulation to heteroge ne o us HiL tes ting is pr e- sented [11]. Using this to olchain, an e ngine test b ench is coupled to real-time vehicle dy na mics and environment mo dels. Mixed real-vir tual prototypes ca n also b e used to incorp ora te the driver in the tes ting pro cess, e .g . by in- vestigating the interaction betw een humans and an a uto- matic trans mis sion in a driving simulator [15]. Since test benches usually do not stand s ide by side, it is reasona ble to use the int ernet when coupling them. E x amples for mixed real-vir tual prototype coupled via the internet can be found in [7] and [16]. In [2] additionally the DCP is used for the int egr ation. In all mentioned examples, the fo cus is on implement- ing the c oupling itself. Coupling faults as delays and drop outs, sp e cified in [16], a r e known but the use of com- pens ation metho ds is no t yet widesprea d. In the sci- ent ific fields of telerob otics [13] a nd netw orked control systems [1] many metho ds are develop ed to comp ensate for these coupling faults, but the co mpens a tion is imple- men ted in the controls themselves. F or mixed rea l-virtual prototypes, how ever, the physical mo dels should not b e mo dified, which is why the comp ensation must be im- plement ed in the co upling signals [17]. In [18] a mo del- based-coupling metho d is presented which is meant for the usa ge for mixed rea l-virtual pro totypes and is tested on a n engine test b ench. The parameters of tw o second order linear systems are identified online to compensa te for the delay . A linea r four th order FIR filter is intro- duced in [17]. T oge ther with a recursive lea st squar es algorithm as identification metho d, the filter is designed to cop e with c o mmu nication time delays, da ta-losses and noisy mea surements. How ever, there is no comp ensation metho d ca pable of rep- resenting nonlinear signa l b ehavior. In addition, the influ- ence of the comp ensatio n on the ov erall system sho uld be predictable and v erifia ble and its pa rameteriza tion sho uld ideally be ba sed o n the dynamics of the coupled system itself. COMPENSA TION ME THOD This pap er cons ider s the coupling pr o cess b etw e e n t wo distributively co upled sy stems (e.g . vehicle co mpo nents) “A” and “B”, at least one o f whic h is a rea l-time system. The communication or macro step size ∆ T is the c onstant rate a t which data is exchanged b etw een the tw o systems. The coupling faults that oc cur in a distributed coupling of mixed real-vir tual prototypes are a ttributable to effects like co mm unication time-delay , jitter, determinis m and message loss [16]. Since the time-delay is usua lly the most dominant fault in a distr ibuted sy s tem, the others are neglected in this pap e r . This simplifies the faults to a constant time-delay τ w hich repre s ents the time b etw een sending a mess age fr o m “ A” and rece iving it at “B” a nd vice versa. The macro step size fixes its r esolution, it holds τ = k · ∆ T with k ∈ N . T o c o mpe ns ate for the time-delay , a n algor ithm is needed which is placed a t each input u of ea ch system participa t- ing in the distributed r eal-time co -simulation. The com- pens ation method extrap ola tes the delayed input u t − τ to get a pr edicted input v alue ˆ u t at time t . In order to ma ke the metho d applicable for as many simulation too ls a nd real-time systems as p oss ible , the extr ap olation is signal- based and only the cur rent as well as past v alues (and no deriv a tives) o f the inputs a re used for the extrap olation. Figure 1 gives an overview of the co upled s ystem, the s ub- script of y , u and ˆ u sta nd for the p oint in time at which the sig nal is ev a luated. Sys A time-delay Sys B y t time-delay neural network neural network ˆ u t u t − τ Figure 1 : Overview of the Considere d Coupled Sy stem F or extrap ola tion, small feedforward neural netw orks ar e used here. If the activ a tion function o f all netw ork no des is linear and a vector ~ u cons isting of p pas t signal v a lues is the input to the netw o rk, the output of the netw ork reads as ˆ u t = ~ a T ~ u + b with ~ a = a 1 a 2 . . . a p and ~ u = u t − τ u t − τ − ∆ T . . . u t − τ − ( p − 1)∆ T . (1) The vector ~ a and the sc a lar b are calcula ted from the weigh ts of the net work. As alre ady s ta ted b y [6], this equals a linear a utoregr essive mo del, which is a gen- eralization of commonly used extrap o lation metho ds in co-simulation as zero-o rder-hold (constant extra po lation, ZOH) and firs t-order-ho ld (linear extra p o lation, FOH). The recursive FIR-Filter for time-dela y compensatio n in [1 7] is based o n the same function. The main adv antage of using a feed forward neur al net- work fo r the extrap ola tion is the fa c t that it c a n b e ex- tended to represent nonlinear signa l b ehavior, by c ho osing a nonlinear a ctiv ation function in the hidden lay er(s). If Rectified Linear Units (ReLU) or, to preven t parts o f the net work from “dying”, leaky ReLUs ar e chosen as activ a - tion function, the netw ork is enabled to switc h be tw een different config ur ations of the para meter s ~ a and b . F or ex- ample, a hidden lay er with n neuro ns with (leak y) ReLU activ atio n implemen ts n 2 different parameter sets o f ~ a and b dep ending on which hidden no de is a ctive a nd which is not. But b etw ee n the switching p oints the netw ork re- tains its linear b ehavior from equatio n (1), whic h allows a detailed analysis of the co mpe ns ation b ehavior, even in the no nlinear case. F ur thermore, the s tr ucture o f the neu- ral netw or k allows using efficient alg orithms for the initial training as well as a n o nline adaptio n of the weigh ts of the net work. ANAL YSIS OF THE COUPLING PR O CESS The coupling fa ults influence the b ehavior of a distr ibuted mixed r eal-virtua l proto type sig nificantly . It is not un- likely that an originally s table sy stem gets unstable due to the c o upling and the as so ciated coupling faults. In order to increase the confidence in mixed real-vir tual pro - totypes by making statements on robustness rega rding the co upling faults, this section aims to analy ze the entire closed-lo op system including coupling faults a nd c o mpe n- sation metho d in fre quency domain. Firs t, the tr ansfer function of the coupling pro ce s s including co upling faults and co mpens a tion metho d is calcula ted and se cond it is shown using an example how this trans fer function can be utilized to analyze the influence of the co upling faults and o f the comp ensatio n metho d on the clo sed-lo op sys- tem. F urther more, it is shown in the next section that the comp ensation metho d can b e initialized optimally base d on this analy s is. As alr eady mentioned in [3], a detailed analysis of a co- simulation is also p os sible in time domain via a m ulti-rate approach, but due to the v ariable step size solvers usually used for physical models , the ana ly sis would beco me very complex. Instead, in this pap er, the analy sis is car ried out in frequency domain which leads to the following as- sumptions: 1. All sub-systems, their inputs and their outputs ar e assumed to b e ideally time contin uous. It follows that the numerical erro rs ma de by a solver due to ev alua ting the system equations at discrete p oints in time are neglected. The mea surement erro r that o c- curs when rea ding out v alues of real-time systems (e.g. test b enches) is als o neglected. 2. The macr o step size ∆ T is constant and small eno ugh to av oid alia sing in all coupling signals. This is veri- fied via the Nyquist-Shannon theorem with the con- dition ¯ ω ∆ T << π fo r the ratio of the maximal band- width ¯ ω o f the coupling signa l and ∆ T [4]. 3. The co upling faults are simplified to a consta n t time- delay τ (see previo us section). Since all inputs and outputs o f the s ub-systems a re time contin uous, it is r e a sonable to assume that als o the cou- pling pro cess is a time contin uous ele men t whic h includes the overall co rrelatio n b etw een the cont inuous o utput sig- nal of a sub- s ystem and the contin uous input signa l of another sub-sy stem. The co upling pro cess inc ludes tw o different effects. On the o ne ha nd, the disturbing effects of sampling and delay due to data exchange and commu- nication and, on the other hand, the added metho ds of comp ensation a nd r econstruction to comp ensate for these effects. Figure 2 displays an ov erview of tw o distributively coupled systems “A” and “B” and the coupling element . T o enable a closed-lo o p analysis of the coupled sy stem in frequency domain, the La place transfor m is a pplied to each co mpo ne nt sepa rately . The transfer function of the disturbing effects G f ( s ) describ es the correla tion be tw een an output s ignal y ( t ) and the ideally recons tructed input u s ( t ) of another sub-system in frequency domain. Hence, Sys A sampling time-delay compensation reconstruction Sys B sampling time-delay compensation reconstruction y ( t ) u s ( t ) ˆ u ( t ) G p ( s ) G c ( s ) G f ( s ) Figure 2 : Co mpo nents o f the Real-Vir tual Pro totype under ass umption 2) and 3 ) ho lds U ( s ) = 1 ∆ T · e − sτ | {z } G f ( s ) · Y ( s ) . (2) A detailed deriv ation on why the influence of the sam- pling can b e represented by a sca ling with 1 ∆ T under these circumstances can b e found in [4]. The authors car ry out the Laplace transfo rmation of a coupling pro cess of a non-itera tive offline co-simulation (without delay and comp ensation). The transfer function G c ( s ) represe nts the freq ue nc y do - main corr elation of the ideally reconstructed input u s ( t ) and the applied input ˆ u ( t ). It holds ˆ U ( s ) = G c ( s ) · U ( s ) . (3) G c ( s ) is now derived for a feedforward neural netw ork with linear activ ation function as comp ensation and ZOH as the reconstructio n metho d. Starting p oint to g et G c ( s ) is equa tion (1) which contains the s ampled b ehavior of the comp ensation metho d under co nsideration of the constant time-delay τ . Including the ZOH r econstruction leads to a piece wise constant function in time domain ˆ u ( t ) = ~ a T ~ u + b with n ∆ T ≤ t < ( n + 1)∆ T . (4) The Laplac e transfo r m of ˆ u ( t ) is defined as L{ ˆ u ( t ) } ( s ) = ∞ X n =0 w ( n +1)∆ T n ∆ T ˆ u ( t ) e − s ∆ T dt. (5) The linearity prop erty of the Laplace transfor m a llows a separate tr ansformation of each summand of ˆ u ( t ). F o r the first summand ˆ u 1 ( t ) = a 1 · u t − τ equation (5) simplifies to L{ ˆ u 1 ( t ) } ( s ) = ˆ U 1 ( s ) = ∞ X n =0 w ( n +1)∆ T n ∆ T ˆ u 1 ( t ) e − s ∆ T dt. (6 ) Since ˆ u 1 ( t ) is piece wise constant in, it ho lds ˆ U 1 ( s ) = ∞ X n =0 ˆ u 1 ( t ) e − sn ∆ T − e − s ( n +1)∆ T s (7) = a 1 1 − e − s ∆ T s | {z } G c 1 ( s ) ∞ X n =0 u t − τ e − sn ∆ T | {z } U 1 ( s ) . (8) This results in the Lapla ce transform of the first summand G c 1 ( s ) of G c ( s ), which is equal to a ZOH extrap olation scaled by a 1 . The tr ansform for all other summands of ˆ u ( t ) works accordingly under co ns ideration of an addi- tional time shift. T her efore it holds G c ( s ) = p − 1 X n =0 a n +1 e − ns ∆ T · 1 − e − s ∆ T s + b s e − s ∆ T (9) for a comp ensation taking p past signal v alues in to a c - count. Finally , using eq ua tions (2) and (3), the ov era ll coupling pr o cess in frequency domain G e ( s ) can b e writ- ten a s G p ( s ) = G f ( s ) · G c ( s ) (10) = p − 1 X n =0 a n +1 e − ( τ + n ∆ T ) s · 1 − e − s ∆ T s ∆ T + b s ∆ T e − ( τ +∆ T ) s . (11) Remarks: • The metho dolo gy also a llows using other metho ds to reconstruct the input b etw een macr o time steps (e.g . F OH) by changing equa tion (4) acco rdingly [4]. • When using a piece wis e linear activ a tion function in the neura l ne tw or k (e.g. ReLU or lea k y ReLU) the b ehavior is nonlinear. Of course in this case the Laplace transfor m is not v alid any more, but s ince the net work will still maintain a piece wise linear struc- ture, each linear comp onent can b e transformed sep- arately , to examine the different p ossibilities of the transmission b ehavior of the neural netw ork. Linear Tw o-Mass Oscillator Using the example of a tw o-ma ss oscillator, it is shown how the tra nsfer function of the coupling pro ces s G p ( s ) can b e used to estimate the overall system behavior of a distributively coupled system. Here, this is done purely in simulation with sy nt hetic coupling faults b etw een the sub-systems. Two via spring and damp er co nnected mo dels o f single mass osc illa tors form the tw o-mas s oscillator as can be seen in figure 3. A t the da shed line, the oscillator is di- m 1 m 2 c 1 c c c 2 d 1 d c d 2 x 1 x 2 Figure 3 : Linear Two-Mass Osc illa tor vided in to tw o sub-mo dels ea ch containing one mass. The mo dels ar e coupled using the so ca lle d force/displa cement coupling [14] a pproach, where one mo del calculates the coupling force and rece ives p ositio n a nd velocity of the mass of the other model. T able 1 contains the pa rame- ters o f the slightly damped co upled sy stem. A Laplac e transfor m of the system equa tio ns of the tw o single mas s o scillators [14] yields their transfer functions T able 1: Parameters of the Two-Mass Osc illa tor (SI) Parameter V alue m 1 , m 2 100 , 1 c 1 , c 2 , c c 10 d 1 , d 2 , d c 0 . 01 G mass 1 ( s ) and G mass 2 ( s ). T ogether with the transfer function o f the coupling pro cess G p ( s ) the coupled sys- tem ca n b e interpreted as a control cir cuit, which allows stability ana lysis with Bo de and Nyq uist plots. Figur e 4 sketc hes the idea . G p ( s ) G mass 1 G p ( s ) G mass 2 Figure 4 : Interpretation of the System as Control Circuit. In order to determine G p ( s ) explicitly , numerical v alues m ust b e assig ned to the pa rameters o f the distr ibuted simulation a nd the comp ensation method. The macro step s ize is set to ∆ T = 0 . 001 s and the delay p er coupling direction to τ = 0 . 0 03 s . The resulting ro und-trip-time of RT T = 0 . 006 s is muc h lower than e.g. in a coupling via the internet, but since the t wo-mass oscilla tor is a strongly coupled system, even this sho rt round-trip-time has an effect on the system b ehavior. The neural net work which is used for c o mpe ns ating the delay is implemented in Python using the K eras pack- age [5]. The size of the netw ork and esp ecia lly the num be r of inputs (considered past sig nal v alues) is a trade-o ff b e- t ween computatio n reso urces needed and the capability o f the net work to repres ent no nlinea r signal behavior. With a linear activ ation function of cour se, the c apability of the net work do es no t increas e w ith the num b er o f neur ons [6], but for the time-delay comp ensa tion of a nonlinea r signa l a single ne ur on is not sufficient. The chosen netw o rk size of four input neur ons, tw o hidden neurons and o ne output neuron is the smallest, which gives go o d results a lso for nonlinear signa ls (see nonlinear example). F or this example, the w eights of the netw ork are obtained by tra ining the net work before simulation on a self-created data set which is based o n simulation results o f the t wo- mass oscillator with different initial conditions (without faults). Since this is cumbersome, section presents how the information from the analy sis shown her e can be used to optimally parameteriz e the netw ork in adv a nce without training. After the training the parameter s (equation (1)) calculated fr o m the weigh ts of the netw or k read a s ~ a = 2 . 4748 − 0 . 647 0 − 0 . 166 4 − 0 . 666 4 , b = 0 . (12) Thu s, the co upling pro cess including comp ensation for this example can b e determined by equatio n (11 ). Multi- plying the transfer functions, as shown in figure 4, r esults in the op en-lo o p tr a nsfer function repre s entation o f the ov erall distributively coupled s ystem G sys ( s ) = G mass 2 ( s ) · G p ( s ) · G mass 1 ( s ) · G p ( s ) . (13) Figure 5 s hows the open lo op Bode plot of G sys ( s ). The blue curve is the reference without co upling effects ( G p ( s ) = 1), red curve is with included faults and triv- ial (ZOH) comp ensatio n and the yellow curve is with in- cluded faults and neural netw ork co mpe ns ation. First of all, the tw o resonance frequenc ie s of the t wo-mass oscil- lator ar e clearly visible and, mo re imp or ta nt ly , they do not c hange by a dding faults o r the comp ensation metho d. This means the qualitative system b ehavior stays the same. The Bo de plot is also useful to verify , that the frequency bandwidth o f the sy stem (a r eas with hig h fre - quency amplifica tion) is b elow 6ra d /s and therefore small enough to av oid a liasing (ass umption 2). It is further ob- served, that the mag nitude for high frequencies is la rger when the comp ensation metho d is included in the con- trol circuit. How ever, this amplification is no t critica l, since the t wo-mass oscillator itself da mpens very s trongly in this frequency r ange. In the b o de phase dia gram a rapidly decreasing phase for hig h fr e quencies is visible, which is t ypical for systems with delays. It is notice- 10 − 1 10 0 10 1 10 2 10 3 10 4 10 − 8 10 − 3 10 2 ω [rad/s] Magnitude [-] reference faults faults and co mp ensatio n 10 − 1 10 0 10 1 10 2 10 3 10 4 − 300 − 200 − 100 0 ω [rad/s] Phase [degr ee] Figure 5 : Bo de P lot of G sys ( s ) able that without comp ensation the phase deviates awa y from the reference within the bandwidth, whereas with comp ensation the phas e follows the reference in a larger frequency r ange. How this affects stability can b e inv estiga ted using the Nyquist plo t in figure 6 . A clo se lo ok a t the area around the cr itical p oint P c = ( − 1 , 0 j ) reveals a deviatio n o f the Nyquist lo cus in the case witho ut comp ensatio n. The en- circlement of the Nyquist lo cus a r ound the critical p oint is different from the referenc e when the faults are intro duced and changes ba ck to the referenc e w hen the comp ensa tio n is added (Nyquist Stabilit y Criterion). This b ehavior is confirmed w ith simulation results: The system with fa ults is unstable witho ut the co mpens ation and can b e stabi- lized by a dding the comp e nsation metho d. The r eference system is of course s table, since a t wo-mass oscilla tor is a mechanically sta ble s ystem. − 5 − 4 − 3 − 2 − 1 0 − 0 . 01 0 0 . 01 Real Axis Imaginary Axis reference faults faults and co mp ensation critical point P c Figure 6 : E nlargement o f Nyquist P lo t of G sys ( s ) with a pre-trained Neural Net work as Co mpens ation Metho d This section revealed tw o imp or tant things: Firstly , an analysis of the overall system b ehavior of a distributed real-vir tual proto t yp es in the freque nc y doma in is possi- ble. This allows, for example, to chec k in adv a nce whether a sy stem can b e stabilized under a cer ta in time-delay with a cer tain comp ensatio n a nd recons truction metho d. Of course these statements are sub ject to some simplifica- tions and assumptions a nd can therefore not b e trans- ferred one-to- one to r eality , but the basic system behavior under certain co upling er rors can b e demonstrated with this analys is a pproach. Secondly , it is shown that the trained neural netw ork is able to compe ns ate for the cou- pling faults. DESIGN OF THE COMPENSA TION ME THOD The idea is to use the a na lysis metho d fro m the last sec- tion not only for chec king the sy stem b ehavior under the influence o f delays and a comp ensation metho d, but also for an optimal design of the co mpe ns ation metho d itself. This e limina tes the need for training the neura l netw ork in b efor ehand. The c o mpe ns ation metho d is very flex ible due to the pa- rameters ~ a and b . Therefore , r equirements for the b e- havior of the c omp ensation in the frequency domain ar e made first, b efore o n that basis an optimization pro blem is defined, by whose s olution the o ptimal para meters a re found. Since the comp ensation depends strong ly on the configuratio n and pro per ties of the coupled sy stems, the requirements are defined for the transfer function o f the ov erall coupling pr o cess G p ( s, ~ a, b ). The para meters ~ a and b must b e chosen such that • P p a p + b = 1, which leads to lim w → 0 G p ( s = j ω ) = 1 and thus a correc t extrap olation of cons tant signa ls. • the magnitude of G p ( s ) within the bandwidth of the coupled sys tem is neutral ( | G p ( j ω ) | = 1). • the phase shift of G p ( s ) within the bandwidth of the coupled sys tem is neutral ( ∠ G p ( j ω ) = 0 ◦ ). • outside the bandwidth fr equencies o f the co upled sys- tem, the combined magnitude of all coupling pr o- cesses G p ( s ) do es not increase faster than the magni- tude of the coupled system de c r eases. This guaran- tees that additional amplifica tions of G sys ( s ), which are introduced by G p ( s ), will be damp ed by the dy- namics of the coupled system itself. The second and third r e quirement ensur e the compe nsa- tion of the coupling faults in frequency ranges where the coupled sys tem is dynamically active. All requirements ar e w eighted and com bined into a sin- gle ob jective function, but a multi-criteria optimization would also b e p ossible. The co mbined ob jective function of the optimization pro blem with s = j ω r e ads as J ( a, b ) = αJ a + β J p + γ J r , with (14) J a = w ω bw,max ω bw,min 1 − | G p ( j ω ) | ω bw, m ax − ω bw, m in dω (15) J p = w ω bw,max ω bw,min ∠ G p ( j ω ) ω bw, m ax − ω bw, m in dω (16) J r = w ω bw,min 0 max ( | G p ( j ω ) , 1) dω − ω bw, m in (17) + w 2 π ∆ T ω bw,max max | G p ( j ω ) | − ω ω bw, m ax v , 0 dω . (18) The bandwidth fr e q uencies o f the coupled sys tem a re within the in terv al [ ω bw, m in , ω bw, m ax ] and the remaining frequencies (up to the s ampling frequency) in [0 , ω bw, m in ) and ( ω bw, m ax , 2 π ∆ T ]. The optimization pr oblem res ults in min a,b J ( a, b ) such that X p a p + b = 1 . (19) Remarks: 1. It shall a pply γ >> α, β , to ensur e that the coupling pro cess stays inside the mag nitude bo undary for fre- quencies o utside the bandwidth frequencies . F urther- more ho lds α = 100 β to punish a phase difference of 1 ◦ equally a s a magnitude erro r of 1% [4]. 2. Parameter v depends on the relative degr e e r of the coupled sys tem. It ho lds v = 1 2 r 3. The calculation o f the ob jective function is p os sible with very little system informa tion. T r ansfer func- tions of the coupled subsystems are not necessa ry . The bandwidth of the coupling s ignals could instead be estimated by F o urier transfor mations of the cou- pling s ignals and the relative degr e e can b e s et co n- serv atively to o ne in ca se of doubt. The ba ndwidth of the tw o mass oscilla tor is in the ra ng e [1 r ad s , 6 r ad s ] and the relative degree is r = 2. Th us, the nu merica lly found s o lution of equatio n (19) is ~ a opt = 6 . 5103 − 1 . 550 9 − 9 . 929 6 5 . 9702 , b opt = 0 . (20) Figure 7 and 8 show the b o de plot and the enlarged nyquist plot with the ne ur al netw ork co mpens ation, ini- tialized with the o ptimized ~ a opt and b opt . Similar r esults as in the tra ined version o f the neural netw ork are ob- tained. The deviation of the n yquist curve b etw een the reference and the comp ensated version is even s maller than with the trained neural netw ork. 10 − 1 10 0 10 1 10 2 10 3 10 4 10 − 8 10 − 3 10 2 ω [rad/s] Magnitude [-] reference faults faults and comp ensation 10 − 1 10 0 10 1 10 2 10 3 10 4 − 300 − 200 − 100 0 ω [rad/s] Phase [degree] Figure 7 : B o de Plo t of G sys with a n Optimally Initialized Neura l Netw ork a s Comp ensa tio n − 5 − 4 − 3 − 2 − 1 0 − 0 . 01 0 0 . 01 Real Axis Imaginary Axis reference faults faults and comp ensation critical p oint P c Figure 8 : Enlarg ement of Nyquist Plo t of G sys with a n Optimally Initialized Neural Netw o rk as Comp ensation NONLINEAR EXAMPLE In the la st sectio n, an o ptimal time-delay comp ensation of the for m o f equation (1) was designed on the bas is of very little sy s tem infor mation. No w the question ar ises why neural netw orks sho uld b e used as comp ensation metho d at all, since they a re more complex to calculate a nd imple- men t than equation (1) (and with linear activ ation func- tion they b ehave exactly alike). The adv a ntages of the neural netw ork is that it can b e adapted online by train- ing in pa rallel and is a lso capable of represent nonlinear signal b ehavior. T o s how this, a no nlinearity ex tends the tw o-mass o s cil- lator system from figure 3. A mechanical stop preven ts the first mass from p o sitioning b eyond x 1 ,stop = − 0 . 1 m . This is implemen ted by r eversing the velo cit y of the first mass v ′ = − e · v at x 1 ,stop [8]. The co efficient of res ti- tution is e = 0 . 7, which leads to a partly inelastic co l- lision. F or x 1 > x 1 ,stop the system b ehaves linea r and corres p o nds ex actly to the t w o-ma ss oscilla tor from s ec- tion (all system parameters ar e identical), whereby the optimized comp ensation pa rameters from equatio n (20) are also optimal in the nonlinea r sy stem. Figure 9 shows simulation results with the nonlinear tw o - mass o scillator. The oscillation starts fro m the initia l co n- dition x 1 , 0 = x 2 , 0 = 1 and no external forces a ct on the system. The b ouncing of the first mass is visible and a ll curves lie on top o f each other, which means that the cou- pling faults hav e no significant effect on x 1 during the first 50 s of the simulation. 0 10 20 30 4 0 50 0 0 . 5 1 Time [s] x1 [m] reference faults faults and co mpensatio n Figure 9 : Position of the First Mass for t ∈ [0 s, 50 s ] Figure 10, which shows the same s im ulations 40 0 s later , reveals a larg e deviation of the simulation r esults and also different convergence prop er ties of the coupled system. The sligh t damping reduces the oscillation a mplitude of 450 460 470 480 490 500 − 0 . 1 0 0 . 1 0 . 2 Time [s] x1 [m] reference faults faults and compensa tion Figure 1 0: Position o f the First Mass for t ∈ [45 0 s, 500 s ] x 1 in each perio d in the reference simulation a s well as in the simulation with faults and comp ensa tio n. In the end a ll the energy will b e dis s ipated and the sys tem will end up in its equilibrium. In the simulation with faults and without comp ensation, the oscillation amplitude of x 1 stays a t 0 . 1 m and the ma ss hits the mechanical stop in ea ch p er io d. The ener gy fed into the s y stem ea ch pe- rio d due to the insta bilit y caused by the faults (figure 6) is dissipated b y the partly elas tic collisio n with the me- chanical stop. Figure 11 shows, how ever, the problem of the co mpens a - tion metho d desig ned o n the linear system. The velocity reversal at the mechanical stop causes jumps in the cou- pling signal ˙ x 1 , which leads to an ov ersho o t b y factor a 1 ,opt = 6 . 5103 of the comp ensation. In this par ticular case, the large comp ensation er rors at the jumps do not effect the overall system b ehavior significantly (sy stem is still stable , s ee figure 10), but in gener a l such la rge er rors should b e av oided. 0 10 20 30 4 0 50 − 4 − 2 0 2 4 Time [s] ˙ x 1 [m/s] reference faults and co mpensatio n Figure 1 1: V elo city of the Firs t Mass with L inea r Neural Net work as Comp ensation Here the adv antages of the neural netw ork can b e fully utilized. Instea d of a linea r activ a tion function, leaky Re- LUs ar e now use d in the tw o neurons of the hidden lay er, which enables the netw ork to s witc h b etw een four differ- ent b ehaviors. The netw or k is initialized the sa me wa y a s the linear neura l netw ork from the pr evious exa mple, but is now adapted during the simulation. T he o nline training is p e r formed in para lle l in a n external pro ces s, in order not to influence the computation time of the comp ensa- tion. F o r this pur po se, the v alues of the sampled coupling signal are stored during the simulation and s ent to the training pro cess together with the c urrent configur ation of the neural net work. There, tr aining data is c r eated from the da ta p oints. Each training sample consis t of an input v ector ~ x with p consecutive data po int s and a re- sp onse y , which c o ntains the data p oint k = τ ∆ T steps after the latest v alue of the input vector. The neura l net- work from the co mpe ns ation pro cess is then duplica ted and optimized in the training pro cess, to minimize the cost C ( w ) = 1 N N X i =1 L ( f ( x i , y i , w )) (21) for N training sa mples. The function f stands for the neural netw ork with the weigh ts w . The loss function L implements the mean-squar ed-erro r alg orithm and the optimizer Adam [1 0], a gr adient-descen t algorithm with adaptive learning rate, so lves the optimization pr oblem. Once the optimization is complete, the updated weigh ts are sent to the comp ensa tion pro cess, w her e the neural net work is up dated. This online a daption pro c e ss can b e rep eated se veral times during a s im ulation. Figure 12 shows the simu lation r esults of ˙ x 1 again, but this time the online training w as ac tive. After the first jump at 4 . 5 s , the first online tra ining cycle starts and fin- ishes a few seco nds la ter. This w ay , the netw ork is able to switch its behavior at the second jump and the pre- dicted sig nal do es not ov ersho ot anymore. If the simula- tion would now b e carried out using the adapted neural net work as comp ensatio n metho d r ig ht from the star t, also no overshoot would o ccur at the first jump. 0 10 20 30 40 50 − 4 − 2 0 2 4 Start of first online training End of first online training Time [s] ˙ x 1 [m/s] reference faults and comp e nsation Figure 12: V elo city of the Fir st Mass with Nonlinear and Online Adapting Neural Netw ork a s Comp ensa tion CONCLUSION AND FUT URE W ORK Current trends in the automotive sector require dis- tributed mixe d r eal-virtual test appr oaches. In this work a feedforward neural netw ork is used as a generalized com- pens ation metho d for the coupling faults (constant time- delay) of mixed re a l-virtual pro totypes. In order to b e able to make statement s in adv ance on how the co m- pens ation metho d will be have in a spatially distributed co-simulation, a n analysis metho d in frequency doma in is prop ose d that descr ibes the overall coupling pro cess. Even with very little information o n the coupled subsys- tems, it is p ossible to use the analysis to determine the parameters of the neur al netw ork via optimiza tio n in such a wa y that the coupling faults ar e comp ensated optimally . F urthermor e, it is sho wn that the ne ur al ne tw or k based comp ensation is also able to adapt to nonlinear sig nal be- havior using an online learning str ategy . F uture work will on the one hand fo cus on the co ns ider- ation of different fault effects to b e able to analyz e the coupling pro cess in a more r ealistic wa y . On the other hand the entire metho dolog y will b e tested on a rea l, in- dustrial test b ench coupled to a MiL simulation. REFERENC ES [1] John Baillieul and Panos J. Antsaklis. Control and com- municatio n challenges in netw ork ed real-time systems. Pr o c e e dings of the I EEE , 95(1):9–2 8, 2007. [2] Peter Baumann, Martin Krammer, Mario Driussi, Lars Mik elsons, Josef Zehetn er, W erner Mair, and Dieter Schramm. Using th e distributed co-simulation proto col for a mix ed real-virtual prototype. I n Pr o c e e dings of 2019 IEEE International Confer enc e on Me chatr onics , Ilme- nau, Germany , 2019. IEEE Indu strial Electronics S ociety . [3] Martin Benedikt and Edo Drenth. R elaxing stiff sy stem integ ration by smoothin g techniques for non-iterative co- sim ulation. In I UT AM Symp osium on Solver-Coupling and Co-Simulation , pages 1–25. Springer, 2019. [4] Martin Benedikt , Daniel W atzen ig, and Anton Hofer. Modelling and analysis of the non-iterative coupling p ro- cess for co-sim ulation. Mathematic al and Computer Mo d- el l ing of Dynamic al Systems , 19(5):451–470 , 2013. [5] F ran¸ cois Chollet et al. Keras. https://keras .io , 2015. [6] Georg Dorffner, editor. Neur al networks for time series pr o c essing . Citeseer, 1996. [7] T u lga Ersal, Mark Brudnak, A shw in Salvi, Jeffrey L. Stein, Zoran Filipi, and Hosam K . F athy . Develo pment of an internet-distributed hardware-in-the-loop simulation platform for an automotiv e application. American So- ciet y of Mec hanical Engineers, 2009. [8] Heinz A. Gall. Zur simulation von haftreibung und mech- anisc hen anschl¨ agen. ASIM Nachrichten , 1:4–9, 2001. [9] Cl´ audio Gomes, Casper Thule, David Broman, Pe- ter Gorm Larsen, and Hans V angh eluw e. Co-sim ulation: a survey . ACM Computing Surveys (CSUR) , 51(3):49, 2018. [10] Diederik P . Kingma and Jimmy Ba. Adam: A metho d for stochastic optimization. arXiv pr eprint arXiv:1412.6980 , 2014. [11] Serge Klein, Rene Sa velsberg, F eihong Xia, Daniel Guse, Jak ob And ert, T orsten Blo ch witz, Claudia Bellanger, St e- fan W alter, Steffen Beringer, Janek Jo chheim, and Nico- las Amringer. Engine in the loop: Closed lo op test b ench control with real-time simula tion. SAE Interna- tional Journal of Commer cial V ehicles , 2017. [12] Martin Krammer, Martin Benedikt, T orsten Bloch witz, Khaled Alekeish, Nicolas Amringer, Christian Kater, St e- fan Materne, Rob erto Ruval caba, Klaus Sch uch, Josef Ze- hetner, Micha Damm-N orwig, Viktor Schreiber, Natara- jan N agara jan, Isidro Corral, T ommy Sparb er, Serge Klein, and Jak ob And ert. The Distributed Co-Simulation Protocol for the Integration of Real-Time Systems and Simulati on Environmen ts. 2018. [13] Dale A . Lawrence. Stability and transp arency in b ilateral teleoperation. IEEE tr ansactions on r ob otics and automa- tion , 9(5):624–637, 1993. [14] Pu Li. O n the Numeric al Stability of Co-Simul ation Meth- o ds . PhD thesis, T echnisc he Universit¨ at Darmstadt, 2017. [15] Niko Maas, Benjamin H esse, Martin Kopp ers, and Di- eter Schramm. Simula tor setup according to use case scenarios-a human-orien ted method for v irtual devel op- ment. IEEE, 2014. [16] Viktor S c hreib er, V alentin Ivano v , Klaus Augsburg, Matti Noac k, Barys Shyrok au, Co rina Sandu, and Pieter Schalk Els. Sh ared and d istributed x-in - the-lo op tests for automotive systems: F easibilit y stu d y . IEEE A c c ess , 6:4017–40 26, 2018. [17] Georg S tettinger, Martin Benedikt, Markus T ranninger, Martin Horn, and Josef Zehet n er, ed itors. R e cursive FIR- Filter design f or fault-toler ant r e al-time c o-simulation , 2017. [18] Georg Stettinger, Martin H orn, Martin Benedikt, and Josef Zehetner. A mo d el-based app roac h for prediction- based interco nnection of dynamic systems. IEEE, 2014.
Original Paper
Loading high-quality paper...
Comments & Academic Discussion
Loading comments...
Leave a Comment