Implement switch with stateflow input in simscape hydraulic system

조회 수: 4 (최근 30일)
I am currently trying to implement a stateflow signal depending pump in a hydraulic system. Depending on the output signal of a stateflow operation a pump should either be turned on and pump liquid into a reservoir or turned off.
As far as I can see there is no possiblity of turning pumps on and off in simscpae fluid hydraulics. Is this correct?
Now I tried to connect the pump to or disconnect the pump from the reservoir depending on the output signal of stateflow but the library does not offer corresponding switches.
Is there another possiblity to implement the wanted behaviour or have I overlooked something?
Thank you!

채택된 답변

Gillian Rosen
Gillian Rosen 2017년 3월 15일
Hi Alicia, 
I understand that you would like to turn a pump on or off in SimHydraulics using the output of a Stateflow chart. 
It is possible to turn a pump off or on in SimHydraulics. To do so, you will need to stop (or start) the motion of the pump's input shaft. For example, if you have a Fixed-Displacement Pump block with its S (shaft) port connected to a Rotational Velocity Source block, controlling the velocity source with a nonzero control signal will turn the pump on, and a control signal equal to zero will turn the pump off. See the image below: 
To use a Stateflow output signal for turning the pump on and off, replace the manual switch portion of the above diagram with your Stateflow chart. 
You can apply this principle with any pump and input- just turn off the input to turn off the pump. 
  댓글 수: 3
Gillian Rosen
Gillian Rosen 2017년 3월 15일
Hi Alicia, 
The current error is not related to Simscape run-time parameters- it is related to your Stateflow chart. It seems that your chart is part of an algebraic loop, which is a situation that can arise where the value of the input to a block directly controls the value of the output. More information about algebraic loops (and how to resolve them) can be found at the following links:
Also, please note that the image above is not a full model. It was meant to show only the part of the model that would turn the pump on and off, and I apologize if this was confusing. To make this a valid model, please connect a Hydraulic Reference block between the P and T ports of the pump block.
Alicia Roder
Alicia Roder 2017년 3월 16일
Thank you very much, Gillian. The model was very helpful and the Connections were not the problem. I am afraid, I cannot eliminate the algebraic loop since it is my control loop - the vital part of the model. Perhaps Simscape is not the tool to use for the application and I should investigate Simulink instead.

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

추가 답변 (2개)

Steve Miller
Steve Miller 2017년 3월 25일
편집: Steve Miller 2017년 3월 25일
Hi Alicia,
You will likely encounter the same error concerning algebraic loops whether or not the pump model is implemented in Simulink or Simscape. Algebraic loop errors indicate that the model you have created means that the input to a block depends on the output of that same block. This situation in a physical system with a controller is not realistic, for there will be a delay in the feedback system.
Assuming your Stateflow model represents a control algorithm which takes input from sensors and then controls a motor, there will be discrete delays from the sensors as they are read and a time constant associated with the motor dynamics. The easiest way to eliminate this error (and make your model more realistic) is to insert a low pass filter on the signal that controls the pump.
Some examples that show how to avoid this problem:
Hydraulic Actuator with Digital Position Controller
Hydraulic Actuator Configured for HIL Testing
Drill-Ream Actuator
This example includes a Stateflow model and transfer functions to model the dynamics of the valves, which then break the algebraic loop.
I hope these examples help you get your Simscape model running properly.
--Steve

Pema   Khandu
Pema Khandu 2019년 5월 12일
Hi
I am currently working on how to put on the pump level based on the tank level. i am using a level sensor to record the level. Hpw do i do that ?

카테고리

Help CenterFile Exchange에서 Discrete Events and Mode Charts에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by