Challenge

Project 2 Adaptive Cruise Control

Requirement:

Here in this project our prime requirement is is to develop adaptive cruise control. The requirement is divided in two various subsections as one and two and three. The prime inputs for developing this model are camera and radar inputs of driving vehicle and lead vehicle and the prime output of this model is to generate the acceleration mode.

Requirement one:


In this block camera input and radar input of the lead vehicles are taken as inputs. As defined in the requirement sheet a summation block is used and the output lead vehicle speed is generated.


Requirement 2:


In this block we have 3 inputs,they are camera and radar inputs of driving vehicle and the third one is acceleration mode. As defined in the requirement sheet a summation block is used to generate the output drivingvehicle_speed.

Another output need vehicle_detected is generated from acceleration_mode input by using a signal conversion block as mentioned in requirement sheet.


Requirement 3:

Requirement 3 he’s developed by using The state machine logic. And this state machine logic has 8 inputs and one output. The inputs are time_gap, set_speed, set_gap, cruiseswitch, setswitch, drivevehicle_speed,leadvehicle_speed, leadvehicle_detected and the output of this state machine logic is acceleration_mode.


State machine logic:

The state machine logic is defined with three states off mode, standby mode, ON mode.


Off mode is the default transition state and after entering this state acceleration_mode is set to zero. Two and fro transitions to this state is developed as per requirement sheet.


Next state is standby mode and in this state acceleration_mode is Set to 1.State transitions are defined as per the sheet.


The final state is ACC ON mode. This state is subdivided into six different states. Each substates in this state are defined with their own acceleration_mode values and transition from one state to another state is defined by the governing conditions as defined in the requirement sheet . the substrates are. LeadVehicle_Detected_Follow (Default), LeadVehicle_Not_Detected, LeadVehicle_Detected_Resume, LeadVehicle_Not_Detected_Resume, LeadVehicle_Speed_lessthan_Set_Speed, LeadVehicle_Speed_Equal_Set_Speed

Chart block inputs and outputs are defined in model explorer

Creation of SLDD:

A symlink data dictionary he’s created with the name project_dictionary. All the signals, And the calibration values that were used in the model and given in in the requirement sheet or define in this dictionary.

The data types, initial values, minimum end Maximum values, storage classes etc were defined as per the requirement sheet.

For output signals header file and definition file were also defined

After creation of SLDD All the signals that were used in the model or propagated or resolved 2 sibling signal object .

Defining Model Settings:

In the model configuration settings all the solverconfigurations are changed as per the requirement. Firstl the solver type changed to fixed step with sample time 0.01s.

All the error and warning settings are adjusted asper MAB guidelines.

As code generation is requested to do in embedded system target file is changed to embedded coder and in the build process while generate code only option is selected.
in the interface tab floating point numbers is selected.

Model Advisor:

Now in the modeling tab we have the model advisor option in the model advisor option we have selected the complete model and then checked weather our created project is as per the modeling standards of MAB and JMAAB guidelines. Upon running the checks we can clearly see that our model has passed all the checks that were in the guidelines and a few warnings.

Code Generation:

After completion of using model advisor to control B is pressed to generate the code here we can see the code is generated without any errors screenshots are also attached. The core generation report screenshot is also attached.

Output check:

The model he’s run for 10 seconds and we can see that there are no errors in the output so by this we can say that our model he’s running successfully.

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.