Building a solid state artificial horizon - Page 1
Forum section: electronics / projects

author: peter-h
author_rank: Super Contributor
timestamp: November 15, 2020, 03:10:12 pm
content: Following thishttps://www.euroga.org/forums/maintenance-avionics/6537-random-avionics-internals/post/263145#263145I was wondering how this could be done with current technology.It seems there are two kinds of accelerometers:* yaw rate - these measure rotational acceleration around a single axis e.g. ADXRS613* G - these measure absolute G, usually along all three axes concurrently eg. ADXL335To get pitch, you use the 1st type and orient it to measure acceleration around the pitch axis, then integrate twice to get the pitch angle.Same for roll.And same for yaw, if you want yaw.But the above will drift - because the yaw rate accelerometers drift i.e. return some acceleration even when there isn't any. So you need to do two things* use the 2nd type above to sense the gravity vector and use that as a slow background erection process (what the famous pendulous vanes do in a vacuum AI)* assume that the plane will be mostly straight and levelandbe able to detect such phases of flight and use the above data especially during those phasesObviously the last one is a big assumption! But there is no way around that. There is no fixed frame of reference which can be independently detected. The only way is inertial, suitably initialised, and periodically corrected.

author: Alti
author_rank: Frequent Contributor
timestamp: November 15, 2020, 04:06:46 pm
content: Quote from: peter-h on November 15, 2020, 03:10:12 pmADXRS613 does not measure angular acceleration but angular velocity.QuoteIf you want to integrate then you integrate sum: noise and useful signal. As you describe, more data is necessary to filter out unwanted junk. Compass, acceleration, GPS, stellar navigation.

author: Siwastaja
author_rank: Super Contributor
timestamp: November 15, 2020, 04:12:22 pm
content: There are no such "two types of accelerometers", ADXRS613 is a gyroscope, not accelerometer.Accelerometers measure acceleration (m/s^2 or g), gyroscopes measure rotational speed (rad/s, deg/s, whatever).For artificial horizon, you want an inclinometer. For a slow, stationary device, just average the accelerometer value over time to reduce noise and contribution of accidental vibrations, and that's it.But to build one which is responsive in moving environment, which you definitely want in an aircraft, you need both 3D accelerometer and a 3D gyro. A lot of integrated products available for both gyros and accelerometers in one chip.Calculate pitch and roll from accelerometer.Integrate pitch and roll from gyroscope. The hardest part is to understand you need to rotate the gyro readings and not just integrate directly the euclidean angles.Then, filter pitch and roll: use the gyro integrals, but sum say 0.1% of the current accelerometer-based pitch,roll values to the integrators. This way, you get the responsitivity from the gyros, but the accelerometer corrects the gyro drift, yet you take such small part of the acceleration that sudden accelerations do not show in the result.

author: peter-h
author_rank: Super Contributor
timestamp: November 15, 2020, 05:50:41 pm
content: "Then, filter pitch and roll: use the gyro integrals, but sum say 0.1% of the current accelerometer-based pitch,roll values to the integrators. This way, you get the responsitivity from the gyros, but the accelerometer corrects the gyro drift, yet you take such small part of the acceleration that sudden accelerations do not show in the result."This is the big question. You have to assume that the aircraft will be mostly straight and level.In some implementations, GPS data is used for this. If the GPS track is constant then a zero-roll is assumed. If the GPS altitude is constant then a constant-pitch is assumed. There are problems with this, of course, e.g. flying upside downOr flying at a constant roll angle (which needs lots of constant yaw). These conditions can't be detected unambiguously.

author: Siwastaja
author_rank: Super Contributor
timestamp: November 15, 2020, 05:52:56 pm
content: No, you don't need to assume that, that's the whole point. You get very reliable and responsive pitch and roll from combining acceleration vector over longer time (~ minutes) with gyros (which are quite stable during a few minutes, even the cheap ones, if you do after-assembly offset calibration). I know for sure because I've done exactly that.Acceleration vector averages to the earth's gravity in fairly short timeframe (tens of seconds, maybe a few minutes); you can't have very long sustained large acceleration, otherwise you would be going at ridiculous speeds. It's enough that gyros don't significantly drift during that timeframe.However, you can't get yaw with the gravitation vector; hence yaw is only defined by the gyro integral, and subject to the long-term drift. You can add magnetometer (compass) to the mix to get long-time average of the yaw, then increase the responsivity by the gyro, again. But magnetometers add another can of worms and are far less accurate and stable compared to the strong gravity vector.Adding complexity to the mix allows the full estimation of yaw, and finally, position, but that's going to be a full-fledged navigation suite which is worth of writing books about - and secret sauce of many, many navigation companies.

author: fourfathom
author_rank: Super Contributor
timestamp: November 15, 2020, 06:16:06 pm
content: Can you get useful corrections using a magnetometer? Some newer chips (9-DOF) include a three-axis magnetometer which could be used to resolve ambiguous orientation. With GPS position information you can correct for magnetic variation and dip.

author: Siwastaja
author_rank: Super Contributor
timestamp: November 15, 2020, 06:20:11 pm
content: Magnetometer could be quite usable in an aircraft, averaged both temporally and spatially (over different areas).Magnetometer is more difficult to calibrate against the soft and hard iron errors caused by the aircraft itself. You need a jig and a manufacturing process for it.My experience with magnetometers in indoor navigation is they are almost useless, well maybe acceptable to +/- 30 deg. Too much iron and magnetic fields everywhere, think about rebars and power wiring; and no time and space to average over large areas.GPS obviously changes the game, but OTOH if you buy GPS, you can easily buy a complete solution where all this navigation wizardry has been taken care of.Yaw is really the problem. As is translation, double integrating the accelerometer is impossible with real-world low-cost accelerometers. (I have been playing with this during this weekend but my math skills are lacking. Yet I'm getting somewhat sane translation estimates (say +/- 50%!) during timeframe of a few seconds, which I already call a success!)But pitch and roll are quite easy!

author: fourfathom
author_rank: Super Contributor
timestamp: November 15, 2020, 06:51:45 pm
content: A friend and I have been considering building an inertial position sensor for a submersible ROV, but I suspect that the accuracy and stability of the cheap sensor chips will be a problem. However I am impressed by how well the sensors in my cellphone work to detect the phone 3-axis orientation (the "Stellerarium" astronomy app does a very good job of knowing where I am aiming the phone). If GPS worked underwater then ROV location information would be easy... Another approach would be 3-D hyperbolic sonar positioning using three detectors (or emitters), but a self-contained inertial unit would be much cleaner.So I've played with the 9-DOF sensors on my bench, but getting the accuracy and stability I need seems questionable.

author: Siwastaja
author_rank: Super Contributor
timestamp: November 15, 2020, 06:57:58 pm
content: With inertial (gyro + acc) only, you can't get beyond pitch and roll.Yaw can be stable within tens of minutes, or many hours with expensive gyros, but you still need to reset it every now and then; as bare minimum, at start.

author: pwlps
author_rank: Frequent Contributor
timestamp: November 15, 2020, 07:06:17 pm
content: Apparently the stability of MEMS gyroscopes isn't that bad:http://www.tkt.cs.tut.fi/research/nappo_files/Symposium_Gyro_Technology_2010_web.pdf

author: peter-h
author_rank: Super Contributor
timestamp: November 16, 2020, 07:24:35 am
content: From the above it appears that for pitch/roll you don't need a stable accelerometer, but of course you do need one for velocity and then position (i.e. navigation).A gyro alone won't give you velocity because it can't sense acceleration along a straight line; is that correct?

author: Siwastaja
author_rank: Super Contributor
timestamp: November 16, 2020, 09:59:29 am
content: Quote from: pwlps on November 15, 2020, 07:06:17 pmI'm working with one of these guys right now, and another is my former boss.Proper filtration and algorithm work is crucial for getting good performance out of cheap IMUs, it isn't trivial.It's also a lot of easier to get get an algorithm work on a lab table, but when subjected to large temperature differences and aging, problems may arise.You may also want to look up the idea of creating a redundant array of low-cost IMUs and process the data together; preferably going beyond simple median-average filter, but even that would be a good safeguard against outlier chip aging in a bad way.

author: Siwastaja
author_rank: Super Contributor
timestamp: November 16, 2020, 10:06:59 am
content: Quote from: peter-h on November 16, 2020, 07:24:35 amYes, this is correct.Gyros are so great because they sensespeedwhich is a much better starting point for integrating position, than acceleration. But gyros can only measurerotationalspeed.You would really want a linear speed sensor, but that it physically impossible without some kind of contact (visual (camera, laser time-of-flight), touch (wheel on the ground; pitot tube "touching" the air...), etc.) to the reference point/plane.From inertial data only, you get linear velocity (let's say translation) by integrating acceleration from the accelerometers once to get linear speed, then integrate the speed to get position. This is mostly theoretical; low-cost IMUs are orders of magnitude too inaccurate for this. Not sure about very expensive (say, military?) sensors, though. Maybe it's possible in practice. It's not only about inaccuracy, you also need to separate the gravitation vector from the motion-causing acceleration; the latter you want to measure. Think about it, if you just integrate the acceleration vector of a level, stationary sensor, your speed is increasing by 9.81 m/s^2. After 10 seconds, you are going 98 m/s downwards. If your sensor was guaranteed to be perfectly level, you could subtract 1g, but real sensors are not perfectly level; if you tilt the sensor a little bit, the accelerometer integral wrongly thinks you are rolling in a downhill with no friction to ever slow you down!I don't shine at the math, but my impression is you definitely need to add gyros so you can know exact, realtime pitch/roll (the easiest part as we discussed; although you need such high accuracy it might not be easy after all), and using them, you can generate the expected gravitation vector, which you can then subtract from the immediate accelerometer reading to get residual acceleration. This is something I have tested and got stable position estimates fora few seconds.

author: peter-h
author_rank: Super Contributor
timestamp: November 17, 2020, 02:27:38 pm
content: For ahorizon, the funny thing is that a mechanical gyro which uses a flywheel in a gimbal with two degrees of freedom (pitch and roll) is accepted as ok for aviation use, despite having to have a means of sensing the gravity vector so it erects to start with and remains generally erected during a flight.The erection is done with various weird means e.g. in an airflow (vacuum) driven AI you have little pendulums which mess around with the airflow until the thing erects.So the same old assumption is being made that most of the time you are flying straight and level.But if you do the same thing electronically, you can't get it certified - as a primary instrument. All the certified solutions use GPS (constant track plus constant altitude = straight and level flight) or airdata (constant magnetometer heading plus constant altitude = straight and level flight). Look up a Garmin GI 275 for example. That uses GPS.Navigationis a different issue; that obviously needs really precise accelerometers and if you get those then you can get your 3D position from that alone. But can you? The Apollo programme used rate gyros, no accelerometers, so how did that work? And modern fibre optic gyros also give you rate - angular velocity around one axis - but airliners, ISBMs and subs have super accurate 3D navigation. You can't do that with just angular rate gyros.

author: Siwastaja
author_rank: Super Contributor
timestamp: November 17, 2020, 02:39:13 pm
content: I don't fully know what goes in the mechanical version, but the electronic version doesn't need to assume mostly straight&level flight; it works even if you stay 80 deg pitch and 70 deg roll for two years straight.The algorithm I have described in my posts just needs to assume you don'taccelerate too long without opposite negative acceleration, which is an easy assumption to make because the speed is finally quite limited, even with supersonic aircraft. If you accelerate by 0.1g for a minute, and average acceleration vector for 10 minutes, the error the acceleration has caused to the gravity vector is just 0.01g, which would be 0.6 deg error in indicated pitch.Start-up time sucks with the naive implementation, though, and you can improve the start-up time significantly if you can assume the aircraft is straight&levelduring startup, so you can reset the pitch&roll integrators to zero. Or if you can assume no acceleration is happening during startup, you can reset the integrators to the immediate (unfiltered, or filtered for just a few seconds) acceleration vector from the accelerometer.

author: Siwastaja
author_rank: Super Contributor
timestamp: November 17, 2020, 03:01:33 pm
content: One practical experiment to get you going in this would be,Get a breakout board for some 6DoF (3D gyro + 3D accelerometer) MEMS chip for your favorite platform (for example, Arduino shield).Create two artificial horizons on screen: for the first one, use the instantaneous accelerometer values:acc_eulers.roll = atan2(acc.y, acc.z);acc_eulers.pitch = atan2(-acc.x, sqrt(sq(acc.y)+sq(acc.z)));acc_eulers.yaw = 0; // no idea about yaw with accelerometerFor the second one, integrate the gyros. Note that treating gyro axes as euler angles directly produces wrong results if multiple axes are rotating simultaneously, the transformation math to fix this is left for the reader, but this shows the concept and isn't too far off for initial testing:static gyro_eulers;gyro_eurlers.roll += gyro.x * unit_conversion_constant * dt;gyro_eurlers.pitch += gyro.y * unit_conversion_constant * dt;gyro_eurlers.yaw += gyro.z * unit_conversion_constant * dt;Now run the thing and see what happens. Spoiler: one of the horizons show correctly when stationary, and never drfits, but is very touchy if you move the thing. Another one of them tracks sudden movements very closely with practically no delay at all, but suffers from longer term drift. Now think about how to combine the data.

author: uer166
author_rank: Super Contributor
timestamp: November 17, 2020, 05:42:36 pm
content: Quote from: Siwastaja on November 17, 2020, 02:39:13 pmThat doesn't sound right, a coordinated turn should be indistinguishable from straight and level. If you fly in a big circle maintaining the acceleration straight down referenced to the aircraft, so you can't disambiguate being in a, say, 20 degree constant turn from a 0 degree level. Of course, this is where GPS would catch the fact that you're turning.

author: fmkit
author_rank: Contributor
timestamp: November 18, 2020, 07:42:32 am
content: Before MEMS become cheap I used Infrared Thermopile Sensors to stabilize my 40" RC flying wings.Long coordinated turn and vibrations do not affect the AH. It takes two pairs of 10-15um sensors and very little computing.

author: peter-h
author_rank: Super Contributor
timestamp: November 18, 2020, 07:52:23 am
content: "That doesn't sound right, a coordinated turn should be indistinguishable from straight and level. "Yes that is exactly right - as any pilot will knowWhat Siwastaja is saying is that you can sort this out by bringing a gravity vector sensor into it, but the gravity vector whichalsopoints directly down at the floor during a correctly coordinated turn, so I don't understand how that can work.But also in a coordinated turn, constant altitude, G will be more than 1, and this condition can persist permanently (well, until the fuel runs out).

author: Siwastaja
author_rank: Super Contributor
timestamp: November 18, 2020, 10:28:50 am
content: Yes, my naive implementation suffers also from flying in circle "forever", I did miss that possibility.You can't accelerate for a very long time (otherwise the speed would reach impossible proportions), but youcancircle for a long time, although you usually won't do that.

author: peter-h
author_rank: Super Contributor
timestamp: November 18, 2020, 02:37:17 pm
content: One possible way to disambiguate the situation would be to use the accelerometer to detect more than 1 G. That, together with a straight-down gravity vector, will tell you that you are in a coordinated turn. A 30 degree roll angle is 1.414G and a 60 degree one is 2G (and needs a fair bit of power, too).One problem I see is that accelerometer FSD drift is quite significant (especially over temperature) and seems to exceed the sort of G deviations which you would get in say a 5 degree roll angle (just maybe say 1.03G).Some info herehttps://github.com/cyoung/stratux/wiki/All-About-AHRS. I see they are doing the usual cheat by using GPS speedThey are using GPS as a quick hack but there is a better way: If you see say 10 seconds of constant GPS track, you assume wings-level flight, and zero the roll angle. But you can't zero the pitch angle because most normal planes cruise at about 2.5-3.0 degrees UP pitch. Also you can't zero yaw, because one can fly a plane with a heavy foot on the rudder, permanently (no solution to that afaics). That is a reasonable approach for roll fixing, unless the plane is upside down, but (a) upside down flight as a result of loss of control will never produce a straight GPS track etc and (b) types which have an engine installation capable of sustained inverted flight are rare, and anyway you can document that limitation.

author: Siwastaja
author_rank: Super Contributor
timestamp: November 18, 2020, 03:32:19 pm
content: Sorry a stupid question but what is accelerometer FSD drift? I tried to google the term to no avail.In the simplistic algorithm I have described, accelerometer is not integrated and there is no cumulative error similar to gyro drift (because gyroisintegrated).But the longer you average the accelerometers (in other words, the less weight you give to the instantaneous acceleration vector), the more criticalgyro driftbecomes.And you need to give a lot of weight for gyros, and very little weight for the accelerometer, if you have long-time sustaining accelerations. Which you usually don't have, but may have if you are flying a tight circle with considerable centrifugal force until fuel runs out.

author: peter-h
author_rank: Super Contributor
timestamp: November 18, 2020, 05:02:47 pm
content: FSD = full scale. For example the one I am playing with (P/N above) varies from 0.98G to 1.02G according to ambient from +20C to +65C.Maybe the sustained acceleration is possible to deal with, because it acts downwards only. The acc along the axis of flight is still close to zero.

author: pwlps
author_rank: Frequent Contributor
timestamp: November 18, 2020, 07:52:42 pm
content: Quote from: peter-h on November 18, 2020, 07:52:23 amI'm curious to know if this can be relevant in a real flight. Of course a long lasting turn with the "ball" (in the turn coordinator, I'm not sure about the term to use) perfectly centered will eventually cause the horizon reference to drift but you have to compare the maximum epected turn time with the time constant of the "erector" system. How does it compare in practice ? (my experience is limited to VFR, no need for artificial horizon).

author: peter-h
author_rank: Super Contributor
timestamp: November 19, 2020, 09:48:23 am
content: In most "real" flying you don't fly constant coordinated turns. You might when mucking about but normally you would be in VMC thenOne might fly a holding pattern for some time but that has a couple of straight sections of ~60 seconds each, so an accelerometer could detect those because the G on the Z axis, while still remaining firmly on the Z axis, will be a few % smaller.

author: gcewing
author_rank: Regular Contributor
timestamp: November 19, 2020, 12:37:42 pm
content: Quote from: peter-h on November 17, 2020, 02:27:38 pmApollo did have accelerometers. Fromhttps://en.wikipedia.org/wiki/Apollo_PGNCS:Quote

author: peter-h
author_rank: Super Contributor
timestamp: November 19, 2020, 01:15:53 pm
content: Very interesting. Very little changes

author: sandalcandal
author_rank: Unknown
timestamp: November 19, 2020, 01:38:06 pm
content: "Attitude sensing" and "attitude control"https://en.wikipedia.org/wiki/Attitude_control#Sensors(not altitude) are the keywords (at least in academia). I did a bit in an undergrad robotics project and I have a PhD friend doing related research right now. Optimal filtering of solid state sensor readings is a big part of getting a solid, reliable attitude that doesn't erroneously drift. Kalman filtering seems to the most popular existing methodhttps://www.bzarg.com/p/how-a-kalman-filter-works-in-pictures/though others exist and are being developed.Modern IMU (inertial measurement unit) ICs even include hardware acceleration for filteringhttps://mjwhite8119.github.io/Robots/mpu6050InvenSense markets the functionality under the name DMP (digital motion processing)Edit: The above IC comes as a Sparkfun/Adafruit breakout for Arduino so you can find plenty of projects with it online. I did an implementation including an artificial horizon based off thishttps://github.com/jarzebski/Arduino-KalmanFilterwhich was pretty stable whilst still giving good responsiveness.

author: Siwastaja
author_rank: Super Contributor
timestamp: November 19, 2020, 02:24:37 pm
content: Quote from: sandalcandal on November 19, 2020, 01:38:06 pmCode looks exceptionally clear and simple, I bet it works very well despite the incorrect usage of gyro axles as euler angles directly:https://github.com/jarzebski/Arduino-KalmanFilter/blob/master/KalmanFilter_MPU6050/KalmanFilter_MPU6050.ino#L50lines 50 and 51.If you need to decrease the weight of accelerometer and rely on gyros for longer time, then I suggest proper transformation of gyro data (most examples online seem to use quaternions).If Kalman filtering seems too big of a first step, then consider the pseudocode I've given earlier which is similar but with fixed weights and no covariance tracking, I guess you could call it a degenerate case of a Kalman filter? Anyway, I have heard people calling a simple out = 0.999*out + 0.001*in IIR filter a "Kalman filter" accompanied with a long lecture about how great a human being mr. Kalman was to invent such nice filter!But it seems the OP is not considering actually trying out any of this, no? The discussion is going in circles.

author: sandalcandal
author_rank: Unknown
timestamp: November 19, 2020, 02:47:49 pm
content: Quote from: Siwastaja on November 19, 2020, 02:24:37 pmI'm looking back at my project report and I think that was just used for the GUI front-end in written in processing. For actually getting readings I usedhttps://github.com/jrowberg/i2cdevlib/tree/master/Arduino/MPU6050BTW I never got the robot to be particularly stable but I only had 3wks in between other courses and outside of uni projects...

author: peter-h
author_rank: Super Contributor
timestamp: November 19, 2020, 03:02:15 pm
content: I am in the early stages of learning about this.My maths skills are poor but I understand the physical technology.Re Apollo, their accelerometers must have been far more sensitive (in resolution), and accurate, than anything solid-state today. I wonder how they were constructed?

author: Siwastaja
author_rank: Super Contributor
timestamp: November 19, 2020, 03:09:46 pm
content: If they really double-integrated the accelerations to get position, they must have had extremely stable and well calibrated accelerometers. This is not even nearly possible with modern low-cost MEMS accelerometers. Still they would need to reset the integrators every now and then based on some other information about position and speed.This is because any error accumulates in two stages of integrator. For example, if your indication is just 0.01g (0.1 m/s^2) off - this would be 0.125% of full range for a +/-4g sensor -, this would mean your speed is estimated 30 m/s wrong after just five minutes. If you are really sitting still and indicated speed is 30m/s after just five minutes, you can think what the position estimate will be.

author: peter-h
author_rank: Super Contributor
timestamp: November 19, 2020, 03:33:15 pm
content: Yes; clearly the mechanical systems were very accurate even in the 1950s, when a nuclear submarine could sail under the northern polar ice cap and surface within some tens of metres of the right place.The solid state components which "we" are using today are rubbish in comparison, but should be ok for creating an artificial horizon - "AI" (attitude indicator) in aviation-speak.I can see how a mechanical yaw rate gyro could be made; you just make a freely rotating "flywheel" on very low friction bearings, and sense its revolutions optically. The fibre optic gyros do this using "relativity" and with no moving parts.But an accelerometer is a different thing, because you can't let it move relative to its mounting (it would "escape"). I think it must be kept centred, and you use a magnetic field to hold it in the central position, and the current required for this magnetic field gives you the G. Now, this isn't going to be linear... any magnetics employing anything other than vacuum have a nonlinear B-H curve, but perhaps this comes out in the wash, mathematically. This problem must have been solved in weighing machines, however, which are pretty accurate and cheap. Some use the obvious strain gauge method while others use electromagnetic force restoration e.g.http://www.frankshospitalworkshop.com/equipment/weighing_scales_equipment.htmland those must be linear enough too. Thishttps://www.torbalscales.com/blog/force-restoration-scale-principles/#.X7aQvsKeQ-Usuggests that nonlinearity is compensated in software. But none of this will be good for double integration...

author: radar_macgyver
author_rank: Frequent Contributor
timestamp: November 19, 2020, 04:02:28 pm
content: One approach I've seen used on commercial ship-board navigation systems is to use differential GPS to estimate the heading (yaw). This can correct the gyro drift that would otherwise accumulate. For roll and pitch, I believe they assume that the long-term average is zero (this may not work for airborne platforms). You can also configure them to receive external heading inputs from say a magnetometer, and it uses this information to do its initial calibration (before the ship leaves port). The system I used (Kongsberg Seapath) internally uses an EKF, according to its documentation. Its sensors are all solid-state, but the gyro/accelerometer sensor head (MRU-5) cost about $50k.We considered using aVectornav VN-300but ran out of time to evaluate it properly. Other research groups did use one of these to get ship attitude data. They are an order of magnitude less expensive than the Kongsberg units.

author: peter-h
author_rank: Super Contributor
timestamp: November 20, 2020, 03:40:35 pm
content: Those Vectornav specs are amazing...I've managed to get my hands on another duff SG102 and the accelerometer is a ADXL321J which is _two_ axis, so no idea where the 3rd axis is coming from. There are definitely three axes shows in the output data. Maybe they are using another chip for the 3rd axis, but the markings on the others are not legible.

author: fourfathom
author_rank: Super Contributor
timestamp: November 20, 2020, 04:09:57 pm
content: Quote from: radar_macgyver on November 19, 2020, 04:02:28 pmThis definitely won't work on a sailboat, where we may spend hours/days/weeks on one tack, heeling (roll) 20 degrees or so. For that matter, on a sailboat there is also a considerable leeway (yaw), which varies with the conditions and point of sail. At least when ocean sailing we are generally sure about our average altitude!When sailing we can use roll, pitch, and yaw to correct the windspeed and direction measured by the anemometer at the top of the mast. In bumpy conditions the measured wind can be dominated by the relative wind generated by masthead motion. This can be averaged out with vector math, but it can also be corrected in real-time by using the accelerometer and gyro information. Even in stable conditions, the anemometer will have a cosine(heel) response, but that can be corrected with the roll data. At this level of accuracy we are also seeing the anemometer being affected by upwash from the sails and rigging, and this is also condition dependent. The only way to adjust for that is with sea-trials to collect correction parameters. Only the hard-core racers go to this much trouble.

author: Siwastaja
author_rank: Super Contributor
timestamp: November 20, 2020, 05:26:10 pm
content: Again, and gazillionth time, such assumption aboutpitch and roll averaging to 0is not needed!Assumption about long-time ACCELERATION (other than the gravity) being zero is done. Exactly because that way we can assume the long-term average of the accelerometer is just gravity, and only gravity. With that assumption, we can easily calculate the long-term pitch and roll from the direction of the gravity vector directly:roll = atan2(acc.y, acc.z);pitch = atan2(-acc.x, sqrt(sq(acc.y)+sq(acc.z)));Sailing a boat at constant 20 deg roll does not cause any meaningful long-term acceleration. If you sail at constant 20 deg roll, accelerometer averages to the gravity vector showing exactly that 20 deg roll no problem whatsoever. Gyro can be then used to catch quick transients and keep the estimate responsive.If you don't trust me, and trying it with actual MEMS is too difficult, try it with any old bubble level, bring it with you on a boat and it doesn't stop working even if you sail at 20 deg roll for a week; it's an instrument which showsacceleration, so it shows gravity reliably, except for disturbances from sudden non-gravity accelerations. You can average it out by eyeballing.

author: radar_macgyver
author_rank: Frequent Contributor
timestamp: November 21, 2020, 05:49:38 am
content: Quote from: Siwastaja on November 20, 2020, 05:26:10 pmQuote from: radar_macgyver on November 19, 2020, 04:02:28 pmQuote from: fourfathom on November 20, 2020, 04:09:57 pmTidal bulge can cause measurable differences in altitude, though I don't know enough to say if the errors we saw were because of WGS84 (used by GPS) not always lining up with reality.

author: uer166
author_rank: Super Contributor
timestamp: November 21, 2020, 08:15:18 am
content: In the end, is the coordinated turn issue solved with very high-precision laser gyros for airliners? I mean, I can't imagine that going in a circle will somehow noticeably break the artificial horizon of a modern airliner in a reasonable amount of time..Only other thing I can think of for space stuff and cruise missiles is star tracking: that should be a relatively easy constant reference (not earth, but to outer space). You may still need to know where you actually are (GPS or ground tracking/correlation, like a Tomahawk), and accurate time to use that as an artificial horizon though.

author: Siwastaja
author_rank: Super Contributor
timestamp: November 21, 2020, 08:42:58 am
content: Gyros used on actual aircraft are so low-drift there is no problem integrating them forhours. Don't know about how it's done today, but at least in the past, they would be reset manually; possibly no accelerometer usedat all.In any case, if they gyro is stable enough in timescale of a few hours, then averaging the accelerometer for hours is not a problem, unless you are doing a multi-hour coordinated turn with significant centrifugal force.