|
|
|
|
|
|
|
|
Joined Dec 2006
1,129 Posts
|
i managed to look at a servo out channel through a cheap scope and could visually observe two kinds of jitter on the pulse width.
1. those that are +- 5us occurring all the time, but do not seem to move the servo. 2. those that are around < -10us/-15us or > +10us occurring once in a while (1-2 per sec), which does seem to move the servo. this is with a more aggressive main loop (which has a side effect of performing more atomic reads, which disable interrupts). i'll look into using lock-free methods of accessing the shared vars (easier on rx in, harder on servo out).. |
|
|
|
|
||
|
United States, NC, Raleigh
Joined Oct 2011
279 Posts
|
Quote:
How do I set aux gain to zero in fail safe mode? I am doing the test again with the TX on and aux gain set to minimum (1ms pulse width) and the total jitter is still 32us. John |
|
|
|
||
|
United States, NC, Raleigh
Joined Oct 2011
279 Posts
|
Quote:
I suspect that the large errors are interrupt latency. |
|
|
||
|
|
||
|
Joined Dec 2006
1,129 Posts
|
i hope you meant 44us
![]() tx on, set gain to min, tx off. this should enable failsafe with min gain (assuming failsafe = hold last channel values). from the code, i would expect jitter to be skewed towards +T (due to delay in interrupt processing, etc) values and not -T (which seem to occur more often). are you able to tell if the jitter variation is skewed? how are you measuring total jitter variation over a long period of time (5min)? Quote:
|
|
|
||
|
|
||||
|
United States, NC, Raleigh
Joined Oct 2011
279 Posts
|
Yes, us not ms. I edited the post.
Quote:
Quote:
Quote:
That is why I am concerned about comparing input and output pulse widths when they are asynchronous. I may not be recording all of the pulses that I am not synchronous width (partial pulses at beginning and end of trace). Maybe we need a test version of the firmware that keeps inputs and outputs synchronous. |
|||
|
||||
|
|
||
|
Joined Dec 2006
1,129 Posts
|
Quote:
if you select one output channel and started measuring it's pulse width over time (min, max, mean), assuming it's corresponding input channel is static and there is no gyro correction, then the measured values would be due to the jitter on the output stage. i'm not sure why we would need to reference it back to the input channel pulse width? alternatively, if you just disconnected the input channel (AIL_IN for example), the code sets it to 1500us by default and it will not change throughout the test. now, we just need to set gain down to zero and see the jitter due to the output stage. i'm going to try that next.. |
|
|
||
|
|
||
|
United States, NC, Raleigh
Joined Oct 2011
279 Posts
|
Quote:
Ignoring the input variation makes the RX3S look even worse. However with my setup I only see about a 1us change in the input so it can be ignored. Different TX and RX combinations could induce different errors. |
|
|
||
|
|
|
|
Joined Dec 2006
1,129 Posts
|
i think i found the source of the "significant" jitter, it is either the i2c or imu libraries (more likely i2c). i think it is disabling interrupts for long-ish periods of time. this is with my mpu6050 board, but the mpu6050 and itg3205 libraries are based off the same base in i2cdevlib.
so, i'll look into using alternate i2c access functions that does not use the arduino Wire library. i'll also look into a lock-free implementation of shared vars access between the isrs and main loop. the current atomic access operations will disable interrupts (though it seems that the disable time is quite small). the +/-5us-ish jitter is probably coming from the 4us micros() granularity as you indicated. using a true microsecond timer1 could help there.. |
|
|
|
|
||
|
United States, MI, Brighton
Joined Oct 2012
945 Posts
|
Quote:
|
|
|
||
|
|
|
|
Australia, WA, Perth
Joined May 2007
3,071 Posts
|
Some read/write operations (i.e. 16bit ones) need to disable ISRs as they take two clock cycles to complete. that might be one reason you're seeing small ISR disable periods.
Why they're doing that in the I2C I don't know. Edit: Just had a look at your code. Using micros() will give you a 4us best case resolution. Why not use TCNT1 like you have with Timer0? |
|
| Thread Tools | |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Sold Flight Stabilization System with Programing Card | Woody_99 | Aircraft - Electric - Helis (FS/W) | 1 | Mar 23, 2012 12:50 PM |
| Sold Flymentor Flight Stabilization with Field Programmer | Woody_99 | Aircraft - General - Radio Equipment (FS/W) | 0 | Mar 17, 2012 07:43 AM |
| Sold Totally Tricked out 400 size with flight stabilization installed, BNF | Woody_99 | Aircraft - Electric - Helis (FS/W) | 2 | Mar 12, 2012 06:56 AM |
| Wanted FY-30A Flight Stabilization System | Casey_S | FPV/RPV - Equipment and Vehicles (FS/W) | 0 | Mar 05, 2012 02:40 PM |