NCO based LED strobe light

Many turntables are equipped with a strobe light. The platter has marks that are illuminated by a pulsed light source. If the rotation speed is exactly such that the marks move exactly their step size in a time equal to the flash period, then the marks will appear to be stationary. This property is used to check disk rotation speed. Often the strobe lamp is powered by mains voltage, so mains frequency error will result in speed error. It is desirable to stabilize the frequency of the stroboscope with quartz.

When powered from the mains, the strobe lamp flashes 100 (50 Hz region) or 120 (60 Hz region) flashes per second. To obtain an accurate speed of 45 RPM or 78 RPM, it is impossible to find an acceptable integer number of marks. Therefore, these speeds are set approximately.

For the 50 Hz region:
Nominal speed: 33 1/3 RPM, real speed: 33 1/3 RPM, number of marks: 180
Nominal speed: 45 RPM, real speed: 45.113 RPM, number of marks: 133
Nominal speed: 78 RPM, real speed: 77.922 RPM, number of marks: 77

For the 60 Hz region:
Nominal speed: 33 1/3 RPM, real Speed: 33 1/3 RPM, number of marks: 216
Nominal speed: 45 RPM, real speed: 45.000 RPM, number of marks: 160
Nominal speed: 78 RPM, real speed: 78.261 RPM, number of marks: 92

To get an accurate value for any speed, it must be possible to fine-tune the flash rate of the strobe in small steps. All 3 sets of marks are not always applied to the platter. Sometimes there is only one set, then to check different speeds, you need to change the strobe frequency. All this requires some flexibility from the stroboscope.

The stroboscope is based on one of the smallest microcontrollers ATtiny12L. To generate the flash frequency of the LEDs, a software-implemented NCO (Numeric Controlled Oscillator) is used, which is usually one of the components of a direct digital synthesizer (DDS). This provides a frequency step of about 0.001 Hz, which allows any quartz to obtain any output frequency within this accuracy. This is an advantage of NCO over a simple divisor.

The stroboscope has the ability to generate 4 different frequencies, which are selected using the SEL0 and SEL1 inputs. Each of these frequencies is specified in the source text as a constant and can be any. The constants for the frequency code are calculated automatically. As the initial data, you must enter the desired speed with an accuracy of 0.001 rpm and the number of platter marks. For example, 50 Hz turntables typically have 180 marks for 33 1/3 RPM and 133 marks for 45 RPM. Based on this data, frequency codes are calculated at the compilation stage. For a speed of 33 1/3 RPM and a number of marks of 180, the LED frequency will be set to 100 Hz. And for a speed of 45 RPM and a number of marks of 133, the frequency will be set to 99.750 Hz, which will give a speed of exactly 45.000 RPM. The speed of 78 RPM can be checked on any set of marks, 180 will be set to 234 Hz, and 133 marks to 172.9 Hz.

#define FREQ_1 FREQ(33333, 180) ;preset 1
#define FREQ_2 FREQ(45000, 133) ;preset 2
#define FREQ_3 FREQ(78000, 180) ;preset 3
#define FREQ_4 FREQ(78000, 133) ;preset 4

In order for the marks to be sharp, the duration of the flashes must be short. The duty cycle of the LED flashes should be 4 ... 16, shorter flashes give a clearer picture of the stroboscopic marks. In the final version of the firmware, the duty cycle is set to 16.

There is another problem - the stroboscope can become a source of interference. A pulsed current flows through the stroboscope LEDs, and if the stroboscope power wires are long and close to the signal wires, interference may occur. Another possible cause of noise is that the LED supply current can create a pulsed voltage drop on the ground wire. For this reason, some turntables have the ability to turn off the strobe. To eliminate the problem of interference, it is desirable to localize the pulsed currents within the stroboscope board, and make the current consumption of the board as a whole constant. To obtain a constant current consumption, a current source is used, implemented on transistors VT1 and VT2. This current source charges the capacitors C6, C7, C8, from which the LEDs VD1 ... VD3 are powered. If the voltage on the capacitors exceeds a certain threshold (about 4 V), the parallel regulator U3 (TL431) turns on, ensuring a constant consumption even without working LEDs. The simulation graph shows that with a total LED pulse current of about 60 mA, the total consumption is about 16 mA, and it is constant.

The stroboscope board can be powered by an external voltage of 5 V. For versatility, a U1 stabilizer is installed on the board. As a result, any voltage within the range of 7 ... 20 V can be used for power supply. If there is a voltage of 5 V, the U1 stabilizer can be excluded.

The stroboscope printed circuit board is single-sided, 30 mm x 40 mm in size. In order not to drill any holes at all, all parts are soldered in the manner of SMD. Electrolytic capacitors are soldered with shortened and slightly bent leads to the pads. The programming pins are soldered as follows: first, the plastic moves up, the pins are soldered to the pads, then the plastic moves down again.

The convenience of this stroboscope design was confirmed during the repair of the Bang & Olufsen Beogram 2000 turntable. He has only one strobe scale, which contains 180 marks. There is no built-in strobe light. For a speed of 33 1/3 RPM, you can use, for example, a neon lamp powered by a mains frequency of 50 Hz. But how to check the speed of 45 RPM? With this strobe, it's simple - you can add the output frequency FREQ (45000, 180), which will give 135 Hz. The marks on the Beogram platter are very high quality, so it was possible to check how the duty cycle of the LED pulses affects the sharpness of the edges of the mark image. With a duty cycle of 4, the marks are quite blurry. With a duty cycle of 8, it gets better, with a duty cycle of 16, the image is close to ideal, a further increase in the duty cycle is not required. This duty cycle is set in the final version of the stroboscope firmware.

The stroboscope can be built into the turntable or made as an external device. In the second case, you can use, for example, a phone charger as a power source.
 

Attachments

  • strobe_sch.gif
    strobe_sch.gif
    22.2 KB · Views: 159
  • strobe_pcb.gif
    strobe_pcb.gif
    59.4 KB · Views: 146
  • strobe_pcb.jpg
    strobe_pcb.jpg
    92.3 KB · Views: 120
  • strobe_i.gif
    strobe_i.gif
    10.5 KB · Views: 127
  • aes_speed.gif
    aes_speed.gif
    52.1 KB · Views: 134
  • strobe_bang.jpg
    strobe_bang.jpg
    25 KB · Views: 155
  • strobe_pcb.zip
    strobe_pcb.zip
    115.3 KB · Views: 81
  • strobe_source.zip
    strobe_source.zip
    5.7 KB · Views: 93
  • Like
Reactions: alighiszem
The problem with DDS for this application (square wave w/variable duty cycle), the number of samples per 360° is not an integer value which can create jitter in the output waveform. For sinewave applications, this doesn't matter as the reconstruction filter will smooth out any anomalies.

I'm assuming you are using a 24bit NCO and a ~16.7 kHz master clock to give you 0.001 Hz resolution? That means at 234Hz, you will have ~70.94 samples/waveform which could produce a lot of jitter on the output waveform edges.

You may get more accurate results by varying the duty cycle slightly and using a fixed timer rate (using 4 MHz xtal, 250 nS instr cycle) :

For 100Hz: Duty Cycle=16:1, total ÷N=2500, actual freq=100.000Hz, RPM error=0 (33.333)
For 135Hz: Duty Cycle=17:1, total ÷N=1743, actual freq=134.9938Hz, RPM error=+0.002 (45.002)
For 234Hz: Duty Cycle=14:1, total ÷N=1221, actual freq=234.0002Hz, RPM error=-0.0001 (77.9999)

This essentially eliminates jitter and the frequency errors are negligible. It's also easier to code in assembly.

I like idea of the constant current source, very neat.

EDIT: I see from your .asm code, you are using a MCLK of 15.625kHz so you will only have 156.25/115.74/66.77 samples/waveform at 100/135/234 Hz (the further away from an integer value, the greater the jitter).
 
Last edited:
The problem with DDS for this application (square wave w/variable duty cycle), the number of samples per 360° is not an integer value which can create jitter in the output waveform.
Yes, jitter will be present. But it does not exceed 1 sample rate period. My NCO is running at a clock frequency of 4 MHz / 256 = 15.625 kHz. The period is 64 µs. The jitter will also have this value. In 64 µs, a turntable platter at 33 1/3 RPM will rotate 0.0128 degrees. I do not think that this will give any visible blur marks. And in practice it is not observed.
That means at 234Hz, you will have ~70.94 samples/waveform which could produce a lot of jitter on the output waveform edges.
It doesn't matter how many samples per period for a given frequency. Jitter will always be equal to one sample period.
 
If we want to reduce jitter, then there are reserves. The interrupt handler takes only 20 cycles, while its call period is 256 cycles. You can also increase the clock frequency of the microcontroller. I have another project - an NCO-based clock generator for capstan PLL systems of reel-to-reel tape recorders. There, the jitter is only 2 µs, which is less than the typical jitter of speed sensors.
 

Attachments

  • Quartz_sch.gif
    Quartz_sch.gif
    11.7 KB · Views: 87
  • Quartz_pcb.gif
    Quartz_pcb.gif
    24.6 KB · Views: 81
  • Quartz_view.jpg
    Quartz_view.jpg
    66.5 KB · Views: 83
  • fuses_tiny25.gif
    fuses_tiny25.gif
    21.1 KB · Views: 84
  • Quartz_pcb.zip
    Quartz_pcb.zip
    73.1 KB · Views: 75
  • Quartz_source.zip
    Quartz_source.zip
    6.7 KB · Views: 70