LabVIEW Embedded

cancel
Showing results for 
Search instead for 
Did you mean: 

Delay on LM3S8962 card between AI0 input to PWM output

Hello

 

 I encountered with some parasitic delay between Analog Input  AI0 to PWM output PWM0 (on Luminary Micro evaluation board LM3S8962).


In my case  with minimum labview components between input and output the dealy is about ~2ms.

I work with PWM frequency 20Khz.

 

 This delay cause big difficult  to close control loop in high gains. 

What is the reason for this delay ? How it could be reduced ? 

 

Best regards

Gil

0 Kudos
Message 1 of 4
(6,922 Views)
A direct control from AIN to PWM is much less than a millisecond (about 20 us if parallel execution is disabled).
The rest is your processing, which I think is not parasitic (posting some code might help).
PWM frequency (
20 KHz) has no significance. One can control a 500 KHz PWM output in a 0.1 seconds control loop.

0 Kudos
Message 2 of 4
(6,905 Views)

Hello

 

Thank you for your response.

I attached my vi that is very simple. What I did in it is sample the input from gyro by AIO and after some gain

output it to PMW0. If I am looking on these  signals with scope I saw delay of ~2ms. (certainly the PMW output I pass through some Low pass filter).

You talked about parallel execution function disabled . Where I can find it?

 

Best regards

 

 

 

0 Kudos
Message 3 of 4
(6,879 Views)

A single iteration of that simple loop takes about 160 microseconds (80 us if parallel execution is disabled).

What you are seeing on scope is the delay of analog filter, which is about 2ms for a simple first order 100 Hz LPF. Here it is the response for a 20 Hz sinusoidal input signal:

 

20Hz signal dealy after 1 order LPF 100Hz.PNG

 

 


Gil B wrote:

You talked about parallel execution function disabled . Where I can find it?

 


 

Execution behavior can be modified in "Build Specification Properties" window (right click the Application and select Properties).


Note:

If parallel execution is disabled then nothing is executed outside the while loop. So, if you want other processing you should use timed loops, which is not so bad for a control loop (get constant sample rate). Timed loops use threads so they add other kind of overhead (you cannot have it all - compromise is the key word).

 

0 Kudos
Message 4 of 4
(6,863 Views)