ADAMS、MATLAB和AMESim机电液联合仿真介绍及应用
基于Adams与Matlab的汽车电动助力转向系统的联合仿真

基于Adams与Matlab的汽车电动助力转向系统的联合仿真一、本文概述随着汽车工业的快速发展和环保理念的深入人心,电动汽车在全球范围内得到了广泛的关注和研究。
电动助力转向系统(EPS)作为电动汽车的重要组成部分,其性能直接影响到车辆的操控性和安全性。
对电动助力转向系统进行深入研究,优化其设计,提高其性能,对于推动电动汽车的发展具有重要意义。
本文旨在通过Adams与Matlab的联合仿真,对汽车电动助力转向系统进行深入研究。
介绍了电动助力转向系统的基本原理和结构,分析了其在实际应用中的挑战和难点。
详细阐述了Adams和Matlab在电动助力转向系统仿真中的应用,包括模型的建立、仿真参数的设置、仿真结果的获取和分析等。
通过Adams进行机械系统的运动学和动力学仿真,结合Matlab进行控制系统设计和优化,实现了对电动助力转向系统的全面仿真分析。
本文的研究方法结合了仿真模拟和理论分析,旨在通过联合仿真,对电动助力转向系统的性能进行深入挖掘和优化。
通过对比不同参数和设计方案下的仿真结果,本文为电动助力转向系统的设计和优化提供了有价值的参考。
本文的研究不仅有助于加深对电动助力转向系统的理解,也为电动汽车的发展提供了有益的探索和实践。
通过Adams与Matlab的联合仿真,我们可以更加准确地预测和优化电动助力转向系统的性能,为电动汽车的安全性和操控性提供有力保障。
二、汽车电动助力转向系统概述汽车电动助力转向系统(Electric Power Steering,简称EPS)是一种通过电动机提供辅助转向力矩的先进转向系统。
该系统主要由转向传感器、车速传感器、扭矩传感器、电子控制单元(ECU)和助力电机等组成。
EPS系统的核心在于电子控制单元,它可以根据驾驶员的转向意图、车速以及转向力矩等因素,实时计算出所需的辅助转向力矩,并通过助力电机为驾驶员提供适当的助力。
与传统的液压助力转向系统(Hydraulic Power Steering,简称HPS)相比,EPS系统具有诸多优势。
AMEsim与Matlab_simulink联合仿真技术

目录摘要 (1)0 引言 (1)1 联合仿真技术 (2)1.1 联合仿真技术的特点与应用 (2)1.2 联合仿真技术的实现途径 (2)2 联合仿真接口技术 (3)2.1 系统环境配置 (3)2.2 系统编译器配置 (3)3 联合仿真应用举例 (5)4 结论 (8)致谢 (8)参考文献 (9)AMESim与Matlab_Simulink联合仿真技术机械电子系0802班李敏M200870228摘要:根据AMESim与Matlab/Simulink软件各自的特点,对两者联合仿真技术进行了研究,解决了联合仿真的接口与实现问题,并把该技术应用于电液位置伺服系统的仿真,取得了良好的效果。
关键词:AMESim;Matlab/Simulink;联合仿真;接口Abstract:United Matlab/Simulink technique with AMESim and Matlab/Simulink was discussed based on their own characteristics. The problem of their interface and realization were solved. As an applied example, Matlab/Simulink of electro hydraulic servo-system was shown. Good results were achieved.Keywords:AMESim;Matlab/Simulink;United simulation;Interface0 引言传统的设计方法往往是通过反复的样品试制和试验来分析该系统是否达到设计要求,结果造成大量的人力和物力投入在样品的试制和试验上。
随着计算机仿真技术的发展,在工程系统的软件设计开发中,大量地采用了数值成型的方法,即通过建立系统的数值模型,利用计算机仿真使得大量的产品设计缺陷在物理成型之前就得到了处理,从而可以使企业在最短的时间、以最低的成本将新产品投放到市场。
AMESim和ADAMS联合仿真设置

AMESim和ADAMS联合仿真设置AMESim和ADAMS依托AMESim7.0与adams2021或2021联合仿真过程,除要用到这两中软件外还要安装完整版的vc++(注意不能要绿色版,要完整破解版)。
设置环境变量:右键点击我的电脑>属性>高级>环境变量,在administration 用户变量栏下点“新建”,设置:变量名 AME_ADAMS_HOME变量值填写你安装adams的安装路径(例如:D:\\adams2021)然后确定。
在开始>运行栏中打cmd进入dos环境,输入 echo %AME_ADAMS_HOME%注意echo后有空格,然后回车,显示你的adams安装路径(例如:D:\\adams2021)说明正确。
下面总体说一下联合仿真过程,简单的说,是两种软件量与量的交换过程。
首先在adams中会建立一个接受AMESim传来的量(f)驱动模型,然后从adams中输出一个模型量(w)传到AMESim。
建立adams模型:首先建立一个工作文件夹,adams和AMESim的工作目录全部指向它,注意这个文件夹的名字和路径全部为英文不能有其他符号和字符,视频教程中建在c盘根目录下,命名aa。
为了说明清楚,在这里仅建立了一个绕固定点旋转的杆件模型,在它和ground直接加入铰接关系,就是那个合页的连接关系,给它加入空间力矩。
然后在build下选system elements>stable variable>new建立新的变量(fAMESim输入扭矩),用同样的方法建立变量w(adams输出角速度),并且设置w的值,从build下选system elements>stable variable>modify选择model中的w,设定f=值,点击三个小点的按钮进入function build,在下拉框中选择velocity,单击anglar velocity about Z,点击assist,在to marker 栏右键单击,选择marker>browse,选择part2 cm(杆中心点),OK,Ok,删掉原有的0,然后确定,然后选择build>contral toolit>plant input在弹出对话框中,双击variable name 栏,Database Navigator中选择f,OK;同样在build>contral toolit>plant output的Database Navigator中选择w为输出变量,OK!将前面设定的扭矩值设定为f,就是在那个fuction窗口中选data element>plant input.从tool>plung manage>中选择control,调出control,在control下选择plant explorer,在plant input选择pinput1,在plant output选择poutput1,点确定。
Adams和AMESim联合仿真的设置和简单例子(都是13版本)

Adams和AMESim的联合仿真前言:本人并不是Adams和AMESim的高手,接触AMESim的时间很短,但是需要做Adams和AMEsim的联合仿真,这里分享一下我探索联合仿真的经验。
目录如下:一、仿真前需要做的准备。
1、软件的安装2、环境变量的设置二、一个具体的联合仿真例子。
(这里只介绍Adams主控的仿真)***********************************************************一、仿真前的准备1、软件的安装软件的版本对联合仿真有重要影响,这里只介绍我自己安装软件的情况。
我的系统是win7 32位,安装的软件是Adams2013、LMS b AMESim Rev 13、Visual Studio 2010。
Adams2013和AMESim Rev 13网上有很多下载资源和安装教程。
这里我只强调一下Visual Studio 2010。
也就是可以建立两个仿真软件联系的Visual C++程序。
Visual C++和VisualStudio等之间的关系大家可以自己在网上查,其实都包含有C++语言。
网上有些教程是用VC++6.0来建立两者之间的关系,但是我安装了VC++6.0的各种版本(企业版,中文版,英文版)都没有成功建立仿真,后来安装了完整的Visual Studio 2010就可以了,但是Visual Studio 2010有些大,我下载的是1.75G。
另外就是安装顺序,最好先安装VC++或者VS(我是最后安装的Visual Studio 2010,先安装的说法我这里并没有证实)。
下面是我的软件的安装位置,安装目录没有中文D:\zy\ADAMSD:\AMESimD:\Program Files\Microsoft Visual Studio 10.0在最后安装好Visual Studio 10后把D:\ProgramFiles\Microsoft Visual Studio 10.0\VC\bin下的nmake和vcvars32文件拷贝到AMESim的安装目录下D:\AMESim\v1300。
AMESim与ADAMS联合仿真操作说明

AMESim与ADAMS联合仿真操作说明摘要:物理系统可能由各种元件组成,例如气动的,机械的,液压的,电子的以及控制系统等,所有的元件协同工作。
多学科领域系统和复杂多体系统之间的相互作用很难在单一的软件平台中来仿真。
解决的方案就是通过AMESim和专用的多体动力学软件ADAMS之间的接口,使得两者在仿真中协同工作。
本文结合天线的简单实例介绍AMESim与ADAMS联合仿真的操作过程。
关键词:AMESim ADAMS 联合仿真1.引言AMESim(Advanced Modeling Environment for Simulation of engineering systems)软件是由法国IMAGINE公司于1995年推出的多学科复杂领域系统工程高级建模和仿真平台,该软件不要求用户具备完备的仿真专业知识,采用面向系统原理图建模的方法,便于工程技术人员掌握和使用。
机构动力学分析软件ADAMS (automatic dynamic of mechanical system)集建模、求解和可视化技术于一体,能有效分析和比较多种参数方案。
运用AMESim与ADAMS的联合仿真,可以有效的对设备的动态过程进行分析,根据交互分析产生的结果来评价设备的性能,为了更加真实的符合实际情况,理论分析用来完成检验产生的数值结果。
这种虚拟产品开发方法与得出的结论将对设计人员提供一定帮助。
通过AMESim/ADAMS之间的接口,有两种方式实现联合仿真:(1)将模型从一个平台中输入到另一个平台中,采用单一的积分器进行计算。
(2)各个平台分别利用自己的积分器计算自己的模型,通过预先统一的通讯间隔进行信息交换。
2.软件环境要求首先AMESim软件需要4.2级以上版本; ADAMS需要2003级以上版本(含A/Control模块)。
其次必须要有Microsoft Visual C++ 编译器。
如果需要从ADAMS环境中使用接口,那么还强烈推荐Fortran编译器,这样可以将AMESim的模型编译成为ADAMS的子函数(Subroutine)。
adamsamesim联合仿真

A/View(前、后置处理器包含模型建构、函数
A/Hydraulics(液压模组)
建构器、客户化界面设计、动画控制及输出、
A/Vibration(振动分析)
试验设计及最优设计等)
A/Solver(求解核心器,含运动、(准)静定、 动 力 学 的 线 性 及 非 线 性 分 析 , 可 与 C++ 或
MATRIXx
MATLAB
EASY5
AMESim
5
Virtual Prototyping 整合系統
设计阶段 节省时间
改善品质
BUILD
• 建构模型 • 输入 CAD 模型
TEST VALIDATE
• 建构驱动器, 感测器与建构测量 • 执行初步机构模拟
• 性能与已知资料比对 • 输入基本图表
REFINE
NO YES
• 试验设计
6
Virtual Prototyping 整合系統
设计阶段 节省时间
改善品质
BUILD
• 建构模型 • 输入 CAD 模型
TEST VALIDATE
REFINE ITERATE
• 建构驱动器, 感测器与建构测量
• 执行初I步-D机E构AS模拟
• 性能与U已G知资料比对 • 输入基C本A图T表IA
Pro/E
• 输入法C则ADDS 5 • 加入摩S擦o、lid滑w动or等ks 参数
CoCreate • What ifA?utoCAD
Microstation
改善效率 产品改善
OPTIMIZE • 最优化 • 敏感度研究
DOT
AUTOMATE
• •
使 自用 行M定ac义自ro对行命话令(G框A,SA..)
基于AMESim与Matlab/Simulink联合仿真技术的接口与应用研究

开发与设计 D i &Dvo et : ( eg e lmn ! / sn ep
基 于 A 与 Ma b\ ME i S m t l a S l k i mui n
联 合 仿 真 技 术 的 接 口与 应 用 研 究
4 )将 联 合 仿 真 的 许 可 证 文 件 lns.a 制 到 i eedt复 e AME i Sm安装 目录下 的 lns g i ei 文件夹 中。 e m 5 )确认 是 否在 AME i 中选 择 VC作 为编 译 器 。 sm 具体操 作 在 A sm— O i s AME i rf ecs " ME i p n— o Sm Pee ne ̄ r C mp ao/ aa tr 中。在 MAT . o itn P rme s li e L B命令 窗 口中输人 A 命令 Me- tD xs m ,选择 V . e C作 为编译器 。
种模 型,改变仿真参数 ,很有效地解 决仿 真技术 中的问
题。
A Sm作 为 一 个 完 整 的 系 统 工 程 仿 真 平 台, ME i Sm l k作为事实上 的控 制系统设 计 的标 准平 台。点对 i ui n 点的 AME i—ilik 口提供 了一个使用便捷 和行之 S S un 接 m nl 有效的工具用于 A Sm的被控对象模 型和控 制系统模 ME i 型之问的耦合分析 、同时利用 r A Sr 和 Sl lk的 ME i e iui n n 最佳功能 ,避 免了不同平台之间复杂模型 的重建。
i 。 m
法 国 I ai 公 司开发 的 A Sm是 当今领先 的流 mge n ME i
体 ,传动系统 和液 压/ 机械 系统 建模 ,仿真及 动力 学分
析软件。基于 Ma a tl 台的 Sm l k是动 态系统 仿真 lb平 iui n 领域 中著名的仿真集成环境 ,它在众多领域得 到广泛应 用 。S ui i lk借助 Ma m n t Mb的计算功能 ,可方便地建立各
Matlab Amesim Adams联合仿真

联合仿真可以充分利用各仿真软件的优点,从而简化建模实现快速仿真。
这里首先讲下如何实现联合仿真,工欲善其事,必先利其器。
一.Matlab与Amesim1. 安装好matlab与amesim。
要点:安装目录不要有空格,比如不要放到program files这个目录中。
2.安装编译器(compiler)Microsoft Visual C++ 6.0(必须)或者Compaq Visual Fortran Pro v6.6.0(可选),在安装过程中遇到设置环境变量的(environmental variance)选择‘yes’,免得以后自己添加麻烦3.拷贝Microsoft Visual C++ 6.0安装目录下\VC98\Bin\VCVARS32.BAT文件到Amesim的安装目录下。
比如:C:\Program Files\Microsoft Visual Studio\VC98\Bin中的VCVARS32.BAT拷贝到C:\AMESim\7.0.0下面4.设置Matlab环境变量,这样联合仿真时Amesim才能找到matlab。
在系统变量中添加‘MATLAB’,其值为Matlab的安装路径,如D:\MATLAB\R2009a。
5.在matlab中设置编译器(如下图)。
在matlab命令行里输入mex -setup,选择编译器Microsoft Visual C++6.0 ,最后选Y确定。
6. 在Amesim里选择编译器。
打开Amesim--tools--options--Amesim preferences选择Microsoft Visual C++7.在Matlab 的目录列表里加上AMESim与Matlab 接口文件所在的目录%AME%\matlab\amesim,其中%AME%是AMESim的安装目录,如果安装在C:\AMEsim ,则就加上C:\AMEsim\matlab\amesim。
(有的版本这个目录可能是安装目录\******ing\matlab\amesim)8.在matlab中set path中继续添加路径:%AME%\7.0.0\interface\simulink以及%AME%\7.0.0\interface\sl2ame9. 完成,实现amesim to simulink 和simulink to amesim 的联合仿真。
amesim与matlab联合仿真步骤(自己总结)

amesim与matlab联合仿真步骤(自己总结)Amesim与matlab 联合仿真参数设置实验软件平台Matlab2009a,amesimR8a ,VC6.0 企业版(英文版)步骤:1 将VC++中的"vcvar32.bat" 文件从Microsoft Visual C++目录(通常是.\Microsoft Visual Studio\VC98\Bin 中)拷贝至AMESim 目录下。
2 设置环境变量:我的电脑- 〉属性-〉高级- 〉环境变量。
设置AMESim环境变量:变量名AME,值为其安装路径如安装在 C 盘中则值为C:\+amesim 安装路径。
设置Matlab 环境变量:变量名MATLAB值为D:\MATLAB,此处我安装的matlab 在D 盘根目录下。
确认在系统环境变量PATH 中包含系统安装目录C:\WINDOWS\system323 在Matlab 的目录列表里加上AMESim 与Matlab 接口文件所在的目录%AME%\matlab\amesim。
File- 〉Set Path- 〉Add Folder 加上需要联合仿真的amesim文件目录和C:\AMEsim\matlab\amesim(注意R8A版本是将%AME%\scripting\matlab\amesim 设置到MATLAB路径中)加入matlab 默认路径中4 将联合仿真的许可证文件licnese.dat 拷贝到AMESim 安装目录下的licnesing 文件夹中5 确认是否在AMESim 中选择VC 作为编译器。
具体操作在AMESim-〉Opions-> AMESimPreferences->Compilation/Parameters中。
.在MATLAB命令窗口中输入命令Mex -setup,选择VC 作为编译器注意点:1,Vc建议安装企业版而且是英文的,其第一次打开安装文件安装并不完全,重启动以后再次点安装文件,会出现于第一次安装文件不同的界面,就说明没有安装完全2,Matlab 的安装目录和amesim的安装目录都不能在中文路径下,而去文件夹的名称不能有空格3,联合仿真设置成功的标志: 可以运行amesim- 〉HELP- 〉GET AMESIM DEMO-〉interface- 〉amesimsimulink 下的范例4,如果运行的现实找不到matlab bin 则说明系统环境变量中没有设置matlab 路径,设置方法见上面,再重启电脑,再次用amesim 打开范例并到参数模式下,运行TOOLS-〉Start matlab,系统会调用matlab 程序,再在打开的matlab 中找到与amesim中打开的文件同目录且同名的.mdl 文件,在matlab 中运行仿真,如果没有错误则在amesim 中进入仿真模式打开相应的元件就可以看到曲线(注意在amesim中不用运行仿真)如果上面设置成功下面不用看下面给出amesim4.0 版本设置方法为了实现二者的联合仿真,需要在Windows2000 或更高级操作系统下安装Visual C++ 6.0,AMESim4.2以上版本与MATLAB6.1上版本(含Simulink)1. 将VC++中的"vcvar32.bat" 文件从Microsoft Visual C++目录(通常是.\Microsoft Visual Studio\VC98\Bin 中)拷贝至AMESim 目录下。
ADAMS与AMESim联合仿真实例2

以AMESim为主软件,与Adams联合仿真ADAMS与AMESim的联合仿真分两种形式,一是将AMESim模型导入ADAMS中(需要Fortran 编译器),另一种是将ADAMS模型导入AMESim中,选取ADAMS2012自带的例子进行联合仿真,具体步骤如下:1、将ADAMS安装目录下名为antenna.cmd(X:/MSC.Software/Adams/2012/controls/examples/antenna/anten na.cmd,X代表Adams安装目录)的文件复制到工作目录中;2、将antenna.cmd导入ADAMS中如下图示;3、通过Settings—Interface Style—Classic将界面切换到经典模式,便于与教程相对照:图示:5、Build—System Elements—New,创建状态变量azimuth_position,control_torque,elevation_position,rotor_velocity;6、Build—System Elements—Modify修改变量7、通过Date Elements—Plant—Plant Input/Plant Output建立输入输出变量,并与状态变量连接起来8、右击azimuth—actuator将力与输入变量连接起来8、通过Controls—Plant Export,导出模型,完成相关设置后点OK;9、zuoye文件夹中生成以下文件:10、在AMESim中建立以下模型,如下图示通过Modeling—Interface block—Import Adams model,选择工作目录中刚刚生成的adams2amesim .inf文件完成如下图示的相关设置11、最终建立的AMESim模型如下图示:12、进行模拟仿真13、在Amesim中查看模拟结果14、在Adams/PostProcessor 中查看模拟结果。
AMESim与ADAMS联合仿真步骤及相关注意事项

AMESim与ADAMS联合仿真1、安装软件最好的安装顺序:VS , Adams,Amesim安装路径不要有中文和空格及特殊字符2、环境变量设置AME_ADAMS_HOME,指向Adams安装目录,如:D:\MSC.Software\MD_Adams\R3ADAMS_CONTROLS_WTIME=203、安装完成后,确认在AMESim安装目录下(如:AMESim/v1300)已包含如下文件:nmake.exevcvars32.bat如果没有,从VS安装目录拷贝过来(C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin)。
4、将adams库加入到AMESim路径中:五、如果提示MSSDK问题,安装GRMSDKX_EN_DVD.iso。
也就是安装Windows SDK7.1如果安装时报错,可按照方法:卸载比Microsoft Visual C++ 2010 x86 Redistributable - 10.0.30319 以及Microsoft Visual C++ 2010 x64 Redistributable - 10.0.30319更高的版本。
如果还出错,在安装时不要选择安装VC-Compiler,其它选项默认即可。
如果卸载了上面的两个组件,则需要安装VBVCRedist中的两个补丁,只需要选择两个卸载的补丁即可。
六、如果提示AsUtility_imp.lib的link错误,在C盘中搜索,找到该文件,再放到AMESim 模型所在工作目录。
(一般不需要此项。
)七、64位操作系统中:AMESim中选择Microsoft Visual C++编译器,Subplatform type选择win64。
如下图八、接口类型为ADAMS还是AdamsCosim,决定于是用离散耦合,还是连续的。
Adams or AdamsCosim depending whether you want to run discrete coupling or continuous export选择AdamsCosim则adams中应该为Discrete。
AMESim和adams联合仿真使用说明

ADAMS interface® Rev 9 – November 2009Copyright © LMS IMAGINE S.A. 1995-2009AMESim® is the registered trademark of LMS IMAGINE S.A.AMESet® is the registered trademark of LMS IMAGINE S.A.AMERun® is the registered trademark of LMS IMAGINE S.A.AMECustom® is the registered trademark of LMS IMAGINE S.A.LMS b is a registered trademark of LMS International N.V.LMS b Motion is a registered trademark of LMS International N.V.ADAMS® is a registered United States trademark of MSC.Software Corporation.MATLAB and SIMULINK are registered trademarks of the Math Works, Inc.Modelica is a registered trademark of the Modelica Association.UNIX is a registered trademark in the United States and other countries exclusively licensed by X / Open Company Ltd.Windows is the registered trademark of the Microsoft Corporation.All other product names are trademarks or registered trademarks of their respective companies.TABLE OF CONTENTS1. Introduction (1)1.1. Organization of this manual 22. Preliminaries (3)2.1. License requirements 32.2. Compiler requirements 32.2.1. Requirements to import ADAMS model into AMESim 32.2.2. Requirements to export AMESim models into ADAMS 32.3. Versions of ADAMS supported 42.4. Platforms supported 42.5. Setting up the environment 43. Importing AMESim into ADAMS (7)3.1. Preliminary 73.2. Import AMESim models into ADAMS 93.2.1. Preparing an AMESim model for export to ADAMS 93.2.2. Importing the model in ADAMS 114. Importing Adams into AMESim (20)4.1. Introduction 204.2. Preparing an ADAMS model for export to AMESim 224.2.1. Step 1: Check exchanged variables 224.2.2. Step 2: Create the Interface 254.2.3. Step 3: Export the system from ADAMS into AMESim 264.3. Importing the model into AMESim 274.3.1. Step 1: Import file generated by ADAMS 274.3.2. Step 2: Configuration of the interface block 294.3.3. Step 3: Running a simulation 304.4. Analyzing results in both software 325. Co-simulation or full export? (32)6. Tips on using the interface (35)6.1. How to stop a simulation 356.2. How do you execute ADAMS commands before a co-simulation? 367. Advanced use of the interface (36)7.1. How to setup interface with template-based ADAMS products 367.1.1. Using more than one interface 377.2. Advanced configuration of the interface 377.2.1. Configuration file 37Using theAMESim / ADAMS Interface 1. IntroductionThe AMESim ADAMS interface enables you to link an AMESim model with an ADAMS multibody model of a mechanical structure. By coupling motion simulation and system simulation, this interface improves the accuracy of your full system simulation.This interface is useful when hydraulic or pneumatic fluid power systems or other AMESim systems interact with complex mechanical structures.The interface is designed so that you can continue to use many of the AMESim facilities while the model is running in ADAMS. In particular, you can change the parameters of the AMESim model within AMESim in the normal way and monitor the results by creating plots just as if you were producing a regular run.Normally you will have AMESim and ADAMS running simultaneously so that you can use the full facilities of both packages. An illustration of this process follows:When the process is finished, the user can change the AMESim model parameters within AMESim, as well as the ADAMS parameters within ADAMS.1.1. Organization of this manualThis manual describes both the two-way full export interface (using ADAMS or AMESim integrator exclusively for the full system) and the two-way co-simulation interface (where both solvers are used, one of them being called by the other).The main part of the manual deals with the standard interface and section 5 looks at the differences between export and co-simulation.The structure of this manual is the following:•Section 1 is the current section.• Section 2: Preliminaries, describes how you must set your working environment so that you can use the interface.• Section 3:Error! Reference source not found. describes how ADAMS imports the AMESim model.2. Section 4: Importing Adams into AMESim•, uses a simple example to describe how to create an AMESim model and configure it to run in cooperation with ADAMS.•Section 5: This section describes the differences between co-simulation interface and the export facility.• Section 6: Tips on using the interface, gives some advice on efficient use of the interface.• Section 7: Advanced use of the interface and Section 8: Advanced configuration of the interface, are useful for customized use of the interface (advanced users). Sometimes a section of text is only valid for a UNIX or Linux environment, for such text, the following presentation is used:Using UNIX:Description for Unix/Linux based environments.Similarly, sometimes a section of text is only valid for a Windows environment, for such text, the following presentation is used:Using Windows:Description for Windows based environments.We assume that either the reader of this manual is already familiar with using AMESim and ADAMS or an AMESim user and an ADAMS user will collaborate in performing the task.We recommend that new AMESim users at least do the tutorial examples in the AMESim manual before attempting a combined simulation. Similarly, a new ADAMS user should become familiar with using ADAMS before attempting a combined simulation.3. Preliminaries3.1. License requirementsWhen the user is running a coupled simulation from the AMESim environment, an Adams interface license is required in AMESim in combination with a standard AMESim runtime license. On the ADAMS side the module Adams/Controls (A/Controls) is needed.When running simulations from ADAMS the user only needs Adams interface and AMESim runtime licenses, A/Controls is unused.3.2. Compiler requirements3.2.1. Requirements to import ADAMS model into AMESimUsing Unix:You will need an ANSI C compiler.Using Windows:You must have at least Microsoft Visual C/C++ 6.0, .NET 2003, 2005.3.2.2. Requirements to export AMESim models into ADAMS AMESim follows the requirements given for ADAMS 2005Software specifications are:Hardware Vendor OperatingSystem Fortran C/C++Intel andIntel- compatible PCs Windows 2000,Windows XPProfessionalCompaq VisualFortran 6.6BMS Visual C/C++ 6.0 (SP5)orVisual Studio C++.NET 2003c89 11.01.20aC++ 03.27Hewlett Packard HP-UX 11, 11i f90 2.4.13SGI IRIX6.5.14m7.3.1.2m 7.3.1.2mIBM AIX 4.3.3, 5.1*XL Fortran 7.1 Visual Age C/C++ 5.0.2Sun Microsystems Solaris 7, 8, 9 6 Update 16 Update 1* ADAMS Service Pack APN-130-257 is required to run on this operating system.3.3. Versions of ADAMS supportedThis manual applies to ADAMS 2005. The interface was developed using this version and when using a mode that requires A/Controls (i.e. importing into AMESim) we suggest that you use that version with following patches:A/View 2003 Service Pack 1 APN-130-240A/Solver 2003 Service Pack APN-130-252A/Controls 2003 Service Pack APN-130-256This manual was also revisited to add some particular aspects for using this interface with the Adams 2008 release3.4. Platforms supportedWindows (2000, XP), HP, Sun and IBM.3.5. Setting up the environmentIn order to use the AMESim / ADAMS interface it is necessary to set an environment variable that points to the ADAMS installation directory. If this is not set, AMESim will not be able to find the files necessary to compile the system.To find out if this environment variable is set, type the following line in a terminal window: Using Unix:echo $AME_ADAMS_HOMEThe result should be something like:/opt/Adams2005being printed on screen. If nothing is printed, or the message “AME_ADAMS_HOME: Undefined variable” is displayed, you must set this variable. To do this you need to know where ADAMS is installed. If your working environment is set up properly to run ADAMS, type either:which adams05 (if you are using C shell) or,whence adams05 (for Korn shell - ksh or Bourne shell - sh) or,type adams05 (for some versions of Bourne shells).This will tell you the location of the command to start ADAMS e.g./opt/bin/adams05Then type:l s –l /opt/bin/adams05This finds the link to the ADAMS directory, it may give something like:/opt/bin/adams05 Æ /opt/Adams2005/mdi*Remove the last part from this pathname to get the value to set for AME_ADAMS_HOME, in this case /opt/Adams2005. If you are using Unix C shell, you can then set the environment variable as follows:setenv AME_ADAMS_HOME /opt/Adams2005This statement can also be added to your .cshrc file so that the environment variable is set every time you log in.For Bourne or Korn shells the corresponding would be:AME_ADAMS_HOME=/opt/Adams2005; export AME_ADAMS_HOMEAdd these statements to your .profile file so that the environment variable is set every time you log in or add it to a script that launches AMESim .Using Windows:echo %AME_ADAMS_HOME%The result should be something like:C:\ADAMS2005being printed on screen. If the environment variable is not set, %AME_ADAMS_HOME% is printed and you need to set the environment variable to point to the ADAMS installation directory. This can be done from the Windows Control Panel.If you want to use this interface from ADAMS side, you will need a Fortran compiler as stated in section 2.2. Using Windows:In this case the file dfvars.bat must be copied into $AME. This file sets up the environment to use Fortran libraries.For Compaq Visual Fortran this file can be found here:C:\Program Files\Microsoft Visual Studio\DF98\BINCopy this file into the AMESim installation directory.Using Unix: You need access to a Fortran compiler. To be certain that the compiler is installed, type one of the following commands in a terminal window. For IBM type: xlf , for SGI type f77 and for Sun type f77. If the command issues an error message, please contact your system administrator.¾ In AMESim the $AME/libadams directory must be in the current path list.to 20.¾ AMS_HOME environment variable must be defined with a DOS-¾ the Visual C compiler, the make file called¾ n depending¾You must set the environment variable ADAMS_CONTROLS_WTIME Generally, this waiting time is enough to initialize connections between AMESim and ADAMS.The AME_AD type path (that can be found in the .inf file generated by ADAMS), for example: D:\PROGRA~1\MSC~1.ADA\To use this interface using amesim_adams_gsec.make located in $AME/interfaces/adams/ should not contain the library dform.lib which is reserved for Fortran compilers.The library for ADAMS must be replaced in the AMESim installatio on the ADAMS version used. The library files are located in $AME/libadams/lib as shown below.Replace AMEADAMS.lib with the correct library file4. Importing AMESim into ADAMS4.1. PreliminaryThe recommended way of working is to first create independent sub-system models in AMESim and ADAMS,each of which has a very simple model of the other domain sub-system.Thus if the end result of a simulation study is to investigate how a hydraulic actuator system will work in a mechanical system it is often best to first model the hydraulic system separately with a simplified model of the mechanical system using the mechanical submodels available in AMESim. This would probably be a prescribed velocity and displacement.In parallel a separate model of the mechanical system would be built in ADAMS with a simplified hydraulic system. This would probably be a prescribed force instead of an actuator. The two sub-system models should then be verified thoroughly. As much independent tuning of the sub-systems as possible should be done at this stage. When the two separate models work properly, they can be integrated.A good general rule is that the ports where the hydraulic and multi-body sub-systems are connected will correspond to hydraulic linear actuator rods or the shafts of hydraulic pumps, motors or rotary actuators.It is not too difficult to think of exceptions but the overwhelming majority of applications will satisfy this rule.You will look at one simple system that uses this way of interfacing. The tutorial case is the ADAMS tutorial example of the antenna. It is strongly recommended that you reproduce this system.When using the interface, there are four important points to treat carefully•units,•sign conventions,•implicit variables (when using AMESim from ADAMS),•numerical aspects.With reasonable care these points can be solved without any problem.The problem of different units in ADAMS and AMESim often leads to the need for the interfacing variables to be adjusted with some unit conversion factor.What we mean by a sign convention is the significance of the signs of forces, displacements and velocities in both AMESim and ADAMS. It is almost always necessary to reverse the sign of displacements and velocities when they are imported into AMESim if hydraulic jacks or hydraulic pumps, motors or rotary actuators are used. Since the sign convention depends on the interfacing of components and variables it is necessary to use caution regarding the sign. This is another good reason for creating two separate sub-system models. The single software simulation results will give good insight into the system behavior and make any sign errors in the combined simulation apparent.As explained in the AMESim manual, AMESim can solve two kinds of systems of differential equations: ordinary differential equations (ODEs) and differential algebraic equations (DAEs). The latter uses implicit variables. The interface between AMESim and the General State Equation in ADAMS supports only ODEs. It is therefore impossible to use any submodel in AMESim that uses implicit variables when exporting the model into ADAMS. It may also be necessary to modify the AMESim model to eliminate any implicit variables that may be created to resolve algebraic loops.When working from ADAMS, numerical problems arise due to the fact that the interface uses the ADAMS integrator, which is tuned to work well with the equations governing multi-body systems. The numerical characteristics of a fluid power system are different. Another source of numerical problems is that an AMESim model when run with the AMESim integrators can employ some special tricks to deal with discontinuities. This is not possible when using the ADAMS integrator. In fact, the documentation of the ADAMS GSE facility, states that the imported system of ODEs must be continuous. It is therefore recommended to avoid hard discontinuities completely in the AMESim model. By a hard discontinuity we mean that there are jump changes in the values of state variables. Fortunately very few AMESim submodels employ hard discontinuities. Avoid the following hydraulic actuator icons that have an integral mass as the corresponding submodels employ hard discontinuities.It is not impossible to use these submodels but if you do, make sure that the jack never hits its end-stops. However, submodels associated with alternative icons employ elastic end-stops, which do not have hard discontinuities. Hence it is preferable to use these.USE THESE ICONSNOT THESESimilarly if you use the mechanical icons, , use MAS21 not MAS005.Looking at the input and output requirements of these preferred submodels and at the requirements of hydraulic pumps and motors, a second general rule becomes apparent. The ADAMS model normally calculates position and velocity, (or angle and angular velocity) and passes them to the AMESim model, which calculates the corresponding force (or torque).Again it is possible to think of exceptions but this rule is very useful.In the same way when working from AMESim, numerical problems can arise when importing a large ADAMS system. The AMESim integrator is not designed to solve such problems, and simulation times may rise significantly.In these cases the co-simulation interface can be a solution if no workaround is found to make the full import facility efficient.4.2. Import AMESim models into ADAMSIn this section you will focus on the interface method to import the AMESim model into ADAMS. We designed the facility for multiple reasons:An ADAMS user needs to integrate a validated AMESim component into a mechanical system; he can still work with ADAMS facilities while taking advantage of AMESim’s ability to design multi-disciplinary control systems.•AMESim may sometimes encounter difficulties in solving a complex ADAMS mechanical structure; in this case, we suggest that user tries the other methodfor coupling the systems, especially if the AMESim system is simple.•This methodology requires no supplementary license for A/controls product.In this case, you will use AMESim subsystem in ADAMS as a general state equation (GSE) block. ADAMS executable will communicate with AMESim using a library. In fact, AMESim will not generate an executable as usual but rather a dynamic link library (dll) on Windows platforms or a library (so) on UNIX platforms.One advantage of this methodology is that you do not need to have AMESim installed on the ADAMS machine; you will just need an AMESim runtime license.4.2.1. Preparing an AMESim model for export to ADAMSIn this section, you will see how to export an AMESim system into ADAMS.In Sketch mode, construct your AMESim system with non-connected ports corresponding to ADAMS inputs and outputs. Then, select Modeling Interface block Create interface icon…, as shown in the screen capture below:Figure 1: Creating export icon in AMESimIt opens a dialog box window named Interface Icon Creation, you select there a Type of interface it should be Adams or AdamsCosim depending whether you want to run discrete coupling or continuous export.Set the number of input variables to ADAMS and output variables from ADAMS and give them a name.In the antenna case it should be one input and two outputs and the created icon looks like this:Figure 2: AMESim subsystem containing ADAMS blockIt is also possible to change the interface status without having to re-do the export, just go to the menu and use Modeling Interface block Display interface status. Then you can switch from Adams to AdamsCosim.Now switch to Submodel mode and Parameter mode. After the compilation of the system AMESim creates the library. Switch to Simulation mode to generate all necessary files or by using File Write auxiliary files.The model cannot have implicit variables otherwise the interface does not work. During the compilation process, the following information is presented:You are now ready to work under ADAMS and import the AMESim system; this is the subject of the next section.4.2.2. Importing the model in ADAMSAs an example, you will use the ADAMS tutorial of the antenna controlled within AMESim. This example comes from A/Controls tutorials; copy the A/View command file antenna.cmd from {ADAMS_DIR}/controls/examples/antenna into a working directory.In ADAMS, do not forget to select the working directory where the AMESim model is located. Use the menu item File Select Directory… By default, the working directory is set to $HOME. This interface also uses libraries located in the $AME/$MACHDIR where $MACHDIR is the machine directory, for example win32 for Windows. This variable must be in the patch directory.¾Import the file within A/view environment.¾The ADAMS model contains an input on the azimuth_motion_csd. variable to force the rotation during the simulation. This input must be deactivated because it is managed in the controller (AMESim model). If we do not deactivate this variable, there will be a conflict between the AMESim control and ADAMS control.To do this, select the Edit Deactivate entry. This action displays the Database Navigator to access the data tree.In the window Database Navigator select azimuth_motion_csd.Figure 3: Deactivate a motion in A/View Apply by clicking OKIf we reopen the Database Navigator, the variable appears as OFF4.2.2.1. Step 1: Create the arrays for inputs, outputs and statesAdams 2005: In A/View go to the Build Controls Toolkit menu.Adams 2008: In A/View go to the Build Data Elements Array menu.¾First, choose the U input array. There you create inputs to the AMESim subsystem, so it will be a 2-dimensional array containing ADAMS variables for velocity and position.Adams 2005Adams 2008¾ Next choose X states array.- discrete export:X state array size = 1 (a dummy state variable)- continuous export: size of the array = AMESim number of states (*) (if = 0 put 1) (*) this number is displayed in the build dialog box.The model cannot have implicit variables otherwise the interface does not work.Adams 2005Adams 2008¾ Finally, choose Y output array. It represents the outputs from AMESim so in our case it will be a 1-dimension array for the control torque.Adams 2005Adams 20084.2.2.2. Step 2: Association of array output value to the modelThe control torque computed by AMESim needs to be associated with the ADAMS model. You do it in the single component torque using ARYVAL ADAMS function. This one permits you to get an array value.Note that, as a first argument to this function you use the array of outputs and the second argument is the position of the required value; 1 in our case.From the Database Navigator, select the azimuth_actuator and we have access to the following dialog box to modify the functionFigure 4: Associate AMESim output to the ADAMS model4.2.2.3. Step 3: Creating the GSE and linking with the AMESim libraryIn the Build System Elements General State Equation menu, choose New… thisopens the dialog box window below.Fill in the window as shown in the following figures. The States line corresponds to the coupling method you chose previously under AMESim; choose discrete for a co-simulation and continuous for an export. The User Function Parameters field always needs three parameters and corresponds respectively to the ID of U Array, Y Array and X Array. AMESim will need them to be able to get correct values from ADAMS during simulation.Figure 5: Creating a GSE in ADAMS; discrete modeFigure 6: Creating a GSE in ADAMS; continuous modeOnce completed, you have to indicate to A/Solver to use the AMESim library.Go to the Settings Solver Executable… menu, in the dialog box window for Solver Library supply the AMESim library path as shown in the figure below:Figure 7: A/Solver settings when using AMESim libraryIn AMESim, select the appropriate settings for the simulation4.2.2.4. Step 4: Running a simulationCreate a command script. Here is an example of a Solver command script:simulate/dynamics, end=0.250000, dtout=0.001 Select Simulate Simulation Script … NewSince A/Solver will use an external library only scripted simulations are available. Select Simulate Scripted Controls …Run the simulation within ADAMS, at the same time the AMESim library writes a result file. The AMESim model is executed in the background. The communication with ADAMS takes place at the library level (dll on Windows and so on Unix platforms). In the aside figure you can notice that AMESim outputs some messages during the simulation.4.2.2.5. Step 5: Checking the resultsIf you have AMESim installed on the same machine, you can look at the results within AMESim. Otherwise, you can focus on ADAMS results only.Results of common variables are as follows under AMESim.In Adams we can also see the variable curves.5. Importing Adams into AMESim5.1. IntroductionAs an example, you will use the same ADAMS tutorial of the antenna controlled within AMESim.The final sketch in AMESim will look like:Figure 8: Antenna sketch in AMESim¾The example comes from A/Controls tutorials; copy the A/View command file antenna.cmd from {ADAMS_DIR}/controls/examples/antenna into a working directory.In ADAMS, do not forget to select the working directory where the AMESim model is located. Use the menu item File Select Directory… By default, the working directory is set to $HOME¾Import the file within the A/view environment.¾The ADAMS model contains an input on azimuth_motion_csd variable to force the rotation during the simulation. This input must be deactivated because it is managed in the controller (AMESim model). If we do not deactivate this variable, there will be a conflict between AMESim control and ADAMS control.To do this, select the Edit Deactivate entry. This action displays the Database Navigator to access to data tree.In the window Database Navigator select azimuth_motion_csd.Figure 9: Deactivate a motion in A/ViewApply by clicking OK.If we reopen the Database Navigator, the variable appears as OFF5.2. Preparing an ADAMS model for export to AMESimIn this case, AMESim is the master software, you will launch simulations from AMESim and AMESim controls ADAMS simulation.There are two ways to export ADAMS into AMESim:•Discrete export, or co-simulation mode, AMESim tells ADAMS to supply its outputs at fixed intervals, ADAMS solves its system,•Continuous mode, AMESim gets the complete system from ADAMS and tries to integrate all equations, ADAMS acts then as a function evaluator.These modes require that you have a valid license for A/Controls.The ADAMS side of the procedure is unchanged whichever mode you use. It is only in AMESim that you make your choice.5.2.1. Step 1: Check exchanged variablesIn this step, you will check the definition of some ADAMS state variables1. You will use them as exchanged variables between the two software packages, for example for a hydraulic actuator modeled in AMESim and acting on an ADAMS mechanical structure, these variables should be a force, a position and a velocity. AMESim needs position and velocity and computes a force.Outputs from ADAMS, often velocity and position, are defined with ADAMS intrinsic functions; AZ( ) for an angle measurement, WZ( ) for a rotational velocity, DM( ) for a displacement magnitude.1 Be careful, the meaning of state variables is not the same in AMESim and in MSC.ADAMS. For the latter these are simple variables defined by an algebraic equation whereas in AMESim these are the variables integrated by the solver.Select the variables in the Database NavigatorBe careful with units (accessible from Settings/Units… menu in A/View). They should be compatible with what AMESim expects, if you do not want to change them in ADAMS, do not forget to place a gain (conversion factor) on the AMESim sketch before inputting the signals into AMESim submodels.Inputs to ADAMS, mainly forces/torques, are used in standard elements like single component force/torque or general force (6 components). At creation, these variables are set to zero value because the other software (AMESim) will compute their values.In our example, the unique input variable is referenced in a torque single component using the function VARVAL.The element azimuth_actuator can be accessed from the Tools Database Navigator…menu in A/View. The control_torque state variable is accessible from Build System Elements State Variables Modify… menu.Figure 11: Creating input variable in ADAMSOnce you have created input and output variables, in the next section you will learn how to define the interface in ADAMS.。
AMESim仿真技术及其在液压系统中的应用

AMESim仿真技术及其在液压系统中的应用AMESim仿真技术及其在液压系统中的应用随着科技的不断发展,仿真技术在工程领域中的应用越来越广泛。
AMESim仿真技术作为一种系统级仿真软件,能够模拟和分析多个物理领域的耦合系统,尤其在液压系统中得到广泛应用。
本文将从AMESim仿真技术的介绍、液压系统基础和模型构建,以及仿真在液压系统中的应用等方面进行探讨。
AMESim仿真技术是由法国LMS公司研发的一种多领域系统仿真软件。
它通过建立系统级的数学模型,能够模拟和分析多个物理领域的复杂耦合系统,包括液压、气动、电控、机械、热力等。
AMESim具有图形化建模界面,用户只需通过拖拉连接各个模块进行系统建模,无需编写复杂的代码。
同时,AMESim还具备快速仿真和优化的能力,能够极大地提高系统设计的效率和准确性。
液压系统是一种基于液体传动能量的技术,广泛应用于工业、航空、机械等领域。
了解液压系统的基础知识对于进行仿真建模至关重要。
液压系统主要由液压源、执行元件、控制元件和负载组成。
液压源产生压力油液,通过控制元件对压力油液进行调节,最终驱动执行元件完成工作。
液压系统具有反馈控制、大功率传动、快速响应和负载自适应等优势。
在液压系统中,液压元件的参数调节、控制策略的选择以及系统的优化等问题对系统的性能和效率有着重要影响。
在AMESim中进行液压系统建模时,首先需要确定系统的工作流程和参数。
通过拖拉连接不同的模块,可以对液压系统的压力、流量、温度等参数进行仿真分析。
同时,AMESim还可以加入控制算法,使系统具备自动调节功能。
在液压系统中,常见的仿真模型包括液压缸模型、泵模型、阀门模型等。
这些模型可以根据实际情况进行自定义和修改,以满足系统设计和性能优化的需求。
仿真在液压系统中的应用主要有以下几个方面:首先,仿真技术可以对液压系统的性能进行全面评估。
通过改变不同参数的数值和控制信号的输入,可以观察系统的响应和工作状态,并进行性能指标的计算和对比分析。
ADAMS+AMESIM+SIMULINK操作说明

ADAMS+AMESIM+SIMULINK总体思路:对于一个实际的机械电液控制系统的建模仿真,用ADAMS进行机械部分的建模,AMESIM进行液压部分的建模,SIMULINK进行控制部分的建模。
将ADAMS建立的机械模型导入到AMESIM中(通常接口处是油缸或是马达),再将整合后AMESIM模块当作一个整体的模块导入到SIMULINK中,在SIMULINK中进行仿真。
仿真时,SIMULINK给出控制信号以控制AMESIM输出的力或是扭矩,AMESIM给出力或是扭矩来控制ADAMS机械系统的运动量(位移、速度、加速度。
),ADAMS会将运动量反馈给AMESIM,SIMULINK 可根据这些反馈做出相应的控制。
下面以一个例子来简介三者联仿的步骤:例子:一只油缸固连一只仅受重力的小球,小球的初始状态为静止。
现在仿真这么一个状态:油缸从一端运动到另一端时的小球的运动变化。
步骤一:准备工作。
1.首先得装好四个软件。
我用的是ADAMS2005,AMESIM8.0,MATLAB2007b,Microsoft Visual C++ 6.0。
另外三个软件要有相应的破解文件以支持联仿。
2.ADAMS到AMESIM的设置:在Windows中设置环境变量%AME_ADAMS_HOME%,该环境变量的值为ADAMS的安装路径(例如C :\ADAMS2005。
注意在ADAMS的安装路径中不能出现空格)。
3.AMESIM到SIMULINK的设置:(1)确认在系统变量PATH中包含系统安装目C:\WINNT\System32。
(2)在Matlab的目录列表里加上AMESim与Matlab接口文件所在的目录%AME%\MATLAB\AMESim。
File→Set Path→Add Folder加上c:\AMESim\MATLAB\AMESim。
(3)确认是否在AMESim中选择VC作为编译器。
具体操作在AMEsim→0pions→AMEsim→Preferences→Compilation/Parameters中。
AMESim-MATLAB联合仿真详细设置+部分问题解决步骤

AMESim-MATLAB联合仿真详细设置+部分问题解决步骤AMESim-Matlab 的联合仿真设置1. 联合仿真的前期准备1.1. AMESim 与Matlab 的版本匹配问题AMESim 与Matlab 的联合仿真有两类接口:接口(将AMESim 模型导入到Simulink 中)接口(将Simulink 模型导入到AMESim 中)两种不同的接口,对应的AMESim-Matlab 联合仿真的软件兼容列表,分别如图 1 和 2 所示。
图中,"Probable"表示未经AMESim 官方测试,但仍然可以正常使用。
"Yes"表示经AMESim 官方测试,确定可以正常使用。
"No"表示该组合不能实现联合仿真。
如图1 所示,"AMESim to Simulink" 接口对软件的版本要求较低,基本上AMESim Rev7(或者更高的版本)与Mablab R2007b (或者更高的版本)可以自由组合进行联合仿真。
如果想使用"Simulink to AMESim" 接口,建议安装AMESim Rev11 以上的版本,Malab 只要求R2007b 以上即可。
图 1 "AMESim to Simulink" 接口图 2 "Simulink to AMESim" 接口1.2. Microsoft Visual C++编译器(VC++)的版本选择?AMESim 支持的VC++版本分别如图1(32 位编译器),图2(64 位编译器)所示。
图1 和图2 中,"Probable","Yes","No"表示的意思同上。
经测试,AMESim Rev9 可以正常调用VS2010 版的VC++(32 位)。
另外,从图 1 中,可以看到,VC++ 6.0 不能支持AMESim Rev11 以上的版本。
基于AMESim-MATLAB-ADAMS联合的机电液一体化仿真综合案例高级专题

详情介绍
《第10讲 三自由度平台的机电液一体化联合仿真基于 MATLAB-AMESim-ADAMS联合仿真(以MATLAB为主)》
本讲内容在MATLAB-AMESim-ADAMS三个软件联合仿真的 软件安装与接口设置已经成功完成的基础上,进行的三自由度平台的 机电液一体化联合仿真的综合案例实现,详细讲解了该案例的 ADAMS模型的建立,连接、驱动和状态变量等设置,AMESim液压 驱动模型建立,MATLAB/simulink控制系统闭环负反馈控制算法的 建立,三个软件联合仿真接口导入与参数设置,让大家熟练掌握机电 液一体机构的机电液一体化联合仿真 基于AMESim与ADAMS联合仿真(以AMESim为主) 》
本讲内容是在AMESim与ADAMS联合仿真软件安装和接口 设置确定正确的前提下,进行的液压油缸变幅机构机电液一体化 联合仿真的综合案例实现,详细讲解了该案例的ADAMS模型的 建立,连接、驱动和状态变量等设置,AMESim液压驱动模型和 闭环负反馈PID控制算法的建立,联合仿真接口导入与参数设置, 让大家对以AMESim为主的联合仿真整体流程和方法有了一定的 掌握。
详情介绍
《第3讲 挖掘机的机电液一体化联合仿真 基于AMESim与ADAMS联合仿真(以AMESim为主)》
本讲内容是在液压油缸驱动变幅机构综合案例的基础上,进 行的挖掘机 机电一体化联合仿真的综合案例实现,详细讲解了 该案例的多自由度ADAMS模型的建立,连接、驱动和状态变量 等设置, AMESim液压驱动模型和闭环负反馈PID控制算法的 建立,联合仿真接口导入与参数设置,让大家熟练掌握以 AMESim为主的联合仿真整体流程和方法。
本讲内容在MATLAB-AMESim-ADAMS三个软件联合仿真的 软件安装与接口设置已经成功完成的基础上,进行的液压油缸变幅机 构机电液一体化联合仿真的综合案例实现,详细讲解了该案例的 ADAMS模型的建立,连接、驱动和状态变量等设置,AMESim液压 驱动模型建立,MATLAB/simulink控制系统闭环负反馈控制算法的 建立,三个软件联合仿真接口导入与参数设置,让大家对这三个软件 的联合仿真整体流程和方法有了一定的掌握。
AMESim与ADAMS联合仿真步骤及相关注意事项

AMESim与ADAMS联合仿真1、安装软件最好的安装顺序:VS , Adams,Amesim安装路径不要有中文和空格及特殊字符2、环境变量设置AME_ADAMS_HOME,指向Adams安装目录,如:D:\MSC.Software\MD_Adams\R3ADAMS_CONTROLS_WTIME=203、安装完成后,确认在AMESim安装目录下(如:AMESim/v1300)已包含如下文件:nmake.exevcvars32.bat如果没有,从VS安装目录拷贝过来(C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin)。
4、将adams库加入到AMESim路径中:五、如果提示MSSDK问题,安装GRMSDKX_EN_DVD.iso。
也就是安装Windows SDK7.1如果安装时报错,可按照方法:卸载比Microsoft Visual C++ 2010 x86 Redistributable - 10.0.30319 以及Microsoft Visual C++ 2010 x64 Redistributable - 10.0.30319更高的版本。
如果还出错,在安装时不要选择安装VC-Compiler,其它选项默认即可。
如果卸载了上面的两个组件,则需要安装VBVCRedist中的两个补丁,只需要选择两个卸载的补丁即可。
六、如果提示AsUtility_imp.lib的link错误,在C盘中搜索,找到该文件,再放到AMESim 模型所在工作目录。
(一般不需要此项。
)七、64位操作系统中:AMESim中选择Microsoft Visual C++编译器,Subplatform type选择win64。
如下图八、接口类型为ADAMS还是AdamsCosim,决定于是用离散耦合,还是连续的。
Adams or AdamsCosim depending whether you want to run discrete coupling or continuous export选择AdamsCosim则adams中应该为Discrete。
AMESim与MATLAB_Simulink联合仿真接口配置

AMESim—MATLAB(64位)联合仿真设置详细步骤说明:现以AMESimR12、MATLAB2014b为例说明,其他版本类似。
1、版本要求2、辅助软件VS2013若要使用 AMESim 与 Simulink 的接口,则需要在本机安装编译器,高版本软件需要高版本的编译器,这里以VS2013为例设置。
一般推荐先安装VS编译器,然后安装 Matlab,最后安装 AMESim的顺序。
若后安装VS编译器,将VS编译器安装目录下如 D:\ Microsoft Visual Studio 12.0 \VC\bin 目录中的nmake.exe 文件和vcvars32.bat 以及D:\Microsoft Visual Studio 12.0\VC\bin\amd64下的vcvars64.bat(64位版本的MATLAB)文件拷贝至 AMESim 安装目录,如D:\AMESim\v1200下。
3、环境变量设置定义Windows 系统环境变量:1)选择“控制面板-系统”或者在“我的电脑”图标上点右键,选择“属性”;2)在弹出的“系统属性”窗口中选择“高级”页,选择“环境变量”;3)用户变量中添加HOME D:\MATLAB D:\MATLAB\R2014bPath D:\ Microsoft Visual Studio 12.0\Common7\Tools; D:\ Microsoft Visual Studio 12.0\VC\bin; D:\Program Files\MATLAB\R2014b\bin; D:\ProgramFiles\MATLAB\R2014b\bin\win644) 在系统变量中添加在Path 环境变量中加入(以分号与其它已经存在的变量值隔开)路径:Matlab_Root(如 D:\Matlab\R2010a)\bin 和Matlab_Root(如D:\Matlab\R2010a)\bin\win32 ,以及%windir%\System32,其中%windir%指的是 Windows 的安装路径,如 C:\WINNTPath D:\Program Files (x86)\Microsoft Visual Studio 10.0; D:\AMESim\v1000; D:\AMESim\v1000\win64;D:\AMESim\v1000\sys\mingw32\bin;D:\AMESim\v1000\s ys\mpich\mpd\bin;D:\AMESim\v1000\sys\cgns;%SystemRoot%\system32;%SystemR oot%;%SystemRoot%\System32\Wbem;D: \MATLAB\R2014b\bin\win64;C:\WINDOWS\system32;C:\WINNT (该处很重要一定要添加,而且一定要包含C:\WINDOWS\system32,不然会有引起很多错误)4、AMESim与MATLAB设置启动AMESim并确认 AMESim 使用的是 MS C++编译器。
Amesim 和 Adams联合仿真设置过程和关键点

高版本的Adams已经不再支持Adams导入Amesim这种联合模式(以Amesim 作为master的co-simulation也不行),但是将Amesim导入Adams或者以Adams 作为master的co-simulation还是没有问题的。
下表是兼容性对比图表(来自Amesim的help文档):下面讲述的过程是基于Amesim R13 、Adams 2012和VS 2009(32-bit):1、安装软件最好的安装顺序:VS , Adams,Amesim安装路径不要有中文和空格及特殊字符2、环境变量设置AME_ADAMS_HOME,指向Adams安装目录,如:D:\MSC.Software\MD_Adams\R3 ADAMS_CONTROLS_WTIME=203、安装完成后,确认在AMESim安装目录下(如:AMESim/v1300)已包含如下文件:nmake.exevcvars32.bat如果没有,从VS安装目录拷贝过来。
3、将adams库加入到Amesim路径中:完成之后在你的Amesim库列表中包含Import of Adams models库:4、以下以Amesim之中help自带的例子讲述联合仿真操作过程(简单、方便联合仿真调通)将例子拷贝到某个目录下,用Amesim打开.ame文件,编译器选择VC++编译,确保在同一个目录下生成了.dll文件:5、打开adams,设置路径(Select Directory…)到.ame文件所在位置(这步很关键,如果不选可能会出错)6、导入Adams的cmd格式文件,一般在%AME%\v1300\demo\Platform\1D3DCAE\MBS\AMESimAdams,如:D:\AMESim\v1300\demo\Platform\1D3DCAE\MBS\AMESimAdams7、选择solver:为了方便在仿真时看结果,可以选择Display,在Show Messages 后面选择Yes再选择编译器和dll文件,Executable 下拉菜单选择External;Solver Library 后面灰色出双击鼠标左键,找到.ame文件生成的.dll文件在Choice后面选择C++作为编译器此处有建议选择FORTRAN的,我的Fortran版本太低,当时无法计算;不过选择C++就能正常计算,一般情况也不需要再安装Fortran。
ADAMS matlab联合仿真

一、ADAMS /Controls模块ADAMS /Controls是ADAMS其他模块如ADAMS/View,ADAMS/Car,ADAMS/solver等的插件模块,为建立的模型添加控制系统。
通过ADAMS/Controls 模块,可以将机械系统仿真分析工具同控制设计仿真软件MATLAB,EASY5,MATRIX等有机地连接起来,实现以下功能。
(1)将复杂的控制系统添加到机械系统模型中,然后对机电一体化进行联合分析。
(2)直接利用ADAMS程序创建控制系统分析中的机械系统仿真模型,而不需要使用数学公式建模。
(3)在ADAMS环境或控制应用程序环境获得机电联合仿真结果。
ADAMS /Controls控制系统可以有两种使用方式:●交互式:在ADAMS/Car, ADAMS /Chassis,ADAMS/Rail, ADAMS/View等模块中添加ADAMS /Controls,通过运动仿真查看控制系统和模型结构变化的效果。
●批处理式:为了获得更快的仿真结果,直接利用ADAMS /Solver这个强有力的分析工具运行ADAMS /Controls。
设计ADAMS/Controls控制系统主要分为4个步骤:1.建模:机械系统模型既可以在ADAMS /Controls下直接建立,也可以外部输入已经建好的模型。
模型要完整包括所需的所有几何条件、约束、力以及测量等。
2.确定输入输出:确定ADAMS 输入输出变量,可以在ADAMS和控制软件之间形成闭环回路。
3.建立控制模型:通过一些控制软件如Matlab、Easy5或者Matrix等建立控制系统模型,并将其与ADAMS机械系统连接起来。
4.仿真模型:使用交互式或批处理式进行仿真机械系统与控制系统连接在一起的模型。
二、MATLAB/Simulink工具箱MATLAB是MathWorks公司开发的软件,具有很多工具箱,其中Simulink工具箱,可以应用于对动态系统进行仿真和分析,他可以处理的系统包括:线性、非线性系统;离散、连续及混合系统;单任务、多任务离散事件系统。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
2
联合仿真技术及其主要方式
多学科和多软件平台协同建模和仿真技术 涉及机械、控制、液压等不同学科领域 是计算机仿真技术应用的发展趋势之一
市场
构思 设计 产品
市场
构思 设计 仿真 产品
3
联合仿真技术及其主要方式
基于接口的联合仿真: 软件独立建模;接口传递计算结果。
多体动力学 ADAMS
FM xvα
XV
18
联合仿真实现一种位置控制系统
利用MATLAB与ADAMS联合仿真实现
X
MATLAB/Simulink ADAMS
1 s2 +s+1 Step Transfer Fcn
PID PID Controller
adams _sub
F
19
谢
谢!
Thank you!
操作平台
伸缩油缸(内置)
一节臂 二节臂 三节臂四节臂 平台
样 机 模 型
15
变幅油缸
联合仿真的工程应用案例
高空车直线轨迹控制系统(ADAMS+MATLAB)
高度 速度
举升速度 (m/s)
距离
举升高度(m)
水平距离 (m)
时间(s)
时间(s)
平台举升曲线
平台水平运动曲线
16
联合仿真实现一种位置控制系统
液压系统 AMESim
vα x
FM x vα
FM
控制系统 MATLAB
4
工程软件ADAMS简介
ADAMS是美国MDI公司开发的机械系统运动学和 动力学仿真软件。
5
工程软件ADAMS简介
进入ADAMS/View
模型名称
菜单栏
主工具栏
全局坐标系 状态栏
6
工程软件ADAMS简介
1 3 5 7 4 6 8 4 连接 5 色盘 14 背景顏色
8
工程软件MATLAB简介
界面
当前目录
Simulink
工作路径
M文件 编辑器
历史命令
命令窗口
开始按钮
9
工程软件MATLAB简介
Simulink
10
联合仿真的工程应用案例
风电吊装缓冲装置(ADAMS+AMESim)
海上风电吊装
吊装对接的缓冲过程
11
联合仿真的工程应用案例
风电吊装缓冲装置(ADAMS+AMESim)
ADAMS/View工具栏
2 1 几何建模 2 测量 3 恢复/重做 8 建构力元素 12 左右视图 13 上下视图
15 其他 9 10 9 动态浏览 11 12 13 6 运动 7 移动 10 动态旋转 14 15 16 11 前后视图 16 视窗布置
7
工程软件MATLAB简介
MATLAB是美国Mathworks公司推出的高性能数 值计算和可视化软件。
ADAMS、MATLAB和AMESim机电液联合仿真 介绍及应用
刘鹏飞
2012 / 03 / 21
索
引
联合仿真技术及其主要方式 工程软件ADAMS/MATLAB简介 联合仿真的工程应用案例 联合仿真实现一种位置控制系统
液压系统 AMESim
多体动力学 ADAMS
控制系统 MATLAB
海上风电吊装简化图
ADAMS+AMESim
12
联合仿真的工程应用案例
高 度 变 化
H (mm)
风电吊装缓冲装置(ADAMS+AMESim)
零点起吊
F (N)
零点起吊 速 度 变 化
V (m/s)
蓄 能 器 压 力
P (MPa)
零点起吊
蓄 能 器 体 积
V (mm^3)
运行时间 t(s)
运行时间 t(s)
吊钩和风机运动曲线
缓冲缸和蓄能器曲线
13
联合仿真的工程应用案例
高空车直线轨迹控制系统(ADAMS+MATLAB)
变幅伸缩臂高空车
变幅伸缩臂高空车
14
联合仿真的工程应用案例
高空车直线轨迹控制系统(ADAMS+MATLAB)
控 制 方 程
墙壁
高 伸缩油缸 空 (内置) 作 业 变幅油缸 平 转台 台 下车
理想化阀控缸位置控制
+
I'X ∆IX PID IX 阀 Q 传感器 油缸 Y
X 位移/电流转换 IX 期望位移
-
液压缸输出位移 对阀流量传递函数
其中:A-液压缸有效面积;ωh-固有频率;ξh-阻尼比
17
联合仿真实现一种位置控制系统
利用AMESim与ADAMS联合仿真实现
F
AMESim ADAMS