Author Topic: Building a solid state artificial horizon  (Read 1503 times)

0 Members and 1 Guest are viewing this topic.

Offline gcewing

  • Regular Contributor
  • *
  • Posts: 76
  • Country: nz
Re: Building a solid state artificial horizon
« Reply #25 on: November 19, 2020, 12:37:42 pm »
The Apollo programme used rate gyros, no accelerometers, so how did that work?
Apollo did have accelerometers. From https://en.wikipedia.org/wiki/Apollo_PGNCS:

Quote
The IMU was gimbaled on three axes. The innermost part, the stable member (SM), was a 6-inch beryllium cube, with three gyroscopes and three accelerometers mounted in it. Feedback loops used signals from the gyroscopes by way of the resolvers to control motors at each axis. This servo system kept the stable member fixed with respect to inertial space. Signals from the accelerometers were then integrated to keep track of the spacecraft's velocity and position.
 

Offline peter-h

  • Frequent Contributor
  • **
  • Posts: 331
  • Country: gb
  • Doing electronics since the 1960s...
Re: Building a solid state artificial horizon
« Reply #26 on: November 19, 2020, 01:15:53 pm »
Very interesting. Very little changes :)
 

Online sandalcandal

  • Supporter
  • ****
  • Posts: 177
  • Country: au
  • MOAR POWA!
Re: Building a solid state artificial horizon
« Reply #27 on: November 19, 2020, 01:38:06 pm »
"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 method https://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 filtering https://mjwhite8119.github.io/Robots/mpu6050 InvenSense 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 this https://github.com/jarzebski/Arduino-KalmanFilter which was pretty stable whilst still giving good responsiveness.
« Last Edit: November 19, 2020, 02:06:12 pm by sandalcandal »
Disclosure: Involved in electric vehicle and energy storage system technologies
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 3176
  • Country: fi
Re: Building a solid state artificial horizon
« Reply #28 on: November 19, 2020, 02:24:37 pm »
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 this https://github.com/jarzebski/Arduino-KalmanFilter which was pretty stable whilst still giving good responsiveness.

Code 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#L50
lines 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.
« Last Edit: November 19, 2020, 02:28:23 pm by Siwastaja »
 

Online sandalcandal

  • Supporter
  • ****
  • Posts: 177
  • Country: au
  • MOAR POWA!
Re: Building a solid state artificial horizon
« Reply #29 on: November 19, 2020, 02:47:49 pm »
Code 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#L50
lines 50 and 51.
I'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 used https://github.com/jrowberg/i2cdevlib/tree/master/Arduino/MPU6050

BTW I never got the robot to be particularly stable but I only had 3wks in between other courses and outside of uni projects...
« Last Edit: November 19, 2020, 03:15:57 pm by sandalcandal »
Disclosure: Involved in electric vehicle and energy storage system technologies
 

Offline peter-h

  • Frequent Contributor
  • **
  • Posts: 331
  • Country: gb
  • Doing electronics since the 1960s...
Re: Building a solid state artificial horizon
« Reply #30 on: November 19, 2020, 03:02:15 pm »
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?
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 3176
  • Country: fi
Re: Building a solid state artificial horizon
« Reply #31 on: November 19, 2020, 03:09:46 pm »
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.
 

Offline peter-h

  • Frequent Contributor
  • **
  • Posts: 331
  • Country: gb
  • Doing electronics since the 1960s...
Re: Building a solid state artificial horizon
« Reply #32 on: November 19, 2020, 03:33:15 pm »
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.html and those must be linear enough too. This https://www.torbalscales.com/blog/force-restoration-scale-principles/#.X7aQvsKeQ-U suggests that nonlinearity is compensated in software. But none of this will be good for double integration...
« Last Edit: November 19, 2020, 03:37:20 pm by peter-h »
 

Offline radar_macgyver

  • Frequent Contributor
  • **
  • Posts: 448
  • Country: us
Re: Building a solid state artificial horizon
« Reply #33 on: November 19, 2020, 04:02:28 pm »
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 a Vectornav VN-300 but 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.
 

Offline peter-h

  • Frequent Contributor
  • **
  • Posts: 331
  • Country: gb
  • Doing electronics since the 1960s...
Re: Building a solid state artificial horizon
« Reply #34 on: November 20, 2020, 03:40:35 pm »
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.
 

Offline fourfathom

  • Frequent Contributor
  • **
  • Posts: 449
  • Country: us
Re: Building a solid state artificial horizon
« Reply #35 on: November 20, 2020, 04:09:57 pm »
For roll and pitch, I believe they assume that the long-term average is zero (this may not work for airborne platforms).
This 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.

 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 3176
  • Country: fi
Re: Building a solid state artificial horizon
« Reply #36 on: November 20, 2020, 05:26:10 pm »
Again, and gazillionth time, such assumption about pitch and roll averaging to 0 is 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 shows acceleration, so it shows gravity reliably, except for disturbances from sudden non-gravity accelerations. You can average it out by eyeballing.
« Last Edit: November 20, 2020, 05:34:23 pm by Siwastaja »
 
The following users thanked this post: sandalcandal

Offline radar_macgyver

  • Frequent Contributor
  • **
  • Posts: 448
  • Country: us
Re: Building a solid state artificial horizon
« Reply #37 on: November 21, 2020, 05:49:38 am »
Again, and gazillionth time, such assumption about pitch and roll averaging to 0 is not needed!

This can correct the gyro drift that would otherwise accumulate.

At least when ocean sailing we are generally sure about our average altitude!
Tidal 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.
 

Offline uer166

  • Regular Contributor
  • *
  • Posts: 220
  • Country: us
Re: Building a solid state artificial horizon
« Reply #38 on: November 21, 2020, 08:15:18 am »
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.
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 3176
  • Country: fi
Re: Building a solid state artificial horizon
« Reply #39 on: November 21, 2020, 08:42:58 am »
Gyros used on actual aircraft are so low-drift there is no problem integrating them for hours. Don't know about how it's done today, but at least in the past, they would be reset manually; possibly no accelerometer used at 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.
 
The following users thanked this post: uer166


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf