Simulink - how to hold signal value after change (transmission)
古いコメントを表示
I need a way to hold a signal value after it changes for a specific amount of times with only simulink blocks.
My Simulink model specifically is a transmission and I want to add a shift suppresor. So basically when the current gear changes it should not shift for 3 seconds. I've tried around with a detect change block that detects a new gear and then a subsystem gets triggered that goes into a switch which is activated as soon as the subsystem has an output and then the gear which is stored in the subsystem gets transmitted instead of the gear that would've been transmitted.
You can see a screenshot of my transmission. The basic principle is that the upshift and downshift logic always check if the gear should be changed and if yes puts out a 1 which is either added or subtracted from the current gear.

I'm thankful for every help!
採用された回答
その他の回答 (1 件)
Altaïr
2025 年 7 月 10 日
1 投票
One straightforward approach to achieve this is by using a Stateflow chart, as illustrated below.


For those who prefer to work with Simulink blocks, building a counter with the Detect Change block and implementing the if-else logic using "If" and "If Action Subsystem" blocks is a suitable method.

Both approaches produce the desired output, as shown.

For more information on the blocks refer the following links:
カテゴリ
ヘルプ センター および File Exchange で Simulink についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

