You are on page 1of 22

The Matlab® & Simulink® interfaces

Shinho Systems Co., Ltd.


Tel:+82-31-737-6800 Fax:+82-31-737-6809
E-mail :support@ishinho.com, http://www.ishinho.com
2F Joongil Eines Plantz, Sangdaewon-dong, Seongnam-si, Gyeonggi-do, Korea

Shinho Systems Co., Ltd.


AMESim® – Matlab® & Simulink® Interfaces

Simulink AMESim
The de-facto standard for Multi-domain systems
control system design simulation platform

AMESim - Simulink Interfaces


Easy-to-use and efficient tool for coupling
AMESim plant model
within Simulink control system model

AMESim-Simulink Standard Interface

Rod displacement
1450 Xp
Constant for xp
Pump Speed rpm

AMESim:
p1
slink_ Pressure @ port 1
Sine entry applied
to the system P1
sv p2

S-Function Pressure @ port 2


Signal
Generator for Shinho Systems Co., Ltd.
P2
valve opening 2
AMESim® – Matlab® & Simulink® Interfaces
 AMESim to Simulink software
requirements

Shinho Systems Co., Ltd.


3
AMESim® – Matlab® & Simulink® Interfaces

 Simulink to AMESim Software


requireme

Shinho Systems Co., Ltd.


4
AMESim Simulink Interface 환경설정
 MATLAB 설치 위치

※ MATLAB 설치 시 C:\MATLAB 폴더에


설치 할 것
(Default 설치위치는
C:\Program\MATLAB)
Shinho Systems Co., Ltd.
5
AMESim Simulink Interface 환경설정
1 Matlab 환경변수 추가
2

3
1

Path 입력

Shinho Systems Co., Ltd.


AMESim Simulink Interface 환경설정
2 컴파일러 설정
※ 사전 Visual C++ 설치 필수

2-1 AMESim 폴더 내에 vcvars32.bat 파일이 있는지 확인

파일 부재시 Visual C++ 설치폴더의 bin 폴더 내에서


vcvars32.bat 파일을 AMESim 설치폴더로 복사할 것

1 2

Shinho Systems Co., Ltd.


AMESim Simulink Interface 환경설정
2-2 도스창에서 $AME\lib\amemex.exe를 실행하여 Visual C++ 선택

도스창에서 AMESim의
lib 폴더로 갈 것

AMESim ver 7

Shinho Systems Co., Ltd.


AMESim Simulink Interface 환경설정
2-3 AMESim 버전별 amemex 파일 위치(해당 디렉터리에서 파일 확인)

AMESim 4.3

AMESim 7

AMESim 8A

AMESim 8B

Shinho Systems Co., Ltd.


AMESim Simulink Interface 환경설정
4
“amemex –setup” 입력

5
“Y” 입력”

Shinho Systems Co., Ltd.


AMESim Simulink Interface 환경설정
2-4 AMESim 컴파일러 변경
1
3

Shinho Systems Co., Ltd.


AMESim Simulink Interface 환경설정
3 Interface 환경설정 후 Error 발생 시

Compilation window에서 마우스 단축키를 클릭하여


Interactive compilation 클릭한 후 Visual C++ [2] 입력

Shinho Systems Co., Ltd.


AMESim Simulink Interface 환경설정

Parameter Mode에서 System Build가 완료


되면 정상적으로 환경설정이 완료 됨.

Shinho Systems Co., Ltd.


AMESim Simulink Interface Modeling
 Interface Block 생성

Shinho Systems Co., Ltd.


AMESim Simulink Interface Modeling
 Interface Block 생성

Seen as the Simulink block

Outputs Inputs

Shinho Systems Co., Ltd.


AMESim Simulink Interface Modeling
 Interface Block 생성

Inputs from Simulink® Outputs to Simulink®


= =
Simulink outputs Simulink inputs
Shinho Systems Co., Ltd.
AMESim Simulink Interface Modeling
 Interface Block 생성

Shinho Systems Co., Ltd.


AMESim Simulink Interface Modeling
 MATLAB SIMULINK 실행

Shinho Systems Co., Ltd.


AMESim Simulink Interface Modeling
 Simulink S-Function 설정 AMESim® file = slink.ame
 S-function name = slink_

1st parameter: 2nd parameter:

AMESim® results file created (1) or AMESim® print interval in the results file
not (any other number) (parameter  0 : same interval as the
one defined in Simulink ®)
Shinho Systems Co., Ltd.
AMESim Simulink Interface Modeling
 S-Function 인식

1
2
1
2

※ Simulink를 Run(F5)시켜 S-Function과 AMESim


Interface Block을 sink 시킨다

Shinho Systems Co., Ltd.


AMESim Simulink Interface Modeling
 Solver 설정

Simulink simulation
parameters

Hydraulic systems are


normally stiff, so to solve
such systems in Simulink,
Select stiff integrator
algorithms. (ode23s, ode15s)

Shinho Systems Co., Ltd.


AMESim Simulink Interface Modeling
 Simulink Results

Shinho Systems Co., Ltd.

You might also like