10-14-2009 06:43 AM
Hello I encountered with some parasitic delay between Analog Input AI0 to PWM output PWM0 (on Luminary Micro evaluation board LM3S8962).
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 |
10-15-2009 03:01 PM
10-18-2009 11:29 AM
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
10-19-2009 09:22 AM
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:
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).