LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

first order transfer function

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. Untitled.png

 

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.


0 Kudos
Message 1 of 11
(6,291 Views)

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

0 Kudos
Message 2 of 11
(6,241 Views)

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?

Barp - Control, Simulation, RTT and HIL - National Instruments
0 Kudos
Message 3 of 11
(6,203 Views)

I don't have to use Control Design toolkit. Am I supposed to convert transfer function into a difference equation? 


0 Kudos
Message 4 of 11
(6,159 Views)

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. 


0 Kudos
Message 5 of 11
(6,158 Views)

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

Barp - Control, Simulation, RTT and HIL - National Instruments
0 Kudos
Message 6 of 11
(6,112 Views)

Here is a good tutorial for using direct implementation:

 

http://www.comm.utoronto.ca/~dkundur/course_info/362/3_Kundur_DiffEq_Implement_handouts.pdf

Barp - Control, Simulation, RTT and HIL - National Instruments
0 Kudos
Message 7 of 11
(6,109 Views)

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.

 


0 Kudos
Message 8 of 11
(6,106 Views)

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

0 Kudos
Message 9 of 11
(6,077 Views)

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. 

 

MovingAverage.png


0 Kudos
Message 10 of 11
(6,067 Views)