HobbyKing.com New Products Flash Sale
Reply
Thread Tools
Old Jul 05, 2009, 11:27 PM
Registered User
Joined Jan 2009
89 Posts
Discussion
Pushpak: PCB board development for Quadrotor.

Project Home Page

Source Code SVN Repository

Updates:
1) Arduino Bootloader working. Now able to program the board using the Arduino environment.
2) ADC auto trigger library working.

Date: Aug 26th 2009
3) Interrupt based RC Reciever decoder completed.
4) Servo pulse outputs using hardware PWM.
brij is offline Find More Posts by brij
Last edited by brij; Aug 26, 2009 at 07:39 PM.
Reply With Quote
Sign up now
to remove ads between posts
Old Jul 05, 2009, 11:32 PM
Registered User
Joined Jan 2009
89 Posts
Schematics and block diagram of the board.

The basic block diagram of the board and schematics. This post will be upaded if any changes are made to the board.
brij is offline Find More Posts by brij
Last edited by brij; Jul 05, 2009 at 11:42 PM.
Reply With Quote
Old Jul 05, 2009, 11:39 PM
Registered User
Joined Jan 2009
89 Posts
First test of the board.

I implemented the ADC Auto-trigger with 15x oversampling. Accumlating 15 data samples provides better noise performance and ADC resolution. First order of business was to find out how much improvement does it offer. Also to figure out if 4 pole butterworth filters are necessary and worth the trouble.

The attached graph is pretty much speaks for itself.

Data Series D: No Butterworth filter and No averaging is the noisest. Note that noise is basically eating up almost 4 bits of ADC.

Data Series A: Butterworth filter + averaging is least noisest.
brij is offline Find More Posts by brij
Reply With Quote
Old Aug 26, 2009, 07:51 PM
Registered User
Joined Jan 2009
89 Posts
Basic frame work uploaded

I have uploaded the basic frame work code that I have completed so far to the SVN repository.

Source Code Repository

Some of salient features are
  • Interrupt base ADC auto sampling with 15x oversampling.
  • Interrupt based RC Receiver pulse decoding. Should be compatible with any receiver.
  • Hardware based servo pulse outputs.
  • Precise control loop timing with error flags to indicate when execution took more time than loop period.
  • RC Radio link loss/fault detection.

Currently working on modifying Arduino serial port code so as to use buffered serial port transmit functionality. This way code will not block when sending data back to PC/Ground station.

Roy, Nelson, Damon and others, would like to hear from you all if any other features would be helpful.

Thanks
brij is offline Find More Posts by brij
Reply With Quote
Old Aug 27, 2009, 01:57 AM
fast
fmkit's Avatar
ISRAEL
Joined Aug 2007
2,644 Posts
I don't think you need TLC04 filters when using accelerometer
when gyro says no angular speed take accelerometer reading
fmkit is offline Find More Posts by fmkit
Reply With Quote
Old Aug 27, 2009, 11:53 AM
Registered User
Joined Jan 2009
461 Posts
Quote:
Originally Posted by fmkit
I don't think you need TLC04 filters when using accelerometer
when gyro says no angular speed take accelerometer reading
fmkit,

Thanks for the suggestion. I have several objections to your algorithm:

1) From what I've seen, the accelerometer data is very noisy, particularly from rotor vibrations. I don't think we can use unfiltered data.
2) At least part of what we're using the accelerometers for is as an input to a complementary filter to compensate for gyro drift - in other words, so we can have a better estimate of zero rate (or any other rate).
3) The other use is to determine position by double integration of the acceleration data. I'm not sure this will be sufficient for use in position/altitude hold without alternate sensors (GPS, sonar, pressure, etc.). I think a complementary filter with these sensors and the accels would yeild higher fidelity than either sensors alone.

Of course, if your experience (with hovering vehicles like quadrotors or helis) is different, please let us know.

- Roy
RoyLB is offline Find More Posts by RoyLB
Reply With Quote
Old Aug 27, 2009, 12:39 PM
fast
fmkit's Avatar
ISRAEL
Joined Aug 2007
2,644 Posts
@ RoyLB:
Filtering the noise does nothing but introduce delay because of very nature of capacitor, you don't get rid of unwanted spikes but spread them in time domain. What works for me is to detect when the accelerometer moves 90degree to its working plane (sideways?) that's when the spikes are worst.
I use loop that takes sample from ACC about every 10ms, 32 samples compared and those that look alike and not extremes used.
I use Cypress PSOC cy8c27xxx chips that have multiple filters built in, you can use 4th or higher order butterworth filters if you want before routing ACC signal to ADC, and I did try all kind of testing starting with 13Hz filter cut off freq. and ensing 300hz - the filter is not useful!
Simple test you can do: connect Wii Nunchuck to flight simulator, when low pass filter set under 50hz using the ACC becomes annoying because of delay.
fmkit is offline Find More Posts by fmkit
Reply With Quote
Old Aug 27, 2009, 10:48 PM
Registered User
Joined Jan 2009
461 Posts
Quote:
Originally Posted by fmkit
@ RoyLB:
Filtering the noise does nothing but introduce delay because of very nature of capacitor, you don't get rid of unwanted spikes but spread them in time domain. What works for me is to detect when the accelerometer moves 90degree to its working plane (sideways?) that's when the spikes are worst.
I use loop that takes sample from ACC about every 10ms, 32 samples compared and those that look alike and not extremes used.
I use Cypress PSOC cy8c27xxx chips that have multiple filters built in, you can use 4th or higher order butterworth filters if you want before routing ACC signal to ADC, and I did try all kind of testing starting with 13Hz filter cut off freq. and ensing 300hz - the filter is not useful!
Simple test you can do: connect Wii Nunchuck to flight simulator, when low pass filter set under 50hz using the ACC becomes annoying because of delay.
fmkit,

Delay is always a concern with any filter design. But, holding an accelerometer in your hand and placing it in a vibrating quadrotor are two different things. I'm concerned about high frequency rotor noise aliasing into the usable frequency of the sensor.

I'm not sure what you mean when you say the spikes are worse at 90 degrees. Technically, accelerometers shouldn't read anything at 90 degrees. Are you using an atan2() function to determine tilt?

BTW, How is the PSOC chip?

- Roy
RoyLB is offline Find More Posts by RoyLB
Reply With Quote
Old Aug 28, 2009, 12:03 PM
multirotor/hotliner pilot
saturnine's Avatar
Chicago, IL
Joined Aug 2005
2,805 Posts
Hi Brij,

Glad to see you're back and working on the project again. I had taken a similar break as you did. Now it's time for me to toy around with the Wii MotionPlus and see how well it works as an IMU for my Arduino Quadrotor. I will contribute anytime I can, but unfortunately will likely be taking more than I give seeing as I am not an accomplished coder as you and others here may be.

I look forward to seeing your project come to life. Best of luck.

Damon
saturnine is offline Find More Posts by saturnine
Reply With Quote
Old Aug 28, 2009, 12:06 PM
multirotor/hotliner pilot
saturnine's Avatar
Chicago, IL
Joined Aug 2005
2,805 Posts
delay

I understand the delay that's being discussed is the product of averaging samples of delay creating a lag in the process. Can this be remedied in part by using exponential moving averages? Is it possible also to rather than average the data to truncate values that algorithmically are determined to be out of line with the rest of the data series?

Damon
saturnine is offline Find More Posts by saturnine
Reply With Quote
Old Aug 28, 2009, 11:52 PM
Registered User
Joined Jan 2009
461 Posts
Damon

Quote:
Originally Posted by saturnine
I understand the delay that's being discussed is the product of averaging samples of delay creating a lag in the process. Can this be remedied in part by using exponential moving averages?
What's an exponential moving average?

Quote:
Is it possible also to rather than average the data to truncate values that algorithmically are determined to be out of line with the rest of the data series?
I think this is what fmkit is doing (but I'm not sure I understand completely what he's doing and why he's seeing the results that he is reporting

- Roy
RoyLB is offline Find More Posts by RoyLB
Reply With Quote
Old Aug 29, 2009, 08:56 AM
checkout my Blog
otlski's Avatar
Joined Feb 2008
467 Posts
Quote:
Originally Posted by saturnine
I understand the delay that's being discussed is the product of averaging samples of delay creating a lag in the process. Can this be remedied in part by using exponential moving averages? Is it possible also to rather than average the data to truncate values that algorithmically are determined to be out of line with the rest of the data series?

Damon

Damon, Roy,

Truncated? Kind of sounds like a median filter. If a median filter is followed by a weighted moving average the flyers are rejected and the emphasis remains on the current data point - somewhat mitigating the lag. It could be an improvement. Before getting into this hobby I was in video astronomy where similar methods of data handling were employed. The crossover is always interesting.

Dan
otlski is offline Find More Posts by otlski
Reply With Quote
Old Aug 29, 2009, 09:11 AM
multirotor/hotliner pilot
saturnine's Avatar
Chicago, IL
Joined Aug 2005
2,805 Posts
@Roy,

An exponential moving average really is just a moving average with a weighting on more recent data so as to prevent a lot of the delay. This is used a lot by financial traders that want to use chart averages, but avoid the delay of not giving more care to immediate data. Essentially it's a faster responding simple moving average:

http://en.wikipedia.org/wiki/Moving_...moving_average

Damon
saturnine is offline Find More Posts by saturnine
Reply With Quote
Old Aug 29, 2009, 07:34 PM
Registered User
Joined Jan 2009
89 Posts
Ooh shucks I never got a email notification of replies to this thread. Sorry for the delay in responding.

As for the question whether filters are needed or not my take on it is from the basic principles of digitally sampling a signal. Before sampling a signal using an ADC an anti-aliasing filter is necessary to suppress all the signals above Nyquest frequency. On this I hope everyone agrees.

One of the first experiments I did was to see how useful the filters are, if they are needed at all. The results of the experiment I have documented here.
Filter performance


Quote:
when gyro says no angular speed take accelerometer reading
As you can see from the data without the filter the Accelerometer resolution is only 6bits (about 5 degrees). With filter the resolution improves to 9bits (less than a 1 degree). If one is building a RC controlled aircraft with a human pilot in the loop I guess 5 Degree of tilt resolution might be acceptable. I am not sure that is the case with autonomous Quadrotor.

This data was collected with accelerometer stationary on the table. I expect the noise to be much worse on the quadrotor from vibrations.

As for the lag introduced by the filter, I agree that could be a problem on Gyro data. We have yet to determine the effects of the lag. Currently the filter has cutoff frequency of 50Hz and I am sampling at 1.5KHz. So I could move the cutoff frequency up to 500Hz to reduce the lag.

I will soon post the results of sampling the Gyro's.
brij is offline Find More Posts by brij
Last edited by brij; Aug 29, 2009 at 07:53 PM.
Reply With Quote
Old Aug 29, 2009, 07:40 PM
Registered User
Joined Jan 2009
89 Posts
Quote:
Originally Posted by RoyLB
fmkit,

I'm not sure what you mean when you say the spikes are worse at 90 degrees. Technically, accelerometers shouldn't read anything at 90 degrees. Are you using an atan2() function to determine tilt?
- Roy
Output of single axis of accelerometer output is not linear when used for tilt measurement. The accelerometer is the most sensitive when it is at 90 degrees and least sensitive when it is 0 degrees with respect to gravity.
brij is offline Find More Posts by brij
Reply With Quote
Reply


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
WTB: PCB Board for 2S lipo localbuyer Aircraft - Electric - Airplanes (FS/W) 0 Mar 09, 2005 07:01 AM
CCD Board camera for sale JPA2002 Aircraft - Electric - Airplanes (FS/W) 5 Feb 07, 2005 08:21 PM
Frequency board thing for club Where to buy ? Warbird Brian Electric Plane Talk 7 Nov 13, 2004 07:06 AM
Idea On-board lighting for night flying ? 4DwannaB 3D Flying 4 Sep 22, 2004 06:45 PM
Trade vintage board games for E-flight stuff docprego Aircraft - Electric - Airplanes (FS/W) 0 Jun 13, 2002 11:01 AM