09/08/2016 at 03:22 •
It appears that I have more relays than I planned. Like, twice more. This makes me think about how to better use them...
More relays means the possibility of a more complex system, which remains to be determined. However the current design still must be completed because the critical electrical design elements are studied. I will probably make a smaller design, with 8 or 10 bits maybe... More relays for the larger design !
Any suggestion for the use of more relays ? I have a vague idea but it might still be too ambitious...
Meanwhile, I'll play with some of these relays with the kids, during the workshops :-)
20160910: The answers are now there : #AMBAP: A Modest Bitslice Architecture Proposal
05/12/2016 at 02:13 •
Since the project has been featured on this website, I have received questions, mostly concerning my sources for the parts.
The relays come from http://www.ebay.com/usr/alex550_2 in Ukraine. He's a very nice seller, who sometimes stuffed some empty space in the boxes with a few extras. He also sold me the 18KHz quartz resonators that are used in #Yet Another (Discrete) Clock. You can find him here too ! @qro_team
The miniature lamps come from eBay user minifux in Germany. Watch his items on the german site as many don't seem to appear anywhere else than http://www.ebay.de/sch/minifux1/m.html (He also has TONS of germanium parts that I use in #Clockwork germanium)
The DC/DC modules come from http://www.ebay.com/usr/exdwh
Yeah, eBay is pretty awesome :-)
Thank you guys !
05/09/2016 at 20:34 •
It didn't take long to find problems in the last diagram of Sequencer design
One is a stupid bug : the ring oscillator's output feeds itself and other relays. When the output relay is close, it feeds +Vcc to the capacitor and the other relays. But when it is open, the capacitor has more coils to drive and it empties faster...
A simple diode should solve this.
Now, this diode drops some voltage. I have tested the ring oscillator down to about 3.4V so 4.3V should be OK.
The clock output also feeds the pulse counter and the main CLK output. This last signal must be buffered through another relay, with the coil in series with the first counter's relay. I've added a lamp in series but I'm not sure it will actually change anything, or shine visibly. We'll see.
Fun fact : no freewheel diode is necessary because the overshoot will charge the ring oscillator's first capacitor. The changes are outlined in red.
The final counter stage is a more intricate problem, though.
05/08/2016 at 16:59 •
It's time to think more about the sequencial logic.
For a 16×16 bits mulitplication (or division), 32 clock pulses are necessary. In general 2N pulses are required to calculate the product of N-bits operands. What is the most efficient design that creates just the needed number of pulses ?
A cascade of DFF is easy to conceptualize. The operation mode is simple:
- Clear all the DFF
- Apply the clock pulses to all the DFF, their data input coming from the precedent DFF's data output. Except for the very first input which is tied to logic 1.
- When the pulses are sent, the shift register will be progressively filled with 1s
- The last DFF will indicate that the counter has expired when the 1 reaches the end of the cascade.
Cost: 2×2N relays, or 64 SPDT in our case...
This is a great enhancement to the previous system. The propagation of the 1s is recirculated after undergoing a logical inversion, which cuts the number of relays in half.
With 32 relays, 32 pulses can be generated before the state of the shift register is repeated. However the end of the cascade will see a change from 0 to 1 then back to 0. This last front must be detected with a "divide by two" circuit, adding 2 relays... so the total is 34 SPDT. Nicer but still not there...
Synchronous binary counter
In the spirit of Simon Winder's design, we can also use binary coding to create the counter. The number of gates/relays is reduced to O(log2(N)) but multiplying factors appear because there are 2×log2(N) DFF but also more gates to compute the next state, using an incrementer circuit. This circuit is described in the above video/link and in the below illustration coming from the ever useful Relay Trainer project page:
At 2 SPDT per bit, a 16-bits counter requires 4 stages × 4 SPDT => 16×SPDT.
That's better but... still not optimal.
This can be further reduced by using an asynchronous ripple counter, which is a cascade of "divide by two" circuits. It's one very simple circuit that is based on the D-flip-flop:
Now two things must be done:
- loop the data output back to the data input
- invert the value (exchange the 0V and 5V contacts) for the output relay.
This way, for each clock pulse, the relay will flip its state. This divides the clock frequency by two !
For 16 bits, the circuit must count from 0 to 15, so there are 2×4 SPDT relays in a cascade.
This is 8×SPDT. A last circuit is necessary to make this divider fully functional: a set-reset latch must control the start and stop conditions.
With 4 relays for the clock generation, and 10 relays for the counter, the total is 14 SPDT. The following version uses only 12:
When you press the Start button, it should generate 16 short pulses on the CLK output.
Erratum : the above circuit would only generate 8 pulses... I must redesign the set/reset latch. The last DFF stage is almost transparent/useless...
Update n°2: the above circuit needs a diode to isolate the capacitor discharge from the other coils, or the time constant will be reduced...
05/08/2016 at 05:24 •
I think I finally nailed it :-)
I have had difficulties with the concept of a relay ring oscillator because relays don't behave like transistors. With this kind of inverting gates, you just use odd numbers of gates with capacitors and that's it.
For relays it must be different. The trick is to use only one inverting gate (at the right) which is normally closed (N.C.). The others are non-inverting gates (N.O.) which add more delay.
It's going to be pretty clickety and remove concerns about bounces on the contacts. It can also control frequency and duty cycles easily, by adding more delay gates, making a more efficient overall design. For example it can generate a clock signal with 1/4 duty cycle, so the series lamp gets turned on during less time, consuming less and allowing faster operation.
Update (20160509): it works !
It is difficult to record the sound, I hope you can hear it.
With 3×(3300µF/22Ω), the clock period is around 600ms, or 1.6Hz, which is reasonable (not too fast, not too slow).
05/08/2016 at 03:10 •
I noticed only now some details I didn't see before: these 3V relays are rated for 150V 100mA max. (under which conditions ?)
Given that it takes 60mA to energise one coil, the amplification coefficient is barely 2 and the design expects more.
It was a good idea to connect coils in series wherever possible. Control signals still require a large fanout and I'll probably have to implement a 2-levels signal tree (with repeaters for each nibble or two).
Given the current handling, it would have been wiser to opt for a higher coil voltage, which reduces the required current, thus a better amplification factor.
That, and DPDT, will be considerations for a next version, if any !
05/06/2016 at 08:28 •
I replaced the resistor with one of the lamps and the result is pretty interesting, even though less reliable than with 10 Ohms.
The frequency is lower, like 3Hz instead of 13Hz. The lamp slows the charge down as it warms up, but the resistance increases with the temperature. It's a fragile balance and often the system gets stuck in micro-oscillations, due to bouncing.
Using the thermal delay is attractive because it is both "visually explicit" and takes less room. I'll be thinking about it while sleeping ;-)
05/06/2016 at 06:30 •
After some trials and errors, I've settled to this system:
3300µF was what I had easy access to, I wanted to make a ring oscillator so I looked for 3 identical high-valued electrolytic capacitors and they looked nice.
I get about 12Hz. The frequency is affected by the series resistor, which I had to reduce in order to keep a stable oscillation because it doesn't start up quiclky.
I initially started with a safe value of 47 Ohms because the coil is 35 Ohms but it didn't work well. It was a bit better at 22 but 10 Ohms keeps oscillating at 4V. The inrush current is in the order of 400mA... (coil dropped below 1V, Vcc=5V, I=(5-1)/10=0.4A)
Maybe I should add a lamp in series to keep it running ?
Anyway, with 10 Ohms, the charging pulse lasts about 10ms, with 65ms of discharge.
That's about 1/75ms=13Hz.
Zooming in the charging pulse, I can see strong ringing...
No wonder my frequency meter was confused !
More action on youtube:
20161107: Oh yeah, the inrush current is 4× the rated 100mA current... No wonder it doesn't work well.
I'm about to make a longer ring oscillator usign PBRL to test the endurance, this will limit the current and check the speed up to 50Hz...
05/06/2016 at 02:40 •
A new problem appeared... These relays don't like to oscillate !
I tried to do the circuit we discussed at How can I make a low-frequency oscillator with a relay (or more ?) and it didn't go as planned. The relay breaks pretty quickly, for an unknown reason (yet).
I wired one, it clicked once and then nothing. Maybe this is a quality problem so I changed it and made it vibrate a bit without capacitor. It made a little whine and it looked OK. Adding 330µF made it sound a bit weird but it only lasted a few seconds : the relay's contact is shut off now.
Maybe this is a problem with current limitation. This hypothesis can be tested by adding a resistor in series with the contact. I have to understand quickly because I've already broken 2 relays...
It seems that a larger capacitor, a 100nF cap across the contacts and a 47 Ohms resistor in series work. However the working voltage is too high (at the very least 5.5V) so I'm changing the design and I start a ring oscillator with 3300µF. This will allow me to tightly control the pulse lengths and sequencing.
05/06/2016 at 01:12 •
So I finally have time to test how a pair of relays behave when in series with one lamp.
There are many things to notice, most obviously that there is a strong hysteresis due to the contacts and the thermal capacity of the filament. Another thing I suspected is that all relays have their own threshold voltage and I'll have to build some "margin"...
Voff Von Relay1 6.73 7.47 Relay2 3.63 3.70
I wired the relays in series so I can't actually tell which one turns on, but they need 7.5V to both turn on, and < 3.6V to turn off (that's a ratio of 2).
But these measurements were done at a very low speed, giving the filament time to heat or cool. The relays both turn on at 4.4V when their coils are switched instantaneously. However you need to wait 2 seconds for the filament to cool, before applying another pulse that works again.
A capacitor in parallel with the lamp can increase the frequency but I must see what I have in stock. I don't have enough electrolytics, I hope ceramics will do.
It looks like 5V might be a decent working voltage, a good compromise between speed and availability of the PSU.
I see already that the control pulses must have a low duty cycles. This should reduce the time to heat the filament, so the latch masters' relays should be "normally" connected to the input, and transfer the capacitor's charge to the output during the short pulse. This is because the capacitor will take some time to charge through the resistor. OTOH it will discharge instantly through the coil of the slave relays.
Now I have to measure the toggling speed I can reach at 5V...