Tuesday, May 26, 2020

Stacked Log-Periodic - 5GHz

While playing with my milling machine and little microwave PCB Yagi antennas, I wondered about increasing the bandwidth and still getting directional gain.  A Log-Periodic antenna looks almost exactly, but not quite unlike a Yagi...

On a Log-Periodic, all the elements are driven, but each dipole is reversed by 180 degrees.  To make it on a single sided PCB, will require some links to wire up the dipoles.  I added a BNC connector and thin equilength coax to the feed points of the antennas.

Stacked Log-Periodic 5GHz

To reduce the amount of copper that needs to be milled out, I cut the board close to the radiators.  The bar at the back is for mounting and also serves as a reflective ground plane.  A log-periodic antenna is surprisingly compact and a little 5 dipole antenna will have a gain of about 3 dB.  By carefully stacking two of them 0.75 Lambda1 centre to centre, one should get another 2 to 3 dB of gain for a total forward gain of 5 to 6 dBi.

The important thing in radios is not the signal strength, but rather the Signal to Noise Ratio (SNR).  A directional antenna reduces multipath reflections and noise from the surroundings and improves the SNR, so that a radio will perform much better with a directional antenna, compared to a simple omni-directional dipole.

Antenna Calculator
Here is a decent log-periodic antenna designer:

Lowest frequency f1 = 4200 MHz
Highest frequency f = 5200 MHz
Diameter of the shortest element ⌀ = 3 mm 
Characteristic input impedance Zc_in = 50 Ω 
Taper τ = 0.901
Optimal relative spacing σo = 0.168 
Chosen relative spacing σ = 0.050

Number of elements ⌊N⌉ = 5 

Dipole element lengths:
dipole l1 = 0.036 m 
dipole l2 = 0.032 m 
dipole l3 = 0.029 m 
dipole l4 = 0.026 m 
dipole l5 = 0.024 m

Sum of all dipole lengths lo = 0.146 m Distances between the element centres and their position along the boom:
d1,2 = 0.004 m, i.e. l2 @ 0.004 m 
d2,3 = 0.003 m, i.e. l3 @ 0.007 m 
d3,4 = 0.003 m, i.e. l4 @ 0.010 m 
d4,5 = 0.003 m, i.e. l5 @ 0.012 m

Boom length L = 0.012 m
Length of the terminating stub l_Zterm = 0.009 m 
Required characteristic impedance of the feeder connecting the elements Zc_feed = 4.8 Ω

An antenna this complex, really should be built on double sided board, for best performance, but I managed to get the prototype together with 22 SWG hookup wire and RG316.

Log-Periodic Wired Up

If you look closely, you can see the hookup wire links under the coax.

Performance Graphs
Considering how it was built, this is not too bad.  It needs a balun to clean up the VSWR ripples.

Log-Periodic - Return Loss

Log-Periodic - VSWR

Log-Periodic - Smith Chart

Design Issues
The graphs show that this a viable antenna and the match is a good 53 Ohm at the centre frequency of 4518 MHz.

When I designed this antenna, I spent much time trying to get the elements done right in the KiCAD footprint editor and Flatcam, so it can be cut out successfully with a 0.8 mm end mill.  However, I did not think enough about how to wire it up and the feed point is not designed for hooking up with unbalanced coax.

The unbalanced feeds cause large VSWR variations, which are very visible in the VSWR and Return Loss graphs.  An infinite balun made with ferrite beads will not work well at 5 GHz (Ferrites falter at about 2 GHz), so I need to change the feed points to match with unbalanced feed lines.  I also need to get some thin coax, which will be easier to hook up than RG316.  I think there is some thin WiFi antenna U.FL pigtails somewhere in a dark corner of my Junque Bochs - it will take a day of archeological digging to find it.

This test unit is a single sided board design, which requires wire links and there is no way to make microstriplines, since there is no ground plane, so for the next try, there are multiple reasons to go double sided.

I would also like to shift the centre frequency up by 200 MHz to about 5700 MHz, therefore the elements need to be 9% smaller, which makes it even more important to find some thin coaxial cable.

La Voila!


Thursday, April 9, 2020

Radios and Attenuators

When you need to test two radios in a lab, they are awfully close together and may not work over the air, since the transmitter will overdrive and saturate the receiver.  You may even damage the receiver since the radio front end is very sensitive and the transistor features are extremely small.  If you would accidentally touch the antennas of two radios together, you could instantly melt the receiver front end.

DIY 90 dB(?) Attenuator

To avoid this melt-down problem, military manpack radios are usually built with power transistors on the front end - the same ones used in the power amplifier.  Since power transistors are expensive, commercial radios are usually not so rugged.

Path Loss
If your transmitter operates at +30 dBm (1 Watt) and the receiver has a sensitivity of -90 dBm (1 nano Watt), then to work properly, you need a path loss of 80 to 90 dB, to bring the transmit signal down to a safe level of about -60 dBm.

You can then hook the two radios back to back, with coaxial cables through the 90 dB attenuator, without risk of blowing anything up.

One trick, is to hook both radios to 50 Ohm dummy loads.  They will then usually still work over the air for a few meters in a lab, due to leakage signals.  A wireless connection like this can be handy for software tests, since you don't need to run a cable over the table/floor, but it is not repeatable for accurate RF tests.

Therefore, every radio shack needs one or two attenuators and dummy loads.  If you go and look at the prices of these things on Pasternack, or Everything RF, you will see that they can be horribly expensive.  You may be tempted to build one, but building a good one from little SMD coils and capacitors that will work at microwave frequencies, is difficult.  Well, maybe not...

DIY Attenuator
The above picture shows my 90 dB attenuator, made from three 30 dB attenuator pads, that one can buy on AliExpress Bokon Store for about $4 each, or from Everything RF for a few bucks more.  So you can 'crook' and not actually build a T or Pi circuit - buy it as a little module and save yourself a whole lot of hassle and money.

Just solder three in series, add two connectors and an aluminium box for shielding and heat dissipation and Bob's Your Uncle?  No, not exactly...

Minus 50 dB Attenuator

To get - 90 dB attenuation is very difficult in practice, due to leakage from the input to the output, inside the box.  My first attempt came in at about -46 dB attention. I eventually got it up to about -60 dB, with careful routing of the little coaxial cables and some copper tape inside the box.

To Measure, is to Know (sorta kinda):
When I plug two RG58U cables into my little network analyzer and leave the ends open, it measures -80 dB.  So with the cables I got, I cannot measure -90 dB.  I would have to get double/triple screened coaxial cables to really know what the attenuation of this little box is, since what I measure, is the attenuator and cable leakage in parallel.

To actually measure this attenuator, I would need to build two and hook them up in parallel, then measure, so that I measure a lower value more within the capabilities of my test setup.

Dummy Loads
I have in the past made quite a few crude dummy loads from 50 Ohm 10 Watt wire-wound resistors soldered to a BNC/TNC connector.  Some radios are OK with that, but some may not like it, since a wire-wound resistor is very inductive.

50 Ohm Dummy Loads on PCB

You can also get 50 Ohm thick film resistors that look much the same as the attenuator pads, to make accurate dummy loads that are not inductive.  Screw one inside a little box with one connector and there you are.  If it is an open construction like this, then they will radiate a little, which is sometimes useful.  The small piece of scrap PCB acts as a heat sink - good for a few Watts.

It is Time, Gentlemen
One thing you got to remember though, is that an attenuator doesn't provide a time delay.  The speed of light is very fast, but not infinite.  Some radio modem protocols (WiFi) assume a turn-around time of a few nano seconds that may work in a lab - but not in real life over long distance.  This is why long range WiFi radio modules have adjustable turn-around timers, so that you can configure it for 100 to 200 km range.

La Voila!


Saturday, March 28, 2020

PCB Mill

PCB Mill Kit
My latest toy is a small PCB Mill, a CNC 3018 Pro, there are many available from Ali Express for the enormous sum of 285 Dirhams or so, which is about 70 Euro.  I thought that even if it didn't work at all, it would not be a big loss.

Assembled CNC 3018 Kit

It will help if you have a little previous workshop experience, but these machines are so simple and relatively slow moving, that any radio-geek can safely experiment.

Carving With a V-bit in a Puddle of Oil

Of course I can have boards made in China by Dirty PCBs, but what is the fun in that?

The problem with making PCB antennas, is that you need to experiment to change the design 1 mm this way or that, to tune it just so and just such and having to wait 2 weeks for each experiment doesn't work.  A few hours playing with a router is more practical.

It turned out to be a pretty nice little kit, made from aluminium and 1/4 inch Bakelite (paper reinforced phenol formaldehyde).  This Prehistoric Olde Fashioned Thermoset Composite is actually pretty good - very strong and stiff.  Assembling the kit was not difficult, but it requires some patience and one has to look ahead to see which nuts need to be slotted into the aluminium pieces for future use, before you bolt them together.  It is also a good idea to put a tiny drop of Locktite on the tips of all bolts, so they don't come undone under vibration (use a wooden tooth pick to apply a very small amount).

Many people don't understand how Loctite/Spring Washers work and why they are very important.  A bolt and nut is normally under tension, with the screw thread pressing together on one side only.  Under vibration, the screw can bounce and become momentarily completely loose, not touching either side of the thread.  Under this floating condition, the bolt can turn very easily.  This effect is used by an Impact Driver.  While the bolt can then turn left or right, Murphy's Law says that it will always turn left (Righty tighty, lefty loosy) and after a while you have little nuts and bolts rolling on the floor.  Purple Loctite 222 is a weak rubber glue that prevents the bolt from turning easily, but it is not so strong that you can never get it apart again.

Use calipers and a triangle to square the machine up as well as you can and once assembled, add a little bit of grease to the slides and worm screws so it will slide smoothly.

Note the anti-backlash springs on the worm screws.  These keep the system locked to one side of the screw thread.  If you stress the machine, then the spring may move and you may get backlash.  You can observe that as a visible jump on the tool tip when it exits a cut into already cut space.  Obviously if you see that, the results will be quite horrible - so slow down - get a mug of coffee and relax.

The step motors are small and there are no end stop switches.  When the mechanism hits the end, the motor magnetic fields will simply slip, which will make a clucking noise.  Don't worry about it - you don't need to add switches.  There is no mechanical wear when a step motor magnetic field slips.

I found only two problems:
a. Two of the three stepper motors rotated the wrong way.
b. The DC barrel plug of the PSU was the wrong size and didn't fit into the socket on the board.

The X and Z axis stepper direction can be reversed using the included GRBL Control software, but I could not find an old enough computer that it would run on (It requires an ancient niche OS called Windows, which was very popular in the previous century), so I cut and reversed the step motor Red/Blue wire pairs instead (reverse only one coil on each motor, else you are back to where you started from).

I could not find a bigger barrel plug in my Junque Bochs and one cannot easily replace the power socket without damaging the board, since it connects to the ground plane (which conducts the heat of a soldering iron away).  I could take the board to my work factory and ask a technician to replace it using an infrared rework machine, but thanks to the Corona virus hullabaloo, I'm stuck at home.  I therefore soldered a pair of wires to the underside of the controller board and fitted an inline socket instead - gut enuff.

Machine Controller
The next problem with these toys is finding usable software to control it with.  I expected this to be a hassle, since I mostly work on a MacBook.  My PCB design software of choice is KiCAD on a Fedora Linux virtual machine.  Hooking Linux via the Mac host USB port to the CNC machine would be very painful and I don't want my Mac to sit in the dust next to the mill - MacBook keyboards do not like dirt.

BTW, the CNC 3018 machine is small enough that one can put a large transparent plastic tote over it to contain the dust and debris.  You don't have to make a special box - just buy one at Carrefour or Ace HW.

I sidestepped the software issues, by ordering a model that includes a little offline controller.  This controller accepts a SD card, so that one can load it with a GRBL file, adjust it to the 0, 0, 0 position manually by rotating the lead screws (Rotate the lead screws when the power is off - best to use white grease or you will get black fingers) and let it go without any further ado.  The only problem then is converting a PCB Gerber file into a CNC GRBL file, which can be done with FlatCAM on Linux.

If you want to be seriously fancy, then you could run GRBL-Web on a Raspberry Pi and access the little CNC machine over your home LAN/WiFi : https://www.instructables.com/id/Control-your-CNC-over-Wi-Fi/

Note that the first time you try it out, it is best to machine something soft, like balsa wood or construction foam, so that if the feed rates are wrong, the machine will not undergo a rapid unplanned disassembly.  I also plan to bolt the whole machine to a sheet of ply wood (Use rubber studs/grommets to prevent noise amplification) to keep it rigid - as soon as the virus scare is over and I can actually find a shop with ply wood.

2D PCB Antenna Carving
Now, I need to fire up KiCAD and design a little antenna to carve out.  That was rather easier said than done.

On Linux, one of the ways to convert a PCB into an outline and Gcode is a program called Flatcam.  This program does exactly what is written on the tin and it wants to have a Gerber PCB layer stack as input.  It can import a SVG file, but then it can be difficult to modify anything, so be sure that the graphic is correct. (Flatcam has an editor function, but it doesn't seem to work and I cannot get the editor to do anything beyond showing a little dot on the screen!).

Flatcam works well, but the UI is a bit confusing to the uninitiated.  In general, first get the red tracks generated, then generate the Gcode.  That sounds tremendously obvious, but it means that you may have to select and do things from the bottom up.  When you try to run Flatcam, you will understand.

Note that for a PCB antenna, you don't need to do isolation milling - simply remove all the non-copper with an end mill and the antenna will be left behind!

The size of the end mill depends on the smallest gap that it has to get through - simple as that - but with a 1/32nd inch or 0.8 mm, you can mill tracks, drill holes and cut out the board - one tool that conquers all.

I can make a Gerber file with KiCAD PCB editor, but while it has very useful footprint wizards, it doesn't have a nice drawing function that can be used for complex shaped small antenna footprints.

I then tried Inkscape and made a neat drawing - then I went on a crazy tour of different CAD programs and file formats, only to come back to Inkscape and the SVG file format.

The trick is that the KiCAD footprint editor can import an outline onto the Front Silkscreen layer.  It then needs some manual editing of the footprint in the library to move it to the Front Copper layer.  

In short: With KiCAD PcbNew, make a new footprint library and a new footprint.  Draw and save a SVG antenna with Inkscape.  Import the SVG file into the PcbNew footprint editor and save the footprint in the new library.  Open the footprint file with a text editor and replace all instances of F.Silk with F.Cu and save it.  Confirm using PcbNew that it is OK by clicking the layers on the right on/off.

Now you can place the footprint on a PCB and carry on as usual, by following this most excellent guide at Inventables https://www.inventables.com/projects/how-to-mill-a-through-hole-pcb

BTW, even with a simple little low cost engraver, you still need to use expensive bits.  The HS sample bits that you get with this toy are only good for experiments in soft wood/plastic - they are not sharp enough to cut copper properly at a fast speed.  Get 1/8th inch shank, Tungsten Carbide 0.8 mm end mills, and 30 Degree V bits for isolation milling (https://www.aliexpress.com/item/32313667075.html).  

Since you cannot easily compensate for board warping and uneven surfaces, you need to cut a little deeper, without making the cuts wider.  Also, don't bother cutting the boards out with a small mill - a jigsaw is much more efficient, but you will need a good 1/8th inch end mill bit to cut out a level work surface and a 1/16th or 1/32nd to mill an antenna.  Cutting a surface with a needle nose V bit, will take longer than the Corona virus quarantine period.

With a larger CNC Mill and larger boards, you could probe the surface and compensate in the Gcode to handle the warping of the board (https://www.autoleveller.co.uk) - you can then save an hour of cutting time, with an hour of probing.  With a small board, the warping is less, so simply cut a little deeper and move slower.

Note that the Gcode is a text file.  You can modify it with a programmer's editor, if you want to change the cutting depth without having to rerun Flatcam for example.  You can also concatenate two or more files so they will run in succession with no further ado, if you don't need to do a tool change in between.  So you can do the copper, board cut-out and hole drilling all with the same 0.8 mm end cutter consecutively, unattended.

Flatcam Parameters
This is a small machine, with small motors, for making small PCBs.  If you stress it, you won't get good results, so take it slow.  The bigger the PCB, the more the warp, so keep them small.

For RF circuits the track width determines the impedance.  For these use a 15 degree needle tip, so that the cutting depth doesn't change the track width significantly - OR - use a 1/32" end mill and take it slow.

Boards are always slightly uneven and warped and the machine is not 100% true and steady.  A cutting depth of 5% to 15% of the thickness of a 1.5 mm board should work, but if you cut deep, the stress on the tool tip is very large, so slow down, else it will go blunt/break, or wander around and chip the copper.  Put several drops of machine oil on the board to lubricate the cutter.  This keeps the bit cool and sharp and also captures the swarfs and dust, so you can just wipe the mess off with an oil rag.  The oil prevents getting itch powder all over your shop.

Levelling Pocket - Made With an 8 mm End Mill

Eventually, I bolted a heavy 1/2 inch board to the aluminium table and slowly (20 mm/min) machined a very good polished 80 x 110 x 0.2 mm pocket, using an 8 mm end mill from my Dremel kit.  Next, I drilled 6 lead holes so that I can secure a 70 x 100 mm PCB blank with 6 small wood screws and washers.  That yields repeatable results.  I sealed the wood with Ye Gut Olde 3 in 1 Machine Oil.

The important point is that this is not a precision machine.  If you stress it, the results will be worse.  If you don't stress it, then it should last a long time.  For Euro 70, it has certainly exceeded my expectations.

Carbide 3D
The manufacturers of the Shapeoko Milling machine provides a free, online PCB Gerber to CNC outline Gcode converter.  Similar to Flatcam, you upload a Gerber file, select the tool and there you are: https://carbide3d.com/copper/

Bits and Bites
Engraving V Bits are very strong and can cut very fast (200 to 300 mm/min), but the result is bound to be rough.  This is due to the nature of the bit.  If you need a clean cut, use a Fluted End Mill.  If you want a perfectly clean cut, use a Push Down Fluted End Mill. It has a left hand thread.  A push down bit seemingly goes the 'wrong' way and doesn't lift the copper layer, but then you have to cut more slowly (30 to 100 mm/min).

For cutting copper foil PCB, you need a very sharp bit.  Garden variety High Speed Steel bits are not quite sharp enough - they are OK for wood and plastic - but you should get tungsten carbide bits for PCBs.

The below little SMD board was cut with a new Steel V-bit.  No burrs, thanks to lots of 3 in 1 oil and taking it painfully slow at 20 mm/min.  Cutting in oil looks horrible, but it works. (The double cuts are due to the ground plane fill - I expected the middle left over copper to curl away, but it stayed perfectly and looks like 10 mil tracks.)

Freshly Cut - No Burrs

Cut in a puddle of oil.  Good olde 3 in 1 machine oil works wonders.  Spread it with a tooth pick.  It keeps the bits sharp and cold and prevents burrs.  It also prevents the dust from taking flight.  Wipe up with a rag and brush with a tooth brush and tooth paste under running water - yes, toothpaste works wonderful to clean an oily board!

V Bits need some high school trigonometry
V Milling bit: 0.1 mm tip, 15 degrees
  • Cutting depth: 0.15 mm
  • Cutting tool width: tip + 2 x tan(degrees/2) x depth = 0.1 + 2 x tan(15/2) x 0.15 = 0.139 mm
V Milling bit: 0.1 mm tip, 15 degrees
  • Cutting depth: 0.10 mm
  • Cutting tool width: tip + 2 x tan(degrees/2) x depth = 0.1 + 2 x tan(15/2) x 0.10 = 0.126 mm
V Milling bit: 0.1 mm tip, 15 degrees
  • Cutting depth: 0.05 mm
  • Cutting tool width: tip + 2 x tan(degrees/2) x depth = 0.1 + 2 x tan(15/2) x 0.05 = 0.113 mm
V Milling bit: 0.1 mm tip, 30 degrees
  • Cutting depth: 0.20 mm
  • Cutting tool width: tip + 2 x tan(degrees/2) x depth = 0.1 + 2 x tan(30/2) x 0.20 =  0.207 mm
V Milling bit: 0.1 mm tip, 30 degrees
  • Cutting depth: 0.15 mm
  • Cutting tool width: tip + 2 x tan(degrees/2) x depth = 0.1 + 2 x tan(30/2) x 0.15 = 0.180 mm
V Milling bit: 0.1 mm tip, 30 degrees
  • Cutting depth: 0.10 mm
  • Cutting tool width: tip + 2 x tan(degrees/2) x depth = 0.1 + 2 x tan(30/2) x 0.10 = 0.154 mm
V Milling bit: 0.1 mm tip, 30 degrees
  • Cutting depth: 0.05 mm
  • Cutting tool width: tip + 2 x tan(degrees/2) x depth = 0.1 + 2 x tan(30/2) x 0.05 = 0.127 mm

Default settings for Flatcam that will 'work' with any V tip:
Just remember 20, 20, 20!
  • Z = -0.20 mm
  • Travel Z = 2 mm
  • Tool diameter = 0.20 mm
  • Feed = 20 mm/min
  • Overlap: 0.15 to 0.25 (15 to 25 percent overlap)
  • Spindle Speed = 5000 (Any number will turn the motor on - no speed control)
  • Dwell Time = 1
The feed rate is related to the spindle RPMs and since this machine doesn't spin fast, you got to feed slow.

You need to cut fast enough that you get tiny little chips and not a cloud of itch powder, but not so fast that the tip wanders and cuts inaccurately.

Use 3 in 1 machine oil liberally and wipe your tools with an oil rag.  An oiled board lubricates the cutter and makes the dust stay on the board, so you don't get glass itch powder all over the shop and in your lungs.

Handy conversions:
1/64" = 0.397 mm; 1/32" = 0.794 mm; 1/16" = 1.59 mm; 1/8" = 3.175 mm; 1/4" = 6.35 mm
20 mil = 0.508 mm; 40 mil = 1.016 mm; 60 mil = 1.524 mm; 80 mil = 2.03 mm; 100 mil = 2.54 mm

Router tip tips:
  • Use a push down (left handed) end mill for a clean surface cut on a laminate.
  • Use a single flute straight cutter on plastics to avoid melting and fouling.

PCB Fixed with Screws and Bent Washers

  • A straight fluted end mill also gives good results, but 
  • a common right handed pull up end mill is as bad as a V bit.
  • Use a cutting fluid - a puddle of machine oil on the copper makes a huge difference.
BTW, regarding the PCB fixture - one can actually buy bent washers made of spring steel, but I just bent some mild steel washers with a crimping tool...

Table Levelling:
  • Bolt Masonite or other soft wood to the aluminium table and machine a level pocket in it 
  • Pocket depth: 0.5 to 1 mm deep
  • Size: A little bigger than your PCB blanks
  • Use a relatively big end mill to get a polished surface (6 to 8 mm)
  • Either use double sided tape, or screw the blank boards down, but screwing can warp them more.
  • Amazing Goop glue also works and it can be rubbed off with a thumb after you pulled the board up. In sheer desperation, I used it for the experiment below and was pleasantly surprized.
Where to get Masonite/Hard Board/Wood during the shutdowns: Buy a clip board, or a bread board at Lulu or Carrefour...

V-Bit Test:
Milling RF parts with a V bit is not recommended and the below picture shows why.

 Yagi Milled with a 30 Degree V Bit

The elements are not of a consistent width.  Cutting this test antenna took about 2 hours, at 200 mm/minute, which is really too fast for a V bit, if you were wondering, but it proved my mill is working as expected and can keep going for hours without burning out, or falling to pieces.  The quality would be much better with a 1/16th inch push down end mill at 20 to 30 mm/minute and will take the same time, since being wider, it will run a much shorter distance.

Yagi Done With 0.8 mm End Mill

Cutting the second Yagi took about 3 hours.  Liberal use of oil resulted in a clean cut with no burrs.  For the next ry, I'll increase the overlap to 20% to get rid of the little left over bits of foil.

See this for antenna details and measurement results:

One problem is that one has to lower the head until the tip of the mill bit just barely touches the copper - if you drive it down hard, then it will cut much deeper than intended.  A 1 thou contact point is very hard to see for someone my age, even with a magnifying glass.  So I soldered a LED and a 2k2 resistor to a 9V battery and two crocodile clips.

Contact Indicator

Cutting Fluid
I tried using propanol and 3 in 1 oil as as a cutting fluid: Propanol works and is less messy, but it evaporates too quickly.  Oil is more sticky and keeps the dust down perfectly.  Wiping it up with a piece of an old T-shirt is also no problem at all.  So my recommendation is to put 5 to 10 drops of oil on the board before you start and keep it wetted.

PCB Warp Compensation:
With this little machine, forget about warp compensation.  The machine is not accurate enough to worry about 0.05 mm differences.

For best results, keep the board feature size larger than 1 mm and cut 0.2 mm deep with a 2 flute (1/32") 0.8 mm or (1/64") 0.4 mm end mill, or a 30 degree V-bit at 10 to 20 mm/min.  The bigger the pads and tracks, the better - 1 mm tracks are good, 0.25 mm (10 mil) are not recommended.

If you want to try V bits for very fine isolation milling of SMD parts, the Autoleveller project is here: https://www.autoleveller.co.uk, but I like'em square and prefer end mills and big tracks.  Small tracks will be an exercise in frustration with this machine - it is simply not accurate enough.  You only need one bad track to ruin a board.

Manual Control
The little offline controller is also nice for drilling small holes and making straight cuts, without programming. A wee little drill press...

Bakelite (Pertinax, Formica, Melamine)
The >100 year old Paper Reinforced Phenol Formaldehyde plastic sheets have made a comeback recently - the modern composites are more stable than before.  Bakelite sheets are dimensionally stable, very strong and much easier to cut/file/mill/drill than aluminium, acrylic or fibreglass board.  It is very useful for making enclosures and panels with intricate cutouts for connectors and it doesn't foul or blunt your tools.

Bakelite is produced in 8' by 4' sheets just like plywood, which presents a large delivery problem. Here are two vendors in Germany for cut pieces of Paper Bakelite, FR2 PCB, Carbon, Aluminium, Lexan and more:

US vendors:

I list them here, since it is very difficult to find these type of composite sheet stock vendors.  Google doesn't help, it just turns up page after page of Chinese PCB manufacturers.

Further Information

So What is This Toy Good For?
It is good for single sided home PCBs with parts large enough that someone over 50 can actually see them unaided.  It really does make home brew circuits look much more professional and neat than strip board or blob board.

You can do SMD boards, but you have to keep the pads bigger than 1 mm on a side, such as 1206 or 1812 - the small 0603 (1.5 by 0.8 mm), with 0.5 mm tracks, is probably the lower limit - the bigger the better.  http://www.resistorguide.com/resistor-sizes-and-packages/

If you have to use a little SO8 package for example, buy a little break-out board for it from Sparkfun, so you can make bigger 1 mm tracks.  The secret sauce however, is cutting in a puddle of machine oil - clean the board with a tooth brush and toothpaste.  If there is enough oil, then there are no burrs.

I also had success with engraving plastic, using a V-bit with the same 20, 20, 20 settings and a puddle of propanol as lubricant.  Oil could make plastics craze.  Clamping a small sheet of acrylic down is difficult - it tends to crack - put something under the washers.

I have not had success with cutting plastic panels yet - it tends to melt - even with propanol.  I am waiting for better single flute end mill bits - hopefully that will work. The secret with plastic is that you need very sharp bits and move at a relatively fast rate.  Blunt bits cause friction and melts the plastic.  Once you found one that works, don't use your new found plastic cutting bit to cut anything else.

BTW, if you want to cut panels to make boxes, see this wizard: https://en.makercase.com/#/

Square Helical Antenna
Something I would like to try, is to make a quadrifilar antenna on 4 pieces of PCB - a square tube version of this one:  https://www.aeronetworks.ca/2017/12/parasitic-quadrifilar-helical-antenna.html starting with the box wizard above for the outlines.

La Voila!


Friday, March 20, 2020

Analogue Meter

A few years ago, I noticed an analogue meter with an amusing front panel.  Since it is very old, I expected that it may not work right, so I bought two.  They have been sulking in a dark corner of my Junque Bochs for a long time, but I found them again when rummaging for something else and decided that I have to find a use for the poor things.  One turned out to be intermittent, the other is perfectly fine.

Et Voila! A super inaccurate Volt-Amp Meter:

Volt-Amp Meter

It doesn't look too bad mounted inside a Perspex cube that I got at Daiso some weeks ago.

Now the old movement is actually useful again and it has measurement ranges for 2V, 20V and 200V DC and AC, plus 20mA DC.

It is a 20mA movement, so I used 1k, 10k and 100k resistors and a couple diodes to give it a 2V, 20V and 200V scale.

Which is more accurate: My uncalibrated 4 digit digital meter, or my uncalibrated analogue meter?

Component Tester
BTW, I found a very nifty little component tester on AliExpress, the DTU-1701, which goes for the princely sum of about $20.  It is called a Transistor Tester, but it can test anything: Resistors, Capacitors, Coils, Diodes, Triacs and even Transistors too...

DTU-1701 Component Tester

It is very simple to use: Hook the component to any of the three leads and press the test button.  It then displays a graphic of what it found.  To me, it is especially nice for winding RF inductors, which are usually a bit of a chore to measure.

I used to measure coils with my oscilloscope:
Every scope also has a square wave output, used to calibrate the probes.  You could however use it to disturb and pulse test anything and one simple way to test a coil (or capacitor) is to make a LC tank circuit, then excite it and look at the frequency of the ringing.


The ring frequency can then be used to calculate the inductor/capacitor value:

fr = (1/2π) √((1/LC)

That of course depends on having a good known coil/capacitor to test against and most have a tolerance of +-20% or +100 -50%, so this little tester is rather easier.

Have fun!


Monday, February 10, 2020

Phased Array Antenna for 5 GHz Band

I've been toying with a switched phased array antenna design for use on a small aircraft.  This type of antenna could be made to radiate forward, backward, or to the sides.  With the addition of a Raspberry Pi Zero (or Arduino Teensie https://www.aeronetworks.ca/2016/08/minimalist-arduino-gps-parser.html), a UBlox GPS receiver and 4 little RF switches, your toy aircraft could then always point its antenna towards your ground control system, without using any step motors or moving parts - well, except for the armatures of the little RF switches.

Phased Array NEC2 Simulation

The design is essentially four Yagi antennas positioned back to back in a cross.  Only one dipole is driven at any time and the result is that the rearward parasitic elements act as a reflector for the antenna that is active.  This improves the front to back ratio quite noticeably.  The NEC2 graphs show extremely small back and side lobes, which I found so encouraging, that I went ahead and built the antenna to see whether it is indeed true.

The whole assembly could be housed inside a streamlined toadstool radome, the head about 190 mm in diameter and the stem about 150 mm high, with the RF switches in the bottom of the stem.

I aimed for about 10 dBi gain, which should result in about 8 dBi in reality.  I don't want to make the gain too high, since then the 45 degree positions will be nulls. I did however leave room for yet another set of directors on the prototype antenna base, to gain another dB if needed.

With a directional antenna, it is not just the forward gain that is important, but the back and the side lobes need to be small, since the lobes introduce unwanted noise.  The aim is to get an improved Signal to Noise Ratio, so that the aircraft radio will work better in both transmit and receive modes.  The NEC2 prediction shows very small unwanted lobes and I hope I can achieve that in practice.

Phased Array 5GHz Design 

I modelled it in NEC2 and because of the large number of wire elements, I added tiny parasitic capacitors with LD cards to the ends of each wire, to make the simulation more accurate.

Phased Array 5GHz Wires and Loads

The prototype antenna elements are made from jumbo paper clips and the substrate is a piece of Lucite acrylic, so my antenna is transparent and the wires seem to float in the air.  The pieces are held down with 'antenna putty' (UHU Patafix) - once tuned up, apply tiny drops of epoxy glue with a tooth pick.

The ultimate phased array was probably the enormous Soviet Duga Radar Antennas, which were built to detect incoming cruise missiles and which operated during the 1970s and 80s.  It was abandoned when the Ukrainian site was contaminated by the Chernobyl accident, leaving a huge hole in the middle of the system, making it all useless.  I remember as a teenager listening to their constant check-check-check screech on my shortwave receiver and wondering what on earth that horrid noise was.  A Duga array used so much electricity, that it had to be next to a nuclear power station and is a bit too big for my backyard:

Duga Radar Antennas

The wire elements of the array must be cut very carefully.  You need to be within a fraction of a millimetre with each wire, otherwise the operating frequency will be off.  The Lucite has a permittivity of 2, which is quite low.  Alternatively use blank FR-1 phenolic paper (Bakelite) printed circuit board, which also has a permittivity of 2.

The magic of this design is in the bent wire element tips.  Each wire end (3 mm) is bent slightly inwards.  This makes the design more wide band and reduces the sensitivity of the antenna so that it doesn't get detuned by close objects so easily.  Bending them is painful on the fingers - use small round nose pliers.

Phased Array 5 GHz Prototype

If you only need one or two of these toadstool antennas, then building it with little wires is quite practical, but if you want to make a million, then you should etch the elements on thin printed circuit board.  Due to the thin dielectric on one side, the elements will then need to be slightly shorter, but the spacing will remain the same.

Initial measurements with a VNA looked encouraging, but some more work was needed to calm the antenna down - widen the band and improve the VSWR.

Phased Array 5GHz VSWR and Smith Chart

Now, I need to mount it on a wooden dowel post and measure the gain, to see how reality compares with the NEC2 predictions.  The impedance and VSWR bumps were a concern and a couple of small ferrite beads over the cable quietened it down.  Large beads will detune the antenna since everything is so close together - keep them small.

Ferrite Beads

The beads improved the matching significantly - still bumpy, but now the antenna is usable, with the VSWR below 2.

Improved VSWR with Ferrites

To measure the antenna, I needed to make yet another little Yagi to use as a receiver, which took a while to do and measuring an antenna in the open, without an anechoic chamber is very difficult.  A 5 mm wooden dowel, a few more paper clips and O'l Bob's yer Uncle.

5 GHz Yagi

The little Yagi is the same as the phased array with a half folded dipole and a couple of ferrite beads to prevent current flowing down the co-ax screen, causing weird pattern effects and a bad VSWR.  I left room in front on the boom for another director to up the gain by another dB if I would want to, but it worked well enough as is.  I later cut the unused wooden snout off for aesthetic reasons.

You almost should not breathe while taking measurements indoors and the numbers are always rolling up and down for no apparent reason, due to reflections off the surroundings.  The sun is also a strong C-band noise source and I live next to a couple of cell towers with C-band back-haul - all extremely non-ideal and going outside is therefore just as dreadful as inside.  If you can't make any sense of your measurements, then you should probably add a few more ferrite beads on your cables.  Otherwise you can try absorbent paint in your workshop - it should help a bit - or go and stand in the middle of a sports field or in a farmer's meadow:

Some more rough measurements in my living room indicates that the antenna more or less works as it is supposed to and I get in the order of 10 dB difference between the front to side and front to back, which is what I was hoping to achieve.  This proves the concept, so the next step is to make the widget from FR-1 PCB to get the design more stable and repeatable.  For this, I bought me a PCB milling machine for the princely sum of 285 Dirhams ($80!) - my next toy.  Milling a board costs as much as Ferric Chloride and UV chemicals, but is less dangerous I think (I've etched boards and printed B&W photos when I was young and reckless).

For switching between the dipole elements, four little RF relays should work.  At 5 GHz, one should use a miniature coaxial relay.  A low cost reed relay will leak so much that it will upset the antenna pattern and VSWR.  You really should invest in something with isolation of around 40 dB or better (about $80 to $120 each!), but be careful when you select one, since there appears to be little correlation between price and quality: https://eu.mouser.com/Electromechanical/Relays/High-Frequency-RF-Relays/_/N-5g33?keyword=5GHZ.

It is strange that FR-1 is hard to get these days, but it is making a comeback due to PCB milling machines (the router bits are blunted by glass fibre board, so old fashioned Bakelite is better).

For this kind of antenna, I want a substrate with low permittivity and FR-1 is about 2, whereas FR-4 is about 3.5.  FR-1 also has the advantage that it doesn't cover your workshop with white itch powder when you cut and drill it like FR-4 glass dust!

PCB Milling
I bought a small PCB Milling Machine and made a couple of test cuts.  This one was done with a 0.8 mm steel end mill, 0.15 mm deep, at 20 mm/minute, which took about 3 hours.  The picture is fresh off the machine, I did not sand the board - just washed the oil off - there are no burrs.

5GHz Yagi Freshly Milled From FR4

This shows that it is possible to make prototypes this way and while it feels very slow, it is much faster than ordering boards from China.  There are tiny flecks of copper foil left over here and there to scratch off with a blade.  I have to increase the overlap a little for the next try.

I connected the centre of the coax to the end of the J and the screen to the centre of the reflector.

5GHz Yagi on FR4

The result is an almost perfect 49 Ohm match and the centre frequency is 5.056 GHz with a bandwidth of 4%.  Usually a Yagi bandwidth is < 2%, so the 4% bandwidth is very nice.  The rule of thumb is that d/L must be between 0.01 and 0.04.  For the next one, I'll increase the rod diameter form 1 mm to 3 mm and see whether that makes a useful difference.

I designed for 4.75 GHz and then made a drawing with Inkscape - what you build is always different and will require tweaking to get it spot on.  Usually the frequency goes down, not up, but who am I to argue...

5GHz Yagi Smith Chart

This shows that PCB milling of common FR4 is a perfectly valid way to make a microwave antenna, but to repeatably get the frequency exactly where you want it, would either require precision high frequency substrates, or a way to trim the dipole length (make it a little too long, so you can trim it), or a small tuning circuit, or adjust the drawing and mill a new one.  It depends on your time vs budget!

5GHz Yagi VSWR

5GHz Yagi Return Loss

As you can see in the above plots, a Yagi antenna is a narrow band device.  If you need a wide band array, then consider using a small log-periodic antenna https://hamwaves.com/lpda/en/index.html

Note that an antenna like this, can be scaled to any frequency, so you could make one for use at 2.4 GHz for example, but at 900 MHz it will be large and probably impractical for a small aircraft.  It could also be good for a ground station tracking antenna with no moving parts.  You could also install 4 antennas on four ends of the aircraft, but beware of the coaxial cable losses.

Have fun!


Friday, February 7, 2020

Yagi Antenna for 900 MHz ISM Band

I like tinkering with wire antenna designs, since they are simple and cheap to make.  Mr Yagi invented his antenna about 100 years ago, but there are still some things left to learn about it.

900 MHz ISM Band Yagi

The 900 MHz ISM band ranges from 902 to 928 MHz.  Covering the whole band with a single Yagi antenna is difficult, since they are inherently narrow band devices.  Consequently some tweaking is required and the result below is a desensitized design that can be built and replicated quite easily, but you need a network analyzer - "To Measure, is to Know!"

A Yagi generally consists of a Reflector, Radiator and one or more Director elements, arranged on a boom.  For a small Yagi, a wooden ruler works a treat, since one can easily mark the position of the wires.  The wire elements are fastened to the bottom of the ruler with hot glue.  The wire elements are  made from straightened out jumbo size paper clips.  The balun, is two clip-on Ferrites, to prevent current flowing on the sleeve of the co-ax, disrupting the pattern.  Winding a ferrite bobbin balun, is not quite worth the hassle to me.

You can plot the pattern of a Yagi with NEC2, but NEC2 does not provide accurate impedance, or VSWR plots and the simulation operating frequency will be lower by about 4% as well, because NEC2 does not automatically compensate for the end effects of the wire rods - you need to add a load card with a tiny capacitor (0.01 to 0.1 pF) for each element end.  For serious Yagi design, you probably need to consider NEC4 or FECO, but if you are aware of the 3 to 4% systematic errors of NEC2, then it doesn't matter, so I never could be bothered to actually buy NEC4!

Stray capacitance calculator:

There are many Yagi antenna tables and calculators on the wild wild web.  I used an Optimized Wide Bandwidth Array (OWA) design, with the first reflector very close (~0.05 Lambda) to the dipole:

Javascript Version 12.01.2014, based on Rothammel / DL6WU
Frequency     :  930  MHz
Wavelength    :  323  mm
Rod Diameter  :  1  mm
Boom Diameter :  1  mm
Boom Length   :  231  mm
d/lambda      :  0.003    ( min.: 0.002 , max.: 0.01 )
D/lambda      :  0.010    ( min.: 0.01 , max.: 0.05 )
Elements      :  5
Gain          :  7.99 dBd (approx.)
Reflector Length   : 155 mm
Reflector Position :  0 mm
Folded Dipole Position : 77 mm, Length: 144 mm
Director #1 Position : 102 mm ,  Length : 147 mm
Distance Dipole - Dir. #1 : 24 mm 
Director #2 Position : 160 mm ,  Length : 145 mm
Distance Dir. #1 - Dir. #2 : 58 mm 
Director #3 Position : 229 mm ,  Length : 144 mm
Distance Dir. #2 - Dir. #3 : 69 mm 
Directors / Parasitics are isolated.
Please choose an isolater thicker than : 2 mm

Make the folded dipole of a length between the reflector and the director and then tweak it till it is reasonably well tuned to the frequency you want.

Several rules of thumb have been developed over the decades and if whatever online design calculator or tables you use differs much from the below rules, then you should be suspicious:
  • The reflector is a little longer than the dipole radiator
  • The directors are a little shorter than the radiator
  • The elements are 3% to 5% shorter than half a wavelength.
  • The spacing between the elements is between 0.1 and 0.2 wavelength.
  • The gain in dB is about equal to the number of elements.

900 MHz Yagi - Voltage Standing Wave Ratio

A Yagi tends to be a sensitive and narrow band antenna with low impedance.  This can be improved with the following suggestions:
  • A folded dipole will increase the impedance to between 50 and 75 Ohm.
  • A folded dipole needs to be a little shorter than a regular dipole and may end up the same size or a little shorter than the first director.
  • The bandwidth can be increased by placing the first director very close, about 0.05 wavelength to the radiator.
  • The antenna can be tuned the old fashioned way: With pliers! - by bending the ends (10%) of the rods.

900 MHz Yagi - Smith Chart

Tuning a Yagi is an art, not a science!

In general, one designs an antenna for the top of the band (930 MHz) and then it will end up lower down towards the middle of the band, due to parasitic effects from the boom, the coaxial cable and things around it.

Tweaking the antenna is quite tricky and requires some patience, but it can be a lot of fun:
  • Do not change the spacing.  You can mount the rods securely.
  • Increasing the length of the dipole, decreases the frequency and vice versa.
  • Make the dipole in sections, so that you can solder and resolder it, till it is tuned exactly to the desired frequency.
  • Bending the ends of the reflector forward, increases the forward gain and reduces the impedance.
  • Bending the ends of the directors backwards, increases the bandwidth and lowers the centre frequency.
  • Bending the rod ends slightly inwards is very important in my experience, since it makes the design much less sensitive to its surroundings, so it will not be detuned so easily by things next to it, but it may reduce the gain a little bit if you go extreme.
Note that since Lambda = 1/(2.pi.f), if your frequency is low by 1%, then you need to trim the length of the elements by 2%, or trim 1% off at each end of the element.  Since the design should not be very far off (unless you used a really dreadful design tool) and the directors will be bent later, only trim the dipole.

I made two.  The one ended up at 913 MHz and the other at 916 MHz and both covered the whole band.  Pretty good.

The measured impedance of this little Yagi is 53 Ohm to 92 Ohm, meaning that one can use a garden variety RG59 or RG58 co-axial cable to drive it directly and avoid using a power sapping trans-match.

If you feel that the impedance is too high for RG58, then you can make a somewhat unconventional dipole with only one folded leg, which is inherently unbalanced and therefore a better match for a coaxial cable.

How to measure the gain of an antenna by pulling yourself up by your boot straps, starting from first principles:
Make two simple dipole antennas - two pieces of wire and a toroid balun each.  Measure the power received over 1 meter distance between them.  Replace one antenna with your antenna under test and measure again.  The difference is the gain of the antenna in dBd (dB relative to a dipole).  For dBi, add 2.2 dB, the gain of a dipole.  Once you have characterized one directional antenna, you can then use that one for measurements of other antennas.

La voila!


Saturday, February 1, 2020

KiCAD Schematic and PCB Design

The venerable Eagle PCB design program has gone Cloudy.  I have used Eagle for about 20 years - sometimes I bought the professional version and sometimes I just used the free hobby version - depending on what I needed to do.  Eagle now requires a permanent subscription, which is not compatible with intermittent use.

I therefore looked around for a Free PCB design program, tried gEDA PCB and KiCAD and quickly found that I am not alone.  My favourite high tech toy stores Sparkfun and Digikey also looked around and we all settled on KiCAD.  It turned out that KiCAD is also used by Great Scott Gadgets (HackRF One) and that two of the main developers of KiCAD are employed by CERN.

KiCAD on a MacBook

If KiCAD is good enough to make the HackRF One PCB, then it must be good enough for me...

As with all CAD tools, it takes a little getting used to.  Note that Move and Drag are not the same.  For example, Dragging will rubber band the wires, while Moving will not.

I tried to install it on my MacBook and soon ran into a little spot of bother, but after futzing around a bit, I found the solution and it works great, as you can see from the above screen grab. (My latest hack is an Olde Skool VHF preamplifier using a miniature thermionic valve - for use with my RTL-SDR SatNOGS receiver)


On Windows and Linux, installing it should not be a problem and the stable version comes with all versions of Linux, so it is as easy as:
# dnf install kicad

$ sudo apt install kicad

For Windows, get KiCAD here:




Install KiCad on a Mac

If you want to install KiCAD on a Mac, you may run into a permissions problem:

No Authenticate Button

The usual way to install program on a Mac, is to drag the left hand icon over to the right hand one.

See the problem?  'Click Authenticate', but there is no 'Authenticate' button to click!

The solution requires two settings changes and some manual dragging and dropping.

1. Enable viewing the Library folders in Finder
Go to your User home folder. Pull down the “View” menu and choose “View Options” Choose “Show Library Folder” in the settings options for the User home folder.

2. Enable Install from Identified Developers
Go to System Preferences, Security and Privacy and tick Allow Apps Downloaded From App Store and Identified Developers.

Now, if you right click/two finger tap on the right hand icon of the KiCAD installer and select Get Info, then you will see the full designation path which is something like "/Library/Application Support".  With Finder, go there and drag the left hand icon of the installer over to the correct place in Finder and now you will get a security authentication prompt.

After that, once everything is installed, KiCAD will work just fine.


KiCAD includes a manual router, which is fine for very simple boards, but if you want to do something more serious, then the manual router will become tedious in no time.

Install Freerouting on Linux:
$ su -
# dnf install freerouting

KiCAD with Freerouting Auto-Routed Board

More information here: https://freerouting.org

In essence, you export a DSN file from KiCAD, import it into Freerouting, turn it loose and go watch a ball game - when you get back, it may be done...

Have fun!