03-13-2015 03:21 PM
Dear all,
Im SIMULINK, there is a block "first order transfer function" where pole is configured and when given any input it calculates TF of it.
How this function can be implemented in LabVIEW? I have control design toolkit but cannot find a block where it automatically configures numerator when a pole is configured. Is there any alternative way in LabVIEW? Help.
Regards.
03-15-2015 01:45 PM
I don't know what the LabVIEW Toolkit wants, but the transfer function of a first order system with pole a is simply 1/(s-a).
BS
03-16-2015 01:12 PM
The function you are looking for is part of the LabVIEW Control Design and Simulation Module and you can find this function under: Control & Simulation >> Simulation >> Discrete Linear Systems >> Discrete Zero-Pole-Gain.
This function will NOT configure the parameters automatically for you, though, but you can easily use the Control Design function: Control Design >> Model Construction >> CD Contruct First Order Model.vi and then, use the function "Control Design >> Model Conversion >> Convert Continuous to Discrete" and then, convert this model to ZPK and implement with the function above. All those steps most likely are the steps executed in under the mask of other competitive softwares.
Does it make sense?
03-19-2015 10:46 AM
I don't have to use Control Design toolkit. Am I supposed to convert transfer function into a difference equation?
03-19-2015 10:47 AM
That is probaby the only way since I have to deploy it inside real-time processor being fed in with samples of data at every iteration.
03-23-2015 09:46 AM
You can try to use those functions here then:
C:\Program Files (x86)\National Instruments\LabVIEW 2014\vi.lib\addons\control\advanced\continuous linear.llb
C:\Program Files (x86)\National Instruments\LabVIEW 2014\vi.lib\addons\control\advanced\discrete linear.llb
there is a discrete transfer function in the second folder.
Another options is to implement the filter manually using "multiply", "add" and shift-register. This is pretty easy too....
03-23-2015 09:53 AM
Here is a good tutorial for using direct implementation:
http://www.comm.utoronto.ca/~dkundur/course_info/362/3_Kundur_DiffEq_Implement_handouts.pdf
03-23-2015 10:13 AM
The reason why I need to implement this transfer function (which is actually a low pass filter) "manually" is because I will probably be feeding pressure sensor values into this block, and that too inside FPGA. And in it I will have to use a while loop, with some delay, rather than a simulation loop which utilizez ODE solver to solve maths inside control and simulation blocks.
Low pass filer in digital is a moving average (after recalling my major classes in college). Probably will design something like that inside an FPGA.
Regards.
03-24-2015 08:14 AM
Very good -- with a little work, you can figure out the relationship between the "corner frequency", sampling rate, and the length of the moving average.
Something I did (mainly because it was, I thought, such a neat way to do this) was to create a finite length Queue (the length being the length of the Average). The Queue was maintained in an Action Engine with three States -- Obtain (creates the Queue), Filter (to be explained), and Release (to release the Queue and end things). Filter consisted of using a Lossy Enqueue to put the latest sample on the Finite Queue (pushing one off after the Queue fills up), using Get Queue Status to obtain both an Array with all of the current elements and the number of elements, doing the division to get the average, then exporting the Average. Since this was encapsulated in a sub-VI, the "messy details" remained hidden (they are irrelevant to the program using the filter). For modest data rates (we were sampling at around 100 Hz, and wanted to filter at about 1 Hz), this "computation burden" is trivial, the code is "obvious" and "provably correct", and once you've done it, you can "reuse the knowledge" whenever you need another such filter.
Bob Schor
03-24-2015 09:49 AM
Or may be something like this, obviously with a little changed settings but the floorplan will look like this for basic measurement criteria I need.