First, there are three ways relevant to us to measure altitude; with thermometers, barometers and GPS.
Temperature gradient tells you the temperature change in altitude - decreasing temp by increasing altitude. For my outdoor trips in the Alps (home base) I go by 6°C/1000 m. In the fells of the UK I think it's more like 7-8°C/1000 m. In the subarctic even more. As a generalised rule of thumb (var. literature) 0.0065°C/m is often stated. Lets go with that, a drop of 6.5 °C for 1000 m higher altitude.
Temp gradient = (temp at given altitude - temp at goal altitude) / altitude difference
Then there's the barometric altitude equation which tells you the air pressure at your goal altitude.
Air pressure at goal altitude = air pressure at given altitude × (1 - temp gradient × altitude difference / temp at given altitude in Kelvin) ^ (0,03416 / temp gradient)
I'm not going into GPS signals, that'd be boring.
So we're now stuck with two ways to calculate altitude; by temperature and barometer. As you mentioned the Edge calculating it by barometer only (which I'm not sure it does - thought it was a mix of GPS signal and barometer, at least for the 810 and 820 - but I may well be wrong) we have following situation with your example:
Start (given) alt. = 510 feet or, better (obviously) 155.448 m
End (goal) alt. = 480 feet or 146.304 m
Temp. = 15 °C or 288.15 Kelvin (just to fill in blank spots in the equation)
Air pressure at start = 1000 hPa (mBar) just as an example
This gives us quite precisely a difference of 1 hPa. So if air pressure changes by 1 hPa during your ride you'll get the alt. readings you used as an example.
If the air pressure hasn't changed, your home has changed altitude or you're lost and confused.
Or your Edge was a bit off.
I don't now how a Edge or a watch like Sunnto measure pressure - guess it's a simple load bearing membrane which probably doesn't need temp. compensation, but analogue barometer do. Something to consider if you compare the reading of the Edge with those of eg a mecury barometer.
Oh... nearly forgot to say that barometers tend to be a bit off. If I gain and loose 2000 m and have done no alt. correction, the alt. will be up to 70 m off on my Suunto (less on my Edge, but don't now the numbers, 'cause I don't need the Edge for navigating the way I do with my wrist barometer - mountaineering vs. biking)
Happy nerding
