A home built clock timing machine: What are the most needed features?

Discussion in 'Horological Tools' started by lmester, Apr 27, 2013.

  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. For the new NAWCC home page
    Click this image at the upper left corner of this page.
  1. lmester

    lmester Registered User
    NAWCC Member

    Dec 30, 2009
    446
    6
    18
    Male
    I manage HVAC systems for a school district.
    West Virginia
    Country Flag:
    Region Flag:
    I've been working on an electronic clock timing machine. Right now It just provides basic functions. It shows the beat time of a clock and the beat error. It also has a software moving average filter to give more stable readings. I also have added an adjustable retrigger or blanking delay.

    When I look at the specs of commercial machines like the Timegrapher or Microset I see that they have many functions. I'm certainly not going to try and duplicate all of the functions of these machines. I'd be writing code forever. Also, I'm primarily interested in clocks so I won't be needing any functions used only for watches.

    Do you have a clock timer? What are the features that you find most useful?

    I'm thinking of adding a beats per hour readout.

    Right now I'm controlling my timer with a serial terminal connected through a wireless bluetooth interface. It outputs data in CSV (Comma separated values) format.

    You use keyboard commands to change options like turning logging on or off and adjusting the retrigger delay. I'll eventually add some pushbuttons so that it can be run without being connected to a PC.


    So far I've found that logging the data to a file and then graphing the data is the most useful thing. I'm using a free program called KST for this.


    Would anyone be interested in building one of these? You'll need some electronics skills. If there is enough interest I'll do a schematic and other information needed to build it. If you have the skills to build it yourself this is a fairly inexpensive project. I only have about $30 worth of parts in it. Most of the cost is in the display and the bluetooth module.


    [video=youtube_share;tZRPY4SqQ0Q]http://youtu.be/tZRPY4SqQ0Q[/video]

    The first three pictures are the timer. The next two are an optical sensor and piezoelectric vibration sensor. The next two are graphs from a self winding clock. The first is raw data and the second is with a moving average filter applied. The glitch each hour is disturbance caused by the clock winding motor. The last picture is the serial terminal screen.
     

    Attached Files:

    eskmill likes this.
  2. eskmill

    eskmill Registered User
    NAWCC Fellow NAWCC Member

    Aug 24, 2000
    7,135
    28
    0
    Region Flag:
    I admire your skill, enthusiasm and abilities in going forward with your clock timer. I would like to have the abilities to make one but years ago, Bryan Mumford satisfied my needs.

    I obtained one of his very first productions and soon discovered that the MicroSet timer was, and still is in my view, "a tool of application." It didn't have beat count, it didn't really need it if the user could perform simple arithmetic calculations. For the curious mind, it is in many ways, an "extension of one's brain" when a repetitive motion needs to be measured by means of observing the interval between events.

    I still have the original MicroSet timer and use it very occasionally.

    Please continue your work and keep us informed of your progress.
     
  3. Tinker Dwight

    Tinker Dwight Registered User

    Oct 11, 2010
    13,666
    68
    0
    Calif. USA
    1.Various forms of cyclic sampling are handy.
    Such as relative sampling of individual teeth on the
    escapement wheel, relative to one particular tooth.
    2.Post processing of data with FFTs.
    Tinker Dwight
     
  4. soaringjoy

    soaringjoy Registered User

    Feb 12, 2009
    7,238
    22
    0
    Germany, North Rhine-Westphalia
    Country Flag:
    Region Flag:
    Thanks for posting your remarkable piece of work, kudos!

    Alas, I guess I'll have to slide this to Horo-Tools and I hope you'll get lots of adaquate responses there.
     
  5. Hudson

    Hudson Registered User
    NAWCC Member

    Jul 19, 2010
    192
    14
    18
    Retired
    Spicewood
    Country Flag:
    Region Flag:
    Luke,

    Hats off to you and your project. I would be interested in building one. I'll admit that without unit labels, I am unsure how to interpret the output of your prototype device.

    Beats per hour or beats per minute are very useful. A time based graph of beats over a short period of time would be helpful in evaluating an escapement.
     
  6. lmester

    lmester Registered User
    NAWCC Member

    Dec 30, 2009
    446
    6
    18
    Male
    I manage HVAC systems for a school district.
    West Virginia
    Country Flag:
    Region Flag:
    The readout is in seconds. The first line is the time taken for a beat. The clock being monitored has a .5 second beat or 7200 beats per hour. I'm actually sampling two beats and then taking the average.

    The second line is the beat error also in seconds. The sign of the number is so that you can get an idea of which beat is longer. I believe I have it set so that if even beats are longer the sign is positive. I'd have to check the code to be sure. In some of the graphs I can see the beat error flip when an extra noise spike is picked up. I've found that the beat error is not really useful unless you use the vibration sensor. With the optical sensor it's going to be off unless the sensor is placed right at the center of the pendulum arc. I may even remove this function if I find some more useful data to display. To check the beat of a clock all you really need are your ears. I just added this because it was easy to implement and only takes a few lines of code.

    The third line is the beat time with an IIR (Infinite Impulse Response) filter applied. This is used as a low pass filter to help get rid of noise in the data. I need to do more work on this. You can see from the data that it's not providing very much filtering.

    The fourth line of the display is just a clock. I have it there just as a reality check for my timing..

    Finally the "On/Off" Blinking in the lower right shows when the device has triggered. It's the same as the red LED on the board.

    You can see in the pictures that the display has 7 digits to the right of the decimal point. This gives .1 microsecond resolution. I'll probably drop off some of these digits. The software is using interrupts to handle the timing. This caused some unavoidable jitter in the readings. Once the software is finished I'll calculate how much jitter there is and drop off the unusable digits. It is also possible to write the code without using interrupts. Doing it without interrupts has it's own set of problems though.


    The windows software that I'm using to display the data allows you to zoom in on a plot. Attached are a 1 hour and two minute plot of my SWCC clock.

    Here is a link to the manual for the KST software that I'm using to create the plots.
    http://www.cita.utoronto.ca/~mamd/kst/handbook/#plotsandplotdialog
     

    Attached Files:

  7. David S

    David S Registered User
    NAWCC Member

    Dec 18, 2011
    7,194
    245
    63
    Male
    Professional Engineer - Retired
    Brockville, On Canada
    Country Flag:
    Region Flag:
    Luke I don't have a clock timer. However if I were to make one I would like a feature where I could keep track of how it strikes in a 24 hour period. I am working on a count wheel clock now. The count wheel only does one complete revolution in 24 hours, so the tooth and space patter on the wheel has to repeat twice. The 2 o'clock tooth is extremely narrow, so I can hit ok on the first sequence but can miss on the second if the second 2o'clock tooth is slightly out. It would be nice if I could leave it unattended and be able to record each strike and the number at each hour...If you understand what I mean.
     
  8. lmester

    lmester Registered User
    NAWCC Member

    Dec 30, 2009
    446
    6
    18
    Male
    I manage HVAC systems for a school district.
    West Virginia
    Country Flag:
    Region Flag:
    I'm now testing my timer with a slow beat 400 day clock. The ticking is so quiet that I had to use the optical sensor.
     

    Attached Files:

  9. David S

    David S Registered User
    NAWCC Member

    Dec 18, 2011
    7,194
    245
    63
    Male
    Professional Engineer - Retired
    Brockville, On Canada
    Country Flag:
    Region Flag:
    Luke bringing this back up. You asked for input, so I gave my feedback on post # 7. So besides being able to record and view what you are already suggesting, I would like to know it it could be modified to include the feature I mentioned.

    BTW I saw your plots in the repair forum... very nice.
     
  10. lmester

    lmester Registered User
    NAWCC Member

    Dec 30, 2009
    446
    6
    18
    Male
    I manage HVAC systems for a school district.
    West Virginia
    Country Flag:
    Region Flag:
    I've been thinking about this. You want to count the number of times that the clock strikes and record the time when the striking takes place? If that's what you want it would be very easy to code this.

    A display like:

    09:01:02 9 strikes detected.


    It's 9:00 and it struck nine times. Is this what you want? Of course you'll need to set the clock timer and the clock to the same time.

    I've had problems with count wheel clocks. You sync the time and strike and it seems to be working fine. The next day when I check it, the time and strike are out of sync. This would give you some idea of when the problem occurs without having to be there and check the clock every hour.


    I'll put this on the list of features to add. I might write the code this weekend.
     
  11. David S

    David S Registered User
    NAWCC Member

    Dec 18, 2011
    7,194
    245
    63
    Male
    Professional Engineer - Retired
    Brockville, On Canada
    Country Flag:
    Region Flag:
    Yes that sounds good, and also the half hour strike as well. Usually a passing strike isn't a problem but if from the count wheel or rake and snail it can.
     
  12. David S

    David S Registered User
    NAWCC Member

    Dec 18, 2011
    7,194
    245
    63
    Male
    Professional Engineer - Retired
    Brockville, On Canada
    Country Flag:
    Region Flag:
    Luke, how would you sense the striking? Normally on the bench I wouldn't have the gong attached. Optically sense the hammer rod? or ??
     
  13. lmester

    lmester Registered User
    NAWCC Member

    Dec 30, 2009
    446
    6
    18
    Male
    I manage HVAC systems for a school district.
    West Virginia
    Country Flag:
    Region Flag:
    I think either the optical or vibration sensor would work. Set the optical sensor so that the hammer rod breaks the light beam or set the vibration sensor so that the hammer taps it. The vibration sensor is sensitive enough that you could probably attach it anywhere on the movement and get a signal. I had this sensor connected to a self winding clock. It went nuts every hour when the clock winding motor ran. I'm still working on the software. When It's done I'll test both sensors.

    What I'm working on is to wait for the striking to start and count the strikes. I'll display the time and number of strikes. This should work for hourly strikes and would also show if a half hour strike happened.
     
  14. lmester

    lmester Registered User
    NAWCC Member

    Dec 30, 2009
    446
    6
    18
    Male
    I manage HVAC systems for a school district.
    West Virginia
    Country Flag:
    Region Flag:
    The strike count function is working. The vibration sensor is far too sensitive. I had to try several locations and find one where the level was low enough. You can see from the data that it picked up a few extra noises from the clock and counted them as a strike. The next time I have a striking movement out of it's case I'll test it again.


    Log is Off Time: 04:45:16 Trigger Delay is 70.
    Strike counter is On .
    Log is Off Time: 04:54:40 Trigger Delay is 70.
    Log is Off Time: 04:57:21 Trigger Delay is 70.
    Strike start time 05:00:02 5 Strike(s).
    Strike start time 05:11:30 1 Strike(s).
    Strike start time 05:29:55 1 Strike(s).
    Strike start time 06:00:03 6 Strike(s).
    Strike start time 06:30:01 1 Strike(s).
    Strike start time 06:54:16 1 Strike(s).
    Strike start time 07:00:01 7 Strike(s).
    Strike start time 07:30:07 1 Strike(s).
    Strike start time 08:00:12 8 Strike(s).
    Strike start time 08:29:59 1 Strike(s).
    Strike start time 09:00:06 9 Strike(s).
    Strike start time 09:30:01 1 Strike(s).
    Strike start time 10:00:06 10 Strike(s).
    Strike start time 10:30:01 1 Strike(s).
    Strike start time 11:00:10 11 Strike(s).
    Strike start time 11:13:33 1 Strike(s).
    Strike start time 11:30:00 1 Strike(s).
    Strike start time 12:00:07 12 Strike(s).
    Strike start time 12:30:03 1 Strike(s).
    Strike start time 01:00:00 1 Strike(s).
    Strike start time 01:29:48 1 Strike(s).
    Strike start time 02:00:02 2 Strike(s).
    Strike start time 02:29:44 1 Strike(s).
    Strike start time 02:59:57 3 Strike(s).
    Strike start time 03:29:47 1 Strike(s).
    Strike start time 04:00:05 4 Strike(s).
    Strike start time 04:29:56 1 Strike(s).
    Strike start time 05:00:05 5 Strike(s).
    Strike start time 05:29:45 1 Strike(s).
    Strike start time 05:59:59 6 Strike(s).
    Strike start time 06:30:00 1 Strike(s).
    Strike start time 07:00:04 7 Strike(s).
    Strike start time 07:30:01 1 Strike(s).


    I ended up opening the door and attaching the sensor there. I still had the sensitivity adjustment all of the way down. I may have to pick a better range of sensitivity. I now have it so that I can pick up the quiet ticking of a quartz clock. This causes problems with really loud noises like a strike.
     

    Attached Files:

  15. lmester

    lmester Registered User
    NAWCC Member

    Dec 30, 2009
    446
    6
    18
    Male
    I manage HVAC systems for a school district.
    West Virginia
    Country Flag:
    Region Flag:
    I'm making more progress with my clock timer.

    Clock rate counter:

    I'm working on a rate counter function to determine the correct beats per hour of a clock. Monitor the minute hand and start counting beats when it passes a sensor. End when it passes again and you have the beats per hour. This gives the correct beats per hour for the clock, not it's current rate.

    Beats per hour display:

    My timer currently only shows the rate as seconds per beat. I'm working on a beats per hour or beats per minute display option. It's easy to do the math on a calculator to convert from seconds per beat to beats per hour. With the chip and language that I'm using, I'm running into some large and complex floating point math code to do this.

    Temperature logging:

    I've been interested in monitoring the temperature related error of clocks. I added a temperature sensor so that along with the clock rate you can also log the current temperature. Probably not of interest for most people.



    I've also added some easy to code but less important tweaks like auto repeat for the push button switches, save current configuration to flash memory so that the timer retains your options when turned off and the ability to Turn off the LCD display backlight to save battery power. I may also add the option to turn off the bluetooth radio when it's not being used for data logging. The backlight and bluetooth use far more power than the rest of the device. Turning them off greatly increases the run time when using battery power.




    Also, I've had some requests to purchase either a complete clock timer or a kit of parts from me.

    I'm sorry to say that I'm not going to be selling this. A complete timer or a kit. This started as a project for my own use. I have no plans to create a commercial product out of this.

    Once I have the software closer to complete and debugged I'll be releasing it for free. I'll probably use the GPL license format.

    If you have some electronics skills you'll have no problem building my timer. It has only a few components. The parts are also not very expensive. About $30. If you enjoy electronics projects, It's a cheap way to get a clock timer.

    If you don't have any electronics skills I'd suggest that you buy a Timetrax or Microset timer. Several of the features that I have in my timer came from looking at the specs on those timers and then picking the ones that would be most useful to me and that don't require complex code to implement.
     
  16. praezis

    praezis Registered User

    Feb 11, 2008
    451
    23
    18
    Germany
    Country Flag:
    Region Flag:
    You don't need floating point math for that. With Assembler you can also use integer math, just make the numbers big enough first to get the needed resolution. 1,2, or more byte division algorithms you can find in the net.
    Regards,
    Frank
     
  17. lmester

    lmester Registered User
    NAWCC Member

    Dec 30, 2009
    446
    6
    18
    Male
    I manage HVAC systems for a school district.
    West Virginia
    Country Flag:
    Region Flag:
    That's how I'm currently coding this. The code uses 32 bit fixed point math. The timer has 100ns resolution. This gives a 10 digit decimal number for the calculations. Place the decimal point 7 digits to the left and the displayed value is in seconds.

    I have the rate of the clock R in seconds per beat. To get beats per hour take the constant 3600 divided by R. 3600 seconds stored as a 100ns resolution fixed point number is 36,000,000,000. I'd need 36 bit fixed point math to do this division. And, this would only give you the beats per hour to one beat resolution. To go to .1 beat per hour resolution you end up with 360,000,000,000. This pushes it up to 40 bit fixed point math.


    You can certainly do this with fixed point. As you can see, the numbers start getting very large.

    The other option would be floating point code. That would add a lot of code.

    There may be some other math tricks that might make this easier. Instead of 3600/N you can do 3600 * 1/N. The code for reciprocal and multiplication may work out easier.

    I'll keep studying this and eventually decide on what might be the easiest way for me to code it.

    I may just decide that when I'm using the timer and want to know beats per hour I'll just pick up my calculator and type in 3600/R :)

    I've been doing some testing of the temperature logging function. Here is a plot with the rate of a pendulum and the temperature. You can see a slight change in the rate as the temperature changes.

    ClockData3.jpg
     
  18. praezis

    praezis Registered User

    Feb 11, 2008
    451
    23
    18
    Germany
    Country Flag:
    Region Flag:
    You can make life easier if you multiply numbers with "2" instad of "10" and correct afterwards the same way. This will need simple bit-shifting only.

    But also consider that you may never get the exact beat numbers, as they can be rational numbers that are never ending in decimal format.

    Regards,
    Frank
     
  19. lmester

    lmester Registered User
    NAWCC Member

    Dec 30, 2009
    446
    6
    18
    Male
    I manage HVAC systems for a school district.
    West Virginia
    Country Flag:
    Region Flag:
    #19 lmester, Jan 24, 2014
    Last edited: Jan 24, 2014
    I spent some time working on this tonight. I now have the ability to display the rate as beats per minute or beats per hour. Once I started working on the code it turned out to be not as unpleasant as I expected.

    As you said, these readings won't be as precise as the seconds per beat that's taken directly from the hardware timer on the chip.

    That brings up another question. How much accuracy is really needed for the beats per hour or minute display?

    I looked through various documentation that has the beat rate for clock movements. The best that I've seen was to .001 BPM for some Hermle movements. I currently have my timer set to calculate and display that resolution. This feature of my timer would normally be used to adjust the rate to a value taken from documentation. I don't think that any more resolution would be necessary. Also I've found that for most movements the data is mostly noise once you go less than .001. You need to log and average the data over long periods of time to see anything finer. Not something you're going to do if you just want to get a typical quality mass produced movement regulated. The only thing that I have that does better is my free pendulum and of course a quartz clock movement.

    So, do you think a display with .001 resolution Ex. 3601.234 beats per hour is good enough?

    Here are some pics. I still need to modify the code to change the text to show what mode it's in. Sec. per beat, Beats per hour or Beats per minute.

    Clock Timer 006.jpg Clock Timer 007 (3).jpg
     
  20. praezis

    praezis Registered User

    Feb 11, 2008
    451
    23
    18
    Germany
    Country Flag:
    Region Flag:
    Hi,

    for rate adjustment only this is enough. Normally a resolution of 0.1 s/day will be ok. That means, 1: 860000. Higher resolution will become sort of esoteric.

    Regards,
    Frank
     
  21. Tinker Dwight

    Tinker Dwight Registered User

    Oct 11, 2010
    13,666
    68
    0
    Calif. USA
    #21 Tinker Dwight, Jan 26, 2014
    Last edited: Jan 26, 2014
    Ah! Luke
    I see what your using to time the x suspension.
    Are you planning to use an external reference. The
    crystal of a micro processor is not very accurate.
    Besides having a lot of phase noise, they are usually
    not tuned and also not kept in an oven to keep that
    tune.
    There are a lot of cheap GPS receivers now for these
    project micros. These often have a very accurate 1
    second pulse output that can be used to determine
    the drift of the uP's clock.
    Tinker Dwight
     
  22. praezis

    praezis Registered User

    Feb 11, 2008
    451
    23
    18
    Germany
    Country Flag:
    Region Flag:
    When timing clocks, there is absolutely no need of atomic clock accuracy! Why?

    - Clock rate during a limited measuring time is more or less different from its 24 hours rate.
    - If you want to adjust the clock by say 10 s/day faster, it doesn't matter if your quartz is absolutely correct or e.g. 1s/day off.
    - to determine the ratio between minute hand revolution and number of beats, i.e. determine beats / hour, no quartz accuracy at all is needed.

    Regards,
    Frank
     
  23. lmester

    lmester Registered User
    NAWCC Member

    Dec 30, 2009
    446
    6
    18
    Male
    I manage HVAC systems for a school district.
    West Virginia
    Country Flag:
    Region Flag:

    I have one of those cheap GPS's. I use it for calibration and testing of the timer. I don't have any plans to us the GPS as a permanent reference. It's really not needed and the GPS antenna needs to have a view of the sats. My timer is already far more accurate than is needed for most clocks. I may add an option to drop off the last four digits in the rate and beat error displays. For most of the mechanical clocks that I've tested anything smaller than millisecond resolution is just noise. I should post some of the test data. A crystal oscillator compared against a GPS reference signal. Really insane accuracy! long term stability around 10^-8 seconds!

    I'm not using a standard crystal on the uP clock. I'm using a temperature compensated oscillator module. Look up TCXO on Google. I wanted to be able to see temperature variations of clocks. Standard uP crystals have poor temperature stability.

    I'm currently working on a schematic and parts list for this timer. I should have it ready in a few days. I'll be posting it in this thread. If you have any electronics skills you should have no problem building one. It's only two chips and some passive components. Everything else is plug in modules such as the LCD display.
     
  24. lmester

    lmester Registered User
    NAWCC Member

    Dec 30, 2009
    446
    6
    18
    Male
    I manage HVAC systems for a school district.
    West Virginia
    Country Flag:
    Region Flag:
    My timer is working good and has basic features implemented.

    It's to the point where you might be interested in building one.

    I've put up a web site with information:

    http://mesterhome.com/timer/

    It's not yet finished. I'll be adding more construction info as time permits.
     

Share This Page