Guideline for Vehicle Simulation using MATLAB

  • Published on
    21-Oct-2015

  • View
    41

  • Download
    2

Embed Size (px)

DESCRIPTION

A supplementary document for vehicle dynamics course taught at the Mechanical Engineering, Mahidol University.

Transcript

  • Page | 1

    Supplementary Document for Longitudinal Dynamics

    Computer Simulation using Matlab/Simulink

  • Supplementary Notes I Computer Simulation EGME 353 Mechanics of Vehicle

    1) Simulation Model Simulink Model 1. Engine Map Torque

    RPM 2. 3.

    i. ii.

    iii. iv.

    2) Simulation Model

    Vehicle: CG height (inch): 20 Wheelbase(inch): 109 Fore/Aft (CG) (inch): 39/70 Mass (lb): 2500 Engine: Inertia (in-lb-sec2): 0.8 RPM/Torque (ft-lb): 800 120 2400 175 4000 200 1200 132 2800 181 4400 201 1600 145 3200 190 4800 198 2000 160 3600 198 2500 180 Transmission Data Gear 1 2 3 4 5 Inertia (in-lb-sec2) 1.3 0.9 0.7 0.5 0.3 Ratio 4.28 2.79 1.83 1.36 1.00 Efficiency 0.966 0.967 0.972 0.973 0.970 Final Drive Data Inertia (in-lb-sec2): 1.2 Ratio: 2.92 Efficiency: 0.99 Wheel Data

    Inertia(in-lb-sec2): 11.0 (Drive and Non-Drive) Size (radius-in): 12.59

    2.1) Simulation Model

  • Supplementary Notes I Computer Simulation EGME 353 Mechanics of Vehicle

    2.1)1. (1 ) 2.1)2. (1 ) 2.1)3. (1 )

    2.2) 2.1)3. 2- 5 (4 ) Max Tractive Force max Note: Simulate 10 Max Tractive Force

    2.3) (1 ) 2.4) (1 ) 2.5) m-file

  • Supplementary Notes I Computer Simulation EGME 353 Mechanics of Vehicle Guideline to construct Simulink simulation model to describe the longitudinal dynamic

    of a vehicle

    1.

    ( )( ) aINNINIrg

    WWRRRTrNN

    etfsfwharetf

    t

    +++=

    22

    2

    1sin (1)

    (1) aMWRRRF eharx = sin (2)

    etftx TrNN

    F

    =

    WKR rr = 2

    21 VACR da =

    ( )( ) +++= etfsfwe INNINIrgWM 2221 Block Diagram 2. Simulink Simulation Diagram ( EGME 309: Lab3)

    Block Diagram (1) Simulink simulation diagram Simulink simulation diagram 2 1. EGME 309

    Mechanical Engineering Laboratory III Tutorials Website

    2. MATLAB Simulink Command Window Click Simulink Icon Simulink

    eM1 x Fx

    Rr

    Ra

    v a

    Wsin -

    --

    +

  • Supplementary Notes I Computer Simulation EGME 353 Mechanics of Vehicle

    3. Simulink Simulation Diagram Click Icon New Diagram

    Simulink Icon

    Open New Diagram

  • Supplementary Notes I Computer Simulation EGME 353 Mechanics of Vehicle

    4. Block diagram (1) Simulation diagram Sum (Drag Sum Math Operation Drop Blank Diagram) Sum (2) (Double Click Sum (2) 4 )

    5. (2) Output Sum 1/M Gain Diagram (Drag Gain Math Operation Drop Blank Diagram) 1/M (Double Click Gain )

    Double Clicks Sum + - - -

  • Supplementary Notes I Computer Simulation EGME 353 Mechanics of Vehicle

    6. Integrator Diagram (Drag Integrator Continuous Drop Blank Diagram) Integrator

    Double Clicks Gain 1/M

  • Supplementary Notes I Computer Simulation EGME 353 Mechanics of Vehicle

    7. Input ( (2))

    1) Engine Map

    Engine Map (2) Engine: RPM/Torque (ft-lb):

    800 120 2400 175 4000 200 1200 132 2800 181 4400 201 1600 145 3200 190 4800 198 2000 160 3600 198 2500 180

    ?

    Final Drive

    ( ) WheeltfEnginewheeltire

    CarCar NNr

    VV == (3) VCar Integrate (2)

    FX Simulink Lookup Table

    (RPM)

    Engine Map (Torque vs. RPM)

    etf

    t TrNN

    Fx ( (2))

  • Supplementary Notes I Computer Simulation EGME 353 Mechanics of Vehicle

    - Simulink Lookup Table

    - Lookup Table Diagram (Drag Lookup Table Lookup Tables Drop Blank Diagram) Double Click () Vector of input values: () 1: [800 1200 1600 2000 2400 2800 3200 3600 4000 4400 4800 5200] 2: [800:400:5200] Vector of output values: [120 132 145 160 175 181 190 198 200 201 198 180]

    - Gain Math Operation 2 Fx o )*2*/()60**( pirNN tf

    o rNNEff tf /***12

    - Diagram

    Double Clicks

  • Supplementary Notes I Computer Simulation EGME 353 Mechanics of Vehicle

    Lookup Table

    1s

    Integrator1

    1s

    Integrator

    12*Eff*Nf*Nt/r

    Gain4

    Nf*Nt*60/(r*2*pi)

    Gain3

    1/M

    Gain

    Note: Diagram MSWord Edit Click Copy Model to Clipboard Paste MSWord Document

    8. Input ( (2))

    (2) Curb Weight () ( Class Notes)

    : fsrrf WKR = (4) : rsrrr WKR = (5)

    Kr Rr Simulink Constant Gain

    - Constant 2 (1 ) Sources Wfs Wrs

    - Gain Math Operation 2 Gain Kr

    - Sum Math Operation Sum 2 (2)

    - Diagram

  • Supplementary Notes I Computer Simulation EGME 353 Mechanics of Vehicle

    Lookup Table

    1s

    Integrator1

    1s

    Integrator

    12*Eff*Nf*Nt/r

    Gain4

    Nf*Nt*60/(r*2*pi)

    Gain3

    Kr

    Gain2

    Kr

    Gain1

    1/M

    Gain

    Wrs

    Constant1

    Wfs

    Constant

    9. Input ( (2)) (2)

    2

    21 VACR da =

    Fcn Function User-Defined Functions Diagram (Double Click Fcn )

    - input u - Sin(X) X input sin(u) - u input V

    ( rho = ) 0.5*rho*A*Cd*u*u

    Double Clicks Default 0.5*rho*A*Cd*u*u

  • Supplementary Notes I Computer Simulation EGME 353 Mechanics of Vehicle

    - Diagram

    Lookup Table

    1s

    Integrator1

    1s

    Integrator

    12*Eff*Nf*Nt/r

    Gain4

    Nf*Nt*60/(r*2*pi)

    Gain3

    Kr

    Gain2

    Kr

    Gain1

    1/M

    Gain

    0.5*rho*A*Cd*u*u

    Fcn

    Wrs

    Constant1

    Wfs

    Constant

    10. Input ( (2))

    Rh Constant 1 Sources Rh Diagram

    Lookup Table

    1s

    Integrator1

    1s

    Integrator

    Eff*Nf*Nt/r

    Gain4

    Nf*Nt/r

    Gain3

    Kr

    Gain2

    Kr

    Gain1

    1/M

    Gain

    0.5*rho*A*Cd*u*u

    Fcn

    Rh

    Constant2

    Wrs

    Constant1

    Wfs

    Constant

    11. Integrate Diagram

  • Supplementary Notes I Computer Simulation EGME 353 Mechanics of Vehicle

    Lookup Table

    1s

    Integrator1

    1s

    Integrator

    Eff*Nf*Nt/r

    Gain4

    Nf*Nt/r

    Gain3

    Kr

    Gain2

    Kr

    Gain1

    1/M

    Gain

    0.5*rho*A*Cd*u*u

    Fcn

    Rh

    Constant2

    Wrs

    Constant1

    Wfs

    Constant

    12. Clock Step (Drag Clock Step Source Drop Blank Diagram)

    13. To Workspace (Drag To Workspace Sink Drop Blank Diagram) x v Fx time : To Workspace Structure () Structure Array (Double Click To Workspace Save Format)

    14. (2) 15.

  • Supplementary Notes I Computer Simulation EGME 353 Mechanics of Vehicle

    Fx

    To Workspace3

    time

    To Workspace2

    v

    To Workspace1

    x

    To Workspace

    Lookup Table

    1s

    Integrator1

    1s

    Integrator

    12*Eff*Nf*Nt/r

    Gain4

    Nf*Nt*60/(r*2*pi)

    Gain3

    Kr

    Gain2

    Kr

    Gain1

    1/M

    Gain

    0.5*rho*A*Cd*u*u

    Fcn

    Rh

    Constant2

    Wrs

    Constant1

    Wfs

    Constant

    Clock

    16. Save ! XXX.mdl Simulink Simulation Model

    17. m-file Simulate : mfile %

    %Vehicle: G = 386 %Gravity (in/sec2) CGh = 20; %CG Hight (inch) Wbase = 109; %Wheel Base (inch) FCG = 39; %Position of CG measured from the front axle (inch) ACG = 70; %Position of CG measured from the rear axle (inch) Mv = 2500; %Vehicle Mass (lb) Wfs = M*ACG/Wbase; % Front Axle Curb Weight (lb) Wrs = M*FCG/Wbase; % Rear Axle Curb Weight (lb)

    % Engine Ie = 0.8; %Engine Inertia (in-lb-sec2)

    % Transmission It = 1.3; %Inertia (in-lb-sec2)

    Nt = 4.28; %1st Gear Ratio EffG = 0.966; %Gear Efficiency

    % Final Drive EffF = 0.99; %Efficiency of the Final Drive

  • Supplementary Notes I Computer Simulation EGME 353 Mechanics of Vehicle

    Nf = 2.92; %Final Drive Gear Ration Is = 1.2; %Inertia (in-lb-sec2) Eff = EffF*EffG; %Overall Efficiency

    % Wheel Data

    Iw = 11.0; %Inertia (in-lb-sec2) r = 12.59 %Tire Radius (inch) Kr = 0; %Coefficient of Rolling Resistant

    % Other Resistant

    Rh = 0;

    % Effective Mass M = (Mv/G) + (Ie+It)*(Nt*Nf)^2 + Is*Nf^2 + Iw;

    18. Save ! XXX.m

    m-file Model 19. load parameters m-file Command Window MATLAB (

    .m) F5 m-file 20. Play Simulation Diagram 21. plot MATLAB Command Window

    >>plot(time,v),grid - (grid ) - MSWord Edit

    Click Copy Figure Paste MSWord Document

    0 1 2 3 4 5 6 7 8 9 100

    100

    200

    300

    400

    500

    600

    700

    800

    900

    1000

  • Supplementary Notes I Computer Simulation EGME 353 Mechanics of Vehicle

    - (....)

    >> title('Simulation Response showing Vehicle Velocity in inch/sec') >> ylabel('Velocity (inch/sec)') >> xlabel('Time (second)')

    0 1 2 3 4 5 6 7 8 9 100

    100

    200

    300

    400

    500

    600

    700

    800

    900

    1000Simulation Response showing Vehicle Velocity in inch/sec

    Vel

    ocity

    (inc

    h/se

    c)

    Time (second)

    22. plot plot MATLAB Command Window >>plot(time,v,k:,time,Fx,r),grid

    0 1 2 3 4 5 6 7 8 9 100

    500

    1000

    1500

    2000

    2500

  • Supplementary Notes I Computer Simulation EGME 353 Mechanics of Vehicle

    - plot >> help plot plot plot time v ( k) ( : ) time Fx ( r) ( -- ) help plot

    - () >> plot(time,v,'k:',time,Fx,'r--'),grid >> title('Simulation Response showing Velocity and Tractive Force') >> xlabel('Time (second)') >> legend('Velocity','Tractive Force')

    0 1 2 3 4 5 6 7 8 9 100

    500

    1000

    1500

    2000

    2500Simulation Response showing Velocity and Tractive Force

    Time (second)

    VelocityTractive Force