Simple PID Control

Hi there,
I'm using an old version of LV, LV 6i to be exact. Now I am constructing a simple PID control to control temperature of a room. I am using NI PCI-6024E as my DAQ card. But, in the middle of trying to get the program right, I stuck at the PID control. I am using the "simplePID".vi, and connect everything that necessary, the high and low limits, the parameters (P, I, and D), setpoint, take subVI "Temp".vi and connect to process variable and the output of the "simplePID".vi to a chart.
The problems occured when I am running the program, the temperature did give readings like normal, and i set the setpoint and limits, and also the parameters. But it seem like the "simplePID".vi did not responds to these values. As the program is running, i clicked on the "simplePID".vi and see that the value of the parameters inside it doesn't changed to the values that I set earlier. Why is this happening. Am I missing something important.
I attached the pictures and my VI for your reference. Thanks in advance.
Solved!
Go to Solution.
Attachments:
29092012.vi ‏32 KB

Apparently, in the Execution tab, the only option ticked is "Auto Handling of Menus at Launch", and i unticked it, try to run the program, and it worked.
Thanks so much for helping me to figure this out
I have another question, do my DAQ card (PCI-6024-E) can be used with any LV program, the latest or the old versions?
and can it be used with trial version of new LV?
Thanks!

Similar Messages

  • 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.

  • How can I use the output value from SIMPLE PID to write something to the serial port?

    I am working on my Senior Design Project that requires the use of incoming compressed air, propotional valves, continuous servo motors, and a serial servo motor microcontroller.  I have figured out how to send byte sequences to the microcontroller through LabVIEW using the VISA serial write function.  The motors are attached to the valves to control the flow rate.  I have created my own simple feedback system using a bunch of case structures but I realized that I am basically trying to recreate the wheel (I basically was writing my own PID VI).   I have an older version of LabVIEW (7.0 Express) and theres no way to upgrade or buy the PID toolkit, so I am stuck using the Simple PID VI.  Also, the only way the motor works is sending an array of bytes to tell it to turn on/off, direction, and speed.  Is there any way I can use the Simple PID VI in conjunction with the VISA SERIAL write function, or is there any other way I can communicate with the serial port using this pid vi?  Any information would be appreciated.

    Hi gpatel,
    you know how to communicate to serial port, but you don't know how to send a value from SimplePID to serial port???
    You know how to communicate, but then you don't know how to communicate???
    You should explain this in more detail...
    Edit:
    From you first post you know what values your motor driver is expecting. You know which values the PID.vi is providing. Now all you need is a formula to reshape the values from PID to the motor. It's up to you to make such a formula. Unless you provide any details we cannot give more precise answers...
    Message Edited by GerdW on 02-28-2010 08:35 PM
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • 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 can I make and wire reffercence signals(ramp,sine,square) to excite and evaluate the behaviour of the system wih PID control?

    Dear all,
    I am Tri, I am a beginer with LV program. Actually I used LV for my reasearch, I had tried wiht very simple thing but the problem arise because I am not familiar with LA. Why I know that problem is simple because I compare with MatLab that I had somtime used before.
    I make a loop of PID control, It worked properly but I don't know how to make a refference signal to wire to the loop for excitating to evaluate the behaviour of the system. Please give me your help.
    Thanks

    Hi Tri,
          I've employed the "simple PID.vi" without a problem, but your example is more complex.  I think you use a Function generator to modulate DAQ inputs?
    Perhaps someone else will be able to infer your intention and identify a flaw in the logic.
    In case someone else wants to run your VI, it may help to build/attach an .llb (some sub-VIs are needed by the VI you atached.)
    To build the .llb, save your VI with Development Distribution options (Alt-F,Alt-W) and attach the .LLB
    1) \File\Save with Options
    2) select Development Distribution
    3) Save
    4) choose "New VI Library"
    But first, It would be helpful to us if you clean-up the code - straighten wire-paths, minimize bends in wires, and try to avoid "tall" diagrams.  Scrolling diagrams up and down is "bad form".  If scrolling is necessary, left&right is preferrable!
    Cheers.
    (and, for the record: in my previous post, Exitation would be wired to "Process Variable", Not "Set Point" (ouch!))
    When they give imbeciles handicap-parking, I won't have so far to walk!

  • Basic PID control for LabVIEW 7.0

    I am trying to find the basic PID control VI in my LabVIEW pallet. I thought that there was some PID VI's in 6.1 but I can't seem to find them in 7.

    Hi Dan,
    I don't think we ever put the simple PID in the pallet. However, if you'll run the NI Example Finder (Help>>Find Examples...) and search on PID, you'll find examples that use the simple subVI.
    Best Regards,
    Doug Norman

  • PID Control Labview 7.1.1

    Hello, I have successfully created a PWM controller for my application
    and built a simple proportional controller into creating my pulse width
    output.  This got rid of the basic "drifting" problem of my device
    output but now a new problem concerning steady state error has arisen
    where the output is offset from my set point.  To combat this
    problem, I have heard that I should also implement integral control
    into my algorithm.  Looking through the daqmx examples, it appears
    to me that all the example PID vi's contain only P controllers when I
    looked at them more closely.  For traditional daq, I found a
    complete P, I, and D controller and was hoping to find something
    similar for daqmx.  Does anybody know of any example vi's online
    or if I am not looking at the packaged examples correctly?  Any
    help would be appreciated.  Also of note is that my setpoint is
    also changing slightly in real time.  I don't know if this has
    significance for more advanced controllers, but I thought I should
    mention it.
    Thanks,
    Nick

    Hello Nick,
    You can pretty much take the simple PID.vi from the traditional DAQ example and plug it in place of the P controller in the DAQmx examples. If you do the PID toolkit for LabVIEW, then it has a set of PID VIs that you could use.
    I am sure you know PID, but I have included a link on PID below.
    http://zone.ni.com/devzone/conceptd.nsf/webmain/D4748F0D59CF436D8625702700809EF4
    Also, please take a look at the 'NI Ready-to-Run Controls Starter Kit' which has executables and VIs for PID applications with our DAQ boards.
    http://zone.ni.com/devzone/conceptd.nsf/webmain/B238B02B04369A0386257028001A7B3A
    Thanks,
    Arun V
    National Instruments

  • Mult-channel PID control using PID Toolkit

    I am controlling the light level in six locations (zones) using light sensors, dimmable ballasts (which respond to a 2 to 10 VDC signal) and the PID toolkit.  In my VI, I loop through 6 times (once for each zone) to control the light levels.  I use the simple PID.vi to determine the next setpoint for the dimmable ballast on the lights.  My problem is as follows, I think:
    The PID algorithm uses past response and the current difference between the measured variable and the setpoint to calculate the next setpoint.  If my understanding is correct, then I am confusing the PID algorithm by calling it with 6 different data sets.  It is almost as if I need 6 separate PID functions, one for each zone. 
    Perhaps I am wrong about the operation of the PID algorithm.  Can someone straighten me out?
    Attached is a snapshot of the VI.  The FOR loop goes from 1 to 6, that is, once for each sensor zone.
    Message Edited by rgentry on 04-29-2007 09:11 PM
    Attachments:
    temp.jpg ‏92 KB

    rgentry,
    The PID has two modes of operation: Single Channel and Muti-channel. The way you developed your algorithm, you are using single channel algorithm with multiple setpoint and variables. This will not work properly since LV will not keep the internal states correct for each channel.
    To fix this, it is pretty simple. Remove the For Loop and provide the whole 1D array to the PID.vi. This will enable the "multi-channel" mode and every time you call your VI, it will keep the internal states for each channel, as if you had 6 different PIDs in parallel. Notice that the interpolation also will work the same way, you just need to remove the build array primitive.
    Hope this helps!
    Barp - Control and Simulation Group - LabVIEW R&D - National Instruments

  • Throttle body PID control using pulse width modulation

    Hello all,
    I am trying to do a PID control for a throttle body (using pulse width modulation) for a set value of feedback voltage. The process variable is the pulse width duty cycle. The throttle body is expected to be fully open at a feedback voltage of 5V and pulse width duty cycle of 42.5%.  When I use the highlight execution using the attached file, I can see the throttle body fully open (the values observed are: PID output 42.5 %, feedback voltage approximately 4.7V). However, when the highlight execution is unclicked, the throttle body flutters in the closed condition (still PID output 42.5%, feedback voltage approximately 0.9 V). Can any one please help by suggesting any modification to this attached file to make this throttle body respond to the set value of feedback voltage.
    Many thanks 
    Ajith
    Attachments:
    Throttle body control using PWM technique - PID.vi ‏525 KB

    How did you determine your P, I, and D gains? If you have not tuned your controller, you'll get poor performance. Running with execution highlighting will slow down the execution, which will change the effect of the gains. I would start with pure proportional control (I and D = 0) with a small proportional gain, and see if it responds in approximately the way you want. If so, then your code is probably correct, and you just need to do a full tuning to get good performance. There are many resources available on the web, on this forum and elsewhere, for PID tuning. Note that since your code uses a simple PID example, and not the one from the PID toolkit, the gains do not have the units that are used in many tutorials so you'll have to correct the calculations to compensate.

  • Real-time pid control

    Hi,
    I found a real-time PID control in LabView examples, for E Series boards. I used one of this boards a time ago and used this control. It works very well.
    Now, I have a M series board (PCI-6221, LabView 7.0) and I would like to use a similar program. I tried to use the DAQmx assistant and look at the examples, but I did not find anything similar.
    Could you please take a look in this example (attached) and help me in configuring the PCI-6221 to work in similar way?
    I really apreciate your support.
    Thanks,
    Jeferson
    Attachments:
    Real-Time PID Control2.vi ‏131 KB
    simple PID.vi ‏53 KB

    Jeferson,
    I no longer have LabVIEW 7.0 on my machine, but I know that in LabVIEW 7.1, DAQmx installs an example called "PID Control-Single Channel.vi." This should be exactly what you are looking for. It can be found in the LabVIEW Example Finder (Help->Find Examples) by searching for "PID."
    Basically, this VI uses hardware timing (the rate will depend on your computer specifications) to acquire a single point, calculate the PID output, then output that value on the next sample clock.  Please let us know if you have any additional questions!
    Hope this helps,
    Ryan Verret
    Product Marketing Engineer
    Signal Generators
    National Instruments

  • 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

  • Error in Simple PID

    The LabVIEW supplied "Simple PID" vi contains an error which disables the Integral function. The "First Call?" node is located outside of the main loop and is therefore only evaluated once. Consequently, each time around the loop the value selected for "prev error sum" is always 0. Moving the "First Call?" node to the inside of the loop cures the problem.

    I have run this VI, and it performs as it is supposed to with the first call node outside the main loop.
    This VI is meant to be inserted into a while loop. Its own while loop is only there to retain the previous values (in the shift registers); it doesn't execute more than once on its own.
    By placing the entire Simple PID.vi into another while loop and running, you'll see that the first call node works properly.

  • 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

Maybe you are looking for

  • IPad 2 crash/freeze

    Was watching a movie (fully charged battery) then screen goes black. Apple logo shows up and just sits there. Difficult to restart. Any one with similar problem? Using 4.3.3 but it also happened with 4.3.2

  • IOS4.01 Problem

    I have an iPhone 3GS and recently upgraded to iOS4. Yesterday I downloaded the latest upgrade to the OS (the one with the signal strength fix) and now my phone cannot find my network. I am in the UK and subscribe to the Orange UK network. Does anyone

  • Building a GUI in SharePoint 2013

    I'm planning on building some business processes that use SQL as the data source and allow SharePoint 2013 users to interact with the data. I'm not sure how to give the users a GUI inside SharePoint. I can use InfoPath, but that's more for the data e

  • End user spam notifications

    We have stand-alone EOP with on-prem Exchange. We have not created any user accounts in Office 365 yet (we are getting around to it later). Will end users receive spam notifications when a message goes to the quarantine if they do not have a user acc

  • I cannot play videos on youtube

    I can't seem to watch videos on youtube. When I try, I'll get the little advertisement thing, but once that's over and it's supposed to go to the actual video, all i get is a black screen. When I right click on it I get 'Movie not loaded...' but it's