필터 지우기
필터 지우기

how to model a switch with two different conditions for activation and deactivation

조회 수: 4 (최근 30일)
Hello:
I have a problem modeling a dynamic system. Now I understand the problem and know a possible solution. My problem is to transform the thought logic into Simulink language.
Let's describe what I want to do:
I want to activate or deactivate a subsystem based on a signal value (0 or 1) in a discrete subsystem. The activation is conditioned by another two conditions: condition A must be ON and does not matter the value of condition B. At this point, if condition A turns to off, the subsystem must be active until condition B is ON (How to maintain this value?). Finally the subsystem is deactivated and it will wait for another instant when condition A is ON again.
Thank you in advance for your help!!

채택된 답변

Arnaud Miege
Arnaud Miege 2011년 5월 9일
Can you use Stateflow? Something like this should do it:
where A_in and B_in are defined as boolean inputs to the chart and out as an output from the chart that can be used to enable a subsystem.
HTH,
Arnaud
  댓글 수: 6
Arnaud Miege
Arnaud Miege 2011년 5월 10일
This is because you haven't defined what ind_presion is in all cases (execution path). For example when you have:
if PABS_cdyc && ind_presion_last==1 % DEACTIVATION
ind_presion = 0;
end
you need an else to define ind_presion when 'PABS_cdyc && ind_presion_last == 1' isn't true.
I would suggest trying to combine all the logic into one if...else statement, possibly with some additional nested if...else statements if necessary.
Javier Guiterrez
Javier Guiterrez 2011년 5월 10일
Thank you very much!!
Now is already fixed. This was the problem, every option was not contemplated.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Javier Guiterrez
Javier Guiterrez 2011년 5월 9일
I have no experience with stateflow. Is it possible to create this logic in Stateflow at university (they have stateflow license) and then convert it into simulink blocks automatically to be able to run it in my job computer?
Or maybe to combine stateflow diagrams with simulink programs? Thank you in advance

카테고리

Help CenterFile Exchange에서 Syntax for States and Transitions에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by