GPS-DO Project Planning - Page 1
Forum section: electronics / projects

author: Xnke
author_rank: Regular Contributor
timestamp: September 07, 2018, 12:25:27 pm
content: Since WWV has been slated for defunding, my current 10Mhz precision reference will be useless soon. So I'm converting it to be GPS-disciplined. It won't be *AS* accurate anymore, as what was originally a phase-locked loop will now be a frequency-locked loop, but it's still going to be accurate enough for what I need.So far, I've been doodling in EAGLE, picking parts out of the bins here and re-using parts from the current 10Mhz reference.The TXCO I have needs 12V to power it, and uses a 0-8 volt error correction voltage to steer it back on frequency. (OFC-Mcoy GSM surplus unit.) A MAX5217 I2c 16-bit DAC will generate the steering voltage on a 0-4v level, then an op-amp setup as a noninverting gain of 2 will convert to 0-8V.The ATmega32u4 is going to be set up as a Pro Micro, although since I want to put it all on one board I've just copied the pro-micro circuitry and pin-numbering scheme. This should help with getting the code done.The ATmega32u4's 16 bit timer1 can't handle more than Fosc/2.5, so can't count an external timer faster that 6.4Mhz. I'm going to divide the 10mhz oscillator signal down to 5Mhz, and square it up to a TTL compatible signal.The GPS module I have is the Skytraq S1315F, of which I can find very little information, other than the datasheet from Mouser Electronics. It appears that while this module is very inexpensive from some sources, it's an older part that's been superceded. I don't have to do much interfacing with it, and it's pre-configured. Just apply power, and the 1pps output and the NMEA data will start.Here are my current "notes" and some questions pertinent to each task the ATmega will have to do.1pps capture:GPS generates 1pps signal, rising edge signals the new second.Atmega32u4 uses INT6/arduino D7 as input, hardware interrupt.On the rising edge, interrupt and check Timer1's 16 bit count of the 5Mhz clock.Compare Timer1 to the ideal count.Do I need to separately generate the interrupt on INT6/ arduino D7, AND do the input capture on ICP1/arduino D4?LCD:HD44780 40 char x 2 line thing, Optrex PWB40267-CEM.plan to use PortF, the analog pins.A0, A1, A2, A3 to LCD D4, LCD D5, LCD D6, LCD D7A4 to RS, A5 to EWrite GPS data to LCD: Current time and date, satellites locked, number of satellites used, number of satellites in view, Is TXCO ready yes/no.5Mhz Input:5Mhz input to Timer 1 on PD6/arduino D1216 bit timer, continuous count. We'll check the count every time Int6 catches the 1pps interrupt.Serial Data from GPS:Receive serial data at 9600 baud on RXD1/arduino D0 from GPSParse serial data and extract current time and date, satellite lock, and number of satellites in view/in use.I2C interface:Interface to the 16 bit DAC to control the error voltage. Want to generate a 0-4 volt output voltage.TXCODivide 10Mhz by 2 to get 5Mhz squared up to feed timer1oven ready signal needs to be converted from <1v not ready to >3V ready to 0-5v digital.Oven ready is tied to PD7/arduino D6, and will display on LCD.Lots of code examples exist to do pretty much all of what I'm going to be doing, just gotta chop and swap what I need. Some people have done the timing control differently, some have good documentation, some have very little to none. Most used an I2C controlled LCD, which I don't have.I'm still very green with C and arduino programming, I do not get much time lately to play with it, and it's often separated by long periods of time...so I forget some of what I learn each time.Can anyone here help me get organized pin-wise, and make sure before I etch the PCB's and solder the bits down, that I've made good choices for what inputs and outputs I plan to use? I'll work on the code after I have a complete board, probably starting with things like does the arduino talk over USB, then can I get the GPS data, is the 1PPS coming in, does the DAC work, etc.

author: bingo600
author_rank: Super Contributor
timestamp: September 07, 2018, 06:01:45 pm
content: Maybe have a look herehttps://www.eevblog.com/forum/projects/lars-diy-gpsdo-with-arduino-and-1ns-resolution-tic/msg1278672/?topicseen#msg1278672

author: David Hess
author_rank: Super Contributor
timestamp: September 07, 2018, 06:21:50 pm
content: Why not derive the ATmega32u4 clock frequency directly from the 10MHz oscillator so the 1pps signal can be measured directly?There is no reason that the 10MHz oscillator cannot be phase locked instead of frequency locked to the 1pps output if a suitably long measurement time is used.

author: iMo
author_rank: Super Contributor
timestamp: September 07, 2018, 09:40:47 pm
content: First thing to do is to get or measure your TCXO's "gain" (in ppb/Volt). An important parameter for the actual design. Also the DAC would require an ref voltage - for example the OCXO's Vref output could be used - but the TCXOs don't have it usually, so you would need one and it would require a buffer too.

author: texaspyro
author_rank: Super Contributor
timestamp: September 08, 2018, 03:25:38 am
content: First, dump that stupid TCXO. You are building a frequency standard, Use a real OCXO/DOCXO. I'm rather fond of the Oscilloquartz 8663's. They do have a Vref output. Expect a surplus one to take around a month for the drift to fully stabilize.

author: Xnke
author_rank: Regular Contributor
timestamp: September 08, 2018, 11:02:47 pm
content: Yes, I think a TXCO (temperature controlled crystal oscillator) and an OXCO (oven controlled crystal oscillator) couldn't possibly be different ways of describing the same thing.Also, I think a TXCO with 1ppb accuracy is a good enough place to start. It's an OFC McCoy, osc92-100b.As far as the data for the oscillator, all I have is the voltage range for correction, 0 to 8.192 volts. The oscillator has a reference voltage output, and an oven state output. The reference voltage is...8.192 volts.Using the 10mhz oscillator as the local clock for the AtMega32U4 means that serial comms won't work-you can't derive the baud rates from a 10Mhz oscillator. USB would still work, as that's an internal oscillator in the ATMega32u4, and you would get the GPS and TXCO synced up approximately twice as fast, but you loose the option of using any kind of standard baud rates for communication with the GPS module.References I am working from:http://k6jca.blogspot.com/2016/02/an-arduino-based-gps-disciplined.htmlhttps://www.barbouri.com/2018/03/10/gps-disciplined-10-mhz-oscillator/#comment-579The second link actually uses the same GPS module I'm going to use, and the oscillator he used is the same pinout and control voltage-but it's a 10.000Mhz, rather than the 10.000000Mhz oscillator I have. They're "drop in" compatible but there are little detail differences, mostly in the oven control scheme-the Isotemp will go high and low on frequency from cold, while the McCoy slowly drifts up to frequency and doesn't have much overshoot-this kind of stuff doesn't matter too much. Their interface to the world is very close to the same.The reference code from the two above sources contains most of what I will need to make this work-actually the second reference would be almost exactly what I would need-but due to different processor, different LCD, and different features, I will end up writing some, if not most, of the code again. Particularly the adaptive compare interval routine, comparing the oscillator count to the previous one or two counts and adapting how many seconds to count deviation over-initially this will need to be a short duration, but as the oscillator stabilizes this duration can be increased to improve the accuracy. The two authors above listed both go into detail on why's and how's, and while both projects work very well, maybe I can improve on this part. Maybe I can't, who knows.The phase-locked approach is attractive, and the old one I built from an article recieved 10Mhz WWV and phase-locked to that carrier, so no division had to be done. Was simple-I didn't like the thought of dividing by 10 million and adding in all that switching time in the logic chips to divide that far-but it seems that isn't the only way to do it. I'll research PLL's and what I have around here that can do the job, and see if the PLL approach could be done without a significant extra outlay.(I have avoided contracting time-nuts disorder, so far...)

author: SilverSolder
author_rank: Super Contributor
timestamp: September 09, 2018, 05:29:09 am
content: Quote from: Xnke on September 08, 2018, 11:02:47 pmOne could bit-bang the serial comms instead of using the UART...

author: Xnke
author_rank: Regular Contributor
timestamp: September 09, 2018, 06:12:54 am
content: Sure, if you want to calculate all the timing required, and keep a timer running specifically for that, on top of all the other concurrently running counts.Just like generating a PWM signal and filtering it to avoid using a DAC for the error voltage. You can-and it works-but is it worth the overhead?I'm still trying to wrap my head around a way of doing the hardware PLL using dividers and comparators to do the phase lock, working it at 1hz would have such a long loop time I don't know that I could ever get the system stable enough to actually "lock".One of the goals of this project is to have a standard to measure oscillator drift against-on the order of 10s of minutes. Essentially I want my old vacuum tube based LO's in my transmitters to be adjusted for minimum drift, and I want a way to trim them in that's more accurate than the timebases in my current TM500 series measurement equipment (I'll get into that in another thread, I have a DC509A that needs some fixin'...) The ability to use it as a reference for all my measuring gear would help let me be absolutely sure all my homebuilt gear is within compliance.

author: hamster_nz
author_rank: Super Contributor
timestamp: September 09, 2018, 08:39:15 am
content: What GPS module are you going to use? IIRC the current ublox modules can be configured to give faster pulse per second signals - e.g a NEO-7N can generate up to 10MHz.

author: SilverSolder
author_rank: Super Contributor
timestamp: September 09, 2018, 11:30:03 am
content: Quote from: Xnke on September 09, 2018, 06:12:54 amAre you 100% sure it cannot be made to work at 10MHz? From the ATmega328P data sheet, we can see that 20 MHz is possible, so why not 10?

author: iMo
author_rank: Super Contributor
timestamp: September 09, 2018, 11:58:03 am
content: With 10MHz you get your 9600baud with UBRR=64 and w/ an error of 0.2%. It is recommended to be <3% with usart.No problem therefore..

author: iMo
author_rank: Super Contributor
timestamp: September 09, 2018, 12:01:21 pm
content: Quote from: hamster_nz on September 09, 2018, 08:39:15 amAs discussed in different threads already - be careful with the NEO7M(??N) modules.They work till 12MHz btw, with exception of output frequenciesFout = 48MHz/N, where N is not an integer (=4,5,6,7..)At 10MHz the output freq square wave is broken, therefore not suitable for PLLs or anything precise, IMHO..Do use 12/8/6.. MHz instead with NEO7M(??N)..

author: Gyro
author_rank: Super Contributor
timestamp: September 09, 2018, 12:24:13 pm
content: If you do a forum search for 'LEA-6T' you will find quite a lot of information on using the higher output frequencies, interger divide of the 48MHz clock etc. Which is relevant to the NEO-7.

author: Xnke
author_rank: Regular Contributor
timestamp: September 10, 2018, 11:23:10 pm
content: Quote from: hamster_nz on September 09, 2018, 08:39:15 amSkytraq S1315F.Quote from: imo on September 09, 2018, 11:58:03 amThat is very interesting. If this can be made to work, then that solves multiple problems.

author: cdev
author_rank: Super Contributor
timestamp: September 11, 2018, 03:37:24 am
content: The S1315F is an RTK-capable chip. That means that with the right antenna you can calculate position to within two centimeters or so. Or even better given a clear sky view a good enough antenna. In my experience the Skytraq accuracy is very good. They also are very sensitive.Just as a GPS, the S1315F has some timing features but you can't use it for both RTK and timing at the same time.I have two of them. I don't think it would likely be the same patch level, mine are more than five years old. Still, thats a very good GPS module, as they go.You might need access to the SDK for the chip to extract the kinds of information you'd need for a GPSDO. You could ask them, send them an email, they are quite helpful.The vendor who you got it from might have it.I think the person at Skytraq to ask would likely be Oliver Huang.

author: t1d
author_rank: Super Contributor
timestamp: September 11, 2018, 03:38:39 am
content: Louis, at skullcom, has a complete UBlox OS DIY project:Basically, he configures the UBlox for 10MHz. The PCB LED is then driven at 10MHz. He taps off of the LED pad, to capture the signal. An Arduino is used to drive a display and a menu, but it is not necessary, for capturing the signal. If you want different frequencies, the UBlox may be programmed, as such.

author: hamster_nz
author_rank: Super Contributor
timestamp: September 11, 2018, 04:20:33 am
content: Quote from: cdev on September 11, 2018, 03:37:24 amI know very little about RTK, after readinghttps://emlid.com/introduction-to-rtk-gps/I know only a tiny bit more.The article seems to implies you need two receivers (and two antennas). Am I missing something?

author: Mr. Scram
author_rank: Super Contributor
timestamp: September 11, 2018, 04:30:14 am
content: Quote from: hamster_nz on September 11, 2018, 04:20:33 amI have to admit I'm a bit confused too.

author: texaspyro
author_rank: Super Contributor
timestamp: September 11, 2018, 04:48:01 am
content: Quote from: cdev on September 11, 2018, 03:37:24 amNot really... RTK gives you a position of a "rover" receiver relative to a (usually) fixed position "base" receiver.My rocket launch system has a NEO-6M at the launch control table box and at each pad controller. These are not RTK receivers, but I get around 1 foot resolution of the distance between them. Since both receivers are relatively close to each other and are affected by the same atmospheric and ionospheric conditions the difference in their positions is quite good, but their absolute positions can be 10+ meters off.

author: hamster_nz
author_rank: Super Contributor
timestamp: September 11, 2018, 04:58:00 am
content: Quote from: Mr. Scram on September 11, 2018, 04:30:14 amThis link points to 174 pages of very dense information on GPS:https://www.u-blox.com/sites/default/files/products/documents/GPS-Compendium_Book_%28GPS-X-02007%29.pdfI think RTK in this context is Carrier Phase GPS - by tracking the carrier phase you get more accurate pseudoranges (because you are following the phase of the ~1.5GHz carrier, not the ~1Mb/s chipping code),Once you get to that precision, then the somewhat unpredictable effects of the ionosphere & atmosphere become the dominant source of error. Military receivers use a second (secured) frequency, and because the errors are frequency dependent they can be largely compensated for.The full RTK seems to be using a second stationery receiver, at a known point, to allow the local for propagation conditions to be deduced and distributed to the mobile receivers in the local area.https://www.aboutcivil.org/sources-of-errors-in-gps.htmlhas a useful table on 'standard' GPS errors...Code:Error VALUE (Approx)Ionosphere 4.0 metersClock 2.1 metersOrbit 2.1 metersTroposphere 0.7 metersReceiver 0.5 metersMultipath 1.0 meterTOTAL 10.4 meters

author: texaspyro
author_rank: Super Contributor
timestamp: September 11, 2018, 05:11:32 am
content: Quote from: hamster_nz on September 11, 2018, 04:58:00 amTaking advantage of carrier phase data generally involves post-processing the receiver measurements using very accurate satellite orbits that are available hours to weeks after-the-fact.I did a test of a couple GPS receivers that send carrier phase and pseudorange data. I converted the carrier phase values to pseudoranges and had CSRS-PPP process the carrier phase pseudorange data and the raw pseudorange data independently. The results were the same.Using combined carrier phase and pseudorange post processing on a L1 only receiver reduced the size of the error ellipses by less than 10% Carrier phase info only really helps when you have L1 and L2 data available... then you can get absolute positions within a few centimeters.

author: cdev
author_rank: Super Contributor
timestamp: September 11, 2018, 02:06:55 pm
content: See the publications of RTKlib's author, and the FOSSGEO list and "PPP Kinematic" and "PPP Static" settings of the RTKlib application. (NOT the Ublox "PPP" which is something else entirely)Yes, an internet connection is handy to download data. Also- If you can get access to a source of correction data - (which is often free- with a sign up of some kind, at least for now.) then you have your other base station and so you don't need PPP.http://gpspp.sakura.ne.jp/paper2005/ppprtk_201203a.pdfhttp://gpspp.sakura.ne.jphttps://github.com/tomojitakasu/RTKLIBhttps://lists.osgeo.org/pipermail/foss-gps/http://www.denshi.e.kaiyodai.ac.jp/gnss_tutor/pdf/es_01.pdfhttps://wiki.openstreetmap.org/wiki/RTKLIB

author: cdev
author_rank: Super Contributor
timestamp: September 11, 2018, 02:13:56 pm
content: Texaspyro,It depends on what version of the firmware you are running. Some (many/most) of the better Ublox receivers can do RTK using one hack or another. Open Street Map has the low down on which versions work and which ones don't. See the links I just posted.The Skytraq receivers are really good, IMHO. At the time they couldn't be beat for their cost.I still feel that with RTKlib or their own management application, they are more sensitive and deliver a better, more stable fix than my two Ublox (M8? older version FW) units (which may be lacking a TCXO, in otherwords they may be counterfeits. not M8Ns as they were represented to be.)I know the TCXO in the Skytraqs is good. I have never checked the accuracy of the 1PPS in the S1315Fs that I have.

author: Xnke
author_rank: Regular Contributor
timestamp: September 11, 2018, 06:40:06 pm
content: The S1315F's that I have are all the Venus 6 chipset-the current S1315F-RAW is a Venus 8 chipset.I can't hardly find anything on these older ones, but they were cheap as chips so I have a handful. I'm still looking at clocking the ATmega32u4 at 10mhz with the TXCO, as suggested, that should save a bit of code and speed up the timing lock by double.I wasn't able to find a method of using a 1hz phase lock that didn't take more room and complexity than using the ATmega to do frequency-locking, so I am still planning on the frequency-locked method.

author: texaspyro
author_rank: Super Contributor
timestamp: September 11, 2018, 08:49:59 pm
content: Quote from: cdev on September 11, 2018, 02:13:56 pmI did those tests with a Ublox M8T and a Venus RTK receiver, both with the latest firmwares.Lady Heather now supports writing RINEX files with the carrier phase / pseudorange info. These can be submitted to CSRS-PPP for precise position calculation.

author: cdev
author_rank: Super Contributor
timestamp: September 12, 2018, 01:34:12 am
content: I hope this is helpful then!S1315F-Raw is not a new designation. Older chips were Venus 6. I have a stash of many old Skytraq datasheets, as well as firmware for the Venus 6 devices I have on an older computer. I will have to look for them.I think their software-based SPARC core gives them a flexibility other vendors don't have.Many areas have free GPS data services. Where I live I can get free correction data in real time from both a nearby state that is much larger and my own state. The baselines are reasonably short. Also my town has done surveys and calculated the exact locations of maybe a hundred of its fire hydrants and luckily there is one very close to me. So I have access to high accuracy data to let me do a sanity check on my position fixes if I want to set up my own base station too. I might want to do that in the future.Quote from: Xnke on September 11, 2018, 06:40:06 pmYou can also find a bit more info on the Skytraq chip on Michele Bavaro's blog athttp://michelebavaro.blogspot.com/2011/04/skytraq-s1315f-raw-under-mangnifying.html

author: cdev
author_rank: Super Contributor
timestamp: September 12, 2018, 01:14:31 pm
content: How cheap were they and are they still available there?

author: Xnke
author_rank: Regular Contributor
timestamp: September 13, 2018, 01:45:56 am
content: They are currently available at Sparkfun for 11$/each, I bought 32 at 4$ each from a buddy of mine locally.

author: cdev
author_rank: Super Contributor
timestamp: September 21, 2018, 03:51:50 am
content: wow, thats really cheap. Well, you got a fabulous deal. You can use them for timing as well as make a super accurate GPS out of them.By super accurate I mean accurate to a few cm, with a decent antenna and a clear sky view. You can set up your own base station and do RTK using RTKlib. They are extremely sensitive.What firmware revision are they, can you launch GPS Viewer and extract the firmware and hardware patch levels?

author: hamster_nz
author_rank: Super Contributor
timestamp: September 23, 2018, 09:58:09 pm
content: I did a little bit of playing over the weekend, and hooked a UBLOX NEO-7M to an FPGA board, and count the number of 100MHz cycles between the PPS signal. Using a DSC1033 for the 100MHz source, and logged the count for ~10 hours. Graphs of data attached.It is worthwhile noting that the GPS module can be programmed to go into 'I'm in a fixed location' mode, which may improve the quality of the data a bit.Posting it here in case anybody finds it of interest.

author: cdev
author_rank: Super Contributor
timestamp: October 10, 2018, 05:09:03 pm
content: There is a plug-in for a wireshark-like program 'comms_champion' that promises to help document the ublox communications protocol - its on github.

author: iMo
author_rank: Super Contributor
timestamp: October 11, 2018, 05:48:21 pm
content: QuoteDoes this work with NEO-7M too?

author: cdev
author_rank: Super Contributor
timestamp: October 12, 2018, 01:13:02 am
content: Definitely a Neo 7 T could. Its possible that a 7 M could, but its possible it doesn't. I have an 8M and I do not remember seeing a Kalman filter setting for stationary. To be honest with you I don't remember. Look in U-center or the Ublox developer information.Look under "Kalman Filter" settings.I really doubt if any non-T GPSs have TRAIM but even the cheapest $6 Skytraq navspark Mini has something thats functionally very similar where you can tell it that its stationary and it will maintain the 1 PPS as long as it has at least one satellite. When you consider how sensitive they are (so they almost always can receive a few sats) the difference is not so important to having a reliable 1 pps. (however as these cheap GPSs only have a TCXO, no ovenized oscillator they are jittery within that approximately 25 ns window.