Simulink Signal Builder: Change of Variable

2 visualizaciones (últimos 30 días)
Andrew Sager
Andrew Sager el 1 de Jul. de 2020
Respondida: sanidhyak el 3 de Mzo. de 2025
In short, I'm designing a cruise control system and I want to simulate the profile of a "hill". It makes more sense to model the hill as a function of position rather than time. It's a closed loop model, so I have a "velocity" node. I figure if I add an integrator from this node to to a custom variable, and use that custom variable as the axis of signal builder, then I will get the model I am looking for.
Any way to do this? Or alternatives?

Respuestas (1)

sanidhyak
sanidhyak el 3 de Mzo. de 2025
I understand that you are working on a cruise control system and want to model a "hill" as a function of position instead of time using Simulink Signal Builder.
Based on your question I am assuming that you are using Simulink R2018b. In this version the Signal Builder block supports only time as the independent variable, which limits direct implementation of position-based profiles.
To achieve your goal, you can follow the below steps:
  1. Use an Integrator block to convert the velocity signal into position.
  2. Then, instead of Signal Builder, use a 1-D Lookup Table block.
  3. Configure the Lookup Table to take position as the input and define the hill profile by mapping position to elevation.
  4. Connect the Integrator output to the Lookup Table input and use the table's output in your cruise control logic to simulate the hill effect.
You can also use Scope blocks to visualize the velocity, position, and hill elevation during the simulation.
This approach models the hill as a function of position rather than time.
If you are using Simulink R2021b or later, you can also explore the Signal Editor block, which offers more flexibility, though it still primarily uses time as the independent axis.
For further details on the Lookup Table block, refer to the official documentation:
I hope this helps.
Cheers and Happy Coding!

Categorías

Más información sobre Configure Inputs and Visualizations en Help Center y File Exchange.

Productos


Versión

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by