Jump to content


Photo

DiY FrSky GPS-Hub

Project Blog

  • Please log in to reply
107 replies to this topic

#1 Mr.RC-Cam

Mr.RC-Cam

    RC-Cam Mentor

  • Admin
  • PipPipPipPipPip
  • 4,696 posts
  • Location:USA
  • Interests:R/C video and photography.

Posted 13 April 2012 - 09:12 PM

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.

GPS-hub1.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, 14 May 2012 - 05:41 PM.
Added post #14 info

  • LTMNO thanked the author
- Thomas

#2 Kilrah

Kilrah

    RC-Cam Mentor

  • Trusted Member
  • PipPipPipPipPip
  • 2,079 posts
  • Location:Switzerland
  • Interests:Modelling, electronics, computers

Posted 13 April 2012 - 11:52 PM

Yum :)

#3 Mr.RC-Cam

Mr.RC-Cam

    RC-Cam Mentor

  • Admin
  • PipPipPipPipPip
  • 4,696 posts
  • Location:USA
  • Interests:R/C video and photography.

Posted 17 April 2012 - 08:58 PM

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?
- Thomas

#4 Kilrah

Kilrah

    RC-Cam Mentor

  • Trusted Member
  • PipPipPipPipPip
  • 2,079 posts
  • Location:Switzerland
  • Interests:Modelling, electronics, computers

Posted 18 April 2012 - 12:57 PM

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 :)

#5 Mr.RC-Cam

Mr.RC-Cam

    RC-Cam Mentor

  • Admin
  • PipPipPipPipPip
  • 4,696 posts
  • Location:USA
  • Interests:R/C video and photography.

Posted 18 April 2012 - 08:41 PM

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).
- Thomas

#6 Kilrah

Kilrah

    RC-Cam Mentor

  • Trusted Member
  • PipPipPipPipPip
  • 2,079 posts
  • Location:Switzerland
  • Interests:Modelling, electronics, computers

Posted 19 April 2012 - 10:02 AM

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, 19 April 2012 - 10:03 AM.


#7 Mr.RC-Cam

Mr.RC-Cam

    RC-Cam Mentor

  • Admin
  • PipPipPipPipPip
  • 4,696 posts
  • Location:USA
  • Interests:R/C video and photography.

Posted 19 April 2012 - 11:56 AM

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

#8 Mr.RC-Cam

Mr.RC-Cam

    RC-Cam Mentor

  • Admin
  • PipPipPipPipPip
  • 4,696 posts
  • Location:USA
  • Interests:R/C video and photography.

Posted 27 April 2012 - 08:55 PM

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:
GPS_Hub_Rx8B_800.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.
GPS_Hub_Rx8A_800.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.
GPS_Hub_factory.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:
GPS_Hub_Rx4A_800.jpg

Edited by Mr.RC-Cam, 28 April 2012 - 10:01 AM.
Add factory install photo

- Thomas

#9 Reacher10

Reacher10

    RC-Cam Visitor

  • Members+
  • Pip
  • 2 posts

Posted 28 April 2012 - 05:27 PM

Is this available yet?

#10 Mr.RC-Cam

Mr.RC-Cam

    RC-Cam Mentor

  • Admin
  • PipPipPipPipPip
  • 4,696 posts
  • Location:USA
  • Interests:R/C video and photography.

Posted 28 April 2012 - 09:28 PM

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).
- Thomas

#11 Reacher10

Reacher10

    RC-Cam Visitor

  • Members+
  • Pip
  • 2 posts

Posted 29 April 2012 - 05:02 AM

OK...thanks

#12 dschiedsch

dschiedsch

    RC-Cam Visitor

  • Members+
  • Pip
  • 1 posts

Posted 12 May 2012 - 10:38 AM

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)

#13 Mr.RC-Cam

Mr.RC-Cam

    RC-Cam Mentor

  • Admin
  • PipPipPipPipPip
  • 4,696 posts
  • Location:USA
  • Interests:R/C video and photography.

Posted 12 May 2012 - 03:14 PM

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?
- Thomas

#14 Mr.RC-Cam

Mr.RC-Cam

    RC-Cam Mentor

  • Admin
  • PipPipPipPipPip
  • 4,696 posts
  • Location:USA
  • Interests:R/C video and photography.

Posted 14 May 2012 - 04:20 PM

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:
Attached File  GPS-Hub_A_Schematic.pdf   20.23KB   1299 downloads

Bill of Materials (BOM), Rev A:
Attached File  GPS-Hub_A_BOM.pdf   5.64KB   907 downloads

PIC16F886 Firmware Hex file, V1.0:
Attached File  FrskyHub.hex   35.13KB   347 downloads (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, 19 February 2013 - 02:58 PM.
New hex file with corrected fuse bits

- Thomas

#15 Kilrah

Kilrah

    RC-Cam Mentor

  • Trusted Member
  • PipPipPipPipPip
  • 2,079 posts
  • Location:Switzerland
  • Interests:Modelling, electronics, computers

Posted 14 May 2012 - 10:24 PM

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...

#16 Mr.RC-Cam

Mr.RC-Cam

    RC-Cam Mentor

  • Admin
  • PipPipPipPipPip
  • 4,696 posts
  • Location:USA
  • Interests:R/C video and photography.

Posted 15 May 2012 - 07:23 AM

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).

- Thomas

#17 Kilrah

Kilrah

    RC-Cam Mentor

  • Trusted Member
  • PipPipPipPipPip
  • 2,079 posts
  • Location:Switzerland
  • Interests:Modelling, electronics, computers

Posted 15 May 2012 - 10:59 AM

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

#18 Mr.RC-Cam

Mr.RC-Cam

    RC-Cam Mentor

  • Admin
  • PipPipPipPipPip
  • 4,696 posts
  • Location:USA
  • Interests:R/C video and photography.

Posted 15 May 2012 - 01:59 PM

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.
- Thomas

#19 Mr.RC-Cam

Mr.RC-Cam

    RC-Cam Mentor

  • Admin
  • PipPipPipPipPip
  • 4,696 posts
  • Location:USA
  • Interests:R/C video and photography.

Posted 16 May 2012 - 12:18 PM

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.
- Thomas

#20 iwik

iwik

    RC-Cam'er

  • Trusted Member
  • PipPip
  • 76 posts

Posted 11 June 2012 - 02:08 AM

Hi,
Nice project, have sent you a PM.
Thanls
Les



Also tagged with one or more of these keywords: Project Blog