Implement switch with stateflow input in simscape hydraulic system
Show older comments
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!
Accepted Answer
More Answers (2)
Steve Miller
on 25 Mar 2017
Edited: Steve Miller
on 25 Mar 2017
0 votes
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
See the transport delay block on the controller output. http://www.mathworks.com/help/releases/R2017a/physmod/simscape/examples/hydraulic-actuator-with-digital-position-controller.html
Hydraulic Actuator Configured for HIL Testing
See the Zero-Order Hold blocks representing a discrete delay. http://www.mathworks.com/help/releases/R2017a/physmod/simscape/examples/hydraulic-actuator-configured-for-hil-testing.html
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
on 12 May 2019
0 votes
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 ?
Categories
Find more on Discrete Events and Mode Charts in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!