LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

verify transfer function

i use the transfer function.vi from the control toolkit to generate a transfer function (0.0133s+1)/(0.0076s+1)
from the examples i have seen the array for the numberator and denominator should be 1, 0.0133 and 1, 0.0076 respectively.
however i cant get the output I want until i switch the values to 0.0133,1 and 0.0076,1 as shown in the attached figure.
can someone verify in which order should the numberator and denominator be?in ascending order or descending order of s?
0 Kudos
Message 1 of 6
(3,111 Views)
Hi,

I work on the Control Design and Simulation team and in most of the cases (if not all), LabVIEW uses the ascending order to represent polynomials. In the example where you are using the Advanced Control Vis from PID Toolset, if you are trying to enter the (0.0133s+1)/(0.0076s+1) transfer function, you have to create and 1D-array as: Numerator [1,0.0133] and Denominator: [1,0.0076].
The Transfer Function above is the implementation of a Lead Controller with Central frequency of 100 rad/s. If inverted, it will generate a Lag Controller with central frequency of 0.01 rad/s. Which type of controller are you trying to use?
Another problem you can have is trying to specify a dT that is not smaller than 3.14 ms (1000 rad/s). The controller has central frequency of 100 rad/s. To avoid any discretization problem when trying to simulate, you need to have a dT 10 times bigger, which leads into 1000 rad/s. Which dT are you using?
Also, what is the application that you are trying to compose? Did you consider use LabVIEW Simulation Module to implement?
Hope this helps.
Barp - Control, Simulation, RTT and HIL - National Instruments
Message 2 of 6
(3,054 Views)
hi

can you explain in detail why is there discretization problem?
how do i chose the best dt in this case?
i still dont get what is the effect of using different dt.
I am a previous simulink user and i dont have to worry abt dt when i use a transfer function
right now i am sampling at 1/250 which is a dt of 4 ms

thanks very much
0 Kudos
Message 3 of 6
(3,018 Views)
Because the computation of a transfer function with feedback in the model requires knowledge of past outputs to compute the next output, it is important to make sure that the past outputs were recent enough that they are still relevant to the computation of the next output. By sampling at 4ms, you should be ensuring that this is the case; however, you should make sure that the dt input to the Transfer Function VI is wired with your sampling rate appropriately. I am not as familiar with Simulink, but I believe that Simulink has the ability to determine the proper rate automatically.

I hope this answers your question. If not, please post a reply.

Regards,

Kristi H
Message 4 of 6
(2,991 Views)
thanks for the answer
can i say a sufficient amount of dt would be the reciprocal of twice the signal bandwidth?
0 Kudos
Message 5 of 6
(2,979 Views)
Hi,

Before I answer, let me review something here, so we are talking the same thing. To be able to simulate continuous systems in a computer, we use differential equation solvers that numerically try to come with a solution for the equation. These techniques are easily encounter in the literature, but, in general you would see solvers that are fixed step size, as Runge-Kutta 1 (Euler) which is a single-step explicit
Runge-Kutta ODE solver of first order, or variable step size, as Runge-Kutta 45 which is a single-step explicit Runge-Kutta ODE solver of fifth order, which uses the Dormand-Prince coefficients.

In Simulink, you don't need to specify dT because it uses an algorithm to identify those coefficients "auto". Also, they have the variable step size as defaut. In the case of the Advanced Control Vis, those are VIs that are ONLY based on the Runge-Kutta 1 (Euler) Integrator, and it needs also the dT, since it does not calculate this parameter for you.

The best guess for dT CAN NOT be only twice the sampling time, because the Euler Integrator will only have 1 point to calculate the derivative and if try to apply a signal with sharp corners, must probably you will be unstable. The dT must by much higher (than the dynamic of the system and, in general, 10 times is good enough.

If you are really looking to simulate dynamic system in LabVIEW, you should look into the Simulation Module. It allows similar functionality as Simulink and also allows you to choose Variable Step size for the integrator. Look into: http://www.ni.com/realtime/control_design.htm OR http://sine.ni.com/apps/we/nioc.vp?cid=13852〈=US for more information about this and other new tools for Control Design and Simulation in LabVIEW.

Hope this help. If not, fill free to reply back.
Barp - Control, Simulation, RTT and HIL - National Instruments
Message 6 of 6
(2,956 Views)