Close

Frequency Shifter - "Flashing Light Prize 2017"

A project log for Entries for the "Flashing Light Prize 2017"

"Flashing Light Prize 2017" is an informal & fun contest to make a light bulb flashing in the most craziest ways

rogeorgeRoGeorge 08/01/2017 at 01:352 Comments

This video is the one that was supposed to be the interesting one, but sent mostly as raw footage:

The project is made of 2 identical motors, each with 4 magnets on top, and a reed switch nearby. The 2 magnetic reed switches are in series with a light bulb and a battery. The motors rotate the magnets they have on top of their axle producing a rotating magnetic field.

When the motors are at the right distance from the switches, the reed contacts start to vibrate in the rhythm of the rotating magnetic field. Motors rotate very fast, probably around 2000 RPM.

The trick is that each motor has a slightly different RPM. The reed switches are in series, so they emulate a logic AND for the bulb. Boolean AND is the same as multiplication. Multiplying RPM1 and RPM2 corresponding frequencies will produce two spectral components with the frequency RPM1 + RPM2 and RPM1 - RPM2, because cos(x)cos(y)=1/2[cos(xy)+cos(x+y)]

As a result, the bulb filament will see two frequencies, RPM1 + RPM2, and another frequency RPM1 - RPM2. Because the filament has thermal inertia, it will act as a low pass filter, and it will attenuate the component of frequency RPM1 + RPM2.

On the contrary, RPM1 - RPM2 will be in the range of about 1 Hz, and the light bulb will flash in the rhythm of RPM1 - RPM2.

In the end, we managed to produce a 1 Hz oscillation started from 2 motors at about 2000 RPM.

Same technique as used in telecommunication for frequency shifting, frequency modulation, software define radios, etc., but applied to an incandescent light bulb with the help of 2 reed switches.

Discussions

Eric Hertz wrote 12/22/2018 at 23:53 point

Pretty slick!

So, if I understand correctly, the two switches are toggling at, say, 2000RPM/60= 33Hz and 34Hz, but since they are in series, they both have to be on simultaneously for the bulb to be powered. As I recall from physics, the "beat frequency" then is 34-33=1Hz... One time per second both switches are on simultaneously for one *half*-cycle (1/67th of a second) at the same time. But, in the cycles before and after that cycle, the two switches' activation will be slightly (and increasingly) misalinged, causing shorter pulses of current to the bulb in those cycles, causing it to dim. (a PWM duty-cycle decreases! 33.5Hz PWM, 0-50% duty-cycle, from magnets spinning on motors. Cool!) Then... at some point, half a second later, the two switches will activate completely out of phase, no current will flow, the duty-cycle is 0%, the bulb is off.

I dig it.

But, I'm not grasping the math... where's this higher frequency (33+34=67Hz) come from in relation to the switches? Shouldn't that be 33.5Hz? (Red and Green make Yellow, not Blue!). So I think I'm missing something...

"Boolean AND is the same as multiplication." ... Took me a minute, but ok, from the truth-table... 0*0=0, 0*1=0, 1*0=0, 1*1=1 and that's the same truth table as an AND gate.

"Multiplying RPM1 and RPM2 corresponding frequencies..."

Whoa, we're crossing domains I had no idea could be crossed...

"...will produce two spectral components"

(as in the fourier spectrum? Can that be applied where rectangular-waves are concerned?)

"with the frequency RPM1 + RPM2 and RPM1 - RPM2, because cos(x)cos(y)=1/2[cos(x−y)+cos(x+y)]"

Whoa. What'd I miss?! How'd we get into trigonometry [of/with booleans?] is that a thing?

This could be handy to have in my toolbox! What do I search for? ("boolean trigonometry" was a no-go)

Regardless of the math going over my head, this is quite cool. Physical-system PWM-generation. And, now that I think about it, very similar in concept to the indicator-system used to detect when two AC sources (e.g. generators) are synchronized and in-phase, ready to be connected in parallel.

  Are you sure? yes | no

RoGeorge wrote 01/06/2019 at 11:49 point

I was describing the project very loosely, the project was for an informal contest, just for the fun.

Let's put aside the PWM and square wave for a moment, and work with sine waveform only.

A sine wave can be written as A=cos(omega*t + fi), where 'A' is the amplitude at the given moment, 't', 'omega' is 2*PI*frequency, and 'fi' is the initial phase.  We don't want to play with the 'fi' here, so we can say it's zero (we want to simplify the formula, so we can go from 'A=cos(omega*t + fi)' to 'A=cos(x)' )

Let's take two sine waves with initial 'fi' zero.  In our example f_1 will be 33Hz and f_2 will be 34Hz:
A_1 = cos(2 * PI * f_1 * t)
A_2 = cos(2 * PI * f_2 * t)

We can make new notation, x and y, and say:
x = 2 * PI * f_1 * t
y = 2 * PI * f_2 * t

Now, or 33 and 34 Hz sine waves are written as
A_1 = cos(x)
A_2 = cos(y)

If we multiply our two 33 and 34 Hz signals, A_1 and A_2
A_1 * A_2 = cos(x) * cos(y)

But hey, we know that cos(x)cos(y) from trigonometry:
cos(x)cos(y) = 1/2[    cos(x−y)   +   cos(x+y)    ]

Note that on the right side of the above equality, there are two cos(something) functions.  Jumping back from math to the real world, a cos(something) means a sine wave for us, where the "something" denotes the frequency.

In words, the above formula from trigonometry applied to our sine waveforms reads like that:
- if we have two sine waveform signals of frequency f_1 and f_2, and multiply the two signals, we will get other two sine waveform signals, let's call them A_3 and A_4.  The frequency of A_3 fill be the difference between the initial frequencies (so 1 Hz), and A_4 will have the sum of the initial frequencies (so 67Hz).

.
If we agree on that one (mixing 33 and 34 Hz gives us in result two spectral components - as in Fourier - a 67 Hz and a 1 Hz) then we can go on and stretch the ideas further.

- any (square) waveform is a sum of many sine waveforms (as in Fourier).  For a square waveform, there is the fundamental frequency (i.e. f_1) and many odd harmonics.

- the energy of a square waveform will be spread between the fundamental and the harmonics.

- the fundamental (the switching frequency) is the biggest one in amplitude, the harmonics are smaller, so the most energy will go into the fundamental frequency.

- that is why I oversimplified the whole explanation using pure sine waves of 33 and 34 Hz instead of working with a square wave and a pulse width.

- in reality the whole spectrum will be a mess, way more complicated than two sine waves mixed together, but the main energy is distributed between the 1 Hz sinewave and the 67 Hz sinewave.

- the incandescent bulb have a big inertia (acts an an integrator) so we see the light softly pulsing as a sine waveform. The other 67 Hz sine and other higher frequency spectral components are "attenuated" by the thermal inertia of the bulb.

- to add even more confusion, for our example of 33 and 34 Hz, the light will pulse twice per period, so our 1 Hz will be seen as a 2 Hz pulsing bulb, one pulse for the positive upper side of the sine waveform, and one light pulse for the negative side of the 1 Hz sinewave.  What we see is the "energy" of the waveform, not the "amplitude".  The energy is proportional with the square of the amplitude of an oscillation. The square function (square as in A * A) not only multiplies the value for A, but also acts like a rectifier! ("Rectifier" as in: instead of a waveform with plus and minus, all the negative semi-sinewaves will be flipped on the positive side of the waveform's chart, somehow similar with what a diode bridge rectifier does for voltage)

.

Indeed, we jumped back and forth between math and physics using a very loosed language made of words, but sometimes is easier to think with words (concepts), than to think with math (formulas).

About the "boolean trigonometry", it is what we get when we work with words instead of math, and in the meantime think about physics, and on top of that oversimplify everything by considering only the most important chunk of energy, two sine waves of 33 and 34 Hz.

:o)

  Are you sure? yes | no