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
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
Outline Objective Matlab/Simulink Vehicle Model VHDL-Design Controller Simulator Coupling System Simulation Summary
Objective Simulation Support in Automotive System Design Requirements for Simulation Reduction in developing effort Increasing design guaranty and reliability Reducing costs 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
Objective Vehicle modelling Model VEHICLE Model CONTROL Controller design Simulation VEHICLE Simulation CONTROL Simulator coupling Model VEHICLE FhG IIS Library Coupling blocks Model CONTROL System simulation Test environment Exact environment modelling for controller design VHDL
Outline Objective Matlab/Simulink Vehicle Model VHDL-Design Controller Simulator Coupling System Simulation Summary
Matlab/Simulink Vehicle Model Example from MATLAB Demos : - Automatic transmission control Vehicle model contains models of : - Engine, transmission -Controller - Driver activity
Matlab/Simulink Vehicle Model Module : Shift logic Shift logic
Matlab/Simulink Vehicle Model Stateflow model : Shift logic FSM 1 Gear Switching FSM 2 Shift Selection
Matlab/Simulink Vehicle Model Shift Schedule (MATLAB Demo) Threshold Up_Shift Threshold Down_Shift
Matlab/Simulink Vehicle Model Simulation Input Driver activity Simulation Output Vehicle behaviour Throttle Speed Gear
Outline Objective Matlab/Simulink Vehicle Model VHDL-Design Controller Simulator Coupling System Simulation Summary
VHDL-Design Controller System model in Matlab/Simulink Transformation of the Stateflow model Shift logic into VHDL
VHDL-Design Controller Block diagram Shift logic in HDL-Designer FSM 1 Gear Switching FSM 2 Shift Selection
VHDL-Design Controller Transformation of the FSM Gear Switching
VHDL-Design Controller Transformation of the FSM Shift Selection
VHDL-Design Controller Transformation of Shift Schedule Gear Throttle [%] 1 2 3 4 0 10.0 30.0 50.0 10 20 30 10.0 10.0 13.0 30.0 30.0 30.0 50.0 50.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 Shift Schedule (MATLAB Demo) LookUp-Table Up_Shift
VHDL-Design Controller VHDL-Testbench in HDL-Designer Stimuli Throttle Speed MUT Response Gear Reset Clock Test pattern Comparing responses with Shift Schedule
VHDL-Design Controller Simulation results in ModelSim Gear Speed Throttle ModelSim Wavetool
Outline Objective Matlab/Simulink Vehicle Model VHDL-Design Controller Simulator Coupling System Simulation Summary
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
Simulator Coupling System model in Matlab/Simulink VHDL model Shift logic
Simulator Coupling Data transfer Throttle Matlab/Simulink ModelSim-Coupler S-Function (DLL) TCP/IP Socket-Channel Matlab-Coupler C-Architecture (DLL) ModelSim Throttle Speed Gear Speed Gear
Simulator Coupling Synchronisation Sample period Sample period Matlab/ Simulink t_simulink simulate to t1 simulate to t2 ModelSim t0 t1 t2 t_modelsim
Simulator Coupling Vehicle model includes ModelSim-Coupler Coupling block to ModelSim
Simulator Coupling Controller model includes Matlab-Coupler Matlab_Coupler Coupling block to Matlab
Outline Objective Matlab/Simulink Vehicle Model VHDL-Design Controller Simulator Coupling System Simulation Summary
System Simulation System testbench Matlab/Simulink Vehicle model ModelSim Throttle Speed Gear Reset Clock Shift logic
System Simulation Matlab/Simulink ModelSim-Coupler Data to ModelSim Data from ModelSim ModelSim Matlab-Coupler Data to Matlab TCP/IP Data from Matlab
System Simulation Diagrams Driver activity Vehicle behaviour Control signals Lists, Statistics...
Outline Objective Matlab/Simulink Vehicle Model VHDL-Design Controller Simulator Coupling System Simulation Summary
Summary Vehicle modelling Model VEHICLE Model CONTROL Controller design Simulation VEHICLE Simulation CONTROL Simulator coupling Model VEHICLE FhG IIS Library Coupling blocks Model CONTROL System simulation Test environment Exact environment modelling for controller design VHDL
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
Summary Forecast : Synthesis of the FPGA Prototype RTL Schematic of automaton Shift Selection
Thanks for your attention!