Friday 3 November 2023

41 - Design and Analysis of Low Pass Filters (Copy of part 2 of an Article for CONTACT )

Designing and Analysing Low Pass Filters for RF (HF) use Part 2: MI5AFL

Method 1: https://rf-tools.com/lc-filter/ is very very useful, together with the toroid coil turns calculator at http://toroids.info/ or coil64.exe from http://coil32.net ) for air-cored coils, these are my main tools until recently when I wanted to investigate more thoroughly.

Here is an example screenshot: There is a simple graphical plot of performance and cursors that allow moving around the graphs - I prefer to copy the circuit over to LTspice to investigate whether 5% or 2% capacitors are needed, to try standard values and to play with the Q of the coils, etc.,



Above is a screenshot of the RF-Tools.com design tool, it plots the amplitude response - the plot of attenuation with frequency is called S21. It also plots, in red, the return loss or S11 figures in dB - this is related to the VSWR or how well the filter matches to 50 Ohms. I usually redraw the circuit in Ltspice and simulate in detail there - moving the cursor about on the RF-tool is tedious and I am well practiced in how to use LTspice effectively. I will cover the LTspice simulation after discussing Elsie.

Method 2: Elsie, (from http://tonnesoftware.com )it took me a while to get familiar with this software but once I had the hang of it, I found it useful. I was particularly interested in designing a filter for the 40m band that had around 35dB of second harmonic rejection (which since I was using a push-pull amplifier I expected a further 15 to 20 dB from the balanced nature of that circuit) and I also wanted at least 50dB rejection at 21MHz - the third harmonic. I also wanted good SWR (Return loss) at the input, assuming 50 Ohm.

To use ELSIE you click on a couple of screens; first hit the DESIGN button and fill in a form, note the software describes the corner frequency Fc as the ripple bandwidth - technically correct since a LPF starts at zero and goes to the corner frequency for its passband, hence the ripple bandwidth is the “passband”. After hitting the design button click the ANALYSIS button to set the parameters for the plot - the start and end frequency. You can set the Q of the coils and capacitors and the reference impedance for VSWR method - I set this to 50 Ohms.



Now click on the SCHEMATIC button to see the circuit diagram, complete with calculated values. I usually click on the “show Q-Value resistances as I may use these values in LTspice later.



Click on the PLOT button to get a useful plot. click the second icon down on the left hand side to get both S21 and S11. I also set 7 Markers and clicked the markers menu item to show them, they are very useful.

This is bit hard to see so here is a zoom in to the Marker results at the foot of the diagram above.


The yellow boxes show interesting stuff. We optimise these by moving Fc up and down a bit, if we can’t meet our specifications we go back and change the order from 5 to 7. The markers below are for a 7.45MHz Fc and 0.1dB ripple, 5th order. It is the result of my experimenting with Elsis and has the lowest insertion loss with a reasonable harmonic rejection. I used a design Q of 200 for the coils and 2000 for the Capacitors. Later I changed the Q to 290 and 10,000


Since good (big) return loss coincides with lowest insertion loss you can see how optimisation works by imagining the 1 to 5 markers on the red graph sliding downwards into the trough.


The nice thing about ELSIE is that if you nip back and make a change to the design data, the plot and the markers change immediately, you can go back and forward experimenting very quickly to get what you need. Here, I see the VSWR is below 1.09 and the insertion loss is less than 0.16dB which is about 1.7%. (see http://www.sengpielaudio.com/calculator-db.htm ) The harmonics are 32dB and 51 dB down so all is good enough. I also tried 7.2MHZ and 7.25MHZ but 7.45 is the best compromise. LTspice gets better figures after I design the air cored coils (15mm former and 1.2mm wire at 2.4mm spacing gives a Q or 290 according to Coil64.exe)

Finally if you click the WRITE button you get the option to write an LTspice .ASC file which is what LTspice uses. You can save it and then launch LTspice and load it as is, but I prefer to add some extra commands to the LTspice schematic as you'll see below. I usually run three different simulations, the first confirms the results above, I then “design” the inductors using Coil64.exe and this gives a computed Q and RESR value, I modify the capacitors to standard values and edit the LTspice schematic and re-simulate to check the performance. Finally I use the Gaussian and, lately, Worst case simulations to vary the component tolerances see how careful I need to make the filter. (see the October 2020 issue of the CONTACT magazine for details of using the Gaussian formulas)

To use Ltspice effectively you need to know how to use .MEASURE text commands. Also there is a choice as to how to display S21 and S11. There is a .NET command but Wes showed a “trick” on his website ( https://w7zoi.net/Extract-sp.pdf ) of how to add S11 and S21 labels directly to the schematic – this just makes plotting a bit quicker so it what I use.

It uses a voltage source with an internal resistance of 50 Ohms and a driving voltage of 2 volts, this gets divided to 1 volt at the actual input to the filter and so the output voltage gives us S21 directly ( the gain is Vout/Vin and Vin is ‘1’). Likewise subtracting one volt from the actual input means that what is left is what gets reflected back from the filter. So the second voltage source gives us the reflected voltage, again this scales by ‘1’ to give us S11 directly. We add a one GigaOHM resistor in series with this subtracting voltage to avoid distorting the results.

We can use LTspice for simple plots, and then alter the capacitances to preferred values.


A more advanced use of LTspice is to show how the performance varies as components vary. You can do multiple simulations with each value set at its worst case or you can vary a value thousands of times between its worst case values, a 2% capacitor can be between 98% and 102% of its nominal value. Here is the spread of performance values after 2000 simulations.

You can't know which component variations causes which value but it looks like it should be alright, you can estimate by eye the chances of your physical circuit meeting the specification. It should convince you that you should never make a filter without (a) checking the values of the components before soldering them in and (b) to check the performance of the completed filter. Thank goodness for the NanoVNA, £50 well spent – get one!

I have found a new, better way to perform an analysis. It is much quicker to pick the worst case extremities of each component and just analyse this, for 5 components there are 32 possible combinations of each component being too high, or being too low (at the limit of its tolerance, +/-2% or +/-5% ). An application note by Analog Devices shows a technique using two one-line functions to iterate through all 32 cases. It uses a 5 bit binary number and we can work backwards to see what component combinations give a particular result. This is important as it opens the opportunity to “tune” a filter to be better than its calculated performance.

The diagram below gives the LTspice schematic the result of plotting the values calculated by the .MEASURE statements against the run number. We can convert the run number into a 5 bit binary number and work out what component values cause what results.


Run numbers 8,9 and 10 have very good insertion losses (and return loss – inevitably since RL and insertion loss are related) 8 is 01000 in binary so keeping C1, C3,L4 and C5 at the lower extremeity (98% of nominal) and L2 5% higher than nominal will give the best results.

To conclude, here are a list of references,

https://rf-tools.com/lc-filter

https://toroids.info will work out how many coils on a powdered iron core toroid

https://coil32.net Can calculate turns and the Q of an air-cored coil.

http://tonnesoftware.com/elsie.html Download ELSIE from here (look at the other programs too!)

http://www.sengpielaudio.com/calculator-db.htm A simple tool to convert dB to a ratio

https://w7zoi.net/Extract-sp.pdf How to modify an LTspice schematic to show S21 and S11

https://www.everythingrf.com/rf-calculators/return-loss-to-vswr-calculator What it says!

https://www.analog.com/en/design-center/design-tools-and-calculators/ltspice-simulator.html

You can download the LTspice simulator from the link above, its handy for just drawing schematics too!

Another common filter design software program is AADE ( http://www.ke5fx.com/aadeflt.htm ) or the PC software at http://www.alkeng.com/ and there are a number of tools included in the CDs that come with Wes Hayward’s EMRFD book, and the older ARRL or RSGB handbooks.

My personal choices at present are to use the rf-tools website, the ELSIE software or the spreadsheets I have developed and found hese are also reproduced on my blog at https://MI5AFL.blogspot.com and in my google drive (links are in my blog).



No comments:

Post a Comment