Configuration of the GPS unit for Megapirate
As we carry on with the Megapirate/Hobbyking AIO board project, our natural desire was to utilize most of its functionality. The next step was to purchase a GPS unit and try a number of modes that are powered by its positioning ability. Running a little bit ahead, we have ended up with a Ublox Neo-7M GPS/Compass combo that proved to be a good choice.
How to set up a GPS unit for Megapirate?
You will need a few things:
- An FTDI board (e.g. Sparkfun or other)
- A spare cable from the GPS unit, modified for connection with FTDI interface. Normally you get 2 cables: one connected to the GPS unit and another one spare with a 5-slot Molex connector. It comes really handy for the setup. I use male jumper wires, which you can buy on ebay in great numbers for very little money.
- u-center software, which you can download from Ublox website (if this link does not work or you are using OS other than Windows, follow the following path: www.ublox.com -->Support -->Kits and Tools -->Evaluation Software)
After you have the GPS connected to your computer, follow this link for detailed instructions on how to configure it. Just in case you are wondering why some of the variables are not there, here is an updated list of what to setup specific to Neo-7M (and yes, you most likely will need to change the baud rate):
- Right Click on the NMEA Text on top of the tree and choose disable child messages SEND
- Choose UBX=>CFG=>NAV5- set the Dynamic Model to use 3-Pedestrian. SEND
- UBX=>CFG=>PRT - set USART1 to 38400bps and make sure ALL the protocol settings are on UBX+NMEA!! SEND
- Change the baudrate of U-Center to 38400bps if the connection is lost at this point SEND
- UBX=>CFG=>RATE(Rates) - change the Measurement Period to 200ms This gives a 5 Hz position update since 5 x 200ms is one second. SEND
- UBX=>CFG=>SBAS : Disable (SBAS appears to cause occasional severe altitude calcuation errors) SEND
- UBX=>NAV (not UBX=>CFG=>NAV): double click on POSLLH, STATUS, VELNED. They should change from grey to black. SEND
- UBX=>CFG=>CFG : save current config, click "send" in the lower left corner to permanently save these settings to the receiver.
- go to Receiver=> Action=> then click Save Config. Otherwise, every time you unplug your gps, it will revert back to the original configuration.
A good video (in Spanish):
According to one of the legends, it is possible to set the GPS so that the blue LED stops flashing once the 3D lock is achieved. I was close but I did not manage (in the hindsight, I probably confused the NMEA and Ublox protocols). You are more than welcome to try and share your knowledge here.
Connection of the GPS module:
As much as I love electrical diagrams and other peoples’ work on explanation of what goes where, I still prefer a good video that takes what to do step by step. Please watch the video below, which in my opinion makes the modification.
In case you are wondering what’s where in technical terms:
- red is +5V(and yes, NEO-7M can be powered from 5V and yes there is no voltage on the serial connector VCC pin – I don’t know why)
- black is ground
- green is Tx for the GPS module and it connects to Rx2 of the controller (this flight controller has an 8-pin male connector and we are NOT going to use Tx1 and Rx1 pins as we connect with a 6-slot female Molex connector from the GPS unit)
- yellow is Rx (GPS side) and it connects to Tx2 of the controller
- orange – SCL for I2C connector (it will be used as a signal wire for compass connection same as the blue wire)
- blue – SDA
Important! Pay attention to position of the black wire when you are connecting the GPS cable to the 8-pin serial connector on the flight controller board; it should match the GND pin.