Jump to content
  • 0

LabVIEW discrete transfer function


aldosebastian

Question

I’m having trouble with the discrete transfer function implementation in LabVIEW FPGA for a while now. So I discretized my PID controller with 100 us and Tustin method in MATLAB, and checked the response to a 1 Hz wave in discrete time using Simulink, with the discrete response as attached. Then I tried doing the same with Discrete transfer function direct VI in FPGA Labview, taking care to factorise the large numerator coefficients so that it respects the input limits of the VI, and then will multiply the coefficient later after the response of the VI. I also made sure the sampling time in the FPGA code is the same as the sampling time of the discrete controller. Despite this the response saturates to its minimum and doesn’t recover. I attach my LabView code and also the response I got (response before multiplying with the large numerator coefficient).

 

I also tried to do this with a simple integrator, and with this case it actually worked. I attach the results with integrator as well.

 

Could someone help please?

simulation response to 1 Hz wave.PNG

discretized transfer function.PNG

input and output from PID.PNG

input and output with integrator.PNG

discretetransferfunction.zip

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Hi @aldosebastian,

Unfortunately, those of us here at Digilent don't have experience with the LabVIEW FPGA module (or Simulink), so we won't be able to offer much in the way of help. Maybe another forum user here would be able to offer some advice, but otherwise I would recommend asking on the National Instruments forum where you will be more likely to receive some experienced feedback.

I'm sorry I could not be of more help.

Thanks,
JColvin

Link to comment
Share on other sites

A very general observation: Usually, Z-domain transfer function are factorized into biquad sections for numerical reasons. In fixed point, it does matter very much which pole / zero pair goes where...

With Matlab you can simply use the "filter" function to study the time domain response. It can be instructive to set up a frequency vector over z = exp(i omegaNorm) and evaluate the Z-domain polynomial with "polyval". "freqz" would effectively do the same

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...