Simulink Signal Builder: Change of Variable

조회 수: 5 (최근 30일)
Andrew Sager
Andrew Sager 2020년 7월 1일
답변: sanidhyak 2025년 3월 3일
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?

답변 (1개)

sanidhyak
sanidhyak 2025년 3월 3일
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!

카테고리

Help CenterFile Exchange에서 Configure Inputs and Visualizations에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by