Ramp up/down function based on the variable input in Simulink/Matlab

38 views (last 30 days)
Hi,
I am kind of new to Simulink and I am having trouble trying to generate an output signal (as attached) which will be ramped up and down to a certain setpoint depending on the input signal. I have tried using the ramp up function with min block but so far this combination could not generate the desired output. The output stops ramping up after it reaches to the first setpoint.
Any suggestions? Your help is really appreciated.
  7 Comments
José Carlos Ortiz Hernández
Hi Aung Myat,
I am developing the same program and I have many problems. How could you solve it?

Sign in to comment.

Answers (1)

Pramil
Pramil on 30 Oct 2024
Hello Aung,
For your use case, the simplest way to generate the specified signal is by utilizing the "Signal Editor" block.
Yes, the above can be achieved by using "Ramp" and "Saturation" blocks but if you know the points at which the signal is changing, it could be easily built with "Signal Editor" block. Here is the link to the documentation of the same:
For the given use case, you can follow these steps to generate the signal:
  • Add a "Signal Editor" block in simulink and open it's dialog box.
  • Click on "open signal editor" icon. A new window will appear.
  • On the left side, click on "scenerio" and select "signal 1".
  • Add the points and their assoicated values on the right side.
  • Make sure to set interpolation to "linear". Once done save the signal in a MAT file.
  • The above MAT file will be used by the "Signal Editor" block. Check the "Interpolate data" checkbox in the dialog box to get the ramp signal.
Hope it helps.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!