Simulink - how to hold signal value after change (transmission)
Ältere Kommentare anzeigen
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!
Akzeptierte Antwort
Weitere Antworten (1)
Altaïr
am 10 Jul. 2025
1 Stimme
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:
1 Kommentar
Dominik
am 10 Jul. 2025
Kategorien
Mehr zu Simulink finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

