Homebrew, open source, repurposed, hacked, software defined, open hardware

Tuesday, 27 November 2012

IKEA mounting hole dimensions - In case you need to make a custom cabinet

I needed to build kitchen cabinets to fit within a fairly constrained set of dimensions and to match the oven profile at the front.

Why build rather than use a standard module?

There is a saying I first heard from a software developer named Frank Falco: "You can have it done properly, cheaply, or quickly. Pick two!"

The depth of the cabinet needed next to the oven would exceed the standard depth of a cupboard module, plus, the kickboard and profile of the oven needed to be matched, plus, there was plumbing that had to be worked around at the back of the cabinet for the espresso machine drip tray, plus, granite or concrete benchtops need very sturdy framing.

The benchtop would be granite, or cast and polished concrete, and could be made to match the front edge of the oven's range in terms of thickness and depth.

Framing and benchtops aren't too hard to make with routine woodworking tools, but making and finishing flat panel doors and panels can be difficult to do well (I think painting rots the brain), and then you have to select the (often expensive) drawer slides and hinges, and then learn what their mounting requirements are, tool up and do it properly.

I wanted it done properly and cheaply.

So, the solution was to use IKEA doors and drawers, including their mounting hardware in custom enclosures and framing. IKEA hardware also has nice adjustment features, to fine tune alignment.

The only problem was, what were the dimensions of the drawer slides, what was the minimum depth needed for the drawers, what mounting holes were needed, and at what spacing, and what thickness were the doors and drawer fronts?

I couldn't find anything on the net other than references to the standard 32mm European cabinetry system, which appeared to be different to IKEA's mounting hole dimensions.

In the end, I went ahead and bought some bits and pieces from IKEA, hoping for the best, and things worked out.

So, to

1) avoid having to find and decipher my scribbles at some point in the future if I need to do some more cupboards, and

2) help others trying to fit a custom cupboard into somewhere awkward in deciding if IKEA hardware will work in their situation

I have documented what I learnt and put it on the web.

Those planning to build something should glean all that they need to know from the photos. Don't blame me if something doesn't work out for you - IKEA might change things tomorrow, rendering my descriptions obsolete, or I might have made a few typos.

In summary, IKEA uses vertical rows of 32mm spaced 5mm mounting holes, about 26mm from the front face of the cupboard enclosure, and starting 44mm above the bottom surface of the cupboard enclosure. There is a second vertical row 300mm behind the first row, for mounting the drawer slides, also starting 44mm above the bottom surface of the cupboard enclosure.

Inside dimensions of the various cabinets are about 364mm, 464mm, and 564mm, to give overall outside dimensions of about 400mm, 500mm, and 600mm for the modules.

Minimum cabinet depth for drawers is 550mm, if soft closers are not used. Cabinet walls are 18mm thick, and door/drawer faces are 16mm thick, made of MDF in my case.

On to the photos.

First of all, for anyone contemplating construction of cupboards and drawers with IKEA kitchen hardware, there are some critical dimensions that need to be known.

1) Distance from the rear face of the door to the vertical mounting holes. I found 26mm to be a pretty good spacing. The hinges allow some adjustment. It should not be less than 25mm.



2) Distance from the bottom of the door to the hinge mounting holes. 44mm and 76mm (Given the 32mm spacing).



3) Minimum depth needed for an IKEA drawer is about 550mm. A bit more is needed if soft closers are attached to the rear of the drawer slides:


4) Distance to the drawer slide mounting hole. 26mm is about right.


5) The thickness of the drawer/door fronts = 16mm:



Overall, the most critical dimension is the height to the first 5mm mounting hole, from the bottom surface of the cupboard. I settled on 44mm. The vertical row of 32mm spaced holes should be no less than 25mm from the front face of the cupboard enclosure, against which the doors and drawers close. 26mm is better, as it gives you more leeway with door hinge adjustments. 27mm may be OK.




I bought a "CMT Universal Boring Jig" from www.carbatec.com.au to make the 5mm holes easier to drill at 32mm spacing, and because I had a lot of them to do. Nothing stops you doing it manually without a jig if you're careful, or if you only plan to do just enough holes for your specific door hardware.

It just so happened that a reversed pin placed (shown above in the photo as it would fall out due to gravity otherwise) under the jig in a 52mm door hinge hole gave a 44mm spacing for the first hole along the 32mm spaced holes, simplifying setup.

The jig has been designed with 25mm between the front face and the centre of the 32mm holes. I think 26mm works out a bit better with IKEA door hardware.


The boring attachment is then used with a 5mm wood drill.




Once a few 5mm holes have been drilled initially,



the clamp is augmented with the provided pins to ensure ongoing alignment while drilling.


Hmm, so far so good.:


The next step is to mark out the rear set of 32mm spaced mounting holes. These are used for drawer slides and are 300mm back from the front set:


Marked out and ready for the boring jig once more:


Rear set of holes done:


Door and drawer hardware test fitted:


Hmm, so far so good.

Here's a view of the panel. Note the use of dimensional lumbar, random scrap bits of wood, and flooring chipboard.


Here's the opposite panel which has had the same treatment


The top, sides and bottom ready for assembly:



Although the kickboard/base and custom woodwork still need painting, and the benchtop to match the adjacent oven is a work in progress, coffee was needed, so the IKEA door and drawer was fitted, and the espresso machine put into position: 


Whether you are refitting a kitchen, or fitting out your amateur radio operating room or hackerpsace, I hope this has been useful

Tuesday, 23 October 2012

Circuit bending with a kit built antenna analyser - or - maths meets chiptunes

For those of you wondering what that trigonometry you learnt in school has to do with circuit bending, read on....

Amplitude Modulation, as in AM radio, is a real world application of trigonometry, and AM radio has been with us for over 100 years.

Some of you may recall the trigonometric identity for multiplying two sinewaves.

Here is how this trigonometric identity can be used to modulate a hypothetical radio frequency carrier signal (a sine wave) with an audio tone (the information signal - also a sine wave):


So, we have shown mathematically how to amplitude modulate a radio wave carrier signal of amplitude A with an audio signal.

This results in the final equation with upper and lower sidebands of amplitude +1/2 and -1/2, and the carrier sine wave of amplitude A.

If we were to look at the results on a spectrum analyser, we would see something like this:


(Thanks to Wikipedia for the graphics)

From this diagram, it becomes obvious how the three terms of the equation arising from the original trigonometric identity relate to the lower sideband, upper sideband, and carrier in an AM broadcast.

In case you don't believe the mathematics, here's a sneak preview of what comes later... note the upper and lower sidebands (the vertical bars) on the spectrum scope and the central carrier shown on the kit built SDR cube receiver receiving a single AM audio tone centred on 1230.20kHz....



As an aside, if you have heard the term "lower sideband", "upper sideband", or perhaps "double sideband" transmission in amateur radio, these modes should make a bit more sense now - they are transmissions missing one or two of the above three terms to save on transmitter power.

So, how do we use this theory for circuit bending?

Simple, we use an existing LC oscillator generating a radio frequency (RF) carrier, and we then feed an audio tone into the early stages of the RF output amplifier, to modulate the amplitude of the final RF output.

A kit built VK5JST antenna analyser will serve nicely as a source of RF (from http://ahars.com.au/htm/jst_aerial_analyser_kit.html ) that can then be heard on an old school AM radio.




This VK5JST antenna analyser is a handy piece of test equipment which can serve as a source of RF from 1.3MHz to 31MHz (and sometimes more, i.e. 200khz to 50MHz, if you do the necessary mods...), usually used to tune antennas to resonance for your desired frequency range (a.k.a. band) of radio activities.

So, how do we circuit bend this source of RF into an AM chiptune transmitter?

Well, the antenna analyser uses a PicAXE microcontroller for frequency and SWR readout on an LCD display.

The software driving the frequency counter and analyser circuit is easily modified and uploaded to the analyser, making it an eminently hackable piece of benchtop test equipment...

It also just so happens that 28X1 and newer PicAXE chips can squirt an audio tone out, including RTTTL music formats, on a spare pin if asked nicely.

So, we have access to the software, which we can modify to add chiptune audio outputs, and we have a soldering iron, which we used to build the analyser in the first place, and we have access to the circuit diagram, so....

First, we install the optional serial port header, so that we can install cabling from the PCB to a stereo 3.5mm audio jack. This is done in keeping with the standard PicAXE convention of ground (tip), PicAXE serial data in (ring), and PicAXE serial out (shaft).





Having done so, we now have the ability to upload modified code to the analyser....

Next, we need to pick a spare pin on the pickaxe that we can use for the chiptune output. From perusal of the circuit diagram, found on the designer's website

( http://www.users.on.net/~endsodds/analsr.htm ):


We see that pin 21 is unused. It'll do.

Next, we need to decide which bit of the circuit to squirt the audio into, to amplitude modulate the RF signal generation portion of the analyser.

Perusal of the LC oscillator and subsequent buffer and amplifier portions of the circuit, we find a control loop feeding back to the Q5 transistor base connected to a 680 ohm resistor controlling oscillator output amplitude:


Somewhere around here should do.

First, we try jumpering a lead from pin 21 to the base of Q5, via a 1uF DC blocking capacitor and a current limiting resistor. Remember, this is a quick and dirty hack... but most circuit bending is. Although the hack is likely to affect phase and frequency stability a little, it shouldn't be noticeable with AM reception.

We start with an test audio tone of around 800 hertz, using a squarewave to mimic what the PicAXE will be providing in due course.

Here are pictures of a dual trace CRO (oscilloscope) showing the audio tone on the lower trace, and the AM modulated RF waveform on the upper trace.

Each picture shows the increasing modulation and increasing waveform distortion arising from reductions in the value of the series resistor going to Q5.




In the last CRO picture, we see over-modulation, and the RF waveform goes to zero for a proportion of each cycle. This confused the frequency counter in the antenna analyser and it reads low, so it's best to use a higher value resistor and to not overmodulate.

The modulation also appeared to be subject to the increasing correction by the AGC loop, and although the tone could be heard on a nearby radio, cleaner modulation was desirable in order to reduce "splatter" and harmonic generation.

To fix this, another approach was needed, and after contemplating various schemes, one requiring minimal modification of the PCB was chosen.

Here's the circuit:






The audio transformer had been gutted from a radio many years ago, as had the33nF capacitor, and these were used in conjunction with a 10k multi-turn potentiometer.


The effect of the potentiometer and capacitor was to form a voltage divider that directed current into the transformer at lower frequencies, but shunted higher frequencies straight to ground through the capacitor. This is also known as a low pass audio filter. This circuit could be interposed between ground and the 680 ohm resistor (also shown in the circuit diagram).

Here's the prototype:



The modulation improved a lot. See how it is much less "jagged":


And here's the circuit being patched into the analyser more permanently.
Note the red wire going to pin 21 of the PicAXE, and the shielded lead interposed between the groundplane and the "earthy" end of the 680 ohm resistor on the PCB. The keen eyed will also note the additional RF chokes added to the rotary switch during analyser kit construction giving extended frequency ranges to the analyser:



And finally, to complete the hack, additional code was added to the antenna analyser's PicAXE micro to make it play ring tone music, squirting the audio out on pin 21.

The resulting AM can be listened to on any old AM radio, in this case an FT817 which happened to be nearby:



In summary, we have used trigonometry to circuit bend a kit built antenna analyser into an AM radio transmitter, and we have even managed to Rickroll it while we were at it.

Here's the subroutine code. It expects a 16MHz clock, and may need slowing down for slower processors. Feel free to use it to rickroll anything with a PicAXE:

'***************
'  RICKROLLING
'***************

b1=1        'clear display
gosub wrins

b0=0
loop11:
lookup b0,("A RICKROLLED"),b1
b0=b0+1
gosub wrchr
if b0<12 then loop11
pause 3000        'display initial words for 1 second

b1=192        'LINE 2
gosub wrins

b0=0
loop12:
lookup b0,("VK5JST ANALYSER!"),b1
b0=b0+1
gosub wrchr
if b0<16 then loop12
pause 4000        'display initial words for 1 second
 
playitagainsam:

'Rickrolling  - uses B.0 which is pin 21 on the PicAXE, 16 is the speed
tune B.0,16,($47,$49,$50,$49,$14,$4C,$14,$4C,$02,$42,$0C,$4C,$47,$49,$50,$49,$12,$4C,$12,$4C,$10,$4B,$09,$49,$47,$49,$50,$49,$D0,$12,$0B,$09,$07,$47,$4C,$07,$D2,$C0,$00,$0C,$47,$49,$50,$49,$14,$4C,$14,$4C,$02,$42,$0C,$4C,$47,$49,$50,$49,$12,$4C,$12,$4C,$10,$4B,$09,$49)

PAUSE 6000
 
goto playitagainsam


It just goes to show, if you can't modify the software in the box, you don't own it....

And in case you think this is a pointless hack, we are just a few lines of code away from turning the antenna analyser into a Morse practice beacon, and just some pullup resistors on some remaining spare PicAXE pins from being able to use a Morse paddle to practice Morse code on any AM radio.....

For the AVR fans, there is nothing to stop similar mischief being perpetrated with an Arduino....

Wednesday, 5 September 2012

Fixing a sunbeam food processor triac - or - using electronics to impress significant others

The wife wanted to make Tiramisu.

As soon as the food processor was plugged in, it remained on at full speed until unplugged.

No speed control!! No on or off!! Tiramisu to be made!! Horror!!

Luckily, improvisation with a grater allowed the chocolate to be grated for the Tiramisu, but the mystery of the somewhat manic food processor remained.

There was of course the bigger problem of under-engineered appliances going into landfill after trivial, easily fixed breakdowns.

Before taking it part, we already knew that the food processor motor worked.

This ruled out a blown fuse, an armature or brush problem, or a blown winding in the motor, or a cold solder joint going open circuit.

The failure of the on or off and speed control switch to work did however suggest a problem with the speed selection and control circuitry.

For the impatient, the fix involved replacement of the BT137 triac and associated DB3 Diac, purchased for just a few dollars from the local electronics store.

For those interested in the gory details, read on:

Cautionary note

Disassembly is shown in stages.

Please note that the food processor is double insulated.

This means that there is no earth wire going to the appliance.

This means that if you are well insulated, have removed the enclosure of the food processor, and have it plugged into a power point, and poke around with a screw driver, you will probably put yourself between active and neutral, act as a large carbon resistor, and go into ventricular fibrillation, and your heart will stop producing useful output.

As blood ceases to be pumped, and you are slipping into unconciousness and death, you may smell burning flesh as the residual earth leakage detector so thoughtfully installed in your meter box fails to trip as you have not provided it an earth return (earth wire) to carry any leakage current. Your only hope of survivial at this point is you trip the circuit breaker by drawing more than 10 amps, or loss of bladder control trips the earth leakage breaker, or someone nearby manages to unplug and resuscitate you without electrocuting themselves.

Alternatively, don't work on it while it is plugged in and open. Having cautioned you about working on live appliances, we can move on.....

Disassembly

The unmolested food processor:


First, the utensil drawer must be removed to expose two screws:




This allows the motor lid to be carefully popped off, to expose the safety interlock assembly and another screw:


Note the pivoted toggle which is pressed onto a plastic split pin. This toggle transmits the interlock motion arising from the insertion of the food processing bowl to the safety interlock microswitches. The toggle has to be gently pried off its split pin and carefully extracted otherwise the upper shroud can't come off:


Now remove the remaining screw:



Next, the drive shaft sleeve must be removed. Identify the flush tab on the drive spindle, pop it out, and slide off the plastic spindle:





Next, remove the speed selection switch by carefully unclipping and prying it free: 



Next, unscrew the four rubber feet and all of the phillips head screws on the base, including the recessed one in the middle, and lift off the upper portion of the enclosure to expose the internals.

The motor assembly can be seen here, with its armature and carbon brushes in plain sight at the top.


The other side of the motor enclosure has the safety interlock microswitches, actuated by the arm moved by the toggle you removed earlier:


The safety interlock microswitches seemed fine, and this was to be expected given that the motor ran at full bore when the unit had been plugged in.

The drive train can be seen here, when lifting up the assembly off the baseplate:
 
 

The base plate:





The remaining side of the motor enclosure has the speed control PCB, connected to the overlying "switchboard" containing the speed selection rotary switch and "pulse" micro switch. The uppermost rotary position is unconnected and acts as an off position, as it provides no AC to the Diac, which turns on the Triac:



Some side on views of the "switchboard" and PCB stack show some of the interconnecting wiring between the PCB and switches:



This view shows the active and neutral feeds coming to the PCB, and the active and neutral power feeds going off to the motor. Given that the motor was working at full speed, this meant that the problem was somewhere in-between the "power in" pair, and the "power out to the motor" pair, on the speed control PCB:


After undoing two screws holding the switchboard/speed control PCB stack to the motor housing, a further two screws can be removed to separate the switching board from the speed control PCB. Here's a view of the underside of the PCB and the wires going to the rotary speed selection switch and "pulse" microswitch. The yellow wire going to the rotary switch is the feed going to the rotary arm, and the four white wires go the resistive divider networks on the PCB for the different speeds. The other two yellow wires go to the "pulse" switch, which bypasses the resistive dividers:


 Here's a view of the underside of the PCB, with red circles around the PCB pads of interest for desoldering, namely, the DB3 Diac and BT137 Triac pads:


Here's a view of the topside of the circuit board, showing the BT137 Triac in a TO-220 package (black with three legs and integral heatsink) and the DB3 Diac which is the small blue cylinder marked Diac on the PCB:


Troubleshooting

On inspection of the circuit it became apparent that the active M+ wire to the motor was commoned to the active line going into the PCB. The triac's job was to complete the motor winding circuit by connecting the neutral feed to the M- wire going to the motor.

Nothing looked charred or burnt, so no smoke had escaped. The diodes tested just fine as did the resistors on the multimeter. I did not bother testing the capacitors at this stage as their failure was not considered likely.

If the Triac had suffered an insult from a power spike, perhaps from some inductive load nearby on the same power circuit, or from the motor itself in the food processor, it may have failed in a short circuit or easily triggered fashion.

Testing resistance across the T1 and T2 terminals of the BT137 triac did not identify a short circuit, and was open circuit (i.e. infinite resistance). Gate to T1 measured about 20 ohms, and on diode test mode about 20mV. Gate to T2 was open circuit, as it should have been.

The Diac also was not shorted, and tested open circuit on the ohm meter.

Despite the essentially normal findings on multimeter testing of the Diac and Triac, subtle failure could not be ruled out in which a power spike had caused a very localised failure within the triac which might only manifest as having a very low trigger threshold, allowing it to turn itself on straight away, rather than be subject to control of turn on threshold via current into its gate from the diac and resistive divider based control circuit.

The BT137 Triac and DB3 Diac were replaced, the unit reassembled, and the motor was found to once again be subject to the control of the on off and speed selection dial. Success.

Ideally, a more robust Triac should have been used in the design as this fault appears to be quite common, judging by Google.

Some Triac and Diac Theory

Triacs and Diacs may seem a bit exotic and mysterious to those new to electronics.

Simply put, the Triac is a solid state switch that can conduct AC, and needs current on the gate to trigger conduction. Apart from the AC aspect, it's behaviour is analogous to that of a simple bipolar transistor.

Where it gets interesting is how to control power going to a load with a Triac, such as a dimmable bulb, electric element, or a universal motor.

With a sinusoidal waveform, one can decide where along this waveform the Triac is to be turned on. This can be thought of as the trigger voltage, or the phase angle along the sinusoidal AC waveform.

This allows a variable amount of power to be supplied, and in this case motor speed, depending on where along the AC waveform the Triac is turned on.

The Diac is really just a voltage triggered switch. Above a certain voltage it turns on, allowing current to flow into the Gate of the Triac, to which it is connected.



In the food processor's circuit, speed control is achieved by a set of resistive dividers selected by the rotary switch, applying a voltage to the Diac.

These determine the threshold, and therefore the point along the AC waveform, at which the Diac switches on, thereby allowing current into the Triac, turning it and by extension the motor, on.

The pulse switch bypasses the rotary switch divider network and lets the motor go full bore.

Triacs commonly fail due to voltage spikes from reactive loads, and are a good place to start in misbehaving small appliances. The Diac was easy to replace and replacing it along with the Triac seemed easier than disassembling again to replace the Diac in the event that Triac replacement did not fix the problem.

If you want to learn more, Google Triac and Diac. I found a very good Thyristor Seminar presentation pdf by NXP that can be found by googling which discusses the history, types and usage of Triacs.

As well as keeping otherwise useful appliances out of landfill, you can learn a lot by troubleshooting and fixing appliances that don't work.

Anyone wishing to use the repair pictures is free to do so with attribution if it helps people fix their appliance.