Jump to content

ShaunR

Members
  • Posts

    4,849
  • Joined

  • Days Won

    292

Everything posted by ShaunR

  1. I think that depends on your point of view. I have used "lazy" instruments before.But generally my design philosophy involves hardware several layers below the user interface, modularised and loosely coupled. This enables me (amongst other things) to bolt on different user interfaces to the same back-end Peculiarities of a device are handled by the modules and/or driver. I re-use many of the modules and wouldn't want to keep putting instrument specific code in to the user interface.
  2. Why do you need to do that? Are you porting to LV?
  3. Before you criticise someone, you should walk a mile in their shoes. That way, when you criticise them, you're a mile away and have their shoes

  4. Aussies: Believe you should look out for your mates. Brits: Believe that you should look out for those people who belong to your club. Americans: Believe that people should look out for and take care of themselves. Canadians: Believe that that is the government's job. Aussies: Dislike being mistaken for Pommies (Brits) when abroad. Canadians: Are rather indignant about being mistaken for Americans when abroad. Americans: Encourage being mistaken for Canadians when abroad. Brits: Can't possibly be mistaken for anyone else when abroad. Canadians: Endure bitterly cold winters and are proud of it. Brits: Endure oppressively wet and dreary winters and are proud of it. Americans: Don't have to do either, and couldn't care less. Aussies: Don't understand what inclement weather means. Americans: Drink weak, pissy-tasting beer. Canadians: Drink strong, pissy-tasting beer. Brits: Drink warm, beery-tasting piss. Aussies: Drink anything with alcohol in it. Americans: Seem to think that poverty and failure are morally suspect. Canadians: Seem to believe that wealth and success are morally suspect. Brits: Seem to believe that wealth, poverty, success, and failure are inherited. Aussies: Seem to think that none of this matters after several beers. Brits: Have produced many great comedians, celebrated by Canadians, ignored by Americans, and therefore not rich. Aussies: Have produced comedians like Paul Hogan and Yahoo Serious. Canadians: Have produced many great comedians such as John Candy, Martin Short, Jim Carrey, Dan Akroyd, and all the rest at SCTV. Americans: Think that these people are American! Americans: Spend most of their lives glued to the idiot box. Canadians: Don't, but only because they can't get more American channels. Brits: Pay a tax just so they can watch 4 channels. Aussies: Export all their crappy programs, which no one there watches, to Britain, where everybody loves them. Americans: Will jabber on incessantly about football, baseball and basketball. Brits: Will jabber on incessantly about cricket, soccer and rugby. Canadians: Will jabber on incessantly about hockey, hockey, hockey, and how they beat the Americans twice, playing baseball. Aussies: Will jabber on incessantly about how they beat the Poms in every sport they played them in. Aussies: Are extremely patriotic about their beer. Americans: Are flag-waving, anthem-singing, and obsessively patriotic to the point of blindness. Canadians: Can't agree on the words to their anthem, in either language, when they can be bothered to sing them. Brits: Do not sing at all but prefer a large brass band to perform the anthem. Brits: Are justifiably proud of the accomplishments of their past citizens. Americans: Are justifiably proud of the accomplishments of their present citizens. Canadians: Prattle on about how some of those great Americans were once Canadian. Aussies: Waffle on about how some of their past citizens were once Outlaw Pommies, but none of that matters after several beers.
  5. What did it do for scripting? Scripting is only useful for tool developers. Those of us that create product have zero use for scripting. Except perhaps the occasional need to automate a few tedious tasks if we find ourselves in a lax minute or 2.. OK just re-read you post...lol. Missed the "we" bit . Yes "you" (as in tool developers) did get it published by NI, but my original point still stands.
  6. In fact. thinking about it..... You don't even need the replace element.
  7. And your reply is that they shouldn't be using un-trained operators But I see what your after. I think you will just have to filter the changes. Although I had a quick look at the slider example you referenced and I certainly wouldn't have done it that way One thing you could do is build an array of the controls that are clicked and the latest value for that control and put that in the on change event case (the same on-change would be used for all controls). You would need to look up the control reference on each click and if it doesn't exist, add it. This is fairly trivial. Then, in the time-out case (set it to a few seconds for example) unwind the array using a for loop and read the control(s) that have changed and send the value to the the instrument(s). If nothing has been clicked, then the for loop won't execute when the time out expires. If some controls have been clicked (the timeout will be reset every click automagicaly) , then they will have an entry and the for loop will iterate through them. Well. That's one way at least. You could also use Cats previous method and start a timer when the user clicks on a control. Then, if the timer times-out,, activate a really annoying sounder (add flashing lights too) and a dialogue box saying "Press The GO Button Idiot". Finally, send an e-mail to the logged in users supervisor telling him that the operator needs scheduling for re-training as he cannot follow simple on screen instructions. I guarantee you will only be called out once late at night
  8. It's a bit like asking "what's a LabView Wire" equivalent in C/C++
  9. HI Cat. Hows tricks? If I understand correctly (which is quite rare) could you use the "mouse leave"event case so that your "send to instrument" function only fires when they move outside the control (i.e stopped clicking and gone elsewhere). The advantage of that is you can attach all your controls to a single event case and use the events control ref to wheedle out the control and value.
  10. Sorry for the delay. Had my own projects that weren't falling and needed kicking into place No need to apologise. I was just trying to let you know that you need to understand what you are doing OK. So you have a 12 digitally controlled motor. That's your design decision Nothing wrong with that, after all we need to keep within budget don't we? I'm assuming you have seen the NI PID Examples and seen that they get a lovely smooth control curve. Right?. Just change the sampling time from 50m to, say 500 m. Does it still look like a nice well controlled curve? What do you see? Remember we haven't changed any PID parameters, or the load we are controlling. Just how often we sample the PV. What do you think is happening here?
  11. Name: Dispatcher Submitter: ShaunR Submitted: 07 Sep 2010 File Updated: 03 Jan 2011 Category: Remote Control, Monitoring and the Internet LabVIEW Version: 2009 License Type: Other (included with download) This is a Publisher/Subscriber implementation of network communications. The package is comprised of two main parts. 1. A Dispatcher that handles connection requests. 2. An API for interacting with the Dispatcher. Overview. Most people are probably familiar with RSS feeds. An RSS feed is an example of a publisher/subscriber implementation, where information is "published" onto the internet and people may "subscribe" to updates using their browser or some other client. A single published service may have millions on subscribers and publish its data every few hours as data changes or periodically, maybe once or twice a day. This package contains a similar implementation where a client "subscribes" to a "publisher", however, it is geared towards high bandwidth data streaming across a local network. So, unlike its internet counterpart, it is not attempting to service millions of clients who require an update once or twice a day. But service a few (maybe 1-10) clients every few seconds or even milliseconds. Detail: The main focus of this package is the Dispatcher which facilitates the publisher/subscriber environment. The implementation can support many network topologies that suit the developers requirements. For example: A single dispatcher may be located on a remote machine and all publishers and subscribers are remote and communicate through it (centralised). Alternatively, there may be many dispatchers on different machines, each with their own cluster of local services and the subscriber connects to the machine that contains the publisher of interest (decentralised). Or even a mixture of both. The implementation is not rigid and allows for the developer to choose the topology simply by installing once or more dispatchers and initiating a connection. An API is provided to enable interaction with the Dispatcher to query its services, request a connection and send/receive data. Additional Features: Supports data-stream encryption (blowfish). Installation: Unzip to a directory of your choice. Required Packages: Labview 9.0 or greater. Transport.lvlib (Included) Queue.vi (Included) Position Form.vi (Included) Stop.vi (Included) Elapsed Time.vi (Included) Known Issues. None. Versioning: Current version 1.0. See changelog.txt. Contact: PM ShaunR on lavag.org (http://www.lavag.org) Click here to download this file
  12. Hmmm. I think maybe I have failed miserably to explain the key concepts. The previous example was to show how you can add a very simple PWM (there is more than 1 type) to an on/off controller that controls a single digital output Cutting and pasting my example and wiring up controls with the same name won't cut it since you want to use a PID controller and not an on/off controller. I'm not doing your project for you, merely trying to show, with he use of examples, how to go about it. The example demonstrates how you can vary a digital output to react a a certain stimulus and since it was available, I used Neds on/off controller . You could, for example, replace the PID VI in the NI example "PID simulator" with the vi I supplied, but you would still have to figure out a method of calculating the duty-cycle on each iteration in relation to the input (which you haven't). You could, however, replace it with Neds example (no mods needed) and see what the difference is to the PID one. I would suggest taking the time to view all the PID examples shipped with the PID toolkit (assuming you have it) and understand the theory. I would even be tempted to rip out the process simulator into another vi and use it to create the step response graph and log the results. Then do my ZN analysis on it to see if I came close to the ones in the example. Then change the process values and repeat. From your project supervisors comment, I think he is expecting an analogue output (or a PWM simulation of an analogue voltage which isn't the type of PWM I used). Is the pump analogue controlled? If it is. What is the reason for using a digital output when your USB device has analogue outputs (And there are many tutorials on Youtube of PID with an analogue output. using LabView) One further point. If your posting VIs that uses sub-vis. Can you put the all vis into a single directory and zip up the entire directory so that all the sub-vis are included. I don't have "On-Off Controller-PWM.vi" or "Simple PID- ViFormyproject.vi". I can guess at what they probably are but its always best to be looking at the same code.
  13. Oppps. Just noticed a feature (bug..it is the wee hours is my excuse) The over set-point check is inverted (sorry about that). This is what it should be
  14. Unfortunately. You have the software, but not the hardware. You need FPGA hardware to run the FPGA stuff on. I only mentioned it to illustrate that NI also have a digital solution. But all is not lost. If you remember back to my example, I said we just need a way to open the valve for a period the PID algo tells us. This seems to be the bit you are having problems with. For the digital output. You already Have an on/off controller example supplied by Ned. But what we really want is a PWM On/Off Controller then it would give us the opportunity to vary the on/off outside the dead-band. PWM always sounds complicated. It really isn't and to demonstrate I've modified Neds example. The bottom half of the loop is Neds on/off controller. I've just modified it a bit so it isn't reliant on the previous iteration of the loop. It's functionally identical. The top half is a timed gate which allows the signal from the on/off controller through for a specified period of time. So now we have an on off controller that we can vary the pulse width in the time domain. And that's PWM. Generally we wouldn't have it all in the same VI and the PWM would run asynchronously to the controller. But for our purposes its actually a bonus. If we set the duty cycle to 100% (note I've used duty cycle and made it a percentage) then it will behave as Neds On/Off controller) then we have our on/off controller back again. If only we could figure out a way to turn the error between the setpoint and the process value into a percentage...... It's unfortunate your hardware doesn't have a configurable counter/timer output otherwise you could have used that.
  15. There are several examples shipped with labview . Use the NI example finder and you will find them under: >Building User Interfaces > Listboxes and Tables
  16. Who? The Prof? Or your colleague? What I meant was that there are certain processes that on/off controllers simply cannot control. They become unstable and oscillate. As an example of an asymmetric system (just to clarify after all.....aren't they all?). I once had an environmental chamber that was convection heated but nitrogen cooled. So. To ramp up (say) 5 °C would take 15 mins at 100% output, but with a 2 second injection of liquid nitrogen the temp would drop by 5°C in about 10 seconds. Especially since some dork had designed the thing with the temperature probe near the injector. What you have to bear in mind is that PID isn't 1 algorithm. Its 3 algorithms cascaded. And you can choose which benefits from the 3 you want to include. You could (for example) use only the P and I terms or the P and D or just the P. Its the flexibility that makes it attractive since there is no "one size fits all" solution for every system. If maths is your forte then I would suggest reading P, PI, PID Control. If (like me) you only want the bullet points and prefer practical examples then try PID Tutorial is
  17. It also gives you the option of running them in different priorities and execution systems.
  18. He who laughs last, didn't get it.

  19. Ahhh. But you can. Consider the lilly a tank that requires 10 litres to fill completely and all we have is a valve that only has 2 positions (open and closed i.e. digital control). Our hypothetical tank is (say) being drained at a rate of 1 litre per minute however, our valve, when fully opened, is capable of supplying 2 litres per minute. If we open that valve for 10 minutes then we will fill the tank to the brim and it all gets rather messy, what with the overspill and everything. However, if we open the valve for 30 seconds, we will supply the tank at the same rate as it is being emptied (on a minute by minute basis). Now. the problem is, in all probability there will be times when there is nothing in the tank (due to timing differences, magic and the law of jam-butty) . So its desirable to open the valve for (say) 40 seconds so there is always more than is being consumed. Ultimately the tank will fill so as we approach the a pre-determined limit we want to switch back to 30 second "pulses". We haven't changed the magnitude of the output (the valve can only be on or off). But what we have done is opened it for more or less time. We have "pulsed" the valve and by changing (or "modulating") how long we keep in open for ( "width" of the pulse), controlled the system and we can all go home . For the above, PID control is simply a calculation (derived from the current level in the tank) that continuously calculates how long we leave the valve open for to achieve and maintain a desired steady state (a level in the tank).. What it gives us is a continuously varying duty PWM signal (which is varying at the sampling rate) , where the period is 1 minute and has a steady state at 50% duty cycle (30 seconds). It doesn't really matter what interface we use to control the valve itself (analogue, digital, a hammer or telekinesis). Just as long as we can open and close it for an amount of time the PID algorithm tells us to.
  20. Nope. Since you are still advocating that the type control interface is implicitly linked to the process. Ovens and kilns, for example, use contractors, SSRs and normal relays, all of which are digital. NI have an example of PWM PID control for their FPGA boards.PID Control Reference Example for LabVIEW FPGA They also have a note on their PID autotune function from the PiD control toolkit which uses a relay PID Autotuning VI and Limitations (it uses Ziegler-Nichols apparently ) But I suppose I'd better answer the OPs original question Choosing PID parameters is a bit of a black art. Manufacturers of PID controllers all have their own algorithms for determining the P, I and D terms (usually called "Autotune") and generally they will be biased to their particular industry and products.. One thing they all have in common though, is that they will analyse one or more step functions as you have seen with the Ziegler-Nichols. But it is worth bearing in mind that this "Autotune" is not a magic bullet. It is a "first best guess" and time will still need to be taken to optimise for the particular process. So. If the manufacturers can't get it spot on for every process. Then I don't think we can expect to. You've read up on Z-N (if its good enough for NI then its good enough to start with eh? ). and its probably time to bite the bullet and see what happens. Use your calculated values and log the tanks (level?) process variable. Start off by using a low setpoint so you don't overfill and inspect the log record to see how much overshoot, ripple and offset there was (you never know, it might be acceptable as is!). You've been wise enough to install a manual valve so if things go really askew you can just shut it off. If you didn't have any problems, Increase the P a large amount and start running for that valve:lol:
  21. PID is designed to control a process to alleviate overshoot, ripple and offsets. It has little to do with the interface. Indeed. First choice is always an on/off controller (they're cheap and easy). But the choice on this type of control depends on whether the process can tolerate overshoot and ripple rather than digital or analogue. Some processes that have significant lag or asymmetric properties cannot be controlled at all this way.
  22. Error -604 is "Access Denied". Its probably the UAC (User Account Control) which was first introduced in Vista and consequently first disabled in Vista . Try disabling UAC and see if that helps. Disabling UAC
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.