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

Similar Messages

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

  • 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

  • Labview PID control for virtual CNC lathe

    i am currently in my third year at UMIST, on the Mechanical Engineering (MEng) course. I am designing a control system for a miniaturised CNC lathe for my 3rd year project. For integration between the computer and actuators, i am planning on using Labview 7, but am currently having problems learning how to utilise the PID control toolset to create a virtual system response. I am planning on being able to input a specific transfer function for, say, a DC motor, and a ramp input, for example, and being able to view the output response as i vary the P, I and D gains. Some help with regards to the block diagram set-up for such a system would be greatly appreciated.

    The best place to look for this kind of information is the shipping examples of LabVIEW. Open LabVIEW >> help >> find examples. Another good place is online. Go to Advanced Search and look in the example programs.

  • 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

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

  • 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

  • Toolkit for feedback system? Motion; PID; Control/Simulation???

    Hi, I have to develop/program an organ bath system - a feedback system mimicking real sinusoidal breathing oscillations (shown in attached images). I have NI Labview 8.5, NI-Motion 7.6, a linear motor (M-235 DC-Mike actuator), an MID-7654 Servo Power Motor Drive and a pressure transducer. I believe I will need to control the PID controller and am aware of the PID Control Toolkit as well as the Control Design and Simulation Toolkit for NI Labview. However, is it possible to control the system using the NI-Motion software I have at the moment? If not, do I have to purchase both the PID and Control/Simulation Toolkit or just one? Thanks in advance...
    Attachments:
    feedback design1.JPG ‏25 KB
    feedback system1.JPG ‏42 KB

    Dear Garry,
    Do you have a motion controller to interface the MID-7654 to your
    computer and LabVIEW? This would be the PCI-734x or PCI-735x. If you
    do, I believe that you could implement your application with LabVIEW
    and NI-Motion. You could do so by using the analog feedback feature for
    the control loops for each axis. Then, you could specify the optimal
    sinusoidal moves/pressure patterns that mimic real breathing patterns.
    The analog feedback from your pressure transducer will be used during
    the move(s) to maintain the pressure that you want.
    Please see Chapter 13 here for more details:
    NI-Motion User Manual
    http://www.ni.com/pdf/manuals/371242c.pdf
    Here is also a good discussion forum post on Analog feedback:
    Can i use NI-7358 to implement a hybrid position force/torque control system?
    http://forums.ni.com/ni/board/message?board.id=240&thread.id=2976&view=by_date_ascending&page=1
    I believe that the above option would work for you, and you would not
    have to use the Control Design and Simulation Module or the PID
    Toolkit. Please let me know if you have any additional questions. I
    haven't actually set up a system with analog feedback from a pressure
    transducer before, but I believe that the above would be a very viable
    option.
    Best Regards,
    ~Nate

  • PID control in FPGA

    Hi,
    New year wishes to all.
    the Pid control block of FPGA(I think even in windows), LabVIEW is differentiating the Process variable instead of differentiating the error, Is that same?
    Regard,
    N. Madhan Kumar.
    Solved!
    Go to Solution.
    Attachments:
    pid Conventional.gif ‏1 KB
    PID in Labview.png ‏3 KB

    I don't have the control design / PID toolkits installed at the moment as I rarely use them nowadays but when I last did it, I ended up implementing my own. This should be a good starting point:
    It is about as basic of a parallel PID implementation as I can come up with (for Windows - hence the doubles, if on the FPGA you'll probably be using floats). You may wish to extend to allow the controller to reset (as per the LabVIEW implementation by reinitialising the shift registers).
    I've attached the VI (LV2012).
    Certified LabVIEW Architect, Certified TestStand Developer
    NI Days (and A&DF): 2010, 2011, 2013, 2014
    NI Week: 2012, 2014
    Knowledgeable in all things Giant Tetris and WebSockets
    Attachments:
    PID.vi ‏13 KB

  • 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 motor DC 12v

    Hi everyone,
    I wanna control a 12v DC motor using PID control toolkit 8.2.
    - a close loop control system
    - using a DAQ model: NI USB-6008
    - how do make a DC motor speed control 12v with PID control
    Im stuck at getting pid.vi and i wanted to know what is the problem.
    pls help me on my problem, if can pls make an example VI for me
    Thanks !
    Solved!
    Go to Solution.

    Well there are a lot of things you need to do this, LabVIEW software being only a part. Firstly, most DAQ cards will not source sufficient current to actually power a motor, particularly a USB6008, so you will need some form of amplifier/power driver. For closed loop you will need some feedback to tell you what the motor rotation is, usually a slotted wheel with a LED and sensor (if this is a project for school or hobby one source you might look at is an old wheeled mouse). So with these two you have a way to drive the motor and then detect its motion. Then you can get to the idea of doing PID, which is taking the feedback (from whatever sensor you end up using) scaling it to match whatever you are using, and apply it to one of the PID equations to get it to match the target value.
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion

  • Real-time PID control and continuous buffered acquisition. Does it work together?

    I use the "real-time PID control.vi" that acquires single AI point and generate single AO point in every "while loop" iteration to control a piezo actuator motion. Simultaneously I need to do (in another loop) a continuous buffered acquisition of another two AI channels (in the same rate as first AI channel).
    It does not work together.
    Does anybody know how to fix it?
    Platform: LabVIEW 6.1
    Board: PCI-6024E

    Hi,
    I would try to avoid the idea of using a separate loop since the PID
    loop is a continuous acquisition and will require un-interrupted access
    to the Analog DAQ system of the board. The last thing it needs is for
    you to attempt to start other AI functions at the same time.
    Configure your AI in the PID loop to read in multiple channels (Just add
    some more channels to the Input Channels Control. Separate the data as
    it comes out of the AI single Scan function using Index Array or other
    Array functions into that needed for the PID and that needed for your
    other data (the example is already doing this to make sure it only gets
    1 channel of data into the PID). If you don't need to sample all your
    channels of data all the time you can throw some data away as
    required.
    Obviously your other channels are now arriving one sample at a time so
    if you might need to build an array, insert into an array or use Auto
    Index on the loop if you are data logging.
    Regards,
    Dave R.
    varmih wrote:
    > I use the "real-time PID control.vi" that acquires single AI point and
    > generate single AO point in every "while loop" iteration to control a
    > piezo actuator motion. Simultaneously I need to do (in another loop) a
    > continuous buffered acquisition of another two AI channels (in the
    > same rate as first AI channel).
    > It does not work together.
    > Does anybody know how to fix it?
    >
    > Platform: LabVIEW 6.1
    > Board: PCI-6024E

  • 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

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

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

Maybe you are looking for