Close

Found and fixed a bug

A project log for GPS Disciplined xCXO

A DIY GPS disciplined 10 MHz reference clock

nick-sayerNick Sayer 08/20/2016 at 17:160 Comments

One of the things in the firmware is a hack to reduce accumulation of the integral term of the PLL. The concern is that floating point numbers can only have so much significance, and when they start to get large in magnitude, they start losing low order resolution. As a workaround, when the absolute value of the I term starts to get too large, a chunk of it will be taken away and applied instead to the base "trim_value," which is the exit DAC value from the bootstrap FLL mode - the base against which the PLL operates.

The bug was that the sign of the adjustment to the trim_value was wrong, which would cause the EFC to suddenly veer 2000 units away - which for the OCXO is 40 ppb - a huge error. This invariably causes the firmware to start over from scratch, entering the FLL mode and so on. It's not the end of the world, but it's eminently avoidable.

I've updated the firmware on Github, and if you have the wherewithal to update it, you probably should.

Discussions