Re: [time-nuts] UPS for my time rack

2015-10-11 Thread Kasper Pedersen
On 10/11/2015 12:07 AM, Dr. David Kirkby (Kirkby Microwave Ltd) wrote:
> Essentially the charging circuits are not designed to run as long as needed
> to charge big batteries. Even on ones designed for external batteries,
> there's a recommended limit on the size of them. So if you think you might
> want to increase runtime by adding some batteries, buy one designed for
> that service.

I have gone down that route, so I have some real data to share:

My (soon to be replaced) backup is an old back-ups CS 500, with a
rewired battery pack out of an RT3000 UPS. So instead of 7Ah, the UPS
has 40Ah. With plenty of fuses.

When charging the standard 7Ah battery, the UPS delivers about 0.7A
(from memory) for many hours, and sits at about 14C above ambient.

When charging the 40Ah, the current is the same, the temperature is the
same, just for longer, as it should be, since the thermal time constant
is much shorter than the time it takes to charge the 7Ah.

Where this has problems is during discharge:
I have about 55W load on it, which in turn is at least 5A on the
battery. After 2 hours a timer in the UPS shuts it off, regardless of
battery voltage.
Also, if you run the UPS at high load where the standard battery lasts
shorter than the thermal time constant, then there might well be trouble.



The replacement, a back-ups pro 1500 behaves differently.
It has support for external battery packs, and will happily run for at
least 5 hours, even when the external-pack-present signal is not connected.
The external-pack-present signal does make a difference when charging;
Without it, it charges at 0.7A. with it, it charges at 1.5A, and the fan
is on continuously.


/Kasper Pedersen

___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] Leap Second results: cheap GPS/1PPS receivers

2015-07-01 Thread Kasper Pedersen
On 07/01/2015 05:23 PM, Tom Van Baak wrote:
 I logged NMEA from three cheap ($15-$50) GPS/1PPS receivers, the kind popular 
 with hobbyists: parallax(good), reyax(good), adafruit(bad).

 
 3) Adafruit Ultimate GPS Breakout
 http://www.adafruit.com/products/746

 
 If someone else has data from this model receiver, please let me know.
 

I have:
 - MC-1010 (MTK3339, same chipset and code as the adafruit one)
 - GPS-1513R (Venus 624) -- FUN!
 - LTE-Lite
 - old GPS18x


The MTK3339 with the same (standard) firmware is also used in the
MC-1010. I have output from the 28th and ahead. Same behaviour.

$GPGGA,235958.000,5610.4160,N,00929.5793,E,1,10,0.80,84.8,M,43.3,M,,*5E
$GPRMC,235958.000,A,5610.4160,N,00929.5793,E,0.01,171.62,300615,,,A*66

$GPGGA,235959.000,5610.4160,N,00929.5793,E,1,10,0.80,84.8,M,43.3,M,,*5F
$GPRMC,235959.000,A,5610.4160,N,00929.5793,E,0.01,171.62,300615,,,A*67

$GPGGA,235959.000,5610.4160,N,00929.5793,E,1,10,0.80,84.8,M,43.3,M,,*5F
$GPRMC,235959.000,A,5610.4160,N,00929.5793,E,0.01,171.62,300615,,,A*67

$GPGGA,00.000,5610.4160,N,00929.5793,E,1,10,0.80,84.8,M,43.3,M,,*5E
$GPRMC,00.000,A,5610.4160,N,00929.5793,E,0.02,171.62,010715,,,A*66

$GPGGA,01.000,5610.4160,N,00929.5793,E,1,10,0.80,84.8,M,43.3,M,,*5F
$GPRMC,01.000,A,5610.4160,N,00929.5793,E,0.01,171.62,010715,,,A*64



But, SkyTraq venus 624 (RF Solutions GPS-1513R) is much more fun. It
backsteps one minute(!), in addition to the other 'features' it has.

$GPGGA,235958.187,5610.4163,N,00929.5757,E,1,11,0.8,84.6,M,41.0,M,,*65
$GPRMC,235958.187,A,5610.4163,N,00929.5757,E,000.0,308.5,300615,,,A*6F

$GPGGA,235959.187,5610.4163,N,00929.5757,E,1,11,0.8,84.6,M,41.0,M,,*64
$GPRMC,235959.187,A,5610.4163,N,00929.5757,E,000.0,308.5,300615,,,A*6E

$GPGGA,235900.000,5610.4163,N,00929.5757,E,1,11,0.8,84.6,M,41.0,M,,*66
$GPRMC,235900.000,A,5610.4163,N,00929.5757,E,000.0,308.5,300615,,,A*6C

$GPGGA,00.187,5610.4163,N,00929.5757,E,1,11,0.8,84.5,M,41.0,M,,*66
$GPRMC,00.187,A,5610.4163,N,00929.5757,E,000.0,308.5,010715,,,A*6C

$GPGGA,01.187,5610.4163,N,00929.5757,E,1,11,0.8,84.5,M,41.0,M,,*67
$GPRMC,01.187,A,5610.4163,N,00929.5757,E,000.0,308.5,010715,,,A*6D



The Venus on the LTE-Lite, with the updated timing firmware, is sane.
I also have the 20MHz output timestamped every 5ms, nothing odd happened.

$GPGGA,235959.000,5610.4155,N,00929.5739,E,2,09,0.9,85.4,M,41.0,M,,*6F
$GPRMC,235959.000,A,5610.4155,N,00929.5739,E,000.0,000.0,300615,,,D*66

$GPGGA,235960.000,5610.4155,N,00929.5739,E,2,09,0.9,85.4,M,41.0,M,,*65
$GPRMC,235960.000,A,5610.4155,N,00929.5739,E,000.0,000.0,300615,,,D*6C

$GPGGA,00.000,5610.4155,N,00929.5739,E,2,09,0.9,85.4,M,41.0,M,,*6E
$GPRMC,00.000,A,5610.4155,N,00929.5739,E,000.0,000.0,010715,,,D*64


Old Garmin GPS18x did the same as the MTK3339:

$GPRMC,235958,A,5611.0119,N,00932.1092,E,000.0,136.1,300615,002.0,E,D*10
$GPGGA,235958,5611.0119,N,00932.1092,E,2,10,0.8,41.5,M,41.7,M,,*72

$GPRMC,235959,A,5611.0119,N,00932.1093,E,000.0,136.1,300615,002.0,E,D*10
$GPGGA,235959,5611.0119,N,00932.1093,E,2,10,0.8,41.4,M,41.7,M,,*73

$GPRMC,235959,A,5611.0119,N,00932.1094,E,000.0,136.1,300615,002.0,E,D*17
$GPGGA,235959,5611.0119,N,00932.1094,E,2,10,0.8,41.3,M,41.7,M,,*73

$GPRMC,00,A,5611.0120,N,00932.1094,E,000.0,136.1,010715,002.0,E,D*1F
$GPGGA,00,5611.0120,N,00932.1094,E,2,10,0.8,41.2,M,41.7,M,,*79

$GPRMC,01,A,5611.0120,N,00932.1094,E,000.0,136.1,010715,002.0,E,D*1E
$GPGGA,01,5611.0120,N,00932.1094,E,2,10,0.8,41.2,M,41.7,M,,*78


/Kasper Pedersen
___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] Homebrew frequency counter, need help

2014-11-28 Thread Kasper Pedersen
On 11/27/2014 03:08 PM, lllaaa wrote:
 Hi guys,
 I've just get my homebrew counter working. And the resolution seems 10x
 better than my RACAL DANA 1992.
 This counter is heavily inspired by the idea from Kasper Pedersen.
 http://n1.taur.dk/permanent/frequencymeasurement.pdf
 STM32F051RB  EMP240T100C5 do the control and counting job. TDC-GP22 as
 the interpolator. Linear regression is done by CPU.
 There are no fancy analog front for both signal path and refclk path.
 I'm using two SN75ALS176 and the schmitt input of CPLD to do the job.
 I've noticed that the 10s gate does not get more meaningful
 digits(looks worse than 1s gate). So here are the questions:
 1) I'm wondering if I could say this is an 11 digits/s counter?
 2) How can I improve that? Is it limited by the 485 transceiver? I can
 switch to a faster MCU, that gets more measures per second, but I think
 that only gets no more than 2 stable bits.
 

A few things to try, and learned:

Try measuring the reference against itself, triggering on the same edge
you clock the cpld on. If your VCC is wandering, your threshold will
wander, and you get wandering phase out of the schmitt trigger in the CPLD.
When I built my counter, I had much fun with my 'front end' (AC04s)
having variable heating, and thus variable delay, depending on slew rate.
I ended up giving each input channel its own low noise regulator to keep
crosstalk from going through VCC. I think I calculated that, for a 10MHz
10dBm signal, 6mV threshold error is 100ps.

I assume you can pick which edge to trigger on. Measure the reference
against itself, and read out interpolator (phase) data on either edge.
When I did my counter, I had ground current flowing through the coax
between the counter reference input, and the house standard. I had been
silly and chosen a low cutoff frequency for the dc-block capacitor in
the reference input, which meant that the resulting voltage over the
coax shield resistance got through the dc-block, and caused phase
modulation. On the rising edge, the noise was low. On the falling edge,
it was nasty and wandering, since when you add LF to 10MHz, and then
slice it, the pulsewidth varies.

From bad experience, try dumping out adjusted timestamps of
almost-10MHz, and plot actual timestamp vs predicted timestamp. It will
show you if you have 10MHz crosstalk, or, if as I did, you added the
interpolator value instead of subtracting it. In my case the counter
appeared to work most of the time, while giving wrong readings all of
the time.


And congratulations on getting it working.


/Kasper Pedersen


(When getting 10MHz out of FEI5680As, mine had ferrite blocks around the
dsub connectors, and while I could get a cleaner signal by shorting GND
to shield on the connector, it was better again when I bypassed the
connector entirely and ran coax.)


___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] Computing GPS Distance Error in Time

2013-11-04 Thread Kasper Pedersen
On 11/04/2013 06:30 PM, Bill Dailey wrote:
 The pps on that unit is good.  Compares favorably to the ublox6T. I can't say 
 how favorably.  
 
 I am working on quantifying its pps as compared to my 2 fury units and the 
 ublox 6T.  

They are pretty good, being dirt cheap nav receivers. In this plot, it
is identical to the MC-1010 (same reference design, same firmware).

http://cm.kasperkp.dk/mc1010ga.png  (adev of various)
http://cm.kasperkp.dk/mc1010p.png   (phase, fei5680)

The MC-1010 is using the 3339 chipset, and is GPS-only.
The MC-1010-G has the  chipset, and is GPS+GLONASS.

When testing, try fast temperature shifts; I found that it would shift
the PPS much more than I expected, as if there is a rather slow filter
driving the PPS output.


 
 Have another trick up my sleeve but need a Linux kernel hacker.  I don't want 
 to go down another rabbit hole if I can avoid it.
 

I have stuck my fingers in the timekeeping code in the kernel, and
managed to get away unscathed.
If it is not too complicated, and interesting, shoot me a mail directly.
I reserve the right to decline, and the right to give up:-)


/Kasper Pedersen

___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] have 10MHz need 19.5Mhz

2013-06-16 Thread Kasper Pedersen
On 06/02/2013 10:21 PM, Attila Kinali wrote:
 
 Another stupid idea: You have a 19.5MHz crystal, probably some
 odd PLL and a varicap diode lying around: Build a VCXO out of the
 crystal and lock it to the 10MHz using the PLL.
 

It has been done with an xor gate, a couple of passives, and the varicap
diode. There processor performs as the divider:

This bit of code will configure the gpclk0 block to output 10MHz on pin
7 of the connector:

http://n1.taur.dk/pi10MHz.tgz

The signal on the pin is the 19.2MHz crystal multiplied to 500MHz (the
GPU PLL), and then divided back down to 10MHz.

Feed that signal, and the external reference signal into an xor gate or
other phase detector of choice. Put an RC filter of around 50us on the
output, and connect that to the varicap.

Picture of the thing as built:

http://n1.taur.dk/piclock.jpg

The only thing on the other side of the board is the connector and the
74HC86 in DIP. I don't know what my varicap is, it came out of an old
gps receiver.

/Kasper Pedersen
___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] Advice on good reception for radio clocks

2012-06-27 Thread Kasper Pedersen
On 06/27/2012 04:04 PM, Tony Finch wrote:

 Are there any basic steps I should take to improve the reception quality
 of a radio clock? I have a cheap and cheerful DCF77 receiver for
 connecting to some GPIO pins, but its PPS output is basically noise with
 maybe a one-second period. Perhaps it's just cheap and nasty.
 


Be careful what you connect the ground of the receiver to.

When I did my DCF77 receiver, my first source of interference was the
common noise on the output of the supply I was powering it off of.
I went to a linear power supply, and things were good for a few years.

Then they installed remote-reading power meters in the neighbourhood,
and DCF77 was completely jammed. The meters talk back on 75kHz with
~6kHz bandwidth. Halfway by accident I found out that if I earth the
receiver well enough, thereby shunting off some of the 75kHz common mode
signal, I get mostly reliable reception all day.

I would suggest, at least for development, a battery and an optocoupler
to isolate the receiver section from conducted interference.

Hmm, I do have a Pi.
And when you have trouble decoding the signal at around 04 in the
morning, you too will have rediscovered sferics, and the need for a
filter that handles that.

/Kasper Pedersen

___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] GPS Splitter

2012-04-12 Thread Kasper Pedersen
On 04/13/2012 12:19 AM, iov...@inwind.it wrote:

 Just found on the auction site: 
 Item number: 220957196441
 Specs available at the manufacturer's website.
 I have no idea if it is worth the price.


It feels mechanically indestructible, and works.

I have a tbolt powering it, and a 3.3V (skytraq venus cheap nav)
receiver on another port to allow me to make plots like
http://wap.taur.dk/gc8.png
which is the view from a puck on the balcony - it has workable view,
east-northeast is through roof.
And the tbolt reports slightly better SNR (the antenna alone has less
gain than the tbolt likes) with it in series.

The N-covers it comes with are just covers, not terminators, so I
suspect it to be the high-iso (+10dB) version. I have not yet actually
measured the gain, work's generator stops at 1GHz so I need to build a
doubler first.

/Kasper Pedersen

___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] Thunderbolt? (re simple gpsdo.)

2012-01-01 Thread Kasper Pedersen
On 01/01/2012 12:23 PM, Tom Harris wrote:

 I too have been mulling over a minimal GPSDO.
 
 Has anyone mentioned a PWM DAC? Even a toy microcontroller like the
 Atmel AVRs can generate 16 bit resolution PWM, which sounds like it

..

 So a minimal GPSDO looks like a simple microcontroller (I would use
 Arduino since we use these at work whenever we need to build something
 in an afternoon) with a filter for a PWM DAC, so one opamp and a few
 discretes. Of course as I write software for such beasts as a trade I
 am giving the software a zero cost.
 


A 'bike light' sized microcontroller can do the job. Today I would have
used something larger, and saved development time. On the other hand,
having only room for 512 instructions prevented spending time on
non-essential features.

http://n1.taur.dk/simplexdo/

I used 8 bit PWM into a two-stage RC filter, making it easier to filter.
To get 16 bit resolution I added delta-sigma modulation on top of the PWM.

The ATTiny13 is not the right part for the job; It has no input capture.
So space- and time consuming tricks are necessary to get cycle-accurate
capture.

Recently I discovered that some of the microcontrollers in the drawer
would do nanosecond capture all on their own, but with a working tbolt,
need has been lacking.


/Kasper Pedersen

___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] Ebay FE-5680A Rb: Are they that good?

2011-12-08 Thread Kasper Pedersen
On 12/08/2011 07:58 PM, Chuck Forsberg WA7KGX N2469R wrote:

 The price seems reasonable, esp. with free shipping.
 Does anyone have experience with these?


I ran one of this type against a tbolt. I was testing a super simple
6-channel phase comparator at the time, and it was not quite as good as
hoped, so the plot is limited by the 25ps noise of the comparator.

time offset plot:
http://n1.taur.dk/timenuts/p444.png

adev plot:
http://n1.taur.dk/timenuts/p445.png

I had (rather coarsely) adjusted the unit the day before, and a 2*10^-12
offset has been removed before plotting p444.

It has been quite useful, moreso since I put it in a rugged box.

/Kasper Pedersen


___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] Heated crystal? Rb tube corrosion (FE-5680A)

2011-12-01 Thread Kasper Pedersen
On 12/01/2011 11:18 AM, Attila Kinali wrote:

 
 Other than that one spot, i have to say that the whole device looks
 like new. No dirt, no corrosion where you'd expect it. Even the solder
 joints look like new.
 


And I did not attempt to clean anything before I took the pictures, either.

The only dirt was a grey tint above and below the oven, where the
convection had deposited all non-gaseous dirt. I have a few of these,
two of which have appear to have actual corrosion (rust red spots) on
the outside, but are just as clean inside. I wonder what that does to
the magnetic properties to the case.


Posting to nuts is dangerous:-)
So far the page has had 243 non-bot visitors, 20 people downloaded all
the full resolution images, and it cost me 10GB this week. An impressive
figure considering the topic.

/Kasper Pedersen

___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] FE 5680A Warning

2011-11-13 Thread Kasper Pedersen
On 11/13/2011 10:36 AM, Peter Bell wrote:

 I can let you know what I've found out about these units - I got given
 a couple of dead ones and did a bit of poking around trying to get
 them working.  I didn't get that far, since one of the units was
 easily fixed (the MAX882 3.3V regulator had failed) and the other
 seems to have a faulty Rb absorption cell (it works if you swap the
 cell from the other unit into it).


Here is a pile of photos I did while fixing one of mine. In this one
the oscillator had drifted high, and wouldn't lock when warm. A tiny
nudge to C217 and it is happy, the output should sweep to about 4ppm high.
I suspect the PTC element on the xtal is dodgy too; It seems slower to
settle than the other units.

http://n1.taur.dk/fe5680a-2/

I figured they might be useful when trying to point out components and
test points.


/Kasper Pedersen


___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] 60 Hz measurement party

2011-06-28 Thread Kasper Pedersen
On 06/25/2011 09:34 PM, Tom Van Baak wrote:
 We are more a group of experimenters than lamenters, so
 here's an open invitation to all of you in the US to join me
 on a 60 Hz measurement party, starting as soon as you
 can and lasting as many weeks or months that it takes to
 get interesting plots.
 

Here is what I have used with far better success than transformers. For
some reason the transformers I get hold of have quite large phase error
(ie. they are cheap and get warm).

http://wap.taur.dk/zcd/sch.jpg
http://wap.taur.dk/zcd/plug.jpg

Cp has the dual role of killing RF, and compensating for the H-L
threshold of the HC14. It sits on the hot side, and charges up through
the protection diodes for the next 200us pulse.
It will drive 10m of POF.
Substitute an opto coupler of choice if you need less isolation.

/Kasper Pedersen

___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] Three Phase Power

2011-06-27 Thread Kasper Pedersen
On 06/27/2011 10:38 PM, Jason Rabel wrote:

 Centerpoint Energy has reached the epitome of laziness and is converting 
 everyone over to smart meters so people can better
 monitor their usage... In reality it does nothing more than offer real-time 
 monitoring for the power company, and they no longer
 have a use for meter-readers...
 

If the communications to/from them is in the CENELEC A band (or
similar), one may have to go to great lengths in order to have
60..77.5kHz clocks/receivers working.

http://n1.taur.dk/dcf/tm.png
(scope)
http://n1.taur.dk/dcf/idleannot.png
(quiet)
http://n1.taur.dk/dcf/active.png
(active on the high channel in A band)

I am only 500km from DCF77 (Denmark), and since they replaced the meter
with a 'smart' one, none of the radio clocks have been able to sync.

Only the phase tracking receiver, having a noise blanker, still works.

So I do not like 'smart' meters.

/Kasper Pedersen

___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] 60 Hz measurement party

2011-06-25 Thread Kasper Pedersen
On 06/26/2011 01:07 AM, Tom Van Baak wrote:

 Extrapolating further, I wonder if anyone has done common view
 time transfer based on synchronized power grids? Although not
 as precise as LF or TV or GPS methods it would make a nice
 demo of the concept.
 
 /tvb

http://n1.taur.dk/plcv/

(with pretty plots. Posted to 'nuts 1.5 years ago)

The two sites were on different 60kV radials, but within the same city.

I wonder what fun things one might deduce by watching the difference in
phase across the continent?

/Kasper Pedersen

The files on the site are pretty old. I still have this in operation to
a time server where I can get the space, power, and bandwidth, but not
the antenna space.


___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] 60hz disciplined watch

2011-04-20 Thread Kasper Pedersen
On 04/20/2011 05:26 PM, Poul-Henning Kamp wrote:

 Are you sure ?
 
 Here in europe that was lost in the privatization of the grid: Nobody
 was charged with paying for the extra power needed to capture lost
 cycles, so now they just try to keep it close to 50.0Hz and don't
 care about the integral.

The mainland Europe grid (which you are not on, I know..) looks like this:

http://n1.taur.dk/grid/plt.png
http://n1.taur.dk/grid/pltw.png (very large with grid)

y axis is phase in seconds, x axis is time

The plot is 130 days long, 60sec/130d= 5ppm
but
in that plot is also 5 days in a row where the frequency is 230ppm high.

/Kasper Pedersen

___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] 50/60 Hz clocks

2011-03-23 Thread Kasper Pedersen

On 03/10/2011 11:41 PM, Robert LaJeunesse wrote:


Poor man's solution: Use an Arduino to read the Thunderbolt 1PPS and lock a 50Hz
(or 60Hz) square wave to the 1PPS. Any resulting jitter can likely be kept in

Here is an even poorer man's solution (and plug):

A DDS using both compare outputs of an 8 pin part to get
a phase-centered PWM with half the usual ripple.
With PPS input as a bonus so the zero crossing occurs where
you want it to.

http://n1.taur.dk/gen60a.jpg

Output 5Vpp@60Hz +1.1mVpp@39kHz. Very pretty sinewave.


//
  TinyAWG.c
//  60Hz generator - 2011 Kasper Pedersen - Beerware license
//
//  This is an arbirtrary waveform generator set up to produce 60Hz sine
//  Compile with GCC -Os
//
//
// 2-5V  ---+-+
//  | |
//  |__   |
//  | __|* |__|
// | |   |__|  VCC |__|---+--||--+
//   3k| |  |  | 1u  |
//  | __|  |_   _|_
// 10MHz ---||--+|__| CLK  LOCK|__| GND
// 1n   |   |  |
// | |__|  |_____  ___
//   3k| |   |__| PPS  PWM1|__|---___--+---___---+
//  |   |  |  2k2  |   3k3   |
//  | __|  |_____  | |
// GND   ---+|__| GND  PWM0|__|---___--+--||--+--||--+-
//  |   |__|  2k2100n |  100n
//  |  ATTINY13V  |60Hz out
//  | |
//  +-+
//
//
//  Rising edge on PPS input (optional) will steer the output
//  so that, after 128 edges, the positive zero crossing
//  of the output will coincide with PPS.
//  When this happens, LOCK will go high.
//
//  PWM frequency is 39kHz
//  first filter stage attenuates 27x
//  second filter stage attenuates 81x and pulls phase 1 deg.

#includeavr/io.h
#includeavr/interrupt.h
#includeavr/pgmspace.h

#define DCBIAS 127
PROGMEM unsigned char table[256]={
 127,130,133,136,139,142,145,149,152,155,158,161,164,167,169,172,
 175,178,181,184,186,189,192,194,197,200,202,205,207,209,212,214,
 216,218,220,222,224,226,228,230,232,233,235,237,238,240,241,242,
 243,245,246,247,248,248,249,250,251,251,252,252,252,253,253,253,
 253,253,253,253,252,252,252,251,251,250,249,248,248,247,246,245,
 243,242,241,240,238,237,235,233,232,230,228,226,224,222,220,218,
 216,214,212,209,207,205,202,200,197,194,192,189,186,184,181,178,
 175,172,169,167,164,161,158,155,152,149,145,142,139,136,133,130,
 127,124,121,118,115,112,109,105,102,99,96,93,90,87,85,82,
 79,76,73,70,68,65,62,60,57,54,52,49,47,45,42,40,
 38,36,34,32,30,28,26,24,22,21,19,17,16,14,13,12,
 11,9,8,7,6,6,5,4,3,3,2,2,2,1,1,1,
 1,1,1,1,2,2,2,3,3,4,5,6,6,7,8,9,
 11,12,13,14,16,17,19,21,22,24,26,28,30,32,34,36,
 38,40,42,45,47,49,52,54,57,60,62,65,68,70,73,76,
 79,82,85,87,90,93,96,99,102,105,109,112,115,118,121,124};

unsigned char phase;
signed acc;
unsigned char lastp=1;

ISR(SIG_OVERFLOW0)
{
signed s;
unsigned char v;
//60Hz*256=15360Hz increment rate.
//irq rate is 10MHz/256=39062.5Hz.
//we need to increment at: 60*256*256 / 10M
//split into primes and eliminate common factors:
//10MHz   = 2^7 * 5* 5^6
//60*256 *256 = 2^7 *2 *  5 *2*2*3 * 2^8
//scaler = 2*2*2*3*256  / 5*5*5*5*5*5
//   = 6144 / 15625

v=__LPM(table[phase]); //generate output
OCR0A=v;
OCR0B=(2*DCBIAS)-v; 

s=acc; //generate phase
s-=6144;
if (s0) {
acc= s+15625;
++phase;
} else {
acc= s;
}

if (PINB16) { //on rising edge: adjust phase so this conincides with 
the positive zero crossing.
if (!lastp) { //we need 128 pulses to become adjusted
lastp=1;
if (!phase) {
//phase is 0. At 15kHz we are within 65us   
PORTB|=4;
} else
if (phase0x80) {
++phase; // 65us adjustments
PORTB=~4;
} else {
--phase;
PORTB=~4;
}
}
} else {
lastp=0;
}
}

void main(void)
{
TCCR0A=0xB3; //A is clear on match, positive output when bigger
TCCR0B=0x01;
TIMSK0=0x02;
DDRB|=1;  //output
DDRB|=2;
DDRB|=4;   //locked output
PORTB|=16; //~50uA pullup on PPS pin.
sei

Re: [time-nuts] advice: frequency calibration to 1 ppm possible without GPSDO?

2011-02-17 Thread Kasper Pedersen

On 02/17/2011 01:58 AM, beale wrote:

Hello time enthusiasts!  I'm hoping for your advice on my (perhaps modest, by 
this list's standards) project.

I would like to make a frequency calibration of a 10 MHz oscillator to 1 ppm 
(1E-6) or better, using some basic equipment. I do not have a GPSDO or any 
serious lab equipment, or budget for same as this is just a personal project. 
What I do have access to:



I did a piece of software to provide calibration to equipment-deficient 
microcontroller-hobbyist frequency counter builders (think 100ppm 
crystal from the bin) over ntp:


http://n1.taur.dk/nft/nft.pdf (usage guide with relevant screenshots, 
required reading)

http://n1.taur.dk/nft/nft.exe
http://n1.taur.dk/nft/nftsrc.zip (delphi source)

Depending on how you are connected, 0.1ppm is quite doable. Measure, 
adjust, measure 3 times to verify.


When you decide that this is too cumbersome and buy a GPS with pps 
output, you could make it self-adjusting:

http://n1.taur.dk/simplexdo/


/Kasper Pedersen


___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] My Garmin 18x, Ver 3.50, currently 1 second slow to UTC

2010-12-31 Thread Kasper Pedersen

On 12/31/2010 10:20 AM, Joseph Gray wrote:

If I am using the NMEA data (as in the Garmin is the only time
source), what firmware is recommended by all those using a GPS18x-LVC?

Here are measurements on the bad versions:

http://n1.taur.dk/permanent/gps18x-330-pps.jpg
http://n1.taur.dk/permanent/gps18x-350-pps.jpg
Note I am running 115200, not 4800


3.00 kills itself. I had 2 die simultaneously.
3.10 starts transmitting 350ms .. 480ms after PPS
3.30 starts transmitting 920ms .. 1220ms (!) after PPS
3.50 starts transmitting 700ms .. 1220ms (!) after PPS

/Kasper Pedersen


___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] Linux timekeeping / jiffy source

2010-12-02 Thread Kasper Pedersen
On 12/03/2010 04:17 AM, Mike S wrote:
 Anyone familiar with Linux kernel timekeeping?


On boot, the kernel picks a clocksource. If the cpu is recent,
and it is not forced, the tsc (cpu) counter gets chosen.

The tsc increment rate is initially unknown, and is measured
against pit (8253/8254), and the result may be off if SMI
interrupts arrive (these are BIOS interrupts and can not be
masked by the OS). The newer the kernel, the more
attempts to work around SMI in that part of the code. If this
code works, it does not matter what frequency the cpu (and
thus tsc) is running, so I suspect this code is failing. Or pit
is on drugs.

http://n1.taur.dk/permanent/testpmt.c

this bit of code will compare the timekeeping clock to the
PMTimer, which runs off of plain 14.31818MHz/4. It gives you
the frequency offset (in ppm) in a few seconds, and provided
ntpd is not started on boot, gives you the scaling error.

If you force the kernel to use another clocksource, either
clocksource=hpet
clocksource=acpi_pm
then you may see a rather large error (12 or 127ppm)
between PMTimer, and the clock running off of PMTimer.
This is due to a rounding error in timekeeping.c, and for
that there is this patch:

http://n1.taur.dk/timefix2.patch

With a good* 14.31818MHz, running the clock off of acpi_pm
is now good. With hpet there's another bug, causing a
60e-9 offset.

My patch above is not perfect. When it corrects for, say, a
127ppm rounding error, it also inadvertently changes the
gain of adjustments. Thus, when you (or ntpd) ask for 1ppm
trim, you get 1.000127 ppm trim. Also, my comment about
this starting with 2.6.32 is false, it affects much older
kernels too.

/Kasper Pedersen

*as defined by time-nuts.

___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] GPS USB dongle for time server

2010-11-09 Thread Kasper Pedersen
On 11/09/2010 03:07 AM, Hal Murray wrote:
 The Garmin USB 18 was much better.  Unfortunately, it wasn't as sensitive as 
 competing units and it's been replaced by the 18x which has the typical 
 horrible jitter problems.  I don't have a graph of the 18x handy, but here is 
 data from a USB 18.
   http://www.megapathdsl.net/~hmurray/ntp/GPS18USB-off.gif
 (The Garmin USB 18/18x units don't speak NMEA, but that's just SMOP.)
   

The 18x-lvc (rs232):

http://n1.taur.dk/permanent/hist3.png
http://n1.taur.dk/permanent/adev3.png
http://n1.taur.dk/permanent/gpst3.png

(in the last plot the y axis is seconds, not nanoseconds)

It is no timing receiver, but it suffices to drive ntpd.
Two notes: the 18x here is configured for n...@115200, as
that is what the homecooked GPSDO speaks. Otherwise the
mesages pile up, moving the time message around excessively.
This unit is decapsulated and sitting indoors.

/Kasper Pedersen

___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] GPS ceramic patch in what plastic housing?

2010-09-06 Thread Kasper Pedersen
On 09/05/2010 06:12 PM, Peter Krengel wrote:
 Hello,
 
 I just did some experiments using a ceramic patch antenna inside a
 small plastic (80 x 30 x 20mm) screw box and experienced much bader signals 
 at lower elevations.
 The plastic is marked as PS (I guess polystyrole ?). Further experiments
 covering a GPS with the same kind of box seemed to effect the signals
 too. On the other hand covering the patch with a flat pcs of the same
 material didnt effect the antenna. 
 

Finding a suitable top for that gps module/patch/.. that is both the 
right material and the right shape is hard. Just the right shape is
much easier. So:

I have had good success with vacuum forming such a beast. One particular
glass cup I have in the kitchen is flat top conical, of just the right
size. I put it on top of the ground plane, a 1mm sheet of 
clear polycarbonate above that, and with an air pump and heat gun I
pulled the PC down around it. A bit of white paint on the inside, and 
it looks really good.


/Kasper Pedersen

___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] Reference source 1E10^8 only ...Ideas

2010-07-24 Thread Kasper Pedersen

On 07/24/2010 02:33 PM, Don Collie jnr wrote:

I need a frequency reference for my frequency counters, it needs to be accurate 
to at least +or- 1 part in 10,000,000.


For a home-cooked gpsdo in the really low end I have this bit to offer:
http://n1.taur.dk/simplexdo/

It was built to be an always calibrated and ready, pocketable, 
instant-on source. Not to compete with something like a second hand Tbolt.


/Kasper Pedersen


___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] A different timenuts interest

2010-07-22 Thread Kasper Pedersen

On 07/22/2010 02:13 AM, Morris Odell wrote:


The pendulum requires a sustaining system to compensate for the inevitable
energy loss with each swing. The system is located in the building and
therefore rotates relative to the pendulum. It needs to provide an impulse
which does not affect the plane of oscillation of the pendulum. I was
thinking of an electromagnet located below the centre of the swing which
would be pulsed appropriately as the bob passes over it.



As a kid, I did a self sustaining pendulum with no moving parts and no 
magnets:


The bob was suspended by two parallel wires, lacquered together, and 
shorted at the bob end. As the bob passed over the center, a one-shot 
sent a good-sized current pulse through the wire, heating it, making it 
slightly longer, and then shrink again as it cooled at the outside of 
the swing.


For a heavy pendulum, and thick wire, the time constant in the cooling 
phase will likely make this infeasible.


/Kasper Pedersen

___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


[time-nuts] A weekend project

2010-04-12 Thread Kasper Pedersen

(mostly for entertainment value)

As the talk fell on what is a weekend project for timenuts, here is my 
Easter project.


I have previously built a few GPSDOs with my own home-rolled OCXOs. The 
VC-OCXOs are a problem: I run into linearity problems, noise, the 
residue of the flux changing with time, and DAC drift. Voltage control 
is annoying.


So, I built a PLL that will take a 14.7456MHz inaccurate non-adjustable 
OCXO (something that does not have a large common denominator with 
20MHz) and generate 20MHz with 1E-12 or arbitrarily better resolution.


The method is this:
A microcontroller is clocked from a 20MHz VCXO. It samples the 14.7MHz 
using a flipflop (something I did before), calculates the phase from a 
number of samples (211ps resolution single shot, 22ps multiple), 
calculates the predicted phase at the phase acquisition time (it turns 
rapidly as there is a 5.3MHz beat), and uses the difference to lock the 
20MHz VCXO.

The whole thing, with the exception of the VCXO, is software.

Stepping the synthesizer in 1E-12 steps is strangely satisfying. So is 
plotting the noise, as the VCXO is deliberately awful; The close-in 
noise (30ms tau) is the VCXO done with the microcontroller's built-in 
oscillator, above that it is that of the OCXO.


http://n1.taur.dk/timenuts/synth_v2.pdf
(2-hour very much draft version - you may want to skip to the very last 
page)


Probably not a new design, but I did re-invent it.
Proper measurements will have to wait a few weeks.

/Kasper Pedersen

___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] simple, cheap clock for the local LAN

2010-04-05 Thread Kasper Pedersen

On 04/05/2010 03:47 PM, Eugen Leitl wrote:


Hi,

I'm thinking about putting a local clock standard (nothing too fancy,
quartz would probably do) for the local LAN so that I have more or
less stable clocks when GPS is down for whatever reason.

I have zero clue about time standards for the low end. Can anyone
recommend anything affordable? Thanks.


You need to give a ballpark figure for what you want.

A beyond-awful homecooked OCXO like this one
http://n1.taur.dk/timenuts/img_1017_crop.jpg
http://n1.taur.dk/timenuts/img_1020_crop.jpg

http://n1.taur.dk/clock/rate.png is the trace for something of similar 
build quality, and as can be seen, it is on the order of 3ppb/day. Noise 
is due to this being a cheap DCF77 clock driven server.
Combined with something like a D945GSEJT board with the crystal removed 
does give sub-ms 24 hour holdover with plain ntpd.


Now, what is the requirement?

/Kasper

___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] Rb Oscillator - rather fundamental question

2010-02-23 Thread Kasper Pedersen

On 02/23/2010 11:10 PM, Matthew Smith wrote:

BTW: does anyone know if a 0.55V p-t-p sine wave from an Rb source would
be enough to clock an Atmel AVR microcontroller?  The crystal/clock
input *is* an amplifier, but didn't know if I'd need to do anything to
the signal first, to get it closer to the 5V logic level.


It will.
Set the fuses as you would have for a 10MHz crystal, and capacitively 
couple the source to XTAL1. Leave XTAL2 open.

Do not set the fuses for 'external clock mode'.

Do put something like 100pF+1k Ohm in series with the input. While they 
won't promise anything, I have deliberately run 1A into the protection 
diodes of an ATMega16 for many seconds and still had a functional part.


/Kasper Pedersen

___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] CPLDs for clock dividers

2010-02-03 Thread Kasper Pedersen

On 02/03/2010 07:59 PM, Matt Ettus wrote:

Does anyone have any experience using CPLDs for very low phase noise
dividers?  You can get an XC9536XL from Xilinx for around $1, and I
thought it would make a good divide by 2 through 10 device.


9500XL (3.3V) is, I believe, similar to 9500 (5V). A downside to the way 
the 9500 is built is the rather high static power consumption, and that 
the static current consumption is dependent on the internal state of the 
signals. If you have a single divider in a part it is not a problem. But 
if you divide by 2 and 10, the '2' output will be modulated by the 
divide-by-10 in ways one may not expect since the input threshold of the 
clock signal changes.


An alternative I like better is XCR3032XL, which is entirely CMOS. No 
current-source-driven AND/OR, with a static current consumption that 
isn't dependent on the internal state. Thus, the internal state does not 
move the threshold of the global clock around.

Output slew rate is faster than 1ns when driving into 150 ohm.

/Kasper Pedersen

___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] 4 KV Power Supply Recommendations

2010-01-18 Thread Kasper Pedersen

On 01/18/2010 11:10 PM, Didier Juges wrote:
 I could not resist, so I checked my relatively expensive Sears/Kenmore
 microwave oven.
 The results are there:
 http://www.ko4bb.com/Test_Equipment/Microwave_oven_leakage/

 In one word, dismal. Almost 1W peak power leakage at 1 foot, and almost
 100MHz occupied bandwidth.

1W into the analyzer with a sub-optimal antenna. If we are really 
optimistic and assume 3dBi, the effective area is (12cm)2/(4*pi)*2(for 
3dBi) = 23cm2, or 12 cm2 for 0dBi.

1W becomes 43..83mW/cm2.
Ow.

The ballpark figure I learned when I worked with ISM was 50mW/cm2 - the 
point at which I have already left, and the point where the heating of 
the lens in your eye becomes a problem. Of the permanent kind.


/Kasper Pedersen

___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


[time-nuts] power line common view - a silly experiment

2009-11-29 Thread Kasper Pedersen
I have servers at two sites: At home (northern part of Silkeborg, .dk), 
and in the center of Silkeborg. Population count about 4.


The location matters, since these two sites are on different 60kV radials.

I have clocks at both locations, so I decided to see how well I could do 
time transfer between the two sites, only using the power line. A poor 
man's common view experiment.


http://mx15.kasperkp.dk/plcv.png


I expected it to be a lot worse. 100us is 1.8 degrees phase error, or 
10V slicer offset on 230V. Since the sense circuits are really cheap 
opto couplers, and the temperature variations on the 'city server' are 
rather extreme (parking basement), they can be responsible for an error 
at least this large.


I have a set of slightly linux specific sources that generate a shm 
refclock from the local power line and a remote observing server with a 
real refclock, if anyone wants to play with this.


/Kasper Pedersen

___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] Reference oscillator accuracy

2009-11-13 Thread Kasper Pedersen

On 11/13/2009 07:15 PM, Don Latham wrote:

The ground wave path of WWVB varies due to a very small changes in the
index of refraction (temperature and absolute humidity) over the path. It
is not much, but is measurable.
Don



My own nuttiness started with that, and the innocent question How much? 
What does it take to measure it? What do I need to build?


http://n1.taur.dk/dcf/  (raw data and plots, time is UTC+1)

I am no more than 6-700 km north of DCF77, and get ~5us p-p. Now that is 
quite large, when I started out that number seemed a lot smaller.


/Kasper Pedersen

___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


[time-nuts] GPS 18x death and resurrection - was: GPS Week 1536 causing problems?

2009-07-05 Thread Kasper Pedersen

Hal Murray wrote:
I don't think it has a battery inside.  That seems like a poor design.  Too 
many reasonable use cases would include sitting in a drawer for extended 
periods of time.
  
There is a battery inside. A tiny little Panasonic rechargeable lithium 
cell. Mine were at 2.7V.
Mine was less than a year old.  It had been plugged in and working fine for 
several months.  Then it just died.
  
Six months. The most recent component is dated 0751, so they've been in 
storage for a while before I got them.
As I was poking around, double checking things to make sure I didn't inject 
too much noise into this discussion, it started working again.
  
I discharged the batteries on my pair. 0.6V was not low enough, then I 
tried again with a dead short for a few minutes, and they both came 
alive again. So just discharging in the drawer for a month or two might 
bring it back to life.
So I support the 'yet another buggy firmware' theory. MediaTek.tw does 
not give me a warm fuzzy feeling.
In case it dies again... Does anybody know how to take one of them apart?  
  
The case is two cups. The top has two 'rings' 2mm apart, the outer ring 
being the outside of the top. The bottom also has two rings, 1mm smaller 
than the top. The cavity between the two rings on the bottom is filled 
with silicone before the top is pushed on. It is held in place with 3 
snap locks, one of which is right next to the thickest bulge on the 
strain relief. If you insert a flat screwdriver and pry the top up 
exactly opposite that bulge, you can get the silicone to release and 
it's then relatively easy to see where the snaps are. Apply force.
If you have compressed air, pull off the bottom label, pull the green 
seal off the breather hole, and apply compressed air.

The magnets are glued on from the inside, there's nothing on the outside.

(and on a side note, the tiny little TCXOs in them are both ~1.4 ppm low)

/Kasper Pedersen

___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] GPS Week 1536 causing problems?

2009-07-03 Thread Kasper Pedersen

Magnus Danielson wrote:


Unfortunatly I have heard a few reports of failures, one which I can't 
disclose the details of right now, but replacing GPS equipment solve 
the issue.




I didn't think this would hit me, and I don't know if it's related, but:

I have (had) 2 Garmin GPS-18x fw 3.00 on the windowsill, one driving a 
homecooked GPSDO, the other just a separate pps.
This morning both of them were quiet; There's no NMEA data coming out of 
them, no pps, nothing. Garmin's tool won't talk to them.
They were on separate supplies, and one of them has RXD tied hard to 
ground (nothing speaks to it).

They did share windowsill, and it hasn't rained.

Anyone else lose an 18x?

/Kasper Pedersen


___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] DSP WWVB Receiver Idea

2009-04-22 Thread Kasper Pedersen

Brooke Clarke wrote:
On the PICLIST there has been a discussion about the CMAX WWVB front 
ends and noise.  Olin mentioned that you could use a dsPIC to look at 
the I and Q signals resulting from mixing the WWVB signal with a 
carrier at 60 kHz.  His example case was to use a cheap crystal (+ or 
- 3 Hz) and so use a 10 Hz low pass filter on the I and Q signals 
prior to squaring and adding them.


I've built such a thing ( http://n1.taur.dk/dcf/ ). The zero-if I/Q 
approach has a few things that make it less ideal than it sounds. 
There's the 1/f  noise, discovering and compensating for DC offset on 
each of the channels requires that you remove the input, and it might 
not be a nice divider from 10MHz.
If you choose a small arbitrary offset you can solve these problems in 
software, only the filters in hardware need to be wider. Having the 
first filters wide, I found, was a good thing: In the very early morning 
I get a lot of sferics, and my steep filter rang like a bell with every 
crackle. A low-Q front end allowed throwing those samples away.


Since that was done I have added a narrow bandwidth phase integrator 
(2mHz) in software, and it will happily pull out ~10ns rms phase with a 
+60dB carrier 1Hz from center. It even stayed locked when the antenna 
amplifier broke and output 5Vp-p instead.


The real advantage of the I/Q method is that the bandpass filter becomes 
two lowpass, and two lowpass is easier than a similar width bandpass 
with enough precision and phase stability to be centered around 60kHz 
(and if you use crystal resonators in the front end you can't track 
anything else, and you get a problem with suppressing sferics).


You might not be able to get continuous reception no matter how hard you 
try; I've seen inversions where the carrier just slowly fades and comes 
back inverted with no apparent phase jumps (it looks like extremely slow 
bpsk).


If I did it today I'd try phk's approach first. Preferably with a 
somewhat tuned antenna to keep harmonics from PAL horizontal retrace 
from clipping the converter. The one above was built with what was 
available in the junkbox at the time.


/Kasper Pedersen

___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


[time-nuts] bounce - apologies

2008-08-07 Thread Kasper Pedersen
I must apologize for screwing up the mail server configuration.
I do not believe in generating replies to usually falsified addresses.
And I'm also rather confused as to why it happened now, and not a lot 
earlier.

To make it short, it is supposedly fixed.

/Kasper Pedersen

___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] Near-perfect chip for Loran-C frequency receiver

2008-07-05 Thread Kasper Pedersen
Bruce Griffiths wrote:
 Your original loop antenna should have a lower phase tempco 
 (particularly if a lower TCE coil former than a plastic lid is used) 
 than any ferrite antenna, particularly so if the antenna is resonated.
 Quartzlock have abandoned the use of ferrite antennas and substituted a 
 balanced shielded loop antenna for this reason for their VLF phase 
 tracking receivers.
   

When I built a DCF77-DO (selective I/Q front end, the rest a software 
radio in an AVR), I ran into this problem of phase tempco. A loop was 
better, but it was unhandy, and I still had phase drift in the 
amplifiers, filters and mixer propagation delay.
My fix was to have a tiny transmitter loop near the antenna (just the 
feeder cable termination resistor). Once in a while the microcontroller 
generates a 77.519kHz carrier, gets a phase measurement using the same 
frontend and I/Q mixer, and uses this for compensation.
DCF77 does wiggle quite a bit at dawn, plus there is the occasional 1us 
phase adjustments at the transmitter end.

http://n1.taur.dk/dcf/(~100km NNW of PHK)

I recall having seen better than this with Loran?

/Kasper Pedersen

___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


[time-nuts] quick and very dirty phase comparator

2008-06-01 Thread Kasper Pedersen
This is to poke my head in, and to share a simple multichannel
phase comparator/monitor that turned out to be useful.

I have a few homebuilt boxes that will do ~100ps timestamps,
I have other uses for them, and tying them up with a single
long term experiment is unacceptable. So I needed a phase
comparator that I could rebuild in an hour if I wanted to,
something in the spirit of TVB's PIC16 divider.
Something simple.

The idea is this:
Beat a number of 10MHz inputs against another clock frequency
using the input flipflops in a microcontroller as samplers,
sample a number of times to cover the phase circle, and
calculate the phase. Beating against 11.0592MHz gives a period
of 3456 clocks, sampling every 8 clocks gives 432 samples, that
should give 230ps resolution. Add clock jitter and aperture
jitter, and precision should be around 500ps.
How much performance can one get for $10?

schematic: http://n1.taur.dk/timenuts/phasecomp8.pdf
samples: http://n1.taur.dk/timenuts/phasesamples.png

When comparing a 10MHz source with itself through
a cable delay, the peak noise is 400ps. That's for a
300-microsecond acquisition time, which means the
update rate is limited by how fast I can compute the
vector and shovel data over to a PC. When monitoring
beating 10MHz sources with an adjusted  (-3ppm)
microcontroller clock, it's about 600ps peak.
When misadjusted to be -30 ppm off, it's 1.1ns peak.

At the moment there is only a crude windows program for
turning the output into decimal plottable data, so some
programming skill or beer drinking friend with programming
skill is required, as well as knowledge of what one wants to
measure (that's usually the hard part).

source, hex: http://n1.taur.dk/timenuts/phasecomp.zip
converter: http://n1.taur.dk/timenuts/phasehex2dec_win.zip

I'm aware that 600ps is a very large figure in a lot of
cases but for my oscillators it's good enough.

/Kasper Pedersen.


___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.