0% found this document useful (0 votes)
39 views3 pages

Homework 2 Simulink

Uploaded by

dph9703
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views3 pages

Homework 2 Simulink

Uploaded by

dph9703
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

CE3890/CE5999, CS3891/CS5891 AV&T

Homework 2: Constant Time Gap Control


Due: 09/24/2024

Instructors: J. Sprinkle & D. Work Fall 2024

Release Notes:
Version 0: Initial release

0 Assignment overview
In this homework, you will implement a constant time gap controller in Simulink, and simulate its behavior
using some of the conditions from Homework 1. You will demonstrate the ability to identify crashes, validate
steady-state behavior, and create time-varying behaviors for the lead vehicle to demonstrate performance of
your car-following system.
Answers to the following questions should be typed in a suitable editor (e.g., Word or LaTex) with appropriate
references (if you used them), figures, and text, as needed to explain your results. You are free to use your
favorite data analysis tools (python, Matlab, C++, an abacus, etc.; just use what you are comfortable with
and show your work).
Your MATLAB/Simulink files must be included with your submission, and must work correctly on the first
try. Please upload your complete submission to Brightspace by midnight of the deadline. Your report should
clearly describe your systems. You may depend on the grader to know how to run your models, if they are
correctly named.

1 Constant-speed lead vehicle


Starting with model in ego_car.slx, devise a feedback control system save it in a new model called
hw2_lead_car.slx. Your controller should track a desired set speed in meters/second, and use the dy-
namics of the car as found in the ego_car model. Rename the ego_car object in the file to just be called
car.
Question 1.1 Using hw2_lead_car.slx, provide a constant reference input of 20 m/s, assuming no vehicle
is ahead of the car. Show a plot that demonstrates that your speed converges to the desired input, with the
desired acceleration in the scope.
Question 1.2 Does your acceleration ever fall outside the bounds of [−3, 1.5] m/s2 ?
Question 1.3 Revise the output of your controller to limit the acceleration and deceleration to stay within
the bounds of [−3, 1.5] m/s2 , and replot (if necessary).

1
CE3890/CE5999, CS3891/CS5891 AV&T – Fall 2024 HW 2 2

Question 1.4 From the Simulink library, add a switch that allows the user to select either the reference
input from a constant of 20 m/s, or a sinusoidal source that you add to your model with values from
Homework 1. Select one of the input signals from Homework 1 as a reference speed for the car, and plot
the results. Ensure that the output speed trajectory is periodic, and compare it to the input speed. What
do you observe? Note: most answers will differ in this case, depending on the controller you implement and
the sinusoidal function you choose.
Note: your submitted hw2_lead_car.slx file will be able to run any of the questions, depending on how you
select the ’switch’ status before playing your model.

2 Constant Time Gap Car Follower


Create a new Simulink model called hw2_closed_loop_sim.slx either by closing your Question 1 materials,
or copy/pasting them in.
Using your results from the previous homework, create a second car and controller. Your controller should
provide the desired acceleration input to an ego_car, based on a reference input of a constant speed gap
of 2 seconds. This represents the constant time-gap between the ego car and the lead car, if your controller
is implemented correctly.
To set up your simulation, ensure that the hw2_closed_loop_sim.slx model has:

• A sum block that correctly subtracts to obtain the relative position of the two cars to obtain the space
gap
• A sum block that correctly subtracts to obtain the relative speed of the two cars to obtain the time
gap.
• a CTG (constant time gap) controller that is based on Homework 1, Question 3. For any system
parameters, consider having those as input values to your controller, rather than hardcoded values.
Hint: the desired acceleration of the ego car may already be expressed as part of the car following model.

A couple of helpful notes:

1. In class we implemented a constant space gap, not a constant speed gap, controller.
2. You must define a vehicle length in order to calculate the space gap, and you can assume the lead car
is the same length.
3. You may want to extend the simulation time in your model to see steady-state behaviors.

Question 2.5 Using the constant reference input for the lead car, show that your ego car behavior results
in a constant time gap by plotting and labeling all the needed signals. What values did you choose for τ and
α?
Question 2.6 Switching the input to the lead car, plot your ego car behavior, including the time gap, as
a signal. Does the speed oscillation of the lead car dissipate, or grow, over time? What other behaviors do
you see? Plot your results and provide discussion.
Question 2.7 Create a simulation with specific values for τ and α and oscillating behavior of the lead
vehicle, that results in a crash. Provide the values of the parameters that produce the crash, and the details
of the oscillating speed signal of the lead car. How do you identify that a crash occurred? Provide a plot
and description that shows you were able to identify this occurrence.
CE3890/CE5999, CS3891/CS5891 AV&T – Fall 2024 HW 2 3

Question 2.8 Could you automate crash detection behavior in Simulink, to stop the simulation or cause
an error when a crash occurs? What methods might you choose to do this? Does it work?
Question 2.9 Select your favorite parameters that maintain safe, constant time gap control. Do your
parameters from Homework 1 provide a reliable result? Provide a plot and discussion, including your
parameters.

You might also like