Re: [time-nuts] Any Isotemp OCXO107-10 Info?
In message 531f7161.2080...@sasktel.net, Ed Palmer writes: I just picked up an Isotemp OCXO107-10 Oscillator. I thought it looked like it might be interesting, but it turns out that it's better than I thought. It's got a Dewar flask! I found the specs, but it didn't mention anything about that. So, before I let the magic smoke out, does anyone have the pinout info? Mine has a DB9 male connector rather than the DB25 shown on the specs but, of course, I'll be grateful for *any* info. Mine is an OCXO107-16, which is a 5MHz model. It has DE9[1] connector with the following documented pinout: 1 - 5MHz logic (CMOS ?) [8.5 kOhm] 2 - DGND[0.14 Ohm] 3 - +5V [7.5 kOhm] 4 - [0.14 Ohm] 5 - +12V (Oven) [219 kOhm] 6 - [0.13 Ohm] 7 - AGND[0.12 Ohm] 8 - EFC [303 kOhm] 9 - VREF[5.7 kOhm] Resistances in [] measured against the metal case, negative terminal to case. Any resistance between pins 2, 4, 6 and 7 are less than I can measure with any precision. +12V current starts at 350mA and ends up less than 80mA after about half an hour. +5V current is 5.2mA and probably only used for whatever chip drives the cmos output on pin 1. Turning it on/off has no effect on the sine-wave output on the SMA connector. VREF stabilizes at 8.060... V after some hours. EFC floats at 4.5580... V [1] It's DB25 but DE9, the second letter is the shell size :-) Hope this helps... -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 p...@freebsd.org | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. ___ 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] How to measure phase noise of HCMOS oscillators?
Thanks a lot for the input! I will try to use the LMH6702 as buffer. The correct way to measure the HCMOS oscillator would probably be to use a high impedance buffer with very low noise, to simulate driving a 10pF load or so. But I guess that is not easy to do. The LMH6702 voltage noise is probably low enough, but I do not know if it is possible to bias the HCMOS signal so it matches the LMH6702 input voltage range without increasing the noise level. I´m using a double balanced mixer form mini circuits as phase detector that can take 14dBm signals and a SRS FFT analyzer to measure the noise. The oscillator that I´m measuring is a 100MHz Crystek. /Anders ___ 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] How to measure phase noise of HCMOS oscillators?
Why not AC couple the HCMOS output to the LMH6702 input? Bruce Anders Time wrote: Thanks a lot for the input! I will try to use the LMH6702 as buffer. The correct way to measure the HCMOS oscillator would probably be to use a high impedance buffer with very low noise, to simulate driving a 10pF load or so. But I guess that is not easy to do. The LMH6702 voltage noise is probably low enough, but I do not know if it is possible to bias the HCMOS signal so it matches the LMH6702 input voltage range without increasing the noise level. I´m using a double balanced mixer form mini circuits as phase detector that can take 14dBm signals and a SRS FFT analyzer to measure the noise. The oscillator that I´m measuring is a 100MHz Crystek. /Anders ___ 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 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] How to measure phase noise of HCMOS oscillators?
On 12/03/14 10:57, Anders Time wrote: Thanks a lot for the input! I will try to use the LMH6702 as buffer. The correct way to measure the HCMOS oscillator would probably be to use a high impedance buffer with very low noise, to simulate driving a 10pF load or so. But I guess that is not easy to do. The LMH6702 voltage noise is probably low enough, but I do not know if it is possible to bias the HCMOS signal so it matches the LMH6702 input voltage range without increasing the noise level. I´m using a double balanced mixer form mini circuits as phase detector that can take 14dBm signals and a SRS FFT analyzer to measure the noise. The oscillator that I´m measuring is a 100MHz Crystek. OK. What is the other signal to the mixer? What is the ref? A known quiet 100 MHz? Another Crystek? Delayed version of itself? Oscillator locked to the input? Cheers, Magnus ___ 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] How to measure phase noise of HCMOS oscillators?
The LMH6702 is a wicked fast op amp which will react accordingly it there are parasitics in the feedback path. I have only used them with well laid out PWBs and extremely short traces to surface mount resistors. Under those conditions, they work beautifully as advertised. Not sure anyone other than John can actually breadboard with them :) Didier KO4BB On March 12, 2014 4:57:23 AM CDT, Anders Time anderst...@gmail.com wrote: Thanks a lot for the input! I will try to use the LMH6702 as buffer. The correct way to measure the HCMOS oscillator would probably be to use a high impedance buffer with very low noise, to simulate driving a 10pF load or so. But I guess that is not easy to do. The LMH6702 voltage noise is probably low enough, but I do not know if it is possible to bias the HCMOS signal so it matches the LMH6702 input voltage range without increasing the noise level. I´m using a double balanced mixer form mini circuits as phase detector that can take 14dBm signals and a SRS FFT analyzer to measure the noise. The oscillator that I´m measuring is a 100MHz Crystek. /Anders ___ 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. -- Sent from my Motorola Droid Razr 4G LTE wireless tracker while I do other things. ___ 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] HP 58503A acurate UTC time
Thanks guys It is now reading UTC, but only after a power off routine. That confused me ! I can't afford the time to let it re-survey, and used the Query command with a 0 instead of a ?. Re-querying it with a question mark it replied that there would be no survey on power up. The iPhone photo of the screen is here www.soundhifi.com/FOURUMIMAGES/gps.jpg So the question is, will this really stop the annoying survey every time ? And finally, does anyone have the circuit of the display so I can put a switch in the reduce the brightness please ? Thanks Dave ___ 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] ELEMEK LXK WWVB Receiver
Tom I may have missed your comment do you have one of these? It appears there is very little data on them. Must not have been popular. So from the posts I can give you a good guess. It would be a TRF receiver without a crystal filter. This can be as reasonable as 4 transistor stages to get that 100 DB gain. Further guessing. The PLL is based on 20 Khz phase comp of a 100KHz ref/5. Could have been a cd4046 they were around back then. I would truly be amazed if it actually used a set of mc1496 mixers and quadrature decoding. The new wwvb modulation will not allow the phase lock to lock. But the time data may still be available if they were using simple AM demodulation with a diode. Thats my purest of speculation. Regards Paul WB8TSL On Tue, Mar 11, 2014 at 2:12 PM, David McGaw n1...@dartmouth.edu wrote: From an ad in Radio-Electronics June 1980, it mentions that it phase-locks to the carrier. I expect the new format of WWVB will give it fits. https://archive.org/stream/radio_electronics_1980-06/ Radio_Electronics_June_1980#page/n71/mode/2up/search/wwvb 73, David N1HAC On 3/11/14 1:55 PM, Tom Holmes wrote: Does anyone have any information on this box? It has 60 kHz and 100 kHz outputs, runs on 12 VDC. Not much info found on the web so far. Tom Holmes, N8ZM ___ 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 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 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] Frequency Counter using OCXO and MCU
Are you putting the unknown signal to be measured on an interrupt pin? that will work for low enough frequencies but most uPs have a built-in counter. It is a hardware register on the uP chip that will increment for each pulse on a pin. then you read that number and divide by the gate time. At some point the frequency will be to high for the counter pin so then you switch in a hardware frequency diver as a pre-scaler. On Tue, Mar 11, 2014 at 8:24 PM, d0ct0r t...@patoka.org wrote: Hello, I am experimenting to build frequency counter using external OCXO and ST32 MCU. The OCXO is external DATUM 2750013-1 device which produce 10Mhz sine wave. I connected its output to OC_IN on MCU. I have few challenges now. First, looks like I need to create some delay to turn on MCU _after_ OCXO. If I try to start both devices simultaneously, I got following result for 10 kHz TTL measurement: System Core Clock: 16800 Hz SYSCLK_Frequency PCLK1_Frequency PCLK2_Frequency 1600 16001600 # Starting SuperLoop... FREQ: 105197 FREQ: 105263 FREQ: 105263 FREQ: 105263 As soon as I push reset button on MCU, I got correct results for its clocks and correct value for the counter: System Core Clock: 16800 Hz SYSCLK_Frequency PCLK1_Frequency PCLK2_Frequency 1680042008400 # Starting SuperLoop... FREQ: 10019 FREQ: 10019 FREQ: 10019 FREQ: 10019 FREQ: 10018 FREQ: 10019 Another challenge is the fact, that if I increase the input signal frequency, then performance of the MCU decreased. In the other word, I need to wait much more time to have a result. Probably MCU is super busy to handle the interrupt. Say for 10 kHz range its pretty fast. Then for 1 mHz its much slower. Here is main loop: while (1) { if(j++ 0xF0) { accum += deltaREF; // Moving Average accum = (accum 1); } else { uwTIM1Freq = (uint32_t) SystemCoreClock / accum; printf(FREQ: %ul\n\r, uwTIM1Freq); accum = j = 0; } } The counter is based on timer in input capture mode and driven by interrupt: [ See STM32F4xx_StdPeriph_Examples\TIM\TIM_InputCapture ] Also this counter shows incorrect results for low frequency. For example, for 100 Hz: FREQ: 4968 FREQ: 5030 FREQ: 5056 FREQ: 4916 I would be interesting to hear any advise how to improve it. And another question is: what will be pros and cons to transform 10Mhz sine to square to feed MCU ? I tried it, but didn't catch any difference. Here is schema http://www.qsl.net/va3iul/Homebrew_RF_Circuit_Design_ Ideas/Sine-to-Square_Wave_BJT_Converter_Wenzel.gif -- WBW, V.P. ___ 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. -- Chris Albertson Redondo Beach, California ___ 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] Frequency Counter using OCXO and MCU
Sorry forgot to add this. As for delayed turn on. That can work but why not simply have the software go into a 5 or 10 second wait before it does anything else. Display warming up or please wait on the LCD. On Wed, Mar 12, 2014 at 7:18 AM, Chris Albertson albertson.ch...@gmail.comwrote: Are you putting the unknown signal to be measured on an interrupt pin? that will work for low enough frequencies but most uPs have a built-in counter. It is a hardware register on the uP chip that will increment for each pulse on a pin. then you read that number and divide by the gate time. At some point the frequency will be to high for the counter pin so then you switch in a hardware frequency diver as a pre-scaler. On Tue, Mar 11, 2014 at 8:24 PM, d0ct0r t...@patoka.org wrote: Hello, I am experimenting to build frequency counter using external OCXO and ST32 MCU. The OCXO is external DATUM 2750013-1 device which produce 10Mhz sine wave. I connected its output to OC_IN on MCU. I have few challenges now. First, looks like I need to create some delay to turn on MCU _after_ OCXO. If I try to start both devices simultaneously, I got following result for 10 kHz TTL measurement: System Core Clock: 16800 Hz SYSCLK_Frequency PCLK1_Frequency PCLK2_Frequency 1600 16001600 # Starting SuperLoop... FREQ: 105197 FREQ: 105263 FREQ: 105263 FREQ: 105263 As soon as I push reset button on MCU, I got correct results for its clocks and correct value for the counter: System Core Clock: 16800 Hz SYSCLK_Frequency PCLK1_Frequency PCLK2_Frequency 1680042008400 # Starting SuperLoop... FREQ: 10019 FREQ: 10019 FREQ: 10019 FREQ: 10019 FREQ: 10018 FREQ: 10019 Another challenge is the fact, that if I increase the input signal frequency, then performance of the MCU decreased. In the other word, I need to wait much more time to have a result. Probably MCU is super busy to handle the interrupt. Say for 10 kHz range its pretty fast. Then for 1 mHz its much slower. Here is main loop: while (1) { if(j++ 0xF0) { accum += deltaREF; // Moving Average accum = (accum 1); } else { uwTIM1Freq = (uint32_t) SystemCoreClock / accum; printf(FREQ: %ul\n\r, uwTIM1Freq); accum = j = 0; } } The counter is based on timer in input capture mode and driven by interrupt: [ See STM32F4xx_StdPeriph_Examples\TIM\TIM_InputCapture ] Also this counter shows incorrect results for low frequency. For example, for 100 Hz: FREQ: 4968 FREQ: 5030 FREQ: 5056 FREQ: 4916 I would be interesting to hear any advise how to improve it. And another question is: what will be pros and cons to transform 10Mhz sine to square to feed MCU ? I tried it, but didn't catch any difference. Here is schema http://www.qsl.net/va3iul/Homebrew_RF_Circuit_Design_ Ideas/Sine-to-Square_Wave_BJT_Converter_Wenzel.gif -- WBW, V.P. ___ 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. -- Chris Albertson Redondo Beach, California -- Chris Albertson Redondo Beach, California ___ 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] ELEMEK LXK WWVB Receiver
Hi Paul... Thanks for that insight, There are 2 4046's on the board, but the guts of the RX are hidden inside a can. It does have a time code output which could be fun to play with. Am hoping to learn a bit more before I tear into it in earnest. Tom Holmes, N8ZM -Original Message- From: time-nuts-boun...@febo.com [mailto:time-nuts-boun...@febo.com] On Behalf Of paul swed Sent: Wednesday, March 12, 2014 9:21 AM To: n1...@dartmouth.edu; Discussion of precise time and frequency measurement Subject: Re: [time-nuts] ELEMEK LXK WWVB Receiver Tom I may have missed your comment do you have one of these? It appears there is very little data on them. Must not have been popular. So from the posts I can give you a good guess. It would be a TRF receiver without a crystal filter. This can be as reasonable as 4 transistor stages to get that 100 DB gain. Further guessing. The PLL is based on 20 Khz phase comp of a 100KHz ref/5. Could have been a cd4046 they were around back then. I would truly be amazed if it actually used a set of mc1496 mixers and quadrature decoding. The new wwvb modulation will not allow the phase lock to lock. But the time data may still be available if they were using simple AM demodulation with a diode. Thats my purest of speculation. Regards Paul WB8TSL On Tue, Mar 11, 2014 at 2:12 PM, David McGaw n1...@dartmouth.edu wrote: From an ad in Radio-Electronics June 1980, it mentions that it phase-locks to the carrier. I expect the new format of WWVB will give it fits. https://archive.org/stream/radio_electronics_1980-06/ Radio_Electronics_June_1980#page/n71/mode/2up/search/wwvb 73, David N1HAC On 3/11/14 1:55 PM, Tom Holmes wrote: Does anyone have any information on this box? It has 60 kHz and 100 kHz outputs, runs on 12 VDC. Not much info found on the web so far. Tom Holmes, N8ZM ___ 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 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 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 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] Mains frequency
Tom, On 18/11/13 23:15, Tom Van Baak wrote: Magnus, I'm going to push back a bit on your mains sampling claim. Mostly, I'd like to see the results of the professional I-Q demodulated gear that you mentioned. Can you post raw data, or a sample plot? I don't have much of that myself. I do recommend you to check the presentations of the NASPI conference (naspi.org). There is plenty of plots there. I agree that looking at power line voltage with 16- or 24-bits at 1 Msps is going to reveal interesting amplitude and phase noise information. But see how well a $1 PIC can do. Well, I should toss that over to the good folk at NIST doing synchrophasor calibrations. Should I grab them now that we are in the same room? Have a look at IEEE C37.118.1 for measurement methods. Attached is a plot made using TimeLab + picPET just now. The picPET is fast enough to capture the zero-crossing of every 60 Hz cycle with 400 ns resolution; the TimeLab plots have tau0 of 16.67 ms. -- The blue trace was simply plugging a 9 VAC wall-wart into the picPET though a 10k resistor. -- The pink trace was adding a 10 nF cap across the input. -- The green trace was unplugging my laptop switching power supply from the same outlet! -- The red trace is replacing the mains wall-wart with a hp 33120A set to 9VAC at 60 Hz, a tentative noise floor measurement of the picPET when used this way. My conclusions are that at least here in the US, or at least at my house, the short-term stability of mains hits about 5e-6, at about tau 0.2 seconds. The attached short-term plot is also not-inconsistent with the long-term plot at http://leapsecond.com/pages/mains/ My other conclusion is that the picPET (a simple PIC-based time-stamping counter) is doing a pretty good job measuring this. Note, no software or data filtering was used. This is just raw serial/USB data going into TimeLab. Well, if you are happy with that, fine. But there are many things happening on the grid which needs deep analysis and the tools for it has been developed to provide both resolution and removal of noise which is not part of the measurments. Just calibrating the trigger noise for a PMU requires care, as the S/N required for a straight comparator for the applications is several tens of dBs away from a good conditions, so they have had issues with doing that. Doing your own time-stamping like you have done is naturally fun, but do not confuse it with the experience and processing that have been shown needed by an industry. BTW. WECC, who has a large network of PMUs, and that covers where you have your house and measurement point, can't release detailed data to me or you just for fun. It always needs to be cleared from a security point of view. Cheers, Magnus ___ 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] Frequency Counter using OCXO and MCU
I am using old Wavetek 180 signal generator for the tests. I just hooked its TTL output directly to the pin of MCU. The STM32F4xx has core clock 168 mHz and its inputs capable to handle pretty wide range of frequency. I don't think 1-2 mHz connected to the pin should be a problem. At least in my setup it shows me adequate result for that frequency. But its slows done the main loop a lot because its interrupting million time per second. For 2 mHz input, I'll need to wait several seconds to see the result. Of course I could remove averaging or decrease number of samples to improve that time. I am still thinking why I have incorrect results for low frequency. May be counter overflows could impact the result. The counter for my timer is 16 bit. That means it will generate overflow after 65535 counts. The timer frequency is 168 mHz. Then it will overflows around every 400 uS (or 2563.5 Hz). Probably any frequency which is lower than 2.5 kHz will shows me incorrect results. Probably I'll need to think how to handle that. Regards, V.P. On 2014-03-12 10:18, Chris Albertson wrote: Are you putting the unknown signal to be measured on an interrupt pin? that will work for low enough frequencies but most uPs have a built-in counter. It is a hardware register on the uP chip that will increment for each pulse on a pin. then you read that number and divide by the gate time. At some point the frequency will be to high for the counter pin so then you switch in a hardware frequency diver as a pre-scaler. On Tue, Mar 11, 2014 at 8:24 PM, d0ct0r t...@patoka.org wrote: Hello, I am experimenting to build frequency counter using external OCXO and ST32 MCU. The OCXO is external DATUM 2750013-1 device which produce 10Mhz sine wave. I connected its output to OC_IN on MCU. I have few challenges now. First, looks like I need to create some delay to turn on MCU _after_ OCXO. If I try to start both devices simultaneously, I got following result for 10 kHz TTL measurement: System Core Clock: 16800 Hz SYSCLK_Frequency PCLK1_Frequency PCLK2_Frequency 1600 1600 1600 # Starting SuperLoop... FREQ: 105197 FREQ: 105263 FREQ: 105263 FREQ: 105263 As soon as I push reset button on MCU, I got correct results for its clocks and correct value for the counter: System Core Clock: 16800 Hz SYSCLK_Frequency PCLK1_Frequency PCLK2_Frequency 16800 4200 8400 # Starting SuperLoop... FREQ: 10019 FREQ: 10019 FREQ: 10019 FREQ: 10019 FREQ: 10018 FREQ: 10019 Another challenge is the fact, that if I increase the input signal frequency, then performance of the MCU decreased. In the other word, I need to wait much more time to have a result. Probably MCU is super busy to handle the interrupt. Say for 10 kHz range its pretty fast. Then for 1 mHz its much slower. Here is main loop: while (1) { if(j++ 0xF0) { accum += deltaREF; // Moving Average accum = (accum 1); } else { uwTIM1Freq = (uint32_t) SystemCoreClock / accum; printf(FREQ: %ulnr, uwTIM1Freq); accum = j = 0; } } The counter is based on timer in input capture mode and driven by interrupt: [ See STM32F4xx_StdPeriph_ExamplesTIMTIM_InputCapture ] Also this counter shows incorrect results for low frequency. For example, for 100 Hz: FREQ: 4968 FREQ: 5030 FREQ: 5056 FREQ: 4916 I would be interesting to hear any advise how to improve it. And another question is: what will be pros and cons to transform 10Mhz sine to square to feed MCU ? I tried it, but didn't catch any difference. Here is schema http://www.qsl.net/va3iul/Homebrew_RF_Circuit_Design_Ideas/Sine-to-Square_Wave_BJT_Converter_Wenzel.gif [1] -- WBW, V.P. ___ time-nuts mailing list -- time-nuts@febo.com To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts [2] and follow the instructions there. -- Chris Albertson Redondo Beach, California Links: -- [1] http://www.qsl.net/va3iul/Homebrew_RF_Circuit_Design_Ideas/Sine-to-Square_Wave_BJT_Converter_Wenzel.gif [2] https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts -- WBW, V.P. ___ 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] Frequency Counter using OCXO and MCU
LCD connected to the same MCU. And it has relation to the core clock too. So, nothing on LCD before I reset entire MCU. I think initial incorrect core clock reading cause a lot of issues. Probably my only option will be to implement some external relay and timer to turn on MCU few seconds after OCXO. Or may be to put 10Mhz oscillator to PCB and connect OCXO output in parallel to it (not sure if its good idea or it will works). Regards, V.P. On 2014-03-12 10:21, Chris Albertson wrote: Sorry forgot to add this. As for delayed turn on. That can work but why not simply have the software go into a 5 or 10 second wait before it does anything else. Display warming up or please wait on the LCD. On Wed, Mar 12, 2014 at 7:18 AM, Chris Albertson albertson.ch...@gmail.com wrote: Are you putting the unknown signal to be measured on an interrupt pin? that will work for low enough frequencies but most uPs have a built-in counter. It is a hardware register on the uP chip that will increment for each pulse on a pin. then you read that number and divide by the gate time. At some point the frequency will be to high for the counter pin so then you switch in a hardware frequency diver as a pre-scaler. On Tue, Mar 11, 2014 at 8:24 PM, d0ct0r t...@patoka.org wrote: Hello, I am experimenting to build frequency counter using external OCXO and ST32 MCU. The OCXO is external DATUM 2750013-1 device which produce 10Mhz sine wave. I connected its output to OC_IN on MCU. I have few challenges now. First, looks like I need to create some delay to turn on MCU _after_ OCXO. If I try to start both devices simultaneously, I got following result for 10 kHz TTL measurement: System Core Clock: 16800 Hz SYSCLK_Frequency PCLK1_Frequency PCLK2_Frequency 1600 1600 1600 # Starting SuperLoop... FREQ: 105197 FREQ: 105263 FREQ: 105263 FREQ: 105263 As soon as I push reset button on MCU, I got correct results for its clocks and correct value for the counter: System Core Clock: 16800 Hz SYSCLK_Frequency PCLK1_Frequency PCLK2_Frequency 16800 4200 8400 # Starting SuperLoop... FREQ: 10019 FREQ: 10019 FREQ: 10019 FREQ: 10019 FREQ: 10018 FREQ: 10019 Another challenge is the fact, that if I increase the input signal frequency, then performance of the MCU decreased. In the other word, I need to wait much more time to have a result. Probably MCU is super busy to handle the interrupt. Say for 10 kHz range its pretty fast. Then for 1 mHz its much slower. Here is main loop: while (1) { if(j++ 0xF0) { accum += deltaREF; // Moving Average accum = (accum 1); } else { uwTIM1Freq = (uint32_t) SystemCoreClock / accum; printf(FREQ: %ulnr, uwTIM1Freq); accum = j = 0; } } The counter is based on timer in input capture mode and driven by interrupt: [ See STM32F4xx_StdPeriph_ExamplesTIMTIM_InputCapture ] Also this counter shows incorrect results for low frequency. For example, for 100 Hz: FREQ: 4968 FREQ: 5030 FREQ: 5056 FREQ: 4916 I would be interesting to hear any advise how to improve it. And another question is: what will be pros and cons to transform 10Mhz sine to square to feed MCU ? I tried it, but didn't catch any difference. Here is schema http://www.qsl.net/va3iul/Homebrew_RF_Circuit_Design_Ideas/Sine-to-Square_Wave_BJT_Converter_Wenzel.gif [1] -- WBW, V.P. ___ time-nuts mailing list -- time-nuts@febo.com To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts [2] and follow the instructions there. -- Chris Albertson Redondo Beach, California -- Chris Albertson Redondo Beach, California Links: -- [1] http://www.qsl.net/va3iul/Homebrew_RF_Circuit_Design_Ideas/Sine-to-Square_Wave_BJT_Converter_Wenzel.gif [2] https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts -- WBW, V.P. ___ 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] Frequency Counter using OCXO and MCU
On Wed, 12 Mar 2014 11:48:04 -0400, d0ct0r wrote: LCD connected to the same MCU. And it has relation to the core clock too. So, nothing on LCD before I reset entire MCU. I think initial incorrect core clock reading cause a lot of issues. Probably my only option will be to implement some external relay and timer to turn on MCU few seconds after OCXO. Or may be to put 10Mhz oscillator to PCB and connect OCXO output in parallel to it (not sure if its good idea or it will works). You could start the MCU up on the internal clock , write to the lcd , wait 5 sec. And then switch to the external clock. Btw: Is the Ext clock input on the STM fed directly from the OCXO ? Can the STM handle the OCXO voltage swing ? If you have a conditioning circuit betewwn the OCXO and the STM , i'd like to see it. As i have the need for one , trying to interface a 5v OCXO to a NXP 1114 Arm , that wants max 1.8v in the clockinput. CFO ___ 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] Frequency Counter using OCXO and MCU
On Wed, Mar 12, 2014 at 10:48 AM, d0ct0r t...@patoka.org wrote: LCD connected to the same MCU. And it has relation to the core clock too. So, nothing on LCD before I reset entire MCU. I think initial incorrect core clock reading cause a lot of issues. Probably my only option will be to implement some external relay and timer to turn on MCU few seconds after OCXO. Or may be to put 10Mhz oscillator to PCB and connect OCXO output in parallel to it (not sure if its good idea or it will works). Why not debounce reset from power-up using an RC network and a Schmitt trigger? Set the time constant so that it will hold the mpu in reset until power has been asserted long enough to ensure that the OCXO is producing output. -- Brian Lloyd, WB6RQN/J79BPL 706 Flightline Drive Spring Branch, TX 78070 br...@lloyd.com +1.916.877.5067 ___ 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] Frequency Counter using OCXO and MCU
On Wed, Mar 12, 2014 at 9:10 AM, cfo xne...@luna.dyndns.dk wrote: On Wed, 12 Mar 2014 11:48:04 -0400, d0ct0r wrote: If you have a conditioning circuit betewwn the OCXO and the STM , i'd like to see it. As i have the need for one , trying to interface a 5v OCXO to a NXP 1114 Arm , that wants max 1.8v in the clockinput. There are logic level converter chip made for this purpose or you can use a comparator and compare the 5V clock to ground. Or just a diode to clip the sine wave. If you connect a code. Sometimes you can set buy with a pair of resisters wired as a voltage divider. I like the comparator best because it will not load the clock. Diodes will load it for other users. -- Chris Albertson Redondo Beach, California ___ 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] Any Isotemp OCXO107-10 Info?
Many thanks, Poul. This info is consistent with the wiring on my unit. By looking and doing continuity tests, I've found ground on pins 2, 4, 6, and 7. The wire on pin 3 is red so that's also likely a match to yours for the +5 lead. Ed On 3/12/2014 2:31 AM, Poul-Henning Kamp wrote: In message 531f7161.2080...@sasktel.net, Ed Palmer writes: I just picked up an Isotemp OCXO107-10 Oscillator. I thought it looked like it might be interesting, but it turns out that it's better than I thought. It's got a Dewar flask! I found the specs, but it didn't mention anything about that. So, before I let the magic smoke out, does anyone have the pinout info? Mine has a DB9 male connector rather than the DB25 shown on the specs but, of course, I'll be grateful for *any* info. Mine is an OCXO107-16, which is a 5MHz model. It has DE9[1] connector with the following documented pinout: 1 - 5MHz logic (CMOS ?) [8.5 kOhm] 2 - DGND[0.14 Ohm] 3 - +5V [7.5 kOhm] 4 - [0.14 Ohm] 5 - +12V (Oven) [219 kOhm] 6 - [0.13 Ohm] 7 - AGND[0.12 Ohm] 8 - EFC [303 kOhm] 9 - VREF[5.7 kOhm] Resistances in [] measured against the metal case, negative terminal to case. Any resistance between pins 2, 4, 6 and 7 are less than I can measure with any precision. +12V current starts at 350mA and ends up less than 80mA after about half an hour. +5V current is 5.2mA and probably only used for whatever chip drives the cmos output on pin 1. Turning it on/off has no effect on the sine-wave output on the SMA connector. VREF stabilizes at 8.060... V after some hours. EFC floats at 4.5580... V [1] It's DB25 but DE9, the second letter is the shell size :-) Hope this helps... ___ 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] HP 58503A acurate UTC time
So the question is, will this really stop the annoying survey every time ? I'd browse the manual looking for fine print. The idea you are looking for is that after a survey it will save the location. If it has a saved location on power up it will use it rather than do a new survey. The other question is why are you turning it on/off often enough for a survey to be annoying? That type of box works a lot better if left on all the time. -- These are my opinions. I hate spam. ___ 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] Mains frequency
So we know there are deviations in line freq. But it seems strange in this era of very accurate and inexpensive freq references. How much is related to the generation? It seems in this era of switching supplies and other complex loads that even if the power were perfect at the generator the phase/freq could vary widely across the grid as different parts of the sine wave are loaded in a non linear fashion. And could a small digital signal be added to the smart grid that would control switching supplies to correct rather then degrade the grid signal? Thomas Knox Date: Wed, 12 Mar 2014 16:39:50 +0100 From: mag...@rubidium.dyndns.org To: time-nuts@febo.com Subject: Re: [time-nuts] Mains frequency Tom, On 18/11/13 23:15, Tom Van Baak wrote: Magnus, I'm going to push back a bit on your mains sampling claim. Mostly, I'd like to see the results of the professional I-Q demodulated gear that you mentioned. Can you post raw data, or a sample plot? I don't have much of that myself. I do recommend you to check the presentations of the NASPI conference (naspi.org). There is plenty of plots there. I agree that looking at power line voltage with 16- or 24-bits at 1 Msps is going to reveal interesting amplitude and phase noise information. But see how well a $1 PIC can do. Well, I should toss that over to the good folk at NIST doing synchrophasor calibrations. Should I grab them now that we are in the same room? Have a look at IEEE C37.118.1 for measurement methods. Attached is a plot made using TimeLab + picPET just now. The picPET is fast enough to capture the zero-crossing of every 60 Hz cycle with 400 ns resolution; the TimeLab plots have tau0 of 16.67 ms. -- The blue trace was simply plugging a 9 VAC wall-wart into the picPET though a 10k resistor. -- The pink trace was adding a 10 nF cap across the input. -- The green trace was unplugging my laptop switching power supply from the same outlet! -- The red trace is replacing the mains wall-wart with a hp 33120A set to 9VAC at 60 Hz, a tentative noise floor measurement of the picPET when used this way. My conclusions are that at least here in the US, or at least at my house, the short-term stability of mains hits about 5e-6, at about tau 0.2 seconds. The attached short-term plot is also not-inconsistent with the long-term plot at http://leapsecond.com/pages/mains/ My other conclusion is that the picPET (a simple PIC-based time-stamping counter) is doing a pretty good job measuring this. Note, no software or data filtering was used. This is just raw serial/USB data going into TimeLab. Well, if you are happy with that, fine. But there are many things happening on the grid which needs deep analysis and the tools for it has been developed to provide both resolution and removal of noise which is not part of the measurments. Just calibrating the trigger noise for a PMU requires care, as the S/N required for a straight comparator for the applications is several tens of dBs away from a good conditions, so they have had issues with doing that. Doing your own time-stamping like you have done is naturally fun, but do not confuse it with the experience and processing that have been shown needed by an industry. BTW. WECC, who has a large network of PMUs, and that covers where you have your house and measurement point, can't release detailed data to me or you just for fun. It always needs to be cleared from a security point of view. Cheers, Magnus ___ 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 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] Frequency Counter using OCXO and MCU
xne...@luna.dyndns.dk said: If you have a conditioning circuit betewwn the OCXO and the STM , i'd like to see it. As i have the need for one , trying to interface a 5v OCXO to a NXP 1114 Arm , that wants max 1.8v in the clockinput. What's wrong with a simple resistive divider? -- These are my opinions. I hate spam. ___ 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] PLL Math Question
Now that I've got the TIC going, I'm working on the PLL math for my GPSDO. My question is about moving averages. I've put in a moving average for the TIC. From that, I've calculated the slope, and have put a moving average on the slope to settle it down. I think this boils down to a moving average of a moving average. If both are 16 seconds long, is this essentially a 32 second moving average of the TIC, or is it some other function? I read briefly about averages of averages last night, but I'm not sure I understood the conclusion. This is all clean code so I may be over-complicating things, but I'm OK with that. NOTE: The reason I'm using 16 seconds is that I'm becoming memory limited. I'm switching to an 18F2320, but that only gets me more program memory. I'm constrained to this chip on an existing board. Bob - AE6RV ___ 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] Mains frequency
Hi Tom, On 12/03/14 18:15, Tom Knox wrote: So we know there are deviations in line freq. But it seems strange in this era of very accurate and inexpensive freq references. May seem strange, yes. How much is related to the generation? It seems in this era of switching supplies and other complex loads that even if the power were perfect at the generator the phase/freq could vary widely across the grid as different parts of the sine wave are loaded in a non linear fashion. And could a small digital signal be added to the smart grid that would control switching supplies to correct rather then degrade the grid signal? The rotating transformers will lag different amounts depending on the load. You balance the frequency by balacing the generation with the load. A higher load than generation causes frequency to go down. A higher generation than load causes frequency to go down. The generators is then within their synchronous region be running synchronously, but not quite synchronous, their phase angle may shift depending on load and strength of the network. When phase diverge, the network fall apart, not often without a black-out as a result. Remember the 2003 NE blackout? On top of that, there is inter-area modes with oscillations, there is forced oscillations (such as from broken generators), control algorithm re-balancing and then all the nice transients from transformer steppings, cap tripping and tripping breakers for a line. Then the load changing patterns. There is a fair amount of GPS clocks being in use, but it doesn't change the behaviour of the grid that directly. It is used as reference to measure phase-vectors, frequency and ROCOF (rate of change of frequency, what we call linear frequency drift) which is used as input for the control of the power-grid. PS. Where are you, no Tom Knox in Knoxville ;-) Cheers, Magnus ___ 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] PLL Math Question
Bob, On 12/03/14 18:24, Bob Stewart wrote: Now that I've got the TIC going, I'm working on the PLL math for my GPSDO. My question is about moving averages. I've put in a moving average for the TIC. From that, I've calculated the slope, and have put a moving average on the slope to settle it down. I think this boils down to a moving average of a moving average. If both are 16 seconds long, is this essentially a 32 second moving average of the TIC, or is it some other function? I read briefly about averages of averages last night, but I'm not sure I understood the conclusion. This is all clean code so I may be over-complicating things, but I'm OK with that. When you serialize two averages you maintain the same time-constant of the average, but you get two 6 dB slopes on top of each other to form a 12 dB slope, while it is flat on the pass-band. You should be careful about use of averager inside the loop. A moving averager adds a zero in the loop, and you want to make sure you understand what that zero will do to the overall control-loop. Here you have two of them, as you run two average zeros in series. I prefer to use a PI or PID loop for such a control-loop, and potentially an exponential averager or two in there. If you make sure the exponential averager has a wide enough bandwidth, you can use standard PI dimensioning formulas, but achieve the tighter slope which the exponential averagers contribute to. NOTE: The reason I'm using 16 seconds is that I'm becoming memory limited. I'm switching to an 18F2320, but that only gets me more program memory. I'm constrained to this chip on an existing board. Exponential averger takes much less memory. Consider this code: x_avg = x_avg + (x - x_avg) * a_avg; Where a_avg is the time-constant control parameter. Cheers, Magnus ___ 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] Frequency Counter using OCXO and MCU
On Wed, 12 Mar 2014 09:42:05 -0700, Chris Albertson wrote: There are logic level converter chip made for this purpose or you can use a comparator and compare the 5V clock to ground. Or just a diode to clip the sine wave. If you connect a code. Sometimes you can set buy with a pair of resisters wired as a voltage divider. I like the comparator best because it will not load the clock. Diodes will load it for other users. Could you come up with some part numbers please. Ie. witch comparator would handle 10Mhz CFO ___ 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] ELEMEK LXK WWVB Receiver
Sun of gun what a guess. If there are two 4046s then they may indeed be running quadrature. Not bad at all. Who would have thunk it. If you decide to tear into things, maybe some pictures would be helpful. I have a fair eye for figuring things out. I do expect under the can to be from 2-3 transistors and perhaps tuned coils and caps. The 237 Hz sighted would be about right for an LC bandpass semi-loaded. There should also be an agc circuit or not. The old Singer WWVB receivers have no agc at all. I think they predate the am modulation. Regards Paul. On Wed, Mar 12, 2014 at 10:33 AM, Tom Holmes thol...@woh.rr.com wrote: Hi Paul... Thanks for that insight, There are 2 4046's on the board, but the guts of the RX are hidden inside a can. It does have a time code output which could be fun to play with. Am hoping to learn a bit more before I tear into it in earnest. Tom Holmes, N8ZM -Original Message- From: time-nuts-boun...@febo.com [mailto:time-nuts-boun...@febo.com] On Behalf Of paul swed Sent: Wednesday, March 12, 2014 9:21 AM To: n1...@dartmouth.edu; Discussion of precise time and frequency measurement Subject: Re: [time-nuts] ELEMEK LXK WWVB Receiver Tom I may have missed your comment do you have one of these? It appears there is very little data on them. Must not have been popular. So from the posts I can give you a good guess. It would be a TRF receiver without a crystal filter. This can be as reasonable as 4 transistor stages to get that 100 DB gain. Further guessing. The PLL is based on 20 Khz phase comp of a 100KHz ref/5. Could have been a cd4046 they were around back then. I would truly be amazed if it actually used a set of mc1496 mixers and quadrature decoding. The new wwvb modulation will not allow the phase lock to lock. But the time data may still be available if they were using simple AM demodulation with a diode. Thats my purest of speculation. Regards Paul WB8TSL On Tue, Mar 11, 2014 at 2:12 PM, David McGaw n1...@dartmouth.edu wrote: From an ad in Radio-Electronics June 1980, it mentions that it phase-locks to the carrier. I expect the new format of WWVB will give it fits. https://archive.org/stream/radio_electronics_1980-06/ Radio_Electronics_June_1980#page/n71/mode/2up/search/wwvb 73, David N1HAC On 3/11/14 1:55 PM, Tom Holmes wrote: Does anyone have any information on this box? It has 60 kHz and 100 kHz outputs, runs on 12 VDC. Not much info found on the web so far. Tom Holmes, N8ZM ___ 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 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 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 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 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] Any Isotemp OCXO107-10 Info?
In message 53208ed8.4090...@sasktel.net, Ed Palmer writes: Many thanks, Poul. This info is consistent with the wiring on my unit. By looking and doing continuity tests, I've found ground on pins 2, 4, 6, and 7. The wire on pin 3 is red so that's also likely a match to yours for the +5 lead. Sounds likely. Good luck, and keep me posted, I'd like to hear how your '107 measure. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 p...@freebsd.org | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. ___ 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] Frequency Counter using OCXO and MCU
Try: http://www.linear.com/product/LTC6957 Bruce cfo wrote: On Wed, 12 Mar 2014 09:42:05 -0700, Chris Albertson wrote: There are logic level converter chip made for this purpose or you can use a comparator and compare the 5V clock to ground. Or just a diode to clip the sine wave. If you connect a code. Sometimes you can set buy with a pair of resisters wired as a voltage divider. I like the comparator best because it will not load the clock. Diodes will load it for other users. Could you come up with some part numbers please. Ie. witch comparator would handle 10Mhz CFO ___ 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 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] PLL Math Question
Hi Magnus, Thanks very much for this response! It will be very easy to add the exponential averager to my code and do a comparison to the moving average. I have no experience with PI/PID. I'll have to look over the literature I have on them and relate that to what I'm controlling. It should be mentioned that I'm more interested in the adventure than in just copying someone else's code or formulae and pumping this out. I have an idea of how I want to do this and... Bob From: Magnus Danielson mag...@rubidium.dyndns.org To: time-nuts@febo.com Sent: Wednesday, March 12, 2014 12:51 PM Subject: Re: [time-nuts] PLL Math Question Bob, On 12/03/14 18:24, Bob Stewart wrote: Now that I've got the TIC going, I'm working on the PLL math for my GPSDO. My question is about moving averages. I've put in a moving average for the TIC. From that, I've calculated the slope, and have put a moving average on the slope to settle it down. I think this boils down to a moving average of a moving average. If both are 16 seconds long, is this essentially a 32 second moving average of the TIC, or is it some other function? I read briefly about averages of averages last night, but I'm not sure I understood the conclusion. This is all clean code so I may be over-complicating things, but I'm OK with that. When you serialize two averages you maintain the same time-constant of the average, but you get two 6 dB slopes on top of each other to form a 12 dB slope, while it is flat on the pass-band. You should be careful about use of averager inside the loop. A moving averager adds a zero in the loop, and you want to make sure you understand what that zero will do to the overall control-loop. Here you have two of them, as you run two average zeros in series. I prefer to use a PI or PID loop for such a control-loop, and potentially an exponential averager or two in there. If you make sure the exponential averager has a wide enough bandwidth, you can use standard PI dimensioning formulas, but achieve the tighter slope which the exponential averagers contribute to. NOTE: The reason I'm using 16 seconds is that I'm becoming memory limited. I'm switching to an 18F2320, but that only gets me more program memory. I'm constrained to this chip on an existing board. Exponential averger takes much less memory. Consider this code: x_avg = x_avg + (x - x_avg) * a_avg; Where a_avg is the time-constant control parameter. Cheers, Magnus ___ 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 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] Mains frequency
Yes the shapes of the waveforms for voltage and current, especially deviation from sinusoidal currents and phase shifts due to generation - transmission system - loads, are of great interest to the utilities in load planning. Of very great interest to the utility industry in the past decade, are the waveforms associated with various fault conditions, as these can be used to analyze the type of a failure and work around it - no purpose reclosing a breaker into a dead short, but reclosing into other kinds of faults can be fine. Looking at I and V in the area around the fault can allow this determination as well as help localize the fault from timing. This allows huge capacity and cost savings if done right - roll the truck to the right place on the 10 mile branch rather than search the entire 10 mile branch. The folks that sell these services and equipment, I know they advertise that they are doing fault analysis at way faster than the megasample/sec level. Also they care about synchronizing measurements taken at geographically diverse locations thus they care about accurate timing. But all the above is looking at details far finer than basic phase and frequency of the 60Hz fundamental that is the grid. The tau of 0.2 seconds that Tom mentions, is the ballpark a time nut cares about - anything above that is drift, anything below that is hash. On Wed, Mar 12, 2014 at 1:15 PM, Tom Knox act...@hotmail.com wrote: So we know there are deviations in line freq. But it seems strange in this era of very accurate and inexpensive freq references. How much is related to the generation? It seems in this era of switching supplies and other complex loads that even if the power were perfect at the generator the phase/freq could vary widely across the grid as different parts of the sine wave are loaded in a non linear fashion. And could a small digital signal be added to the smart grid that would control switching supplies to correct rather then degrade the grid signal? Thomas Knox Date: Wed, 12 Mar 2014 16:39:50 +0100 From: mag...@rubidium.dyndns.org To: time-nuts@febo.com Subject: Re: [time-nuts] Mains frequency Tom, On 18/11/13 23:15, Tom Van Baak wrote: Magnus, I'm going to push back a bit on your mains sampling claim. Mostly, I'd like to see the results of the professional I-Q demodulated gear that you mentioned. Can you post raw data, or a sample plot? I don't have much of that myself. I do recommend you to check the presentations of the NASPI conference (naspi.org). There is plenty of plots there. I agree that looking at power line voltage with 16- or 24-bits at 1 Msps is going to reveal interesting amplitude and phase noise information. But see how well a $1 PIC can do. Well, I should toss that over to the good folk at NIST doing synchrophasor calibrations. Should I grab them now that we are in the same room? Have a look at IEEE C37.118.1 for measurement methods. Attached is a plot made using TimeLab + picPET just now. The picPET is fast enough to capture the zero-crossing of every 60 Hz cycle with 400 ns resolution; the TimeLab plots have tau0 of 16.67 ms. -- The blue trace was simply plugging a 9 VAC wall-wart into the picPET though a 10k resistor. -- The pink trace was adding a 10 nF cap across the input. -- The green trace was unplugging my laptop switching power supply from the same outlet! -- The red trace is replacing the mains wall-wart with a hp 33120A set to 9VAC at 60 Hz, a tentative noise floor measurement of the picPET when used this way. My conclusions are that at least here in the US, or at least at my house, the short-term stability of mains hits about 5e-6, at about tau 0.2 seconds. The attached short-term plot is also not-inconsistent with the long-term plot at http://leapsecond.com/pages/mains/ My other conclusion is that the picPET (a simple PIC-based time-stamping counter) is doing a pretty good job measuring this. Note, no software or data filtering was used. This is just raw serial/USB data going into TimeLab. Well, if you are happy with that, fine. But there are many things happening on the grid which needs deep analysis and the tools for it has been developed to provide both resolution and removal of noise which is not part of the measurments. Just calibrating the trigger noise for a PMU requires care, as the S/N required for a straight comparator for the applications is several tens of dBs away from a good conditions, so they have had issues with doing that. Doing your own time-stamping like you have done is naturally fun, but do not confuse it with the experience and processing that have been shown needed by an industry. BTW. WECC, who has a large network of PMUs, and that covers where you have your house and measurement point, can't release detailed data to me or you just for fun. It always needs to be cleared from a security point of view.
Re: [time-nuts] Frequency Counter using OCXO and MCU
Analog Devices, Linear Technology and Maxim have fast comparators 73 Alex On 3/12/2014 11:02 AM, cfo wrote: On Wed, 12 Mar 2014 09:42:05 -0700, Chris Albertson wrote: There are logic level converter chip made for this purpose or you can use a comparator and compare the 5V clock to ground. Or just a diode to clip the sine wave. If you connect a code. Sometimes you can set buy with a pair of resisters wired as a voltage divider. I like the comparator best because it will not load the clock. Diodes will load it for other users. Could you come up with some part numbers please. Ie. witch comparator would handle 10Mhz CFO ___ 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 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] PLL Math Question
mag...@rubidium.dyndns.org said: Exponential averger takes much less memory. Consider this code: x_avg = x_avg + (x - x_avg) * a_avg; Where a_avg is the time-constant control parameter. Also note that if a_avg is a power of 2, you can do it all with shifts rather than multiplies. Note that the shift is to the right which drops bits. That suggests that you might want to work with x scaled relative to the raw data samples. Consider a_avg to be 1/8, or a shift right 3 bits. Suppose x_avg is 0 and you get a string of x samples of 2. The shift throws away the 2 so x_avg never changes. -- These are my opinions. I hate spam. ___ 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] Mains frequency
So we know there are deviations in line freq. But it seems strange in this era of very accurate and inexpensive freq references. How much is related to the generation? Controlling the line frequency is a giant PLL, with horrible complications. The simple setup for a big generator is that if you add load, the generator will slow down slightly. You can feed it more fuel to get it back up to speed. I think that part is classic PLL theory. Given the inertia of the generator and time delay around the loop, you can predict the response to a simple change in load, watch for instabilities and such. In the real world, there are at least two levels of complications. The first is that you are doing it with many generators rather than one. When load is added, you have to decide which generator(s) will work harder. The other nasty complication is that you want to do it as cheaply as possible as well as follow all the rules from regulators. One of the complications from regulators is a requirement to make clocks that depend on the line frequency keep good time. There was a proposal a while ago to remove that constraint. I think it got dropped, but I could easily have missed an interesting announcement. - Has anybody collected data from a typical few-KW portable generator? It would be interesting to see if interesting things happen if you turn some lights on/off at the right frequency. Here is the Aurora video: Staged cyber attack reveals vulnerability in power grid http://www.youtube.com/watch?v=fJyWngDco3g (1 min) -- These are my opinions. I hate spam. ___ 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] PLL Math Question
Hi Hal, In the moving averages I'm doing, I'm saving the last bit to be shifted out and if it's a 1 (i.e. 0.5) I increase the result by 1. Bob From: Hal Murray hmur...@megapathdsl.net To: Discussion of precise time and frequency measurement time-nuts@febo.com Cc: hmur...@megapathdsl.net Sent: Wednesday, March 12, 2014 2:25 PM Subject: Re: [time-nuts] PLL Math Question mag...@rubidium.dyndns.org said: Exponential averger takes much less memory. Consider this code: x_avg = x_avg + (x - x_avg) * a_avg; Where a_avg is the time-constant control parameter. Also note that if a_avg is a power of 2, you can do it all with shifts rather than multiplies. Note that the shift is to the right which drops bits. That suggests that you might want to work with x scaled relative to the raw data samples. Consider a_avg to be 1/8, or a shift right 3 bits. Suppose x_avg is 0 and you get a string of x samples of 2. The shift throws away the 2 so x_avg never changes. -- These are my opinions. I hate spam. ___ 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 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] Any Isotemp OCXO107-10 Info?
Sounds kind of like this oscillator. I found it to be very low power but it took about a week for it to really settle down and until then I was continually adjusting the EFC. http://i906.photobucket.com/albums/ac262/rjb1998/Oscillator_zps63a30a2f.jpg -Arthur ___ 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] Any Isotemp OCXO107-10 Info?
In message 1394653389.44185.yahoomail...@web122901.mail.ne1.yahoo.com, Arthur Dent writes: Sounds kind of like this oscillator. I found it to be very low power but it took about a week for it to really settle down and until then I was continually adjusting the EFC. The pinout looks the same. I'm not running this OCXO very often, but when I power it up I don't bother with EFC until it has settled for a couple of days, it's a very slow riser. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 p...@freebsd.org | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. ___ 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] HP 58503A acurate UTC time
HP 58503A Hi Hal Good point, I don't want the display lighting my office up at night, hence I often turn it off. What I really need is the circuit of the front panel, then I could dim the display and leave in on 24/7 Thanks Dave ___ 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] Any Isotemp OCXO107-10 Info?
Could be, but I didn't see a good picture of that oscillator. Here's the one I bought: http://www.ebay.com/itm/121264125456?orig_cvip=true Ed On 3/12/2014 1:43 PM, Arthur Dent wrote: Sounds kind of like this oscillator. I found it to be very low power but it took about a week for it to really settle down and until then I was continually adjusting the EFC. http://i906.photobucket.com/albums/ac262/rjb1998/Oscillator_zps63a30a2f.jpg -Arthur ___ 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] Any Isotemp OCXO107-10 Info?
In message 5320c644.4070...@sasktel.net, Ed Palmer writes: Could be, but I didn't see a good picture of that oscillator. Here's the one I bought: http://www.ebay.com/itm/121264125456?orig_cvip=true Looks exactly like mine. Good Bargain btw, the list price was north of $1k originally. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 p...@freebsd.org | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. ___ 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] PLL Math Question
x_avg = x_avg + (x - x_avg) * a_avg; Hi again Magnus, In fact, I just post-processed some data using that formula in perl. It looks great, and will indeed save me code and memory space. And, it can be a user variable, rather than hard-coded. Thanks for the heads up! Bob From: Magnus Danielson mag...@rubidium.dyndns.org To: time-nuts@febo.com Sent: Wednesday, March 12, 2014 12:51 PM Subject: Re: [time-nuts] PLL Math Question Bob, snip Exponential averger takes much less memory. Consider this code: x_avg = x_avg + (x - x_avg) * a_avg; Where a_avg is the time-constant control parameter. Cheers, Magnus ___ 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] Mains frequency
All: Some crude approximations. Generators that I know of do in fact have a negative slope of frequency versus load. This is deliberate, to enable stable load sharing.On small systems, you try to set the slopes proportional to load capacity so that load sharing remains proportional in the face of a step increase in load. The amount of load each machine carries is proportional to capacity in these systems if their no-load frequencies are equal before parallel. Once in parallel, the proportion can be adjusted in infinite combinations by adjusting governor (frequency setting) on the two machines. It gets much more complex in larger systems, but the fundamentals above are a good start in understanding. With networked automation, what I described above can be largely automated, as long as the system is stable. As an aside, similar situation exists with voltage versus reactive load. Increased reactive (usually inductive; large motors) load is seen as higher line current at the generator output, requiring increased excitation current in the generator field to overcome internal losses and maintain the same terminal voltage. This is what initiated the 2003 blackout in parts of the US Canada. A utility had a paucity of reactive generation on a day with large reactive load, and one of its generators tripped on over-excitation to prevent damage to the generator and voltage regulator. This initiated the cascading events that left many in the dark. (The Joint US/Canada task force on that event is a /fascinating/ read!) Relaxing frequency tolerance gives the system operators additional freedom in managing their systems in the face of rapidly changing load or generation. As the penetration of solar and, in particular wind, increases, managing this is becoming more difficult, so additional variation helps keep the grid on line. A 2007 US DOE report stated that to be stable, the grid needs some percentage of excess generation capacity over load, and stated at the time, the US had just UNDER that amount of excess, and projected construction was much less than projected load increase. That report predicted widespread and frequent rotating blackouts in the US by 2010, which obviously didn't happen, due to a /decrease/ in load, probably due to the combination of the economy and energy conservation efforts. Since then, large amounts of generation (primarily coal) has been shut down, so I was not at all surprised by the request. I missed the announcement that the request was withdrawn, and actually thought it had been approved and enacted -- all my line-frequency based clocks are now erratic and not very accurate. Hope this helps. Jim wb4...@amsat.org On 3/12/2014 3:23 PM, Hal Murray wrote: So we know there are deviations in line freq. But it seems strange in this era of very accurate and inexpensive freq references. How much is related to the generation? Controlling the line frequency is a giant PLL, with horrible complications. The simple setup for a big generator is that if you add load, the generator will slow down slightly. You can feed it more fuel to get it back up to speed. I think that part is classic PLL theory. Given the inertia of the generator and time delay around the loop, you can predict the response to a simple change in load, watch for instabilities and such. In the real world, there are at least two levels of complications. The first is that you are doing it with many generators rather than one. When load is added, you have to decide which generator(s) will work harder. The other nasty complication is that you want to do it as cheaply as possible as well as follow all the rules from regulators. One of the complications from regulators is a requirement to make clocks that depend on the line frequency keep good time. There was a proposal a while ago to remove that constraint. I think it got dropped, but I could easily have missed an interesting announcement. - Has anybody collected data from a typical few-KW portable generator? It would be interesting to see if interesting things happen if you turn some lights on/off at the right frequency. Here is the Aurora video: Staged cyber attack reveals vulnerability in power grid http://www.youtube.com/watch?v=fJyWngDco3g (1 min) --- This email is free from viruses and malware because avast! Antivirus protection is active. http://www.avast.com ___ 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] Any Isotemp OCXO107-10 Info?
The photo looks like one of the 2 units I have but the info on one if my oscillators says: CTS Knights 970-2074-0 5 Mhz 0410-2540 8947 I'm pretty sure the last numbers are the date code. If more than one company made these units they could have been in some piece of equipment made under military contact where they required a second source and/or spares. -Arthur ___ 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] PLL Math Question
b...@evoria.net said: In the moving averages I'm doing, I'm saving the last bit to be shifted out and if it's a 1 (i.e. 0.5) I increase the result by 1. That's just rounding up at an important place. It's probably a good idea, but doesn't cover the area I was trying to point out. Let me try again... Suppose you are doing: x_avg = x_avg + (x - x_avg) * a_avg; For exponential smoothing, a_avg will be a fraction. Let's pick a_avg to be 1/8. That's a right shift by 3 bits. I don't think there is anything magic about shifting, but that makes a particular case easy to spot and discuss. Suppose x_avg is 0 and x has been 0 for a while. Everything is stable. Now change x to 2. (x - x_avg) is 2, the shift kicks it off the edge, so x_avg doesn't change. (It went 2 bits off, so your round up doesn't catch it.) The response to small steps is to ignore them. If you have noisy data, things probably work out OK. If you need to process low level (very) low frequency changes (which seems desirable for a GPSDO) you probably want some fractional bits. For me, the easy way to do that is to use y = x * k Let's use k = 16, a 4 bit left shift. For the same step of x=2, y= 32, (y - y_avg) is 32, shifted right by 3 that's 4, so y_avg is 4. I'm sure this is all business-as-usual for the people who write control loops in small CPUs using fixed point arithmethic. Of course, you have to worry about shifting too far left (overflow) and things like that. If you have enough cycles, you can use floating point. :) -- These are my opinions. I hate spam. ___ 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] Any Isotemp OCXO107-10 Info?
It's hard to see in the picture, but my oscillator is labelled: 0410-2540 Model OCXO107-10 Freq 5.000 MHz S/N6396-40 Notice the same '0410-2540' line. So you're probably right. I wouldn't be surprised to find that Lucent had multiple sources for the oscillator and their part number for the oscillator was 0410-2540. By the way, mine is working. Frequency looks good - still moving, of course. Tuning range is good. I've got something like 200 Hz range on the EFC. Current drain is good at about 70 ma. I found a broken ferrite wirewound inductor on the oscillator board. I have no idea what the value is so I just had to throw in something to get it to work. My selection criteria was entirely scientific - magnetic core, lots of turns, and present in my junkbox! That may explain why the output level is only -5 dBm. I'll ovbiously have to revisit that. Ed On 3/12/2014 5:52 PM, Arthur Dent wrote: The photo looks like one of the 2 units I have but the info on one if my oscillators says: CTS Knights 970-2074-0 5 Mhz 0410-2540 8947 I'm pretty sure the last numbers are the date code. If more than one company made these units they could have been in some piece of equipment made under military contact where they required a second source and/or spares. -Arthur ___ 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] PLL Math Question
Hal says: For exponential smoothing, a_avg will be a fraction. Let's pick a_avg to be 1/8. That's a right shift by 3 bits. I don't think there is anything magic about shifting, but that makes a particular case easy to spot and discuss. Hi Hal, Yeah, I've been sitting here manually running some sample data and I haven't been happy with my efforts so far. I think I'll just stay with what I know for now: moving averages. I've got a number of places I can reduce memory usage when I run a bit shorter, so I think it'll work out. And I suspect I'm being far too conservative; i.e. averaging way too long If not, maybe there will be a good gain value that will be convenient to code the exponential average. Thanks for the help, Bob From: Hal Murray hmur...@megapathdsl.net To: Bob Stewart b...@evoria.net; Discussion of precise time and frequency measurement time-nuts@febo.com Cc: hmur...@megapathdsl.net Sent: Wednesday, March 12, 2014 10:08 PM Subject: Re: [time-nuts] PLL Math Question b...@evoria.net said: In the moving averages I'm doing, I'm saving the last bit to be shifted out and if it's a 1 (i.e. 0.5) I increase the result by 1. That's just rounding up at an important place. It's probably a good idea, but doesn't cover the area I was trying to point out. Let me try again... Suppose you are doing: x_avg = x_avg + (x - x_avg) * a_avg; For exponential smoothing, a_avg will be a fraction. Let's pick a_avg to be 1/8. That's a right shift by 3 bits. I don't think there is anything magic about shifting, but that makes a particular case easy to spot and discuss. Suppose x_avg is 0 and x has been 0 for a while. Everything is stable. Now change x to 2. (x - x_avg) is 2, the shift kicks it off the edge, so x_avg doesn't change. (It went 2 bits off, so your round up doesn't catch it.) The response to small steps is to ignore them. If you have noisy data, things probably work out OK. If you need to process low level (very) low frequency changes (which seems desirable for a GPSDO) you probably want some fractional bits. For me, the easy way to do that is to use y = x * k Let's use k = 16, a 4 bit left shift. For the same step of x=2, y= 32, (y - y_avg) is 32, shifted right by 3 that's 4, so y_avg is 4. I'm sure this is all business-as-usual for the people who write control loops in small CPUs using fixed point arithmethic. Of course, you have to worry about shifting too far left (overflow) and things like that. If you have enough cycles, you can use floating point. :) -- These are my opinions. I hate spam. ___ 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] PLL Math Question
This is a FIR x IIR question... moving average = FIR filter with all N coeficients equalling 1/N exponential average = using a simple rule to make an IIR filter Daniel Em 13/03/2014 00:55, Bob Stewart escreveu: Hal says: For exponential smoothing, a_avg will be a fraction. Let's pick a_avg to be 1/8. That's a right shift by 3 bits. I don't think there is anything magic about shifting, but that makes a particular case easy to spot and discuss. Hi Hal, Yeah, I've been sitting here manually running some sample data and I haven't been happy with my efforts so far. I think I'll just stay with what I know for now: moving averages. I've got a number of places I can reduce memory usage when I run a bit shorter, so I think it'll work out. And I suspect I'm being far too conservative; i.e. averaging way too long If not, maybe there will be a good gain value that will be convenient to code the exponential average. Thanks for the help, Bob From: Hal Murray hmur...@megapathdsl.net To: Bob Stewart b...@evoria.net; Discussion of precise time and frequency measurement time-nuts@febo.com Cc: hmur...@megapathdsl.net Sent: Wednesday, March 12, 2014 10:08 PM Subject: Re: [time-nuts] PLL Math Question b...@evoria.net said: In the moving averages I'm doing, I'm saving the last bit to be shifted out and if it's a 1 (i.e. 0.5) I increase the result by 1. That's just rounding up at an important place. It's probably a good idea, but doesn't cover the area I was trying to point out. Let me try again... Suppose you are doing: x_avg = x_avg + (x - x_avg) * a_avg; For exponential smoothing, a_avg will be a fraction. Let's pick a_avg to be 1/8. That's a right shift by 3 bits. I don't think there is anything magic about shifting, but that makes a particular case easy to spot and discuss. Suppose x_avg is 0 and x has been 0 for a while. Everything is stable. Now change x to 2. (x - x_avg) is 2, the shift kicks it off the edge, so x_avg doesn't change. (It went 2 bits off, so your round up doesn't catch it.) The response to small steps is to ignore them. If you have noisy data, things probably work out OK. If you need to process low level (very) low frequency changes (which seems desirable for a GPSDO) you probably want some fractional bits. For me, the easy way to do that is to use y = x * k Let's use k = 16, a 4 bit left shift. For the same step of x=2, y= 32, (y - y_avg) is 32, shifted right by 3 that's 4, so y_avg is 4. I'm sure this is all business-as-usual for the people who write control loops in small CPUs using fixed point arithmethic. Of course, you have to worry about shifting too far left (overflow) and things like that. If you have enough cycles, you can use floating point. :) -- These are my opinions. I hate spam. ___ 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 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] PLL Math Question
Hi Daniel, re: FIR vs IIR I'm not a DSP professional, though I do have an old Smiths, and I've read some of it. So, could you give me some idea what the FIR vs IIR question means on a practical level for this application? I can see that the MA is effective and easy to code, but takes up memory space I eventually may not have. Likewise, I can see that the EA is hard to code for the general case, but takes up little memory. Any thoughts would be appreciated unless this is straying too far from time-nuts territory. Bob From: Daniel Mendes dmend...@gmail.com To: Discussion of precise time and frequency measurement time-nuts@febo.com Sent: Wednesday, March 12, 2014 11:13 PM Subject: Re: [time-nuts] PLL Math Question This is a FIR x IIR question... moving average = FIR filter with all N coeficients equalling 1/N exponential average = using a simple rule to make an IIR filter Daniel ___ 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] PLL Math Question
On Wed, Mar 12, 2014 at 9:13 PM, Daniel Mendes dmend...@gmail.com wrote: This is a FIR x IIR question... moving average = FIR filter with all N coeficients equalling 1/N exponential average = using a simple rule to make an IIR filter Isn't his moving average just a convolution of the data with a box car function? That treats the last N samples equally and is likely not optimal. I think why he wants is a low pass filter. This method is like the hockey player who skates to where to puck was about 5 seconds ago. It is not the best way to play the game. He will in fact NEVER get to the puck if the puck is moving he is domed to chase it forever.. Same here you will never get there. But if you have a long time constant on the control loop you have in effect the kind of averaging you want, one that tosses out erratic noisy data. A PID controller uses only three memory locations and is likely the best solution. We have to define best. I'd define it as the error integrated over time is minimum. I think PiD gets you that and it is also easy to program and uses very little memory. Just three values (1) the error, (2) the total of all errors you've seen (in a perfect world this is zero because the positive and negative errors cancel) and (3) the rate of change in the error (is it getting bigger of smaller and how quickly?) Multiply each of those numbers by a constant and that is the correction to the output value. It's maybe 6 or 10 lines of C code. The magic is finding the right values for the constants. This is worth reading PIDforDummies.html http://www.csimn.com/CSI_pages/PIDforDummies.html -- Chris Albertson Redondo Beach, California ___ 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.