prec home dir suiv

CHOUR - Workshop Timing Machine (Chronocomparator) RM4


© Pascal Chour V1.0 - 2019-2022

img

Version française : img

Introduction

PC-RM4, vue d'ensemble

PC-RM4 is a workshop chronocomparator intended for setting mechanical watches.

The functions proposed by PC-RM4 are as follows:

Its accuracy is of the order of 25ns (it depends on the frequency chosen for the time base, the frequency used here is 40MHz) which allows a precision over 24 hours of the order of 0.02s at the precision of the time base close (we can count on 0.01%).

If you pratice electronics as an hobby, its production cost is around fifty euros, mainly due to the processor board (DevEBox) and the 320x280 pixel LCD screen. You can also use the printed circuit that I developed for about twenty euros (I provide with some mechanical elements such as the switch, the female jack socket, the RCA socket and the female battery holder which are soldered directly on the printed circuit board).

RELATED INFORMATION

Timing machine PC-RM1
Sensor for timing machine (in French)

USER MANUAL

Disclaimer: Some screenshots were taken with the 3.2" screen, 320x240 definition, others with the 3.5" screen, 480x320 definition. Obviously, the latter are prettier but do not be impressed. The 320x240 version looks much better in reality than in the photos.

Also, the texts are mainly in French but the language can be changed.

Hardware

From an external point of view, the chronocomparator looks like this :

When you connect a sensor to the Jack socket (switch in the "non-amplified signal" position), the chronocomparator amplifies the signal received (which generally comes from a piezo sensor) so as to be able to perform the measurements

The LED flashes according to the beats received. If it does not flash, it means that the amplification is insufficient (or that the sensor is not generating signals). If it flashes erratically, the amplification is too high. If it flashes regularly, the amplification is set correctly.

The gain of the amplification is adjusted by acting on the potentiometer.

Main features

The main features are:

These different functionalities are detailed below.

Ergonomic aspects

The different functionalities are offered through displays and inputs by touch buttons that have common characteristics:

Calibration TouchScreen

When first powered on, the device displays a touchScreen calibration screen. You exit this screen when the calibration is successful.

To calibrate the touchScreen, press the stylus on the crosses that are displayed. If the calibration is successful, you go directly to the home screen. Otherwise, the program asks for a calibration again.

Calibration data is stored in battery powered memory. If the battery is out of service, this data is not stored after the timing machine has been switched off. Its lifespan is several years.

Lors de la première mise sous tension, l'appareil affiche un écran de calibration du TouchScreen. On sort de cet écran lorsque le calibrage est réussi.

Pour calibrer le TouchScreen, il faut appuyer le stylet sur les croix qui sont affichées. Si le calibrage réussi, on passe directement à l'écran d'accueil. Sinon, le programme redemande une calibration.

Les données de calibration sont sauvegardée dans une mémoire alimentée par pile (modèle CR1220, sa durée de vie est de plusieurs années).

Once the calibration of the TouchScreen has been done, the following power-ups no longer propose this calibration screen.

image

Homepage

It is displayed for about 2 seconds. If this screen is pressed twice with the stylus during its display, the following screen will be that of the touchScreen calibration. Otherwise, we go to the beat selection screen.

The welcome screen displays:

Beat selection

image

This screen displays buttons indicating the possible beats for the watch to be set. The value selected by default is indicated by a button with a red background (that of the previous choice or the first value available if it is the first power-up). It also gives access to the screen for measuring the time parameters of the watch ("Measurement") and to a screen for setting the timing machine ("Param.").

To choose a beat, simply press one of the buttons displayed. Acknowledgment of the press is indicated by the button flashing (red-white) which then remains red.

Note that the last proposed beat can be configured (see "Param." button and configuration screen). It is indicated on a yellow background when it is not selected.

The selected value is kept in saved memory.

The "Simulation" button allows the timing machine to operate with an internal signal simulator. The measurements are then carried out on the basis of this simulator. The option is disabled by default.

Watch Time Parameters Measurement Screen

image

This screen displays:

The available commands are:

Some views of measurements. The first set of 3 photos are from a Lorsa 237B movement which needs a serious overhaul. The first photo represents the measurement while the movement is horizontal. The curve is characteristic of insufficient amplitude. During the second measurement, the movement is vertical and the time differences between Tick and Tock become too great for the display to be readable. You have to go to a resolution of 1000µs for it to be interpretable again (3rd photo). For information, the amplitude is 150°!.

image image image

The following series of two photos come from a new Chinese 2813 movement (automatic and date) which cost around €15 in 2019. For the first photo, the movement is horizontal. There is a small periodic irregularity which should be able to be resolved by simple cleaning in the best case. For the second photo, the movement is vertical. Accuracy improves slightly but we find the defect mentioned above. For information, the amplitude is 272°.

image image

Synchronization indicator

A synchronization indicator comprising the letter "S" is present at the bottom right of the time measurement screen. This indicator is colored green if the device is synchronized with the watch, orange if it synchronized synced but occasionally loses signals, or red when not synchronized. Synchronization takes place as follows:

Scope function

image

This screen displays:

Note on amplitude

The calculation of the amplitude is done by measuring the time between the first and the third pulse of a Tic or a Tac considering that there is a second pulse between the two (see Scope for more details).

The first pulse detected by the timer determines T1

T3 is the edge that corresponds to the highest amplitude in the measurement window (normally, T2 has a lower amplitude than T3).

The amplitude is calculated on a sliding average of successive measurements for the lift angle indicated in the configuration screen. This amplitude is very sensitive to weak shifts of T3-T1. To illustrate this point, here is a small numerical example:

The formula for calculating the amplitude is: Amplitude = (3600 * LeftAngle)/(T*Π*n) or T =|T1-T3| expressed in seconds, Π is the number Pi and n is the number of beats per hour. For this example, it is assumed that the watch beats 18,000 strokes per hour and that its angle of lift is 51°.

With 120µs, we can already have doubts that the movement is in its best condition. In practice, if you observe the beat of many watches, you will find that the triggering of T3 can vary well beyond 120µs compared to the best T3-T1 with the consequence of an average amplitude which will tend to be pessimistic. You just have to keep this point in mind when interpreting the value displayed by the chronocomparator.

Note on synchronization

image

To perform its measurements, the timing machine needs to detect the first edges of the signals generated by the ticks or tocks. When this is the case, the device is correctly synchronized.

As seen in the figure above, the signal is made up of a line of very low amplitude (framed by the two lines in blue) and peaks at periodic intervals.

To detect the first edge, the triggering of the synchronization must be done for a value higher than the low amplitude line. If the trigger threshold is at a lower value, the device will not be able to synchronize.

The low amplitude line is a more or less random noise that is produced by any electronic element. External noise can be added to this internal noise. For example, LED lights or other electrical equipment can generate noise that will be picked up by the conductive elements that make up the device, for example, its power cable or the cable that connects the sensor to the timing machine.

If the noise is too high, it can drown out the useful signal. In this case, any synchronization is impossible. The cause must be found and eliminated (for example, sometimes it is enough to turn off an LED light that is too close).

The scope function visualizes this noise like the rest of the signal and makes it possible to detect anything abnormal.

To improve synchronization, the program introduces an occultation window whose principle is as follows:

img

Suppose a certain Tic occurs at time T1. The next must occur at time T2 = T1 + duration of a half period.

The authorized measurement window is centered on T2. Pulses are only taken into account in the green zone. If a pulse occurs in the first zone shaded in red (before T2), it is ignored. If the pulse occurs beyond the green zone, it probably means that a signal has been lost. The chronocomparator ignores this data and tries to resynchronize itself on another pulse.

For a watch that beats at 18,000 beats per hour, the half-period (duration between a tick and a tock) is 200ms. If a blanking duration of 9/10 is chosen, the pulses will only be taken into account between T1+180ms and T1+220ms.

An occultation duration of 9/10 of the half-period makes it possible to eliminate parasitic phenomena.

Note on filters and sampling

The displayed signal comes from measurements that are made at regular time intervals, like on a digital oscilloscope. This means that certain phenomena may not appear if their duration is less than the sampling period.

Suppose the sampling is 50µs. This means that the device takes a measurement every 50µs. Between two measurements, any signals that may be present are simply not taken into account.

If a signal has a duration of more than 50µs, it will appear, sometimes as a single dash.

In a watch, it is unlikely that signals have a duration of less than 50µS. The orders of magnitude are rather of the order of a millisecond. However, this duration of 50µs varies according to the zoom used. If you want to view the signal over a long period (for example, 4 Tick or Tock), the signal displayed will represent a duration of 800ms for a watch that beats 18000 beats per hour. On a screen 360 pixels wide, each pixel will therefore represent 2ms what happens in the orders of magnitude of signals of short duration on a watch. There is therefore a greater risk of missing certain signals.

We could over-sample but at some point, it will be necessary to reduce all the measurements so that they can be displayed on a screen of a given definition. This reduction will have to be done via a processing which is in fact a filter. And the choice of a filter has a consequence on the graphic representation which is given of the signal and which may not have much to do with its real representation, such as one could see it on an analog oscilloscope for example. It is therefore necessary to say a few words about filters, their interest and their limits.

image image image

A filter is a process whose purpose is to highlight certain phenomena and/or to eliminate others. The result of the application of a filter to the raw signal therefore modifies the shape of this signal, sometimes in a very significant way. Let's take some examples:

There are all kinds of digital filter algorithms. But obviously, not all of them are applicable to a particular field.

In PC-RM4, 3 filters are offered at the date of writing this page (06/2022). Others may be added later if they prove useful.

The first filter (F0) is... the absence of processing (of filter). Finally, not quite since it is necessary to format the signal well so that it fits on the screen. And in practice, the (analog) amplifier has a band-pass filter function that eliminates low-frequency signals (typically those introduced by the mains) and high-frequency signals that have nothing to do with a watch. Nevertheless, we can consider that what is displayed on the screen is the most faithful representation of what the watch produces, except for the sampling frequency.

The second filter (F1) calculates a sliding average of each point of the signal and also performs a symmetrization (for a signal above the average value, we add its counterpart below the average value, and Conversely). Concretely, the filter tends to smooth the envelope of the signal curve and gives the most interesting visual results. It also eliminates a lot of background noise. On the other hand, as a result, a signal of low amplitude will risk disappearing from the display.

The third filter (F2) first applies the F1 filter and then performs the following processing (the explanation only considers the part of the signal above its average value):

This filter is particularly effective in highlighting T3 (and T2).

The fourth filter (F3) visualizes only the upper part of the signal compared to its average value (the lower part is brought back to the upper part). It favors the rising edges and applies an attenuation function to them on their falling part. It is not very interesting visually but can help in the identification of T1 and especially T3, and possibly, T2.

Simulation mode

In simulation mode, the timing machine generates the signal of a watch which has an offset of [+100µs, -110µs] around its half-period with small variations which vary between 10µs on either side.

This small variation results in a difference between the Tick and the Tock of about 180µs and a difference over the period which can vary between a little less than 10µs up to almost 2ms depending on the selected beat: the reason for this significant difference comes a side effect of the implementation. In simulation, the time for the period and the half-period of a beat is given in milliseconds (whereas in real measurement, the times are calculated in nanoseconds). Consider a beat of 19,800 beats per hour. The remainder of the division of 3600 by 19800, 0.181818181... The integer part of the half-period of the beat is therefore 181 in milliseconds but is worth 181181181 in ns. There is therefore a difference of 181181 ns which is not negligible compared to 24:00. This edge effect was considered interesting because it allows us to see how the display varies when a watch is very out of adjustment.

Depending on the setting (see "Settings"), it is possible to change the direction of the shift, which causes either an advance (the signal will move upwards by screen), or a delay (the signal will move down the screen).

Settings

Some parameters of the chronocomparator can be modified via the configuration screen:

To change a setting, just tap on it with the stylus.

Two output options are available: "Validate", the values entered are validated and saved in the saved memory, "Cancel", the values entered are ignored, the original values are not modified.

For values requiring numeric entry, the program displays a basic keyboard with a display that displays the current value of the parameter. The keyboard features:

image image

User language

The default language is French. English is also implemented. It is very simple to add another language (the texts are grouped together in a single place) but you have to recompile the program.

image image

Adjustment (calibration)

Like any measuring device, the chronocomparator may require calibration. In this case, it is necessary to determine the value to add or subtract from the time measured for a Tick or a Tock so that it is correct.

This value depends on several factors that cannot be determined in advance: quartz precision, signal transit time, etc.

To make the adjustment, you need to have a reliable time base. It can be:

Take a time measurement and note the difference (or average of the difference) from the expected time period. Suppose it is -90.0µs.

Go to the settings screen and enter this value in nanoseconds (complete with 0s). For -90.0µs, you would therefore enter -90000.

Validate the entry and redo the measurement. You should get a difference of 0.0µS. If so, the chronocomparator is calibrated.

The value is saved in permanent memory.

The default calibration value is -90000 which happens to be that of the PC-RM4 prototype.

What to do if...

The synchronization indicator is red. The front LED is always on or off.

Check that you have the sensor plugged in and that a working watch is on it.

Check that the sensitivity level is sufficient (adjustment by potentiometer).

Check that you have selected the correct beat.

You can check for the presence or absence of a signal as follows:

The synchronization indicator changes from red to green permanently. The LED on the front flashes irregularly.

Act on the sensitivity by decreasing or increasing it. A level that is too low means that certain signals will not be detected, causing synchronization to be lost. Conversely, too high a sensitivity can introduce spurious signals from the background noise.

Check that you have selected the correct beat. If in doubt, try several. Keep in mind that this may be a non-standard beat. The parameterization function allows you to enter non-standard beats.

In the time measurement screen, dots appear anywhere on the screen.

It is likely that the zoom is too high. Press the "-" key until the display shows a single line or two more or less parallel lines. As a reminder, the number displayed on the left of the screen in the graphic display area indicates the number of µs per pixel on the screen. If it displays 1000µs, it means one pixel represents 1ms. If it displays 1µs, one pixel represents 1µs. If at minimum zoom (100µs), the dots continue to appear anywhere on the screen, it is likely that you have a severely out of adjustment watch with a very large difference between the Tick and the Tock. The watch must first be serviced before attempting to adjust its rate.

In the time measurements screen, the trace of the rate of the watch is almost vertical.

You have a watch with a very high lead or lag. Look at the "F/S Day" value to convince yourself of this. Note that the trace will tend all the more towards the vertical as the zoom is high.

The amplitude values seem high.

At maximum zoom, if the signal moves a lot from right to left and from left to right, it is likely that the sensitivity is not sufficient. As a result, from time to time, the measurement is triggered on T1 and other times, on T2 or T3. Try increasing the sensitivity.

IMPLEMENTATION

Schéma bloc

The block diagram looks like this:

schéma bloc PC-RM4

Power supply

The device connects directly to the mains with earth connection. The power supply delivers a continuous voltage of 5V. The power consumption is around 170mA.

Computation module

The "computation, display, input" block is an STM32F407-based development board with a LCD TouchScreen screen. It is supplied with 5V DC (red on the diagram) and delivers a voltage of 3.3V (orange on the diagram) which is used to power other parts of the device.

Amplifier

This is a montage adapted from that proposed by the Watchoscope site. It uses a quad operational amplifier.

Logic

This block transforms the analog signal into a logic signal according to an automaton which is described later. It is made up of a double J/K flip-flop and is supplied with 3.3V (orange on the diagram).

Attenuator

It is comparable to a potentiometer intended to attenuate the output signal of the amplifier.

Overview

The non-amplified signal typically comes from a piezo sensor which reacts to the shocks generated by the ticks and tocks of the watch to be adjusted. This signal is very low in voltage and must be strongly amplified to be exploited.

You can also connect the sensor of an existing measuring device, such as the one associated with the Vibrograf, the Bandelin tickoprint or any equivalent device.

It should nevertheless be aware that the signals generated by these sensors have a higher voltage than those generated by the simple piezo sensor that I use. There is therefore a risk of saturating the amplifier's input signal. If this is the case, it will be necessary to add an adjustable resistor at the input in order to avoid saturation.

If you have an already amplified sensor, you can also connect it to the chronocomparator on the input provided. A contactor makes it possible to select either the output of the amplifier, or the signal already amplified as a source for the logic block which processes the signal.

For signals already amplified, care should be taken that the injected voltage does not exceed 3.3V.

The logic block is controlled by the processing module and delivers two signals making it possible to control the counting of the timers of the microcontroller.

The analog signal output from the attenuator is also supplied to the processing module for analog display of the signal (scope function) and is available on an output socket of the device to, for example, display it on an oscilloscope or the process on a computer via the "microphone" input.

Electronic schematic

schema PC-RM4
Click to enlarge

Amplifier

For the amplification of the signal from the piezo sensor, we can use the principle of the diagram proposed on the Watchoscope site with however some modifications. I used it for PC-RM1 and PC-RM3 and it works perfectly.

it uses a quadruple operational amplifier LM324 (U1).

Some explanations :

The others modification are more related to functional or situational aspects.

Logic circuit for counting

An internal clock of the processor (42 to 84 MHz) provides a clock AB1 which will supply 32-bit counters (TIM2 and TIM5) of the microcontroller, the counters being controlled by a control logic made around two flip-flops U3A and U3B controlled by the microcontroller . This is the main novelty of PC-RM4 compared to the previous PC-RM1 and PC-RM3 chronocomparators, the control of the counters is independent of the activity of the microcontroller.

U3 Microcontroller
U3A/Q (6)Counter 1PA0TIM2
U3B/Q (8)Counter 2PA1TIM5
U3AD (2)PA2
U3BD (12)PA3
ClockU3AC and U3BC
AnalogAnalog signalPA4Analog input

Microcontroller board

The microcontroller is a STM32F407 168MHz. The development board is a DevEBox.

DevEBox
DevEBox, front side

Display

The display used is a 3.2" TFT LCD Color MBR3205 320x240.

mbr3205

Sensor

The standard sensor uses a piezo module

img

This sensor can be put in a vice designed for repairing watches. With a little worke, it is also possible to make a suitable mechanism such as the one proposed on this page

img

PCB

At this point, you have two options :

Thereafter, I will detail only the realization based on printed circuit.

circuit imprimé PC-RM4
PCB components side

Assembly

Quelques informations sur le montage :

Here is a view of the assembled circuit (this is the prototype version, there are some corrections on the V1 printed circuit in the photo).

circuit imprimé PC-RM4 peuplé 1
PCB populated with the components

For resistors and capacitors, I took what I had in stock. The capacitors are oversized (35V operating voltage for chemicals, 63V to 100V for others). If you have to buy some, no need to take these fanciful values... The highest voltage on the circuit is 5V. You can therefore take 10V for the chemicals.

circuit imprimé PC-RM4 peuplé 2

Summary of components :

Ref schematic Ref. Qty Value
U1DIP-14_W7.62mm_LongPads1LM324
U2DeveBox STM32F4071DevEBox_STM32F407
U3DIP-14_W7.62mm_LongPads174HC74
Q2TO-92_Wide1BS170
D1,D2,D5,D6D_DO-35_SOD27_P7.62mm_Horizontal21N4148 or BAT85
LED1Standard model
C1C_Rect_L7.0mm_W2.0mm_P5.00mm11µF
C5,C8C_Rect_L7.0mm_W2.0mm_P5.00mm2470nF
C26,C9, C6CP_Radial_D5.0mm_P2.50mm2100µF 10V
C22,C28,C18,C16,C4,C2C_Rect_L7.0mm_W2.0mm_P5.00mm6100nF
C3,C7,C13C_Disc_D4.3mm_W1.9mm_P5.00mm3150pF
R1R_Axial_DIN0207_L6.3mm_D2.5mm_P2.54mm_Vertical1150kohms
R4,R8R_Axial_DIN0207_L6.3mm_D2.5mm_P2.54mm_Vertical22.2kohms
R11,R3,R17,R5,R2,R16R_Axial_DIN0207_L6.3mm_D2.5mm_P2.54mm_Vertical6100kohms
R9R_Axial_DIN0207_L6.3mm_D2.5mm_P2.54mm_Vertical147kohms
R6R_Axial_DIN0207_L6.3mm_D2.5mm_P2.54mm_Vertical11kohms
R14R_Axial_DIN0207_L6.3mm_D2.5mm_P2.54mm_Vertical16.8kohms
R15R_Axial_DIN0207_L6.3mm_D2.5mm_P2.54mm_Vertical133kohms
R25R_Axial_DIN0207_L6.3mm_D2.5mm_P2.54mm_Vertical1510 ohms or 270 ohms
P1Potentiometer log (piste B)110kohms B
J1Jack_3_5_PJ3161AudioJack2
J2DIN5 ou 31DIN 5 or 3 pins.
J6RCA1RCA
J10TerminalBlock_MetzConnect_Type101_RT01602HBWC_1x02_P5.08mm_Horizontal1
SW1SW_SS12F23_Angled1Switch SS12F23
F1Fuse:Fuseholder_TR5_Littelfuse_No560_No4601Fuse 200mA
BT1S8411-45R_11For CR1220 battery
Con. IDC234-pin female IDC connectors to connect the screen to the printed circuit via a cable.
Power switch1
HLK1Power supply Hi-Link HLK-PM01, 0,6A.

SOFTWARE LOAD

ST-LINK-V2

To load the software into the microcontroller, you will need an ST-LINK-V2 probe which is easily available for a few euros.

ST-LINK-V2

The connection of the probe to the microcontroller board is done as follows :

ST-LINK-V2 Microcontroller (J1)
SWCLKCLK or SWCLK according to marking
GNDGND
SWDIODIO or SWDIO according to marking
3,3VDO NOT CONNECT (unless you are powering the assembly through the probe).

ST Link Utility

You can check that you can communicate with your ST-Link probe and that it recognizes the development board. Launch the STM32 ST-LINK Utility which is normally available for download from the ST Microelectronics website.

Select "connect to the target". If you have an error, start by unplugging the probe from its USB port, reconnecting it and selecting "connect to the target" again. I'm assuming that the connection is successful (if not, I don't know).

The utility displays the following information (some depends on the probe, development board and when you make the connection).

StLink utility
Probe ST-Link V2

You can take advantage of the utility being launched to update the probe's firmware. To do this, it is best to unplug and reconnect the probe from its USB port. This done, select the ST-LINK option in the menu then firmware update and let yourself be guided.

Software to download

The latest version specific to the DevEBox board and the chosen screen is available here: (coming soon)

I also have other versions for the STM43F4VE board with parallel 320x240 screen or SPI bus 480x320 screen. Contact me for more details but these versions are not maintained.

ACCURACY AND PRECISION

The accuracy and precision of the device must be defined for the 3 measurements carried out:

The microcontroller board clock used has a resolution of 25ns. Its accuracy depends on that of quartz and is probably much less than 0.01%. We will call it P% thereafter. In this context, it can be said that:

To measure the advance/delay, the difference is taken between the sum of the durations of the Ticks and the Tocks measured and the expected duration. If NB is the number of measures of Tick and Tock, the difference with the expected duration is Deviation = sum (durations of Ticks and Tocks) - NB x duration of a period.

It is then sufficient to bring this value back to 24 hours to obtain the difference over 24 hours.

In the worst case, the measurement resolution accumulates in absolute value over the measurement period. If NB24 is the number of periods in 24 hours, then the lowest resolution bad is NB24* resolution. For a watch that beats at 18,000 beats per hour, this resolution is less than or equal to 18,000 x 24 x resolution of a measurement, i.e. approximately 21ms.

April 2019-September 2022

PROTOTYPES

The following photo is the back side of the printed circuit prototype. I had simply "forgotten" 3 tracks (naming error on the electronic diagram). PCB V1 corrects this point.

PC-RM4 PCB V0

The following photo is a prototype using another development board than DevEBox. It was used for all the developments that are described on this page in French) for those who want to go into the detail of the realization. The screen is also different. In this case, it is a 480x320 screen with SPI bus. I also developed the 320x280 version, parallel bus which is the one I use.

PC-RM4

PC-RM4

The following photos show an example of the prototype casing. It remains to put a small aluminum plate around the screen to make it look nicer.

PC-RM4

PC-RM4

PC-RM4

PC-RM4

PC-RM4

sommaire