Author Topic: Yet another DIY GPSDO - yes, another one  (Read 154702 times)

0 Members and 2 Guests are viewing this topic.

Offline AndrewBCNTopic starter

  • Frequent Contributor
  • **
  • Posts: 571
  • Country: fr
TIC traces
« Reply #350 on: October 23, 2021, 02:10:04 pm »
Having wired the 1ns resolution, 1000ns range TIC (Erik's version of Lars' TIC), attached is a DSO capture of the TIC output voltage. Bottom Yellow trace is the 1PPS from the GPS module, top Green trace is the TIC output voltage.

Explanation (please refer to the schematic page 2): a 1nF capacitor gets charged through a 1k resistor for X ns, X being the time difference between the GPS 1PPS and the picDIV 1PPS rising edges, which in the capture below is around 730ns. Hence the voltage output by the TIC when the capacitor is charged is more or less proportional to X, where X is between 0 and 1000ns. The 1nF capacitor is slowly discharged by a 1M resistor in parallel.

The 1PPS from the GPS also generates an interrupt, which causes the MCU to read the ADC channel that is connected to the TIC. The MCU then will use this information to adjust Vctl (the OCXO frequency control voltage) to minimize the phase difference between the 1PPS from the GPS and the 1PPS from the picDIV.

As can be seen in the DSO capture, there is still a lot of noise in the TIC output voltage, but it's manageable.
« Last Edit: October 23, 2021, 03:49:24 pm by AndrewBCN »
 

Offline Renate

  • Super Contributor
  • ***
  • Posts: 1460
  • Country: us
Re: Yet another DIY GPSDO - yes, another one
« Reply #351 on: November 01, 2021, 03:21:08 pm »
Just a minor footnote...

Most board GPS have an easily accessible PPS output, the consumer hockey pucks, not so much.
The (very common) GlobalSat BU-353S4 has a blinky LED but at 0.5 Hz (groan).
If you take one apart you'll see that there is a 6 pin connector with one pin not populated.
If you happen to have a spare 1mm pitch pigtail you can stuff the contact in.
The actual signal is a 1.8V logic signal but it's straining a bit under the LED drive.
I just took a pair of dykes to the LED, the signal swings 0.0 to 1.8V now.
 

Offline rodpp

  • Frequent Contributor
  • **
  • Posts: 307
Re: Yet another DIY GPSDO - yes, another one
« Reply #352 on: November 06, 2021, 05:20:21 am »
Hi,

My parts arrived from China. I followed the schematics and it didn't work.

After some troubleshooting, I concluded that the GPS M8N is defective. It arrived with some scratches, so it probably was used before, albeit it was selled as new (product link: https://www.aliexpress.com/item/32672644764.html?spm=a2g0s.9042311.0.0.42f84c4dIWiH8P).

See attached some pictures of the circuit and of the defective M8N GPS module. I changed some things in the code to show informations on the OLED display, even without the GPS module working, otherwise it stays locked waiting an GPS response and shows nothing on the screen.

I ordered locally another GPS module to replace this one.

Regards,
Rodrigo.
 

Offline MIS42N

  • Frequent Contributor
  • **
  • Posts: 511
  • Country: au
Re: Yet another DIY GPSDO - yes, another one
« Reply #353 on: November 06, 2021, 08:48:51 am »
Hi,

My parts arrived from China. I followed the schematics and it didn't work.

After some troubleshooting, I concluded that the GPS M8N is defective. It arrived with some scratches, so it probably was used before, albeit it was selled as new (product link: https://www.aliexpress.com/item/32672644764.html?spm=a2g0s.9042311.0.0.42f84c4dIWiH8P).
:
:
Regards,
Rodrigo.
I have a similar GPS module, I just connected it to a USB port on the computer with a cable from the USB port on the module. The USB supplies +5 to run the module and it runs. The module appears as a serial device, COM5, 9600 baud. I used Tera Term to see the serial data, it looked OK. I plugged in an antenna, and loaded VisualGPS (not VisualGPSview, I don't like it) and it show the module has a fix and is working.

I suggest you try this before saying the M8N is defective, the problem may be somewhere else.
 
The following users thanked this post: AndrewBCN

Offline AndrewBCNTopic starter

  • Frequent Contributor
  • **
  • Posts: 571
  • Country: fr
Re: Yet another DIY GPSDO - yes, another one
« Reply #354 on: November 06, 2021, 10:13:55 am »
Hi,
My parts arrived from China. I followed the schematics and it didn't work.
After some troubleshooting, I concluded that the GPS M8N is defective. It arrived with some scratches,
 ...
Regards,
Rodrigo.

Hello Rodrigo.
First, thank you for the pictures.  :-+ Looking good!

I see two problems with the GPS module:
1. The scratches you describe. It almost seems like someone was trying to "tune" the patch antenna. In any case, with these scratches I don't think it is going to work.
2. It's not an M8N, it's an M8L! First time I see an M8L, btw! Very strange.
You can open a dispute and ask for a full refund, including shipping costs. I have been promptly refunded by AliExpress before in some cases.

As MIS42N suggested, you can test the GPS module separately, or in-circuit with the small Arduino sketch I am attaching.

Are you using an extra "puck" antenna?

And yes, without a PPS the STM32 GPSDO does almost nothing. It really depends on the PPS signal to work.
« Last Edit: November 06, 2021, 10:21:26 am by AndrewBCN »
 
The following users thanked this post: Alex Nikitin, jpwolfe31

Offline Renate

  • Super Contributor
  • ***
  • Posts: 1460
  • Country: us
Re: Yet another DIY GPSDO - yes, another one
« Reply #355 on: November 06, 2021, 10:55:06 am »
I have a similar GPS module, I just connected it to a USB port on the computer with a cable from the USB port on the module. The USB supplies +5 to run the module and it runs.
Yes, the model shown will just run off USB power.
A board I have had an unpopulated jumper/0 ohm labelled "USB PWR" you needed to bypass for standalone USB operation.
 

Offline erikka

  • Regular Contributor
  • *
  • Posts: 183
  • Country: nl
Re: Yet another DIY GPSDO - yes, another one
« Reply #356 on: November 06, 2021, 02:54:32 pm »
A small warning.
When you have the GPS module on a breadboard surrounded by all kind of high frequency wires the GPS may find it difficulty to lock (at least mine did).
To solve you put the GPS module as far away as possible from all the high frequency wires.
This locking problem should be very visible when connected to a PCB using the USB port.
Once the GPS module gets close to the digital wires the number of satellites goes down and you even may loose GPS lock
 
The following users thanked this post: cdev

Offline rodpp

  • Frequent Contributor
  • **
  • Posts: 307
Re: Yet another DIY GPSDO - yes, another one
« Reply #357 on: November 06, 2021, 04:59:15 pm »

I have a similar GPS module, I just connected it to a USB port on the computer with a cable from the USB port on the module. The USB supplies +5 to run the module and it runs. The module appears as a serial device, COM5, 9600 baud. I used Tera Term to see the serial data, it looked OK. I plugged in an antenna, and loaded VisualGPS (not VisualGPSview, I don't like it) and it show the module has a fix and is working.

I suggest you try this before saying the M8N is defective, the problem may be somewhere else.

I tried to connet it using the USB without success, the computer doesnt detect it.

I installed the VisualGPS and it doesn't detect it either.


Hello Rodrigo.
First, thank you for the pictures.  :-+ Looking good!

I see two problems with the GPS module:
1. The scratches you describe. It almost seems like someone was trying to "tune" the patch antenna. In any case, with these scratches I don't think it is going to work.
2. It's not an M8N, it's an M8L! First time I see an M8L, btw! Very strange.
You can open a dispute and ask for a full refund, including shipping costs. I have been promptly refunded by AliExpress before in some cases.

As MIS42N suggested, you can test the GPS module separately, or in-circuit with the small Arduino sketch I am attaching.

Are you using an extra "puck" antenna?

And yes, without a PPS the STM32 GPSDO does almost nothing. It really depends on the PPS signal to work.


Thanks for the sketch, i tried but no success.

I'm using the puck antenna. I checked the RX/TX pins using the scope serial decoder, and it only shows data coming from the STM32F411 to the Ublox and no data from the Ublox to the SMT32F411.

But it seems I have a problem with the TinyGPS++ library, even with the basic example that do not need a GPS module (it creates the GPS response string), the STM32F411 is not presenting data on the serial console as it should.

Other examples like the Communications->Ascii are working normally with the serial console. I'll investigate it further.

Yes, the model shown will just run off USB power.
A board I have had an unpopulated jumper/0 ohm labelled "USB PWR" you needed to bypass for standalone USB operation.

My unit is not recognized when connected in the USB port.

A small warning.
When you have the GPS module on a breadboard surrounded by all kind of high frequency wires the GPS may find it difficulty to lock (at least mine did).
To solve you put the GPS module as far away as possible from all the high frequency wires.
This locking problem should be very visible when connected to a PCB using the USB port.
Once the GPS module gets close to the digital wires the number of satellites goes down and you even may loose GPS lock

Thanks, I'll change my circuit to place it far away from the other components.
 

Offline AndrewBCNTopic starter

  • Frequent Contributor
  • **
  • Posts: 571
  • Country: fr
Re: Yet another DIY GPSDO - yes, another one
« Reply #358 on: November 06, 2021, 11:08:54 pm »
...
I tried to connect it using the USB without success, the computer doesnt detect it.
...
Thanks for the sketch, i tried but no success.
I'm using the puck antenna. I checked the RX/TX pins using the scope serial decoder, and it only shows data coming from the STM32F411 to the Ublox and no data from the Ublox to the SMT32F411.
...
Other examples like the Communications->Ascii are working normally with the serial console. I'll investigate it further.

Hmm, from everything you described, it seems that GPS module is "dead".
 

Offline Johnny B Good

  • Frequent Contributor
  • **
  • Posts: 811
  • Country: gb
Re: Yet another DIY GPSDO - yes, another one
« Reply #359 on: November 07, 2021, 02:22:38 pm »
@rodpp

 Looking at the pictures (and assuming you haven't tested with an external active GPS antenna), I think you may be experiencing the very same problem I came across with my first purchase of that M8N module (a genuine one as it turned out) just over 2 1/2 years ago.

https://www.eevblog.com/forum/projects/ublox-neo-m8n-gps-navigation-signal-amplify-module-for-arduino-rasppery-pi/msg2277186/#msg2277186

 The link takes you to the relevant post describing the cause and its solution. Assuming the PPS LED lights when powered up, you can try a simple test with a 14cm length of solid core wire inserted into the SMA socket to act as a 3/4λ antenna (gives better results than a 1/4λ in this scenario). You can power it via its usb port from a powerbank.

 Using a powerbank allows you to roam anywhere this makeshift setup can get an unobstructed view of the sky - you only need to be able to see the LED start blinking at a steady 1PPS at this stage to confirm whether it will be worth performing a "Patchectomy" as I described in that post. :)

[EDIT]  I almost forgot to mention that it can take up to 20 minutes for these M8 (and M6 and M7) modules to reacquire the ephemeris data if they've gone more than four hours without an update (or the BBRAM supercap has discharged - typically 45 minutes reserve from loss of power if it's a fake without flash).

 Once it has valid ephemeris data, it can regain lock on subsequent power up cycles in anywhere from 3 to 36 seconds. The genuine (and the better fakes) can retain lock for an embarrassingly long time when you unplug the antenna or shield an attached patch antenna whilst in an outdoor location when you want to force a loss of lock in order to test how quickly they can regain lock after such LOS events.  ::)

PS the attached image shows what I'd discovered when I removed the patch antenna on my M8N module.  :wtf: no wonder it was struggling to receive any signals looking at all those circuit traces in what should have been just a solid groundplane. The LNA must have been overloaded into total submission (fortuitously muting the interference it would have  otherwise injected into the RF input on the module itself, leaving the signal from the external antenna connection unmolested).
« Last Edit: November 07, 2021, 05:11:00 pm by Johnny B Good »
John
 

Offline rodpp

  • Frequent Contributor
  • **
  • Posts: 307
Re: Yet another DIY GPSDO - yes, another one
« Reply #360 on: November 08, 2021, 11:49:01 pm »

Hmm, from everything you described, it seems that GPS module is "dead".


Yes, unfortunately it seems dead.

@rodpp

 Looking at the pictures (and assuming you haven't tested with an external active GPS antenna), I think you may be experiencing the very same problem I came across with my first purchase of that M8N module (a genuine one as it turned out) just over 2 1/2 years ago.

https://www.eevblog.com/forum/projects/ublox-neo-m8n-gps-navigation-signal-amplify-module-for-arduino-rasppery-pi/msg2277186/#msg2277186

 The link takes you to the relevant post describing the cause and its solution. Assuming the PPS LED lights when powered up, you can try a simple test with a 14cm length of solid core wire inserted into the SMA socket to act as a 3/4λ antenna (gives better results than a 1/4λ in this scenario). You can power it via its usb port from a powerbank.

 Using a powerbank allows you to roam anywhere this makeshift setup can get an unobstructed view of the sky - you only need to be able to see the LED start blinking at a steady 1PPS at this stage to confirm whether it will be worth performing a "Patchectomy" as I described in that post. :)

[EDIT]  I almost forgot to mention that it can take up to 20 minutes for these M8 (and M6 and M7) modules to reacquire the ephemeris data if they've gone more than four hours without an update (or the BBRAM supercap has discharged - typically 45 minutes reserve from loss of power if it's a fake without flash).

 Once it has valid ephemeris data, it can regain lock on subsequent power up cycles in anywhere from 3 to 36 seconds. The genuine (and the better fakes) can retain lock for an embarrassingly long time when you unplug the antenna or shield an attached patch antenna whilst in an outdoor location when you want to force a loss of lock in order to test how quickly they can regain lock after such LOS events.  ::)

PS the attached image shows what I'd discovered when I removed the patch antenna on my M8N module.  :wtf: no wonder it was struggling to receive any signals looking at all those circuit traces in what should have been just a solid groundplane. The LNA must have been overloaded into total submission (fortuitously muting the interference it would have  otherwise injected into the RF input on the module itself, leaving the signal from the external antenna connection unmolested).


Thanks for the detailed answer!

I tested it with a external puck antenna placed outdoor, with no success. I tried connecting it using the computer USB port, and no success too.

Even after hours with an external antenna, the pps LED never turned on or blinked, always off... and no communications too. Checked with the scope, the serial communication from the STM32F411 to the M8L arrives ok, but the module never answer anything.

I opened an AliExpress dispute.


Here is the serial output using the AndrewBCN code from github, even after hours powered on and using an external antenna:

Code: [Select]
21:46:59.345 -> UBX command sent, waiting for UBX ACK...
21:46:59.345 ->  * Reading ACK response:  (FAILED!)
21:47:02.347 -> Oops, something went wrong here...
21:47:02.347 -> B562624240FFFF23000010270050FA0FA06402C100001027000000004953
21:47:02.347 -> UBX command sent, waiting for UBX ACK...
21:47:02.347 ->  * Reading ACK response:  (FAILED!)
21:47:05.347 -> Oops, something went wrong here...
21:47:05.347 -> B562624240FFFF23000010270050FA0FA06402C100001027000000004953
21:47:05.347 -> UBX command sent, waiting for UBX ACK...
21:47:05.347 ->  * Reading ACK response:  (FAILED!)
21:47:08.347 -> Oops, something went wrong here...
21:47:08.347 -> B562624240FFFF23000010270050FA0FA06402C100001027000000004953
21:47:08.347 -> UBX command sent, waiting for UBX ACK...
21:47:08.347 ->  * Reading ACK response:  (FAILED!)
21:47:11.348 -> Oops, something went wrong here...
21:47:11.348 -> B562624240FFFF23000010270050FA0FA06402C100001027000000004953
21:47:11.348 -> UBX command sent, waiting for UBX ACK...
21:47:11.348 ->  * Reading ACK response:  (FAILED!)
21:47:14.319 -> Oops, something went wrong here...
21:47:14.319 -> B562624240FFFF23000010270050FA0FA06402C100001027000000004953
21:47:14.319 -> UBX command sent, waiting for UBX ACK...
21:47:14.319 ->  * Reading ACK response:
 
The following users thanked this post: Johnny B Good

Offline Renate

  • Super Contributor
  • ***
  • Posts: 1460
  • Country: us
Re: Yet another DIY GPSDO - yes, another one
« Reply #361 on: November 11, 2021, 04:25:41 pm »
Another minor note for what it's worth.
Some devices have a 0.5 Hz "PPS" which is just stupid. You can't get exact triggering the same on a rising edge as a falling edge. It's better to just pick one if you're stuck with 0.5 Hz.
In any case, I just discovered that the 0.5 Hz out of a GlobalSat BU-353S4 is not even locked to even/odd seconds. It's just random at startup and XORed once a second.
 

Offline cdev

  • Super Contributor
  • ***
  • !
  • Posts: 7350
  • Country: 00
Re: Yet another DIY GPSDO - yes, another one
« Reply #362 on: November 11, 2021, 07:50:20 pm »
A small warning.
When you have the GPS module on a breadboard surrounded by all kind of high frequency wires the GPS may find it difficulty to lock (at least mine did).
To solve you put the GPS module as far away as possible from all the high frequency wires.
This locking problem should be very visible when connected to a PCB using the USB port.
Once the GPS module gets close to the digital wires the number of satellites goes down and you even may loose GPS lock

Yes..  thank you!

If you read the UBLOX implementation manual they say this also. Their modules should not be placed on the backside of the antenna. (As shown)

As erikka says this is a guaranteed problem because the module is a source of noise. Better to use a large external andtenna with built in LNA and placed in a place it can see the sky. The digital traces should not be where they are with this module. Bet you it is misrepresented as an M8N and actually is not a real M8N. Send it back. If its mislabeled a something it isn't (like an official M8N, ebay will cancel out your sale and the debit. If the module does not have working flash memory and cannot be updated, it is not an M8N. Very few if any of them bought in this context are genuine.
"What the large print giveth, the small print taketh away."
 

Offline rodpp

  • Frequent Contributor
  • **
  • Posts: 307
Re: Yet another DIY GPSDO - yes, another one
« Reply #363 on: November 17, 2021, 02:02:24 am »
The new GPS module I bought locally arrived today, with a M8N chip and not a M8L as before. I replaced the suspect GPS module and the circuit worked (please, see the attached image). Thank you all!

My universal counter is measuring around 1.5Hz above 10MHz, I'll monitor it over the days.

I put the puck antenna over the rooftop, using a 6m SMA extension cable. It is only getting around 5 or 6 satellites. Should I upgrade the antenna, or is that ok?
« Last Edit: November 17, 2021, 02:04:10 am by rodpp »
 
The following users thanked this post: AndrewBCN

Offline MIS42N

  • Frequent Contributor
  • **
  • Posts: 511
  • Country: au
Re: Yet another DIY GPSDO - yes, another one
« Reply #364 on: November 17, 2021, 05:22:08 am »
I put the puck antenna over the rooftop, using a 6m SMA extension cable. It is only getting around 5 or 6 satellites. Should I upgrade the antenna, or is that ok?
When you say "getting around 5 or 6 satellites" is that satellites in view or satellites used to get a fix. I suggest you pull the M8N module off the breadboard and plug a usb cable from a computer into the usb socket on the M8N module. You can then use a program to see exactly what satellites are in view and their signal strength, and what satellites are used for a fix. I am not 100% sure what the signal strength value means, but I suspect SNR in dB. If you are getting four or more satellites at 30 (dB?) or greater then all should be well and you don't need to do anything with your antenna. The critical value for good readings is HDOP or PDOP (dilution of precision). Ideally this is always below 2. VDOP can be higher.

A well positioned antenna will "see" many more satellites than needed. There are recommendations elsewhere for timing GPS modules how to get the best results by selecting constellations and only accepting signals from satellites above a certain angle.
 
The following users thanked this post: rodpp

Offline Renate

  • Super Contributor
  • ***
  • Posts: 1460
  • Country: us
Re: Yet another DIY GPSDO - yes, another one
« Reply #365 on: November 17, 2021, 11:08:55 am »
Ideally this is always below 2. VDOP can be higher.
Just saying (reading this morning):
Code: [Select]
DoP H/V 0.48 / 0.91My cheaper GPS is saying 0.7 / 1.4
« Last Edit: November 17, 2021, 11:11:58 am by Renate »
 

Offline AndrewBCNTopic starter

  • Frequent Contributor
  • **
  • Posts: 571
  • Country: fr
Re: Yet another DIY GPSDO - yes, another one
« Reply #366 on: November 17, 2021, 12:41:56 pm »
There are two problems somewhere in your setup, because after three hours uptime, the OCXO frequency should have stabilized at 10MHz +/- 0.01Hz, and you should be getting at least a dozen satellites in view or so with a rooftop antenna.

1. Are you using the PWM 16-bit DAC or the redundant 12-bit DAC module? Try using the 16-bit PWM DAC (requires 2 resistors and 2 capacitors).
2. Try to reposition your puck antenna. Even indoors I get > 10 satellites in view with the M8N module.
3. Please copy/paste a 1s sample of what the GPSDO is reporting through the USB serial or the Bluetooth.
4. Please copy paste the configuration section of the firmware you have compiled (the #define's).
« Last Edit: November 17, 2021, 12:49:05 pm by AndrewBCN »
 
The following users thanked this post: rodpp

Offline tic226

  • Newbie
  • Posts: 8
  • Country: de
Re: Yet another DIY GPSDO - yes, another one
« Reply #367 on: November 17, 2021, 01:25:29 pm »
Hi @AndrewBCN , i have created a PCB layout with a socket for the DAC module and overlooked that in your schematic you supply that module with 3.3V instead of 5V (i blame it on the fact that i didn't have my glasses on and an almost empty toner cartridge). The module works with both voltages but when supplied with 5V its output range is 0...5V. Does the larger voltage range require changes to your software?
I'm afraid it's too late to change the layout as it is already being manufactured in China. In the worst case i can add a 3.3V regulator to the module.
 

Offline AndrewBCNTopic starter

  • Frequent Contributor
  • **
  • Posts: 571
  • Country: fr
Re: Yet another DIY GPSDO - yes, another one
« Reply #368 on: November 17, 2021, 01:43:04 pm »
Hi @AndrewBCN , i have created a PCB layout with a socket for the DAC module and overlooked that in your schematic you supply that module with 3.3V instead of 5V (i blame it on the fact that i didn't have my glasses on and an almost empty toner cartridge). The module works with both voltages but when supplied with 5V its output range is 0...5V. Does the larger voltage range require changes to your software?
I'm afraid it's too late to change the layout as it is already being manufactured in China. In the worst case i can add a 3.3V regulator to the module.

The problem is that the I2C DAC module interfaces with the STM32 module which works with 3.3V logic levels. I am not sure what could happen if you power the DAC with 5.0V when all the other modules are powered with 3.3V.

Note that you don't need to add a 3.3V regulator, the Black Pill can supply more than enough current from its 3.3V power output pin, it has an onboard LDO 3.3V regulator.
 

Offline thinkfat

  • Supporter
  • ****
  • Posts: 2150
  • Country: de
  • This is just a hobby I spend too much time on.
    • Matthias' Hackerstübchen
Re: Yet another DIY GPSDO - yes, another one
« Reply #369 on: November 17, 2021, 01:47:33 pm »
I think the I2C I/Os on most STM32 are 5V tolerant. It should not be a problem to pull them up to 5V. You'll have to check the datasheet of your particular STM32 but it is very likely.

Or, you could use a DAC that has separate I/O rails for digital I/O and for the analog part.
Everybody likes gadgets. Until they try to make them.
 

Offline tic226

  • Newbie
  • Posts: 8
  • Country: de
Re: Yet another DIY GPSDO - yes, another one
« Reply #370 on: November 17, 2021, 02:31:10 pm »
I just had a closer look at the MCP4725 module (Adafruit version) and they come with their own pullup resistors and it is the the only module on SDA1/SCL1. The only other optional module i use is the INA219 which hangs off SDA3/SCL3. So while the MCU port pins are 5V tolerant the rail-to-rail design of the DAC would mean up to 5V on the MCU's PB0 pin. I have a bag full of 3.3V LDO regulators lying around (MCP1702). I think i'll add one of those to the module, it's much simpler than to reroute 3.3V to the socket pin on the GPSDO board, really should have gone with the PWM option in the first place....

The only missing piece is one of those chains to hang my glasses around my neck so i can't misplace them anymore. 
 
The following users thanked this post: AndrewBCN

Offline AndrewBCNTopic starter

  • Frequent Contributor
  • **
  • Posts: 571
  • Country: fr
Re: Yet another DIY GPSDO - yes, another one
« Reply #371 on: November 17, 2021, 07:54:23 pm »
It is because of these small problems that come up during the build that I advise people to assemble the STM32 GPSDO on a breadboard first.

For example, it is easy to compare the OCXO frequency regulation from the 12-bit I2C DAC vs the 16-bit PWM DAC on a breadboard prototype. Both work to achieve 10E-9 (0.01Hz) regulation, but the 16-bit PWM DAC goes a little bit further and one can achieve 10E-10 (0.001Hz) regulation (as far as I can tell), even on a noisy breadboard prototype.

And personally I am still experimenting with the optional picDIV, sinewave output filter, 1ns (theoretical) resolution TIC, so I have not committed to a PCB layout yet.
 

Offline rodpp

  • Frequent Contributor
  • **
  • Posts: 307
Re: Yet another DIY GPSDO - yes, another one
« Reply #372 on: November 18, 2021, 04:09:30 pm »
I put the puck antenna over the rooftop, using a 6m SMA extension cable. It is only getting around 5 or 6 satellites. Should I upgrade the antenna, or is that ok?
When you say "getting around 5 or 6 satellites" is that satellites in view or satellites used to get a fix. I suggest you pull the M8N module off the breadboard and plug a usb cable from a computer into the usb socket on the M8N module. You can then use a program to see exactly what satellites are in view and their signal strength, and what satellites are used for a fix. I am not 100% sure what the signal strength value means, but I suspect SNR in dB. If you are getting four or more satellites at 30 (dB?) or greater then all should be well and you don't need to do anything with your antenna. The critical value for good readings is HDOP or PDOP (dilution of precision). Ideally this is always below 2. VDOP can be higher.

A well positioned antenna will "see" many more satellites than needed. There are recommendations elsewhere for timing GPS modules how to get the best results by selecting constellations and only accepting signals from satellites above a certain angle.

5 or 6 satellites is the number shown in the OLED display. Sometimes it goes up to 9 or 10 and decreases again.

I connected the module using the USB as suggested and I used the VisualGPS software. It never had 4 satellites above 30. The best I can get is 2 satellites above 30, sometimes less in the same antenna position. The total of satellites in view inside the VisualGPS software is around 10. The VisualGPS never get a fix or show any coordinates, so no HDOP, PDOP or VDOP values.

It was a goot test to show that the 6m SMA cable degrates the antenna signal significantly, it is much better to leave the antenna in an obstructed view than over the rooftop using the extension cable.

Probably, I'll need to buy a better antenna and a better extension cable, maybe coaxial intead of this thin SMA extension cable. To put the antenna over the rooftop, passing the cable inside the walls, I'll need around 10m of cable.

There are two problems somewhere in your setup, because after three hours uptime, the OCXO frequency should have stabilized at 10MHz +/- 0.01Hz, and you should be getting at least a dozen satellites in view or so with a rooftop antenna.

1. Are you using the PWM 16-bit DAC or the redundant 12-bit DAC module? Try using the 16-bit PWM DAC (requires 2 resistors and 2 capacitors).
2. Try to reposition your puck antenna. Even indoors I get > 10 satellites in view with the M8N module.
3. Please copy/paste a 1s sample of what the GPSDO is reporting through the USB serial or the Bluetooth.
4. Please copy paste the configuration section of the firmware you have compiled (the #define's).

Regarding your questions:

1- I was using the 12-bit DAC. Now I'm using the PWM and the circuit now is working good. Maybe the problem was not the DAC, but the Universal Counter that I'm using to measure the output frequency. It's impendance is 1Mohm, but if I connect it after the resistor R5 the 10MHz signal deteriorates. Now I'm connecting it between the oscillator and the R5, and it is ok.

2- As discussed above, I tested the antenna connecting it to the USB using the VisualGPS software. The extension cable is really bad, so no success placing the antenna in a better position, like over the rooftop. Sometimes I get 9-10 satellites on the OLED screen too, but most of the time it is around 6.

3- Please, see the output (only coordinates edited):
Code: [Select]
$GNGSA,A,3,02,05,18,24,25,29,20,12,,,,,2.30,1.19,1.97*1E
$GNGLL,XXXX.XXXXX,S,XXXXX.XXXXX,W,154555.00,A,A*72
$GNRMC,154556.00,A,XXXX.XXXXX,S,XXXXX.XXXXX,W,0.040,,181121,,,A*69
$GNGGA,154556.00,XXXX.XXXXX,S,XXXXX.XXXXX,W,1,11,0.92,744.5,M,-7.7,M,,*5F

Fix time 879mS
Uptime: 000d 17:53:41
New GPS Fix:
Lat: -XX.XXXXXX Lon: -XX.XXXXXX Alt: 744.5m
Sats: 11 HDOP: 0.92
UTC Time: 15:45:56 Date: 18/11/2021

Voltages:
Vctl: 1.88  DAC: 2336
VctlPWM: 1.66  PWM: 30046
Vcc: 4.83
Vdd: 3.28

Frequency measurements using 64-bit counter:
64-bit Counter: 644065948477
Frequency: 10000000 Hz
10s Frequency Avg: 10000000.0 Hz
100s Frequency Avg: 10000000.00 Hz
1,000s Frequency Avg: 9999999.999 Hz
10,000s Frequency Avg: 0.0000 Hz

BMP280 Temperature = 27.6 *C
Pressure = 947.2 hPa
Approx altitude = 729.9 m
AHT10 Temperature: 26.95 *C
Humidity: 70.20% rH

4- When I was using the 12-bit DAC, the configuration were:
Code: [Select]
// Define hardware options
// -----------------------
#define GPSDO_OLED            // SSD1306 128x64 I2C OLED display
#define GPSDO_MCP4725         // MCP4725 I2C 12-bit DAC
// #define GPSDO_PWM_DAC         // STM32 16-bit PWM DAC, requires two rc filters (2xr=20k, 2xc=10uF)
#define GPSDO_AHT10           // I2C temperature and humidity sensor
#define GPSDO_GEN_2kHz        // generate 2kHz square wave test signal on pin PB9 using Timer 4
#define GPSDO_BMP280_SPI      // SPI atmospheric pressure, temperature and altitude sensor
// #define GPSDO_INA219          // INA219 I2C current and voltage sensor
// #define GPSDO_BLUETOOTH       // Bluetooth serial (HC-06 module)
#define GPSDO_VCC             // Vcc (nominal 5V) ; reading Vcc requires 1:2 voltage divider to PA0
#define GPSDO_VDD             // Vdd (nominal 3.3V) reads VREF internal ADC channel
#define GPSDO_CALIBRATION     // auto-calibration is enabled
#define GPSDO_UBX_CONFIG      // optimize u-blox GPS receiver configuration
#define GPSDO_VERBOSE_NMEA    // GPS module NMEA stream echoed to USB serial xor Bluetooth serial

Now, using the PWM, it is:
Code: [Select]
// Define hardware options
// -----------------------
#define GPSDO_OLED            // SSD1306 128x64 I2C OLED display
#define GPSDO_MCP4725         // MCP4725 I2C 12-bit DAC
#define GPSDO_PWM_DAC         // STM32 16-bit PWM DAC, requires two rc filters (2xr=20k, 2xc=10uF)
#define GPSDO_AHT10           // I2C temperature and humidity sensor
#define GPSDO_GEN_2kHz        // generate 2kHz square wave test signal on pin PB9 using Timer 4
#define GPSDO_BMP280_SPI      // SPI atmospheric pressure, temperature and altitude sensor
// #define GPSDO_INA219          // INA219 I2C current and voltage sensor
// #define GPSDO_BLUETOOTH       // Bluetooth serial (HC-06 module)
#define GPSDO_VCC             // Vcc (nominal 5V) ; reading Vcc requires 1:2 voltage divider to PA0
#define GPSDO_VDD             // Vdd (nominal 3.3V) reads VREF internal ADC channel
#define GPSDO_CALIBRATION     // auto-calibration is enabled
#define GPSDO_UBX_CONFIG      // optimize u-blox GPS receiver configuration
#define GPSDO_VERBOSE_NMEA    // GPS module NMEA stream echoed to USB serial xor Bluetooth serial

If I comment the 12-bit DAC line, the compilation returns a error because a non declared variable is used.

I attached two multimeter screens that shows the control voltage of the oscillator over time.

The 10MHz output measure by the universal counter is 9.999,999,966,5MHz, the last two digits varying aproximately between 50 to 78.

So, the frequency variantion is < 1ppb and my universal counter is off by 3.35ppb.
 
The following users thanked this post: AndrewBCN

Offline AndrewBCNTopic starter

  • Frequent Contributor
  • **
  • Posts: 571
  • Country: fr
Re: Yet another DIY GPSDO - yes, another one
« Reply #373 on: November 18, 2021, 06:15:56 pm »
Hi Rodrigo,

That looks very good to me with the PWM DAC working as it should.  :-+

I will be uploading version 0.04j of the STM32 GPSDO firmware soon, it should fix a few small bugs and add a few new features. Version 0.05 is still a couple of months away.

You can also try the Bluetooth connection, check the GitHub repository there is a small program to configure the HC-06 Bluetooth module. Then you can control the GPSDO from your smartphone!  ;D

About the SMA extension cable, to be honest I was suspicious that it was the cause of your poor satellite reception.

You can consult with MIS42N, he has a very good and inexpensive setup for his GPS rooftop antenna.

 
The following users thanked this post: rodpp

Offline rodpp

  • Frequent Contributor
  • **
  • Posts: 307
Re: Yet another DIY GPSDO - yes, another one
« Reply #374 on: November 18, 2021, 06:55:14 pm »
Thank you Andrew,

I'll try the bluetooth later, will be nice to control it using my smartphone!

Regarding the antenna, one option is to place the GPS module on the roof, near the antenna, and use a CAT5e cable to connect it to the STM32. But I would like to put everything inside a box in the future, so better if the GPS module stay near the STM32. I'll research more about placing the antenna far away from the GPS module.
 
The following users thanked this post: AndrewBCN


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf