DiY FrSky GPS-Hub


108 posts in this topic

Posted (edited) · Report post

EDIT: The technical data for the DiY FrSky GPS-Hub is in post #14.


The ER9X hack discussion got a bit off topic when I dragged my FrSky GPS hub project into it. So I've spun-off the hub to this new dedicated topic. I'll use this as a sort of blog on the hub's progress. But before you read much further I recommend reviewing the original thread: http://www.rc-cam.co...827-er9x-hacks/

To help get you up to speed, we've been discussing the Turnigy/FlySky 9X transmitters and the nifty open source firmware that is available for it. Plus, our 9X's have been hacked and now sport the FrSky data telemetry modules. This combination is very affordable but requires delicate soldering and a few hours to perform all the upgrades.

Then in a bit of temporary insanity, I decided to create a custom GPS hub for the FrSky R/C receiver. It would essentially replace the sensor module that FrSky already offers with a smaller, more integrated board that would fit inside the existing receiver. It would include a baro sensor (altimeter) and support common GPS modules (on a tethered cable). And because the hub will run custom software, the telemetry data can be optimized a bit. For example, it will support faster GPS updates and GPS signal quality status.

That's the project in a nutshell. So now we can move on to the nuts and bolts.

About three weeks ago I ordered the custom PCB's. They arrived yesterday and I was able to stuff a set, modify the code to run on the new processor, and test it out. I was relieved to find that the new Hub and the companion GPS works as planned. Also, the hub PCB fits nicely inside the 8-Channel FrSky Rx. So all the scary stuff is out of the way.

Here's a photo of the assembled GPS-Hub and the optional GPS module board. Despite how big the photo makes them look, each board is about the size of a large postage stamp.

post-2-0-07404200-1334379924_thumb.jpg

At the moment the hub's software only provides GPS data. The baro altimeter code needs to be written. Plus, I think I will add a bootloader as a alternate way to install firmware upgrades. Hopefully these things will be done in a couple weeks. I'll post again as things progress.

Edited by Mr.RC-Cam
Added post #14 info
1 person likes this

Share this post


Link to post
Share on other sites

Posted · Report post

Yum :)

Share this post


Link to post
Share on other sites

Posted · Report post

The barometric altimeter feature is now working. Despite my hopeful prediction that the 8K PIC would be plenty big for this little project, I battled insufficient ROM space issues with the C compiler's math library. After a fierce battle I finally gave up with the all the convenient math functions (that the big boys get to use) and wrote the altimeter function using integer math. It wasn't as easy as planned, but in the end the altimeter code was squeezed into the PIC. The displayed altitude reading has 1 meter resolution, so I'm happy.

The GPS-Hub's baro sensor chip has a precision temperature sensor for the pressure compensation calculations. This temperature parameter is hijacked, converted to Celsius, and then sent with the other FrSky telemetry data. Even if displaying a R/C model's ambient temperature is not a killer feature, it was an easy no-cost addition.

The code is not formally done (needs more testing and some cleanup), but maybe this weekend I'll be able to try the nifty new GPS-Hub on my quad. :)

The late night coding has taken its toll (sleep deprivation sucks), so I need to take a break for a few days. But I could use a some help with the Open9X transmitter features, as follows.

1. How do I change the telemetry's unit of measure from metric to imperial?

2 Where/how is the GPS altitude displayed when baro altitude is present?

Share this post


Link to post
Share on other sites

Posted · Report post

Mmh, great news :)

1. How do I change the telemetry's unit of measure from metric to imperial?

Not implemented (yet?)

2 Where/how is the GPS altitude displayed when baro altitude is present?

Nowhere. At this point it's supposed that if baro altimeter is connected it's better than GPS.

I'll ask about those, should be easy to get both points solved :)

Share this post


Link to post
Share on other sites

Posted · Report post

I'll ask about those, should be easy to get both points solved

Thanks! It would be very convenient to have altitude in feet (we don't speak metric on this side of the pond). As a work-around I could have the GPS-Hub send the baro height in feet instead of meters. This is a nice trick because it offers 3X resolution (versus meters). But, I think this would confuse the Open9X's distance calculator (DIST field).

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

All ideas listed here commited. Should be part of the next release.

Bertrand.

Imperial / metric is defined as a compile option as a user is unlikely to change systems everyday from what we can see :)

Edited by Kilrah

Share this post


Link to post
Share on other sites

Posted · Report post

Very good, I'll go find/download the imperial version of Open9X.

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

The GPS-Hub finally made its way inside the FrSky 8-Ch telemetry Rx. It fits perfectly in there too. Only three wires are needed to connect it to the Rx (Pwr/Gnd/Hub-Data). A 4-wire cable connects to the GPS. Here's what it looks like before the covers are re-installed:

post-2-0-13092300-1335588413_thumb.jpg

And a photo after the covers are put on. The GPS cable requires cutting a slot in the plastic case. This is a working setup with GPS and baro altimeter.

post-2-0-10424400-1335588437_thumb.jpg

Here's what a normal factory installation looks like to do the same thing as shown in the above photo. As you can see, the new DiY GPS-Hub is more elegant than a typical FrSky installation.

post-2-0-19289200-1335633941_thumb.jpg

I received the new FrSky 4-Ch telemetry Rx today too. It is the latest version with the data port. I was very happy to see that the 4-Ch Rx is exactly the same size as the GPS-Hub. The Rx does not have a hard case. Instead, it's a simple paper cardboard sleeve. So a bit of doublesided tape and heatshrink is all that is needed to attach the DiY GPS-Hub. Here's a size comparison photo showing the GPS-Hub sitting on the 4-CH telemetry Rx:

post-2-0-90723600-1335588467_thumb.jpg

Edited by Mr.RC-Cam
Add factory install photo

Share this post


Link to post
Share on other sites

Posted · Report post

Is this available yet?

Share this post


Link to post
Share on other sites

Posted · Report post

This is a personal project, so it's not a product that I intend to build and sell. If there is sufficient interest I can post the schematics and firmware hex file after all the testing is complete. There may be a chance that I will have some spare unpopulated PCB's (but the builder would need to have very good SMD assembly experience).

Share this post


Link to post
Share on other sites

Posted · Report post

OK...thanks

Share this post


Link to post
Share on other sites

Posted · Report post

Hi I was wondering if your schematic and code have progressed thus far that you can post them.

I would like to build one of these sensor hubs myself.

I've experience in electronics and SMD soldering and can handle microchip pic programming so I could help you test this thing if need be

Also did you already grab one of those current sensing units (FAS-100)

Share this post


Link to post
Share on other sites

Posted · Report post

I was wondering if your schematic and code have progressed thus far that you can post them.

I'll post the schematic, BOM, and firmware. But first I need to review all of it to make sure it the information is clear. So I'll need a couple days.

Also did you already grab one of those current sensing units (FAS-100)

Who has it for sale?

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

Here are the technical details to build the DiY GPS-Hub. As updates occur I will post them here. Changes will be noted by the revision / version numbers:

Schematic, Rev A:
GPS-Hub_A_Schematic.pdf

Bill of Materials (BOM), Rev A:
GPS-Hub_A_BOM.pdf

PIC16F886 Firmware Hex file, V1.0:
FrskyHub.hex (revised)



Please note that this is an advanced project. It is suitable for someone with experience with SMD soldering. Programming the PIC requires a Microchip ICD2 or similar ICSP programming tool.
I have tested GPS-Hub with ER9X and Open9X firmware in a modified FlySky 9X transmitter; Please report the bugs you find.



General Information:

1. The schematic and BOM include details for using GTOP's PA6B GPS module. However, nearly any GPS module with a 3.3V TTL serial interface can be used. The main criteria is that the GPS must configured for 4Hz updates / 9600 baud. The GGA and RMC sentences are the only ones used, so all others should be disabled. Some GPS modules will be automatically configured by the GPS-Hub firmware (more on this later).

2. My custom PCB board layout had the GPS-OUT and HUB-OUT signals swapped. So that is why you see the two strange signal corrections on the Rev-A schematic.

3. The connections are as follows:

HUB (3-Pin)

Pin 1: To GPS RxD Input

Pin 2: Rx power (5VDC)

Pin 3: Rx common ground


GPS (4-Pin)

Pin 1: To GPS V-in (5VDC)

Pin 2: To GPS TxD Output

Pin 3: To FrSKY Data Input

Pin 4: To GPS Gnd


EXP (4-Pin)

Pin 1: Not used

Pin 2: Not used

Pin 3: Not used

Pin 4: Not used


ICSP (ICD 5-Pin programming port)

Pin 1: MCLR

Pin 2: Normally not used. Do NOT connect to 5V! See additional warnings below.

Pin 3: GND

Pin 4: DAT

Pin 5: CLK



Operational Notes:

(1) The max VCC voltage allowed on the ICSP / ICD port is 3.3V. Do NOT connect a 5V ICD/programmer! If your programmer does not have a 3.3V mode then apply 5V power to the GPS-Hub at the HUB pin-2 while you program it from the ICSP. In this case Do NOT connect anything to ICSP pin-2.

(2) Max voltage on any MCU pin is 3.3V. This means you cannot use a GPS module with 5V TTL or standard RS-232 voltage levels!

(3) LED Status:
During the Power Up Boot a 3 sec long rapid blink means the automatic GPS initialization feature is enabled.
Also during run-time you may see these three LED status indicators:
Slow Blink: All Ok.
Fast Blink: GPS not locked.
Periodic 3-sec pause Wink: GPS communication problem.

(3) If the GPS's GGA or RMC sentences are missing/bad then the FrSky V1 register will contain an error code:
1.00 = GGA bad.
2.00 = RMC bad.
3.00 = Both GGA and RMC are bad.
NOTE: For this feature to work correctly the GPS update rate must be 1Hz or faster.

(4) The FrSky ER9X/Open9X FUEL register has the satellite count.

(5) The FrSky ER9X/Open9X TEMPERATURE1 register has the precision temperature from the baro sensor IC.

(6) The FrSky ER9X/Open9X TEMPERATURE2 register has the satellite Fix status.

(7) At boot-up the firmware version number is sent to Register V6. It is not periodically
updated and the value can be erased by pressing the ER9X/Open9X menu button.
The Tx must be on BEFORE turning on the Rx to see this value.

(8) If GPS automatic initialization is not wanted then install Jumper-A to disable it.
If GPS initialization is enabled (no Jumper-A installed ) the LED will rapidly flash for 3-secs upon boot. This
3-sec period is the typical GPS memory battery pre-charge period that will be needed if the GPS memory
battery is severely depleted.

(9) If the BMP085 Baro Altimeter is not used then install Jumper-B to disable it.



The GPS-HUB has provisions to automatically configure the FrSKY (ublox) and GTOP (MTK) GPS modules. If you use these modules then there is no need to pre-configure them other than ensure their default baud rate is 9600. Other GPS modules may also respond to this built in feature if they use the same GPS engine chip sets found in the GTop or ublox. All other GPS modules will require that you configure them for 9600 baud, 4Hz, RMC and GGA sentences. Please consult your GPS data sheets on how to do this (requires the PC software provided by the GPS manufacture).


I have a some blank PCB's available (2-board set, same as used to build what you see in post #1). They are $10 USD each set, 2 for $18, 3 for $25. Postal shipping is $3. PayPal only. If you want one then please contact me by forum PM, do NOT use email. Please keep in mind that step by step instructions are NOT available; You will be required to build it using the published schematic and BOM.

Edited by Mr.RC-Cam
New hex file with corrected fuse bits

Share this post


Link to post
Share on other sites

Posted · Report post

Cool :)

Just a question, does the FrSky GPS (I don't have one) have the correct footprint to be soldered to the GPS board once removed from its own board? I don't have one and thought it actually way a GTop module, but from what you say it seems it's not the case...

Share this post


Link to post
Share on other sites

Posted · Report post

does the FrSky GPS (I don't have one) have the correct footprint to be soldered to the GPS board once removed from its own board?

The FrSky GPS uses a ublox module which does not fit the footprint of the GTop module used on my custom board. Fortunately a stock FrSky GPS works fine as-is (and is the same size), so there's no need to hack it.

I forgot to mention that the satellite count value that is sent to the Fuel register is scaled 10X. This allows it to conveniently appear as a 0-100% fuel level (0-10 satellites).

Share this post


Link to post
Share on other sites

Posted · Report post

Wow, an ublox module in such a cheap unit?! now that's worth it...

Share this post


Link to post
Share on other sites

Posted · Report post

Wow, an ublox module in such a cheap unit?! now that's worth it...

It's a ublox NEO-6M. It offers 5Hz updates and has a SAW filter in its front end. So it is a good companion to the DiY GPS-Hub. The GTop module is a good choice too.

Many GPS modules don't have the filter in them which makes them more sensitive to video Tx interference. Plus some older models are limited to 1Hz updates. So GPS-Hub project builders should choose wisely rather than randomly grab one from the spare parts drawer.

Share this post


Link to post
Share on other sites

Posted · Report post

A project trick not yet mentioned:

There are provisions on the custom GPS-Hub PCB to allow the use of a FrSky FVAS Variometer baro Sensor (instead of installing the BMP085 baro IC on the PCB).

On the bottom of the PCB are some pads labeled +5, GND, SDA and SCL. These are the I2C connections that are needed to communicate with the BMP085 baro sensor IC that is in the FrSky Variometer. So all four wires of FrSky's variometer would be connected to the GPS-Hub PCB.

I haven't tried installing FrSky's FVAS variometer on the GPS-Hub because I don't want the extra clutter from the external sensor. So using this option means you will be on your own.

Share this post


Link to post
Share on other sites

Posted · Report post

Hi,

Nice project, have sent you a PM.

Thanls

Les

Share this post


Link to post
Share on other sites

Posted · Report post

Hi Thomas,

Thanks for your reply. I have found a souce for the PA6B GPS module an dthe link is below. It says it has been customised for Developers.

Will it be suitable for your diy HUB/GPS?

Here is the link:

http://www.pvelectronics.co.uk/index.php?main_page=product_info&cPath=17&products_id=65

Thanks

Les

P.S i know i would have to change Baude rate, would anything else have to be changed. Or have a you a link to a better choice.

Share this post


Link to post
Share on other sites

Posted · Report post

Will it be suitable for your diy HUB/GPS?

A PA6B module will fit the DiY PCB.

i know i would have to change Baud rate, would anything else have to be changed.

You may have to restore the Gtop GPS's other default settings too. I recommend that you ask them to send you one that has the standard factory default configuration. Otherwise, be prepared to do this when you get it.

Share this post


Link to post
Share on other sites

Posted · Report post

Thanks Thomas,

I presume there is a facility in the Tool to set it back to Default?.

Les

Share this post


Link to post
Share on other sites

Posted · Report post

I presume there is a facility in the Tool to set it back to Default?.

The MiniGPS tool is a generic PC application for MediaTek based GPS Chip sets. So it does not know what Gtop's defaults would be for their PA6B module.

If you cannot find a standard PA6B with factory default settings then use MiniGPS and set the GPS as follows (these instructions can be used with Generic 3.3V compatible GPS modules too):

Baud: 9600

Fix Update Rate: 4 Hz

GGA : 1

RMC : 1

(All other NMEA Output Strings: 0)

Use the information in the GPS module's data sheet to set the factory default settings to all the remaining registers.

You will need a 3.3V TTL compatible USB-serial adapter so the GPS configuration tool can communicate with the GPS module.

Please note that you can also use FrSky's GPS module without any modifications. It may be more convenient if you cannot find a factory default (unmodified) PA6B module.

Share this post


Link to post
Share on other sites

Posted · Report post

Thanks Thomas,

Ive found a supplier and have ordered the PA6B. Ive also sent you some money for the PCB.

Look forward to building the Hub/GPS.

Reagrds

Les

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now