Vehicle Dynamics Blockset User's Guide
R2018a
How to Contact MathWorks Latest news:
www.mathworks.com
Sales and services:
www.mathworks.com/sales_and_services
User community:
www.mathworks.com/matlabcentral
Technical support:
www.mathworks.com/support/contact_us
Phone:
508-647-7000
The MathWorks, Inc. 3 Apple Hill Drive Natick, MA 01760-2098 Vehicle Dynamics Blockset ™ User's Guide
© COPYRIGHT 2018 by The MathWorks, MathWorks, Inc. The software described in this document is furnished under a license agreement. The software may be used or copied only under the terms of the license agreement. No part of this manual may be photocopied or reproduced in any form without prior written consent from The MathWorks, Inc. FEDERAL ACQUISITION: This provision applies to all acquisitions of the Program and Documentation by, for, for, or through the federal government of the United States. By accepting delivery of the Program or Documentation, the government hereby agrees that this software or documentation qualies as commercial computer software or commercial computer software documentation as such terms are used or dened in FAR FAR 12.212, DFARS DFARS Part 227.72, and DFARS DFARS 252.227-7014. Accordingly, Accordingly, the terms and conditions of this Agreement and only those rights specied in this Agreement, shall pertain to and govern the use, modication, reproduction, release, performance, display, and disclosure of the Program and Documentation by the federal government (or other entity acquiring for or through the federal government) and shall supersede any conicting contractual terms or conditions. If this License fails to meet the government's needs or is inconsistent in any respect with federal procurement law, the government agrees to return the Program and Documentation, unused, to The MathWorks, Inc.
Trademarks
MATLAB and Simulink are registered trademarks of The MathWorks, Inc. See www.mathworks.com/trademarks for a list of additional trademarks. Other product or brand names may be trademarks or registered trademarks of their respective holders. Patents
MathWorks MathWorks products are protected by one or more U.S. patents. Please see www.mathworks.com/patents for more information. Revision History
March 2018
Online only
New for Version 1.0 (Release 2018a)
Contents
Getting Started
1 Vehicle Vehicle Dynamics Blockset Blockset Product Description Description . . . . . . . . . . . Key Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1-2 1-2
Required and Recommended Recommended Products Products . . . . . . . . . . . . . . . . . . . Required Products . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Recommended P Recommended Prroducts . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1-3 1-3 1-3
3D Visualization Engine Engine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1-4 1-4
Vehicle Vehicle Dynamics Blockset Blockset Communication with 3D Visualization Softwa Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1-6
Yaw Yaw Stability on V arying Road Surfaces . . . . . . . . . . . . . . . . . . . 1-8 Run a Double-Lane Change Maneuver . . . . . . . . . . . . . . . . . . 1-8 Sweep Surface Fr Friction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-10 Vehicle Vehicle Steering Steering Gain at Diferent Speeds . . . . . . . . . . . . . . . Run a Slowly Increasing Increasing Steerin Steering Maneuver . . . . . . . . . . . . . Sweep Speed Set Points . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1-21 1-21 1-23
Frequency Response to t o Steering Angle Input . . . . . . . . . . . . . Run a Swept-Sine Steering Steering Maneuver . . . . . . . . . . . . . . . . . . Sweep Steering Steering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1-30 1-30 1-32
iii
Coordinate Systems
2 Coordinate Systems in Vehicle Dynamics Blockset . . . . . . . . . Earth-Fixed (Inertial) Coordinate System . . . . . . . . . . . . . . . . Vehicle Vehicle Coordinate System . . . . . . . . . . . . . . . . . . . . . . . . . . . Tire and Wheel Coordinate Systems . . . . . . . . . . . . . . . . . . . . World World Coordinate S ystem . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2-2 2-2 2-3 2-4 2-6
Reference Applications Applications
3
iv
Contents
Passenger Vehicle Dynamics Dynamics Models . . . . . . . . . . . . . . . . . . . . .
3-2
Double-Lane Change Maneuver Maneuver . . . . . . . . . . . . . . . . . . . . . . . . . Lane Change Refere Reference Generator . . . . . . . . . . . . . . . . . . . . . Predictive Dri ver ver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Controllers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Passenger Vehicle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Visualization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-4 3-5 3-6 3-6 3-6 3-7
Scene Interrogation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3D Visua isuali liza zati tion on . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Controller and Displa Display y Su Sub bsyst system em . . . . . . . . . . . . . . . . . . . .
3-13 3-14 3-16
Swept-Sine Steering Maneuver Maneuver . . . . . . . . . . . . . . . . . . . . . . . . Swept Sine Referenc Reference Generator . . . . . . . . . . . . . . . . . . . . . Longitudinal Dr Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Controllers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Passenger Vehi Vehicle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Visualization Subsystem . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-20 3-21 3-21 3-21 3-22 3-23
Slowly Increasing Steering Maneuver . . . . . . . . . . . . . . . . . . . Slowly Increasing Steer Block . . . . . . . . . . . . . . . . . . . . . . . . Longitudinal Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Controllers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Passenger Ve Vehicle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Visualization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-28 3-29 3-29 3-30 3-30 3-31
Run a Maneuver in 3D Environment . . . . . . . . . . . . . . . . . . . .
3-37
Supporting Data
4 Supporting Scene, Drive Cycle, and Maneuver Data . . . . . . . . Install Maneuver and Drive Cycle Data . . . . . . . . . . . . . . . . . . Customize and Install Ad Additional Scenes . . . . . . . . . . . . . . . . .
4-2 4-2 4-2
v
1 Getting Started
1
Getting Started
Vehicle Dynamics Blockset Product Description Model and simulate vehicle dynamics in a virtual 3D environment
Vehicle Vehicle Dynamics Blockset™ provides fully assembled reference application models that simulate driving maneuvers in a 3D environment. You can use the prebuilt scenes to visualize roads, trafic signs, trees, buildings, and other objects around the vehicle. You can customize the reference models by using us ing your own data or by replacing a subsystem with your own model. The blockset includes i ncludes a library of components for modeling propulsion, steering, suspension, vehicle bodies, brakes, and tires. Vehicle Vehicle Dynamics Blockset provides a standard model architecture that can be used throughout the development process. It supports ride and handling analyses, chassis controls development, software integration testing, and hardware-in-the-loop testing. By integrating vehicle dynamics models with a 3D environment, you can test ADAS and automated driving perception, planning, and control software. These models let you test your vehicle with standard driving maneuvers such as a double lane change or with your own custom scenarios.
Key Features • Preassembled Preassembled vehicle vehicle dynamics dynamics models models for passenger passenger cars cars and and trucks trucks • Preassembled Preassembled maneuvers maneuvers for common common ride and and handling handling tests, tests, including including a double-lane double-lane change • 3D environme environment nt for visualizing visualizing simulatio simulations ns and communicatin communicating g scene scene information information to Simulink ® • Libraries Libraries of propulsion, propulsion, steering steering,, suspension, suspension, vehicle vehicle body, body, brake, and tire tire components components • Combin Combined ed longit longitudi udinal nal and and lateral lateral slip dynam dynamic ic tire tire models models • Predictive Predictive driver driver model model for for generatin generating g steering steering commands commands that that track a predened path • Prebuilt Prebuilt 3D scenes, scenes, including including straight straight roads, curved curved roads, roads, and parking parking lots
1-2
Required and Recommended Products
Required and Recommended Products Required Products Vehicle Vehicle Dynamics Blockset product requires current versions of these products: • MATLAB • Simulink
Recommended Products You You can extend the capabilities of the Vehicle Vehicle Dynamics Blockset using the following recommended products. Goal
Model events
Recommended Product
Stateow®
Test closed-loop perception, planning, and control algorithms
Automated Driving System Toolbox Toolbox™
Test vehicle-level integration
Powertrain Blockset™
Optimize vehicle energy consumption, ride and handling
1-3
1
Getting Started
3D Visualization Engine The 3D visualization engine requires: • A Windows® 64-bit platform. If you do not enable the 3D visualization engine, Vehicle Dynamics Blockset runs on Windows, Mac, and Linux L inux® 64-bit platforms. • Microsoft® DirectX®. If it is not already installed on your machine, Vehicle Dynamics Blockset prompts you to install the software the rst time you enable 3D visualization. To use the Vehicle Dynamics Blockset 3D visualization engine, consider these hardware recommendations: • Graphics Graphics card card (GPU): (GPU): Virtual Virtual Reality (VR) ready ready with with 8-GB 8-GB on-boar on-board d RAM • Proc Process essor or (CPU (CPU): ): 2.60 2.60 GHz GHz • Memo Memory ry (RAM (RAM): ): 12 GB
Limitations The 3D visualization engine and blocks do not support: • Co Cod de gene generratio ation. n. • Mode Modell refe refere renc nce. e. • Multip Multiple le instanc instances es of the Simulat Simulation ion 3D Cong block. • Multiple Multiple instances instances of the same actor tag. tag. To To refer to the same same scene scene actor when you you use the 3D block pairs (e.g. Simulation 3D Actor Transform Get and Simulation 3D Actor Transform Set), specify the same Tag for actor in 3D scene, Actortag parameter. • Paral aralle lell simu simula lati tion ons. s. • Rapi Rapid d acce accele lera rato torr mod mode. e.
See Also Simulation 3D Actor Transform Get | Simulation 3D Actor Transform Set | Simulation 3D Camera Get | Simulation 3D Cong | Vehicle Terrain Sensor
1-4
See Also
More About •
“Vehic “Vehicle le Dynam Dynamics ics Bloc Blockse ksett Commu Communic nicati ation on with with 3D 3D Visua Visualiza lization tion Sof Softwar tware” e” on on page page 1-6
•
“Sce “Scen ne IInt nter erro rog gatio ation” n” on page age 3 3--13
External Websites •
Unreal Engine
1-5
1
Getting Started
Vehicle Dynamics Blockset Communication with 3D Visualization Visualization Software The vehicle dynamics models run programmable maneuvers in a photorealistic 3D visualization environment. Vehicle Vehicle Dynamics Blockset integrates the 3D simulation environment with Simulink so that you can query the world around the vehicle for virtually testing perception, control, and planning algorithms. The Vehicle Vehicle Dynamics Blockset visualization environment uses the Unreal Engine® by Epic Games®. When you use Vehicle Dynamics Blockset to run a maneuver, maneuver, Simulink can co-simulate with the visualization engine.
In the Simulink environment, Vehicle Vehicle Dynamics Blockset: • Determines Determines the the next position position of object objectss by using using 3D 3D visualization visualization environment environment feedback and vehicle dynamics models. • Congures the 3D visualization environment, specically: • Ray tracing • Scen Scene e cap captu ture re came camera rass • Init Initia iall obje object ct pos posit itio ions ns In the visualization engine environment, Vehicle Vehicle Dynamics Blockset positions the objects and uses ray tracing to query the environment.
1-6
See Also
See Also More About •
“3D “3D Vis Visua uali liza zati tion on En Engi gine ne”” on on pag page e 11-4
•
“Sce “Scene ne Inter nterro rog gatio ation” n” on page age 3 3--13
External Websites •
Unreal Engine
1-7
1
Getting Started
Yaw Yaw Stability on Varying Varying Road Surfaces Surfaces This example shows how to run the double-lane change maneuver on diferent road surfaces, analyze the vehicle yaw stability, stability, and determine the maneuver success. s uccess. ISO 3888-21 denes the double-lane change maneuver to test the obstacle avoidance performance of a vehicle. In the test, the driver: • Accele Accelerate ratess until until vehic vehicle le hits hits a targe targett veloci velocity ty • Rele Release asess the the acce accele lera rato torr peda pedall • Turns Turns steeri steering ng wheel wheel to to follow follow path path into into the the left left lane • Turns steering steering wheel wheel to to follow follow path path back back into into the the right right lane lane Typically, Typically, cones mark the lane boundaries. If the vehicle and driver can negotiate the maneuver without hitting a cone, the vehicle passes the test. For more information about the reference application, see “Double-Lane Change Maneuver” on page 3-4.
Run a Double-Lane Change Maneuver 1
Create and open a working copy of the double-lane change reference application. vdynblksDblLaneChangeStart
2
Open the Lane Change Reference Generator Generator block. By default, the maneuver is set with these parameters: • Longitudinal entrance velocity setpoint — setpoint — 30 mph • Vehicle Vehicle width — width — 2 m • Lateral reference position breakpoints and breakpoints and Lateral reference data — data — Values that specify the lateral reference trajectory as a function of the longitudinal distance
3
Run the maneuver with the default settings. As the simulation runs, view vehicle information. • In the Vehicle Vehicle Positio Position n window, window, view the vehicle vehicle longitud longitudinal inal distance distance as a function function of lateral distance.
1-8
Yaw Stability on Varying Road Surfaces
• In the Visualiz Visualization ation subsyste subsystem, m, open the Lane Change Change scope scope block to display display the lateral displacement as a function of time. • Red line — Cone Coness marki marking ng lane bou bounda ndary ry • Blue Blue llin ine e — Refe Refere renc nce e traj trajec ecto tory ry • Gree Green n lin line e — Actu Actual al traj trajec ecto tory ry The green line does not cross the red line that marks the cones.
1-9
1
Getting Started
Sweep Surface Friction Run the reference application on three road surfaces with diferent friction scaling coeficients. Use the results to analyze the yaw stability and help determine the success of the maneuver. 1
1-10
In the double-lane change reference application model DLCReferenceApplication,, open the Environment subsystem. The Friction block DLCReferenceApplication parameter Constant value species the friction scaling coeficient lambdamu. lambdamu. By
Yaw Stability on Varying Road Surfaces
default, the friction scaling coeficient is 1.0. 1.0. The reference application uses the coeficient to adjust the friction at every time step.
2
In the Visualization subsystem, enable signal logging for these lane change signals:
, , , , , , and . . Save the model.
3
Set up a vector with the friction scaling coeficients, lambdamu, lambdamu, that you want to investigate. For example, to examine friction scaling coeficients equal to 0.50, 0.50, 0.65, 0.65, and 0.80, 0.80, at the command line enter: mdl = 'DLCReferenceApplication' 'DLCReferenceApplication'; ; open_system(mdl); % Define the set of parameters to sweep lambdamu = [0.50, 0.65, 0.80]; numExperiments = length(lambdamu);
4
lambdamu equal to the Friction Create an array of simulation inputs that sets lambdamu equal constant block parameter. parameter.
1-11
1
Getting Started
% Create an array of Simulink.SimulationInputs for idx for idx = numExperiments:-1:1 in(idx) = Simulink.SimulationInput( Simulink.SimulationInput(mdl); mdl); in(idx) = in(idx).setBlockParameter in(idx).setBlockParameter([mdl ([mdl '/Environment/Friction' '/Environment/Friction'], ],'Value' 'Value',[ ,['on 'on end 5
Save the model. Run the simulations for 30 s. If available, use parallel computing. tic; set_param(mdl,'StopTime' set_param(mdl,'StopTime', ,'30' '30') ) simout = parsim(in,'ShowSimulationManager' parsim(in, 'ShowSimulationManager', ,'on' 'on'); ); toc; delete(gcp('nocreate' delete(gcp('nocreate')) ))
6
Import the simulation results to the Simulation Data Inspector. a
On the Simulink Editor toolbar, toolbar, click the Simulation Data Inspector button button .
1-12
b
In the Simulation Data Inspector, Inspector, select Import. Import.
c
In the Import dialog box, clear logsout. logsout. Select simout(1), simout(1), simout(2), simout(2), and simout(3). simout(3). Select Import. Import.
Yaw Stability on Varying Road Surfaces
d
7
Select each of the runs. For each run, in the Name eld, enter the friction scaling simulati on. Run 1 corresponds to the coeficient that corresponds to the simulation. simulation with lambdamu equal lambdamu equal to the default friction scaling coeficient value 1.
Explore the results in the Simulation Data Inspector. Inspector. • To assess assess the the succe success ss of the the maneu maneuver ver test test when when lambdamu is lambdamu is equal to .50, .65, and .80, plot the upper lane boundary, boundary, , , lower lane boundary, , , and lateral vehicle distance, Y. The results are similar to these plots, which show the results for runs 2, 3, and 4, respectively. respectively. The results indicate that the vehicle lateral position comes close to lambdamu is .50. The vehicle might hit a and crosses the lane boundaries when lambdamu is lambdamu is .65 or .80, the vehicle lateral cone during the maneuver. maneuver. When lambdamu is position does not cross the lane boundaries.
1-13
1
Getting Started
1-14
Yaw Stability on Varying Road Surfaces
• To assess the yaw stability stability for the the road surface surfaces, s, plot the lateral lateral accelerati acceleration, on, , , lateral vehicle distance, Y, yaw angle, psi, psi, and yaw rate, r. The results are similar to these plots, which show the results for all the runs. The results indicate that the vehicle has a yaw rate of .70 rad/s when the friction scaling coeficient is equal to .50.
1-15
1
Getting Started
1-16
Yaw Stability on Varying Road Surfaces
8
To explore the results resul ts further, further, use these commands to extract the lateral acceleration, steering angle, and vehicle trajectory from the simout object. simout object. • Extract Extract the lateral acceleration acceleration and steerin steering g angle. angle. Plot Plot the the data. data. % Plot results from simout object figure for idx for idx = 1:numExperiments % Extract Data log = simout(idx).get('logsout' simout(idx).get('logsout'); ); sa = log.get('SteerAngle' log.get('SteerAngle').Values; ).Values; ay = log.get('' log.get('').Values; ).Values; legend_labels{idx} = [ 'lambdamu = ', ', num2str(lambdamu(idx))]; % Plot steering angle vs. lateral acceleration plot(sa.Data,ay.Data) hold on
end % Add labels to the plots legend(legend_labels, 'Location' 'Location', , 'best' 'best'); ); title('Lateral title('Lateral Acceleration') Acceleration' ) xlabel('Steering xlabel('Steering Angle [deg]') [deg]' ) ylabel('Acceleration ylabel('Acceleration [g]') [g]' ) grid on
The results are similar to this plot. They indicate that the greatest lateral acceleration occurs when the friction scaling coeficient is 0.8 and 0.8 and the steering angle is at 360 deg.
1-17
1
Getting Started
• Extrac Extractt the the vehicle vehicle path. path. Plot Plot the the data. data. % Plot results from simout object figure for idx for idx = 1:numExperiments % Extract Data log = simout(idx).get('logsout' simout(idx).get('logsout'); ); VehFdbk = log.get('VehFdbk' log.get('VehFdbk'); ); x = VehFdbk.Values.Body.X; y = VehFdbk.Values.Body.Y; legend_labels{idx} = [ 'lambdamu = ', ', num2str(lambdamu(idx))]; % Plot vehicle location plot(y.Data,x.Data) hold on
end % Add labels to the plots legend(legend_labels, 'Location' 'Location', , 'best' 'best'); ); title('Vehicle title('Vehicle Path') Path' ) xlabel('Y xlabel('Y Position [m]') [m]' )
1-18
See Also
ylabel('X ylabel('X Position [m]') [m]' ) grid on
The results are similar to this plot. They indicate that the greatest lateral vehicle position occurs when the friction scaling coeficient is 0.5. 0.5.
See Also Simulink.SimulationInput | Simulink.SimulationInput | Simulink.SimulationOutput
References [1] ISO 3888-2: 2011. Passenger Passenger cars — Test Test track for a severe lane-change lane-change manoeuvre.
1-19
1
Getting Started
See Also More About
1-20
•
“Dou “Doubl blee-La Lane ne Chan Change ge Mane Maneuv uver er”” on on pag page e 3-4 3-4
•
“Vehic “Vehicle le Dynam Dynamics ics Bloc Blockse ksett Commu Communic nicati ation on with with 3D 3D Visua Visualiza lization tion Sof Softwar tware” e” on on page page 1-6
•
“Sim “Simul ulat atio ion n Dat Data a Ins Insp pecto ectorr in in You Yourr Workow” (Simulink)
Vehicle Steering Gain at Diferent Speeds
Vehicle Steering Gain at
Diferent Speeds
This example shows how to use the slowly increasing steering reference application to analyze the impact of the steering angle and speed on vehicle handling. Specically, you can calculate the steering gain when you run the maneuver with diferent speed set points. Based on the constant speed, variable steer test dened in SAE J2661, the slowly increasing steering maneuver helps characterize the lateral dynamics of the vehicle. In the test, the driver: • Accele Accelerate ratess until until vehicle vehicle hits hits a target target veloci velocity ty.. • Main Maintai tains ns a tar targe gett velo veloci city ty.. • Linearly Linearly increases increases the the steering steering wheel angle from from 0 degrees degrees to a maximum maximum angle. angle. • Maintai Maintains ns the the stee steerin ring g wheel wheel ang angle le for for a specied time. • Linearly Linearly decreases decreases the steering steering wheel angle angle from from maximum maximum angle to 0 degree degrees. s. For more information about the reference application, see “Slowly Increasing Steering Maneuver” on page 3-28.
Run a Slowly Increasing Steering Maneuver 1
Create and open open a working copy of the increasing i ncreasing steering reference application. vdynblksIncreasingSteeringStart
2
Open the Slowly Increasing Steer block. By default, the maneuver is set with these parameters: • Longitudinal speed setpoint — setpoint — 50 mph • Handwheel rate — rate — 13.5 deg • Maximum handwheel angle — angle — 270 deg
3
Run the maneuver with the default settings. As the simulation runs, view vehicle information. • In the Vehicle Vehicle Positio Position n window, window, view the vehicle vehicle longitud longitudinal inal distance distance as a function function of lateral distance.
1-21
1
Getting Started
• In the Visualiz Visualization ation subsyste subsystem, m, open the Yaw Yaw Rate and Steer Scope block to to display the yaw rate and steering angle versus time: • Yello ellow w line line — Yaw Yaw rat rate e • Blue Blue line liness — Stee Steeri ring ng angl angle e The blue line shows a linearly increasing and decreasing steering angle.
1-22
Vehicle Steering Gain at Diferent Speeds
Sweep Speed Set Points Run the slowly increasing steering angle reference application with three diferent speed set points. 1
In the slowly increasing steering reference application model ISReferenceApplication,, open the Slowly Increasing Steer block. The ISReferenceApplication Longitudinal speed set point, xdot_r block block parameter sets the vehicle speed. By default, the speed is 50 mph. 50 mph.
2
Set up a speed set point vector v ector,, xdot_r, xdot_r, that you want to investigate. For example, at the command line, enter:
1-23
1
Getting Started
mdl = 'ISReferenceApplication' 'ISReferenceApplication'; ; open_system(mdl); % Define the set of parameters to sweep vmax = [40, 50, 60]; tfinal = [60, 60, 60]; numExperiments = length(vmax); 3
Create an array of simulation inputs that set xdot_r equal xdot_r equal to the Slowly Increasing Steer block parameter. for idx for idx = numExperiments:-1:1 in(idx) = Simulink.SimulationInput( Simulink.SimulationInput(mdl); mdl); in(idx) = in(idx).setBlockParameter in(idx).setBlockParameter([mdl ([mdl '/Slowly Increasing Steer'], Steer' ], 'xdot_r' 'xdot_r', , in(idx) = in(idx).setModelParameter in(idx).setModelParameter( ( 'StopTime' 'StopTime', , num2str(tfinal(idx))); end
4
Save the model and run the simulations. If available, use parallel computing. tic; simout = parsim(in,'ShowSimulationManager' parsim(in, 'ShowSimulationManager', ,'on' 'on'); ); toc; delete(gcp('nocreate' delete(gcp('nocreate')) ))
5
Import the simulation results to the Simulation Data Inspector. a
On the Simulink Editor toolbar, toolbar, click the Simulation Data Inspector button button .
1-24
b
In the Simulation Data Inspector, Inspector, select Import. Import. In the Import dialog box, accept the defaults and select Import. Import.
c
logsout. Select simout(1), simout(1), simout(2), simout(2), and In the Import dialog box, clear logsout. simout(3). simout(3). Select Import. Import.
Vehicle Steering Gain at Diferent Speeds
d
6
Select each of the runs. For each run, in the Name eld, enter the velocity that corresponds to the simulation. Run 1 corresponds to the simulation with the default settings.
Explore the results in the Simulation Data Inspector. Inspector. To characterize the steering, view the plots of the simulation results. For example, plot velocity, velocity, xdot_mph, xdot_mph, steering angle, SteerAngle, SteerAngle, lateral acceleration, ay, ay, longitudinal position, X, and lateral position, Y. The results are similar to these plots, which show the results for all the runs. The results indicate that the greatest lateral acceleration, ay , occurs when the vehicle velocity is 60 mph. 60 mph.
1-25
1
Getting Started
7
1-26
To explore the results resul ts further, further, use these commands to extract the lateral acceleration, simout object. steering angle, and vehicle trajectory from the simout object.
Vehicle Steering Gain at Diferent Speeds
• Extract Extract the lateral lateral accelerati acceleration on and steerin steering g angle. angle. Plot the the data. To To calculate calculate the steering gain, t a rst order polynomial to the data. figure for idx for idx = 1:numExperiments % Extract Data log = simout(idx).get('logsout' simout(idx).get('logsout'); ); sa = log.get('SteerAngle' log.get('SteerAngle').Values; ).Values; ay = log.get('' log.get('').Values; ).Values;
firstorderfit = polyfit(sa.Data,ay.Data,1 polyfit(sa.Data,ay.Data,1); ); gain(idx)=firstorderfit(1); legend_labels{idx} = [num2str(vmax(idx)), ' mph: Gain = ',num2str(gain(idx)) ' ,num2str(gain(idx))
% Plot steering angle vs. lateral acceleration plot(sa.Data,ay.Data) hold on end % Add labels to the plots legend(legend_labels, 'Location' 'Location', , 'best' 'best'); ); title('Lateral title('Lateral Acceleration') Acceleration' ) xlabel('Steering xlabel('Steering Angle [deg]') [deg]' ) ylabel('Acceleration ylabel('Acceleration [g]') [g]' ) grid on
The results are similar to this plot.
1-27
1
Getting Started
• Extrac Extractt the the vehicle vehicle path. path. Plot Plot the the data. data. % Plot results from simout object figure for idx for idx = 1:numExperiments % Extract Data log = simout(idx).get('logsout' simout(idx).get('logsout'); ); VehFdbk = log.get('VehFdbk' log.get('VehFdbk'); ); x = VehFdbk.Values.Body.X; y = VehFdbk.Values.Body.Y; legend_labels{idx} = [num2str(vmax(idx)), ' mph']; mph']; % Plot vehicle location axis('equal' axis('equal') ) plot(y.Data,x.Data) hold on end % Add labels to the plots legend(legend_labels, 'Location' 'Location', , 'best' 'best'); ); title('Vehicle title('Vehicle Path') Path' ) xlabel('Y xlabel('Y Position [m]') [m]' )
1-28
See Also
ylabel('X ylabel('X Position [m]') [m]' ) grid on
The results are similar to this plot.
See Also Simulink.SimulationInput | Simulink.SimulationInput | Simulink.SimulationOutput Simulink.SimulationOutput | | polyfit
More About •
“Slo “Slowl wly y Inc Incre reas asin ing g Ste Steer erin ing g Man Maneu euve ver” r” on page page 3-28 3-28
•
“Vehic “Vehicle le Dynam Dynamics ics Bloc Blockse ksett Commu Communic nicati ation on with with 3D 3D Visua Visualiza lization tion Sof Softwar tware” e” on on page page 1-6
•
“Sim “Simul ulat atio ion n Dat Data a Ins Insp pecto ectorr in in You Yourr Workow” (Simulink)
1-29
1
Getting Started
Frequency Response to Steering Angle Input This example shows how to use the swept-sine steering reference application to analyze the dynamic steering response to steering inputs. Specically, you can examine the vehicle frequency response and lateral acceleration when you run the maneuver with diferent sinusoidal wave steering amplitudes. The swept-sine steering maneuver tests the vehicle frequency response to steering inputs. In the test, the driver: • Accele Accelerate ratess until until the vehicle vehicle hits hits a target target velocity velocity.. • Comman Commands ds a sinuso sinusoidal idal steeri steering ng whee wheell input. input. • Linearl Linearly y increas increase e the frequ frequenc ency y of the sinus sinusoid oidal al wave. wave. For more information about the reference application, see “Swept-Sine Steering Maneuver” on page 3-20.
Run a Swept-Sine Steering Maneuver 1
Create and open a working copy of the increasing steering reference application. vdynblksSweptSineSteeringStart
2
Open the Swept Sine Reference Generator block. By default, the maneuver is set with these parameters: • Longitudinal velocity setpoint — setpoint — 30 mph • Steering amplitude — amplitude — 90 deg • Final frequency — — 0.7 Hz
3
Run the maneu ver with the default settings. settings. As the simulation runs, view vehicle information. • In the Vehicle Vehicle Positio Position n window, window, view the vehicle vehicle longitud longitudinal inal distance distance as a function function of lateral distance.
1-30
Frequency Response to Steering Angle Input
• In the Visualiz Visualization ation subsyste subsystem, m, open the Yaw Yaw Rate and Steer Scope block to to display the yaw rate and steering angle versus time: • Yello ellow w line line — Yaw Yaw rat rate e • Blue Blue line liness — Stee Steeri ring ng angl angle e The blue line shows a 90 deg 90 deg amplitude sinusoidal steering angle with an increasing frequency.
1-31
1
Getting Started
Sweep Steering Run the reference application with three diferent sinusoidal wave steering amplitudes. 1
In the swept-sine steering reference application model SSSReferenceApplication,, open the Swept Sine Reference Generator block. The SSSReferenceApplication Steering amplitude, omega_hw block block parameter sets the amplitude. By default, the amplitude is 90 deg. 90 deg.
2
Set up a steering amplitude vector, vector, amp, amp, that you want to investigate. For example, at the command line, type: mdl = 'SSSReferenceApplication' 'SSSReferenceApplication'; ; open_system(mdl);
1-32
Frequency Response to Steering Angle Input
% Define the set of amplitudes to sweep amp = [60, 90, 120]; numExperiments = length(amp); 3
Create an array of simulation inputs that set the Swept Sine Reference Generator block parameter Steering amplitude, omega_hw equal equal amp. amp. for idx for idx = numExperiments:-1:1 in(idx) = Simulink.SimulationInput( Simulink.SimulationInput(mdl); mdl); in(idx) = in(idx).setBlockParameter in(idx).setBlockParameter([mdl ([mdl '/Swept Sine Reference Generator'], Generator' ],'o 'o end
4
Save the model and run the simulations. If available, use parallel computing. tic; simout = parsim(in,'ShowSimulationManager' parsim(in, 'ShowSimulationManager', ,'on' 'on'); ); toc; delete(gcp('nocreate' delete(gcp('nocreate')) ))
5
Import the simulation results to the Simulation Data Inspector. a
On the Simulink Editor toolbar, toolbar, click the Simulation Data Inspector button button .
b
In the Simulation Data Inspector, Inspector, select Import. Import. In the Import dialog box, accept the defaults and select Import. Import.
c
In the Import dialog box, clear logsout. logsout. Select simout(1), simout(1), simout(2), simout(2), and simout(3). simout(3). Select Import. Import.
1-33
1
Getting Started
d
6
1-34
Select each of the runs. For each run, in the Name eld, enter the amplitude that corresponds to the simulation. Run 1 corresponds to the simulation with the default settings.
Explore the results in the Simulation Data Inspector. Inspector. To characterize the steering, view the plots of the simulation results. For example, plot velocity, velocity, xdot_mph, xdot_mph, steering angle, SteerAngle, SteerAngle, lateral acceleration, ay, ay, longitudinal position, X, and lateral position, Y. The results are similar to these plots, which show the results for all the runs. The results indicate that the greatest lateral acceleration, 0.32 gn, 0.32 gn, occurs when the steering amplitude is 120 deg. 120 deg.
Frequency Response to Steering Angle Input
7
To explore the results resul ts further, further, use these commands to extract the lateral acceleration, steering angle, and vehicle trajectory from the simout object. simout object. • Extract Extract the lateral acceleration acceleration and steerin steering g angle. angle. Plot Plot the the data. data. % Plot results from simout object figure for idx for idx = 1:numExperiments % Extract Data
1-35
1
Getting Started
log = simout(idx).get('logsout' simout(idx).get('logsout'); ); sa = log.get('SteerAngle' log.get('SteerAngle').Values; ).Values; ay = log.get('' log.get('').Values; ).Values; legend_labels{idx} = [ 'amplitude = ', ' , num2str(amp(idx)), '^{\circ}' '^{\circ}']; ]; % Plot steering angle vs. lateral acceleration plot(sa.Data,ay.Data) hold on
end % Add labels to the plots legend(legend_labels, 'Location' 'Location', , 'best' 'best'); ); title('Lateral title('Lateral Acceleration') Acceleration' ) xlabel('Steering xlabel('Steering Angle [deg]') [deg]' ) ylabel('Acceleration ylabel('Acceleration [g]') [g]' ) grid on
The results are similar to this plot.
• Extrac Extractt the the vehicle vehicle path. path. Plot Plot the the data. data. % Plot results from simout object figure for idx for idx = 1:numExperiments
1-36
Frequency Response to Steering Angle Input
% Extract Data log = simout(idx).get('logsout' simout(idx).get('logsout'); ); VehFdbk = log.get('VehFdbk' log.get('VehFdbk'); ); x = VehFdbk.Values.Body.X; y = VehFdbk.Values.Body.Y; legend_labels{idx} = [ 'amplitude = ', ' , num2str(amp(idx)), '^{\circ}' '^{\circ}']; ]; % Plot vehicle location axis('equal' axis('equal') ) plot(y.Data,x.Data) hold on
end % Add labels to the plots legend(legend_labels, 'Location' 'Location', , 'best' 'best'); ); title('Vehicle title('Vehicle Path') Path' ) xlabel('Y xlabel('Y Position [m]') [m]' ) ylabel('X ylabel('X Position [m]') [m]' ) grid on
The results are similar to this plot.
1-37
1
Getting Started
8
For For the next steps, use a fast Fourier transform (FFT) to examine the steering response in the frequency domain.
See Also Simulink.SimulationInput | Simulink.SimulationInput | Simulink.SimulationOutput Simulink.SimulationOutput | | fft
More About
1-38
•
“Fou “Fouri rier er Anal Analys ysis is and and Filt Filter erin ing” g” (MA (MATLAB TLAB))
•
“Sim “Simul ulat atio ion n Dat Data a Ins Insp pecto ectorr in in You Yourr Workow” (Simulink)
•
“Swe “Swept pt-S -Sin ine eS Ste teer erin ing g Man Maneu euve ver” r” on page page 3-20 3-20
•
“Vehic “Vehicle le Dynam Dynamics ics Bloc Blockse ksett Commu Communic nicati ation on with with 3D 3D Visua Visualiza lization tion Sof Softwar tware” e” on on page page 1-6
2 Coordinate Systems
2
Coordinate Systems
Coordinate Systems in Vehicle Dynamics Blockset Vehicle Vehicle Dynamics Blockset uses these coordinate systems to calculate the vehicle dynamics and position objects in the 3D visualization environment. Environment Description
Coordinate Systems
Vehicle Vehicle dynamics in Simulink
“Earth-Fixed (Inertial) Coordinate System” on page 2-2
The right-hand rule establishes the X -Y - Z Z sequence and rotation of the coordinate axes used to calculate the vehicle dynamics. The Vehicle Vehicle Dynamics Blockset 3D simulation environment uses these righthanded (RH) Cartesian coordinate systems dened in the SAE J670[2] and ISO 8855[3] standards:
“Vehicle Coordinate System” on page 2-3 “Tire and Wheel Coordinate Systems” on page 2-4
• Earth-xed (inertial) • Vehicle • Tire • Wheel The coordinate systems can have either orientation: • Z-down — Dened in SAE J670[2] • Z-up — Dened in SAE J670[2] and ISO 8855[3] 3D visualization engine
To position objects and query the 3D “World Coordinate System” visualization environment, the Vehicle on page 2-6 Dynamics Blockset uses a world coordinate system.
Earth-Fixed (Inertial) Coordinate System The earth-xed coordinate system ( X X E, Y E, Z E) axes are xed in an inertial reference frame. The inertial reference frame has zero linear and angular acceleration and zero zero angular velocity. velocity. In Newtonian physics, the earth ea rth is an inertial reference.
2-2
Coordinate Systems in Vehicle Dynamics Blockset
Axis
Description
X E
The X E axis is in the forward direction of the vehicle.
Y E Z E
The X E and Y E axes are parallel to the ground plane. The ground plane is a horizontal plane normal to the gravitational vector. In the Z -up -up orientation, the positive Z E axis points upward. In the Z -down -down orientation, the positive Z E axis points downward.
Vehicle Coordinate System The vehicle coordinate system axes ( X X V , Y V , Z V ) are xed in a reference frame attached to the vehicle. The origin is at the vehicle sprung mass. Z-Down Orientation
2-3
2
Coordinate Systems
Axis
Description
X V
The X V axis points forward and is parallel to the vehicle plane of symmetry.
Y V
The Y V axis is perpendicular to the vehicle plane of symmetry. symmetry.
Z V
In the Z -down -down orientation: • Y V axis points to the right • Z V axis points downward
Tire and Wheel Coordinate Systems The tire coordinate system axes ( X X T , Y T , Z T ) are xed in a reference frame attached to the tire. The origin is at the tire contact with the ground. The wheel coordinate system axes ( X X W , Y W , Z W ) are xed in a reference frame attached to the wheel. The origin is at the wheel center. Z-Up Orientation1 1.
2-4
Reprinted Reprinted with permission permission Copyright Copyright © 2008 SAE SAE Interna Internationa tional. l. Furthe Furtherr distribut distribution ion o off this this material material is not permitted without prior permission from SAE.
Coordinate Systems in Vehicle Dynamics Blockset
Z-Down Orientation
2-5
2
Coordinate Systems
Axis
Description
X T Y T
X T and Y T are parallel to the road plane. The intersection of the wheel plane and the road plane dene the orientation of the X T axis.
Z T
Z T points:
• Upwar Upward d in in the the Z-up Z-up orie orient ntat ation ion • Down Downwar ward d in the the Z-d Z-dow own n orie orient ntati ation on X W
X W and Y W are parallel to the wheel plane:
Y W
• X W is parallel to the local road plane. • Y W is parallel to the wheel-spin axis.
Z W
Z W points:
• Upwar Upward d in in the the Z-up Z-up orie orient ntat ation ion • Down Downwar ward d in the the Z-d Z-dow own n orie orient ntati ation on
World Coordinate System The Vehicle Vehicle Dynamics Blockset 3D visualization vis ualization environment uses a world coordinate system with axes that are xed in the inertial reference frame.
2-6
See Also
Axis
Description
X
Forward Forward direction of the vehicle
Y
Extends to the right of the vehicle, parallel to the ground plane
Z
Extends upwards
References [1] Gillespie, Thomas. Fundamentals of Vehicle Vehicle Dynamics. Warrendale, PA: Society of Automotive Engineers, 1992. [2] Vehicle Dynamics Standards Committee. Vehicle Dynamics Terminology . SAE J670. Warrendale, PA: Society of Automotive Engineers, 2008. [3] Technical Committee. Road vehicles — Vehicle Vehicle dynamics and road-holding road-holding ability — Vocabulary . ISO 8855:2011. Geneva, Switzerland: International Organization for Standardization, 2011.
See Also Combined Slip Wheel | Longitudinal Wheel | Simulation Simula tion 3D Actor Transform Get | Simulation 3D Actor Transform Set | Simulation 3D Camera Get | Simulation 3D Cong | Vehicle Vehicle Body 3DOF | Vehicle Vehicle Body 6DOF | Vehicle Vehicle Terrain Terrain Sensor
External Websites •
SAE SAE Inte Intern rnat atio iona nall Grou Ground nd Vehic ehicle le Sta Stand ndar ards ds
•
ISO Standards
2-7
3 Reference Applications
3
Reference Applications
Passenger Vehicle Dynamics Models To analyze the t he dynamic system response in common ride and handling maneuvers, Vehicle Dynamics Blockset provides these pre-assembled vehicle dynamics models. Vehicle Description Description Vehicle Body Degrees-of-F Degrees-of-Freedom reedom Wheel DOFs Model (DOFs)
Passeng • Vehicle er with four 14DOF wheels Vehicle Vehicle • Available as model variant in the maneuver reference applicatio ns
Six
Two per wheel - eight total
Translational
Rotational
Longitudina l
✓
Lateral
✓
Yaw Yaw
✓
Vertical Vertical
✓
Roll
✓
Passeng • Vehicle Three er 7DOF with four Translational Vehicle Vehicle wheels • Available as model variant in the maneuver reference applicatio ns
Vertical Vertical
✓
Rollin g
Rotational ✓
Lateral
✓
Rotational
Pitch
Rolling
Vertical Vertical
Yaw Yaw
✓
Roll
Passeng • Vehicle Three er 3DOF with ideal Translational Vehicle Vehicle tire
3-2
Translation Rotation al al
✓
One per wheel - four total
Longitudina l
None Rotational
Longitudina l
✓
Lateral
✓
Vertical Vertical
Pitch
Pitch Yaw Yaw Roll
✓
✓
✓
See Also
From the Simulink start page, you can open project les that contain the vehicle models.
See Also Vehicle Vehicle Body 3DOF | Veh Vehicle icle Body 6DOF
More About •
“Coo “Coord rdin inat ate e Syste Systems ms in in V Veh ehic icle le Dyn Dynam amic icss Bloc Blocks kset et”” on pag page e 2-2 2-2
•
“Veh “Vehic icle le Refer eferen ence ce App ppli lica cati tio ons” ns”
3-3
3
Reference Applications
Double-Lane Change Maneuver This reference application represents a full vehicle model undergoing a double-lane change maneuver according to standard ISO 3888-2 [1]. You can create your own versions, establishing a framework to test that your vehicle meets the design requirements under normal and extreme driving conditions. Use the reference application to analyze vehicle ride and handling and develop chassis controls. To To perform vehicle studies, including yaw stability and lateral acceleration limits, use this reference application. ISO 3888-21 denes the double-lane change maneuver to test the obstacle avoidance performance of a vehicle. In the test, the driver: • Accele Accelerate ratess until until vehic vehicle le hits hits a targe targett veloci velocity ty • Rele Release asess the the acce accele lera rato torr peda pedall • Turn Turnss stee steeri ring ng wheel to follow path into the lef t lane • Turns steering steering wheel wheel to to follow follow path path back back into into the the right right lane lane Typically, Typically, cones mark the lane boundaries. If the vehicle and driver can negotiate the maneuver without hitting a cone, the vehicle passes the test. To test advanced driver assistance assista nce systems (ADAS) and automated driving (AD) perception, planning, and control software, you can run the maneuver in a 3D environment. For the 3D visualization engine platform requirements and hardware recommendations, see “3D Visualization Engine” on page 1-4. To create and open a working copy of the double-lane change reference application project, enter vdynblksDblLaneChangeStart
This table summarizes the blocks and subsystems in the reference application. Some subsystems contain variants. Reference Application Element
Description
Lane Change Generates lane signals for the visualization subsystem Reference Generator and trajectory signals for the Predictive Driver block
3-4
Variant s
Double-Lane Change Maneuver
Reference Application Element
Description
Variant s
Pred Predic icti tive ve Drive Driverr
Gene Genera rate tess norm normal alize ized d steer steerin ing, g, acce acceler lerati ation on,, and and braking commands that track the reference trajectory
Environment
Implements wind and road forces
Controllers
Implements controllers for engine control units (ECUs), transmissions, and brakes
✓
Passe asseng nger er Vehic ehicle le
Imple mpleme ment ntss the: the:
✓
• Engine • Steeri Steering, ng, tran transmi smissio ssion, n, drive drivelin line, e, and and brakes brakes • Bo Body dy,, susp suspen ensio sion, n, and and whee wheels ls Visualization
Provides the vehicle trajectory, trajectory, driver response, and 3D visualization
✓
To override the default variant, select select View View > V > Variant ariant Manager . In the Variant Manager, navigate to the variant that you want to use. Right-click and select Override using this Choice. Choice.
Lane Change Reference Generator Use the Lane Change Reference Generator block to generate: • Lane signals signals for for the Visualiz Visualization ation subsyste subsystem m — The left left and right lane lane boundari boundaries es are a function of the V the Vehicle ehicle width parameter. width parameter. • Velocity and lateral lateral reference reference signals for the Predictive Predictive Driver Driver block block — Use Use the Lateral reference position breakpoints and breakpoints and Lateral reference data parameters data parameters to specify the lateral reference trajectory as a function of the longitudinal distance. To specify the target velocity, use the Longitudinal entrance velocity setpoint parameter. To start the maneuver a specied distance after the vehicle reaches the target speed, specify a Distance after target speed to begin reference parameter. reference parameter.
3-5
3
Reference Applications
Predictive Driver The reference application uses the Predictive Driver block to generate normalized steering, acceleration, and braking commands that track the reference trajectory. trajectory. The Predictive Driver block implements an optimal single-point preview (look ahead) control model developed by C. C. MacAdam[2], [3], [4]. The model represents driver steering control behavior during path-following and obstacle avoidance maneuvers. Drivers preview to follow a predened path.
Controllers The Controllers subsystem generates engine torque, transmission transmis sion gear, gear, and brake commands. The reference application has these brake variants. Controller
Variant
Description
Brake Pressure Control Bang Bang ABS Anti-lock braking system (ABS) feedback controller that switches between two states Open Loop (default)
Open loop braking controller
Passenger Vehicle The Passenger Vehicle Vehicle subsystem has an engine, controllers, and a vehicle body with wi th four wheels. Specically, the vehicle contains these subsystems. Body, Suspension, Wheels Subsystem
Variant
Description
PassVeh7DOF
PassVeh7DOF (default)
Vehicle Vehicle with four wheels: • Vehi ehicle cle bod body y has has three three degree degrees-o s-offfreedom (DOFs) — Longitudinal, lateral, and yaw • Ea Each ch whee wheell has has one one DOF DOF — Roll Rolling ing
3-6
Double-Lane Change Maneuver
Body, Suspension, Wheels Subsystem
Variant
Description
PassVeh14DOF
PassVeh14DOF
Vehicle Vehicle with four wheels. • Vehic ehicle le body body has six DOFs DOFs — Longitudinal, lateral, vertical and pitch, yaw, yaw, and roll • Each Each wheel wheel has two DOFs DOFs — Vertica erticall and and rolling
Engine Subsystem
Variant
Description
Mapped Engine
SiMappedEngine Mapped spark-ignition (SI) engine (default)
Steering, Transmission, Driveline, and Brakes Subsystem
Variant
Description
Driveline Driveline Ideal model Fixed Gear
All Wheel Drive
Congure the driveline for all-wheel, frontwheel, or rear-wheel drive
Front Wheel Drive
Specify the type of torque coupling
Rear Wheel Drive (default) Drive (default) Transmissio Ideal ( Ideal (d default) n
Ideal xed gear transmission
Visualization When you run the simulation, the Visualization subsystem provides driver, driver, vehicle, and response information. The reference application logs vehicle signals during the maneuver, maneuver, including steering, vehicle and engine speed, and lateral acceleration. You can use the Simulation Data Inspector to import the logged signals and examine the data.
3-7
3
Reference Applications
Element
Description
Driver Commands
Driver commands: • Hand andwheel ang angle • Acce Accele lera rati tion on comm comman and d • Brake command
3-8
Double-Lane Change Maneuver
Element
Description
Vehicle Vehicle Response
Vehicle response: • Engine speed • Vehicle sp speed • Acce Accele lera rati tion on comm comman and d
Lane Change Scope block
Lateral vehicle displacement versus time: • Red line — Cone Coness mark marking ing lane bou bounda ndary ry • Blue Blue llin ine e — Refe Refere renc nce e traj trajec ecto tory ry • Gree Green n line line — Actu Actual al tra traje ject ctor ory y
Steer vs Ay Scope block
Steering angle versus lateral acceleration
Steer, Velocity, Lat Accel Scope block
• SteerAngle — SteerAngle — Steering angle versus time • — — Longitudinal vehicle velocity versus time • — — Lateral acceleration versus time
Vehicle Vehicle XY Plotter
Vehicle longitudinal versus lateral distance
3D Visualization
Optionally, Optionally, you can enable the 3D visualization environment. For For the 3D visualization visualiz ation engine platform requirements and hardware recommendations, see “3D Visualization Engine” on page 1-4. After you open the reference application, in the Visualization subsystem, open the 3D Engine block. Set these parameters. • 3D Engine to Engine to Enabled. Enabled. • Scene description to description to one of the scenes, for example Straight road. road .
3-9
3
Reference Applications
When you run the simulation, view the vehicle response in the VehicleSimulation window. Note
• To ope open n and and clos close e the the VehicleSimulation VehicleSimulation window window,, use the Simulink Run and Stop buttons. If you manually close the VehicleSimulation VehicleSimulation window window,, Simulink stops the simulation with an error. error. • When you you enable enable the the 3D visualizat visualization ion environ environment, ment, you you cannot cannot step step the simulation simulation back.
To change the camera views in the VehicleSimulation VehicleSimulation window window,, use these key commands.
3-10
See Also
Key Key Came Camera ra View iew
1
Back left
2
Back
3
Back right
4
Left
5
Internal
6
Right
7
Front left
8
Front
9
Front right
References [1] ISO 3888-2: 2011. Passenger Passenger cars — Test Test track for a severe lane-change manoeuvre manoeuvre. [2] MacAdam, C. C. "An Optimal Preview Control for Linear Systems". Journal of Dynamic Vol. 102, Number 3, 1980. Systems, Measurement, and Control. Vol. [3] MacAdam, C. C. "Application of an Optimal Preview Control for Simulation Simulati on of ClosedLoop Automobile Driving ". IEEE Transactions on Systems, Man, Man, and Cybernetics. Vol. Vol. 11, Number 6, 1981. [4] MacAdam, C. C. "Development of Driver/Vehicle Driver/Vehicle Steering Interaction Models for Dynamic Analysis". Final Technical Technical Report UMTRI-88-53 UMTRI-88-53. The University of Michigan Transportation Research Institute. 1988.
See Also Mapped SI Engine | Predictive Driver
3-11
3
Reference Applications
Related Examples •
“Yaw “Yaw Stab Stabil ility ity on Varyi arying ng Road Road Su Surf rface aces” s” on page page 1-8 1-8
More About
3-12
•
“3D “3D Vis Visua uali liza zati tion on En Engi gine ne”” on on pag page e 11-4
•
“Pass “Passen enge gerr Veh Vehicl icle e Dyn Dynam amic icss Mod Model els” s” on page page 3-2 3-2
•
“Sim “Simul ulat atio ion n Dat Data a Ins Insp pecto ectorr in in You Yourr Workow” (Simulink)
Scene Interrogation
Scene Interrogation The scene interrogation with camera and ray tracing reference application provides the Simulink interface with the 3D visualization environment. The scene interrogation with camera and ray tracing reference application contains: • Passenge assengerr vehi vehicle cle with fou fourr whee wheels ls • Vehicle body body and wheel wheel 3D actors, actors, independe independently ntly positionposition-contr controlled olled by Simulin Simulink k • Camera • 3D actor actor,, positio position-c n-cont ontrol rolled led by by Simuli Simulink nk • Provid Provides es frameframe-byby-fra frame me 3D scene scene images images to Simu Simulin link. k. • Terrain sen sensor • Provid Provides es terra terrain in feedb feedback ack for for each each wheel wheel to Simul Simulink ink.. • Provides Provides forward forward-facin -facing g object object detection detection feedback feedback to Simulin Simulink. k. To create and open a working copy of the camera and ray tracing reference application project, enter vdynblksSceneCameraRayStart
3-13
3
Reference Applications
This table summarizes the parts of the reference application. Name
Description
3D Read
Reads te terrain, in, ob object, and cam came era in informati ation in in th the 3D 3D en environment.
Dynamics and Controls Stub
Interfaces with Simulink to calculate the dynamic response of the vehicle plant and controller. controller. By default, it contains a simple vehicle so that you can test the 3D visualization environment without including complex dynamics calculations.
3D Write
Writes tes te terrain an and ca camera in information ion tto o tth he 3 3D D vis visu ualiza izatio tion environment.
3D Visualization When you run the simulation, by default, the reference application provides this vehicle and scene information.
3-14
Scene Interrogat I nterrogation ion
Window
Description
VehicleSimula VehicleSimula Video output of Simulation 3D Camera Get block. tion To change the camera views in the VehicleSimulation VehicleSimulation window, window, use these key commands. Ke Camera View y
SDL Video Display
1
Back left
2
Back
3
Back right
4
Left
5
Intern al
6
Right
7
Front left
8
Front
9
Front right
Video output from camera actor Camera0. Camera0. By default, Camera0 shows Camera0 shows the view from the front of the vehicle.
Note
• To ope open n and and clos close e the the VehicleSimulation VehicleSimulation window window,, use the Simulink Run and Stop buttons. If you manually close the VehicleSimulation VehicleSimulation window window,, Simulink stops the simulation with an error. error. • When you you enable enable the the 3D visualizat visualization ion environ environment, ment, you you cannot cannot step step the simulation simulation back.
3-15
3
Reference Applications
Controller and Display Subsystem Controller
When you run the reference application, by default, the vehicle moves forward at a constant velocity with a continuous right-hand steer command. During the simulation, you can interactively control the vehicle motion by changing these commands. • ThrCmd — ThrCmd — Throttle • BrakeCmd — BrakeCmd — Brake • SteerCmd — SteerCmd — Steer For example, with the simulation running, you can steer straight and bring the vehicle to a stop by using these BrakeCmd and BrakeCmd and SteerCmd commands. SteerCmd commands.
Translation, Rotation, and Scale Display
The Display block provides the translation, rotation, and scale of the vehicle body and four wheels. Use the Constant block value to control the display displa y. • 1 — Translation • 2 — Rotation • 3 — Scale For example, to display translation information, set the value to 1.
3-16
Scene Interrogation Interrogation
The display indicates that the: • Vehic ehicle le body body is at -212.5, -212.5, 65.66, 65.66, and 0.0112 m 0.0112 m along the world X -, -, Y -, -, and Z - axes, respectively. • Wheels Wheels are are at their their initi initial al positi positions ons along along the the world world X -, -, Y -, -, and Z - axes, respectively. The Display block provides the array information according to the vehicle and wheel w heel locations.
È Vehi cle X Í FrontLeft Í FrontLeft X Í FrontRig t Righ ht X Í RearLeft X Í RearLeft Í R earRear Î earRear X
Vehicl eY FrontLeft FrontLeftY Front rontRi Rig ghtY RearLeftY RearRearY
˘ FrontLeft FrontLeft Z ˙˙ Fron rontRig tRigh ht Z ˙ ˙ RearLeft RearLeftZ ˙ RearRear RearRearZ ˙˚ Vehi cleZ
• Vehicle translat translation ion and rotation rotation are along along the the world coordinate coordinate system system axes. axes. • Wheel translat translations ions and rotations rotations are with respect respect to their initial initial position positions, s, along along the world coordinate system axes. Terrain Displays
The Display block provides the vehicle body and wheel terrain information. Use the Constant block value to control the display. display. • 1 — Ray trace start location
3-17
3
Reference Applications
• 2 — Ray trace hit location For example, to display the hit location, set the value to 2.
Display Block
Example Indicates
StartLoc • Vehic ehicle le body body ray ray tra trace ce hit hit and HitLoc location is at -22.81, -22.81, -72.55, -72.55, and 0.246 m 0.246 m along the world X -, -, Y -, -, and Z - axes, respectively. • Fron Frontt lef leftt whe wheel el ray ray trace hit location is at -22.47, -22.47, -70.02, -70.02, and 0.004927 m 0.004927 m along the world X -, -, Y -, -, and Z - axes, respectively.
3-18
Display Array
È Vehi cle X Í FrontLeft Í FrontLeft X Í FrontRig t Righ ht X Í RearLeft X Í RearLeft Í R earRear earRear X Î e
Vehicl eY FrontLeft FrontLeftY Front rontRi Right ghtY RearLeftY RearRearY
˘ FrontLeft FrontLeft Z ˙˙ Front rontR Right ightZ ˙ ˙ RearLeft RearLeft Z ˙ RearRear RearRearZ ˙˚ Vehi cleZ
See Also
Display Block
Example Indicates
HitFlg
Vehicle Vehicle and wheel ray traces sense an object. • Vehic ehicle le body ody hit hit ag is 1. • Wheel hit ags are 1.
Display Array
È Vehicle ˘ Í FrontLeft ˙ Í FrontLeft ˙ Í FrontRight FrontRight ˙ Í ˙ RearLeft ˙ Í RearLeft Í RearRight ˙ Î RearRight ˚
VehHitDis Vehicle Vehicle senses an object t 4.406 m 4.406 m in front of the vehicle.
[ Vehicle]
TireHitDi Front left wheel is 0.3754 st m from the ground.
[ FrontLeft FrontLeft
FrontRight FrontRight
RearLef RearLef
RearRight RearRight ]
See Also Simulation 3D Actor Transfo Transform rm Get | Simulation 3D Actor Transform Set | Simulation 3D Camera Get | Simulation 3D Simulation 3D Cong | Vehicle Terrain Sensor
More About •
“Coo “Coord rdin inat ate e Syste Systems ms in in V Veh ehic icle le Dyn Dynam amic icss Bloc Blocks kset et”” on pag page e 2-2 2-2
•
“Vehic “Vehicle le Dynam Dynamics ics Bloc Blockse ksett Commu Communic nicatio ation n with with 3D Visuali Visualizati zation on Soft Software ware”” on page page 1-6
3-19
3
Reference Applications
Swept-Sine Steering Maneuver This reference application represents a full vehicle model undergoing a swept-sine steering maneuver. maneuver. You can create your own versions, providing a framework to t o test that your vehicle meets the design requirements under normal and extreme driving conditions. Use the reference application to analyze vehicle ride and handling and develop chassis controls. To analyze the dynamic steering response, use this reference application. The swept-sine steering maneuver tests the vehicle frequency response to steering inputs. In the test, the driver: • Accele Accelerate ratess until until the vehicle vehicle hits hits a target target velocity velocity.. • Comman Commands ds a sinuso sinusoidal idal steeri steering ng whee wheell input. input. • Linearl Linearly y increas increase e the frequ frequenc ency y of the sinus sinusoid oidal al wave. wave. To test advanced driver assistance systems (ADAS) and automated driving (AD) perception, planning, and control software, you can run the maneuver in a 3D environment. For the 3D visualization engine platform requirements and hardware recommendations, see see “3D Visualization Engine” on page page 1-4. To create and open a working copy of the swept-sine steering reference application project, enter vdynblksSweptSineSteeringStart
This table summarizes the blocks and subsystems in the reference application. Some subsystems contain variants. Reference Application Element
Description
Swept Sine Generate the sinusoidal steering commands for a sweptReference Generator sine steering st eering maneuver. block
3-20
Longitudinal Driver block
Generates normalized acceleration and braking commands to track speed.
Environment
Implements wind and road forces.
Variant s
Swept-Sine Steering Maneuver
Reference Application Element
Description
Variant s
Controllers
Implements controllers for engine control units (ECUs), transmissions, and brakes.
✓
Passe asseng nger er Vehic ehicle le
Imple mpleme ment ntss the: the:
✓
• Bo Body dy,, susp suspen ensio sion, n, and and whee wheels ls • Engine • Steeri Steering, ng, tran transmi smissio ssion, n, drive drivelin line, e, and and brakes brakes Visualization
Provides the vehicle trajectory, trajectory, driver response, and 3D visualization.
✓
To override the default variant, select select View > Variant View > V ariant Manager . In the Variant Manager, navigate to the variant that you want to use. Right-click and select Override using this Choice. Choice.
Swept Sine Reference Generator Use the Swept Sine Reference block to generate the sinusoidal steering commands for a swept-sine steering st eering maneuver. • Longitudinal velocity setpoint — setpoint — Target velocity • Steering amplitude — amplitude — Sinusoidal wave amplitude • Final frequency — — Cut of frequency frequency to stop the maneuver
Longitudinal Driver To track the vehicle speed, the Longitudinal Driver block implements a longitudinal Proportional-Integral (PI) controller with tracking anti-windup and feed-forward gains controller.
Controllers The Controllers subsystem generates engine torque, transmission transmis sion gear, gear, and brake commands. The reference application has these brake variants.
3-21
3
Reference Applications
Controller
Variant
Description
Brake Pressure Control Bang Bang ABS Anti-lock braking system (ABS) feedback controller that switches between two states Open Loop (default)
Open loop braking controller
Passenger Vehicle The Passenger Vehicle Vehicle subsystem has an engine, controllers, and a vehicle body with wi th four wheels. Specically, the vehicle contains these subsystems. Body, Suspension, Wheels Subsystem
Variant
Description
PassVeh7DOF
PassVeh7DOF (default)
Vehicle Vehicle with four wheels: • Vehi ehicle cle bod body y has has three three degree degrees-o s-offfreedom (DOFs) — Longitudinal, lateral, and yaw • Ea Each ch whee wheell has has one one DOF DOF — Roll Rolling ing
PassVeh14DOF
PassVeh14DOF
Vehicle Vehicle with four wheels. • Vehic ehicle le body body has six DOFs DOFs — Longitudinal, lateral, vertical and pitch, yaw, yaw, and roll • Each Each wheel wheel has two DOFs DOFs — Vertica erticall and and rolling
3-22
Engine Subsystem
Variant
Description
Mapped Engine
SiMappedEngine Mapped spark-ignition (SI) engine (default)
Swept-Sine Steering Maneuver
Steering, Transmission, Driveline, and Brakes Subsystem
Variant
Description
Driveline Driveline Ideal model Fixed Gear
All Wheel Drive
Congure the driveline for all-wheel, frontwheel, or rear-wheel drive
Front Wheel Drive
Specify the type of torque coupling
Rear Wheel Drive (default) Drive (default) Transmissio Ideal ( Ideal (d default) n
Ideal xed gear transmission
Visualization Subsystem When you run the simulation, the t he Visualization subsystem provides driver, driver, vehicle, and response information. The reference application logs vehicle signals during the maneuver, maneuver, including steering, vehicle and engine speed, and lateral acceleration. You can use the Simulation Data Inspector to import the logged signals and examine the data.
3-23
3
Reference Applications
Element
Description
Driver Commands
Driver commands: • Hand andwheel ang angle • Acce Accele lera rati tion on comm comman and d • Brake command
3-24
Swept-Sine Steering Maneuver
Element
Description
Vehicle Vehicle Response
Vehicle response: • Engine speed • Vehicle sp speed • Acce Accele lera rati tion on comm comman and d
Yaw Yaw Rate and Steer Scope block
Yaw Yaw rate and steering angle versus time: • Yello ellow w line line — Yaw Yaw rate rate • Blue Blue lin lines es — Ste Steer erin ing g ang angle le
Steer vs Ay Scope block
Steering angle versus lateral acceleration
Steer, Velocity, Lat Accel Scope block
• SteerAngle — SteerAngle — Steering angle versus time • — — Longitudinal vehicle velocity versus time • — — Lateral acceleration versus time
Vehicle Vehicle XY Plotter
Plot of vehicle longitudinal versus lateral distance
3D Visualization
Optionally, Optionally, you can enable the 3D visualization environment. For For the 3D visualization visualiz ation engine platform requirements and hardware recommendations, see “3D Visualization Engine” on page 1-4. After you open the reference application, in the Visualization subsystem, open the 3D Engine block. Set these parameters. • 3D Engine to Engine to Enabled. Enabled. • Scene description to road . description to one of the scenes, for example Straight road.
3-25
3
Reference Applications
When you run the simulation, view the vehicle response in the VehicleSimulation window. Note
• To ope open n and and clos close e the the VehicleSimulation VehicleSimulation window window,, use the Simulink Run and Stop buttons. If you manually close the VehicleSimulation VehicleSimulation window window,, Simulink stops the simulation with an error. error. • When you you enable enable the the 3D visualizat visualization ion environ environment, ment, you you cannot cannot step step the simulation simulation back.
To change the camera views in the VehicleSimulation VehicleSimulation window window,, use these key commands.
3-26
See Also
Key Key Came Camera ra View iew
1
Back left
2
Back
3
Back right
4
Left
5
Internal
6
Right
7
Front left
8
Front
9
Front right
See Also Longitudinal Driver | Mapped SI Engine
Related Examples •
“Fre “Frequ quen ency cy Resp Respon onse se to Stee Steeri ring ng Angl Angle e Inp Input ut”” on on pag page e 1-3 1-30 0
More About •
“3D “3D Vis Visua uali liza zati tion on En Engi gine ne”” on on pag page e 11-4
•
“Pass “Passen enge gerr Vehic ehicle le Dyna Dynamic micss Mod Model els” s” on page page 3-2 3-2
•
“Sim “Simul ulat atio ion n Dat Data a Ins Insp pecto ectorr in in You Yourr Workow” (Simulink)
3-27
3
Reference Applications
Slowly Increasing Steering Maneuver This reference application represents a full vehicle model undergoing a slowly increasing steering maneuver according to standard SAE J266 [1]. You can create your own versions, establishing a framework to test that your vehicle meets the design requirements under normal and extreme driving conditions. Use the reference application to analyze vehicle ride and handling and develop chassis controls. To To characterize the steering and lateral la teral vehicle dynamics, use this reference application. Based on the constant speed, variable steer test dened in SAE J2661, the slowly increasing steering maneuver helps characterize the lateral dynamics of the vehicle. In the test, the driver: • Accele Accelerate ratess until until vehicle vehicle hits hits a target target veloci velocity ty.. • Main Maintai tains ns a tar targe gett velo veloci city ty.. • Line Linear arly ly incr increa easses the steering wheel angle from 0 degrees degrees to a maximum angle. • Maintai Maintains ns the the stee steerin ring g wheel wheel ang angle le for for a specied time. • Linearly Linearly decreases decreases the steering steering wheel angle angle from from maximum maximum angle to 0 degree degrees. s. To test advanced driver assistance systems (ADAS) systems (ADAS) and automated driving (AD) perception, planning, and control software, you can run the maneuver in a 3D environment. For the 3D visualization engine platform requirements and hardware recommendations, see “3D Visualization Engine” on page 1-4. To create and open a working copy of the increasing steering reference application project, enter vdynblksIncreasingSteeringStart
This table summarizes the blocks and subsystems in the reference application. Some subsystems contain variants.
3-28
Reference Application Element
Description
Slowly Increasing Steer block
Generates steering, accelerator, and brake commands for the Longitudinal Driver block
Variant s
Slowly Increasing Steering Maneuver
Reference Application Element
Description
Variant s
Longitudinal Driver block
Generates normalized acceleration and braking commands to track speed
Environment
Implements wind and road forces.
Controllers
Implements controllers for engine control units (ECUs), transmissions, and brakes
✓
Passe asseng nger er Vehic ehicle le
Imple mpleme ment ntss the: the:
✓
• Bo Body dy,, susp suspen ensio sion, n, and and whee wheels ls • Engine • Steeri Steering, ng, tran transmi smissio ssion, n, drive drivelin line, e, and and brakes brakes Visualization
Provides the vehicle trajectory, trajectory, driver response, and 3D visualization
✓
To override the default variant, select select View View > V > Variant ariant Manager . In the Variant Manager, navigate to the variant that you want to use. Right-click and select Overr ide ide using this Choice. Choice.
Slowly Increasing Steer Block Use the Slowly Increasing Steering block to generate steering, accelerator, accelerator, and brake [1] commands for a slowly increasing steering maneuver . • Longitudinal speed setpoint — setpoint — Target velocity setpoint • Handwheel rate — rate — Linear rate to increase steering wheel angle • Maximum handwheel angle — angle — Maximum steering wheel angle
Longitudinal Driver To track the vehicle speed, the t he Longitudinal Driver block implements a longitudinal Proportional-Integral (PI) controller with tracking anti-windup and feed-forward gains controller.
3-29
3
Reference Applications
Controllers The Controllers subsystem generates engine torque, transmission gear, and brake commands. The reference application has these brake variants. Controller
Variant
Description
Brake Pressure Control Bang Bang ABS Anti-lock braking system (ABS) feedback controller that switches between two states Open Loop (default)
Open loop braking controller
Passenger Vehicle The Passenger Vehicle Vehicle subsystem has an engine, controllers, and a vehicle body with wi th four wheels. Specically, the vehicle contains these subsystems. Body, Suspension, Wheels Subsystem
Variant
Description
PassVeh7DOF
PassVeh7DOF (default)
Vehicle Vehicle with four wheels: • Vehi ehicle cle bod body y has has three three degree degrees-o s-offfreedom (DOFs) — Longitudinal, lateral, and yaw • Ea Each ch whee wheell has has one one DOF DOF — Roll Rolling ing
PassVeh14DOF
PassVeh14DOF
Vehicle Vehicle with four wheels. • Vehic ehicle le body body has six DOFs DOFs — Longitudinal, lateral, vertical and pitch, yaw, yaw, and roll • Each Each wheel wheel has two DOFs DOFs — Vertica erticall and and rolling
3-30
Engine Subsystem
Variant
Description
Mapped Engine
SiMappedEngine Mapped spark-ignition (SI) engine (default)
Slowly Increasing Steering Maneuver
Steering, Transmission, Driveline, and Brakes Subsystem
Variant
Description
Driveline Driveline Ideal model Fixed Gear
All Wheel Drive
Congure the driveline for all-wheel, frontwheel, or rear-wheel drive
Front Wheel Drive
Specify the type of torque coupling
Rear Wheel Drive (default) Drive (default) Transmissio Ideal ( Ideal (d default) n
Ideal xed gear transmission
Visualization When you run the simulation, the Visualization subsystem provides driver, driver, vehicle, and response information. The reference application logs vehicle signals during the maneuver, maneuver, including steering, vehicle and engine speed, and lateral acceleration. You can use the Simulation Data Inspector to import the logged signals and examine the data.
3-31
3
Reference Applications
Element
Description
Driver Commands
Driver commands: • Hand andwheel ang angle • Acce Accele lera rati tion on comm comman and d • Brake command
3-32
Slowly Increasing Steering Maneuver
Element
Description
Vehicle Vehicle Response
Vehicle response: • Engine speed • Vehicle sp speed • Acce Accele lera rati tion on comm comman and d
Yaw Yaw Rate and Steer Scope block
Yaw Yaw rate and steering angle versus time: • Yello ellow w line line — Yaw Yaw rate rate • Blue Blue lin lines es — Ste Steer erin ing g ang angle le
Steer vs Ay Scope block
Steering angle versus lateral acceleration
Steer, Velocity, Lat Accel Scope block
• SteerAngle — SteerAngle — Steering angle versus time • — — Longitudinal vehicle velocity versus time • — — Lateral acceleration versus time
Vehicle Vehicle XY Plotter
Plot of vehicle longitudinal versus lateral distance
3D Visualization
Optionally, Optionally, you can enable the 3D visualization environment. For For the 3D visualization visualiz ation engine platform requirements and hardware recommendations, see “3D Visualization Engine” on page 1-4. After you open the reference application, in the Visualization subsystem, open the 3D Engine block. Set these parameters. • 3D Engine to Engine to Enabled. Enabled. • Scene description to road . description to one of the scenes, for example Straight road.
3-33
3
Reference Applications
When you run the simulation, view the vehicle response in the VehicleSimulation window. Note
• To ope open n and and clos close e the the VehicleSimulation VehicleSimulation window window,, use the Simulink Run and Stop buttons. If you manually close the VehicleSimulation VehicleSimulation window window,, Simulink stops the simulation with an error. error. • When you you enable enable the the 3D visualizat visualization ion environ environment, ment, you you cannot cannot step step the simulation simulation back.
To change the camera views in the VehicleSimulation VehicleSimulation window window,, use these key commands.
3-34
See Also
Key Key Came Camera ra View iew
1
Back left
2
Back
3
Back right
4
Left
5
Internal
6
Right
7
Front left
8
Front
9
Front right
References [1] SAE J266. Steady-State Directional Control Test Procedures For Passenger Cars and PA: SAE International, 1996. Light Trucks. Warrendale, PA:
See Also Longitudinal Driver | Mapped SI Engine
Related Examples •
“Ve “Vehicle icle Stee teering ing Gain ain at Diferent Speeds” on page 1-21
More About •
“3D “3D Vis Visua uali liza zati tion on En Engi gine ne”” on on pag page e 11-4
•
“Pass “Passen enge gerr Vehic ehicle le Dyna Dynamic micss Mod Model els” s” on page page 3-2 3-2
3-35
3
Reference Applications
•
3-36
“Sim “Simul ulat atio ion n Dat Data a Ins Insp pecto ectorr in in You Yourr Workow” (Simulink)
Run a Maneuver in 3D Environment
Run a Maneuver in 3D Environment This example shows how to run a vehicle maneuver in a 3D environment. By integrating vehicle dynamics models with a 3D environment, you can test advanced driver assistance systems (ADAS) and automated driving (AD) perception, planning, and control software. For the 3D visualization engine platform requirements and hardware recommendations, see “3D Visualization Engine” on page 1-4. 1
Create and open a working copy of a maneuver reference application. For example, open the double-lane change reference application. vdynblksDblLaneChangeStart
2
Run the maneuver simulation. By default, the 3D environment is disabled. When you run the simulation, the Visualization subsystem provides driver, driver, vehicle, and response information. The reference application logs vehicle vehi cle signals during the maneuver, maneuver, including steering, vehicle vehi cle and engine speed, and lateral acceleration. accelerati on. You You can use the Simulation Data Inspector to import the logged signals and examine the data.
3-37
3
Reference Applications
Element
Description
Driv Driver er Comma ommand ndss
Driv Driver er comm comman ands ds:: • Hand andwheel ang angle • Acce Accele lera rati tion on comm comman and d • Brake command
3-38
Run a Maneuver in 3D Environment
Element
Description
Vehicle Vehicle Response
Vehicle response: • Engine speed • Vehicle sp speed • Acce Accele lera rati tion on comm comman and d
Lane Change Scope block
Lateral vehicle displacement versus time: • Red line — Cone Coness mark marking ing lane bou bounda ndary ry • Blue Blue llin ine e — Refe Refere renc nce e traj trajec ecto tory ry • Gree Green n line line — Actu Actual al tra traje ject ctor ory y
Steer vs Ay Scope block
Steering angle versus lateral acceleration
Steer, Velocity, Lat Accel Scope block
• SteerAngle — SteerAngle — Steering angle versus time • — — Longitudinal vehicle velocity versus time • — — Lateral acceleration versus time
Vehicle Vehicle XY Plotter 3
Vehicle longitudinal versus lateral distance
Enable the 3D visualization environment. In the Visualization subsystem, open the 3D Engine block. Set these parameters. • 3D Engine to Engine to Enabled. Enabled. • Scene description to road . description to one of the scenes, for example Straight road.
3-39
3
Reference Applications
4
Rerun the reference application. As the simulation runs, in the VehicleSimulation window, window, view the vehicle response. To change the camera views in the VehicleSimulation VehicleSimulation window, window, use these key commands.
3-40
Run a Maneuver in 3D Environment
Ke Camera View y
1
Back left
2
Back
3
Back right
4
Left
5
Internal
6
Right
7
Front left
8
Front
9
Front right
For For example, when you run the double-lane change maneuver, maneuver, use the cameras to visualize the vehicle as it changes lanes. • Back
3-41
3
Reference Applications
• Front le left
3-42
Run a Maneuver in 3D Environment
• Internal
3-43
3
Reference Applications
Note
• To ope open n and and clos close e the the VehicleSimulation VehicleSimulation window window,, use the Simulink Run and Stop buttons. If you manually close the VehicleSimulation VehicleSimulation window, window, Simulink stops the simulation simulati on with an error. error. • When you enable enable the 3D visualization visualization environment, environment, you cannot cannot step the simulation back.
3-44
See Also
See Also More About •
“3D “3D Vis Visua uali liza zati tion on En Engi gine ne”” on on pag page e 11-4
•
“Dou “Doubl blee-La Lane ne Chan Change ge Mane Maneuv uver er”” on on pag page e 3-4 3-4
•
“Slo “Slowl wly y Inc Incre reas asin ing g Ste Steer erin ing g Man Maneu euve ver” r” on page page 3-28 3-28
•
“Swe “Swept pt-S -Sin ine eS Ste teer erin ing g Man Maneu euve ver” r” on page page 3-20 3-20
•
“Sim “Simul ulat atio ion n Dat Data a Ins Insp pecto ectorr in in You Yourr Workow” (Simulink)
3-45
4 Supporting Data
4
Supporting Data
Supporting Scene, Drive Cycle, and Maneuver Data Install Maneuver and Drive Cycle Data This example shows how to install additional maneuver and drive cycle data from a support package. By default, the Drive Cycle Source block has the FTP-75 drive cycle data. The support package has drive cycles that include the gear shift schedules, for example JC08 and JC08 and CUEDC. CUEDC. 1
In the Drive Cycle Source block, click Install additional drive cycles to cycles to start the installer.
2
Follow Follow the instructions and default settings provided by the installer install er to complete the installation.
3
On the Select a support package screen, package screen, select the data you want to add: Accept or change the Installation folder and and click Next. Next. Note You You must have write privileges for the Installation folder. folder.
Customize and Install Additional Scenes To customize and install additional scenes, use the Vehicle Dynamics Blockset Interface for Unreal Engine 4 Products support package. Download D ownload the support package from the MathWorks MathWorks File Exchange.
See Also Drive Cycle Source | Simulation 3D Cong
External Websites •
4-2
Unreal Engine