Tuesday, 8 March 2022

19 - Measuring the Deviation of an FM transceiver using an SDR

 

If your FM transceiver is a converted PMR set it may be useful to measure the FM deviation because if it is set too low you are only heard faintly. There are deviation meters that can sometimes be picked up on the second hand market, or they may be part of a communications test set but not all of us have access to these. It is possible to measure deviation by the carrier null method. To do this you need a VHF/UHF SSB transceiver with 500 Hz CW filters, or an SDR.

I recently purchased an SDRPlay RSP1a (for £98) that is a really good SDR – with a 14 bit ADC it is much much better than the £20 SDR dongles you can buy as these are only 8 bit. I will repeat the measurements below with an 8 Bit device and report back if it works, but here are the results of using the RSP1a.

The RSP1a comes with software called SDRUno (Version 1.41) and also RSP-Spectrum Analyser software (Version 1.1). I used the spectrum analyser software here but the ordinary SDR would work as well – just with “fatter” traces.

How does the method work? Well, we are all familiar with the sidebands of AM and SSB. The sidebands of an FM modulated signal are much more complicated. But you don’t need the theory (it involves Bessel functions). Just accept the diagram below; and note the first trace (the carrier) passes through zero at 2.405


 

These are a plot of the various sidebands that exist with an FM transmission, of course they are all added together and hard to separate. You can see them on the spectrum plot of my SDR below

 <<< spectrum/sdr plot >>> 



This is a 1KHz tone being played through a loudspeaker, near the microphone.

You can use an app on your phone or a PC to generate the audio tone (I find Audacity on the PC quite good). Here I used an audio signal generator which is more convenient as I needed to slowly increase the frequency while watching the screen. Notice that the Carrier – the first waveform coloured Red above, it passed through zero at a special value of 2.405– this is why this method works, we increase the frequency of the applied single tone until the carrier goes low – it dips. It does not actually go to zero, but the dip was easy to see. Here it is;

<<< spectrum/sdr plot+text box and carrier dip - I was inputting 1.818kHz>>>


 

This dip occurred when I was inputting an audio frequency of 1818Hz. This was the first dip as I transmitted a sweep of audio frequencies from 300 Hz to 6KHz. You want the first dip, not the second.

The deviation is simply this frequency multiplied by the magic number of 2405.

So the deviation of the transmitter being tested is 1818*2405 = 4.37kHz

It would be better to be 5kHz so I need to tweak it a bit, I also tested an old PMR which I used a lot on the repeater when I drove to work every day and its deviation was below 3kHz. Oops.

I will continue playing with the RSP1a as I am finding it a fantastic spectrum analyser – as good as instruments costing £1,000 plus. Do be aware however that you MUST not connect the input direct to the transceiver – the RSP1a will self destruct if it gets an input above 10 milliwatts, and in fact the recommended limit is 1mW. I just ran my 5W transceiver into a dummy lead through 2 metres of coax and left the SDR antenna socket unconnected, and the SDR about 5 feet away from the dummy load. I am making up some simple attenuators – vital accessories with a spectrum analyser like this.






 

 

 

18 - Using LTspice to help build RF circuits

LTspice is a free software package that can compute and display what the output of a circuit would be if we were to build it and apply some inputs. We call this process simulation; this can be very useful – it is a lot faster to draw a circuit then to build it. I have been



using it for years and am currently working on simple transistor circuits and building up to simulating an entire HF transceiver (the uBITx) before building it. The text below makes more sense if you download and try the software.

To get you started I will show you how to use LTspice to see the performance of a simple low pass filter. I will first apply a range of frequencies and then show you the frequency response. Here is the circuit of the filter (also called a “schematic diagram” in American English) 

  To simulate this we must add a voltage source – at the antenna inputs. The voltage source should be given a series impedance (Rser) of 50 Ohms. We also need to add a 50 Ohm load to the output. Filters only work correctly if they are properly terminated with their designated input and output impedances. Rightclick on the voltage source and set Rser to 50 and the AC amplitude to 1 Volt. Don’t give it any of the functions you see on the left of the form. (keep it at the default of “none”)

In Ltspice you add a voltage source using the “add component” icon on the tool bar. The coils, capacitors and resistors are added by the obvious icons. You add labels and wires as shown and assign values by rightclicking on the components. To run the simulation below you select a “running man” icon on the toolbar. In addition you must specify a simulation command – this is done by planting text on the schematic that begins with a dot - such as .AC dec 101 3Meg 45Meg You can do this by picking “edit simulation command” on the top line View menu item – it allows you to fill in a form that explains that this command causes a linear sweep from 3MHz to 45MHz with 101 points per decade. The .AC analysis is known as a small signal analysis it is only an approximate result but it does allow looking at a range of frequencies – the other often used command is the .TRAN – a super accurate analysis but only at one frequency. For a filter we want to sweep the input frequency.


 Select run by clicking on the running man symbol at the top, or right-clicking the mouse

After running the simulation a blank, black window appears – the plot pane (I changed mine to white to save ink here!). To add a trace to this simply let your mouse hover over the output label on the schematic “TO_MIXER1” and notice that a symbol of a voltage probe appears, left click and you get the waveform below. 


 

You can add cursors by double clicking on the green label at the top and move the cursors to see the insertion loss and -3dB points. This is useful but LTspice can do so much more. You can use LTspice in, maybe 8 or 9 different ways to work out input and output impedances, noise and distortion measurements as well as just the frequency response.

Just running LTspice once is fine but LTspice is much more useful than that. Say the filter was to be made with components that had a 5% tolerance. LTspice can “run” a circuit tens of thousands of times and change the component values each time – randomly plus or minus 5% on each component. After all these runs you can see if the performance is good across all the runs. If not then you should be using 2% components.

To do this is a very advanced use of LTspice. Instead of giving a capacitor a value of 100p you give it a value or formula denoted by a name enclosed in curly brackets { } then somewhere else in your circuit you define a range of values that it should take. I wanted the system to pick random values for me using a standard distribution also known as a Gaussian distribution, there is a GAUSS function available. Here is the modified schematic. Check the helpfiles for what .PARAM and .STEP do.


 

I told LTspice to do this 5000 times – see the .STEP command above and in the help files. The 5000 runs took 15 minutes on a fast laptop. I have run jobs overnight, early in my professional career I once ran a simulation that took 26 days to get an answer. (glad it wasn’t 42) The plot below is after 50 runs. One of the runs has a 2dB discrepancy and would affect 30MHz. But it is mainly ok. 



 

Looks like a reasonable filter, even if built with 5% capacitors and 10% inductors…

This is not a tutorial on how to use LTspice – just to show you it can be a useful tool. It is a simple tool to use and there are several good Youtube videos and blogs showing you this – a good start is; https://robs-blog.net/2017/02/10/lt-spice-for-radio-amateurs-part-1/ More advanced is the webpages of Gunthard Kraus at http://www.gunthard-kraus.de/ he also covers QUCs and microwave simulators. I have corresponded with him and he is a good guy. The youtube videos of “FesZ Electronics” are excellent but can be advanced. https://www.youtube.com/c/FesZElectronics/videos LTspice can be downloaded from https://www.analog.com/en/design-center/design-tools-and calculators/ltspice-simulator.html And there is most excellent support from https://groups.io/g/LTspice I hope to update my own blog soon on 8 lessons on using LTspice for transistor design for simple RF buffers check out http://mi5afl.blogspot.com/

Go and play … I mean experiment…

17 - Building a Lowcost HF transceiver from Scratch

Building a Lowcost  HF transceiver from Scratch.

Transceivers have only 4 different types of circuit within them, so making a complete transceiver is not overly difficult, particularly given the availability of very low cost test equipment and modern designs that are simple and convenient to make.  Radio Amateurs who do this are called homebrewers and it is an active and growing part of our hobby. I will document my journey to making a particular design known as the uBitx.

The four types of circuit are;

Filters, two types are often needed; Lowpass made with good quality capacitors and hand wound coils, usually on a simple powdered iron toroid core. Also needed are bandpass filters often made with a number of quartz filters to provide good selectivity or purchased as a ready made crystal filter.

Amplifiers; The uBitx receive chain uses a number of simple three transistor circuit, 4 identical modules are needed. The uBitx also has two simple one transistor circuits as a microphone amplifier and a audio pre-amplifier. The audio pre-amplifier feeds a low component cost audio amplifier but I will replace this with a more powerful audio circuit to drive bigger speakers as I have poor hearing. The other amplifiers in the BitX are in the transmitter portion of the circuit and there are four stages to take the sub-milliwatt RF signals up to 10 Watts. Each stage has only half a dozen to ten components and is easily tested in isolation. In fact building and testing each simple module in isolation is the best way to build.

Mixers; There are three of these, two are identical  each with four diodes and two simple broadband transformers handmade with 8 turns of wire around small ferrite toroid. The third has only one transformer and two diodes. These circuits also have 2 or 3 resistors and the odd capacitor but they are not complicated.

Oscillators; In days of yore these would be the main headache, now they are extremely simple. A single chip can provide the 3 outputs we need. This 8 pin chip is driven by a simple arduino (a nano) so that the frequencies can be changed. This allows a nice modern user interface with lots of flexibility. The software has been written for you so you do not need to be a programmer to successfully construct or buy this module.

And that is it! you can see the circuit of the uBitX at https://www.hfsignals.com/index.php/ubitx-v6/ 

Of course if interested in building a transceiver the uBitX is not the only option, HFsignals.com also describes a simpler design that covers one band only; the Bitx. This design was originally for 40m but can be put onto any other band. 

There is also a most excellent book from the RSGB online shop.










Building a Transceiver by Eamon Skelton EI9GQ and Elaine Richards, G4LFM

This is a very complete and very well explained book. It covers a more complex design but it is a valuable read. The uBitx also has good community support from the groups.io/bitX forum - it covers both Bitx and uBitx. In the near future it will no doubt cover the sBitx SDR transceiver and possibly the unnamed 2m Bitx. 

A block diagram of a conventional SSB/CW transceiver is listed below, it has the four types of object mentioned above, note the RF receiver amplifiers (between the mixers) are paired up but only one of the pair is given 12 volts of power at a time - on the 'R' or 'T' lines. this allows the mixers and filters to be shared by the transmitter and the receiver without needing a lot of relays to switch from one to the other. These amplifiers are designed so that when they are powered down they do not affect the powered up circuitry (much). 

The secret to managing complexity is to divide and conqueror. Once you can build a triangle (an amplifier) a rectangle (a filter) and a mixer (a circle) you have most of the hard work done! I have covered the bandpass filter, the output low pass filter and the crystal filters in previous CONTACT articles, at least partially.



 
 

I intend to make my uBitx in a modular way - each module will be on a small piece of singlesided PCB material, each PCB will be placed on a baseplate of a bigger piece of PCB - 6.5 inches by 6 inches is the target. Soldering bits of braid will connect each module to the base and connect up all areas of blank copper to zero volts. Before making the first module I estimated what size each module might be and made a floorplan. Module size for the filters and mixers was dictated by my use of T50 toroids for the filters and FT37 for the mixer transformers. That's what was in my junkbox! T50's have an outside diameter of 0.5 inch and the FT37's are 0.37 inch.

The main construction technique will be "manhattan" this is where islands are glued or created on blank copper clad PCB board. I also etch a traditional printed circuit board for the amplfiers as I have made many boards this way - using glossy photo ink jet paper in a laser printer to create black plastic toner which can be melted onto a copper board using a smoothing iron. The melted toner protects tracks and pads prior to dipping into ferric chloride solution where the  unprotected copper is eaten away in a few tens of minutes. 

However, just for a change I though I might try something new (to me). As well as supergluing small squares of copper I will grind circles using a dremel and a core cutter that i bought from the GQRP club many years ago - it makes a 3mm circle and a 1mm trough. (The GQRP club currently sell a slightly bigger version). Manhattan layout also allows mid-air connections.

Friday, 11 February 2022

16 - Software, not Ham radio

This started as a post about my view on software development and turned into my memoirs...

Each of us has undertaken a journey that colours our perspective. My journey in writing software began 50 years ago when I was 15 and took a class at school in Computer Science -  a very new option then (1969).

I began with the ALGOL programming language, this was one of the big three languages of the time, the others being COBOL and FORTRAN. We wrote our code on special A4 sheets of paper on a Tuesday and our teacher took them to a local technical college a few miles away on Friday and we got computer printouts the following Tuesday. If you had made a simple typing error like omitting a comma then you had to wait a week for the syntax to be corrected. you have to be careful when writing programs, they can't be approximately right.

Nonetheless, I found the creative part of programming very satisfying, my earliest program found all the primes in the first thousand numbers, I still remember the algorithm, it was mostly inefficient although my version was smart enough to only search up to the square root of a thousand plus 1.

I left school at 18 and went to the local university to study engineering, after 6 weeks there I was approached by a government department who asked me to undertake an industrial sponsorship scheme - one of their entrants had dropped out and I had mentioned to my entrance tutor I would maybe have liked a year off. The sponsorship scheme was a brilliant way to do engineering, 12 months working in a company, then the university degree with summers spent working in the company and then an obligation to work in the company for a couple of years after finishing, described as a moral obligation and not a legal one. The sweet spot was you got paid throughout all this so I never had to ask my parents for money when I was a student. I ended up with a very high tech company that made microprocessor based medical instruments. They also produced minicomputers to be used in hospital laboratories as well as bespoke software solutions for businesses and labs. Early on they brought in microcomputers from the states and became dealers for the Commdore PET and Apple machines. Early geek heaven.

I remember being handed two thick books and told to write a mastermind program on a microprocessor development board. The books were the Motorola data book and the application manual for the M6800 8 bit microprocessor. A happy 2000 pages that I devoured with intensity. The development board had 256 bytes of ram and had a simple monitor program that allowed entering hex bytes into memory (a "M" command) and to pass control to an address where you had placed your program (a "G" command). The monitor also allowed reading and writing the contents of memory to paper tape - if your terminal was a teletype. These beasts were old and very noisy printers and keyboards with attached paper tape punches and readers, 2000 moving parts and three feet wide using rolls of paper. No glass screens. 

After writing mastermind (also called bulls and cows I think) I went on to write my own monitor, memory test routines and even a disassembler  I also wrote a crude semicompiler that could process BASIC like statements and produce assembly language. Didn't quite get it finished but it did cause me to be interested in compiler writing although it would take me 10 years to get back to it (with the MIPs 32 bit microprocessor)

Mainly I wrote bits of code to talk to bits of hardware that we were building and interfacing to our microprocessor systems. These were card based, it took several cards to make up a system in the 19 inch wide racks we used, a power supply card, a processor card, an eprom card, a ram card, a serial communication card and a parallel interface card. A modular system was easy to debug and repair. single sided 43 way edge connectors and only a few chips per PCB, this worked well and allowed low cost PCBs to be made in-house, double sided but with soldered thru links.. 

Funny how you learn the laws of unintended consequences. The company had 3 or 4 young bright things of which I suppose I was one. I tended to do microprocessor hardware design which also involved some software. Others focused on repair, (Aubrey Sayers) manufacture/production (Helen Hall) or pure software (Nigel Young). After me came Ivan Bell, Alan Watts and Angela - memory fails here... but the company changed direction a bit in later years. 

When I joined the company it did bespoke microprocessor interfacing, bespoke small scale electronic production as well as being a software house and its medical instrumentation product. (a computerised interface to laboratory blood analysers). Aubrey, the young undergraduate/graduate doing repair got fed up replacing a particular chip on the boards - it always seemed to be the one to go faulty. A 74LS133 chip that looked at a lot of address lines and was used to map boards to particular address ranges (the M6800 had a 16 bit address bus - 64k of space but we only 2k eprom board and 256 byte memory RAM boards at first). The reason why the 74LS133 chips broke was interesting, an education.

The 43 connections had +12v pin adjacent to one of the address lines and when you pulled a board out and reinserted it, if you were at a slight angle the gold finger momentarily connected the +12v to the address line blowing up the '133. This happened because, even with the power switched off the +12v was still present on the smoothing capacitor that was on the 12 volt output, it decayed very slowly. It had been this way for several years before Aubrey's smart thinking tracked down the fault (more a feature I suppose). Adding a 10k resistor across the cap ensured its voltage died away quickly and the number of faults reduced dramatically - we had supplied spare boards to 30 or 40 hospitals across the UK and encouraged user repair by board swapping. Nice one Aubrey!

We also brought in (SWTPC) M6800 systems from the states and these even had floppy disks, this was the start of the home computer revolution, at least in the states and we were in the vanguard of bringing it into the UK. We also brought in software libraries such as floating point maths routines and simple BASIC interpreters, tinybasic (3.5k of code), integer BASIC(4k) and a powerful floating point basic that took up 8k of space. I recall wiring code for a system to be used on television for a quiz game - basically snakes and ladders. It was one of the summers when I worked at MSCS as an undergraduate. I had to load the BASIC interpreter into RAM and then load my code as well - both using paper tape. It took 40 minutes unless there was an i/o loading error when I had to reload the portion of paper tape and try again, I remember one day having to load three times and it took to lunchtime to get the system up. Then there was a power fail and I burst into tears and went home. It is not often an 19 year old man cries...

I learnt a lot at this company, then called MSCS Ltd. When microcomputers arrived we were quick to do smart things with them, I recall having a Commodore PET interfaced to a parallel interface board and using BASIC and machine code to drive parallel voltages to DAC chips to set the gain in a really complex data acquistion system that involved making a fast ADC out of three or four chips and having the ADC feed its data into 16k of dynamic RAM, I built the circuitry to access and refresh the RAM in hardware. This memory meant we could do time travel...

We had been commissioned to make a system that monitored faults in power stations, monitoring many voltages and storing 1/5th of a second of data in memory - in a circular buffer. A separate board detected a power station fault and after a short delay (say 1/10th of a second) stopped sampling voltages and outputted the data into a UV paper chart recorder - which took 60mSec to get up to speed. The buffer had the data both before and after the fault and you could go back in time nearly a 1/5th second to see which voltage went wrong first.

My circuit board had scores and scores of chips, my boss Ken Richey had designed most of the digital parts although I had to modify it to get the timing just right to get the dynamic RAMs to work. The full system went into a wardrobe sized cabinet and was an impressive bit of work. It spawned a company that sold them into the Americas and went on to great things (Power Automation Products and then CSD Ltd).

When the Apple microcomputer came along I was fascinated by it, this was the Apple 2 (Apple ][ and then the ][e) and not the later Apple Macs though I did get to play with the Apple Lisa a bit. The Apple ][ came with an orange book that gave complete design details and a complete industry was spawned making add on interfaces. The back of the microcomputer had 8 slots which allowed adding lots of extra boards to interface to external equipment - really handy for MSCS which was interfacing microprocessors to all sorts of industrial devices

I designed and built lots of plugin boards; serial boards, parallel boards, even bank switched memory boards. These all required software written in assembly language for the Rockwell 6502 which was very similar to the Motorola M6800 I had started with. I made many complete systems, my favourite was used in a lab in the Department of Agriculture in Belfast. It controlled three bomb calorimeters. These had relays that caused a heater to burn all the oxygen in a sealed container that contained pig shit I think. The computer had to wait for a stable initial temperature, trigger the burn and wait for a final stable temperature, the more "fuel" (calories) the higher that final temperature. A human had weighed the sample and had to enter a serial number into the computer.

One of the unique things about the Apple ][ visual display was that not only was it completely memory mapped, there were routines were you specified the coordinates of a box within the display and you could scroll it by calling a routine in the Apple firmware. I wrote a system that split the screen into 4 or 5 and included three vertical columns that showed data for the three calorimeters. These scrolled independently and the various numbers changed and flashed, displayed inverse video etc as the state of each machine changed. Remember this all predates windows!

I recall avidly reading the Byte magazine and Dr Dobb's journal every month and soaking up what was going on in microcomputers. I taught myself USCD Pascal which really replaced all the Apple innards with a new operating system, very interesting. As MSCS was a selling lots of different stuff, the development engineers often got to "test" (play with) things before we shipped them. Hence I also played with the CP/M operating system and some of the other languages it could support. Colleagues used Forth and Fortran, my boss even played with LISP. Often we could use the new technology to deliver a solution to a customer - we got to stay on the bleeding edge of technology and the customer got a product that performed well or could do extra things, 

I also had an introduction to minicomputer programming as we had some bigger systems, bit like the DEC PDP range of machines. I also recall the first 16 bit microcomputer arriving at the factory for evaluation, this was the predecessor to the IBM PC. In fact it ran CPM/86, the first MSDOS was yet to arrive. I remember laughing when the machine beeped and said "ERROR: Keyboard missing, hit [F1] key to continue"

An IBM Dealer manager arrived to assess whether we could sell IBMs. An interesting guy, I had little experience of very (very) big companies and the strict all encompassing culture of IBM was amazing, though not my cup of tea. He said that IBM often setup two factories to make something, at opposite sides of the world sometimes. The job of one factory manager was to make it cheaper than the other one. They also did not add up the manufacturing cost of a product and just add a margin (multiply by a ratio is actually more accurate) to set the selling price. No, IBM had decided they could afford a chunk of money to make PCs (actually only one day of IBM's annual turnover got invested at the start). So to set the price they asked the marketing department, "what is the highest we can charge for these computers so demand is suppressed and we only manage to sell x million of them" This is why the IBM PC was twice the price of anybody else and a large clone market appeared. 

It was a salutary less in business methods that this was a brilliant strategy, "Make it for as cheap as you can and sell it for as much as you can" There are a lot of smart people at IBM.

However the time came for me to move on. Developing products all the time is stressful and can have very long hours, particularly in very small companies. I had been a part time tutor for the Open university and an opportunity came up to apply for a lecturing post in the University of Ulster - actually called the Ulster Polytechnic at the time but the name change was planned for the following year. I successfully entered academia on a "Fresh Blood" appointment and stayed there until I retired.

I never fully embraced the academic side of things, the traditional career route of churning out papers . These sometimes came so fast, one had to doubt their value, but it is part of the game. Besides by doing lots of consultancy I got to play with interesting things and enhanced my salary too - academic research grants got you money too, but you could only spend it on certain things, going to conferences, hiring PHd students and sometimes getting equipment. I also enjoyed the teaching and specialised in embedded microprocessors, both digital hardware and software. In fact as new technology came along I was able to amend teaching curriculums to suit my own interests and got to learn and lecture on Linux as an embedded operating system, 32 bit microprocessors, Internet Socket programming and Real time operating systems (FreeRTOS). To really know something, you should teach it. Geek heaven again!

In the early days you were left alone to become an expert in something and the freedom to study what you wanted was fantastic. I tended to work 60 hour weeks until the Summer and then disappeared with my computer and with a few interesting textbooks to the caravan in Donegal and latterly away abroad in our cruising yacht, France and the Baltic. I set many interesting final year projects for students to undertake; most of colleagues found this a hindrance to their own work but I loved it as an outlet for some of my more outlandish ideas. I was involved with dozens of industrial consultancy schemes; Teaching company projects, Fusion schemes with companies over the border where I mentored young bright things in industry in specific projects for the companies they worked in, usually a new product or product line/area and occasionally new processes. This certainly kept my brain alive!. There were also one week Innovation Voucher schemes where I worked with entrepreneurs on their own, sometimes, outlandish ideas. There were a couple of longer term projects too. All good fun, really good fun.

My interests in Ham radio and Sailing are listed elsewhere, but this is where I came from... so far ok...

15 - Taking Measurements of the modules of an SSB Transceiver

A transceiver has 4 basic modules, repeated in various guises. Oscillators, mixers, Amplifers and filters. I will describe how I tested the modules of my sctratchbuilt uBitx

The list of some of my ham shack test gear that could be used is; 

DVM (even a simple, cheap one - £10 is useful but even better  is to have  2 or 3)

NanoVNA (under £50 this can be used as an antenna analyser and is very useful)

SWR Meter that can measure Power can be useful once the power gets above 1W

Signal Generator - though you can use the transmitter part of a working transceiver. You could make your own but it is probably better to pick up a second hand unit as it will probably be much more stable with more accurate level attenuators. £50 to £100

Oscilloscope, even a cheap 20MHz one (£20 second hand) is useful but the more recent Digital types that pass data to a PC using the USB interface is much better - they sometimes have a very slow Spectrum display. I have a 200MHz one that cost £200.

Component testers; in the old days these might have been a substantial RLC bridge. There are some very cheap modules available on EBAY - the GM328 or LC-100A cost under £15.

Frequency Meter, older units are now available second hand form EBAY for £50 to £100. But there are new uncased PCB modules that cost under £10. They work well provided the input is at a suitable level. At a pinch you could use a working receiver.

Spectrum Analysers, old substantial units are available second hand from £300 upwards (new ones could set you back £1500+) As an alternative you can use a SDR with spectrum analyser software - I use a RSP1a from SDRPlay (£92) although you will need to build an attenuator, The SDRPLay SDR's have properly calibrated input stages that allow display of signals with accurate display of levels to within 1dB but are easily damages at inputs much above 1mW (0dBm) and distort slightly if the input is above -10dBm so keep inputs low for the most accurate readings. They are superb if you do this.

Attenuator - you will need two or three fixed ones and a switched one - I made one with 8 slide switches that can bring in 20dB, 20dB, 20dB, 10dB, 6dB, 3dB, 1dB and 1dB  allowing any values from 0dB to 81dB. fixed attenuators are made up of three resistors so you knock them up as and when you need one. Be careful above 30MHz and check your homemade devices.

Return Loss bridge -If you don't have a NanoVNA you should make a simple one of these  -they only have 4 components and will cost you about 50p plus a couple of connectors - I try to standardise on BNC and use adaptors to convert to and from these if needs be.

An RF Two Tone oscillator is vital for certain types of measurement such as IMD. Slightly more tedious to make, mine has a pair of two transistor crystal oscillators, each built in its own metal Altoids mint tin along with 7 pole filters, the output of each is put into a 3dB combiner/isolator and the whole assembly put in another metal case, made up spare PCB material soldered into a box shape, still only under £10 for the bits

A testbench amplifier - a broadband, well screened unit that can provide 15 to 20dB of gain, at lowish levels of under 50mW output, you might want a higher power one to drive and test 1W and 10W amplifiers - but you will be building these anyway as you build your transceiver - provided you build in the right order! you can build a couple of extra units so you will have them for later projects.

Power amplifier sampler will allow easier testing of the output of driver and PA stages. A high power attenuator would be handy too.

Of course you will also need a soldering iron or 3, desoldering braid, flux and cutters, pliers and probably a couple of magnifiers, one of which should be an illuminated light. - unless you have young eyesight!

I have more than this of course as I hoard stuff and have 2,3 or 4 of everything, but if you were setting up your own lab in the shack using this list you would probably spend £350 to £500. You should make your own gear as much as possible, but you should be prepared to spend money on your hobby. Some people spend much more than this playing golf (per year).

Now to the tests;

Filters, you will be making lowpass filters, as well as crystal filters. Some designs require bandpass filters although the uBitx does not. It has some LC circuits used as matching circuits. The things needing measured are corner frequency, passband loss, passband ripple and Slope in the stopband. All of these can be done using NanoVNA and it can also measure the inductance of any coils you need to wind. Crystal filters are a bit special in that you need to buy more than you need and then to select a group with frequencies that are very close to each other. With care the NanoVNA will suffice but you may need to make a couple of jigs (costing under £1 each) as it is quicker to use a jig and a frequency counter.  

Ampifiers Most of these are low level but the transmit chain might have 4 stages of gradually increasing power, maybe 10mW, 100mW, 1W and 10W (most amplifier designs use gains of 10 or so in each stage - better to be conservative to reduce the chance of instability).  We will want to measure Gain vs Frequency, input and output Impedances (i.e return loss or SWR in a 50 Ohm environment). NanoVNAs are handy for this - provided you use an attenuator on the amplifier output - taking account of the power coming out of the amp - every attenuator has a maximum power rating. Also for the higher power amplifier you will want bench amplifiers to boost the NanoVNA output as most models can only manage 1mW. Protect the NanoVNA input too, using attenuators.

The other parameters you will want to measure is the harmonic content of the amplifier output when amplifying a single signal (you can use a signal generator and spectrum analyser) and also what is the distortion when two signals close together in frequency and amplitude are fed to the amplifiers inputs. This distortion is called Intermodulation distortion or IMD. It indicates non-linearity and the biggest is nearly always due to the third order mixing of (2 * f1 - f2) or (2 * f2 - f1) . This is also known as OIP3 - When the distortion is equal to the desired signal. You look at the spectrum on a spectrum analyser and interpolate the OIP3 as you can never get the output as high as the OIP3 level. This can be a bit tedious and you also need an RF two tone signal generator and attenuators and amplifiers. As an alternative to measuring and calculating the OIP3 you can use a rule of thumb that a drop in the gain of 1dB over what the expected output happens about 13 to 15dB below OIP3 (for amplifiers made of BJTs, ordinary transistors). So we measure  P(-1dB) also known as "Gain Compression" It is easier to do than measuring OIP3 directly - though not as accurate it will give ball park figures. you can use a single signal generator with an attenuator and a oscilloscope (or a simple diode probe and a DVM to measure gain

Actually the OIP3 is usually about the same as the DC power that the amplifier stage takes from the power supply - this is why increasing the current passing through the amplifier devices, either by using bigger transistors or paralleling  4 transistors is sometimes done in the early stages of a receiver - to provide better strong signal handling, important on 40m but it does reduce battery life when operating portable and may make more noise (or less!)

The remaining amplifier parameter is concerned with noise and the minimum discernable signal, (MDS). Measurement of Noise figure (NF) is difficult, current methodology is to use a calibrated noise source and you make noise measurements with it switched on and off, the ratio of these two can be used to calculate the Noise figure using the "Y-Factor" method.

Calibrated noise sources are expensive. Alternatively if you know the NF is low you can use the Hot and Cold method were you heat and cool a resistor and take two readings. Best done with boiling water and Liquid Nitrogen but Ice would do at a pinch, particularly if the expected NF is below 2, not clear (yet) how accurate noise figures of 5 or 6 will fare. One problem with this method is that you need to have the resistance keep its value as the temperature changes - a 0% temperature coefficient. Or maybe that can be fixed using mathematics - if we know the tempco. I haven't done this yet so I am being a bit theoretical.  Another way to measure noise is to use a microwave dish that is good enough quality to be sure of a tightly focused beam path, you can point this at a "cold" sky. 

I will leave noise measurements to the last. I may buy a preamplifer with a known NF (or send it off the someone and get it measured. Once I have that I can make a noise source and test the amplifier using a guessed Equivalent Noise Ratio (ENR) and then amend the guess until I get the right answer!. To be scientific about it I would need to calculate all the expected errors, sum the RMS errors, think about the accuracy of everything and see what the upper and lower limits are or maybe I will keep monitoring EBAY and hope (forlornly) that a dirt cheap Noise Source with a calibration certificate becomes available. By the way, there are uncalibrated noise sources that are useful accessories to a spectrum analyser - if you pass wideband noise through a filter you can see the shape of the filter's response. Such general purpose noise sources only have a few components and can be bought or built for under a tenner.  Mediocre proper noise sources start at £200

Mixers In an ideal world we measure the loss, the noise and the distortion behaviour. Mixers have three ports, low-level RF is applied to one port and a mid-level oscillator is applied to another. Mixing takes place and the sum and difference of the two input frequencies appears at the third port, This describes how they are used on receivers with the RF and Local Oscillator(LO) ports combine to present an output to the IF port, When used as a transmitter the roles of the RF and IF ports are swapped. Noise is usually taken as the loss, this will be close.

To test a mixer we can use two signal generators; one strong, one weak. Then by using a switchable attenuator between either signal generator and its mixer port you can do a series of tests to prove basic functionality - using a Spectrum analyser on the IF port, the IF port must have a 50 Ohm load on it, most SAs have this built in. As well as observing the mixing process on the spectrum you can see the insertion loss, probably about 6dB below the applied RF. A lot of mixers use 7dBm LO levels but higher is better, the OIP3 is close to the power level of the LO and the IIP3 being higher by 6dB or so. Of course you mustn't overdrive the diodes. LTSpice can offer up values to try.

Measuring Distortion is a bit harder, I will focus on 3rd order IIP3 and OIP3 (they differ by the insertion loss) To measure IIP3 you need three signal generators, the Local Oscillator and a RF two tone generator for the RF port, The Spectrum analyser is used to measure the signal levels at the IF Port, there are 4 frequencies generated at the Additive frequency and 4 at the difference frequency. for example the Additive 4 are displayed as two middle signals of ToneF1+LO and ToneF2+LO and the lowest and highest of the 4 are the third order IMD products of (ToneF1*2 -ToneF2) + LO and (ToneF2*2-ToneF1) + LO.

Mixers only work when properly terminated otherwise any signals reflected from the IF port go back into mixer and get mixed with all the signals present, so a smorgsbord of signals come out the IF port where they reflect back to the mixer. This rapidly growing list of spurious tones gives the mixer the opportunity to create more IMD products near our desired signals which will be heard, or at least have an effect on the quality of the final audio signal, clearly undesirable. To get a 50 Ohm load for the mixer will require a diplexor or an amplifier with a broadband Zin of 50 Ohms. The ubitx uses Termination Insensitive Amplifiers designed with the correct Zin. A mixer's output should never feed a crystal directly as the Zin of (any) filter varies such a lot. A diplexor is a filter that passes the desired signal without attenuation and passes any other frequency into 50 Ohm resistors.


Wednesday, 1 September 2021

14 - Components; the map is not the territory, models and real life: LTSpice and the uBITx

In the beginning of our learning about electronics we concentrate on RLC components - Resistors, Capacitors and Inductors before moving on to study transistors and diodes. Possibly studying transformers a bit along the way.  It would have been better to spend longer on the passive components. 

To learn that resistors are not just things obeying Ohm's law; R = V/I  (Ohms are simply volts per amp). This is only true as a first approximation - once current begins to flow the resistor heats up - and invariably its resistance changes for each degree of temperature rise. The wires of a resistance possess inductance, maybe 20 to 50 nH per inch. And there is a capacitance or two present as well!

Capacitors are not that simple either; A lot of types of modern small capacitors have capacitance values that vary dramatically as the DC voltage across them varies. Larger, older capacitors have only a nominal value - +80/-20%  - a so called 10,000uF electrolytic capacitor can be anywhere between 8000 and 18,000 uF in value. And it ages, so after a year or so its value has changed, more so if operated in an elevated temperature. And after 20-30 years you need to throw them out and replace them - they have dried out (this is how you fix old valve gear). Their value also depends on the frequency of any AC passing through it, and just to make life complicated this is a voltage dependent effect. Luckily a lot of modern circuits don't care what value the capacitance is as long as it has a low effective series resistance (ESR).

Of course it does depend on how the capacitor was made - its type. I sometimes think a degree in chemistry would be useful in remembering all the different materials and constructions that modern (and old) capacitors used.

So much to learn and so little time.

And then we come to inductors. These can be;
  • Air-Cored spiral -wound like a cylinder
  • Wound on a magnetic core in the shape of an; E, or U either solid or built up from flat laminations
  • Wound on a round pot core 
  • Wound on a rod, there are several ways to wind the turns too, and different types of wire
  • a flat pack with a slit or mounted over a set of turns laid down on a flat substrate (e.g SMD inductors or inductors made of PCB material 
  • a cylinder with one, two or six holes or 
  • a ring/doughnut structure (which to be fair is the same as a cylinder with one hole.)
The material can vary from various irons through to ceramics of nickel, zinc, manganese.

The applications can use;
  • DC, 
  • low frequency AC such as 50 or 60 Hz
  • Slightly higher frequencies up to 100kHz and lately to nearly a Megahertz for switching power supplies and battery chargers. 
  • Also radio frequencies that are lowish, under 3MHz or 
  • In the radio bands we use for High Frequency communications (3 to 30MHz) or
  • very and even ultra high - VHF/UHF as well as 
  • microwaves as found in mobile phones, satellite dishes and microwave (sic) ovens.
  • I suppose the millimetre waves of 5G must use inductance, not sure we'd recognise them.

All very complicated. I explore inductors more in other blog posts on this site (http://mi5afl.blogspot.com/ ) I am still learning.

We need to "manage the complexity" and as humans we abstract the truth to things that are easier to work with. Thus we use Ohms law and formula for the impedance (Reactance) of coils and capacitors and can work out approximate voltages and currents for networks of components. We use "ideal" components, we assume everything is linear - is well behaved with no second order effects.

Complicated networks can sometimes be simplified by applying the formula for series and parallel components, sometimes with star to delta conversions or by judicious use of Kirchoff's Voltage and Current laws or conversions using Thevenin or Norton equivalent circuits. You might end up having to solve simultaneous equations, or you can create enormous matrices and then have to do Matrix inversions and other Matrix arithmetic

All good stuff, and why it takes 3 or 4 years to make an electronics engineer.

Instead you can let the computer do the heavy lifting. Modelling and Simulation programs are now vital tools for a practising engineer. You can not expect to manually solve the problems in a finite time span and are obliged to use a computer. Spreadsheets are also useful, particularly with their complex number formula. Spreadsheets make smart people smarter, although...

The most famous/often used circuit modelling packages are based on the free and open source SPICE program that came originally from Berkeley University in 1973. The name SPICE stands for Simulation Program (with) Integrated Circuit Emphasis but it can be applied in a number of applications. There are several important SPICEs available. The Linear Technology Company (now owned by Analog Devices -ADI) give away LTspice at no charge. The free, open source KICAD Schematic Capture (circuit drawing) and PCB layout tools package includes NGSpice and the MicroCap software is now given away free (used to cost thousands of pounds but the owner has retired and has been most benevolent in allowing anyone to use MicroCAP free). The URLs are below. There are also spice programs available to purchase - PSpice does have a 30 day trial version available (and a restricted free version) and is quite popular in Universities, they also use HSpice and other very expensive packages. There are a number of textbooks on LTspice and Pspice available on Amazon and support forums and Youtube videos for both available online. There is little to choose between them, I find LTspice easier and quicker to learn and it has many more downloads than any of the others, so presumably it is much more popular.

Downloads:
https://kicad-pcb.org/ - has NGSpice built in (and is a superb drawing and PCB package)
http://ngspice.sourceforge.net/ - if you choose not to want KiCAD, you can just get NGSpice

As a trained engineer I was taught to calculate voltages and currents around simple transistor circuits. To do this we pretend the transistor is a sub circuit of resistors and capacitors and voltage and current sources that are dependent on some external value. I realised it was all over one day when I looked into how SPICE calculates transistor models. I was using 3 components per transistor at lowish frequencies, rising to maybe 8 or 9 at radio frequencies. I discovered that there were 54 different parts to the transistor models that SPICE was using when it calculated circuit values. We can't compete, the machine has won.

You can use the package to;
  • Work out the DC operating point (no signal applied) - the values at various nodes around a circuit to help you fault-find and check the bias conditions have been calculated correctly.
  • Work out "small signal" performances; gain and frequency responses are obvious examples, but also the input and output impedances  (and how these vary with frequency) - this is important when you interface two modules together.
  • Design filters and see how changing a components value to a standard value affects performance. (there are even tools that can generate LTSpice files by filling in a form about what type of filter you want - see http://www.tonnesoftware.com/elsie.html or other tonnesoftware programs)
  • Work out how much noise a circuit produces. I want to experiment with this...I am a bit dubious about how accurate the noise data included in some transistor models by manufacturers are, whilst microwave transistor models may be accurate I think a lot of ordinary transistors have nominal or even missing noise parameters in their models.
  • Work out what the maximum output can be before clipping, Usually either the "one dB compression point" or the third order intercept point (IIP3 or OIP3) or even THD.
  • Calculate what harmonics are produced.
  • Work out the power consumed or how much power each component dissipates.
  • Calculate the temperature rises in a circuit and its effects.
  • Of less use to amateurs perhaps - but you can vary every component randomly about its tolerance values - this tells you that if you build a thousand circuit boards, how many will pass or fail some output test. - known as Monte Carlo testing. You can use this to see if building a filter using 5% tolerance components is likely to give a reasonable performance.
A lot of useful LTSpice tutorials are found on Youtube by FesZ Electronics; his playlist of videos covers nearly everything about LTSpice. See https://www.youtube.com/playlist?list=PLT84nve2j1g_wgGcm0Bv3K4RSl2Jdjsey 

I will (eventually) give a circuit and results for the amplifiers, filters and mixers used in the ubitx - an all band SSB/CW transceiver available for home assembly at £125 (PCBs are already soldered - you just put it in a box and wire up the leads). The transceiver is described at https://www.hfsignals.com/index.php/ubitx-v6/ and the schematic is at http://www.hfsignals.com/wp-content/uploads/2019/12/ubitxv6.pdf. 

The ubitx (and earlier singleband Bitx) was designed by Ashhar Farhan VU2ESE from India. A superb designer. He has also published a Youtube video which I found inspirational; it covers the design, building and testing of a simple feedback amplifier - a single transistor circuit that is the basis for all his RF low signal amplifiers. Understand it and you can understand nearly all the others.

The video discusses the circuit, then he solders the components on a small piece of copper PCB material - blank, un-etched  copper (single or double-sided). He solders one leg of a component down to the board if it is to be wired to "earth" or 0 volts. This leaves enough legs sticking up in the air to solder other component between them - the entire circuit is wired up in about 2 minutes! This is known as ugly construction and whilst not pretty, is actually very effective at radio frequencies. He adds a couple of BNC connectors and a power jack and powers up the circuit. His only test gear is a $100 homebrew antuino - he designed this antenna analyser but it can also "receive" signals and plot their amplitude. A £35 NanoVNA would do instead. 

He shows you how to measure the gain, the input impedance and output impedance and how they vary with frequency as well as the maximum amount of signal the amplifier can accept before generating distortion. These parameters define nearly everything about the amplifier (with the exception of noise figure and some phase data)

Gain 17dB drooping slightly at VHF
Input SWR and output SWR - the antuino can measure return losses or SWR.
50 Ohm input impedance, Rin - a NanoVNA can gives Zin directly.
50 Ohm output impedance. Rout - though by measuring Return loss we can estimate Zout 
Input third order Intermodulation distortion (IMD) Products  of +8dBm, this is called the IIP3

Anyone interested in homebrewing radio circuits must watch this 51 minute video
https://youtu.be/j3Xf_SpK7qc Titled "Design, Build and Test of a Feedback Ampilfier"

I have put the circuit into LTspice and simulated it - and got the same results as the physical measurements (always a relief!) and may create a powerpoint presentation or Youtube video - as much as an example of how to use LTspice as well as being a useful adjunct to Farhhan's work.

There are a number of simulation runs in the video/powerpoint;
- Applying a sine wave signal and seeing the output - much as a signal generator and scope would.
- measuring voltage gain using this - noting Vin and Vout. Calculating Power gain in dB.
- varying the input until we can see (qualitatively) when distortion and clipping is occuring.
- Measuring input voltage and current to get input impedance (with output terminated in 50 Ohm)
- Measuring output impedance by applying a signal to the output and measuring its V & I.
- A better way to measure gain, Zin and Zout using "two port analysis" - the .NET command

- Measuring the Noise Figure - as I said above,  I am dubious as to the accuracy and presence of noise data in the models of many transistors but the results are plausible. Hard to measure physically to verify. If I can't get a calibrated noise source soon I may need a thermos flask of liquid Nitrogen - but that's another story.

- Distortion; I had bother here, I did the same two tone test that Farhhan does but my results were initially suspect. I had to use the FFT function in LTspice and lean heavily on the way data is gathered in the package. I got it working with considerable help from the LTspice forum at groups.io ( https://groups.io/g/LTspice ) (the secret was to have a tiny "timestamp" which meant it took 40 minutes and several gig of diskspace to run the simulation!

Most of the time we use the .TRAN and the .AC analyses of SPICE.


A .TRAN analysis runs for a fixed time period from startup and uses numerical techniques to calculate voltages and currents at every node using large signal/non-linear models of the components. The .AC analysis works out the .DC operating condition and then creates a small signal/linear model of the circuit at that bias point. It applies a single frequency sine wave, calculates the V and I assuming linear operation, changes the frequency of the input signal and repeats the process. It sweeps the input across a frequency range and is useful to see frequency response. It is using an approximation of the actual circuit but is useful nonetheless.


Quote from groups.io LTspice forum

"Small Signal Analysis takes a system, and linearizes it about its operating point, and because the system it looks at is a linear system, there are a lot of powerful techniques that can be used to very precisely analysis the system, and often get closed form mathematical results. (But the precise answers are to an approximation of the system).


Large Signal Analysis, uses a much more detailed model of the system, including non-linearities. Because of this, you rarely get significant closed form mathematical results, but the systems tend to (be) processed with numeric methods. These answers tend to be approximations, but to a much better model of the system, so can be more accurate."

And a further quote

"an .AC analysis in SPICE, ... SPICE converts those transistor and diode models into their small-signal (linear) equivalents at the DC operating point of your circuit, and all results from that point forward are based on that.  Even if your simulation uses 10KV AC signals, the diode and transistor models in that .AC simulation are small-signal models because they've been linearized.  But they were linearized starting with the original nonlinear (large-signal) models.


In a .TRAN analysis, the simulation uses the full nonlinear model so it works for small and large signals."

And

"One common way to determine whether a signal is small enough to be “small signal” is to do a transient (.TRAN) analysis using a sine signal source. Then, you can do a Fourier Analysis of the output. One of the metrics of this analysis is a harmonic distortion number. You can then vary the amplitude of your input signal until the harmonic distortion is “small enough”. At this point, for your application, it is then Small Signal."


LTspice can calculate THD (total harmonic distortion) which suits audio amplifier designers. RF designers work with third order distortion rather than the total distortion as it is usually the biggest and our circuits have filters or we are only interested in outputs around a single frequency or frequency band. The distortion due to third order products should increase rapidly as the input rises (three times more rapidly). You can test for this by applying two similar tones f1 and f2 at a certain level and use the FFT function to see the distortion (2f1-f2 or 2f2-f1). i.e if you apply 0 dBm tones and get 2f1-f2 at -46 dB below that and then increase the inputs to 3 dBm you should see f2-f1 at 9dB higher or -40dB below the tones. My initial run of LTspice did not do this. I was not setting the FFT parameters correctly and others have noted "funnies" in the FFT results.  Gunthard Kraus simulates an entire 137MHz satellite receiver (convertor) using LTspice at http://www.gunthard-kraus.de/LTSwitcherCAD/SwitcherCAD-Tutorial_English/pdf-File/ When I noticed this I went on to assess IMD a different way - If you apply a signal and then increase its strength, there comes a point when the amplifier cannot amplify enough and the gain starts to drop, a standard value is when the gain drops one dB from its theoretical value. the "one dB compression point" POUT(-1dB). The OIP3 figure tends to be 13 to 15dB above this value in BJT amplifers and about 10-12 dB in FET circuits. This gave me an alternative way of estimating OIP3.


In parallel with this work I asked for help on the forum, Tony Casy, Andy, Vlad and Dana all replied (it is a really good group) and gave me FFT settings that finally gave believable results - I could see third order products rise three times faster than rises in the input - which is correct behaviour and also the OIP3 were about 15dB higher than the 1dB compression point which further reassures me the results can be trusted. Tony also created a version of one of my models to present automated results of compression, it uses a lot of LTspice commands but a lovely example of what a "power user" can do


See my Youtube videos when they go up as there is a lot of fiddly bits to get it all working - spread over 8 different LTspice simulation runs. They are a good example of how to use simulation as a design tool when designing, or before building, homebrew transistor circuits to be used a amplifiers as part of receivers and transmitters. 


Of course LTspice is also very very useful for filters and other radio circuits. When I get around to simulating the uBitx I will be simulating mixers, filters and audio circuits - hopefully everything!. I have a simulating model of a ring mixer already and it works - the computer gives the same answer as the theory and the same results as a real circuit. One wrinkle to the model is that all 4 diodes have the same model parameters - absolutely identical. In real life, if you pick up 4 diodes they all differ slightly, we often manually match them by picking 4 from a larger batch so that they have the same forward voltage drop maybe within a millivolt or two (at a chosen fixed forward current - perhaps what the diode test function on your DVM uses!). This is important - as a first approximation, but of course the question is - are they still matched at differing currents and what happens when the ambient temperature increases? This is an example of when you need to do multiple runs at slightly different conditions. In LTspice this can be done by using Monte Carlo simulations and these can take a lot of time - I shall be running my computers overnight or longer to get results for this one. It will have to wait until I am actually building my uBitx however and I will create detailed diode models from the few hundred diodes in my junk box by measurement. 


No manufacturer publishes the data that I need to see the statistical tolerance spreads on the parameters - they usually just publish a single figure, or at best (but very rarely) the three figures of minimum, typical and maximum. I need the standard deviations of each published parameter (assuming a normal bell curve spread of values). This is way beyond what a hobbyist radio amateur needs but I find it interesting and the current situation is giving me time to be thorough. (Not sure if it is the lockdown or the fact I am recently retired)










Wednesday, 27 May 2020

13 - Experimenting with Chokes - The theory behind good ones!


Experimenting with Chokes 
<< changed 10th June 2020 to fix bad Al value for type 31 - redid graphs and tables>>
A real antenna is never symmetrical, it is affected by nearby wiring, pipework and pieces of metal or even conductive earth. If you use coaxial cable then there are three paths for current. Through the centre conductor, through the inside of the coax sheath and the outside of the coax sheath. The two surfaces of the sheath are independent of each other. Electricity at radio frequencies only travels on the skin or surface of conductors – this is known as the skin effect. (at 3.5MHz 2/3rds of the current is within a 1/30th of a millimetre of the surface). We don’t want current on the outside of our coax for two reasons. It makes it act as an aerial – both for transmit and for receive and it brings RF into your shack.
When you unintentionally transmit via your antenna feeder it may reach nearby electronics and cause interference – obvious in the old days because analogue televisions were so susceptible to it (TVI) but nowadays the effect is much more subtle, burglar alarms may go off in the next street, your coffee machine may decide to switch itself on or it may even go unnoticed - your Wifi may drop to a snails pace or your phone may drop from 3G to 2G. Even if unnoticed you should try and stop it.
On receive, interference from your home, and the homes on either side of you may be coupled onto the outside sheath and these end up at the input terminals of your receiver. Either by going up to the antenna and back down the centre conductor or by lifting the earth potential of your antenna socket at the back of your transceiver. You may not notice this except to comment that you appear to have a noisy antenna or you may hear harsh buzzing or whistles or bursts of noise at specific areas of your tuning dial. Some internet lines coming into the house are inherently noisy at HF (VDSL in particular) and modern Wifi extenders that use the mains wiring, a lot of LED lighting and even smart phone and tablet chargers can cause problems (modern phone chargers use switching technology and may or may not have anti-interference components fitted – a lot of Chinese units fit the components to the units that are sent to get tested for EMC and then the production line omits the components once mass production starts. 99 times out of a 100 they get away with it.)
RF in the shack may or may not get noticed – this year, but maybe you change something next year and strange things happen – your transceiver won’t switch from transmit to receive, your internet goes slow (I had this problem and only noticed it when the spectrum waterfall on websdr.org froze when I transmitted at 100W on 17m, it was ok at 50W and I fixed it with a choke) or your lips get burnt when you kiss your microphone (don’t kiss your microphone!)
The current travelling down the outside of the coax sheath can be reduced to nearly zero if you insert a choke or two. Usually called a common mode choke(CMC) as it does not affect the differential current that flows up the centre conductor and back down the inside of the coax sheath.
If you wind coaxial cable in a coil then the differential currents don’t realise this as they are effectively shielded from the outside by the thickness of the sheath but the outside of the sheath notices as it is now having to pass through a coil – a coil that has some inductance and hence reactance measured in Ohms. A 500 Ohm choke in a 50 Ohm system will reduce the common mode currents to 10% of what they were – current from antenna asymmetry elects to take the path of least resistance (sic) and travels down the inside of the coax instead (it acts as a balun but I don’t like the term balun or unun – I try to use the terms chokes and transformers).
If the current is induced onto the sheath from an external source then the resistance causes the interference to dissipate as heat – it doesn’t reach the shack (or the antenna)
However a coil of coax is only effective at one frequency, it possesses capacitance between its turns as well as inductance and this causes a resonance – which is good at some frequencies but poor at others. Resonance can give unpredictable results and is difficult to “tune” to the correct frequency. The coil must not hang near a metal mast either.
For multiband performance, chokes should use ferrite material such as toroidal rings or tubes. Ferrite beads are sometimes used but they are very expensive and heavy if they are to be effective. I will concentrate on ferrite toroids and not powdered iron toroids. Powdered Iron should not be used as chokes, they (a) won’t have enough inductance and (b) are low loss (high Q) and we want lots of loss in a choke. High Q circuits make poor chokes as the resonance peaks, whilst of a very useful high impedance is only present over a narrow band of frequencies and that frequency moves according to stray capacitance. Powdered Iron make good filter inductors and narrow band transformers. Powdered Iron toroids are named with a T such as T200-6 and they are nearly always painted, red, yellow or glossy black etc.,
We can use ferrites to make broadband transformers, where different criteria apply. I am talking about chokes here.
Ferrite Toroids are named with an FT prefix, such as FT240-43, this has an outside diameter of 2.4” and is of type 43. Other common types include -31, -52 and -61 as well as several in the 70’s which are better suited to switching power supplies and frequencies of a few hundred kilohertz. You occasionally see them used on top band (1.8MHz).
Manufacturers produce datasheets that can be confusing. They sometimes quote that a given ferrite type is suitable for a certain frequency range and then you see them being used at other frequencies. The reason is that a ferrite can be used to build a transformer where we want low loss, or a choke where we want high loss. Also sometimes we want resonance and sometimes we don’t – or we want a wide band smeared resonance and not one that is too peaky. A narrow peaked resonance does provide very high attenuation but external reactances will detune and move the peak.
Also type #43 is really common and widely available – it is good enough even if used on non-optimal frequencies. The more recent #31 is a better choke at lower frequencies (say below 10MHz) and very nearly as good at higher frequencies. Of course choking impedance is not the only design criteria – we should worry about power handling and how smooth the response is over the entire frequency range of interest.
I found the excellent charts produced by Steve Hunt G3TXQ(SK) to be a good starting point – he did a lot of choke measurements. My studies took me to excellent documents by Jim Brown(K9YC) and some really useful calculators and spreadsheets by Owen Duffy(VK1OD). You should study their websites for further information.
Here are diagrams found on Steve’s web site http://www.karinya.net/g3txq/chokes/


Here we see that 17 turns on a single FT240-43 should give 4k to 8k of choking from topband to low down in the 10m band. But it is only resistive from 4.5 MHz to 12 MHz (the thin black line shows this, but we really need to know values)

On the face of it the type #31 seems not as good as the #43, 12 turns on a single




core FT240-31 gives 2k to 4k of choking over all bands. More subtly, and more importantly is the black line – the choke appears as a resistance of a large portion of the spectrum – the #31 is very broadly resonant and less prone to a peaky resonance, this makes it better behaved if presented with a nasty range of antenna reactances. In fact after further study I now do not use the charts above as we really need to know the resistive values (the details of the black lines above). The reactance, and overall impedance are less important, since you may be unlucky enough to combine a high choking reactance with an antenna which has the same reactance but of the opposite sign. In which case the choke does nothing. You really need resistance in a choke. I give my own graphs and tables of resistance at the end of this article. I will add them to my blog after this article is published.
Many hams have used the charts above and ended up with 12 turns of coax wound on an FT240-43 – a useful choke, certainly from 80m to 10m. However a closer inspection of the datasheets and the writings of others show that the relatively new type 31 (promoted since 2006) is actually better below 10MHz, and nearly as good from 10 to 30MHz. Again, for well behaved antennas either will do. For antennas well off resonance and presenting reactive loads then the 31 may be better.
Manufacturers do not really produce products to suit radio ham bands – they are in the business of producing ferrites for EMI suppression and also for transformers and inductances for filters. Fair-Rite make ferrites and Amidon distribute them. Also worth knowing is that for some reason Amidon and others rebadge the ferrites so what Amidon calls an FT240-31 has a Fair-Rite part number of 5931003801. Here are what the sellers of these toroids actually recommend.
1Amidon(the distributor) is quoting a different range from Fair-Rite the manufacturer
2 These figures are from Palomar Engineering, rest from Fair-rite and Amidon sites
 
Not a bit of wonder we can have variable performance from 3 to 30MHz! A lot of what is currently done is because originally we only had type #43 – it was easy to get. So custom and practice was to use #43 for 3MHz to 30MHz. It would be better to use type #31 for chokes from 1 to 10MHz and #43 for chokes from 10MHz to 30MHz. If you are buying fresh pick #31. Jim Brown says “a single #31 choke is 
good over a 8:1 frequency range while a #43 choke is good over a 4 to 1 frequency range”.
Here is another chart from Fair-Rite showing its recommendations for chokes

For ordinary inductors or transformers different rules apply, sometimes we pick material for a transformer based on its complex (sic) magnetic properties rather than its recommended frequency range; this is because it is hard to make transformers with a very wide bandwidth and choosing the number of turns and tweaking the transformers becomes an art not a science. This article is only about chokes.
Jim Brown (K9YC) has an excellent set of documents describing choke design – some of it relating to choking RF out of audio cables but he also covers RF choke design fairly rigorously. He sometimes suggest using 5 toroids at a time – which is a bit expensive, Ian GM3SEK has produced designs that are cheaper to make using type 31 tubes rather than toroids. I have FT240 toroids so that is what I will use. I will buy some of the tubes that Ian recommends (in http://www.ifwtech.co.uk/g3sek/in-prac/) as well as some clip on ferrites the next time I go shopping for Ferrites.
Toroids are given values in their datasheet for Al and ui – the Al constant is used for a quick and dirty calculation of inductance. However this is of limited use with ferrites as the value is only accurate at very low frequencies. Real ferrites have a reactance that may start out inductive but at some stage it actually becomes capacitive! And it has considerable resistance as we will see later. The initial permeability ui is just that; an initial value measured at a unrealistically low frequency– real ferrites have a permeability that varies with frequency, and it is not even just a simple number, it is best considered as a complex number, it has two parts µ’ and the µ’’.
The datasheets for the Ferrites show the µ’ and the µ’’ values – these represent the reactive and resistive (losses) values if we are making chokes. They actually chart the complex permeability but this will approximate to reactance (µ’) and resistance (µ’’) – related to the losses in the material. Losses are good in a choke 



So we can anticipate the resistive portions being quite low up to 3MHz and dropping again after 30MHz For comparison here is the #31 graph



Note these have slightly different scales. – at 2MHz the type 31 has 4 times better resistance choking.
I wanted chokes specifically for a new End Fed Half Wave antenna which covers all bands from 80 to 10m but needs good common mode chokes. I resolved to design something with as much resistance as possible. Current thinking (since 2006) has been to try for 5,000 Ohms. It used to be thought 500 Ohms was enough, to choke off the more obvious RF currents. However 5000 Ohms helps reduce receiver noise.
Rather than use Steve’s charts I wanted to calculate my own. I needed tables of µ’ and the µ’’ to build up my spreadsheet. There are tables on the Fair-Rite website at 1MHz intervals which I imported into Excel’s polynominal curvefitting. This allowed me to get a table for the hambands. I then found that Owen Duffy had beat me to it and used more sophisticated cubic spline curve fitting, he had also re-measured some of the values so I decided to use his µ’ and the µ’’ values. Thanks Owen.
The formula for R and X depends on the initial ui and the µ’’ and µ’ values at the frequency (f) of interest. You also need the number of turns (N) and the published Al value for your toroid. Ferrite Al values are only given +/- 20% so the graphs and tables below are only roughly indicative. The formulas for Resistance and reactance are;
Rs = (µ'' /µi ) * 2πf N2 Al
Xs = (µ' /µi ) * 2πf N2 Al

There is one other wrinkle. Real chokes suffer from stray capacitance which alters these equations. I copied an idea of Owen Duffy’s website and re-calculated the resistances with a stray capacitance of 1.3pF, I will be experimenting with different values when I try measuring some chokes.
here are tables of µ’’ and µ’ – from https://www.owenduffy.net/calc/toroid4.htm


You can find the manufacturer’s data at
(there is a link to a . CSV file halfway down the page )
Using the table of µ’’ and µ’ above, I built a spreadsheet and from it produced this graph and table. The spreadsheet on my blog calculates X and Z as well (but those values are irrelevant – Resistance is what matters, at least in demanding applications


Above is a table of resistance for differing turns of RG58 wound on a FT240-31 , I like the look of 15 turns, for 80m to 20m.
Here is the data for type 43;


Here 11 turns looks good 20m to 12m. To get even better performance I decided to add these two chokes in series. The final R,X and Z values for this combination is the R_TOTAL column shows the two chokes together exceed the 5k criteria for resistance (and nearly 10k for Z)



Below is a diagram of a choke
- this one has 8 turns including a crossover winding known as a Reisert Turn.




This allows the input and output to be on opposite sides of the choke and allows more turns. It may reduce capacitance slightly though this is very hard to measure. It seems to make no difference but is easier to wind


In Summary

Current thinking is that common mode chokes need high resistance, high impedance (reactance) is not a reliable way of choking badly behaving antennas.
A single choke will not cover all bands. An air-spaced choke may sort of work on one band.
A lot of commercially available chokes are old fashion designs and poor performers in certain situations. High Resistance chokes always perform well.
The tables and graphs above are new and should be useful to anyone wanting to make a common mode choke. – at least from FT240 types of ferrite. The spreadsheet on my blog can be used for smaller ferrites, although getting RG58 on them is tricky.
I will attempt to measure my chokes in a future article – or try my blog http://MI5AFL.Blogspot.com. Note, measuring high impedance chokes is actually very difficult – I have already fallen foul of my scope probe’s built in capacitance and had bother with heavyweight manipulations of S11 and S21 data in my VNA. (and getting bad data from the internet - http://toroids.info  has the wrong Al value for a FT240-31, http://amidoncorp.com has the right value.


My study of this area has depended on the work of others; in particular

If you go to the "pages" tab of this blog (http://mi5afl.blogspot.com/p/blog-page_15.html )you will get a link to various files I hae written  - the txt of this article as a pdf and three spreadsheets, Ask me if you want me to explain anything.
(mailto: MI5AFL@ARRL.Net )