paparazzi-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Paparazzi-devel] AHRS over SPI on Tiny


From: David Conger
Subject: Re: [Paparazzi-devel] AHRS over SPI on Tiny
Date: Fri, 03 Sep 2010 19:55:48 -0700

Hello Christophe, 

I really appreciate all the details in your answer. Some new and some a good review. 

May I ask why you did not mention magnetic reference? I would imagine that is another "physical" thing related to attitude that is not affected by accelerations in a small MAV. Can that not be used? That's what I thought made my Booz point the right direction :)

I think the Razor has a 3-axis magnetometer on it. This is the one I want to connect: http://www.sparkfun.com/commerce/product_info.php?products_id=9623

My thinking, likely wrong, is that the magnetometer could tell the code when a sustained coordinated turn is taking place vs flying level. 

Regards,
David


On Sep 3, 2010, at 6:11 AM, Christophe De Wagter wrote:

Hi David

Good phi, theta and psi can be directly copied to estimator_phi, estimator_theta and estimator_psi. The only question is: what phi, theta and psi (=attitude) are good? 

Since you look seriously interested, maybe I can try to explain?

The only physical thing related to attitude is the earth gravity  (unless you use a multi-antenna phase-measuring GPS... $$$$). Unfortunately, the sensors that measure gravity (=accelerometers) also measure so-called kinematic accelerations or in other words: changes in speed: like centrifugal forces, Coriolis forces, linear accelerations etc... The sum of all these litteraly is "what you feel" and is called "specific force". 

so : accelerometer_value (specific force) = earth_gravity + change in velocity (linear accelerations) + velocity times turn rate (centrifugal etc)

A = B + C + D  

You measure A and want to know B. What all (yes all) gyroscopes and accelerometer only AHRS projects are doing in some way or another is to neglect the last 2 (C and D). In many situations this is not bad: for instance: when testing the AHRS attached to your computer: it can not accelerate for a very long time (at most a few meters: so if you accerate to the left, then you need to accelerate to the right directly after so the average is zero) and can not rotate to much either (or your cable gets strangled). This is why all AHRS videos on youtube look perfect. And on the desk they are perfect: you neglected 2 terms in the equation that in that situation are perfectly neglectable. 

Now what about the gyroscopes you might ask. I deliberately keep them only second as gyroscopes (turn rate or rotation speed sensors) do NOT give you attitude but ONLY HELP TO SOLVE SHORT TERM errors in the previous part. If gyroscopes only measured turn-rate perfectly, then they would help more but all MEMS sensors are more or less sensitive to 1) temperature, 2) turnrate, 3) vibrations, 4) accelerations, 5) radiation, 6) power supply quality, 7) non-linearity 8) ADC-quality, 9) dynamic range and saturation problems, ... so if you integrate gyroscopes, sooner or later you get trouble. I put this list here so you know what to pay attention for. If using gyroscopes: always try to keep the temperature as constant as possible, reduce vibrations (dampers), use better ADC (e.g. 10bit ADC with +/- 1200 deg/sec gyros have a resolution of 2.4 degrees/s per adc tick, so your phi/theta might drift 1.2deg/sec) and power supply filtering and shielding etc to start with. All of this defines for how long (seconds!/minutes?) gyroscope integration is useful.

If you convert the accelerometer directly to attitude and plot it, it will vibrate a lot and will show errors when you accelerate the AHRS on your desk. During a coordinated turn of a fixedwing plane, the force you feel is perpendicular to the plane (not pointing to earth). If you add GPS data however, from the flightpath you can quite accurately reconstruct the missing C and D. Together with the accelerometer you can know "where the earth is" even when you keep accelerating and turning. Here questions like latency, update rate, noisy derivatives (linear acceleration) are of importance. 

Finally there is the heading... GPS ground-track is not the same as nose direction. Gyroscopes measure how much the nose has been turning, so using GPS to correct it induces errors that increase with corsswind. Magnetometers can help here, and become necessary whenever you do not move enough anymore (hovering).

I hope this help in understanding what is possible, what will work better or worse... 

A lot of people are working on this simultaneously, so there must be some results soon. If forces are combined... it might even be very soon.

Christophe



On Fri, Sep 3, 2010 at 3:21 AM, Marc Schwarzbach <address@hidden> wrote:
Hi David,

there are different approaches of intgating an IMU to the paparazi system.
One is to use an external processor doing the drift compensation, Kalman etc. This would be an external AHRS as used by OSAM with the MTi-G or others with the Vectornav or CHR-6dm.
These are in most cases more expensive (then the autopilot itself).
The data can be dirctly used as the estimator.

The other approach (as done by Hochschule Bremen/Warmers) is to use the raw data of gyros and accelerometers (like from the Sparkfun 6DOF Razor, this board only provides analogue values, no controller onboad) and process it in the paparazzi board using the DCM calculations by Premerlani and Bizard (same as UAV-Devboard or ArduIMU). The estimator calculation normally performed for the IR sensors are rewritten for that.

Hope this helps to understand the diefferent aproaches.

Cheers

Marc



-------- Original-Nachricht --------
> Datum: Thu, 02 Sep 2010 15:59:06 -0700 (PDT)
> Von: David Conger <address@hidden>
> An: address@hidden
> Betreff: Re: [Paparazzi-devel] AHRS over SPI on Tiny

> Hello, Thank you, this is all good information.
>
> I understand the issue with using the IMU is not documentation related. I
> am trying which is why I am asking so many questions today. I hope everyone
> doesn't mind my questions while I try different things. As always I will
> add what I learn to the Wiki where I see a void.
>
> Am I correct then in staying that those Paparazzi Fixed Wing projects
> flying with IMU are relying on the AHRS on the IMU and feeding estimator with
> the results? I guess OSAM uses an IMU fed to a Gumstix which runs some other
> code to get PHI, PSI, THETA then feed that into estimator?
>
> I'm really hoping that if estimator can simply be directly fed PHI, PSI,
> THETA from whatever source then you can fly. So maybe
> 1) Overo Water (I already have) +
> 2) Booz IMU (I already have) +
> 3) Some code ((I do not have)
> Might produce good PHI, PSI, THETA to feed estimator that will fly? I
> still lack the understanding if estimator if given good PHI, PSI, THETA can fly
> or is it more complex.
>
> Again please excuse my ignorance on these things. I really have valued
> your time to reply so far everyone. 
>
> Regards,
>
> David Conger
> Onefastdaddy
> 001-858-775-3613
> Web: http://www.onefastdaddy.com
> email: address@hidden
>
>
>
>
>
> On Sep 02, 2010, at 11:49 AM, "Prof. Dr.-Ing. Heinrich Warmers"
> <address@hidden> wrote:
>
> > Hello,
> > The sensors used by Booz and HB-Autopilot (ADXRS610)  have higher
> vibration resistance  and lower drifts.
> > You can also use Spakfun PCBs with the adxRS610 and glue them together
> to a cube . But this is expensive about 180 Euros.
> > The first sensors  LISY300AL  used by the diydrohnes project had poor
> vibrations resistance.
> > The Razor IMU has new sensors with better performance. Also the new
> IMUSENSE sensors have good performances to fly quadcopters and
> > normal planes. If you want to fly with  MEMS you must look that you have
> fully balanced the drive train (propellers).
> > Sometimes it is necessary to damp vibrations by the use of rubber mounts
> or foam.
> >
> > The advertange of the DCM algorithm introduced by William Premerlani and
> Paul Bizard is that they also take the centrifugal forces into account in
> > correcting the  gyro drift and to correct the orthogonallity of the DCM.
> Both are scientists and no hobbyist and wrote easy to understand documents
>  and take matlab simulations before going to the C code. Also a EKF was
> implemented.
> >
> > If very closer circles are flown with high speed the range of the
> acceleration sensors has to be extended.
> > Booz and HB-Autopilot can measure up to 5g. The new  HB autopilot  can
> measure  up to 6g. The RazzorIMU can measure up to 3g.
> > There is no  limitation  on the  speed.
> >
> > The diydrohens project works first as paparazzi  wiht IR-Sensors and
> AVR processors.  The community is very active:
> > normal planes, quadrocopters and helicopters.
> > Most of the hardware is sealed by Sparkfun.
> > You can by a IMU with processor for 99$  with  the same algorithms.
> > http://www.sparkfun.com/commerce/product_info.php?products_id=9956
> > In the actual version 1.7  also pressure  measurement and magnetometer
> signals  are taken into account.
> > It is also possible to use this system with the paparazzi Towg. There is
> a comment in the paparazzi  wiki..
> >
> > Regards
> > Heinrich
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > David Conger schrieb:
> >> Hello,
> >>
> >> Thank you CHristophe (and Dr. Warmers). This explanation below raises
> another question then. How are the UAV Devboard guys able to do it? Here is
> the link to the UAV Dev Board main page:
> http://code.google.com/p/gentlenav/wiki/MatrixPilot
> >>
> >> One of their users flies a FunJet > 100mph, not in a straight line
> only, quite well with the DCM code. How is this possible from a project so new
> by someone with no experience with UAV before?
> >>
> >> It should be noted that the code for the DIY is a simpler version of
> the orig. code from the UAV Devboard so maybe better results would come from
> code more like the UAV Devboard and not the DIY IMU.
> >>
> >> I want to help, try out code, fly, ask programmers I work with to take
> a look... but I don't want to use DIY code and still use IR to fly fixed
> wing. I also can not afford a 2000.00 IMU. To me Booz is fine because  anyone
> can assemble one or have one assembled from available plans or it can be
> purchased for about the same price as a VT100. I do not get the feeling
> having a 100.00 IMU will make all the difference. It's the lack of actually
> being able to do it or that it's not widely done with any IMU that seems to
> get the complaints from people I interact with. They simply point to the UAV
> Devboard and DIY for the examples.
> >>
> >> -David
> >>
> >> On Sep 1, 2010, at 11:34 PM, Christophe De Wagter wrote:
> >>
> >>> Hello,
> >>>
> >>> The AHRS works fine as long as there are no long-lasting kinematic
> accelerations. An airplane however does accelerate very often for a long time:
> for instance when making something as simple as a turn. This is a big
> problem for "Inertial/Magnetic-Only" AHRS. For quadrotors, as long as you hover
> or move slowly and always keep your nose in the same direction, these
> sensors are sufficient. For aircraft you NEED to compensate for kinematic
> accelerations. This is why either airspeed of GPS is required in order to make
> the filter stay within the +/-10 degree error range like thermopiles.
> >>>
> >>> The code in the HW branch uses this type of filter as was written by
> diydrones.
> >>>
> >>> If the Raisor IMU can be converted to accept GPS data, it could do the
> full computation. Once reliable attitude data is available, like you say:
> "it can simply be copied to the estimator variables"
> >>>
> >>> If you run for instance the XSens Mti-G Module (with internal GPS and
> barometer for kinematic conpensations), that is exactly what happens.
> >>>
> >>>
> >>> -Christophe
> >>>
> >>>
> >>> On Thu, Sep 2, 2010 at 8:16 AM, David Conger <address@hidden> wrote:
> >>>
> >>>     Hello,
> >>>
> >>>     I took a look at the HW branch code today. Am I correct when I
> think the HW code in razor_imu is bypassing the DCM code on the Razor and just
> using the ADC outputs and then calculating the Euler Angles in the
> Autopilot. Then feeding them to estimator.
> >>>
> >>>     Since the Razor is an AHRS already can't the outputs from the AHRS
> just be fed to estimator directly? Just over SPI feel the Euler Angles
> output into:
> >>>     From estimator.c
> >>>     /* attitude in radian */
> >>>     float estimator_phi;
> >>>     float estimator_psi;
> >>>     float estimator_theta;
> >>>
> >>>     I also see the wiring diagram in the HR branch shows IR sensors
> are still used alongside the Razor IMU. Is this because it's difficult to
> remove the IR code?
> >>>
> >>>     -David
> >>>
> >>>     On Sep 1, 2010, at 6:30 AM, address@hidden wrote:
> >>>
> >>>>     Germar, Have a look at the post by Prof. Dr.-Ing. Heinrich
> Warmers on 23 July 2010.
> >>>>     He has tested a low cost Sparkfun IMU ( RAZZOR IMU 6DOF Razor -
> Ultra-Thin IMU) with the paparazzi hardware.
> >>>>
> >>>>     From: paparazzi-devel-bounces+mark.griffin=itu.int@nongnu.org
> [mailto:paparazzi-devel-bounces+mark.griffin=itu.int@nongnu.org] On Behalf Of
> David Carlson
> >>>>     Sent: Wednesday, 1 September 2010 1:53 PM
> >>>>     To: address@hidden
> >>>>     Subject: Re: [Paparazzi-devel] AHRS over SPI on Tiny
> >>>>
> >>>>     Contact hwarm or check out his branch in svn.  I believe they
> have this IMU working with the autopilot already.
> >>>>
> >>>>     Buzz
> >>>>
> >>>>     On 09/01/2010 09:31 AM, Germar Walter wrote:
> >>>>     Hi,
> >>>>
> >>>>     We are building a fixedwing Aircraft with tiny board.
> >>>>     We want to replace the Thermopiles with a AHRS System. We have
> purchased the Sparkfun9DOF Razor IMU. On the IMU we are directly calculating
> eulerian angles via the code provided by
> http://code.google.com/p/sf9domahrs/source/list.
> >>>>     We have activated the SPI interface on the board to communicate
> with the paparazzi.
> >>>>     Has anybody done something similar or knows how to use the angles
> for roll and pitch for stbilization? The code from the gyro.c only takes
> analogue measurements, but since We have a digital interface we don't want
> to convert to analogue just to convert back on the paparazzi.
> >>>>
> >>>>     cheers
> >>>>     Germar
> >>>>
> >>>>
> >>>>
> >>>>     _______________________________________________
> >>>>     Paparazzi-devel mailing list
> >>>>     address@hidden
> >>>>     http://lists.nongnu.org/mailman/listinfo/paparazzi-devel
> >>>>
> >>>>
> >>>>     _______________________________________________
> >>>>     Paparazzi-devel mailing list
> >>>>     address@hidden
> >>>>     http://lists.nongnu.org/mailman/listinfo/paparazzi-devel
> >>>
> >>>
> >>>     _______________________________________________
> >>>     Paparazzi-devel mailing list
> >>>     address@hidden
> >>>     http://lists.nongnu.org/mailman/listinfo/paparazzi-devel
> >>>
> >>>
> >>> _______________________________________________
> >>> Paparazzi-devel mailing list
> >>> address@hidden
> >>> http://lists.nongnu.org/mailman/listinfo/paparazzi-devel
> >>
> >>
> >> _______________________________________________
> >> Paparazzi-devel mailing list
> >> address@hidden
> >> http://lists.nongnu.org/mailman/listinfo/paparazzi-devel
> >>
> > _______________________________________________
> > Paparazzi-devel mailing list
> > address@hidden
> > http://lists.nongnu.org/mailman/listinfo/paparazzi-devel

--
GMX DSL SOMMER-SPECIAL: Surf & Phone Flat 16.000 für nur 19,99 &euro;/mtl.!*
http://portal.gmx.net/de/go/dsl

_______________________________________________
Paparazzi-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/paparazzi-devel

_______________________________________________
Paparazzi-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/paparazzi-devel


reply via email to

[Prev in Thread] Current Thread [Next in Thread]