Vehicle Model |
Overall System |
Software Architecture |
LookUp Table |
Function-Call Subsystem |
PID Control Unit |
This project consists of 2 different parts:
In the first part, I've created the car system in the 1st picture using Simulink/Simscape. I declared the parameters of the wheels with the Magic Formula algorithm. While the system is running, you can interactively observe how the speed of the car is affected by changing the incline of the road, the throttle position and the wind speed in the opposite direction.
In the second part, I explained how to create a throttle position in accordance with AUTOSAR and ISO26262 standards and make it ready for hardware. The 2nd picture shows the I/O inputs, the State Chart section that sorts the hierarchy in the server-client system and the composition block of the whole system. The 3rd picture shows the Software Architecture Model, which includes Adaptive Software Components. You can examine the ports and the event sequences assigned to them in the AUTOSAR Dictionary section. At this stage, you can generate your C++ Code and ARXML files for your hardware with MATLAB Code Generator. If you wish, you can change the table values such as HBridge in the system with the LookUp Table Editor as in the 4th picture. In the 5th picture, there is the function-call Subsystem, which is required to create the Adaptive Software Component and is triggered by the functions we have created in the State Chart. In the last picture, you can see the PID Controller.* MATLAB 2023a
* Simulink
* Simulink Simscape
* Simulink Desktop Real-Time
* Simulink AUTOSAR Blockset
- Download CarModel.slx in the FirsPart folder and observe the effect of the qualifications on the vehicle speed interactively.
- Download SecondPart folder into your MATLAB path.
- Be sure that your MATLAB path is chosen SecondPart folder.
- Open VehicleSystemControl.slx file. MATLAB will automatically combine the other Simulink files.
- You can create your C++ code using Code Generator to implement it to your hardware.
Please share your comments and ideas about the project with me. Thank you for your time.