Sie sind auf Seite 1von 35

Using ModelSim and Matlab/Simulink for

System Simulation in Automotive Engineering


Dipl.-Ing. Sven Altmann
Dr.-Ing. Ulrich Donath
Fraunhofer-Institut Integrierte Schaltungen
Branch Lab Design Automation Dresden

Mentor Graphics Users Group 2003


9. / 10. Oktober 2003, Sonthofen

Mentor Graphics Users Group, October 2003

Automotive Engineering

System Specification
- X-by-Wire, ABS, ESP
- Automatic climate control
- Automatic transmission

System Simulation
- Functional test
- Parametrisation
- Configuration

Controller Design
- ECU
- FPGA
- ASIC
Mentor Graphics Users Group, October 2003

Outline

Objective

Matlab/Simulink Vehicle Model

VHDL-Design Controller

Simulator Coupling

System Simulation

Summary

Mentor Graphics Users Group, October 2003

Objective

Simulation Support in Automotive System Design


Reduction in developing effort
Increasing design guaranty and reliability
Reducing costs

Requirements for Simulation


Check of the system functionality, performance and
security
Behaviour of subsystems in interaction with the
environment
System dynamics in time critical load cases and
error situations
Optimisation of selected operating parameters
Mentor Graphics Users Group, October 2003

Objective
Vehicle modelling
Controller design

Simulator coupling

System simulation
Exact environment modelling
for controller design

Model VEHICLE

Model CONTROL

Simulation
VEHICLE

Simulation
CONTROL

Model VEHICLE

FhG IIS Library


Coupling blocks

Model CONTROL

Test environment

VHDL

Mentor Graphics Users Group, October 2003

Outline

Objective

Matlab/Simulink Vehicle Model

VHDL-Design Controller

Simulator Coupling

System Simulation

Summary

Mentor Graphics Users Group, October 2003

Matlab/Simulink Vehicle Model

Example from MATLAB Demos :


- Automatic transmission control

Vehicle model contains models of :


- Engine, transmission
- Controller
- Driver activity

Mentor Graphics Users Group, October 2003

Matlab/Simulink Vehicle Model

Module : Shift logic

Shift logic
Mentor Graphics Users Group, October 2003

Matlab/Simulink Vehicle Model

Stateflow model : Shift logic


FSM 1
Gear Switching
FSM 2
Shift Selection

Mentor Graphics Users Group, October 2003

Matlab/Simulink Vehicle Model

Shift Schedule (MATLAB Demo)

Threshold Up_Shift

Threshold Down_Shift

Mentor Graphics Users Group, October 2003

Matlab/Simulink Vehicle Model

Simulation Input

Simulation Output

Driver activity

Vehicle behaviour

Throttle
Speed

Gear

Mentor Graphics Users Group, October 2003

Outline

Objective

Matlab/Simulink Vehicle Model

VHDL-Design Controller

Simulator Coupling

System Simulation

Summary

Mentor Graphics Users Group, October 2003

VHDL-Design Controller

System model in Matlab/Simulink

Transformation of the Stateflow model Shift logic into VHDL


Mentor Graphics Users Group, October 2003

VHDL-Design Controller

Block diagram Shift logic in HDL-Designer

FSM 1
Gear Switching

FSM 2
Shift Selection

Mentor Graphics Users Group, October 2003

VHDL-Design Controller
Transformation of the FSM
Gear Switching

Mentor Graphics Users Group, October 2003

VHDL-Design Controller
Transformation of the FSM
Shift Selection

Mentor Graphics Users Group, October 2003

VHDL-Design Controller
Transformation of Shift Schedule
Gear
Throttle [%]

Shift Schedule (MATLAB Demo)

10.0

30.0

50.0

10

10.0

30.0

50.0

20

10.0

30.0

50.0

30

13.0

30.0

50.0

40

18.0

34.0

54.0

50

23.0

42.0

60.0

60

27.0

48.0

70.0

70

32.0

56.0

80.0

80

36.0

63.0

90.0

90

40.0

80.0 100.0

100

40.0

80.0 100.0

LookUp-Table Up_Shift
Mentor Graphics Users Group, October 2003

VHDL-Design Controller

VHDL-Testbench in HDL-Designer
Stimuli
Throttle
Speed

MUT

Response
Gear

Reset
Clock

Test pattern

Comparing responses
with Shift Schedule

Mentor Graphics Users Group, October 2003

VHDL-Design Controller

Simulation results in ModelSim

Gear
Speed
Throttle

ModelSim Wavetool

Mentor Graphics Users Group, October 2003

Outline

Objective

Matlab/Simulink Vehicle Model

VHDL-Design Controller

Simulator Coupling

System Simulation

Summary

Mentor Graphics Users Group, October 2003

Simulator Coupling

Restrictions of the VHDL-testbench


- vehicle dynamics are modelled roughly
- no feedback to vehicle behaviour

Solution

Combining VHDL controller model


and Matlab/Simulink vehicle model

Mentor Graphics Users Group, October 2003

Simulator Coupling

System model in Matlab/Simulink

VHDL model Shift logic


Mentor Graphics Users Group, October 2003

Gear

Data transfer

Speed

Throttle

Simulator Coupling

Matlab/Simulink
ModelSim-Coupler

S-Function (DLL)

TCP/IP
Socket-Channel

Matlab-Coupler

C-Architecture (DLL)

Gear

Speed

Throttle

ModelSim

Mentor Graphics Users Group, October 2003

Simulator Coupling

Synchronisation

Sample period

Sample period

t_Simulink

Matlab/
Simulink

simulate to t1

ModelSim

t0

simulate to t2

t1

t2

t_ModelSim

Mentor Graphics Users Group, October 2003

Simulator Coupling

Vehicle model includes ModelSim-Coupler

Coupling block to ModelSim


Mentor Graphics Users Group, October 2003

Simulator Coupling

Controller model includes Matlab-Coupler

Matlab_Coupler

Coupling block to Matlab

Mentor Graphics Users Group, October 2003

Outline

Objective

Matlab/Simulink Vehicle Model

VHDL-Design Controller

Simulator Coupling

System Simulation

Summary

Mentor Graphics Users Group, October 2003

System Simulation

System testbench
Matlab/Simulink

Vehicle model

ModelSim
Gear

Throttle
Speed

Reset
Clock

Shift logic

Mentor Graphics Users Group, October 2003

System Simulation
Matlab/Simulink

ModelSim-Coupler
Data from ModelSim

Data to ModelSim
TCP/IP
ModelSim
Matlab-Coupler
Data to Matlab

Data from Matlab

Mentor Graphics Users Group, October 2003

System Simulation

Diagrams
Driver activity
Vehicle behaviour

Control signals

Lists, Statistics ...


Mentor Graphics Users Group, October 2003

Outline

Objective

Matlab/Simulink Vehicle Model

VHDL-Design Controller

Simulator Coupling

System Simulation

Summary

Mentor Graphics Users Group, October 2003

Summary
Model VEHICLE

Model CONTROL

Vehicle modelling
Controller design

Simulation
VEHICLE

Model VEHICLE

Simulator coupling

Simulation
CONTROL

FhG IIS Library


Coupling blocks

Model CONTROL

Test environment

System simulation
Exact environment modelling
for controller design

VHDL

Mentor Graphics Users Group, October 2003

Using Simulation Results


Check of the system functionality, performance and security
Does the transmission switch and
are parameters kept (overspeed limitation) ?
Behaviour of subsystems in interaction with the environment
Effect of the current transmission gear for
rotation speed and vehicle speed
System dynamics in time critical load cases and error situations
How does the vehicle react if brake and throttle are
simultaneously activated or if signal transfer failed ?
Optimisation of selected operating parameters
Customisation of the shift schedule
Mentor Graphics Users Group, October 2003

Summary

Forecast : Synthesis of the FPGA Prototype

RTL Schematic
of automaton
Shift Selection

Mentor Graphics Users Group, October 2003

Thanks for your attention !

Mentor Graphics Users Group, October 2003

Das könnte Ihnen auch gefallen