LibrePilot Forum

Development => Hardware => Topic started by: hwh on December 10, 2015, 01:12:41 am

Title: GPS/Mag combiner board
Post by: hwh on December 10, 2015, 01:12:41 am
I've been thinking about a small board to combine the GPS boards that have separate wires for GPS and Mag into one wire compatible with our serial ports the way the V9 GPS board is.  Essentially a postage stamp sized board with 3 connectors, a STM32F031G6 cpu, crystal, vr, and a few caps. And maybe the ESD chips if there's room. Firmware would be a modified version of the V9 firmware.

I've got two questions:

1. I picked that cpu because it matches the specs in the existing V9 firmware source.  I can't find a clear photo of the bottom of the V9, what cpu does it actually use?

2. I seem to remember (not that my memory is great) that the flash on the V9 was there for a future logger function that was never implemented.  True?

I was also thinking of trying to make a version that would fit inside the generic hockey puck gps like the one in https://forum.librepilot.org/index.php?topic=259.msg2471#msg2471  Remove both cables, hook a small board to where they were, and run the combined cable out.

Anyone else have any thoughts on this?

Title: Re: GPS/Mag combiner board
Post by: xfce on December 10, 2015, 03:19:20 am
I think you can have a try, it's simple.
use STM32F031G6, flash as revolution, mag as 5883, gps use ublox-7N , JUST DO IT ;D

here is my redesign oplink mini as it  support both 1W and 100mW transmit power :D
Title: Re: GPS/Mag combiner board
Post by: hwh on December 10, 2015, 03:58:55 am
@xfce  Thanks for the encouragement.  I am planning on doing it, mostly because doing a project is the best way I've found to get familiar with something.  In this case it's to get familiar with the project's source code.  Making a modified version of the firmware and getting it to run will force me to get better acquanted with the code. These days the hardware design is trivial compared to getting the firmware working.

I ordered a STMF0 discovery kit to breadboard a prototype before my earlier post. DigiKey is pretty good about shipping, it'll probably be here Friday or Saturday.  The GPS to go with it I ordered a few days ago but it's coming from China and will take longer to get here.  It's the same one I linked to in the earlier post.  Looking at his picture and knowing the size of the mag chip in it I estimate I can put around a 12x24mm board in there.  That gps is a really odd design, all the power and signal wires lay on top of the mag chip.  It's low power and current but I'd never have run those wires over a mag sensor.

I had wondered if anyone had laid out an oplink with the 1 watt module, nice job.  Did you make the larger board have the footprints for both the 100mw and 1w modules?
Title: Re: GPS/Mag combiner board
Post by: xfce on December 10, 2015, 04:13:19 am
Yes, it must be, and with a two layer boards
Title: Re: GPS/Mag combiner board
Post by: TheOtherCliff on December 10, 2015, 09:03:52 pm
I've considered this as well.  I started researching using an Arduino.
Title: Re: GPS/Mag combiner board
Post by: mazevx on December 10, 2015, 10:28:59 pm
It would be great if you can develop anything like this!
Title: Re: GPS/Mag combiner board
Post by: hwh on December 10, 2015, 10:37:19 pm
@TheOtherCliff  I thought about a board based on an AVR or PIC processor but liked the idea of keeping it STM32 like the rest of the project.  And a large part of my reason for doing it is to force myself to become familiar with the project's code.  In the 43 years I've been programming I've found that the best way for me to learn something is to just jump in and do a project.
Title: Re: GPS/Mag combiner board
Post by: JaeMelo on December 11, 2015, 04:32:22 pm
I can get you all the info you need about the v9 when mine arrives tomorrow in the mail.
Title: Re: GPS/Mag combiner board
Post by: TheOtherCliff on December 11, 2015, 08:23:30 pm
@hwh I would definitely suggest that you start by building your own LP code.  I bet you can do it in a day, but start with release 15.09 as 'next' is a bit in flux right now.

Then look at the files in: flight/targets/boards/gpsplatinum
That is the actual code running inside the V9 GPS.  It is the code where an F10x processor is used to talk to a GPS and a mag and put it out on a single serial connection.  The gpsplatinum code hasn't changed in a while now.
Title: Re: GPS/Mag combiner board
Post by: hwh on December 11, 2015, 08:38:37 pm
Thanks @TheOtherCliff.  I've already setup an account on bitbucket, forked LP into it, cloned it to my pc, installed the tools, and gotten next from the fork to compile.  And I've looked at the stock gpsplatinum code and at least a little at much of the other project code.  The STMF0 development boards should be here tomorrow and over the weekend I'll copy the v9 code to a new name, compile it, and try loading it on the dev board.  Once I get that so it loads and runs I'll work on deleting the flash chip code and the other changes needed.
Title: Re: GPS/Mag combiner board
Post by: cato on December 12, 2015, 05:37:02 pm
Definitely looking forware to your results :)
I liked the idea of the GPS V9 to transfer all date through the serial port, I would love to have a V9 kind of board, as mine is not working and it seems no new V9 will anymore produced ...
Title: Re: GPS/Mag combiner board
Post by: hwh on December 12, 2015, 06:19:51 pm
@cato Yes, the V9 is a nice GPS.  Even without the mag combiner it's a better design than any of the ones we can currently buy on eBay, Banggood, or other places.  Using the ublox modules there are essentially two ways to connect them to the antenna, the cheap way and the better way.  All the GPS I've seen available online use the cheap way, connect the antenna directly to the ublox module.  The V9 used the better way, it put an external LNA and/or filter between the module and the antenna.  I'm not sure which because none of the pictures I can find is clear enough to tell what the chip is. Either way, this makes it more sensitive and rejects interference from services on nearby frequencies like cell phones better.
Title: Re: GPS/Mag combiner board
Post by: JaeMelo on December 15, 2015, 03:24:37 pm
OP do you still need shots of the rear of the GPS?
Title: Re: GPS/Mag combiner board
Post by: hwh on December 15, 2015, 06:39:51 pm
@JaeMelo  I've gotten past the need for them but I'd still like to have them for future reference if you would post it.
Title: Re: GPS/Mag combiner board
Post by: JaeMelo on December 16, 2015, 06:10:48 pm
Ahh gotcha well I made sure most of the components are identifiable. Here is the link for the raw image http://imageshack.com/a/img905/1223/isps87.jpg (http://imageshack.com/a/img905/1223/isps87.jpg)

I wonder if there is a company out there that could somehow scan a bare pcb and generate a Gerber from it... Id totally do it to help get more v9's out there.
Title: Re: GPS/Mag combiner board
Post by: hwh on December 16, 2015, 07:58:10 pm
I couldn't ask for any clearer.  There's only one component that I can't read the numbers, a little rectangular one just above and to the right of the round antenna pin in the center. 

While in theory you could take all the components off and scan the board it's easier to just reverse engineer the schematic and lay it out again.  It's not that hard to do these days.  The info to do all but the LNA/filter strip of components is defined in the software source code. From it we know that for instance the gps SDA line goes to BP7 on the cpu, SCL to PB6, etc...

But the LNA/filter parts would probably have to be unsoldered and measured to exactly duplicate that part. 

That's not the problem, I could generate a set of schematics and gerbers for it if I had one to take apart.  The problem is moral, legal, ethical, whatever you want to call it.  Reversing it for personal use is probably OK but the least restrictive the board license is is probably still non-commercial use only like the revo, oplink, and other boards that we have original schematics for.  I think only the cc3d had a true open hardware license that allowed commercial duplication. Unless someone changed to license from non-commercial use I don't even think the revo and oplink copies are truly legitimate.

That said, if I had one, even an intact but non-working one, I'd regenerate the schematic and gerbers so people could homebrew their own.  Someone would have to donate one knowing they'd never get it back.

A better solution would be to lay out a new board using either the same 7 series module or the newer 8 series ublox module and just make it software compatible with the current board. That would avoid any question about the licensing of the board. 

I've considered doing that, these days the hardware is easier than debugging the firmware. But who's going to build them? I might hand build a couple for myself but I don't want to get into building and selling hardware.  And I could be wrong but I haven't seen anything that would make me think the project itself wants to get into building hardware.

And cost is also a consideration, in the US and Europe the parts to build one are way more than what we can buy the complete boards from China with separate gps and mag wires.  That's why I started working on a combiner board that will take one of those boards and make it look to the FC like an actual V9. The rest of the parts I need to develop this should be here in a week or so.  By early to mid January I should be ready to order blank PCBs.  I'm not sure whether or not I actually want to build and sell them but I was intending to make the design fully open source / open hardware so anyone can build their own once I get my own prototypes working properly.
Title: Re: GPS/Mag combiner board
Post by: JaeMelo on December 16, 2015, 08:38:16 pm
I couldn't ask for any clearer.  There's only one component that I can't read the numbers, a little rectangular one just above and to the right of the round antenna pin in the center. 

While in theory you could take all the components off and scan the board it's easier to just reverse engineer the schematic and lay it out again.  It's not that hard to do these days.  The info to do all but the LNA/filter strip of components is defined in the software source code. From it we know that for instance the gps SDA line goes to BP7 on the cpu, SCL to PB6, etc...

But the LNA/filter parts would probably have to be unsoldered and measured to exactly duplicate that part. 

That's not the problem, I could generate a set of schematics and gerbers for it if I had one to take apart.  The problem is moral, legal, ethical, whatever you want to call it.  Reversing it for personal use is probably OK but the least restrictive the board license is is probably still non-commercial use only like the revo, oplink, and other boards that we have original schematics for.  I think only the cc3d had a true open hardware license that allowed commercial duplication. Unless someone changed to license from non-commercial use I don't even think the revo and oplink copies are truly legitimate.

That said, if I had one, even an intact but non-working one, I'd regenerate the schematic and gerbers so people could homebrew their own.  Someone would have to donate one knowing they'd never get it back.

A better solution would be to lay out a new board using either the same 7 series module or the newer 8 series ublox module and just make it software compatible with the current board. That would avoid any question about the licensing of the board. 

I've considered doing that, these days the hardware is easier than debugging the firmware. But who's going to build them? I might hand build a couple for myself but I don't want to get into building and selling hardware.  And I could be wrong but I haven't seen anything that would make me think the project itself wants to get into building hardware.

And cost is also a consideration, in the US and Europe the parts to build one are way more than what we can buy the complete boards from China with separate gps and mag wires.  That's why I started working on a combiner board that will take one of those boards and make it look to the FC like an actual V9. The rest of the parts I need to develop this should be here in a week or so.  By early to mid January I should be ready to order blank PCBs.  I'm not sure whether or not I actually want to build and sell them but I was intending to make the design fully open source / open hardware so anyone can build their own once I get my own prototypes working properly.

If I'm correct the chip you are referring to is the one with the reflective lettering. I took a closer look and it says. "ATH3". Also I think your idea is much better taking into consideration the legal implications of being caught infringing someone else's hardware. In addition a GPS unit similar to the v9 but with a m8n module would be much better in the end.

If you do go through with this be sure to follow up id love to get hold of your gerber and BOM lists to assemble one myself.. I've already built a 2x revo's from components and excluding the price of having high Tg/Td ENIG PCB's fabbed up, components alone from digikey and sparkfun came out to be just under $90 So I understand the costs of something like this.

Heres one of my babies :P
(http://imagizer.imageshack.us/v2/xq90/908/QoOplW.jpg) (https://imageshack.com/i/p8QoOplWj)
Title: Re: GPS/Mag combiner board
Post by: mazevx on December 16, 2015, 10:57:49 pm
To find someone who can produce such a V9 derivate/copter/ rebuild how ever you want to call... Should be no problem we have done that before but it will be very expensive.
 Maybe drotek is interestet in this Technologie?
Title: Re: GPS/Mag combiner board
Post by: JaeMelo on December 16, 2015, 11:19:11 pm
To find someone who can produce such a V9 derivate/copter/ rebuild how ever you want to call... Should be no problem we have done that before but it will be very expensive.
 Maybe drotek is interestet in this Technologie?
Drotek makes some great GPS's. I've had a few of their 6M's, 7N's and M8N's. Maybe someone should shoot them a message letting them know that something that can send mag data over the same 4pin jst connector is demand.
Title: Re: GPS/Mag combiner board
Post by: mazevx on December 16, 2015, 11:44:33 pm
So hurry up write drotek an email ;-) someone with better skills than me and an idea of what we need should get in contact with them.
Title: Re: GPS/Mag combiner board
Post by: JaeMelo on December 17, 2015, 05:03:36 am
So hurry up write drotek an email ;-) someone with better skills than me and an idea of what we need should get in contact with them.
Thats the problem lol I know absolutely nothing about how the V9 works... Thats something I think someone like hwh would be better off explaining lol.
Title: Re: GPS/Mag combiner board
Post by: xfce on December 24, 2015, 05:09:23 am
May be like this 8)
Title: Re: GPS/Mag combiner board
Post by: hwh on December 24, 2015, 04:03:56 pm
It could be something like that. :)

The two halves of the picture seem to be of different revisions of the board.  On the left the board is designed for an external active antenna and on the right it shows a passive patch antenna mounted.

The other differences seem to be valid design decisions:
Most of the changes seem to be designed to lower cost and ease hand assembly and wouldn't affect performance.  I'm not sure what the performance difference between the external active antenna and the existing passive patch with LNA/SAW filter is.  I suspect they would be similar.  It would be interesting to test the two side by side and see.
Title: Re: GPS/Mag combiner board
Post by: TheOtherCliff on December 24, 2015, 06:09:40 pm
There is already a thread around here somewhere that discusses the DJI GPS/mag hardware.  They are only $26 shipped.  I have one on order to see how easy it would be to support.  I think this type of GPS/mag looks to be a real winner for us.
https://www.ebay.com/itm/252119739450 (https://www.ebay.com/itm/252119739450)
Title: Re: GPS/Mag combiner board
Post by: hwh on December 24, 2015, 08:00:56 pm
@TheOtherCliff  I ordered within minutes of you but from a different seller, http://www.ebay.com/itm/351480000985

The descriptions are identical but the logo on the pictures is different.  I found the one I ordered on banggood and although their description is identical to the auctions, including the 32 bit cpu, they show a picture of the inside that clearly has an Atmel Mega328p, an 8 bit cpu.  Other pictures on the web show one with a STM32F030F4P6. I'm hoping that I get the one with the Atmel chip and you get the STM32 one so we'll have firmware written for whichever one someone receives.
Title: Re: GPS/Mag combiner board
Post by: TheOtherCliff on December 24, 2015, 08:51:28 pm
I hope to go one better than that.  :)

These both use the DJI protocol.  It would be a lot easier to make the FC grok DJI GPS/mag.  No GPS/mag flashing needed for that, no matter what processor they use in the GPS/mag.
Title: Re: GPS/Mag combiner board
Post by: hwh on December 24, 2015, 09:52:26 pm
That doesn't seem like as much fun as tearing apart the gps units, reverse engineering them, and modifying them.  But it does make a lot more sense than my way and is way, way easier on the end user.  :)
Title: Re: GPS/Mag combiner board
Post by: xfce on December 25, 2015, 01:59:32 am
It could be something like that. :)

The two halves of the picture seem to be of different revisions of the board.  On the left the board is designed for an external active antenna and on the right it shows a passive patch antenna mounted.

The other differences seem to be valid design decisions:
  • ESD chips replaced with series resistors
  • supercap replaced by more conventional battery
  • LNA/SAW filters replaced by external active antenna
  • single caps on VRs replaced by equivalent pairs
  • tiny discrete components replaced with easier to work with larger size
Most of the changes seem to be designed to lower cost and ease hand assembly and wouldn't affect performance.  I'm not sure what the performance difference between the external active antenna and the existing passive patch with LNA/SAW filter is.  I suspect they would be similar.  It would be interesting to test the two side by side and see.

yes, I just design this to have a try. it is a prototype.
will use NEO-M8N, active antenna, rechargeable backup battery, the bottom side's passive antenna is just used to show as a 3D model.
all RLC use 0603 size.
and if all goes well, I will  assemble a prototype at the next weekend.
Title: Re: GPS/Mag combiner board
Post by: hwh on January 04, 2016, 07:30:42 pm
The Naza gps clone that I ordered on eBay arrived today.  It took 3 days to get from China to the US and after it cleared customs it only took the USPS 8 days to move it the remaining 60 miles.  Probably a new speed record for them... >:(

First, before anyone goes out and buys one, DON'T.  They don't work with anything other than NAZA flight controllers.  I ordered one to look at modifying the firmware in them to work with my revo and TheOtherCliff ordered one to look at changing the LP software to read the protocol they put out.  Currently you can't use one even if you change the connector.

The one I received is, as I hoped, the Atmel based one.  It's essentially an Arduino mini with a ublox Neo-M8N gps module and a mag sensor.   It's running an unmodified version of Pawelsky's adapter code that was written to emulate a real Naza gps.

The hardware is nicely done, a clean design and well constructed.  Unlike many of the inexpensive gps units available it has an external LNA and SAW filter on the gps and in theory should have performance similar to the V9 gps.  Maybe better since it has a newer generation Ublox module.

I hooked it up to a usb-serial adapter and confirmed that it works.  The firmware is hardcoded to 115,200 baud and it puts out Naza protocol packets.  It looks like about 4 or 5 gps packets a second and a lot more mag packets between them.  Probably 50 or so a second?

Even though TheOtherCliff's way of modifying the system to read this protocol is the best solution for most users I'm going to continue to work on replacement firmware that emulates the V9.  While most people probably wouldn't have the stuff around to install replacement firmware I think that if I release V9 emulation firmware for it the Chinese makers will probably produce and sell a version with that firmware and our JST-SH connectors.  At least I hope so.
Title: Re: GPS/Mag combiner board
Post by: TheOtherCliff on January 04, 2016, 08:31:54 pm
Just got mine as well.

I will begin with researching DJI protocol.

Google says it is well documented and 100% serial so it should be :) a very short time to implement.
Title: Re: GPS/Mag combiner board
Post by: hwh on January 04, 2016, 11:32:17 pm
@TheOtherCliff   The firmware in the atmel based ones was written by http://www.rcgroups.com/forums/member.php?u=393936 it's under Naza GPS module alternative (using APM 2.6 GPS/compass combo).  Unfortunately he didn't release the source code to his adapter but his posts document everything known about the protocol.

His page also has the protocol decoder he wrote.
Title: Re: GPS/Mag combiner board
Post by: TheOtherCliff on January 05, 2016, 09:25:33 am
I recall reading about a protocol description and source for a library for the DJI protocol.  That is probably where I will start.