PID-Control (Tank Level)

Hi!
I want to realize a PID-control for a tank level. I've already looked at all related examples in LabVIEW, but I have a general question:
Where is the measured value brought into the process (where would I connect the DAQ to the control-loop)?? I can't figure out how it's done in the examples (there is always an "initial value" outside the while-loop)....
Would be great to get some answers!

Generally you take the DAQ value and feed it into the PID as the process variable.  The examples store the process variable in a shift register in order to simulate a system in which the current value depends on the previous value, but in a real system the physics of the system handle that for you.  For example in a tank control system, the tank itself holds some amount of liquid, which doesn't change by a large amount within one sample period.  To simulate that properly you need to store a value equivalent to the liquid volume in a shift register.

Similar Messages

  • Tank Level Control with PID regulator

    Hello! 
    I found a lot of examples regarding the simulation of a tank - level control with PID regulator. but I still have a dilemma.
    I can't find the transfer function for the process, if you can help me it would be great because I'm stuck here...

    Maybe you could ask some of you classmates?
    LabVIEW Champion . Do more with less code and in less time .

  • Level Control with PID Control & Pulse-Width Modulation

    Hi all,
          I have attached my program which I'm having trouble wiring up in the block diagram.... I'm fairly new to labview, but basically I have a level control project with an analog input cistern arm turning a pot for my test tank (configured as DAQ assistant voltage analog i/p) and a pump working off a reservoir (configured as DAQ assistant voltage digital o/p). My electrical side of things is working correctly and I have tested both DAQ assistants I/O's successfully off a basic program, minus the PID & PWM... I found a simple PID control subvi which I think I have wired up correctly, apart from the output variable... I also found a bit of code for PWM using the square waveform vi (far right side of the program) which I have tried to include in the program, but I've been unsuccessful with that. The ideal operation i'm looking for with this project is to be able to enter different values for the setpoint, for the PID to kick in to find that setpoint each time using the PWM to drive the pump, which has a flow rate of 13L/min. I have a manual valve to release water from my test tank which I can set accordingly.
    My questions are;
    - How do I connect the 'output variable' of the PID subvi to my DAQ assistant digital output(both DAQ assistants are set at 1 sample on demand)?
    I have a 'number to boolean array' function, but this gives an error saying that the number of tasks generated are not the same...
    - How do I wire up the PWM bit of code? Do I need to include the 'error in & out' tabs?
    -Am I on the right track with this program or am I way off the mark?!
    Any feedback on this would be greatly appreciated. Thanks for your time,
    Richie
    Attachments:
    PID-RichLevelControl.vi ‏91 KB

    Rich-MechatronicsStudent wrote:My questions are;
    - How do I connect the 'output variable' of the PID subvi to my DAQ assistant digital output(both DAQ assistants are set at 1 sample on demand)?
    I have a 'number to boolean array' function, but this gives an error saying that the number of tasks generated are not the same...
    - How do I wire up the PWM bit of code? Do I need to include the 'error in & out' tabs?
    -Am I on the right track with this program or am I way off the mark?!
    You're a bit off track.  You need the output of the PID to go into the PWM generator, and the output of the PWM to be written to the digital output.  Right now you have the output of the PID connected directly to the Digital Output in a way that won't work, and the PWM generator hanging off the side not really connected to anything.  Also, the PWM generator isn't really going to work since you're generating it at the same frequency as your PID loop runs.  Try a simpler algorithm such as on/off control first and see if that works for your system.

  • Monitoring unknown tank level and control

    Hello
    I want monitor unknown numbers of water tank level. but I dont know is it possible to design a wizard that get me numbers of tank and then design them or not? can u help me?
    actually, these are process:
    1) get number of tank and their properties that are difference between all tanks.
    2) show tanks and their levels
    3) control input/output valves with a Matlab program
    tnx
    BR

    Hi behzad,
    how such a programming must be prepared?
    As any other programming project too: you need to collect specs, draw a flow chart (on paper!), create the program to follow your flow chart…
    Please ask specific questions to get specific answers. As long as you only ask for very general topics all you get are very general answers!
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Pid control for mydaq

    Hello,
    I am writing to know can you please help me. I am trying to writing a PID control programme for a water level control project I am doing but when I use labview and select a daq assisitant it does not show terminals onit therefore I cannot wire it up. Can you please help to rectify this.
    Solved!
    Go to Solution.

    moonlightingelec wrote:
    Hello,
    I am writing to know can you please help me. I am trying to writing a PID control programme for a water level control project I am doing but when I use labview and select a daq assisitant it does not show terminals onit therefore I cannot wire it up. Can you please help to rectify this.
    Am not sure why you are searching the PID terminals in DAQ assistant. Are you using any LAbVIEW PID module?
    The best solution is the one you find it by yourself

  • PID control temperature of oven

    Hi! I should check the temperature of an oven through a PID control.
    I wish that, after setting the reference temperature, the system acts on the power supply and change the current on the resistances of the oven, so that the temperature of the oven reaches the reference temperature.
    Not knowing the programming language labview, I wanted to know if any of you have already saved the program in the PC and can post it, please.
    Thank You!

    aputman wrote:
    That's why I used words like "think" and "may".  I haven't been successful at it but I am definitely no expert. 
    What sort of incorrect response do you get from the heater system? If you're actively working on such a project I'd be happy to help.
    For tuning a slow system, I highly recommend starting with the Cohen-Coon method (or the similar Ziegler-Nichols Open Loop approach). Take the PID out of the loop. Set the output at a fixed level and allow the system to stabilize. Change the output, and allow the system to stabilize again (make sure you wait until the system is actually stable). Record the output and process variable the entire time. Then you use that data to make a couple of quick measurements, plug the numbers into the tuning formula, and you get your gains. Unless the system is horribly non-linear, these gains will work well. Make sure you get all the units correct (for example, the LabVIEW PID block expects Integral Time in minutes, and not an integral gain).

  • Create a NI based PID control system? Advice?

    I need to make a new PID control system using labview. I have a magnetically levitated shaft, spinning at 80,000 RPM and is subject to axial loads.
    It is a pretty simple. One axial input, one output to an amplifier.
    I need it to be fast, dynamic and stable.
    Does labview have these capabilities? I suppose I would need to scan the one input channel continiously, and be continuously writing a PID derived control signal which would need to be smooth, obviously not notchy.
    What hardware has the capabilities to read and write continuously and have the speed i require. I suppose 20khz input would be fast enough.
    I have a current sytem that died on me (motherboard failure) but the computer which is a 486!, the card, the software are all SUPER old, and no one knows how to use it anymore. The DSP card company has been purchased several times and is totally unsupported.
    So:
    What hardware do you recommend?
    What software? LV + PID toolkit?
    Anything else?

    FPGA is a reconfigurable logic, I can describe it as a kind of "programmable hardware", in the sense that the actual chip is defined in a high level description language, which define connections between logical block of the FPGA. Of course, you can find better definitions on wikipedia, i guess....
    Anyway, you don't need to care about how does it works: it matters that these devices are used in real-time, reliable acquisition.
    Real-Time is expensive, but consider that you can get discounts buying NI Developer suite, possibly buy one that includes Real-Time and PID module, check your country's sales representative.  In my company, we bought NI Developer suite "Control Edition", but it was about 2 years ago, nowadays, I don't know what similar product is offered by NI...
    Yes, since cRIO is meant for reliable DAQ, it can do continuous sampling 24/24, 7/7.  Only take care to write a reliable software in labVIEW!
    Hope it helps.... have a nice day!
    graziano

  • PID control of Counters (PWM)

    Hello everybody!!
    I work on a closed loop PID controlled problem (Labview 8.5) and I have a couple of questions in order to make some progress!
    Firstly, I have to declare that my loop is composed of 2 AI channels (2 accelerometers), 1 AO channel (excitation channel-shaker), and 2 CO (for pulse creation PWM-controllers). The idea is very simple. When the AI (channel 1) value surpass or underpass a predetermined threshold value, then the appropriate CO should be activated in order to apply the necessary control forces and simultaneously to copy my data values of both AI channels in binary style for CPU velocity reasons! BUT, with the PID controller I want to optimize the Duty Cycle value of the pulses!
    My questions are :
    1) Why when I put Kp=Ti=Td=0 ( = run WITHOUT control) I can copy ALL the AI samples and when I start to activate the PID controller (let’s say for only Kp=0.5) I CAN’T copy ALL the AI samples? Where is my fault?
    2) About the PID vi which I use, is it correct or I should use the PID vi for ARRAYS?
    3) And finally, about the Boolean statement just before the Case Structures and the Shift Register, is it ok/necessary?
    I attach two vis, the ReadBinar .vi is used to read my binary files generated in the end of running of the Control.vi.
    Best regards
    Grigorio
    Attachments:
    Control.vi ‏277 KB
    ReadBinar.vi ‏162 KB

    Hello Zach!
    First of all, I want to thank you for your kind interest on my problem!!
    I must describe you the desired process with the Control.vi. There are two AI channels writing down the acceleration of a structure in two different points (for velocity reasons I use Binary Type storage for my data). One AO channel for structure sinusoid excitation (shaker) and two CO channels for controlling two solenoid valves with which I want to control my structure acceleration (minimize it as well and fast as possible)!!
    In order to help the description, let’s ‘cut’ the block diagram of Control.vi into three pieces (Before While Loop – Inside While Loop – After While Loop).
    In Before While Loop section, the main question is about simultaneousness. The DAQmx Start inside the Flat Sequence Structure, do you think that is necessary, ok? I want to run my experiment for 30s and to collect 6000 samples with 200 samples/s. In addition, in the CO DAQmx timing, I have set 200 samples/channel in order to be able to change the duty cycle value because of the conditions inside the While Loop. Do you think that everything in this section works well? 
    Inside the While Loop, firstly in the DAQmx Read, I have set 200 samples per Input Channel, which is also equal to the AI and AO Sampling rate! Before some days I have put there -1 and unfortunately the total written samples were less than 6000!! My main problem is how I can check all the read data without losing run velocity and simultaneous if one sample is >0 then it goes further to the first PID.vi (left solenoid valve) or if that sample is <0 then it goes further to the second PID.vi (right solenoid valve)!! When a sample has gone to a PID.vi, then I want to tune the duty cycle of the controller (PWM control) as well as possible in order to achieve the Setpoint value for the second AI channel. Are all these possible? If not, what do you suggest me?
    In addition I compare the present duty cycle value with the previous one in order to be inside a tolerance value (let’s say 0.1). Moreover, is it correct the Case Structures where I want to share the positive and negative AI samples before going to the respective PID ?
    Finally, After the While Loop, I believe that everything is OK. I just finish all the tasks.
    I have to mention that I work on a PCI-6289 and Labview 8.5.
    With best regards!
     Grigorio
    Attachments:
    Control.vi ‏288 KB
    equal within tolerance.vi ‏9 KB
    ReadBinar.vi ‏163 KB

  • I am looking to control a 4-way hydraulic solenoid valve. Do I need a PID control toolset, or can i control the system through my 16E4 daq card and scxi chasis

    I am looking to control a 4-way hydraulic solenoid valve. Do I need a PID control toolset, or can i control the system through my 16E4 daq card and scxi chasis

    I think you're asking 2 different questions.
    The PID control toolset is for using PID loops for control; it's just software.
    The DAQ card and scxi chassis are hardware. If you have the appropriate signal conditioning cards in your chassis to control/monitor your solenoid valve, then you can run a PID loop.
    I believe the simple answer is: the PID control toolset is the best way to do control, but there are simple PID VI's (even on this website) that you can download and use for simple control.
    Mark

  • How to do you control lower levels from the Stage?

    How to you control lower levels from the Stage?
    I have a button on the main stage and I have a symbol that has another symbol inside that I want to control that timeline or label.
    I have had success with going one level deep but not two or three deep.
    sym.getSymbol("symbol01").stop("label01");
    Any help would be great!
    Thanks.

    Can you explain the hierachy of your symbols? By this I mean, name of your symbol and any symbol inside and any symbol inside nested symbol and what event you are triggering from where?

  • PID control in a windows CE Labview application

    Hi there,
    I want to build an application that will control the temperature in some ovens, using PID control. The application will be running in a controller (or a touch panel computer) with windows CE OS. I have Labview 8.6, PID control toolkit 8.6 and Touch panel module 8.6. The problem is that the PID vi's don't seem to work in touch panel module. 
    Is there any way to implement PID control in a windows CE Labview application?  
    Thanks in advance.
    Solved!
    Go to Solution.

    I think with a timed loop you can run reasonable good timing down to 1 mSecond. I think 1 mSecond is the lower limit for non realtime systems like Windows/windows CE. And if you have the PID toolkit this will supply you with the functions you need. You do not need an extra CE PID toolkit. This because  the touch panel module run under your standard Labview environment. But I do not know if all the functions in the PID tool like fuzzy logic are compatible with CE. Have you also considered Windows Embedded as OS for your module. With windows Embedded you can run standard Labview built exe files
    Both Windows Embedded, and XP Embedded can be trailed
    http://www.microsoft.com/windowsembedded/en-us/products/westandard/default.mspx
    Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
    (Sorry no Labview "brag list" so far)

  • Steps to create vi file for PID control in 8.0 pro without specific PID addons.

    Per my other posts, I am testing a friend's software to see if this is what we would like to use.  I would prefer to use their software for our initial work to help offset the cost of the software.  Problem is their software is 8.0 pro without the extra PID stuff.  I am curious how one gets started creating a custom PID algorithm to be used in series between an input and an output.  I have viewed several tutorials but all seem to simply point at the PID toolkit that is not availalbe to me right now.  I realize it might be more work to create one but probably the only option at this point. 
    To simply the process, lets just compare a single input and output where the software will control the output to obtain to desired input.  in  tutorial, I was following right along until the PID loop was added and that seems to be just a drop and go type of deal in which would rarely apply to a real work application. I am simply trying to learn how PID systems are written into the block diagrams.  
    Hopefully my question makes sense.  

    asdfs wrote:
    Per my other posts, I am testing a friend's software to see if this is what we would like to use.  I would prefer to use their software for our initial work to help offset the cost of the software.  Problem is their software is 8.0 pro without the extra PID stuff.  I am curious how one gets started creating a custom PID algorithm to be used in series between an input and an output.  I have viewed several tutorials but all seem to simply point at the PID toolkit that is not availalbe to me right now.  I realize it might be more work to create one but probably the only option at this point. 
    To simply the process, lets just compare a single input and output where the software will control the output to obtain to desired input.  in  tutorial, I was following right along until the PID loop was added and that seems to be just a drop and go type of deal in which would rarely apply to a real work application. I am simply trying to learn how PID systems are written into the block diagrams.  
    Hopefully my question makes sense.  
    Take a look at the PID Control Toolkit User Manual . It clearly defines the math used and there is absolutely nothing stoping you from writing that code yourself.
    What you will not get by doing it yourself is the auto-tuning as well as all of the supporting and helper sub-VI along with the polymorphic versions that will support arrays of PIDs.
    If you write it yourself and it work good please post up your version for others to review or use.
    Have fun,
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How to apply notch filter in the PID control

    Dear all,
    I am using PID control in my positioning stage but the output is every noisy with some fixed frequencies(30,50,150Hz). I want to add a notch filter to take off those noise. However, I do not know how to apply the notch filter to the PID module. Could anyone tell me how and show me example if you have?
    Thanks
    best
    Attachments:
    PID_notch filter.png ‏21 KB
    PID_notch filter.png ‏21 KB

    Hi LYnn,
    I am sorry for my late reply. My stage is driven by a voice coil actuator (VCA). The VCA as a resolution of 1 um and range of 6 mm. The NF of the stage does shift when the load is changing. Do you have any advice for controlling such kind of stage?
    BTW, as far as I see, the control frequency is determined in the DAQ Assistant settings and its value is equal to "Sampling rate"/"Samples to read", am I right?
    Thanks
    best
    Attachments:
    VCA stage.png ‏160 KB

  • NI Robotic starter Kit DANI PID control

    Hello
    I have this great kit and interested to do a kind of research of PID control on the two DC motors.
    I already saw links that can do this job but I noticed that I can not find any technical datasheet having the motor paramters ( Mechanical or electrical)
    I plan to bulid a tranfser function usig these paramters and then design a PID controller to make a speed control.
    I searched the internet for the datasheet for these motors and could not find.
    I think I should use a system identification for these parameters...so the question is
    Is it possible to do any experimental system identification for identification of the DC motor parameters without deassebling them from the kit???
    and how to do this job using labview??
    if any has the datasheets for these motors (TETRIX DC Drive motor, part number 39083) it will be helpful  ...
    Thanks
    A.Hakim

    Hello ShishKeBobby
    Thanks for your reply, but realy these information I knew, I need more information like a datasheet for this DC motors concerning the electrical and mechanical parameters.
    I searched for the tetrix DC drive motor, part no. 39083 on pitisco web site but I could not download the datasheet.
    these are the information I need
    Motor constants (KT, KE)
    Motor internal resistance (Rm) and inductance (La)
    Motor friction (viscous friction)
    Interia (J)
    , thanks 
    or I am thinking to get these parameters by system identification but I dont know how without disasseblying of the dc motor from DANI and having a benifet from Labview and the assembled Morors in DANI.....
    what you think?
    Thanks for help
    A.Hakim

  • What is the T-code to see the stock at tank level?

    What is the T-code to see the stock at tank level?
    Regards
    S.Senthil

    Hi Senthil,
                    In Order to Overview the stock at tank level do the following:
                1. Tcode-   O4_TIGER
                2. In the screen launched set the 'Transaction' Field as 'Stock Overview'.
                3. In the 'Pre selection' frame, enter the Storage Location and the Seq. No (Tank ID) details
                4. On execution you will get to see a Report. Refer to the 'Corr. Book Stock' column for the available stock.
                5. If there are more than one materials assigned to a tank. Click on the line item of the Report to see the break up materialvice.
    P.S: To fine the seq No of the tank use tcode 'O4NA'.
    Please let me know if this has helped you.
    Regards,
    S. Satish

Maybe you are looking for

  • Passing Parameter to XSL document (in XDK forPL/SQL)

    Here i' trying to pass parameters to my XSL document.But the value is not getting populated in the final document, can anyone help me on this.,.? // This is how i 'm passing parameter value to the XSL xslprocessor.setParam (styles,'p_batch_name','bat

  • Mass cancellation of invoices Posted in MIRO and FB60

    Hello, Because of wrong VAT customizing in OB40, i have several invoices posted to wrong VAT G/L Account. Now the user need a solution to correct this situation. I proposed FB08, F.80, MR8M but this is not a good solution for the user because, if i r

  • Regading cond base value

    Hi, when we create a sales order, from where the condition base value is populate in an condition type?

  • SSL error when friends of friends also submit PDF form

    We've sent a PDF form out into the wild. It sends back data correctly on the first time that the form is submitted. But when second-generation respondents try to submit, my contacts are reporting SSL errors. Is there a way that the PDF can be safely

  • My ajax appliction only not working in http mode

    My testing page works in local mode such as C:\Inetpub\wwwroot\ajax_test\mypage.html but if I try in http://machinename/ajax_test/mypage.html, it doesn't show any records. Any clue? Thanks Riverboat Here is the code: <!DOCTYPE html PUBLIC "-//W3C//DT