PID control for a sinusoid

Hello,
I have written a program that takes a reference signal, and then uses a
proportional control to synthesize a similar signal in a wire coil. I
modulate the duty cycle of the counters of a PCI 6224 card. One counter
goes to  the positive side  of an H Bridge, and the other to
the negative. I'm getting decent results for reference frequencies of
about a hz, but if I go below that I start seeing more interesting wave
forms (the funkiness appears when the waveform crosses zero). I am
questioning whether adding integral or differential controls are liable
to improve matters given the time dependence of the system, and how to
best apply them if appropriate.
Attached are my program and the results it gives for several
frequencies. Most of the missing VIs are those that record the data to
file. The other is the proportional controller from the PWM Counter
Output example, taking the reference signal as its setpoint. (It also
adds .5 to the duty cycle from the P output. If at the setpoint, I want
the current in the coil to remain constant)
Thanks,
Elliot
Attachments:
Amplifier.vi ‏229 KB
generated waveforms.pdf ‏57 KB

Hey, are you using the PID toolkit in LabVIEW?  If so, this link: http://www.ni.com/pdf/manuals/372192a.pdf, discusses using interregnal and derivative terms.  It is possible that your system just can't do frequencies below that.  Personally, I have found the best way to figure this stuff out is to just try.  Also, consider using the PID gain scheduling VI.  This will let you have different P, I , & D terms based on an input.  I have found that a very useful tool.
Hope this helps!
Dan
Daniel Eaton
National Instruments
Systems Engineering
Embedded and Industrial Control

Similar Messages

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

  • I need to maintain a temperatur​e profile for my process.Ca​n i use PID control for this applicatio​n?

    Hi all,
    I need to maintain a temperature for my process.Can i use PID control vi's for this application?
    I have NI-PCI 6023E DAQ board.Should I need any other hardware components???
    Any help in this regard is highly appreciated.
    Thanks,
    radhika

    Hi,
    Thanks for your reply.
    I do have a temperature sensor and it is read by the DAQ (NI 6023E) .
    Also i have a voltage input to the program which has to be controlled in order to control the temperature.
    So , I am using a PID , the output of the PID should control the Voltage input so that the temperature is controlled.
    Can I give the  voltage input and the temperature  to the PID through the DAQ and  just use one more channel in the DAQ to get the output from the PID.Will that work???
    I am not sure why you have mentioned SC2345,SCB68.
    Thanks,
    radhika

  • PID control for student 2010 edition

    Hi I need to get a pid controller for a project i am completing in college , is there a pid controller that can run on this verson of labview ??

    PID Controller is nothing but a mathematical calculations. My suggestions is stretch yourself and try duplicating the PID contollers into LabVIEW.
    The best solution is the one you find it by yourself

  • 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

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

  • I have a big delay in my real time pid control

    hi ,
    since i don't have a digital input module i tried to use the serial port RS232 on my Crio to read the data from an absolute encoder in order to perform PID control for  a dc motor, but the problem is that the data took too match time to be read; there is a big delay between the first read position and the next one,and when i change the slide controller the indicator took time to change, although it should be instantinouse, here is
    a snapshot of my vi. 
    please i need help.

    Hi Moho,
    Looking at your code I see a couple of things that might be causing the issue. How long is the delay that you are experiencing? You are trying to transfer 2000 bytes every loop which will cause some delay. You also have a lot of mathematical operations that can take time between loop iterations. Also what is the VI that you have manipulating your waveform? Have you looked into the PID VIs?
    Scott B.
    AE NI

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

  • 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

  • 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

  • Looking for a reasonable looptime for my PID controler!!

    Good morning!
    I am trying to do a PID control of a combustionchamber.  The setpoint and process value are the output  temperature, the value to  operate  is  the massstream of  the fuel.  My  in- and output datas are refreshed every 50 ms.  My problem is...
    What is a reasonable looptime for my PID control? 
    Do you have any ideas???
    thanks RT

    My group has used the Sun Electronics PC-1000 Process Controller for some time, with good results. There are some instructions in the beginning of this Engineering Note (pdf link) that discribe how to iteratively determine the PID coefficients for a linear system. I'm not a mathematician, so I can't vouch for whole document, but their somewhat antiquated instruments DO work
    Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
    If you don't hate time zones, you're not a real programmer.
    "You are what you don't automate"
    Inplaceness is synonymous with insidiousness

  • Why do I get this error when running the PID Control-Single Channel.vi: "Requested value is not a supported value for this property."

    Error -200077 occurred at Property Node DAQmx Timing (arg 3) in DAQmx Timing (Sample Clock).vi:1->PID Control-Single Channel.vi
    Requested value is not a supported value for this property.
    Property: SampQuant.SampMode
    You Have Requested: Hardware Timed Single Point
    You Can Select: Finite Samples, Continuous Samples
    Author: Pcorcs
    Attachments:
    PID Control-Single Channel.vi ‏53 KB

    Actually I have already tried a few things you suggested and got as far as the DAQmx Write vi. The error at the DAQmx was a buffer error indicating i needed to set it to 2 instead of the default of 1. Tried using the DAQmx Input and Output Buffer vi to change buffer, with no luck.
    Attachments:
    PID Control-Single Channel.vi ‏53 KB

  • Best design idea for parallel DAQ (via GPIB), PID control and watchdog system

    Hello!
    I am a starter programmer in LabView, I already understand the basic ideas, and design patterns, like producer/consumer, events state machine, functional global variables, and so on, so the basics...
    I started a project a few weeks ago, and first I wrote and tested all of the necessary subvi-s for my project, like the ones initializing my GPIB devices (a Keithley mux and a dvm), controlling/reading out the measured voltage/resistancy values from them, subvi for my Static Analog Output card (I have to drive 7 analog output channels, 4 has to be PID controlled regarding to some of the measured values from the GPIB devices), and another subvi for the analogue card, sending TTL watchdog signals out to my experiment in every 2 seconds.
    Any idea is welcomed about suggesting the best design pattern for my project.
    The main features of my program would be:
    After starting the user interface the program starts with a start-up state, initializes the DAQmx channels and the GPIB devices. The program starts to read out different values from the GPIB devices, including 4 temperature values in every 3 seconds.
    In the same loop (?), using PID control, the program sets the DC voltage values of 4 channels (3 to heating wires, 1 to a Peltier-heat pump) on the Static Waveform Analogue output card, the remaining 3 values are constants.
    I have to send digital TTL watchdog signal to some relays from the same output card, changing its state in every 2 seconds (not the same rate as the GPIB values are read out).
    When the 4 temperatures and the power values regarding to the heating wires are equilibrated after a few hours, the program goes into another state, and signals to the user, that the measurement can be started. During a measurement, I write out all of the measured values to a TDMS file, and there is also some basic calculations "on the fly", like a moving average.
    After the measurement done, the user can swap samples, and the program goes into the above state, waiting for equilibration . and so on...
    Do you think I should use a Producer/Consumer pattern with events? Or someone would recommend me a better design idea?
    Thanks very much!
    ps.: I read out lots of values from the Keithleys, so I put them in a cluster. I made a small test vi (attached without the GPIB comm subvi-s), just to test the GPIB comm. So this is the recent state of my project. (all other subvi-s tested and ready to use as I wrote above, like the DAQmx output part)
    Attachments:
    GUI_Calorimeter_control_image_v2.vi ‏284 KB

    Okey
    I think it is a better approach if I work first, and after I ask
    I go with small steps. For first, now I just want to make a DAQ analog output loop, and parallel a watchdog loop sending out TTL in every 2 seconds.
    The main loop in my project will iterate with approx. 10-15 seconds.
    I want to check in my watchdog loop, if my main loop hangs up (in that case the PID control stops, but the danger is if the output voltages stay on).
    After some readings, I have decided to use a functional global variable.
    I have attached the vi, can someone give me advice, what would be the good solution for this purpose?
    (I know it is a bit silly what I messed up with the shift registers in the bottom loop, it was some experimenting).
    Thanks in advance!
    Attachments:
    watchdog_funcglobvariable.vi ‏12 KB
    Global 1_stop.vi ‏4 KB
    analog_output+Watchdog.vi ‏57 KB

  • I am looking for Compact RIO system for PID control

    Hi all,
    I am looking for the CompactRIO system for PID control.
    My system acquires two input data (0-10V) from two displacement sensors and sends one output signal (0-10V) to piezo-actuator at every step. And my target is the short settling time and the low overshoot.
    I think that I need fast control system. So I am interested in CompactRIO. But I am not familiar with this sytem. Could you recommend the good control system for me?
    The one important thing is that the time limiting step of my system is Piezo actuator (it's natural freq is 20kHz.) CompactRIO is much faster than the Piezo-actuator. I am not sure whether CompactRIO is good to my system or not.
    Here is the CompactRIO system which I am interested in:
    i) CompactRIO Reconfigurable Embedded System: cRIO-9004
    ii) CompactRIO Reconfigurable Chassis: cRIO-9101
    iii) I/O Module : AI : cRIO-9215 AO: cRIO-9263
    Thank you so much,
    Sungjin

    Hello Sungjin,
    CompactRIO should work great for your PID control system. Those I/O modules are the correct voltage range and the 1M gate FPGA backplane will be plenty for a single PID controller. You'll probably be able to get loop rates around 100kHz for analog PID control.
    Keep in mind that the LabVIEW FPGA module includes PID examples that will cut down your development time considerably.
    Regards,
    Vineet

Maybe you are looking for

  • Problem with Applet for Microsoft VM

    Hi there! I implemented an applet (first for SUN JVM 1.4.1_02) that has to communicate with a servlet via serialized objects. Therefore the applet sends a request and expects the response : //establish connection URLConnection l_con= l_url.openConnec

  • Conncting my PB 12' to a TV

    I am trying to connect my pb to my tv through the mini-dvi to Video Adapter, but the display preferences don't give NTSC/PAL Display (like they should) but rather, VGA Display. What's wrong? I'd appreciate if someone help me Thanx

  • QuickTime Plugins have problems on Windows 7 (64-bit)

    Uninstalling/reinstalling QuickTime did not fix the problem. Still get a script error and no QuickTime ActiveX plugin installed when accessing a web page with the embedded player on Windows 7 Pro 64-bit with Internet Explorer 8 (64-bit). I did more e

  • If the customers treated Verizon like Verizon treats its customers

    Im having a hard time finding words that wont get my post deleted. The past few times ive had any dealings with Verizon should be the traing for how not to provide customer service. On the phone or in the store it doesnt matter its been a bad joke. I

  • 6000 songs out of 7800 disappeared

    I'm using Itunes on my MacBook. When I'm in "Match" View it tells me that my Itunes Library is available on Icloud (7807) Songs. When I switch to "Songs" View it show me only 1.126 items 1.100 of them are in "waiting" Icloud Status, no Icloud Downloa