Gil, Leigh, Mike, and anyone else that is interested in tuners,
I have posted some pictures of my autotuner on my web page. Feel free to have a look at http://www.qsl.net/k7fj An icon at the bottom of the page will take you to the tuner page. |
A few months ago I maintained a brief correspondence with some on this list
with an interest in a homebrew balanced autotuner. The project is nearing the point where I will be installing it into a K2 case. At the moment, though, I am having trouble coming up with a software algorithm that finds minimum swr and this message is a request for suggestions. I have found that it is not as easy as I had imagined. I have been using several methods to automatically find minimum swr and some work pretty well most of the time but none work well *all* of the time. The problem is that on some bands minimum swr occurs over a very narrow range of C and L. With either C or L are set only a little off of these optimum values any change in C or L will have *no* effect on measured swr. I have used complex algorithms that vary step size, vary C and L values intelligently with either positive or negative changes in value. I have used simple algorithms that stupidly go through an entire range of possibilities of all values of L for every C and so forth (ugh!) ... and have to believe there is someone out there in Elecraft-land a lot more clever than I who can suggest ways to intelligently find best combinations of L and C quickly using measured swr as the criteria. It really does not matter a great deal if I never perfect the autotuning feature of the tuner. It is easy to manually tune the tuner, store L and C for every band segment in nonvolatile memory, and then let the tuner automatically switch to the proper values when it senses the frequency at the input. But I can't call it an autotuner if it doesn't tune well automatically can I? Perfectionist that I am I would like to make it autotune like it is supposed to. Any ideas? Don K7FJ http://www.qsl.net/k7fj/ |
Don -
If you can easily tune the tuner by hand .... I always teach my programming students to just watch themselves manually performing the task, then write down a set of instructions so someone else could do that, and then write the program to follow those steps. Seems to me an exhaustive search trying all combinations has to find the lowest SWR, but that would take time. You could perhaps first run through your smart search method and if it gets close enough stop there, and if not, try all values. If you could get an approximation of the complex impedance of the load (not exactly sure how to do that offhand) you could then calculate what is approximately needed to best match it, and search around there. I will be interested in reading the ideas of others on this topic! 73/72 - Mike WA8BXN -------Original Message------- From: Don A few months ago I maintained a brief correspondence with some on this list with an interest in a homebrew balanced autotuner. The project is nearing the point where I will be installing it into a K2 case. At the moment, though, I am having trouble coming up with a software algorithm that finds minimum swr and this message is a request for suggestions. |
In reply to this post by Don Ehrlich-2
Instead of an exhaustive search, you might try a genetic algorithm.
73, Steve AA4AK At 11:51 PM 9/13/2005 -0400, Mike WA8BXN wrote: > Don - >If you can easily tune the tuner by hand .... I always teach my >programming students to just watch themselves manually performing the task, >then write down a set of instructions so someone else could do that, and >then write the program to follow those steps. > >Seems to me an exhaustive search trying all combinations has to find the >lowest SWR, but that would take time. You could perhaps first run through >your smart search method and if it gets close enough stop there, and if not, >try all values. > >If you could get an approximation of the complex impedance of the load (not >exactly sure how to do that offhand) you could then calculate what is >approximately needed to best match it, and search around there. > >I will be interested in reading the ideas of others on this topic! > >73/72 - Mike WA8BXN > > >-------Original Message------- > >From: Don > > >A few months ago I maintained a brief correspondence with some on this list >with an interest in a homebrew balanced autotuner. The project is nearing >the point where I will be installing it into a K2 case. At the moment, >though, I am having trouble coming up with a software algorithm that finds >minimum swr and this message is a request for suggestions. > >_______________________________________________ >Elecraft mailing list >Post to: [hidden email] >You must be a subscriber to post to the list. >Subscriber Info (Addr. Change, sub, unsub etc.): > http://mailman.qth.net/mailman/listinfo/elecraft > >Help: http://mailman.qth.net/subscribers.htm >Elecraft web page: http://www.elecraft.com _______________________________________________ Elecraft mailing list Post to: [hidden email] You must be a subscriber to post to the list. Subscriber Info (Addr. Change, sub, unsub etc.): http://mailman.qth.net/mailman/listinfo/elecraft Help: http://mailman.qth.net/subscribers.htm Elecraft web page: http://www.elecraft.com |
In reply to this post by Don Ehrlich-2
This may work out to be an optimization problem where you need to find the
gradient of the LC surface and descend down that gradient. Imagine the SWR as the z axis of a basin. This basin is your attractor with the best SWR at the bottom of the basin. The x axis is your choice for L and the y axis is your choice of C in this tuner setup. The simplest method is to find the gradient by choosing a few points at random to begin to describe the character of the basin. Hopefully it is a simple basin with no false minima. There are ways of determining how to walk around them but that is a bit tougher than I want to explain right now. Since the function of this basin is not known a priori you will need to make the random choices I mentioned earlier. This can be used to perform piecewise differentiation to determine the gradient of the steepest path. Think of the gradient as the fall line a skier takes to go down the slope in the fastest manner. If you can determine the gradient you can adjust the L and C of your tuner in the direction indicated until you start to increase the SWR. At that point you simply back up to the one before and you're done. It is almost my bedtime so write me a note if you think you want to try this and I'll write out the mathematics of it in algorithmic form instead of my little thought experiment. It truly can solve your problem in a very short number of iterations. If you like you can determine the gradient at every step to achieve the optimal solution. This will take a little longer but your answer will be the best one you can get. Sincerely, Kevin Rock. On Tue, 13 Sep 2005 20:16:52 -0700, Don <[hidden email]> wrote: > A few months ago I maintained a brief correspondence with some on this > list with an interest in a homebrew balanced autotuner. The project is > nearing the point where I will be installing it into a K2 case. At the > moment, though, I am having trouble coming up with a software algorithm > that finds minimum swr and this message is a request for suggestions. > > I have found that it is not as easy as I had imagined. I have been > using several methods to automatically find minimum swr and some work > pretty well most of the time but none work well *all* of the time. The > problem is that on some bands minimum swr occurs over a very narrow > range of C and L. With either C or L are set only a little off of these > optimum values any change in C or L will have *no* effect on measured > swr. > > I have used complex algorithms that vary step size, vary C and L values > intelligently with either positive or negative changes in value. I have > used simple algorithms that stupidly go through an entire range of > possibilities of all values of L for every C and so forth (ugh!) ... and > have to believe there is someone out there in Elecraft-land a lot more > clever than I who can suggest ways to intelligently find best > combinations of L and C quickly using measured swr as the criteria. > > It really does not matter a great deal if I never perfect the autotuning > feature of the tuner. It is easy to manually tune the tuner, store L > and C for every band segment in nonvolatile memory, and then let the > tuner automatically switch to the proper values when it senses the > frequency at the input. But I can't call it an autotuner if it doesn't > tune well automatically can I? Perfectionist that I am I would like to > make it autotune like it is supposed to. > > Any ideas? > > Don K7FJ > > > http://www.qsl.net/k7fj/ > > _______________________________________________ > Elecraft mailing list > Post to: [hidden email] > You must be a subscriber to post to the list. > Subscriber Info (Addr. Change, sub, unsub etc.): > http://mailman.qth.net/mailman/listinfo/elecraft Help: > http://mailman.qth.net/subscribers.htm > Elecraft web page: http://www.elecraft.com _______________________________________________ Elecraft mailing list Post to: [hidden email] You must be a subscriber to post to the list. Subscriber Info (Addr. Change, sub, unsub etc.): http://mailman.qth.net/mailman/listinfo/elecraft Help: http://mailman.qth.net/subscribers.htm Elecraft web page: http://www.elecraft.com |
In reply to this post by Don Ehrlich-2
Don wrote:
> I have found that it is not as easy as I had imagined. I have been > using several methods to automatically find minimum swr and some work > pretty well most of the time but none work well *all* of the time. The > problem is that on some bands minimum swr occurs over a very narrow > range of C and L. With either C or L are set only a little off of these > optimum values any change in C or L will have *no* effect on measured swr. Some tuner algorithms use a phase detector as well as measuring VSWR. If you compare the phase of the current and voltage, the error signal from the phase detector will go through zero and change sign when you pass resonance. This tells you to reduce the step size and back up. I bet Wayne knows a good algorithm! Looking at the schematic of the KAT100 I only see a sensitive SWR detector. -- 73, Vic, K2VCO Fresno CA http://www.qsl.net/k2vco _______________________________________________ Elecraft mailing list Post to: [hidden email] You must be a subscriber to post to the list. Subscriber Info (Addr. Change, sub, unsub etc.): http://mailman.qth.net/mailman/listinfo/elecraft Help: http://mailman.qth.net/subscribers.htm Elecraft web page: http://www.elecraft.com |
Administrator
|
On Sep 13, 2005, at 11:08 PM, Vic K2VCO wrote: > I bet Wayne knows a good algorithm! Indeed I do. And it took several weeks of serious R & D and coding the first time we developed an ATU (KAT2). Among other things, the code uses four tuning phases, each with different granularities; time-based SWR target adjustment; hand-tuned, pseudo-grayscale switching of latching relays; SWR-based look-ahead tree pruning (borrowing extensively from game theory); scaled L-C stepping near local minima; and, when possible, L-C range prediction based on band information. It was a wonderful, hair-pulling, sleep-depriving, learning experience that I wouldn't deny anyone by giving away the details ;) 73, Wayne N6KR --- http://www.elecraft.com _______________________________________________ Elecraft mailing list Post to: [hidden email] You must be a subscriber to post to the list. Subscriber Info (Addr. Change, sub, unsub etc.): http://mailman.qth.net/mailman/listinfo/elecraft Help: http://mailman.qth.net/subscribers.htm Elecraft web page: http://www.elecraft.com |
wayne burdick wrote:
> It was a wonderful, hair-pulling, sleep-depriving, learning experience > that I wouldn't deny anyone by giving away the details ;) Wayne, you're a sick, sick man... but we love you! :-) -- "Nosey" Nick Waterman, Senior Sysadmin. #include <stddisclaimer> [hidden email] Santa is so jolly is because he knows where all the bad girls live _______________________________________________ Elecraft mailing list Post to: [hidden email] You must be a subscriber to post to the list. Subscriber Info (Addr. Change, sub, unsub etc.): http://mailman.qth.net/mailman/listinfo/elecraft Help: http://mailman.qth.net/subscribers.htm Elecraft web page: http://www.elecraft.com |
In reply to this post by Don Ehrlich-2
I have not looked at the code myself but this might (?) help:
http://fermi.la.asu.edu/w9cf/tuner/tunersrc.zip You can try the applet at http://fermi.la.asu.edu/w9cf/tuner/tuner.html vy 73 de toby _______________________________________________ Elecraft mailing list Post to: [hidden email] You must be a subscriber to post to the list. Subscriber Info (Addr. Change, sub, unsub etc.): http://mailman.qth.net/mailman/listinfo/elecraft Help: http://mailman.qth.net/subscribers.htm Elecraft web page: http://www.elecraft.com |
In reply to this post by Don Ehrlich-2
Stephen Kercel's suggestion to use a Genetic Algoirthm is brilliant ...
this sounds like a perfect application for these astounding and amazing techniques. I have had two passions in my life (at least, PG-rated) ... ham radio and genetic algorithms ... own every book ever written on GA's as well (have even read most of them!) ... (not a lot of real world experience with GA's of course ... I am more of a theoretician!). The beauty of the GA's, loosely modeled on the way real DNA and natural selection work, is that they often finds good empirical solutions to difficult problems like tuner settings optimization, without the need for the articulation of the exact methodology used. In other words, all of the factors that Wayne wrestled with become moot ... the GA will find good solutions to the problem without all the intellectual knowledge of antennas and radio physics. I would encourage any of you who want to have some real fun to search google and read about GA's. Joseph Sanger, M.D. WB2SSB ------------------------------------------------------------------------------- This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is proprietary, confidential, and exempt from disclosure under applicable law. Any unauthorized review, use, disclosure, or distribution is prohibited. If you have received this email in error please notify the sender by return email and delete the original message. Please note, the recipient should check this email and any attachments for the presence of viruses. The organization accepts no liability for any damage caused by any virus transmitted by this email. ============================================================================== _______________________________________________ Elecraft mailing list Post to: [hidden email] You must be a subscriber to post to the list. Subscriber Info (Addr. Change, sub, unsub etc.): http://mailman.qth.net/mailman/listinfo/elecraft Help: http://mailman.qth.net/subscribers.htm Elecraft web page: http://www.elecraft.com |
As much as GAs are fun and very powerful, I do wonder about the amount
of time it might need using say a population of 50 and 100 generations. Assuming 100ms for switching and mesurement -> 100ms * 50 * 100 = 8Min 20Sec. Not to mention the amount of memory needed. Most controllers do not have gobs of memory. vy z3 de toby _______________________________________________ Elecraft mailing list Post to: [hidden email] You must be a subscriber to post to the list. Subscriber Info (Addr. Change, sub, unsub etc.): http://mailman.qth.net/mailman/listinfo/elecraft Help: http://mailman.qth.net/subscribers.htm Elecraft web page: http://www.elecraft.com |
In reply to this post by Don Ehrlich-2
--- Don <[hidden email]> wrote:
> At the moment, though, I am having trouble coming up with a software > algorithm that finds minimum swr and this message is a request for > suggestions. > .... > Any ideas? Hi Don. Most tuners contain directional couplers to indicate VSWR, but they are often sandwiched between the transmitter and the tuning network. The tuning network is then adjusted for zero reflected power using a trial-and-error approach. If the directional coupler were instead placed between your tuning network and the antenna jack (the OUTPUT of the tuner), you could use the amplitude and phase information returned from the coupler to determine the complex impedance of the load (antenna) you wish to match to 50 ohms. Next, you could calculate what conjugate impedance the tuner needs to place in series with antenna jack to produce the 50 ohm resistive output impedance you desire, and then select the appropriate L and C values in your tuner network to produce that impedance. Done! 73, de John, KD2BD Visit John on the Web at: http://kd2bd.ham.org/ . . . . __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com _______________________________________________ Elecraft mailing list Post to: [hidden email] You must be a subscriber to post to the list. Subscriber Info (Addr. Change, sub, unsub etc.): http://mailman.qth.net/mailman/listinfo/elecraft Help: http://mailman.qth.net/subscribers.htm Elecraft web page: http://www.elecraft.com |
In reply to this post by dj7mgq
Toby:
Good point. 73, Steve AA4AK At 04:10 PM 9/14/2005 +0200, Toby Deinhardt wrote: >As much as GAs are fun and very powerful, I do wonder about the amount of >time it might need using say a population of 50 and 100 generations. >Assuming 100ms for switching and mesurement -> 100ms * 50 * 100 = 8Min 20Sec. > >Not to mention the amount of memory needed. Most controllers do not have >gobs of memory. > >vy z3 de toby >_______________________________________________ >Elecraft mailing list >Post to: [hidden email] >You must be a subscriber to post to the list. >Subscriber Info (Addr. Change, sub, unsub etc.): >http://mailman.qth.net/mailman/listinfo/elecraft > >Help: http://mailman.qth.net/subscribers.htm >Elecraft web page: http://www.elecraft.com _______________________________________________ Elecraft mailing list Post to: [hidden email] You must be a subscriber to post to the list. Subscriber Info (Addr. Change, sub, unsub etc.): http://mailman.qth.net/mailman/listinfo/elecraft Help: http://mailman.qth.net/subscribers.htm Elecraft web page: http://www.elecraft.com |
In reply to this post by John Magliacane
Interesting idea, but it has problems. Directional couplers are
designed around a known set of values for its components, minimizing the number of variables in the circuit. One of the things that is normally fixed is the load impedance which the coupler "sees." Accuracy of the measurements is directly dependent on this, as can be seen from the math that applies to the circuit. By connecting the coupler to a non-deterministic load, as you suggest, it becomes at the least difficult to verify the accuracy of any resulting calculations, with results most likely being invalid. This being the case, the only time that data would then be valid would be when the antenna matches the design characteristic impedance of the directional coupler, a condition that the tuner itself is supposed to create. Thus the directional coupler really needs to be on the other, traditional side of the tuner. Note that on this side you still have phase and amplitude information that can be used for calculations. It can be difficult, of course, to take these measurements since they need to be sampled at HF, although this can be done as is seen in the days antenna analyzers. You can then apply the LC transformation, which is known, to more accurately calculate the antenna impedance for the frequency. Having said that, the design of the tuner will directly affect the algorithms needed in the firmware. As an example, the traditional L network will need a dramatically different algorithm than a tank circuit. The L network tends to have a single point of match, while a tank circuit-based tuner may have several. Finding the best one for your needs is the real trick, and wholly depends on your definition of "best." Examples of this are lowest SWR, broadest bandwidth at match, fastest time to match, etc... In either case, this isn't a trivial problem to solve, but it definitely is an interesting one to pursue from a technical view point. It is definitely something that, while seemingly simple, can consume "perfectionist engineers" (we know who we are...) for years. ;-) On Sep 14, 2005, at 7:20 AM, John Magliacane wrote: > --- Don <[hidden email]> wrote: > > >> At the moment, though, I am having trouble coming up with a software >> algorithm that finds minimum swr and this message is a request for >> suggestions. >> .... >> Any ideas? >> > > Hi Don. > > Most tuners contain directional couplers to indicate VSWR, but they > are often sandwiched between the transmitter and the tuning network. > The tuning network is then adjusted for zero reflected power using > a trial-and-error approach. > > If the directional coupler were instead placed between your tuning > network and the antenna jack (the OUTPUT of the tuner), you could > use the amplitude and phase information returned from the coupler > to determine the complex impedance of the load (antenna) you wish > to match to 50 ohms. > > Next, you could calculate what conjugate impedance the tuner needs > to place in series with antenna jack to produce the 50 ohm resistive > output impedance you desire, and then select the appropriate L and C > values in your tuner network to produce that impedance. > > Done! > > > 73, de John, KD2BD > > > Visit John on the Web at: > > http://kd2bd.ham.org/ > . > . > . > . > > > > __________________________________ > Yahoo! Mail - PC Magazine Editors' Choice 2005 > http://mail.yahoo.com > _______________________________________________ > Elecraft mailing list > Post to: [hidden email] > You must be a subscriber to post to the list. > Subscriber Info (Addr. Change, sub, unsub etc.): > http://mailman.qth.net/mailman/listinfo/elecraft > > Help: http://mailman.qth.net/subscribers.htm > Elecraft web page: http://www.elecraft.com > - Jack Brindle, W6FB ------------------------------------------------------------------------ --------------------- _______________________________________________ Elecraft mailing list Post to: [hidden email] You must be a subscriber to post to the list. Subscriber Info (Addr. Change, sub, unsub etc.): http://mailman.qth.net/mailman/listinfo/elecraft Help: http://mailman.qth.net/subscribers.htm Elecraft web page: http://www.elecraft.com |
In reply to this post by wayne burdick
Wow! I have received a lot of responses and there are some very
interesting and valuable ideas in them. Wayne's response to the list gets the prize for smoke, mirrors, and just plain fun (how much of that is smoke we will never know). His message set a new high for the ratio of reading enjoyment to actual usefulness. Thanks guys. p.s. For those who have asked .... the tuner is a dual L-C network fed through an SWR bridge and 1:1 voltage balun and I am using it 160-20M to feed a 160M horizontal loop using ladder line. There is a description of the tuner at http:/www.qsl.net/k7fj/ . Don K7FJ >> I bet Wayne knows a good algorithm! > > Indeed I do. And it took several weeks of serious R & D and coding the > first time we developed an ATU (KAT2). > > Among other things, the code uses four tuning phases, each with different > granularities; time-based SWR target adjustment; hand-tuned, > pseudo-grayscale switching of latching relays; SWR-based look-ahead tree > pruning (borrowing extensively from game theory); scaled L-C stepping near > local minima; and, when possible, L-C range prediction based on band > information. > > It was a wonderful, hair-pulling, sleep-depriving, learning experience > that I wouldn't deny anyone by giving away the details ;) > > 73, > Wayne > N6KR _______________________________________________ Elecraft mailing list Post to: [hidden email] You must be a subscriber to post to the list. Subscriber Info (Addr. Change, sub, unsub etc.): http://mailman.qth.net/mailman/listinfo/elecraft Help: http://mailman.qth.net/subscribers.htm Elecraft web page: http://www.elecraft.com |
In reply to this post by wb2ssb
Joseph:
Genetic Algorithms would be an extremely inefficient method for solving such a problem where the objective value is so easily measured and the direct effects of the arguments of the objective function (capacitance and inductance) are so easily determined. Wayne's solution is relatively direct and clearly effective. Kevin Rock's proposal, using some method of steepest decent is also of interest. However, anyone who has used a transmatch with tunable input and output will know there arise situations where simple iteration between the two tuning capacitors does not simply walk down a SWR valley. Occasionally one must significantly off-tune one cap to get a lower reading with the other. This, then, is a situation where first derivatives are inadequate and second derivatives are best brought into play. Steepest decent is a "first-derivative only" algorithm. Some form of a DFP or, better yet, Newton's method -- ones that also use the Hessian information -- would be of interest in this context. However, all these kinds of optimization routines are assuming continuous variability of the arguments, C and L. With a very finite number of values of C and L to consider, a tree network with branch-and-bound really seems the way to go. Switches in values that increase SWR are pretty effective means for pruning branches off the tree. best wishes, david belsley, w1euy On Sep 14, 2005, at 9:57 AM, Sanger, Joseph wrote: > Stephen Kercel's suggestion to use a Genetic Algoirthm is brilliant ... > this sounds like a perfect application for these astounding and amazing > techniques. I have had two passions in my life (at least, PG-rated) > ... > ham radio and genetic algorithms ... own every book ever written on > GA's > as well (have even read most of them!) ... (not a lot of real world > experience with GA's of course ... I am more of a theoretician!). > > > > The beauty of the GA's, loosely modeled on the way real DNA and natural > selection work, is that they often finds good empirical solutions to > difficult problems like tuner settings optimization, without the need > for the articulation of the exact methodology used. In other words, > all > of the factors that Wayne wrestled with become moot ... the GA will > find > good solutions to the problem without all the intellectual knowledge of > antennas and radio physics. > > > > I would encourage any of you who want to have some real fun to search > google and read about GA's. > > > > > > Joseph Sanger, M.D. > > WB2SSB > > > > > ----------------------------------------------------------------------- > -------- > This email message, including any attachments, is for the sole use of > the intended recipient(s) and may contain information that is > proprietary, confidential, and exempt from disclosure under applicable > law. Any unauthorized review, use, disclosure, or distribution is > prohibited. If you have received this email in error please notify the > sender by return email and delete the original message. Please note, > the recipient should check this email and any attachments for the > presence of viruses. The organization accepts no liability for any > damage caused by any virus transmitted by this email. > > ======================================================================= > ======= > _______________________________________________ > Elecraft mailing list > Post to: [hidden email] > You must be a subscriber to post to the list. > Subscriber Info (Addr. Change, sub, unsub etc.): > http://mailman.qth.net/mailman/listinfo/elecraft > > Help: http://mailman.qth.net/subscribers.htm > Elecraft web page: http://www.elecraft.com Elecraft mailing list Post to: [hidden email] You must be a subscriber to post to the list. Subscriber Info (Addr. Change, sub, unsub etc.): http://mailman.qth.net/mailman/listinfo/elecraft Help: http://mailman.qth.net/subscribers.htm Elecraft web page: http://www.elecraft.com |
Free forum by Nabble | Edit this page |