01-26-2020 02:54 PM
Hi there, i am doing college project and i am stuck here need some help i have to control the dc motor(pump) with LabVIEW. I am making grow box which have sensor output will be run the pump according the setpoint.
There is no control and simulation toolbox in our college labview so we have to use basic block diagram,as far i got its working as 2 step controller but project was asign us it has to work as proportional controller.
Solved! Go to Solution.
01-26-2020 03:23 PM - edited 01-26-2020 03:39 PM
(Since every post here is about LabVIEW (note the correct lettercase), please have a moderator change the subject of your post. I am sure you can come up with a better description)
Proportional control typically involves PID, so start looking into that. The example finder has some useful demos.
01-26-2020 03:27 PM
We are no allow to use pid controller to the control speed of dc motor. We have to use basic case structure like, not sure yet.
01-26-2020 03:44 PM - edited 01-26-2020 03:45 PM
PID is part of LabVIEW full, so at least look at the examples to give you some ideas. Then substitute your own code..
@Bk1980 wrote:
We have to use basic case structure like, not sure yet.
A case structure does not control anything and there is only one type (not e.g. basic and acidic versions ;)). Please find out what the rules are and post again once you are sure.
01-26-2020 03:54 PM
I already made pid controller in my laptops. When i present to my supervisor he rejected it. said due to we are not using control simulation so i have use different way. no idea what to do now.
01-26-2020 06:49 PM
I suspect you are supposed to do something simpler (I will avoid a remark about "more basic" for fear of an acidic response 😉 ) and with regards to the Case Structure perhaps you can read about a State Machine.
Your general idea probably involves taking the current value, determining if it is more or less than the setpoint, and then turning on or off the motor in response to this finding.
This can be done with a relatively small number of simple nodes, like Greater Than, Less Than, perhaps Select?
01-27-2020 02:40 AM
Thanks. I will try this way in next class. just wondering is any way we can make own pid with first principle without having pid control toobox
01-27-2020 02:49 AM - edited 01-27-2020 02:51 AM
Edit: I see you didn't specify if you are controlling flow rate or simply on/off, so perhaps you already have an analog output. Please keep that in mind when reading below...
It's certainly possible.
The "algorithm" I described is not truly a PID controller at all - it is none of Proportional, Integral or Derivative dependent.
However, you have only a binary output in the form you described.
If you instead had an analog output (e.g. flow rate from pump, controlled by voltage or similar) then you could adjust your control value (flow rate) based on your measured value.
To build a proportional controller, you'd calculate the difference between your measured value and your target value, then multiply this by some constant (sometimes written k_p, where _ implies a subscript) and use that as your new control value.
To add the I and D terms, you'd look at the trending value over time and the change vs time. The Wikipedia page on PID controllers can give you a lot more detail.
01-27-2020 08:49 AM - edited 01-27-2020 08:52 AM
@Bk1980 wrote:
Thanks. I will try this way in next class. just wondering is any way we can make own pid with first principle without having pid control toobox
Of course you can make a PID controller without using ashipped-with-LabVIEW PID controller.
It's just math in there, not magic: PID_controller
I wander if that is what your teacher means though. If he really said you have to use "control simulation" he might be referring to actually using system identification to make a good controller (where PID is sufficient at best).
01-29-2020 03:32 PM
Hi there, As I discussed before, I'm controlling the pump speed depending on the moisture level in the flower pot. I got the calibrated output from the moisture sensor and fed it to the DAQ anologue input channel. In the labview, when I subtracted the measure value from the setpoint level and mulitiplied it with the constant value, which I calculated by the pump flow rate versus voltage.
But the problem is, that I am not using select block (on and off) from labview, I can't stop the pump. Even the very small errors. The pump keeps running, hope you understand this time and I really appreciate your help.