View Full Version : Discussion nanoAHRS, very small inertial attitude solution
jlcortex
May 29, 2009, 02:05 PM
Hi to all!
we are developing a small device that contains two PCBs, one with all inertial sensors (3 accelerometers, 3 gyros and 3 magnetometers, temperature sensor) and another one with a 32-bit microcontroller (LPC2387 ARM7)
Micro-USB Connector
microSD card (for data logging)
1x CAN-BUS
The approximate dimensions of the assembly are 39 x 36 x 10 mm and weight 17gr!!!
Connectivity:
we are thinking about nanoAHRS could be used in several aplications:
Autopilot - it have PPM input, 4x servo output and 2 serial port for GPS and Radiolink in order to make a simple autopilot.
FMA Copilot Emulation - it have 3 analog outputs for emulate FMA with a real inertial solution (direct connection to ardupilot, attopilot, paparazzi ...)
DIGITAL (asynchronous serial NMEA) - Another way to connect it could be this: connect GPS to nanoAHRS and then connect nanoAHRS to serial port of your device. so nanoAHRS can inject attitude data as a NMEA frame.
The AHRS algotithm is based on DCM update proposed by William Premerlani in DIYDRONES
we have a demostration video working over our old board (now it starts to work on new boars. i have to make a video very soon)
http://www.youtube.com/watch?v=BTE_qYrFWV8
It is not opensource, I am thinking about make full assembled cost-price boards in order to people can test it and can help me to develop it.
i have to calculate exact price but i think (all components including accelerometers gyros and magnetometers + 4 layers PCB + SMT assembly) could be about $150 - $180
my target is to arrange a group buy.
jlcortex
nMine.com
jglenn
May 29, 2009, 06:26 PM
Pretty cool, where are you located? The price seems a bit low, 4 layer boards
are expensive, especially in small quantities, and if you plan on automatic assembly, the laser cut solder mask screens are costly. I do a lot of hand mount smd work, down to pretty fine pitch (takes more time) with both hot air/
solder paste, and just an iron, which is best for SOIC and 0805 parts.
Curious what magnetometer chip you are using. The software sounds like a bear, I try to follow the Ardu and Atto guys threads, sometimes overpowering.
Kalman filter? How do you fuse the sensor data? Ground station?
Oh, checked your site, what is the advantage of virtual gyros? The simpler
hardware makes the software more complex, I never heard of that trick.
Maybe to save weight?
jlcortex
May 30, 2009, 04:14 PM
Hi jglenn,
I am from Spain,
Yes, all in this board is expensive (sensors, PCBs and assembly). resistors and capacitors are 0603 and sensors are very hard to solder "Lead-Less-Package"
due to solder dificulties, i preffer to assembly here in my city (Valencia), there are very professional assembler and very nice people here in my city.
the magnetometer are very new IC from honeywell, it works really well!
AHRS data fusion is based in a powerful, efficient and very interesting algorithm proposed by William Premerlani in DIYDRONES. it is based on DCM representation and PI controllers for drift tracking, it have some advantages over conventional kalman structure.
we have make an interesting work on PC software, we can not call it "ground station" because it is diferent aproximation.
jglenn
May 30, 2009, 04:27 PM
Looks interesting! Have you flown it yet? The plane looks like a Stryker,
for sure those need an autopilot, if you are not used to fast planes. I prefer
slow. What is the honeywell mag part #?
0603 is on the tiny side. Do you plan any US distribution of your unit? They
don't care if you ship it here?
Why did you make the virtual gyro? Does it work in flight?
jlcortex
May 31, 2009, 04:09 PM
hi jglenn,
i have not flown it yet, i hope to make some test next weeks, the first test will be to log data in the SD card in flight.
at the moment i am planning to supply some units for beta testers from anywhere. shippin it into US is easy, i think the problem is to send this technology from US to other countries.
virtual gyro is a idea to calculate gyros from two acelerometers, we have tested it on the desk, and it seems to work (it is very critical!)
now there are inexpensive gyros and it start to have no sense
jglenn
May 31, 2009, 07:09 PM
Yes, with cheap IC gyro, I wondered why you did it, but it seemed different.
Flight testing is valuable, be careful not to crash. Rear engine high speed
planes require an experienced pilot. I have a friend that flys 3D, builds custom
scale birds from foam, an artist. Sometime I will post a pic of the WW1 biplane he made for me that weighs 5 ounces, flies slow. One problem I had on my 80MPH
Stryker is the aileron servo's were not strong enough, had to get better ones.
The Honeywell mag sensor is probably digital, I2C. Wanted to look up the data
sheet, since I favor mag sensing for quasi-inertial sensing. Sort of like your
trick with X\Y accel to do gyro. For limited use, I have flown a plane with just
earth mag sensing to correct for attitude. Mainly I want to fly level, not fancy
stunts, so an IMU may not be necessary for many missions.
UAV's are hot for anti-terrorism, our gov may hate the hobby ones. As a model rocket person, have already been called a "nerd terrorist" by a
Congressman! :cool: (Schumer). :censored:
If you need a US distributor, I would consider, if able to test one.
HELModels
Jun 01, 2009, 11:55 PM
The flexible interface/outputs is brilliant. That makes it modular, portable and platform independant.
jlcortex
Jun 18, 2009, 11:51 AM
artificial horizon connected through Xbee PRO
all ready for first flight test!
http://www.youtube.com/watch?v=boPrqnCy0n4
jlcortex
jlcortex
Jun 22, 2009, 01:54 PM
Centripetal force compensation is a algorithm than compensate centripetal forces effect over accelerometers so AHRS could get a correct attitude measurement during large turns.
Effect of centripetal force could be a problem if the plane stay in a turn for a large time, for example doing circles.
we are using a simple record player to test centripetal compensation.
http://www.youtube.com/watch?v=fW5Lsee6jz8
jlcortex
nmine.com
dmgoedde
Jun 23, 2009, 02:32 PM
AHRS data fusion is based in a powerful, efficient and very interesting algorithm proposed by William Premerlani in DIYDRONES. it is based on DCM representation and PI controllers for drift tracking, it have some advantages over conventional kalman structure.What - no Kalman filtering?!? Welcome to the IMU heretic club. Watch out that you don't get jumped on by others that 'know better'. Amen.
jglenn
Jun 23, 2009, 04:53 PM
He should provide the details on why it is better than Kalman filters.
Nasa and others have used his filter for decades, it is almost artificial
intelligence, as I understand it. Reminds me of fuzzy logic a bit. Do
you know about that? The japanese are big on it, but some engineers
I respect, like Bob Pease in EDN, say it is not so much. There are many
ways to solve problems, and designers are like cooks. Only one per kitchen!
:censored:
airmcn_3
Jun 23, 2009, 05:39 PM
He should provide the details on why it is better than Kalman filters.
Nasa and others have used his filter for decades, it is almost artificial
intelligence, as I understand it. Reminds me of fuzzy logic a bit. Do
you know about that? The japanese are big on it, but some engineers
I respect, like Bob Pease in EDN, say it is not so much. There are many
ways to solve problems, and designers are like cooks. Only one per kitchen!
:censored:
Never was there a statement that his system is better or worse the Kalman filtering. As you stated yourself there are many ways to solve problems as long as the result ends up the same.
Look at it this way, just because NASA has billions of dollars to fund projects that require thousands of individuals do not mean they do everything the best. Kalman was designed back in the 70's I believe. My grandfather worked for NASA for 24 years, I once asked him why they have not updated the space shuttle with new computers and systems. His simply stated the way they see it is, if it works don’t fix it.
What I am getting at is there are other individuals in the world that may be far beyond NASA in how they implement their code or what code is written or at least hip with the 21st century. The end result is the same. The question is, why would NASA spend millions on writing a new updated code when the one they have has and continues to work perfectly fine?
dmgoedde
Jun 23, 2009, 06:05 PM
1960 R. Kalman paper: "A New Approach to Linear Filtering
and Prediction Problems". The method tracks variance (square of standard deviation) of the model and inputs (predictive and measurment based) to optimally track a best guess estimate, statistically speaking. The method was a quantum leap for navigation to the moon using noisy radar ranging information and at various time intervals; previous method for moon shot would have required evenly time-spaced measurements as one drawback. The method was condensed to run on 8 bit computers in the spacecraft.
In my experience I don't see all that much noise in most modern MEMS gyros and accelerometers. Especially with proper RC filtering of the accel analog data. Perhaps this is why the DCM and my methods (and those in the Kestrel2) work so well? Data not being so noisy = perhaps less need for optimal filtering? I can vouche that my method stays well converged in real world flight, and minimal foam padding of the IMU. Throw in a magnetometer for the nanoAHRS and I'm sure they got a rock solid system, even without KF or EKF.
jglenn
Jun 23, 2009, 06:23 PM
I an not a mathhead, but I think it is more than noise tolerance that makes
the Kalman great. It has predictive abilities. When fed by a few sensor
channels, when one or two drop out, it can compensate by inferring from the
remaining. I have seen the results in predicting the apogee of a rocket,
where simple raw alt or rate processing is either early or late.
A more stringent area of control is missiles. Things happen pretty quick.
UAV's are in slow motion in comparison. Not to judge anyones routines or
techniques, if they work, they are valid. Probably the best test is to put
different units on the same plane, and put it through some rough manouvers.
BTW, the Apollo computer was 16 bit!
http://ed-thelen.org/comp-hist/vs-mit-apollo-guidance.html#Architecture
Instruction Set: Approximately 20 instructions;
100 noun-verb pairs, data up to triple-precision
Word Length: 16 bits (14 bits + sign + parity)
Memory: ROM (rope core) 36K words; RAM (core) 2K words
Disk: None
I/O: DSKY (two per spacecraft)
Performance: approx. Add time - 20us
Basic machine cycle: 2.048 MHz
Technology: RTL bipolar logic (flat pack)
I did some work at GRC on an ISS project, eurocard embedded pcs, mostly
circuit hacking and board layout. They use 386 cpu's for non-critical use
because the transistors in Pentiums are so small, particles and rays up there
cause bit flipping. The older chips are more reliable. Kinda dumb, really.
Never
A
Straight
Answer
Paul_BB
Jun 24, 2009, 04:43 AM
I have compared DCM with an Extended Kalman Filter. The EKF has 7 states: quaternion (4) and gyro offsets (3). I used my simulator for the comparison.
Both algorithms have the same inputs, they work in parallel. I then compare the euler angles. The plane is a CG Super Chipmunk: looping, rolls etc.
For a given capability to swallow gyro offset (robustness) the EKF is more accurate, maybe by a factor 5 or 10.
Put it another way, for a given accuracy the EKF will be less sensitive to noise from the accelerometers and gyros by the same factor.
But on the long term, the offsets in the estimation of the gravity vector (e.g. steady state turn) will have the same effects on both algorithms.
So its is important to have the cleanest estimation of the gravity vector (and the heading).
Now the computational load of the EKF is maybe 100 or 1000 times greater than the one of the DCM.
So one must choose EKF or DCM or equivalent depending on their requirements, the performance of the gyrometers etc.
jglenn
Jun 24, 2009, 07:29 AM
Does your testing vindicate the Kalman? Or is it outmoded and ancient?
Do top shelf units use it, like the Kestrel? Is this a judgement call?
Why cannot the magnetometer data provide the estimation of the gravity vector?
I would think the Propeller, with eight 16 bit cpu's, could implement Kalman.
That is as much power as a fleet of Lunar Modules!
Paul_BB
Jun 24, 2009, 08:16 AM
[QUOTE=jglenn]Does your testing vindicate the Kalman? Or is it outmoded and ancient?
Do top shelf units use it, like the Kestrel? Is this a judgement call?
No vindication nor judgment ! :)
Each algorithm has its pros and cons. Kalman is more performant but is much more expensive. The choice depends upon the application.
DCM is so simple ! Largely enough for a RTL kind of application. For agressive aerobatics I would choose EKF.
I have compared DCM and Kalman. Not Dean's algorithm and Kalman: maybe Dean's algorithm is better than DCM because he has some special refinements. I don't know and it is none of my business. :)
If I had a lot of spare computational power then I would go for EKF.
You need two independent vectors to correct your attitude estimation. The more perpendicular they are the better.
airmcn_3
Jun 24, 2009, 12:09 PM
Does your testing vindicate the Kalman? Or is it outmoded and ancient?
Do top shelf units use it, like the Kestrel? Is this a judgement call?
Why cannot the magnetometer data provide the estimation of the gravity vector?
I would think the Propeller, with eight 16 bit cpu's, could implement Kalman.
That is as much power as a fleet of Lunar Modules!
Not outmoded or ancient just old........
Kestrel II does not use Kalman filtering.
Prop chip will do more then you need.
Watch out NASA! LOL
reedchristiansen
Jun 25, 2009, 12:43 AM
Kalman is being thrown around pretty generically these days. There are lots of ways to do efficient and robust attitude estimation. A classic KF implementation, given white, gausian noise is proven to converge on an optimal solution. If you implement an extended KF that goes out the window - so why is everyone stuck on it? It's like the Intel Inside sticker or something. Can't be caught without one of those on my homebuilt autopilot.
"Kalman Inside" or "Kalman Powered"
The discusion about the quality of an AHRS product should probably center more around the accuracy of the solution in static and accelerated flight vs whether or not the internals involve the propagation of a covariance matrix.
Regarding the nanoAHRS - it looks really good. If it performs as stated then making an autopilot from scratch just got allot easier. In addition to shaving tons of dev time, it would really cut production costs by eliminating the expensive and time consuming temp comp, scale factor, and alignment procedure. This definitely removes some entry barriers for people who want to make and sell small autopilots.
A few questions - and maybe these have already been asked:
1. How does the attitude solution perform when there is magnetic interference nearby - We can assume yaw is messed up, how about the rest of the solution?
2. Does the inclination and declination have to be known?
3. Does it accept a GPS input? How about Baro? Airspeed?
Reed
Not outmoded or ancient just old........
Kestrel II does not use Kalman filtering.
Prop chip will do more then you need.
Watch out NASA! LOL
Paul_BB
Jun 25, 2009, 02:22 AM
1. How does the attitude solution perform when there is magnetic interference nearby - We can assume yaw is messed up, how about the rest of the solution?
As for any other attitude estimator, if the yaw error is of 90°, the pitch correction will "correct roll" and vice versa.
Paul
airmcn_3
Jun 25, 2009, 02:26 AM
Kalman is being thrown around pretty generically these days. There are lots of ways to do efficient and robust attitude estimation. A classic KF implementation, given white, gausian noise is proven to converge on an optimal solution. If you implement an extended KF that goes out the window - so why is everyone stuck on it? It's like the Intel Inside sticker or something. Can't be caught without one of those on my homebuilt autopilot.
"Kalman Inside" or "Kalman Powered"
The discusion about the quality of an AHRS product should probably center more around the accuracy of the solution in static and accelerated flight vs whether or not the internals involve the propagation of a covariance matrix.
Regarding the nanoAHRS - it looks really good. If it performs as stated then making an autopilot from scratch just got allot easier. In addition to shaving tons of dev time, it would really cut production costs by eliminating the expensive and time consuming temp comp, scale factor, and alignment procedure. This definitely removes some entry barriers for people who want to make and sell small autopilots.
A few questions - and maybe these have already been asked:
1. How does the attitude solution perform when there is magnetic interference nearby - We can assume yaw is messed up, how about the rest of the solution?
2. Does the inclination and declination have to be known?
3. Does it accept a GPS input? How about Baro? Airspeed?
Reed
Reed,
I agree with all your statements, Kalman is great if that is what you chose to use but there are other ways as you said.
I was simply answering the question asked, can’t answer the above....
Chris
jlcortex
Jun 26, 2009, 03:15 PM
i think it is a error to compare DCM with Kalman
DCM or Quaternions are only attitude representations. i think performance of both are pretty near.
Kalman is a gyro drift tracking method
we are not using kalman we are using PI controller also called "explicit complementary filters", i undestand it is a equivalent implementation than complementary filters but in a diferent shape.
Complementary filters have been used for year in tactical navigation grade.
obviously Kalman is better than complementary filter but both solutions are better than necessary for our applications
for performance comparison it is more important the quality of gyros... and i am using the most cheap gyros :D :D :D
I have tested my solution in flight and it works surprisement well!
at the moment i have only tested a roll closed loop control. but i am finishing my autopilot.
A few questions - and maybe these have already been asked:
1. How does the attitude solution perform when there is magnetic interference nearby - We can assume yaw is messed up, how about the rest of the solution?
2. Does the inclination and declination have to be known?
3. Does it accept a GPS input? How about Baro? Airspeed?
In my experience magnetic interference produce a small degree error, but it is easy compensated with autopilot PID so it is not critical. obviously we have to work more in AHRS!
nanoAHRS have 2 spare analog inputs than i am using for pitot tube.
next board (i have assembling now) have a digital absolute pressure for altitude.
yes, inclination and declination have to be known, we are meassuring in for local position. but we can implement a magnetic field model in a future (please help).
The_Todd
Jun 26, 2009, 05:04 PM
I agree with jlcortex in his previous post. People are confusing filtering (kalman) with orientation representation (DCM, Quaternions). There is nothing new with either method, they are not competitors.
Filtering takes noisy data (which all sensors have) and tries to produce the desired useful data, Kalman is just one method among many (butterworth low pass, high pass, moving avg., etc...). Kalman just happens to be useful for estimation (i.e. Taking the current state to "estimate" the next state), while trying to remove the integration errors from random white noise. The drawbacks hobbyists have for implementing proper Kalman filters is that the dynamic coefficients of model planes are not quantitatively known (i.e. rudder deflection to roll rate denoted Lr in linear aircraft dynamics ). This is why actual aircraft spend many hours in wind tunnels, so then with these parameters, the estimation filters can be mathematically proven stable and converge (Eigenvalues less than 1 for discrete system). Also, generation of Gaussian White Noise to add in to the Kalman equation is processor intensive.
Orientation Representation however, simply gives just that, the orientation. For example a compass gives yaw heading, this is one form of orientation, the same way that DCM (Direction Cosine Matrix) contains Euler angles of yaw, pitch, and roll. DCM is used as a standard method in undergraduate introductory Kinematics / Dynamics courses, seek a dynamics book (such as Hibbeler) for more information. DCM works fine for forward kinematics, but poses issues for inverse kinematics because it can become non-invertible in some situations (the Determinate equals zero), this problem is overcome with Quaternions which operates in the spherical domain, but adds complexity.
Now you see that you cannot compare Kalman to DCM, it is comparing apples to oranges. In fact it is common to use Kalman filtered data to produce the DCM Matrix. They are not competitors with eachother whatsoever. Hopefully this post will put some of these things to rest.
The_Todd
Jun 26, 2009, 05:19 PM
This post is off topic of my last one so I decided to separate them.
jlcortex, I have been following your progress and wanted to give you some encouragement, it looks like you've made outstanding progress so far! I have been working on my own embedded autopilot in spare time using an ARM processor (STM32 cortex-m3), and am hoping that we could do some collaboration in the future. Specifically I would like to utilize your AHRS for my autopilot, and preferably read its filtered data over the CAN-Bus (adding this distributed bus architecture functionality will make your AHRS very powerful and useful to many people like me). Please checkout one of my projects here (TresCopter) (http://www.trescopter.com/Home/overview). The Autopilot I'm developing will initially work on planes as that's easier, but using the bus-architecture it should work for almost anything.
Anyways, my Autopilot is currently in the software simulation environment, and I'll buzz you later when I'm looking into a hardware AHRS. Keep up the good work.
Regards,
Todd
jlcortex
Jun 27, 2009, 06:53 AM
Hi Todd,
your designs about 3 rotor helicopters are very nice!
it could be very interesting to collaborate with you. There are a lot of people asking for use nanoAHRS in multirotors
About using nanoAHRS in other projects, yes it is my idea, in fact i was designed it only as attitude sensor.
i can see you also like CAN-BUS, we have experience with CAN-BUS in race aplications. it is incredible easy to connect diferent devices (from diferent manufacturers) with CAN-BUS.
i attach a typical channel configuration in our greatkhan aplication (this board have 2 CAN-BUSes
Paul_BB
Jun 27, 2009, 09:15 AM
I agree with jlcortex in his previous post. People are confusing filtering (kalman) with orientation representation (DCM, Quaternions).
Hi Todd,
When some people here on RC Groups or DIY Drones talk about DCM as an attitude estimator it is just a misuse. The DCM firmware from Bill Premerlani make use of a PI filter to correct the DCM (state) estimation. The DCM is propagated by means of the gyrometers. The theory is well known and Dr Bob Mahoney has written a paper about it. B. Premerlani could have used the quaternion representation but he decided not because he wanted to base his lateral and longitudinal guidance (next step after the attitude estimation) on cross and dot products between body, earth frame and other vectors.
It is true that the propagation + renormalization of the quaternion is sligthly more robust (less drift) than the one of the DCM.
By the way there is no singularities inherent in the DCM, it is a rotation matrix whose determinant is worth 1. It is kept normalized (as the quaternion is also) during the propagation process. :)
Best regards,
Paul
dmgoedde
Jun 30, 2009, 04:04 AM
You need two independent vectors to correct your attitude estimation. The more perpendicular they are the better.Ja - ideally you get two references in a 9 DOF system that happen to be roughly perpendicular, or at least perpindicular enough to get the job done and provide enough data to bias correct not only pitch and roll but also yaw gyro, AND perform dead reckoning navigation in the even GPS lock is lost. Gravity down and magnetic is North-ish. Both gravity and magnetic are lumpy if you want to be a pain in the arse and split hairs, however we can assume in a small sUAS flying zone they are pretty constant.
Paul_BB
Jul 03, 2009, 08:43 AM
As for any other attitude estimator, if the yaw error is of 90°, the pitch correction will "correct roll" and vice versa.
Paul
My bad: I am wrong ! The DCM RP estimation is totally independent from the yaw estimation ! :o
jglenn
Jul 03, 2009, 09:13 AM
[QUOTE=The_Todd] DCM works fine for forward kinematics, but poses issues for inverse kinematics because it can become non-invertible in some situations (the Determinate equals zero), this problem is overcome with Quaternions which operates in the spherical domain, but adds complexity.
Todd: I'm trying to learn a little here, this math and theory is tough.
What is inverse kinematics? Going backwards in time? :confused:
I've made an attempt to simplify attitude sensing by using a special type
of electronic compass device to detect the vertical and horizontal flux lines
separately. There are many problems with this, but the biggest source of
interference I get on a plane is from the motor, ESC, and battery wires. Of course it changes with throttle positions. I might want to try an IMU board set in the future. Saving pennies.
vBulletin® Copyright ©2000-2009, Jelsoft Enterprises Ltd.