03-15-2017 06:16 AM
Hello all
For a school project I have to make a control for a reactor that measures pressure, temperature and flow.
Both pressure and flow will be sine-like signal outputs. So for now I wanna build a simulator that generates a sine signal and a controller that keeps it within certain limits.
So far I've been able to build a sine generator and a basic PID control, but they are both separate.
I have no clue how I can introduce the sine signal in the controller so that it can be kept within certain limits.
The sine I now have has an amplitude of 10, a frequency of 0,3 and an offset of 50.
Can anyone help me combine the sine signal with the controller so that it stays within an amplitude of 40-60
Solved! Go to Solution.
03-15-2017 07:08 AM - edited 03-15-2017 07:09 AM
Hi Xebe,
I have no clue how I can introduce the sine signal in the controller so that it can be kept within certain limits.
How should your controller influence the sine wave generation?
How should the sine wave look like after you "keep it within certain limits"? (Otherwise simply use the InRangeAndCoerce function to "keep the sine within limits"…)
03-15-2017 08:15 AM - edited 03-15-2017 08:17 AM
We'll be using a pulsing pump, so i don't expect to get a lineair output out of it.
So what I'm trying to achieve is to keep the pump at it's current ratio as long as the process values stay within (lets say) a pressure of 40-60 bar.
But if the pressure delivered becomes higher than 60 bar the pump needs to slow down again so that the pressure falls within the previous limits again.
Where would I find the ' InRangeAndCoerce function'?
Also I'd like to make some kind of simulation, without having to add hardware yet. But if possible i'd like to easily switch to the real thing by just removing and/or replacing a few blocks.
03-15-2017 08:32 AM
Hi Xebe,
Also I'd like to make some kind of simulation, without having to add hardware yet.
LabVIEW comes with a lot of example VIs.
With the PID toolkit come several example VIs explaining the use of PID functions with a simple simulation. Did you examine them?
Where would I find the ' InRangeAndCoerce function'?
Use Quickdrop (Ctrl-Space).
Or search the LabVIEW help.
Or look at the comparison palette…
So what I'm trying to achieve is…
Now we are starting to talk about a control loop consisting of a system, a controller and several signals (sp, pv, outputs). This is a clear improvement against "limiting a sine wave"…
General answer: set the PID gains suitable for your control system!
03-15-2017 08:49 AM
I've been through a few examples, but I can't find any that use a sine/pulsating signal as input.
At this point my knowledge of LabVIEW and control loops stuff isn't suited for the task, but I'm willing to learn. However, most of these examples are already a bit too complicated for me to even understand.
03-15-2017 08:55 AM
Hi Xebe,
However, most of these examples are already a bit too complicated for me to even understand.
Then you should start the with those GettingStarted links given on top of the LabVIEW forum!
I can't find any that use a sine/pulsating signal as input.
There are examples for PID control and there are example to create a sine wave. You just need to combine them (using the basic knowledge from GettingStarted)…
03-15-2017 09:04 AM
I've seen all those learn-labview video tutorials so far. I can now make a thermometer that gives °C or °F and if I try i could make a traffic light.
But I don't quite see where I should put my sine signal into the controller, and how the controller will then be able to control the sine signal.
I see that you're trying to help me, thanks for that, but it doesn't seem to really help me get anywhere further.
03-15-2017 09:21 AM
Hi Xebe,
as far as I understood your question the sine wave will be your "process value" pv (aka measurement value). The (PID) controller expects your pv and a "setpoint" sp as inputs (with some PID gains) and gives you an output value. That output should be your pump speed (or requested massflow/pressure)…
So when you use those example VIs, which usually use a FP control to set the sp you would replace that control with your "sine wave"!
03-15-2017 09:32 AM
Okay, that was very helpful.
This is what I got so far (see attachment). It seems to be working and stable.
But now it seems that should my pressure drop, the pump will also start slowing down?
Pressure drops are possible, but will be mostly slowly over time because of pressure leaks (in the future real process).
03-15-2017 09:32 AM - edited 03-15-2017 09:36 AM
Okay, that was very helpful.
This is what I got so far (see attachment). It seems to be working and stable.
But now it seems that should my pressure drop, the pump will also start slowing down?
Pressure drops are possible, but will be mostly slowly over time because of pressure leaks (in the future real process).
Edit:
forgot to rescale some graphs, now my pump would get a sine signal to constantly give more and then less power?