Shop OBEX P1 Docs P2 Docs Learn Events
GPS navigated RC car makes smooth turns at 28mph — Parallax Forums

GPS navigated RC car makes smooth turns at 28mph

GreenLightGreenLight Posts: 8
edited 2008-12-10 00:28 in Robotics
I put a Garmin GPS and accellerometer to my bs2p on my rc car.· I controll the speed with the radio but the stamp does all the steering.· It can drive very well as it guesses the degrees it has·turned using the accellerometer between the updates of the GPS for its direction.· After flipping it a couple times from turning to fast to sharp i was able to change some constants so that it wont pull enough G's to flip at max speed.

Dont slam me on the messy code· because I had to come up with some tricky math to calculate·so that its not limited by the distance between coordinates as long as they are in the same hemisphere.

All those fix* routines compare the most sig digits and truncate the gps coord so I can get an accurrate set of coord in a word var without loosing accurracy for my bearing calc.

It doesnt weave, it makes smooth turns and heads right to the next waypoint.· This example only has 4 waypoints because i was just running laps in the parking lot.· My rc car can do the laps at 28mph thats the max speed of the car. The car is an acurra i bought from radioshack for $30.·

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-12-03 22:18
    Do you have any pictures or a schematic to upload as well?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • GreenLightGreenLight Posts: 8
    edited 2008-12-03 22:27
    Sorry after I got the car working like I wanted I took it all apart so that i can put it on my RC airplane for an autopilot. I am using much of the same code for that but with the addition of a gyro for pitch controll. Ill post that here with pics once im done.
  • GreenLightGreenLight Posts: 8
    edited 2008-12-03 22:39
    Theres not much for schematic. I only use the one axis of the accellerometer to pin 9, The gps serial in to pin 10 and stearing servo to pin 12.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-12-03 22:40
    Well for future posts try to include schematics and pictures. Completed Projects don't seem to get much coverage if there's nothing to look at or the information needed to build it. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • GreenLightGreenLight Posts: 8
    edited 2008-12-10 00:28
    gps with rc car
    Originally Sent : 12/9/2008 9:11:06 PM GMT by samfar

    hi sir,

    i would like more info to what you;ve achived.
    i want to coonect a rc car with a gps or something similar were i give pre insturctions and the car will go from one place to the other (at this point ignoreing obstacles)

    and at a fast sppeed... any suggestions?

    thanks
    sam
    sammyfarrugia@gmail.com

    The code I posted will do just that.· You can enter gps·coordinates in the waycheck routine.· They should be in the format of latitude degree degree minute minute in the first word value, then the second word value is the decimal part minute minute·minute minute. The next word value is Longitue dddmm and then the last value is .mmmm

    my code only has 4 waypoints but you can easily add many more by adding additional case statments and changing the value in the if statement to the number of waypoints minus 1
    the value in the then part of the if can be set to the last waypoint if you want the car to stop at the last waypoint.

    You should be able to put this on any rc car that uses a standard servo for the steering control.

    I used a Garmin GPS L18· but you should be able to use any gps that give nmea GPRMC sentances.

    If you have any other questions let me know
Sign In or Register to comment.