PDA

View Full Version : GPS module + BS2



misa1125
11-22-2006, 01:01 PM
Hi, Im new here and would like some advice/help with my project.· I ordered a GPS module straight from parallax, and am currently having problems with it, so its being sent back.· However, while its being sent back, I thought I should ask some questions about it.· First, I currently have the original BS2, and I know that it only has space for 26 variables.· My project is very comprehensive, and I was wondering if there is any way to cut down the GPS code so that I dont have to use so many variables?

The reason I am sending the GPS back is that it was not getting any signal, even when i stood outside with an extension cable w/ an AC adapter on a clear day.· I dont know if its the Parallax module that isnt strong enough to recieve the signal between the big buildings of NYC or not, but I was wondering if anyone had any other suggestions for GPS modules besides the parallax that go for less than a $100?

Thanks in advance.

·

stamptrol
11-23-2006, 01:54 AM
The data from the GPS comes in the form of an ASCII string which you can program the stamp to capture in different ways. This allows you to make the best use of your variable space by only storing what you need.

Secondly, you can re-use variables by grabbing a part of the GPS string in one part of your program, process it, then receive the GPS string a second time and grab another part of it using the previously used variable.

An alternative GPS unit is one made by Garmin. It is about the same price, has an easy-to-use serial interface and comes in a waterproof "hockey puck" about 3 inches across. It is the Garmin OEM GPS 18 LVC Sensor with Bare Wire Connection and is available from GPS City.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk

http://www.siskconsult.com
·

ratronic
11-23-2006, 08:07 AM
You Might TRY this link and look over their oem modules in 3 differant
hook up and voltage possibillitys - you can get the garmin specs here
http://www.garmin.com/products/gps18oem/·it has excellent sensitivity , I hang mine·inside the front window
·hanging from the cord w/the dome facing the window and it captures every time. ps i didnt get the parallax gps as it was b.o. at the time.·I am using bpx chip and a 4 x 20 parallax ser lcd good luck!

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
D Rat

jhoyoza
11-23-2006, 09:50 PM
Hello,

I recently discover much about GPS data acquisition, and you and others, may find what I've learned helpful. I’m using a GPS in an attempt to drive a toy-boat autonomously. Open water is a good choice when an unobstructed field is required. I don’t have WAAS-enabled GPS so the larger the body of water the better. And yes, I thought about an aircraft, as my unit does provide altitude information. But right now…ummm…I think I’ll stick to the water. It‘s safer! And reduces the chances of losing it, or possibly injuring someone, or worse. I just may have to do a bit of paddling or even snorkeling to retrieve it…lol.

I did figure out how to grab a string of serial-data from my GPS unit using a data-cable available on-line. (I wrote a very simple BS2 acquisition program shown below.) It does takes a bit more effort to convert the data into variables that one can actually work with, especially when dealing with erroneous-data and decimals. The inexpensive GPS units do not appear to have waypoint capabilities. So, one can only take X,Y information and use it, say to steer north for a time, or until a longitude or latitude is reached, and then change course…etc. Or perhaps, with a bit of number crunching, perform complex trigonometric calculations and determine where you are and where you want to go, and adjust steering accordingly.

It is painful to even think about doing such complex mathematics on a basicstamp!

With the Garmin unit, (Etrex summit) I can use waypoints for navigational purposes. Various methods can be used to enter waypoints into the unit. They can be punched in manually or by using mapping software such as ‘Topo’ that allows creating waypoints simply on a topographical map and then upload them onto the GPS unit. One can then mount the unit in a vehicle for navigation purposes. This particular unit is actually water resistant.

I set the Garmin output to NEMA 0183 at 4800 baud and read the serial-data using an available I/O pin on the basic stamp. I use the GPRMC and GPRMB NEMA-0183 sentences. These provide a wealth of useful information. First and foremost is the current heading. (You must be moving to receive this information.) Second is the heading to the waypoint. The difference between these two angles determines which way to steer the boat. Also, the distance to the current waypoint is available and useful when slowing down to make tighter turns. The Garmin unit switches to the next waypoint automatically when it reaches the current one. It can hold 20 reversible routes with up to 124 waypoints each! The GPRMC and GPRMB sentences also provide the distance, and the next angle to the upcoming waypoint. Strategically planning for a turn is very plausible.

Now that’s cool! And the Etrex has great tracking capabilities and a wonderful trip computer. But unfortunately it is about twice the cost of a ’basic unit, around $200.

The disappointing thing about the Etrex is, I don’t think it provides a way to read the magnetic compass built into the unit? (As far as I know, you can only see the magnetic-compass by looking at the display on the unit itself.) This is discouraging as I designed a 2-axis gimbal to keep the unit level at all times. (See photo. The GPS is level and the boat is tilted about 45 deg starboard and about 5 deg aft.) The magnetic-compass is accurate only if the unit is held absolutely level. (I hope the GPS will still work stuck in a hole like that. I think I best check that out soon. I have been in situations where I get no signal in a clear open field and other times get great reception in a heavily wooded area. Or sometimes when in while sitting in the house. I did find that when moving, it works much better as far as signal reception goes.)

Relying on the magnetic-compass doesn’t matter once you are moving fast enough, however, as once the GPS-compass kicks-in, the physical orientation is irrelevant. I adjusted the speed on the GPS unit to switch from magnetic-compass to GPS-compass at 1MPH or greater, and can receive viable data at low sppeds.

I’m now struggling with, whether the basic stamp can actually chew gum and walk at the same time? In my boat experiment, the stamp must read the incoming data, perform the calculations, then send correction data to the motor controller and rudder servo. The data comes in once a second and thus historisisis is an issue. (Technically, you are actually ahead of where you think you are by the time everything is read, calculated, and adjusted. I believe aircraft pilots call it, “Staying ahead of the airplane.” It is a challenging issue for the human-brain, never mind a basicstamp.)I think I’m going to use one basicstamp just for data acquisition and another stamp for calculations and motor/rudder control. Did I mention variable space? I also designed in a radio-control over-ride (see other post) thus creating even more of a burden. (This will hopefully serve to keep me from being forced to go chasing after it, or potential disasters.). A PWMPAL may help with multitasking servo control, but as I quickly found out, I needed a more powerful motor controller to handle the power requirements to drive a 9.6VDC-motor under actual load conditions. Even the Motor-Mind-B couldn’t handle the actual loads. I received a MB-25 and delighted with the performance.

Everything is now jury rigged and it is “Time to make the donuts,” so to speak, and start writing code and finalizing the nuts and bolts of it all. I believe I have all the necessary parts, and enough bits and pieces of test code lying around. I do wish I had more programming experience, as this seems like one heck of a job for a beginner. Perhaps the propeller chip is better suited for this type of multi-tasking application and I‘d bet that’s probably the better way to go! Short of getting a bigger boat and strapping a laptop to it!

Well there it is, I hope you and others find it helpful and any programming and/or hardware advise and/or general comments would be greatly appreciated.

Thanks!

-J

---------------------------------------------------------

' {$STAMP BS2}
' {$PBASIC 2.5 }

' Simplistic Garmin Etrex GPS DATA reading endless LOOP.
' GPS is on pin 8. GPS ground tied to Vss.
' Gamin Set to NMEA 0183 @ 4800 baud, GPS compass engaged at 01+ MPH.

'************************************************* *************
x VAR Byte

DO

SERIN 8, 16572, [WAIT ("GPRMC"),WAIT (","),WAIT (","),WAIT (","), WAIT (","),
WAIT (","),WAIT (","),WAIT (","),WAIT (","),DEC x]

DEBUG CLS

DEBUG DEC5 x

PAUSE 20

LOOP

'************************************************* *****************************
' OR use array info to gather string DATA:

' serStr2 VAR Byte (6) (use TO initialize array)
' ,STR serStr2\5] (use in SERIN statement instead of DEC x to read string data format)
' DEBUG STR serStr2 (to view string)

' See GPRMB FOR waypoint info: http://www.nps.gov/gis/gps/NMEA_sentences.html
' See example in Parallax Syntax Reference Manual Ver. 2.2 pg. 405.

Post Edited (jhoyoza) : 11/25/2006 3:10:38 AM GMT

John Abshier
11-24-2006, 10:37 AM
I am not at home with my reference materials and on a 30K phone line so searches are painful. I do remember that some Garmin GPS output a Garmin specific output sentence with the compass info. Search for "Garmin propriatery(spelling) NMEA"