Hello everyone,
I am currently working on a project with Simulink. I am relatively fresh to the topic, hence I encounter a lot of problems.
Simplified description of the model goes: Model follows main sample velocity profile (ex. from lookup table) through entire simulation, after longitudinal controller, velocity signal goes to Matlab function block. Matlab function block should have the capabilitiy of recognizing the signal and based on some factors (not yet implemented) switch to the short snippets of different velocity profiles - 'events' (from workspace block). Use of a From Workspace block to import the data is forced by existing database that has to be used for this project.
Here is simplified version of the model to show the problem:
#1:
How to make 'events' time independet? Here you can see that function switches to 2 different velocity snippets (since reaching desired speed) while there are already finished (due to From Workspace block time based structure). Those snippets are 5 seconds long and goes like (10, 11, 12, 13, 14). I would like the snippets to start only when the function switches to them.
#2:
In the future, model should be able to decide which 'event' to use based on best fitting factors e.g. velocity. For example I would like the function to decide which 'event' to use through comparison of the basic profile velocity to 'events'. Is it possible to implement in Simulink/Matlab the functionality of a function reading into From Workspace and making decision from this level?
Hope I presented the problem clearly enough. I will be very greatful for any tips and anwsers.
Greetings and thank you in advance.