Rate Transition in If-action Subsystems

Hello,
I am trying to setup a control system with different controller operating modes. I want to handle the selectionm of the operating mode with a if-action subsystem structure. I'm getting the following error that I am not completly sure how to handle:
'ctrlActiveHandler_0_4_sim/Axis_Control/AbsPosMode/Horizontal_Axis_Control/Rate Transition' is a rate transition block. A rate transition block is not allowed inside the if action subsystem 'ctrlActiveHandler_0_4_sim/Axis_Control/AbsPosMode' unless its input or output port sample time is asynchronous sample time. Consider placing the rate transition block outside the if action subsystem.
I can't take the rate transition outside the subsystem as it ensures integrity between to different blocks. And I am not sure about the asynchrounus sample time. Can someone explain this error and its fix?
Thank you very much.

 Accepted Answer

Fangjun Jiang
Fangjun Jiang on 20 Oct 2020
Edited: Fangjun Jiang on 20 Oct 2020
Let's say your whole model is executed at every 0.1s. At every 0.1 second, the condition is checked and the "If-action" subsystem is executed or not executed. So the execution of the subsystem is asynchronous or triggered. I can't think of a scenerio where inside the subsystem, a rate transition is meaningful, although your error message says there might be such a case.
Move the rate transiton block outside of the "if-action" subsystem. I can't imagine why you can't.
Added below:
Now I think I might understand such a case indicated in the error message. When the "If-action" subsystem is executed, all its inputs must be available. The "If-action" subsystem is only executed at most once per step size, so there is no need to do rate transition inside. However, if one of its input is asynchronous or triggered which means it is not available at the time when the "If-action" subsystem is executed, then you might need to do rate transition inside (for the purpose of holding last available value). Still, even in that case, I think it is possible or better to do the rate transition outside.

5 Comments

Hello,
Thank you for your reply. I got your point. I was expecting the behaviour to be like an enabled subsystem where the subsystem is active while the condition is met. I have tested and as expected there is no problem regarding rate transitions there.
I have seen that in the block library there are if-action and switch-case subsystems. I have to test if they perform differently. But maybe as a follow up question is there a way to use the switch-case structure in simulink where the executed subsystem works like an enabled subsystem? Or do I have to build that by myself using standard blocks? Not that it would be difficult but the switch-case structure seems so much more convenient.
For the most part, I think an enabled subsystem is the same as the switch-case subsystem. It is executed when the condition is met.
Hello,
but when I add a rate transition inside a enabled subsystem I don't get the above mentioned error while I get it with a switch-case subsystem, if-action subsystem and triggered subsystem. I have checked that in a minimal example with all mentioned subsystems. So there must be a structural difference between enabled subsystems and the other three.
Yes. It certainly looks like the differences are there. I never had the need to worry about this subtle differences.
Hi
Im also experiencing the same issue. i have to use rate tranition block inside the if action subsystem for getting rid of sample time mismatch error between the if block and my subsystem . but now, using rate transiton block inside if action substem is limitted by the above error. could anyone give some suggeston?

Sign in to comment.

More Answers (0)

Categories

Products

Release

R2016b

Community Treasure Hunt

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

Start Hunting!