GPS altitude accuracy good enough to calc road grade?
I have heard from several sources that altitude readings from GPS sensors are not very accurate and should not be relied upon. I also read that some of the new chips (such as those made by Locosys) are pretty good.
I do not necessarily need total accuracy on the absolute altitude. I am looking more at the change in altitude. What I want to do is measure the grade of the road I am traveling on. Accuracy of about +- 2% of grade would be good enough. (not 2% of reading, 2% of grade)
-I figure I could take a base altitude reading, say 800 feet.
-Then travel up the road 100 feet. Measure distance traveled of 100 feet with the GPS.
-Take another altitude reading, say it is now 805 feet.
-The change in altitude is 805 feet - 800 feet = 5 feet. It took 100 feet to get there, so the grade of the road is 5/100 or 5%
Is a good GPS chip accurate enough to do this? Or should I stick with my original plan to use an accelerometer and calculate using g's of gravity (I already know how to do this, but I am finding mounting the accelerometer on edge somewhat of a challenge).
Thanks for any insights.
-Larry G.
Post Edited (LarryG) : 7/18/2010 1:48:46 PM GMT
I do not necessarily need total accuracy on the absolute altitude. I am looking more at the change in altitude. What I want to do is measure the grade of the road I am traveling on. Accuracy of about +- 2% of grade would be good enough. (not 2% of reading, 2% of grade)
-I figure I could take a base altitude reading, say 800 feet.
-Then travel up the road 100 feet. Measure distance traveled of 100 feet with the GPS.
-Take another altitude reading, say it is now 805 feet.
-The change in altitude is 805 feet - 800 feet = 5 feet. It took 100 feet to get there, so the grade of the road is 5/100 or 5%
Is a good GPS chip accurate enough to do this? Or should I stick with my original plan to use an accelerometer and calculate using g's of gravity (I already know how to do this, but I am finding mounting the accelerometer on edge somewhat of a challenge).
Thanks for any insights.
-Larry G.
Post Edited (LarryG) : 7/18/2010 1:48:46 PM GMT
Comments
In my research a GPS reading is not accurate enough to determine road grade. I have
gotten readings which, in the short term, varied as much as 50 feet!
I am very interested in your application and have tried, without much success, to build a
Stamp based road grade meter. The closest I am have gotten is using a very sensitive
barometric altimeter. However the model I have outputs via USB and I haven't found the
expertize to tell me how to input ascii code via USB into the Stamp.
I plan to calculate the change in vertical velocity [noparse][[/noparse]fps] from the change in altitude, and
then divide by the 'horizontal' velocity obtained from the GPS. By-the-way, if your road
velocity is 68 mph [noparse][[/noparse]=100 fps] then a change in vertical velocity in fps gives road grade
directly. My altimeter does present vertical velocity in fps but one just can't depend on
driving at exactly 68 mph
If you find all this of interest please let me know if I can be of further help.
cheers, David
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Leon Heller
Amateur radio callsign: G1HSM
An accelerometer would appear ideal. However the inclines relating to road grade are small: therefore the acceleration change is small. This is ok for a nonmoving or slow moving application but I have found that vehicle acceleration/deceleration overwhelms the incline measurement.
Or, have I missed something. I did run across a technical paper which showed that you could account for vehicle acceleration but I couldn't figure how to apply the measurements [noparse][[/noparse]Measurements canceled each other out and I didn't get any readings.].
cheers, David
Another manufacturer makes a curved bubble-level-type inclinometer that gives accurate gradient readings when properly installed & calibrated on a bike. Can't argue with old school!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·"If you build it, they will come."
Those problems can be overcome, but will need quite a lot of work. You might even need to use something like Kalman filtering.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Leon Heller
Amateur radio callsign: G1HSM
I have been testing a few different accelerometers for my bike computer lately. Here is what I have learned:
1) A basic 2 axis chip works fine, but can find a 3 axis cheaper at times.
2) One of my favorite 2 axis is the Analog Devices ADXL213
3) You typically will be looking for the grade of the road instead of how many degrees of tilt. But it might not matter for your application. (Grade is rise over run, tangent of the angle)
4) There are about 16mg in one degree of tilt
5) Bouncing was not too bad due to rough roads. I take 10 samples then average them.
6) You only need to do the calibration one time. In a 3.3v application, level is going to be pretty close to 1.65v. (Over 1.65v you have a positive grade, below that you are going down hill.) You will need to figure out what margin you want to use for level. For instance, if tilt is one degree either way, then it is basically on level ground. Use a level at the time of mounting the sensor. Get the offset value and plug that in to your equation to set that as a level value.
7) For item #6, the further you are off of level for the offset, the less accurate you will be in higher readings. This mostly comes into play when you are over 6 degrees of tilt.
8) I have also used the 3 axis Freescale MMA7361L. Mount it on edge. You do not need to look at the Z, only X or Y depending on how it is mounted. Z is not going to tell you if the road is going up or down, it will only tell you it is not level
Some good resources on measuring tilt:
-Analog Devices app note AN-603
-Memsic app note #AN-00MX-012
-Freescale AN3107
This stuff was good enough to work on my bicycle where I did not take into account acceleration going up the grade (I usually do not accelerate going up hill, I am lucky to just get up the hill). You can use both X and Y readings to negate the effects of acceleration. You have to mount the sensor at a 45 degree angle. This is shown in the Memsic app note mentioned above.
Hope at least some of this helps.
Thanks for the information on using accelerometers. The 2nd resource you listed,
Memsic app note #AN-00MX-012, is the reference I used to code the Stamp. However
when I coded the general form equation given it canceled the signal. Maybe it's as simple
as my lack of understanding of translating the equation into PBasic. It has been some
time ago that I played with Parallax's accelerometer so I can't, offhand, find the code I
derived.
Will, sometime in the future, try to redo the experiment.
Thanks for the instruction.
cheers, David
Maybe you could run some averaging and noise statistics tests on this data set and see if it might be good enough for your purposes.
This is over a bike trail with practically no hills at all, so any large altitude change in the data is a glitch (there are a few bridges with a meter or so of altitude change).
I have occasionally seen jumps in altitude data, but in general, my altitude readings are very good most of the time, as this data shows.
Here's a visualization of the second of the two tracks:
http://www.everytrail.com/view_trip.php?trip_id=205432
I don't think you'd want to just take two readings. You'd be better off continually tracking the altitude reading, keeping a running average, discarding or flagging values that are wildly out of range. If you did that, my experience would be that you'd usually get useable readings.
In the past I·have logged GPS altitude with the receiver stationary and it wandered all over the place - a result, IIRC of the geometry of the satellites...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Hugh - the thinking woman's Geoffrey Pyke.
-GPS altitude cannot be relied upon
-Accelerometer can be used as an inclinometer, but forward and reverse g-force along both x and y directions need to be negated.
So, I will mount a 2 axis sensor at a 45 degree angle, so x and y point up to make a "V". This is mentioned in the Memsic app note #AN-00MX-012. The angle of the road then is cos-1(.707[noparse][[/noparse]Ax+Ay]/g). Calibrate that to zero. It is worth a try. But I don't think the acceleration of a bike going up a hill is going to throw off the reading by much anyway. But I do want to make this somewhat accurate and consistent.
You're quite welcome. As mentioned I also have a interest in making a Stamp based road
grade meter. As a result of your query I have again read the app note. However the vector
math of the equation and it's translation into PBasic escapes me. I thought about writing
Andy at Parallax to see if he would be interested in adding a snippet of coding to his mini
course on the Memsic accelerometer. But I noted that the course had been drafted several
years ago and his interest may have waned.
I wonder then if you might be interested in adding your thoughts on this coding to Andy's
thread; as I feel it might help others?
In any regard, thanks for your thoughts and renewing my interest.
cheers, David