- In the Simulink model, locate the blocks or subsystems responsible for controlling the throttle pedal and brake pedal positions. These blocks are typically connected to the vehicle dynamics or control system.
- Add a "Signal Logging block" to the output of each of these blocks or subsystems. The Signal Logging block allows you to log the values of the signals at specific time intervals.
- Configure the Signal Logging blocks to log the signals at a sample time of 0.1 seconds or whatever interval you desire. You can set the sample time in the block parameters.
- Run the simulation of your model. The Signal Logging blocks will record the values of the throttle and brake pedal positions at the specified intervals.
- Once the simulation is complete, you can access the logged data in the MATLAB workspace. The logged signals will be stored as MATLAB timeseries objects.
- Use MATLAB plotting functions to plot the profiles against time. You can plot the velocity profiles, acceleration profiles, relative distance between ego and MIO, throttle pedal positions, and brake pedal positions all in the same plot or separate plots, depending on your preference.
How can I extract throttle and brake pedal behavior profiles with values at the interval of 0.1 s for the entire Sim runtime?
7 views (last 30 days)
Show older comments
Good Day all,
I am working on my masters thesis and i am using Highway lane following testbench for that.
I am trying to extract throttle pedal and brake pedal positions at the interval of 0.1 s through the runtime so that I can plot the profiles against time. However, I could not find a way to extract those values from the simulink model or from the setup & Scenario files itself. I am using Curved-stop-and-go scenario. I need to plot those results along with the velocity profiles, acceleration profiles, relative distance between ego and MIO as well as throttle and brake pedal behaviors as it has been shown in the documentation via hfigure functionality.
Any suggestions?
Thank you
0 Comments
Answers (1)
Priyank Pandey
on 17 May 2023
Hi Manan,
To extract throttle pedal and brake pedal positions at regular intervals during the runtime of your Highway lane following testbench in Simulink, you can use the following approach:
Please refer to the following link to know more about Signal logging block:
I hope this helps!
Regards
Priyank
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!