Friday 18 March 2022

26 - Making Filters using LTspice and a Soldering Iron

Making Filters using LTspice and a Soldering Iron

The Zoom talk I gave to the club at our December 2021 meeting covered a number of points – I have placed the PowerPoint on my blog at https://mi5afl.blogspot.com but thought I might summarize the material here.

One of the filters in the uBitx transceiver is shown below drawn using the simple LTspice tool.


Of course to simulate this we must add a 50 Ohm output impedance and a voltage source with an internal impedance of 50 Ohms. We must also add lines of text beginning with a “dot” to instruct LTspice what to do when the simulation runs. There are half a dozen types of spice command but the two below tell LTspice to do an AC analysis by sweeping from 1 to 30 MHz, 101 points per decade and to prepare two port network parameters such as S21, Zin and Zout. S21 is the “gain” of the filter in dB – it’s what a NanoVNA would show if it was measuring a real filter.


Hitting the “run” icon in LTspice produces a blank white window, right-clicking in it allows you to “add a trace” and you can select S21 (or Zin or Zout). Note you can remove phase information by right-clicking on the right hand axis and you can change the format of the Zin trace to linear by clicking on the left hand axis in the Z plot.



The performance of this filter is quite good for its gain characteristic – it passes 40m (7 MHz to 7.2 MHz) signals nicely and attenuates 14 MHz to -65dB. However, its impedance matching is not great, varying from 65 to 110 Ohms. So, if the design you have picked up from the web or a book is poor how do you design your own?

The ARRL and RSGB handbooks have tables of filters at 1 Ohm input and output impedances and frequencies of 0.159 Hz (this is one radian/second). These are not real filters of course – you scale up the impedance and frequencies to what you need. Not difficult if you follow the instructions but it is tedious.

As well as several downloadable pieces of software (ELSIE or AADE for example) there is a very good online filter designer at https://rf-tools.com/lc-filter/

You fill in the response of the filter you want – bandpass, highpass or lowpass.

You tell it what type;

Butterworth, smooth but gentle sloped.

Chebyshev has a good steep slope but has inband ripple – you specify how much, even 1dB is hardly noticeable. The remaining types are Elliptical (Cauer) and Bessel. Bessel is best for digital signals and Cauer is the steepest but has big ripples in the stop band. Chebyshev 1dB ripple is commonly used.



http://Toroids.info - can both design Toroids and Matching Networks



So once the simulations are done you can build the filter, the next question is how do you make the inductors?

Inductors can be easily made on Powdered Iron toroids – these have a name like T50-2 this is a toroid of 0.5 inch outer diameter and type -2 powdered iron painted a yellow colour. You should not use ferrite toroids (these have a FT prefix like FT50-43) although you can use them for wideband transformers, Baluns and chokes. To work out how many turns to use in your powdered iron inductor you can either take the square root of the desired inductance in nH divided by the Al constant for your chosen type (type 2 has an Al of 4.9) or you can use a handy online tool found at http://toroids.info/ The screen above shows that 13 to 14 turns are needed.

I wound the toroids for the uBitx filter (900nH inductances) and found I could get anywhere from 626 nH to 1000 nH by spreading out or compressing the windings on the core. I measured the inductance on my NanoVNA and dripped hot candlewax over the winding to keep them stable as I soldered them in. Hot glue would be a more permanent solution. Here is a photo of the completed filter.


I used polystyrene capacitors because I have a lot of them, 160V and 2.5% they are a good choice but can be hard to get hold of and are expensive. Ceramic discs or dipped mica are more stable and good high voltage ratings. So how did the real filter compare to the simulations? When I measured with my nanoVNA the results were poor, but it turns out there is something wrong with my nanoVNA. Richard's NanoVNA gave good results. When I switched to using a signal generator and my SDRPlay SDR1a as a spectrum analyser I got results that matched the simulation almost exactly. I don’t have a tracking generator so the diagram below is several screenshots stitched together

So, in summary, don’t believe everything you see in books or on the web. Verify designs with LTspice. Filter design is easy using https://rf-tools.com/lc-filter/ and http://toroids.info/  Winding toroids is easy provided you measure and squeeze turns until you get the right value. Candle wax holds winding securely so you can solder them into a circuit without disturbing the windings. 





No comments:

Post a Comment