Hej Lars,

Impressive build in all it's simplicity.

Your filtering equations look strange.
Rather than having a PI loop it looks like both the P and I branch integrates. I'm also unclear about the loop gain changes by the pre-filter averager.

Will have to look more at your code.

Cheers,
Magnus

On 12/02/14 23:10, Lars Walenius wrote:
I have just changed all my Swedish comments in my source code and attached it. 
I also copied the text to a Word-file so everybody can see it without the 
Arduino Environment.




The Control loop (“PI-loop”) is more or less just two lines that you find 
approximately in the middle of the file (page 13 in Word-file). Check the two 
lines with comment: Corr for time respectively Corr for frequency.




As you say, Chris, it would be a good idea to use a smaller Arduino board or I 
have also thought of the 28pin DIP with Arduino bootloader. I have a couple of 
them from Digikey. Together with a FT232RL board (from China) it also could 
work well. With that it should also be possible to add optocouplers for 
isolation to the computer (have not tested it yet).




I see a lot of possibilities to improve the design. As you say adding an 
external DAC (monotonic 16-20bits) and/or ADC, LCD. Also more EEPROM for 
logging, soft serial lines to read e.g. M12 sawtooth information to correct the 
TIC Reading are possibilities.




Another thing that is important if you want a really good GPSDO is buffering 
and a good metal case for screening. I don´t have it so I get disturbances on 
other electronics like my DIY 10volts references that on a couple of them moves 
several ppm´s due to 10MHz leakage.




The third attachment is an ADEV+MDEV plot, made with the excellent Plotter 
program made by Ulrich Bangert, I just did from eight hours run between a LPRO 
Rb GPSDO in holdmode ( free running ) and another OCXO GPSDO with time constant 
set to 1000secs. The 1PPS was from a M12 timing receiver. The OCXO has 4 HC390 
dividers and was set to output 1Hz into the start channel of a HP5370B. The 
LPRO has 2 HC390  dividers and was set to give 1kHz into the stop channel of 
the HP5370B. As you can see the ADEV seems to be about 2E-12 at Tau=1000s.




An interesting thing I haven´t observed before is the minimas at 10,20,30 etc 
Tau. A question I have is if it could be due to the 0.1Hz output from the HC390 
on the OCXO leaking into the 1Hz output? Is that reasonable or is it another 
explanation for this?




Lars





Från: Chris Albertson
Skickat: ‎onsdag‎ den ‎12‎ ‎februari‎ ‎2014 ‎02‎:‎32
Till: [email protected]





Lars,

Thanks for posting this.   I think your design will be popular
especially with availability of the nano size Arduinos that sell for
$4 from China.
Your design could be built on a 3" perf board for about $10 with
change left over. (not counting the OCXO and GPS)

I like the little shields you've used but move to the nano sized
Arduino after the breadboard works

You say you have so rough edges with your code.  If you post it some
place (github.com, or just a file attachment here)  Anyways if you
post it I'll do what I can to clean it up and fix any problems.   I'm
wondering if you've addressed things like "wrap around" where the
clock goes to zero or if you maybe have problem with race conditions
in interrupt handers or something related to that.

I have an Arduino attached to my iMac as I type.  I know a bit about
software but little about control theory and I'm trying to get a PID
controller to be stable.  The darn thing just runs away, literally,
(t's a mobile robot.)   The good thing about placing 99% of the
functionality in software like you did is that your GPSDO can be
improved quickly once a few experts look at it and start testing it.

Already I am thinking about a real-time graphic display.  It would be
easy to add an LCD display to your GPSDO.   And then there are better
DACs and ADCs that are easy to connect to the Arunino's I2C bus

Thanks again for sharing this




On Tue, Feb 11, 2014 at 10:23 AM, Lars Walenius
<[email protected]> wrote:
I have long thought I should make my first post to the Time-Nuts forum. Being 
very grateful to everything I learned here.





I have tried to attach a picture showing one of my two Arduino GPSDO Shields . 
The first one I put together in 2011. It only needs two HCMOS circuits 
(HC390+HC4046), one diode and passive components. Still it has 1nsec resolution.



 From the simplified schematic it can be seen that the TIC uses a HC4046 very 
similar to the Shera controller but instead of using a digital counter I just 
added a diode and RC-net that goes directly into one of the 10-bit AD channels. 
So the TIC has about 1nsec resolution and 1usec range when the HC4046 is fed 
with 1MHz from the HC390. The linearity of the TIC is quite good as I use the 
1.1Volt ADC range. 500ns gives a reading of about 530 if 1000ns is a reading of 
1000. See also the picture that shows a hanging bridge measured with the board. 
Scale is AD value but is very close to 1ns per bit.



To get a broader TIC range I added a 5MHz input to timer 1 in the Arduino. 
Sorry to say I am not a good programmer so I have managed to get it to read the 
timer and add usecs to the analog nsec value but sometimes I get a wrong value 
so I am not using it to regulate yet.



As DAC I use two 8-bit PWMs in the Arduino Uno. They are summed by two resistor 
and to get ripple down I have a two-pole RC lowpass filter. My measurements 
with a Keithley 2000 6 digit DMM indicates at least 13-14bits monotonic range 
with 1% resistors. The internal 5Volt in the Arduino UNOs seems to have about 
or maybe less than 100ppm/C drift. With my OCXO I use only a 10ppb (1E-8) range 
so I get better than 1E-12 resolution and less than 1E-12/°C extra from the 
DAC. For the LPRO Rb I use 1ppb range so it gives better than 1E-13 resolution 
and less than 1E-13/°C extra from the DAC.



I also read temperature of the OCXO or Rb I discipline. The program can correct 
for temperature drift if needed. I have used it for the OCXO I have, an old 
CEPE that look similar to an 8663,  but not for the LPRO. My LPRO have about 
7E-13/°C tempdrift and 7E-14/mbar pressure drift so pressure drifts gives more 
problem for me.



For the LPRO, that seems to need about 7000secs timecontant, I also found a new 
problem when I was testing that for the first time during Christmas. The 
problem was a truncation error with long time constants and heavy prefiltering 
that gives an apparent change in timecontant and damping (more ringing). It is 
not solved in my code yet. So right now I use 1000secs as time constant for the 
LPRO also.



About my program:

-The 1PPS gives an interrupt that starts almost all of the program and first 
reads the TIC ADC

-Uses a prefilter after the TIC (Now set to one forth of time constant in my 
code )

-Uses a PI loop

-Senses four dipswitches for 16 different timecontansts between 100 and 
30000secs

-Senses four other dipswitches to set e.g fast locking (50 sec Tc), hold, max-, 
min-, mid-dac value for tests

-Has a missed PPS counter (increments if more than 1.1secs since last PPS)

-Has a  PPS lock indication that turns on if the TIC value is within 500+-x for 
more than five time constants

-Sends out time, DAC value, temperature, missed PPS and Locked every second on 
the serial line

-It also sends out the last 144 averaged 5minutes and 3hour TIC-values, 
DACvalue and temperature with one each of the values each second so after 
300seconds all stored values are sent to the serial line. From the Arduino 
serial monitor it is rather easy to copy-paste to e.g. Excel for further 
processing.

-It starts with the last stored 3 hour DAC-value if the EEPROM is not empty at 
start or if the board is reset. If the EEPROM is empty it starts with a value 
set in the program.




My Arduino GPSDO shield is far from ready but probably very useful for those 
who like to experiment and have a GPS with 1PPS out and an OCXO with a voltage 
control input and 10MHz TTL level output.




Lars Walenius
_______________________________________________
time-nuts mailing list -- [email protected]
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.





_______________________________________________
time-nuts mailing list -- [email protected]
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


_______________________________________________
time-nuts mailing list -- [email protected]
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.

Reply via email to