TM4313 GPSDO: strange behavior after a night of poor reception - Page 1
Forum section: electronics / testgear

author: shapirus
author_rank: Super Contributor
timestamp: April 09, 2024, 09:19:52 am
content: I'm new to the GPSDO topic.I bought a GPSDO during an Aliexpress sale out of curiosity, and it later turned out to be (per reviews) one of decent enough models, known as TM4313.When the antenna is placed outside (it's enough for it to bejustoutside), it seems to work as expected: it starts receiving the GNSS signal(s) rather quickly, then switches to the "tracking" state in a few minutes, and then in some more minutes (~20-ish) it switches to what seems to be "fine" tracking, as described in more details athttps://tomverbeure.github.io/2023/07/09/TM4313-GPSDO-Teardown.htmlOnce it is in this tracking state, it agrees to within a fraction of Hz with my TinySA Ultra's calibration output, and once both are warmed up, the frequency difference remains stable at 0.3-0.4 Hz or ~30-40 ppb. Since they both agree so well, and looking at the status messages received over the serial (to USB) interface, I assume that it is this state of the GPSDO that is correct.Now, I decided to let it run overnight and moved the antenna inside the room, leaving it stuck to the window with some scotch tape (later in the morning I found that the tape failed and the antenna was lying on the window sill). I don't know how many satellites the GPSDO can see in either of those locations, but my smartphone barely sees one or two when placed right on the window glass inside, and a lot of them once just outside.After a night spent with the antenna being inside, the messages from the controller (I changed the jumpers to receive the microcontroller's messages instead of the GPS module's messages over the serial-to-USB interface) looked way off, like this:Code:Ph = 4760, D = 1039687, GL = 0, LOS = 3, ST = 78213, AF = 37, RT = 78519Ph = 4900, D = 1058441, GL = 0, LOS = 3, ST = 78214, AF = 37, RT = 78520Ph = 4901, D = 1077805, GL = 0, LOS = 3, ST = 78215, AF = 37, RT = 78521Ph = 4759, D = 1097213, GL = 0, LOS = 3, ST = 78216, AF = 37, RT = 78522Ph = 4604, D = 1116081, GL = 0, LOS = 3, ST = 78217, AF = 37, RT = 78523...Ph = 281, D = 1162668, GL = 0, LOS = 3, ST = 78255, AF = 37, RT = 78561Ph = 144, D = 1153634, GL = 0, LOS = 3, ST = 78256, AF = 37, RT = 78562Ph = 6, D = 1144387, GL = 0, LOS = 3, ST = 78257, AF = 37, RT = 78563Ph = -136, D = 1134960, GL = 0, LOS = 3, ST = 78258, AF = 37, RT = 78564Ph = -280, D = 1125348, GL = 0, LOS = 3, ST = 78259, AF = 37, RT = 78565...Ph = -5755, D = 1051665, GL = 0, LOS = 3, ST = 78293, AF = 37, RT = 78599Ph = -5918, D = 1027427, GL = 0, LOS = 3, ST = 78294, AF = 37, RT = 78600Ph = -5943, D = 1002474, GL = 0, LOS = 3, ST = 78295, AF = 37, RT = 78601Ph = -5826, D = 977371, GL = 0, LOS = 3, ST = 78296, AF = 37, RT = 78602Ph = -5700, D = 952698, GL = 0, LOS = 3, ST = 78297, AF = 37, RT = 78603...Ph = -254, D = 937942, GL = 0, LOS = 3, ST = 78377, AF = 37, RT = 78683Ph = -139, D = 945679, GL = 0, LOS = 3, ST = 78378, AF = 37, RT = 78684Ph = -23, D = 953570, GL = 0, LOS = 3, ST = 78379, AF = 37, RT = 78685Ph = 95, D = 961609, GL = 0, LOS = 3, ST = 78380, AF = 37, RT = 78686Ph = 216, D = 969799, GL = 0, LOS = 3, ST = 78381, AF = 37, RT = 78687...The "Ph" (phase difference?) parameter oscillated up and down, never converging to zero, the "D" parameter was always way above normal (see below), and the AF parameter remained at the value indicating what seems to be "coarse" tracking. Weirdly enough, it never thought it lost tracking, which is indicated by the ST parameter, which means seconds since tracking started or stopped (and RT means seconds since power-on).Most importantly, the frequency it produced in this state was way off, at least tens of Hz difference against the TinySA. I also suspect that the OCXO used in my unit is not the best, as the frequency quickly wanders off once GPS tracking is lost, but that's a different story.Things did not change when I moved the GPS antenna outside. It still could not catch up after ~30 min or so.Then I disconnected and reconnected the antenna.It promptly detected the loss of signal (GL=1):Code:Ph = -3064, D = 738791, GL = 0, LOS = 3, ST = 79728, AF = 37, RT = 80034Ph = -3005, D = 742375, GL = 0, LOS = 3, ST = 79729, AF = 37, RT = 80035Ph = -3005, D = 745982, GL = 1, LOS = 3, ST = 79730, AF = 37, RT = 80036Ph = -3005, D = 745982, GL = 1, LOS = 4, ST = 0, AF = 37, sK = 2.06052, RT = 80037Ph = -3005, D = 942403, GL = 1, LOS = 4, ST = 1, AF = 37, RT = 80038Ph = -3005, D = 942401, GL = 1, LOS = 4, ST = 2, AF = 37, RT = 80039Then it, as it would normally do on power-on, started to receive the GPS signal (GL=1 transitioning to GL=0):Code:Ph = -1343, D = 942376, GL = 1, LOS = 4, ST = 14, AF = 37, RT = 80051Ph = -1228, D = 942374, GL = 1, LOS = 4, ST = 15, AF = 37, RT = 80052Ph = -1110, D = 942372, GL = 0, LOS = 4, ST = 16, AF = 37, RT = 80053Ph = -996, D = 425986, GL = 0, LOS = 2, ST = 0, AF = 37, RT = 80054Ph = -951, D = 405986, GL = 0, LOS = 2, ST = 0, AF = 37, RT = 80055-- at this point the 10 MHz frequency output becomes very close to the TinySA.Then it starts tracking (LOS=2 -> LOS=3, ST resets, Ph fluctuates close to zero):Code:Ph = -3774, D = 565986, GL = 0, LOS = 2, ST = 40, AF = 37, RT = 80182Ph = -3770, D = 565986, GL = 0, LOS = 2, ST = 41, AF = 37, cK = 0.003312E-9/LSB, RT = 80183Ph = -3764, D = 550892, GL = 0, LOS = 2, ST = 42, AF = 37, RT = 80184Ph = -3761, D = 550892, GL = 0, LOS = 2, ST = 43, AF = 37, RT = 80185Ph = -3760, D = 550892, GL = 0, LOS = 2, ST = 44, AF = 37, RT = 80186Ph = -3761, D = 550892, GL = 0, LOS = 2, ST = 45, AF = 37, RT = 80187Ph = -3760, D = 550892, GL = 0, LOS = 2, ST = 46, AF = 37, RT = 80188Ph = 0, D = 550892, GL = 0, LOS = 3, ST = 0, AF = 37, RT = 80189Ph = -1, D = 550892, GL = 0, LOS = 3, ST = 1, AF = 37, RT = 80190Ph = 0, D = 550892, GL = 0, LOS = 3, ST = 2, AF = 37, RT = 80191-- at this point the 10 MHz frequency has the same difference measured earlier against the TinySA and the difference remains stable.And then, finally, it switches to what seems to be "fine" tracking state (AF=37 -> AF=73, and the steps of the changes in D become very small):Code:Ph = 1, D = 550704, GL = 0, LOS = 3, ST = 997, AF = 37, RT = 81186Ph = 0, D = 550704, GL = 0, LOS = 3, ST = 998, AF = 37, RT = 81187Ph = -1, D = 550704, GL = 0, LOS = 3, ST = 999, AF = 73, RT = 81188Ph = 0, D = 550704, GL = 0, LOS = 3, ST = 1000, AF = 73, RT = 81189No observable output frequency change at this point.Now, just by looking at the output, I think it's safe to assume that this (the latest messages) is its normal state, and what I saw after a night of potentially poor signal reception and/or low number of satellites, was not. It seems that it got locked up in some bad state and needed an antenna reset to come out of it back to normal. Would it be able to resolve that bad state on its own with the antenna placed outside? I don't know, I didn't have the patience to wait.What was it that I observed? Was it expected? There's not much information on the internet about this device, but I believe there are a few people here on this forum that own it, so maybe they have some thoughts, or maybe some general GPSDO considerations may be applicable.

author: tverbeure
author_rank: Regular Contributor
timestamp: April 09, 2024, 05:21:59 pm
content: There's very little literature on the TM4313 other than my blog post, and other than you and me, I don't think anyone has gone father in their analysis of the TM4313 log messages.I'm surprised by the frequency difference of 0.3-0.4Hz that you're observing. That's more than I'm seeing. This weekend, as part of a new blog post (https://tomverbeure.github.io/2024/04/06/Guide-Tech-GT300-Frequency-Reference-Teardown.html), I measured the clock of free-running frequency standard against the TM4313 and got a precision of around 1mHz (see video at the bottom of the page). This is with the TM4313 being in lock for more than a day.Earlier, I also measured the TM4313 against the 10MHz output of a modded SyncServer S200 that was in GPS lock. They are within 20mHz of each other, but the SyncServer S200 has a larger variation than the TM4313 when measured against the GT300 reference.A retired HP veteran who was involved in the design of a bunch of frequency counters told me that GPSDOs are extremely tedious to work on because of the long time constants. It's one of the reasons why I decided to buy the 4313 instead of making one myself. You're kind of running into the same issue: "...I didn't have the patience to wait."It'd be interesting to see if you can reproduce it and check if it recovered eventually after getting a decent GPS signal again.Tom

author: shapirus
author_rank: Super Contributor
timestamp: April 09, 2024, 05:48:42 pm
content: Quote from: tverbeure on April 09, 2024, 05:21:59 pmOf course I'm not even surprised to find you on this forum. Where else could I meet the author of a blog post about a very specialized piece of equipment? :)Quote from: tverbeure on April 09, 2024, 05:21:59 pmWell, the TinySA Ultra has never been supposed to serve as a frequency standard. It's a cheap device whose primary function is SA. I'd say it's surprising that the difference is sosmall, as it's a budget-constrained device and it has "only" a TCXO for the clock generator which isn't synced to any external reference. So it's quite stable and is well trimmed on the factory. I wonder if it's possible to readjust it btw, using the GPSDO as a reference. Given how stable it is, it might make sense to trim that 0.3 Hz difference further to make it match the GPSDO perfectly. That doesn't matter much for the SA part with its minimum RBW of 200 Hz, but it would be nice for the calibration output to provide an even better frequency reference (of course if we assume that the GPSDO is more accurate).I have no other frequency reference to compare these two against.Quote from: tverbeure on April 09, 2024, 05:21:59 pmYou know how it goes. Start with a simple ready made device, then develop a feeling that you need something better, decide that it might be possible to do it yourself...Quote from: tverbeure on April 09, 2024, 05:21:59 pmYes I will check it. I won't try to cause it deliberately this night, though, because I want to see if it changes its state after tracking for more than 24 hours (the datasheet says, or I read it elsewhere, that the track LED has to start flashing less frequently then) and whether the frequency difference against the TinySA Ultra at that point will change.GPS reception seems to become worse during the night, though, so it may happen on its own again, so I'll see how it goes this time.Now the antenna is inside, stuck on the window glass again, and it's changing between good:Code:Ph = 0, D = 550850, GL = 0, LOS = 3, ST = 33590, AF = 73, RT = 113779Ph = 0, D = 550848, GL = 0, LOS = 3, ST = 33591, AF = 73, RT = 113780Ph = 1, D = 550848, GL = 0, LOS = 3, ST = 33592, AF = 73, RT = 113781Ph = -1, D = 550844, GL = 0, LOS = 3, ST = 33593, AF = 73, RT = 113782Ph = 0, D = 550844, GL = 0, LOS = 3, ST = 33594, AF = 73, RT = 113783Ph = -1, D = 550844, GL = 0, LOS = 3, ST = 33595, AF = 73, RT = 113784Ph = -1, D = 550846, GL = 0, LOS = 3, ST = 33596, AF = 73, RT = 113785Ph = -1, D = 550848, GL = 0, LOS = 3, ST = 33597, AF = 73, RT = 113786Ph = 0, D = 550850, GL = 0, LOS = 3, ST = 33598, AF = 73, RT = 113787...and not so good, but not bad either:Code:Ph = 4, D = 550643, GL = 0, LOS = 3, ST = 33681, AF = 37, RT = 113870Ph = 4, D = 550634, GL = 0, LOS = 3, ST = 33682, AF = 37, RT = 113871Ph = 4, D = 550626, GL = 0, LOS = 3, ST = 33683, AF = 37, RT = 113872Ph = 4, D = 550617, GL = 0, LOS = 3, ST = 33684, AF = 37, RT = 113873Ph = 4, D = 550609, GL = 0, LOS = 3, ST = 33685, AF = 37, RT = 113874Ph = 3, D = 550600, GL = 0, LOS = 3, ST = 33686, AF = 37, RT = 113875Ph = 3, D = 550596, GL = 0, LOS = 3, ST = 33687, AF = 37, RT = 113876Ph = 3, D = 550591, GL = 0, LOS = 3, ST = 33688, AF = 37, RT = 113877but then goes back to good again:Code:Ph = 0, D = 550718, GL = 0, LOS = 3, ST = 33774, AF = 37, RT = 113963Ph = 0, D = 550726, GL = 0, LOS = 3, ST = 33775, AF = 37, RT = 113964Ph = 0, D = 550734, GL = 0, LOS = 3, ST = 33776, AF = 37, RT = 113965Ph = 0, D = 550741, GL = 0, LOS = 3, ST = 33777, AF = 37, RT = 113966Ph = 0, D = 550749, GL = 0, LOS = 3, ST = 33778, AF = 73, RT = 113967Ph = 0, D = 550749, GL = 0, LOS = 3, ST = 33779, AF = 73, RT = 113968Ph = 0, D = 550753, GL = 0, LOS = 3, ST = 33780, AF = 73, RT = 113969Ph = 0, D = 550757, GL = 0, LOS = 3, ST = 33781, AF = 73, RT = 113970Btw note how the AF values in the "coarse" state are different in your unit and mine: 19 vs 37.The OCXO is also different, mine definitely doesn't have the logo yours has, but unfortunately I didn't take a good picture when I opened it. Will do when I power it off.

author: nctnico
author_rank: Super Contributor
timestamp: April 09, 2024, 05:55:58 pm
content: Quote from: tverbeure on April 09, 2024, 05:21:59 pmFor proper GPSDO testing you'll need 3 units (2 known-good) and compare against eachother using time interval counters. Or use a Cesium clock to be absolutely sure. Either way you'll need to measure over a 48 hour period so you have the GPS satellites fly in about the same formation over 2 times.@shapirus: are you certain there is no GPS jamming going on in your region?

author: tverbeure
author_rank: Regular Contributor
timestamp: April 09, 2024, 06:06:26 pm
content: > For proper GPSDO testing you'll need 3 units (2 known-good) and compare against each other using time interval counters. Or use a Cesium clock to be absolutely sure. Either way you'll need to measure over a 48 hour period so you have the GPS satellites fly in about the same formation over 2 times.I have a Symmetricom OT-21. It has a GPSDO with a Rubidium clock, but it's used for telecom timing and doesn't have a 10MHz or 1PPS output. So I first need to create a small interposer PCB that brings out those 2 signals from the Rb module, and buffers them up. (It's also annoying that they need to be powered with -48VDC.)Anyway, the question still remains then: if you have 3 GPSDOs, how to do know that they're good? And also, what kind of measurements and post-processing does one typically make?

author: shapirus
author_rank: Super Contributor
timestamp: April 09, 2024, 06:14:21 pm
content: Quote from: nctnico on April 09, 2024, 05:55:58 pmI thought GPS satellites were geostationary. I've just learned that they aren't. Good :).Quote from: nctnico on April 09, 2024, 05:55:58 pmI'm almost certain there is ;)That's what I'm attributing the late evening and night reception degradation to.During the day, however, even on the inner side of the windows, reception is solid. I want to try setting up an antenna on the outside permanently, but for that I'd need to buy a waterproof one (speaking of which, is there anything suitable on Aliexpress that's been verified by someone already?) and also buy a piece of flat RF cable that won't be damaged by the closing window to connect it.

author: nctnico
author_rank: Super Contributor
timestamp: April 09, 2024, 06:34:48 pm
content: Quote from: tverbeure on April 09, 2024, 06:06:26 pmAs I wrote before: two need to be known-good units. These don't need to be expensive but verified by others that they work. These should show similar performance; if you derive the 1PPS from the 10MHz, the 1PPS shouldn't drift more than a few tens of ns over a 48 hour period.

author: shapirus
author_rank: Super Contributor
timestamp: April 09, 2024, 07:41:20 pm
content: All right, time to lose signal again :)Code:Ph = 4, D = 550757, GL = 0, LOS = 3, ST = 40152, AF = 37, RT = 120341Ph = 3, D = 550741, GL = 0, LOS = 3, ST = 40153, AF = 37, RT = 120342Ph = 3, D = 550724, GL = 0, LOS = 3, ST = 40154, AF = 37, RT = 120343Ph = 4, D = 550708, GL = 0, LOS = 3, ST = 40155, AF = 37, RT = 120344Ph = 1, D = 550704, GL = 0, LOS = 3, ST = 40156, AF = 37, RT = 120345Ph = 1, D = 550712, GL = 0, LOS = 3, ST = 40157, AF = 37, RT = 120346Ph = 1, D = 550720, GL = 0, LOS = 3, ST = 40158, AF = 37, RT = 120347Ph = 0, D = 550728, GL = 0, LOS = 3, ST = 40159, AF = 37, RT = 120348Ph = -10000003, D = 550745, GL = 0, LOS = 3, ST = 40160, AF = 37, RT = 120349Ph = -10000003, D = 550761, GL = 0, LOS = 3, ST = 40161, AF = 37, RT = 120350Ph = -10000003, D = 550757, GL = 0, LOS = 3, ST = 40162, AF = 37, RT = 120351Ph = -10000003, D = 550753, GL = 1, LOS = 3, ST = 40163, AF = 37, RT = 120352Ph = -10000007, D = 550753, GL = 1, LOS = 4, ST = 0, AF = 37, sK = 0.00000, RT = 120353Ph = -10000007, D = 550653, GL = 1, LOS = 4, ST = 1, AF = 37, RT = 120354Ph = -10000007, D = 550653, GL = 1, LOS = 4, ST = 2, AF = 37, RT = 120355Ph = -10000006, D = 550653, GL = 1, LOS = 4, ST = 3, AF = 37, RT = 120356Ph = -10000002, D = 550653, GL = 0, LOS = 4, ST = 4, AF = 37, RT = 120357Ph = -10000002, D = 425986, GL = 0, LOS = 2, ST = 0, AF = 37, RT = 120358Meh. I won't be able to get a stable 24h+ of tracking without an outdoor antenna like this.It's now flapping between the tracking and no-tracking states, so clearly the signal reception quality has degraded.Well, at least I'm gonna leave it like this till morning and see if the lockup issue repeats.I don't like the algorithm of what it does on signal loss. The output frequency changes quite abruptly when that happens. I don't have the numbers, but I see it on the scope: I'd estimate it at tens of Hz difference at least. Once it starts tracking again, it gets to sub-Hz difference against the TinySA cal output almost instantly. Apparently it simply stops applying the tuning voltage to the OCXO when the GNSS signal is lost, whereas I think the proper thing to do would be to retain the last known good voltage instead to at least let it run at a good enough frequency until the GNSS signal can be received again. I think that's a software flaw.

author: tverbeure
author_rank: Regular Contributor
timestamp: April 09, 2024, 08:28:25 pm
content: What kind of clock reference is TinySA using?I've unplugged the GPS antenna from my TM4313, but I don't remember seeing the clock frequency jump. I'll check it out tonight.

author: shapirus
author_rank: Super Contributor
timestamp: April 09, 2024, 08:34:43 pm
content: Quote from: tverbeure on April 09, 2024, 08:28:25 pmAll I could find was "30MHz TCXO". It does take a good bit of time to warm up before finally stabilizing, but after that it doesn't seem to deviate from the GPSDO much, and so far it seem to be consistent across power cycles.Quote from: tverbeure on April 09, 2024, 08:28:25 pmAnother scenario to test is keeping the antenna connected, but blocking the signal (e.g. with a metal box or something).

author: tverbeure
author_rank: Regular Contributor
timestamp: April 09, 2024, 08:49:07 pm
content: Quote from: shapirus on April 09, 2024, 08:34:43 pmOk. When you're talking about the GPSDO being off by 0.4Hz during lock, it will be the TCXO that's off instead.

author: shapirus
author_rank: Super Contributor
timestamp: April 09, 2024, 08:58:04 pm
content: Quote from: tverbeure on April 09, 2024, 08:49:07 pmI believe I never said that one or the other was off (except for when the GPSDO loses signal and stops tracking). I always referred to it as adifferencebetween the TinySA and GPSDO. Of course I'm assuming that it's the latter that is more accurate of the two,as long as it's tracking and the logs look sane.Now, here's something very funny:Code:Ph = -7, D = 551672, GL = 0, LOS = 3, ST = 480, AF = 37, RT = 124297Ph = 5, D = 551709, GL = 0, LOS = 3, ST = 481, AF = 37, RT = 124298Ph = 6, D = 551730, GL = 0, LOS = 3, ST = 482, AF = 37, RT = 124299Ph = 5, D = 551750, GL = 0, LOS = 3, ST = 483, AF = 37, RT = 124300Ph = 10000005, D = 551734, GL = 0, LOS = 3, ST = 484, AF = 37, RT = 124301Ph = 10000006, D = 551692, GL = 0, LOS = 3, ST = 485, AF = 37, RT = 124302Ph = 10000002, D = 551692, GL = 0, LOS = 3, ST = 486, AF = 37, RT = 124303Ph = 9999998, D = 551700, GL = 0, LOS = 3, ST = 487, AF = 37, RT = 124304Ph = 9999997, D = 551700, GL = 0, LOS = 3, ST = 488, AF = 37, RT = 124305Ph = 9999990, D = 551700, GL = 0, LOS = 3, ST = 489, AF = 37, RT = 124306I'm not sure about the frequency, as I've already turned off the TinySA, but hey, this change in the Ph parameter. And neither GL nor LOS changed here. I wonder if it's really GNSS jamming that puts it into this state.Several minutes later, the D parameter also becomes screwed up:Code:Ph = 9989475, D = 2117078271, GL = 0, LOS = 3, ST = 1860, AF = 37, RT = 125677Ph = 9989440, D = 2119228159, GL = 0, LOS = 3, ST = 1861, AF = 37, RT = 125678Ph = 9989295, D = 2128710399, GL = 0, LOS = 3, ST = 1862, AF = 37, RT = 125679Ph = 9989153, D = 2138178175, GL = 0, LOS = 3, ST = 1863, AF = 37, RT = 125680Ph = 9989015, D = -2147336449, GL = 0, LOS = 3, ST = 1864, AF = 37, RT = 125681Ph = 9988879, D = -2137898241, GL = 0, LOS = 3, ST = 1865, AF = 37, RT = 125682Ph = 9988746, D = -2128475393, GL = 0, LOS = 3, ST = 1866, AF = 37, RT = 125683Ph = 9988619, D = -2119067393, GL = 0, LOS = 3, ST = 1867, AF = 37, RT = 125684Ph = 9988482, D = -2109673985, GL = 0, LOS = 3, ST = 1868, AF = 37, RT = 125685Ph = 9988335, D = -2100295425, GL = 0, LOS = 3, ST = 1869, AF = 37, RT = 125686...and the "track" LED is still flashing!It'll be interesting to see if it can recover from this, but so far it seems that the firmware is not able handle some conditions. It looks like the GPS signal is in reality lost, but the firmware fails to recognize it.Would also be interesting to see the messages produced by the GPS module when it's in this state, but, alas, we can't hot-switch it. Or can we? I don't feel like trying it :)

author: tverbeure
author_rank: Regular Contributor
timestamp: April 09, 2024, 09:02:44 pm
content: Having to deal with GPS jamming may be something the designers never thought about, especially for something as cheap as this. I mean how do you even start to cover all the ways jamming can work.

author: shapirus
author_rank: Super Contributor
timestamp: April 09, 2024, 09:14:33 pm
content: Quote from: tverbeure on April 09, 2024, 09:02:44 pmWell, if I had to write software handling it, I'd do it in the most straightforward way: no data? treat as lost signal; bogus data, an abrupt change of coordinates and/or timestamps received from the GPS module? discard data and treat as no signal.That's not even about handling jamming situations, but just a regular input conditioning procedure that is a very common thing to do.Besides, whatever is causing it, it has to be able to recover once good data starts coming back.Ifit starts. And this "if" makes me think that it may be not the firmware that locks up, but the GPS module itself, which requires a reset of the antenna to recover. I think it's quite likely. I'll switch the UART path to the GPS module next evening and see what it will report.

author: tverbeure
author_rank: Regular Contributor
timestamp: April 09, 2024, 10:31:34 pm
content: Quote from: shapirus on April 09, 2024, 09:14:33 pmThat's a good point. I don't remember if the unfiltered 1PPS signal that comes from the module is easily available, but it could be useful putting that up on a scope.

author: tverbeure
author_rank: Regular Contributor
timestamp: April 10, 2024, 06:12:46 am
content: Quote from: shapirus on April 09, 2024, 07:41:20 pmI recorded the frequency every second on my frequency counter, unplugged the antenna and then plugged it back in:StanfordResearchSystems,SR620,00182,1.480 9.99999999761E61 9.99999999769E62 9.99999999785E63 9.99999999766E64 9.99999999766E65 9.99999999815E66 9.99999999796E67 9.99999999774E68 9.99999999796E69 9.99999999764E610 9.99999999802E611 9.99999999788E612 9.99999999745E613 9.99999999755E614 9.99999999669E615 9.99999999747E616 9.99999999774E617 9.99999999758E618 9.99999999709E619 9.99999999802E620 9.99999999807E621 9.99999999780E622 9.99999999793E623 9.99999999802E624 9.99999999829E625 9.99999999907E626 9.99999999880E627 9.99999999918E6 <<<< Antenna unplugged28 9.99999999883E629 9.99999999932E630 9.99999999926E631 9.99999999910E632 9.99999999924E633 9.99999999956E634 9.99999999940E635 9.99999999986E636 1.00000000001E737 1.00000000006E738 9.99999999934E639 9.99999999850E640 9.99999999856E641 9.99999999829E642 9.99999999858E643 9.99999999821E644 9.99999999861E645 9.99999999856E6...138 9.99999999812E6139 9.99999999802E6140 9.99999999804E6141 9.99999999802E6142 9.99999999791E6143 9.99999999845E6144 9.99999999848E6145 9.99999999829E6146 9.99999999791E6147 9.99999999788E6 <<< Antenna plugged in, immediate GPS relock148 9.99999999815E6149 9.99999999815E6150 9.99999999793E6151 9.99999999821E6152 9.99999999875E6153 9.99999999837E6154 9.99999999856E6155 9.99999999837E6156 9.99999999823E6157 9.99999999831E6158 1.00000000010E7159 1.00000000000E7160 9.99999999921E6161 9.99999999818E6162 9.99999999717E6163 9.99999999658E6164 9.99999999620E6165 9.99999999566E6166 9.99999999536E6167 9.99999999509E6168 9.99999999419E6169 9.99999999351E6170 9.99999999397E6171 9.99999999359E6172 9.99999999340E6173 9.99999999240E6174 9.99999999232E6175 9.99999999188E6176 9.99999999202E6177 9.99999999167E6178 9.99999999183E6179 9.99999999164E6180 9.99999999245E6I'd have to repeat this test a couple of times and create a plot, but the effect is minimal. Instead of have measurements that different by ~1 or 2 mHz, there's maybe a little jump but it's definitely the a couple of Hz that you're seeing. The interesting part is if there's a jump, it settle back down after that, so the change could just be due to the vibrations caused by unscrewing the antenna connector.Edit: I redid the exercise with the counter set to a 5s update rate. Unplugging has zero effect, plugging the cable back in is more disruptive (~10mHz) with the output frequency swinging around a bit, which is what you'd expect from a control loop.

author: shapirus
author_rank: Super Contributor
timestamp: April 10, 2024, 07:44:26 am
content: I'll repeat the same test as yours with the antenna disconnection a bit later. Well, somewhat the same -- I don't have a freq counter, so will have to use the oscilloscope to watch two signals, GPSDO and TinySA, along each other. Assuming that the disconnection of the antenna from the GPSDO is not supposed to disturb the output of the TinySA, then if a significant difference occurs in what's seen on the scope (particularly in the XY mode), then it can only mean that it's the GPSDO that loses its frequency stabilization.As far as the 1 PPS output, there is a respective jack, and I will try to trace where it's connected to (not sure if it'll be possible with that black solder mask). Is it supposed to output nothing when there's no GPS reception?Right now the GPSDO is locked up again (has been since the evening -- see the ST value) and isn't recovering:Code:Ph = 49838453, D = -296976385, GL = 0, LOS = 3, ST = 40169, AF = 37, RT = 163986Ph = 49838537, D = -288784385, GL = 0, LOS = 3, ST = 40170, AF = 37, RT = 163987Ph = 49838566, D = -280559617, GL = 0, LOS = 3, ST = 40171, AF = 37, RT = 163988Ph = 49838540, D = -272400385, GL = 0, LOS = 3, ST = 40172, AF = 37, RT = 163989Ph = 49838443, D = -264208385, GL = 0, LOS = 3, ST = 40173, AF = 37, RT = 163990Ph = 49838325, D = -256049153, GL = 0, LOS = 3, ST = 40174, AF = 37, RT = 163991Ph = 49838364, D = -247857153, GL = 0, LOS = 3, ST = 40175, AF = 37, RT = 163992Ph = 49838395, D = -239697921, GL = 0, LOS = 3, ST = 40176, AF = 37, RT = 163993I have checked the 1 PPS output: it is outputting a pulsed signal, 1 Hz (I can't check how accurate), unipolar 0..4.75V square (into 1 MOhm), 100 ms pulse width.Does it mean that the GPS module is definitely not locked up?

author: nctnico
author_rank: Super Contributor
timestamp: April 10, 2024, 08:01:53 am
content: I'd say it is a software issue. But it is quite possible that the type of jamming used near you, is designed to confuse GPS receivers to a point where they don't come up after the jamming ends. Makes it harder to pinpoint the transmitter. It would be very interesting if you could test other GPSDOs using different GPS receiver modules and look what is coming out of the module itself in the form of NMEA data.

author: shapirus
author_rank: Super Contributor
timestamp: April 10, 2024, 08:45:39 am
content: Quote from: shapirus on April 10, 2024, 07:44:26 amHere's how it looks visually:Looks more like a software issue to me. Purple trace is a stable enough reference (TinySA Ultra), blue trace is the TM4313.I was going to record how it behaves when I disconnect and reconnect the antenna, but alas, have just had a power outage, and the GPSDO got powered off. Next time I'll power it from the UPS.Anyway, I will at least be able to record its reaction to a disconnection of the antenna when it's in a "good" tracking state to compare the results with those posted bytverbeureabove.

author: shapirus
author_rank: Super Contributor
timestamp: April 10, 2024, 09:16:14 am
content: Quote from: shapirus on April 10, 2024, 08:45:39 am...and we have a match here. When the antenna is disconnected, there is no visually observable change in the output frequency, at least within a few minutes. When the antenna is connected back, it goes into "fine" tracking mode again almost instantly. This means that the OCXO tuning voltage level is maintained in the last known good state in this scenario.The next thing to test is to bring the antenna, without disconnecting it, further into inside of the room to simulate a signal level degradation.

author: shapirus
author_rank: Super Contributor
timestamp: April 10, 2024, 09:28:50 am
content: Quote from: shapirus on April 10, 2024, 09:16:14 amThis test is passed too.1) antenna moved deep indoors:Code:Ph = -16, D = 552276, GL = 0, LOS = 3, ST = 552, AF = 37, RT = 2005Ph = -15, D = 552269, GL = 0, LOS = 3, ST = 553, AF = 37, RT = 2006Ph = -15, D = 552263, GL = 0, LOS = 3, ST = 554, AF = 37, RT = 2007Ph = -15, D = 552256, GL = 0, LOS = 3, ST = 555, AF = 37, RT = 2008Ph = -14, D = 552254, GL = 0, LOS = 3, ST = 556, AF = 37, RT = 2009Ph = -14, D = 552247, GL = 1, LOS = 3, ST = 557, AF = 37, RT = 2010Ph = -14, D = 552247, GL = 1, LOS = 4, ST = 0, AF = 37, sK = 0.00000, RT = 2011Ph = -14, D = 551097, GL = 1, LOS = 4, ST = 1, AF = 37, RT = 2012Ph = -14, D = 551097, GL = 1, LOS = 4, ST = 2, AF = 37, RT = 2013Ph = -14, D = 551097, GL = 1, LOS = 4, ST = 3, AF = 37, RT = 2014Ph = -14, D = 551097, GL = 1, LOS = 4, ST = 4, AF = 37, RT = 2015Ph = -14, D = 551097, GL = 1, LOS = 4, ST = 5, AF = 37, RT = 2016Ph = -14, D = 551097, GL = 1, LOS = 4, ST = 6, AF = 37, RT = 2017Ph = -14, D = 551097, GL = 1, LOS = 4, ST = 7, AF = 37, RT = 20182) antenna brought back to the window:Code:Ph = -14, D = 551097, GL = 1, LOS = 4, ST = 156, AF = 37, RT = 2167Ph = -14, D = 551097, GL = 1, LOS = 4, ST = 157, AF = 37, RT = 2168Ph = -14, D = 551097, GL = 1, LOS = 4, ST = 158, AF = 37, RT = 2169Ph = -14, D = 551097, GL = 1, LOS = 4, ST = 159, AF = 37, RT = 2170Ph = 0, D = 551097, GL = 1, LOS = 4, ST = 160, AF = 37, RT = 2171Ph = 0, D = 551097, GL = 1, LOS = 4, ST = 161, AF = 37, RT = 2172Ph = 0, D = 551097, GL = 1, LOS = 4, ST = 162, AF = 37, RT = 2173Ph = 0, D = 551097, GL = 1, LOS = 4, ST = 163, AF = 37, RT = 2174Ph = -1, D = 551097, GL = 1, LOS = 4, ST = 164, AF = 37, RT = 2175Ph = 1, D = 551097, GL = 1, LOS = 4, ST = 165, AF = 37, RT = 2176Ph = 3, D = 551097, GL = 1, LOS = 4, ST = 166, AF = 37, RT = 2177Ph = 4, D = 551097, GL = 1, LOS = 4, ST = 167, AF = 37, RT = 2178Ph = 5, D = 551097, GL = 0, LOS = 4, ST = 168, AF = 37, RT = 2179Ph = 0, D = 551097, GL = 0, LOS = 3, ST = 0, AF = 37, RT = 2180Ph = 2, D = 551097, GL = 0, LOS = 3, ST = 1, AF = 37, RT = 2181Ph = 3, D = 551097, GL = 0, LOS = 3, ST = 2, AF = 37, RT = 2182Ph = 5, D = 551097, GL = 0, LOS = 3, ST = 3, AF = 37, RT = 2183Ph = 6, D = 551097, GL = 0, LOS = 3, ST = 4, AF = 37, RT = 2184Ph = 7, D = 550771, GL = 0, LOS = 3, ST = 5, AF = 37, RT = 2185Ph = 10, D = 550656, GL = 0, LOS = 3, ST = 6, AF = 37, RT = 2186The output frequency remained stable during the entire length of this test.So, I guess, no night-time frequency reference for me, for now :). At least without an outdoors antenna.Yes it would be interesting to test how other GPSDO behave in this scenario, but the level of this curiosity is not high enough to justify the expense required to get another unit.

author: shapirus
author_rank: Super Contributor
timestamp: April 10, 2024, 10:02:51 am
content: I took it apart to change the jumpers to connect to the GPS module's serial port and took some pictures while I was there.OCXO:Date and HW revision:The 1 PPS output is connected like so (i.e., not to the GPS module):

author: Zenith
author_rank: Frequent Contributor
timestamp: April 10, 2024, 11:01:34 am
content: Quote from: tverbeure on April 09, 2024, 05:21:59 pmI'm glad this thread has appeared. I've had a TM4313 for about three years. It came with no instructions and until now I couldn't find anything about it on the WWW, although I hadn't looked for some time. It sits there with the antenna on a window sill, not outside, and agrees with a Racal 1992 with the better OCXO (04E) option, to within a few ppb over the course of a week. I'd always wanted to explore its data reporting features. It's lost lock a couple of times when the antenna has been covered up with something or other.I assume that for practical purposes, calibrating synthesised sig gens and adjusting frequency counters with ancient OCXOs, (so no better than 1 part in 10^8) that the TM4313 is perfect.One thing that has surprised me is how good the AliExpress ex-equipment CTI OCXOs are.

author: tverbeure
author_rank: Regular Contributor
timestamp: April 10, 2024, 01:22:10 pm
content: Quote from: shapirus on April 10, 2024, 10:02:51 amYeah, that’s expected. The 1PPS coming out of the GPS module is way too jittery.

author: shapirus
author_rank: Super Contributor
timestamp: April 13, 2024, 07:52:10 am
content: Update.I cannot reproduce this lock-up when the jumpers are set to receive messages from the GPS module!Yesterday in the evening it was running with the jumpers set for the MCU's UART output. The GPSDO locked up as described in first post. I disconnected and reconnected the antenna, it started tracking, but then went into that unstable state again. Then I changed the jumpers and let it run again. Guess what, no issues. It's tracking just fine. Yes it did lose tracking a couple of times at some point, but then resumed it properly.Right now, and it was a second (non-consecutive though) night with no lock-up issues, it's generating a good output frequency with no "seeking" oscillation.I wonder what do the jumpers have to do with it and how could it affect things. At this point it does not look like a coincidence.

author: tggzzz
author_rank: Super Contributor
timestamp: April 13, 2024, 08:10:07 am
content: Quote from: shapirus on April 09, 2024, 09:14:33 pmThat's only a crude version of what GPS (etc) jamming does. The more sophisticated versionmovesthe apparent position, so that ordnance lands near the target, not on the target.I've heard reports of someone in the UK whose GPS receiver told them they were flying directly over a military airfield - but they could see the runway a couple of miles away over the top of their wing.If your problem is time-dependent, then maybe jamming only occurs when an attack is imminent.

author: shapirus
author_rank: Super Contributor
timestamp: April 13, 2024, 09:53:05 pm
content: Quote from: shapirus on April 13, 2024, 07:52:10 amAll right, so I caught it in the middle of something.The output frequency is all over the place. There's no nice seeking back and forth (yet), as I've shown before, but it clearly cannot synchronize.At the same time, the NMEA messages look totally fine. Well, at least the coordinates are correct.I have scrolled the minicom buffer backwards for ~1.5h and noticed that the output changed: from four "$GPGSV" lines starting with "$GPGSV,4," followed by a number from 1 to 4, to three lines starting with "$GPGSV,3," followed by a number from 1 to 3. I cannot correlate this with the time when it lost proper tracking, but 1.5 hour ago would seem likely.On scrolling further backwards, I see that this number flapped between 3 and 4, and even earlier between 5 and 6. I guess that's the number of satellites it can receive data from?Will check what it says in the morning and what the output frequency will be.p.s. while I was scrolling the screen buffer and writing this post, the output frequency stabilized and is now exactly where it's expected to be. Go figure.So yes, I'm still unable to see it going into a permanent bad state when the UART->USB jumpers are set for the GPS module. It does lose proper tracking from time to time, but it seems to be able to recover, unlike when the jumpers were set for the MCU.

author: shapirus
author_rank: Super Contributor
timestamp: April 13, 2024, 10:04:03 pm
content: Quote from: tggzzz on April 13, 2024, 08:10:07 amFound no correlation with that.

author: MIS42N
author_rank: Frequent Contributor
timestamp: April 14, 2024, 10:31:39 am
content: The $GPGSV messages decode as $GPGSV,<number of $GPGSV messages being sent>,<sequence number>,<total satellites in view>, etc.So look at the field after the sequence number to see how many satellites are in view. It should be the same in every group of $GPGSV messages (but may be different a second later). If you are getting between 3 and 4 lines, that's between 9 and 16 satellites in view and that should be plenty.Capture the NMEA messages and analyze them with a program such as GPSview or u-center to find out signal to noise. Four or more satellites above 30dBs should give reasonable tracking.I spent a few years on and off trying various discipline algorithms for my GPSDO design. I finally came up with one that reliably recovers from almost anything, simply by the program rebooting the processor if signal is lost for more than a minute. It then reverts to a past good control voltage until signal is acquired again. This has the disadvantage that the past control voltage can be out by a margin due to ageing of the crystal in the meantime. However, since the indicator LED will not revert to normal until the processor decides it is tracking properly again, the user knows.So my guess is the erratic behaviour and failure to recover is down to the programming. As long as the unit gives fair indication that it is misbehaving, that's probably tolerable. You get what you pay for.

author: nctnico
author_rank: Super Contributor
timestamp: April 14, 2024, 12:20:38 pm
content: Quote from: tggzzz on April 13, 2024, 08:10:07 amYou have to take into account that the map might be wrong on purpose. Theoretically you can spoof gps but it will also cause problems with car navigation systems when done permanently.

author: tggzzz
author_rank: Super Contributor
timestamp: April 14, 2024, 01:57:22 pm
content: Quote from: nctnico on April 14, 2024, 12:20:38 pmUnlikely in the specific case, due to the adjacent main road and town in Wiltshire.The curious issue is that there is "forbidden" airspace above that airfield. If someone was relying on GPS and penetrated that airspace, I'm not sure what would happen. I expect the attitude would be "you should look out the cockpit, because all instruments lie".Around that time there were many NOTAMs to the effect of "don't trust GPS near Aberstywth" (nowhere near Wiltshire!). Clearly jamming trials were in progress.