程磊LMSImagine.LabAMESim&Virtual.LabMotionCouplingLMSMasterClass程磊AMESim与Virtual.LabMotion联合仿真Virtual.LabMotionSystemmodel作动器模型产生的力/力矩被驱动部件的运动状态信息位移/速度/加速度电液系统模型机构动力学模型Virtual.LabVirtual.LabMotionMotionActuatorsForces/Torquesfromhydraulics/electrical/1DmechanicalsystemsMass&InertiachangesSensorsTranslationaldisplacement,velocity,accelerationAngulardisplacement,velocity,accelerationsMotioncurves,forceelements程磊AMESim与Virtual.LabMotion联合仿真AMESim与Virtual.LabMotion可以通过三种方式进行闭环耦合分析:Co-Simulation方式AMESim和VLMotion求解器在分析过程中同时运行,分别求解各自的模型,在设定的通讯步长上通过接口进行信息交换采样保持方法Master-Slave方式也称Coupled方式:VLMotion作为Master求解器AMESim电液系统模型编译为dll文件,集成到VLMotion中,VLMotion作为主求解器,分析过程中由VLMotion进行积分求解此种方式可以将AMESim模型参数和变量导入VLMotion,即WatchParameter和WatchVariable,允许在VLMotion中直接修改AMESim模型的参数,而无需回到AMESim中修改,再重新导入FunctionEvaluation方式VLMotion模型方程通过坐标缩并形成ODE方程集成到AMESim中,作为AMESim的一个子模型,在求解过程中,AMESim求解器作为主求解器,负责进行积分计算,而VLMotion求解器仅负责评价函数结果可通过Optimus对AMESim和VLMotion机电耦合系统进行整体参数优化程磊CosimulationversusCoupledSimulationCoupledSimulationAllstateequations(fromMotionANDAMESim)aresolvedbytheMotionsolverMustuseControlInput/OutputCo-simulationBothSolversRunandcommunicateatadiscretetimeintervalStateequationsaresolvedbyMotionandAMESimsolversrespectivelyMustusePlantInput/OutputCommunicationdelaybetweensolvers(communicationinterval)Virtual.labMotionImagine.LabAMESimPost-processavailableinbothenvironments!Post-processavailableinbothenvironments!程磊Pre-InstallationforCoupledOptionInstallVisualStudio.Net2003InstallAMESim8BCopyVCVARS32.batfromVisualStudio.Net2003installinto…\AMESim\v810Copynmake.exefilefromVisualStudio.Net2003\Vc7\binto…\AMESim\v810InstallVirtual.Lab8BSL1CopyAMEQueryLib.dllfrom…\Virtual.Lab.R8B-SL1\intel_a\code\bindirectoryto…\AMESim\v810\win32directoryCopythewhole‘intel’folderfrom…\Virtual.Lab.R8B-SL1\DynMotionSolver\plant\ameto…\AMESim\v810\libChangetheAMEpathin‘VlStart_Solver.bat’toyourImagine.Labinstallationpath程磊InstallationguidelinesandprerequisitesAMESimusesaC++compilerforsimulation.ForcoupledsimulationwithLMSVirtual.LabtheMicrosoftVisualC++compilerhastobeused.SelecttheMicrosoftcompilerin[AMESim]OptionsAMESimPreferencesCompilation/ParametersAMESimpreferencesDifferentMicrosoftCompilerscanbeused:•MicrosoftVisualC++•MicrosoftVisual.netC++WhenusingVisualC++ExpressEditionCopythefilevcvars32.batfromtheC++installationtotheAMESiminstallationdirectoryCopythefileNMAKE.exetoyourinstallationdirectory程磊Pre-InstallationforCoSimulationInstallAMESimfirst,thenVirtual.LabWheninstallingVirtual.Lab,checkthe‘IntegratewithAmesim’ison(defaultoption).VerifythepathfoundbyVLMotioninstallertotheAmesiminstallationdirectory,alsoforCATIA,Easy5andMatlab,ifsuccessful,severallaunchoptionwillappearonthestartMenuInAMESimgoto:ModelingÆCategorypathlistÆaddpathAddthepathtotheAmesiminstallationendingwith“/libmotion”AddanSystemEnvironment:VLMOTIONSLV=…\Virtual.Lab.R8B-SL1\VirtualLab\DynMotionSolverWhenusingCoSimoption,launchAMESimfromtheStartMenu程磊GuidelinesCoupledsimulation(standardoption)Betterfor“tightly”coupledsystems,especiallywithsmallAMESimmodelsVerystrongcouplingandfastdynamicsofthehydraulicfluidswouldrequireaverysmallcommunicationinterval(hencebigCPU)forstabilityifco-simulationwasusedCo-Simulation(nottobeusedblindly)Betterfor“weakly”coupledsystems,especiallywithbigAMESimmodelsVeryloosecouplingandslowdynamicsresponsewouldsupportbiggercommunicationinterval(hencesmallerCPU)Reasonisthatthecommunicationoverheadismuchsmallerthantheadvantageofusingappropriatesolver.Generalcomments(alwaysvalidforco-simulation)Thesmallerthecommunicationinterval,thebettertheaccuracyandthebiggertheCPUused.Startingwith0.001second.Communicationintervalshouldbechangedcarefullybyfactor2MAXIMUM(upordown,dependingifbetterCPUtimeoraccuracyisrequested)becausetheresultsareverysensitivetothisparameter.程磊TipsAMESimusesMKSunits.MakesureLMSVirtual.LabMotionsolversettingsaresettoMKSUnitsorconverttheinputandoutputcontrolnodesbeforesendingthesignalstoandfromtheAMESimblock.Takecarewiththesignconventions.DependingontheMotionelementandAMESimelementconnectedthroughtheinterfaceblock,thesignmayhavetobeinverted.程磊IntegratorsChoice程磊HowtolinkAMESimtoMotionInImagine.LabAMESimDCmotorwithitscontrolInLMSVirtual.LabMotiondrivinggearoftheseatWhenactivated(leftsignal),theDCmotormakesthedrivinggearrotateModels:AMESim:elect_motor_092006.ameMotion:MODELE_COMPLET.CATAnalysis程磊Interfacesetup–step1Step1:AMESimexportIconInterfaceCreateExportIconChosetypeofinterface“VL.Motion”Defineinputsandoutputs程磊Interfacesetup–step2Step2:ConnectexportIconInsertTWSG01fromtheMechanicalLibrary(velocityin,torqueout)AddkgainsinordertobeabletoinvertthesignbetweenAMESimvariablesandMotionvariablesConnectthebuildingblocksRemarksAMESimusesMKSunitsSignconventionsbetweenMotionandAMESimaredifferent程磊Interfacesetup–step3Step3:FinalizeAMESimmodelGotoParameterMode:AMESimnowcompilesthedllthatMotionisgoingtouseGotoRunModeSelectRunParametersandclickOK:thiscreatesa*.simfilerequiredbytheMotionsolverLeaveAMES