Matlab pump control
Matlab pump control
(OP)
I need to use the Matlab for controling water pump speed which will control water level in a small tank. Water pump (windshield-water pump, 12v) is connected to DC-DC converter controller which is control by Matlab (0-5V).
Water level is messured by pressure sensor and this is INPUT.
So this is what i need from Matlab:
When input in Matlab is 0-0.5V, OUT must be 5V.
When IN is 2.5V, OUT must be 3V. If Input then raises, OUT must decrease for 0.5V. If it raises again, then OUT must again decrease by 0.5V. And so on.
If Input lowers then OUT must raise for 0.5V. And if it sill raises, again 0.5V increase in OUT and so on...
When IN is 4V, OUT must be 0V.
So if someone can help me to write code in Matlab that will do that.
Thank You.
Water level is messured by pressure sensor and this is INPUT.
So this is what i need from Matlab:
When input in Matlab is 0-0.5V, OUT must be 5V.
When IN is 2.5V, OUT must be 3V. If Input then raises, OUT must decrease for 0.5V. If it raises again, then OUT must again decrease by 0.5V. And so on.
If Input lowers then OUT must raise for 0.5V. And if it sill raises, again 0.5V increase in OUT and so on...
When IN is 4V, OUT must be 0V.
So if someone can help me to write code in Matlab that will do that.
Thank You.
RE: Matlab pump control
Why not use an embedded function in Simulink that has a few if statements that say exactly what you said.
"When input in Matlab is 0-0.5V, OUT must be 5V."
%
while input<=0.5 & input>=0
output=5;
end
%
ect.
Fe
RE: Matlab pump control
- What is the sampling rate of your system? Over what period is a raise or fall in voltage measured?
- What's the desired behaviour between 0.5V and 2.5V?
- Steve
RE: Matlab pump control
I must control water level in one tank. Motor is pumping water, and water is flowing out through manual valve. And pressure sensor is there to "see" water level.
So my system must fill tank with water and then control level fluid to be lets say around 30-32cm (pressure sensor reading 2.5-2.7V).
As a read on web and getting familiar to Matlab and Simulink, i see that for controling water level is maybe better use some PID controller.
With this IF statements it can be done too i think, but maybe it is simplier with PID? But how to do it.
Sample rate i don't know. I need something to start with that my system work, then i will fine tune it.
RE: Matlab pump control
- Steve
RE: Matlab pump control
When input raise 0.3V over 2.5V (which will be refferent fluid level), then out must decrease so that motor pumps water slower.
0.3V raise is done in 2 seconds.
RE: Matlab pump control
=====================================
Eng-tips forums: The best place on the web for engineering discussions.
RE: Matlab pump control
RE: Matlab pump control
Without the basics, it will be difficult to help....
Aside from this, my opinion is to use a PD or PI with set point diversion.
Fe
RE: Matlab pump control
Cheers
Greg Locock
New here? Try reading these, they might help FAQ731-376: Eng-Tips.com Forum Policies http://eng-tips.com/market.cfm?
RE: Matlab pump control
Fe