Poor mans navigation system.

Started by KetilO, July 26, 2010, 12:52:02 AM

Previous topic - Next topic

KetilO

The Norwegian fjords are treacherous, sometimes deep, sometimes shallow with underwater rocks. To make things even worse the difference between low and high tide is about 3 meters. A sonar is a must, preferably a bow mounted swinger to give you an early warning.
Hitting an underwater rock can be dangerous and expensive. On my map I will put a warning mark on places to avoid.

The place where I have my cabin and boat can best be described as a saltwater lake with a tidal river into the fjord. This place is really dangerous to those unfamiliar, full of underwater rocks only visible at low tide. The tidal current is stong so you cant go slow or you will be thrown off course.

Included is a screenshot that shows part of the place.

KetilO

dedndave

that looks like a beautiful place Ketil
hafta go fishin for some of those elusive Norwegian Sweeties   :bg
i would think the elipsoid corrections would be particularly important at lattitudes that far north (or south)
not so much for distances, but for bearings
but, as long as you can make your GPS jive with your map, i guess it doesn't matter

KetilO

Hi dedndave

Last week I took a 40Km drive with my car to test the GPS / map acurancy. It never went off the road, although somtimes left hand driving.
If it is good enough for a car it is certainly good enough for navigating a boat.

On the map I am using the longitude / lattitude are straight lines. The longitude is linear, the lattitude is not. Instead of trying to figure out the formula to use I have an array of lattitudes with one entry for each vertical map tile. Since my area of interest is less than 100x100Km this works very well.

Yes, Norway is beautiful this time of the year. During summer there is nowhere else i rather be than right here where I live.

Today my wife had a day off from work, and I still have a few days left of my vacation so we decided to go to our cabin. It is just half an hour drive from home.
I wanted to fish and my wife wanted to pick some blueberries so i put her off at some small island while I went fishing.
After half an hour or so I had three cods, each around 5Kg. I went back to the island and cleaned the fish. One of the cods i cut into smaller pieces and wrapper it in tin foil with plenty of onion slices. I then picked some dry wood branches and made a small fire.
While the fire was burning out I went looking for my wife. When I found her she had alreddy picked a basket full of blueberrys.
When we returned to the fire it had alredy burned out so it was time to put the fish on. It is important to let the fire burn out or you will get fried fish instead of fish boilen in its own juice.  I get water in my mouth just by thinking of how dellicious it is.
For dinner we had boiled cod and salad, for desert fresh blueberries  with a teaspoon shugar and some milk.

Yes, life is good if you know how to enjoy it.

Ketil


dedndave

mmmm - that sounds good   :U
it would be cool to see that part of the world
all the mountain peaks in the same view as the lakes, with green everywhere
maybe i am just getting tired of seeing the Arizona desert - lol
rocks, dirt, cactus
Arizona has some great places, too - just hardly get out to see them anymore
of course, the weather here sux right now
it is hot, humid, and sticky - yesterday it was 110F (~43C) in the shade   :red

KetilO

Many years ago I visited Arizona (Phoenix). It is so long ago I cant even remember what time of the year it was. I am guessing it was winter or maybe early spring. A few things stuck to my mind. When we visited the desert I noticed that water came bubling out from the sand in my footprints. Not exactly what I have in mind when it comes to deserts. I also noticed that many of the larger buildings was underground due to the heat. during summer. I also remember that we had a rafting trip on some nearby river. It was nice. The guide told me he stayed in Phoenix during winter and went up north during summer. What a lucky guy.

Here, just now the weather is nice, the sky is blue and it is about 20C in the shadow.
Where I live it is just an hour drive to the polar circle. This means that a couple of months during summer we have 24 hour daylight.
You dont get all this without paying for it. The winter is long and cold and we only get some 6 hours daylight. But as a wise friend of mine says "If its too hot I take off all my cloths and its still too hot. If its too cold I just put on more cloths."

KetilO


dedndave

i dunno where water was coming out of the ground - lol
that doesn't sound like the desert i am familiar with
from what i can see, they don't bury enough buildings around here
most houses in the Phoenix area do not have basements or cellars
that is because, after you get about 4 feet down, it is very hard to dig a hole here
but - the river i know well - it is the Salt River - when i was in high school, i tubed it a few times a week
now, the state charges you money to park, money for tubes, money for the bus ride
they have done what they can to prevent the old 2-vehicle method that we used to use
and - the banks are patroled by sherriff deputies on horseback and quads
they have really sucked all the fun out of it
well - most of the fun, anyways...




aker

伟大的恐怖主义革命家拉登,因遭袭医治无效,于2011年5月1日在巴基斯坦逝世,享年54岁

cork

Quote from: KetilO on August 18, 2010, 10:11:37 PM
Hi dedndave

Last week I took a 40Km drive with my car to test the GPS / map acurancy. It never went off the road, although somtimes left hand driving.
If it is good enough for a car it is certainly good enough for navigating a boat.

On the map I am using the longitude / lattitude are straight lines. The longitude is linear, the lattitude is not. Instead of trying to figure out the formula to use I have an array of lattitudes with one entry for each vertical map tile. Since my area of interest is less than 100x100Km this works very well.

Yes, Norway is beautiful this time of the year. During summer there is nowhere else i rather be than right here where I live.

Today my wife had a day off from work, and I still have a few days left of my vacation so we decided to go to our cabin. It is just half an hour drive from home.
I wanted to fish and my wife wanted to pick some blueberries so i put her off at some small island while I went fishing.
After half an hour or so I had three cods, each around 5Kg. I went back to the island and cleaned the fish. One of the cods i cut into smaller pieces and wrapper it in tin foil with plenty of onion slices. I then picked some dry wood branches and made a small fire.
While the fire was burning out I went looking for my wife. When I found her she had alreddy picked a basket full of blueberrys.
When we returned to the fire it had alredy burned out so it was time to put the fish on. It is important to let the fire burn out or you will get fried fish instead of fish boilen in its own juice.  I get water in my mouth just by thinking of how dellicious it is.
For dinner we had boiled cod and salad, for desert fresh blueberries  with a teaspoon shugar and some milk.

Yes, life is good if you know how to enjoy it.

Ketil

Wow. That sounds fantastic, KetilO! Thanks for sharing that awesome image.

GregL

Yes, that sounds really nice KetilO.  Sounds like a beautiful place to live.

minor28

Hi Ketil,

Quote
On the map I am using the longitude / lattitude are straight lines. The longitude is linear, the lattitude is not. Instead of trying to figure out the formula to use I have an array of lattitudes with one entry for each vertical map tile. Since my area of interest is less than 100x100Km this works very well.

If you use a map with mercator projection the formula is

y = a*ln(tan(45deg + latitude/2deg))

where a is semi-major axis = 6,378,137m. You can read about it here.

From your map ref points you can calculate a virtual axis in pixels with correct zoomfactor. I suppose your map has at least 3 ref points.

KetilO

Thanks minor28

I will try it out.

KetilO

KetilO

There is obviously someting I dont understand about this formula.
I expected that the difference between top and bottom would give me the height of the map in meters.
Instead it gives me a number about 2.5 times higher.


fp2 dq 2.0
pidiv4 dq 0.785398163397
iL2e dt 3FFEB17217F7D1CF79ACh
smaxis dq 6378137.0

.code

;minor28
;y = a*ln(tan(45deg + latitude/2deg))
;where a is semi-major axis = 6378137m
;http://mercator.myzen.co.uk/mercator.pdf
;y = a*ln[tan(Rad(lat)/2+PI/4)]
LatToPos proc iLat:DWORD
    LOCAL tmp:DWORD

    fild iLat
    ;Convert to decimal by dividing by 1 000 000
    fdiv dqdiv
    ;Convert to radians
    fmul deg2rad
    ;Divide by 2
    fdiv fp2
    ;Add PI / 4
    fadd pidiv4
    fptan
    ;Pop the 1.0
    fstp st
    ;ln
    fld iL2e
    fxch
    fyl2x
    ;Multiply by a
    fmul smaxis
    fistp tmp
    mov eax,tmp
    ret

LatToPos endp


The code works as it should, verified using windows calculator.

KetilO

KetilO

Since I started this project I have replaced the Cuda 350 with a BU 353 GPS module and added my homebrew sonar using the STM32 Discovery as microcontroller.
The BU 353 has better sensivity and the sonar has 3 times the range.
Only calibratinon of the temprature sensors and the time dependant gain control remains on the sonar.
This will be done using lookup tables.




dedndave

very nice Ketil

i did some work on bio-med ultrasound scanners
i seem to recall a formula for gain compensation
if you google "time-gain compensation", you should find some info

edit...
i found this graph - looks like a fairly simple log curve (for the most part - lol)

KetilO

Thanks dedndave, interesting reading.

Unfortunatly the gain control of the receiver is not linear.
Gain control is achived by varying the bias of a jfet and a transistor.
The bias is set using one of the DAC channels on the STM32 Discovery.
A gain lookup table is needed as it is the fastest way to update the DAC.
The input signal range is 15uV to 1V (peak to peak) for a 3V output signal.