ufo900 Posted September 13, 2012 Report Share Posted September 13, 2012 Hi! I need to implement a temperature control by changing the voltage of a power supply connected to a heater. I don't have PID toolkit, but I know how PID theorically works. Attached: VIs (Untitled 1 the principal one) [cannot upload zip file] Any suggestion, help or hints are appreciated. Thank you Untitled 1.vi HP6XXXA.LLB ni435x.llb ni435xcm.llb NI435Xu.llb Quote Link to comment
MikaelH Posted September 13, 2012 Report Share Posted September 13, 2012 I'm just wondering, since the LV PID Toolkit VIs are not block diagram protected, so if I just take the content and copy it on a new VI's block diagram, and send you that VI, do I then breach any copyright laws? Quote Link to comment
ufo900 Posted September 13, 2012 Author Report Share Posted September 13, 2012 I saw that trick but (example) in PID.vi i have a function that recall the toolkit.. Anyway i think I solved in another way, if I'll have trouble i can try that way! Thank you Quote Link to comment
ufo900 Posted September 13, 2012 Author Report Share Posted September 13, 2012 Another minor issue. I need to graph the spectrum of the temperature wave.. I did the amplitude and phase spectrum but anything changed: no graph visualized.. How to do that? Quote Link to comment
MikaelH Posted September 13, 2012 Report Share Posted September 13, 2012 I need to graph the spectrum of the temperature wave.. I did the amplitude and phase spectrum but anything changed: no graph visualized.. How to do that? I don't understand what you mean. Do you just need to plot the temperature? In my PID graphs, I normally plot the Control signal (maybe voltage 0-10v) and also the temperature. I use different Y scales for the two plots. Quote Link to comment
ufo900 Posted September 13, 2012 Author Report Share Posted September 13, 2012 I don't understand what you mean. Do you just need to plot the temperature? In my PID graphs, I normally plot the Control signal (maybe voltage 0-10v) and also the temperature. I use different Y scales for the two plots. ok I understand that, but i need to plot the spectrum of the signal, the frequencies of the signal.. don't know how to explain in a different way Quote Link to comment
MikaelH Posted September 13, 2012 Report Share Posted September 13, 2012 If you need to plot a frequency spectrum, you should use FFT Power Spectrum. Quote Link to comment
ufo900 Posted September 13, 2012 Author Report Share Posted September 13, 2012 (edited) frequency is visualized as Y and time as X how to visualize the frequency as X and amplitude as Y? Edited September 13, 2012 by ufo900 Quote Link to comment
MikaelH Posted September 13, 2012 Report Share Posted September 13, 2012 If you can make up a VI that simulates the HW-signals, it's easier to help you out and for me to understand what you are looking for. Quote Link to comment
ufo900 Posted September 13, 2012 Author Report Share Posted September 13, 2012 If you can make up a VI that simulates the HW-signals, it's easier to help you out and for me to understand what you are looking for. here you go vicreate.vi Quote Link to comment
drjdpowell Posted September 13, 2012 Report Share Posted September 13, 2012 I need to implement a temperature control by changing the voltage of a power supply connected to a heater. I don't have PID toolkit, but I know how PID theorically works. Years ago I implemented the algorithm from this link. It’s not that hard to write in LabVIEW. It’s my oldest bit of code still in use (and I would be embarrassed to post it), but I’ve found it very reliable. — James Quote Link to comment
ufo900 Posted September 13, 2012 Author Report Share Posted September 13, 2012 Years ago I implemented the algorithm from this link. It’s not that hard to write in LabVIEW. It’s my oldest bit of code still in use (and I would be embarrassed to post it), but I’ve found it very reliable. — James well thank you but i already implemented the pid control. I have another issue now as you can see above here Quote Link to comment
asbo Posted September 13, 2012 Report Share Posted September 13, 2012 frequency is visualized as Y and time as X how to visualize the frequency as X and amplitude as Y? Sounds like you need to use an XY Graph or XY Chart. Quote Link to comment
ufo900 Posted September 13, 2012 Author Report Share Posted September 13, 2012 Sounds like you need to use an XY Graph or XY Chart. well i did but nothing changed. maybe i can explain better: I need to graph the spectrum of the temperature wave (input of a NI 4351 connected to a termocouple) (Vi attached named temperatura.vi) I did the FFT amplitude and phase spectrum and it visualizes the spectrum in X=0 and Y=frequency (i guess) But i need to graph the frequency of the signal as in the example in the attached VI (vicreate.vi). How to do that, using the incoming instrumental signal? Someone told me to use filter anti.aliasing and other stuff but how to implement in the attached code? Thank you temperatura.vi Quote Link to comment
gb119 Posted September 14, 2012 Report Share Posted September 14, 2012 Ok, let me try to see if I'm understanding. You have a signal (a temperature in this case) that is oscillating in some fashion - possibly not sinusoidally - and you want to track the frequency of this oscillation over a period of time (which one assumes must be longer than the period of the osciallation) to look, for example, for a drift in the frequency of the oscillation. Assuming this is correct, what you need to do is to take a sample of your data that is longer than the expected oscillation period but shorter than the time over which you expect the frequency to change. Take an FFT Power spectrum of this sample. This gives you the signal as Y(f) vs f where f is the frequency (which you would normally plot on the X axis). You want the value of f for which Y(f) is maximum as that will represent the fundamental frequency of the oscillation. You then repeat this process at different times, generating a plot of f vs t. Quote Link to comment
ufo900 Posted September 14, 2012 Author Report Share Posted September 14, 2012 Ok, let me try to see if I'm understanding. You have a signal (a temperature in this case) that is oscillating in some fashion - possibly not sinusoidally - and you want to track the frequency of this oscillation over a period of time (which one assumes must be longer than the period of the osciallation) to look, for example, for a drift in the frequency of the oscillation. Assuming this is correct, what you need to do is to take a sample of your data that is longer than the expected oscillation period but shorter than the time over which you expect the frequency to change. Take an FFT Power spectrum of this sample. This gives you the signal as Y(f) vs f where f is the frequency (which you would normally plot on the X axis). You want the value of f for which Y(f) is maximum as that will represent the fundamental frequency of the oscillation. You then repeat this process at different times, generating a plot of f vs t. well the oscillation of the signal is "casual" if it is not touched (it depends on the real temperature of the ambient) but i need to control voltage of a heater to make the oscillation of the temperature zero (costant value), one frequency (sine oscillation) or in a way that the user is defining (square or something). the problem is actually this: how to write the code, starting from the temperature array ending to the graph.. Quote Link to comment
Rolf Kalbermatter Posted September 15, 2012 Report Share Posted September 15, 2012 I'm just wondering, since the LV PID Toolkit VIs are not block diagram protected, so if I just take the content and copy it on a new VI's block diagram, and send you that VI, do I then breach any copyright laws? Yes you do! Quote Link to comment
MikaelH Posted September 16, 2012 Report Share Posted September 16, 2012 Yes you do! Okay, If I open the VIs memorise it and then rewrites it without looking at the code while doing it, is that also a breach? Quote Link to comment
Rolf Kalbermatter Posted September 16, 2012 Report Share Posted September 16, 2012 Okay, If I open the VIs memorise it and then rewrites it without looking at the code while doing it, is that also a breach? Well ask OpenSource programmers! Many think that looking at non-free code is already more than enough to endanger an Open Source project. Wine for instance has a clear policy there. Anyone having had access to Windows source code is not welcome to provide any code patches. They can do testing, documentation and such things but source code patches are refused if project leaders have any suspicion that the person sending in the patch might have been exposed to that code either through the Microsoft shared source initiative or the illegally leaked source code a few years ago. Also they state explicitly that someone having looked at the (incomplete) source code of the C runtime or MFC library, that comes with every Visual Studio installation for many years, should not attempt to provide any patches to code related to these areas. If the submitted code raises suspicions of such influence, it is refused. They even have for many years refused code patches from people involved in the ReactOS project, another Open Source project trying to create a Windows compatible kernel but not building on Linux but directly sitting on top of the BIOS interface, meaning it is a fully featured OS in itself, because some of the contributors to that project have more or less openly admitted to the use of disassembling Windows for reverse engineering purposes. So not just exposure to source code is a serious risk to creating copyright challenged source code but also looking at the compiled product of such source code to closely. Some Open Source programmers even refuse to look at GPL source code since they believe that it poses a risk if you do not plan to release your own source code under (L)GPL yourself, but under a different possibly more permissive open source license like BSD. Copying GPL source code in anything non-GPL is anyhow a sure way of copyright violation. Memorizing source code and recreating it is more complicated but could be in many jurisdictions a serious legal risk already. And very often the question is not who is more right, but who has a longer financial breath to go through all the legal procedures. So be careful offering to recreate copyrighted code. NI may not be interested to go after you in general, or where you currently live or for whatever other reason, but many little things like this could build up to something undesirable in the future. Also you have to think about such things anyhow. Just doing it has always the danger of the so called sliding perception. If this hasn't caused problems today I should be fine going a little further tomorrow and even further next week and before you are aware of it you operate in truly dangerous areas. 1 Quote Link to comment
MikaelH Posted September 16, 2012 Report Share Posted September 16, 2012 So be careful offering to recreate copyrighted code. Sure, I wouldn't do it, but it's very hard to know where the line goes sometimes. Especially for the PID VIs, there aren't many ways implement it. And if you haven't looked at the source code your code might end up looking very similar anyway. Quote Link to comment
Rolf Kalbermatter Posted September 16, 2012 Report Share Posted September 16, 2012 Sure, I wouldn't do it, but it's very hard to know where the line goes sometimes. Especially for the PID VIs, there aren't many ways implement it. And if you haven't looked at the source code your code might end up looking very similar anyway. PID being a certain algorithme, indeed has a high chance to come up with similar code. But to be safe it is definitely a good idea to go from the text book description of the algorithme and not from looking at another implementation of it. Open Source development for instance usually allows for so called clean room development. It means it is considered permissible for someone to use reverse engineering practices to produce a textbook description of the interface and its requirements and someone else using that description to implement the code. But the reverse engineer has to be careful to not describe the internal algorithm in more details than absolutely necessary to allow for a compatible implementation. The implementation of an algorithme can be copyrighted, the workings of it not, that is possibly a case for patent protection, another can of worms. But much of the confusion about copyright also comes from a confusion between copyright and patent right. One protects the form, or specific implementation of an idea, the other more the content of the idea itself. Quote Link to comment
ufo900 Posted September 16, 2012 Author Report Share Posted September 16, 2012 that''s right, but anyone could help me solving the problem? Thank you all Quote Link to comment
MikaelH Posted September 16, 2012 Report Share Posted September 16, 2012 that''s right, but anyone could help me solving the problem? Thank you all Sorry, we got into another discussion there :-) So back to your original question. "how to visualize the frequency as X and amplitude as Y? " When using a FFT power spectrum, the X axis is in frequency. It starts at Frequency 0 Hz and every x value has a delta f increment. Quote Link to comment
ufo900 Posted September 17, 2012 Author Report Share Posted September 17, 2012 Sorry, we got into another discussion there :-) So back to your original question. "how to visualize the frequency as X and amplitude as Y? " When using a FFT power spectrum, the X axis is in frequency. It starts at Frequency 0 Hz and every x value has a delta f increment. thank you about that but now I have another "PID problem". I have some issues to apply PID into my system.. I can do a PID control by simulating a system only in temperature but issues if I want a voltage control that depends of temperature value. Attached here PID subVIs I use and the program with the other subVI. Hope you can help me apply PID into it. Thank you VIs(1).zip Quote Link to comment
ufo900 Posted September 18, 2012 Author Report Share Posted September 18, 2012 little up Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.