Author Topic: Transformer Ratio Design Tip  (Read 3677 times)

0 Members and 1 Guest are viewing this topic.

Offline T3sl4co1lTopic starter

  • Super Contributor
  • ***
  • Posts: 21688
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Transformer Ratio Design Tip
« on: March 12, 2016, 08:39:14 pm »
This is sort of a beginnery thing:

Transformers can only be designed for rational turns ratios.  That is, you can't have sqrt(2) or pi turns ratios, only 1:2 or 57/64 and such.  Often, you need to wind one for an irrational ratio: the most common case being impedance matching, where the turns ratio is sqrt(impedance ratio).

Suppose you need to match a 50 ohm transmission line to a pair of 50 ohm transmission lines wired in series: 100 ohms, as seen by the transformer.  (This is called a 180 degree splitter or hybrid.)  The impedance ratio is (100/50) = 2, so the voltage/turns ratio is sqrt(2) ~= 1.4142...  RF transformers need to be wound with the smallest possible number of turns (because wire length limits the upper frequency range), so it would be nice to find the smallest number that gives an accurate ratio.

Well... an irrational number can't be expressed as a rational, but we can try and get close.  Let's say the matching needs to be within 10% (which means the turns ratio has to be within 5%).  How do we find a ratio?  We can brute-force it by incrementing the numbers in (p/q) until the ratio gets close enough, but that's tedious (though, a good way for a computer program!).

Is there a better way?  Certainly!  We can find all* the best points, that we'd get with a brute-force method, using fewer steps in a smarter approach.

(*I don't think this is actually true, but there's a theorem about it that relates to this.)

Here's the procedure.  Grab a standard (non-RPN) calculator and enter the desired number (to an adequate number of decimal places, or compute it first).  If the number is < 1, take its reciprocal (hit 1/x).  Then repeat:
1. Subtract the integral part (everything left of the decimal); write down this number.
2. 1/x
3. GOTO 1

You don't need to loop forever of course, but what you are doing is creating a continued fraction.  Each number you subtract off, is another factor into the ratio you'll produce.  And at each step of the way, you're getting more and more accurate.  For 5% accuracy, you don't need more than about 1/sqrt(5%) steps, or thereabouts.

Or, if you happen to get an integral part that's rather large (like 5 or 10 or more), that means the previous step produced a pretty accurate subtraction, and you'll have a pretty good result stopping there.  Because, when you're subtracting 5 from a remainder in the range of [0, 1) (average 0.5), then you have a 10% match, in that step alone -- which goes on top of the accuracy already achieved by the previous steps!

To compose the transformer ratio, simply reverse the process:
Enter the last integer
1/x
+ (2nd-last integer)
1/x
+ ...
...
1/x
+ (1st integer)
= Done!

If you follow this process through, on paper (or using an exact calculator), so you get the fraction (p/q) rather than its decimal value, you'll note that each integer alternates between multiplication and addition, and contributing to p or q.  The result is that, as you spin off more integers, (p/q) gets closer to the original number.

Worked examples:

sqrt(2) for the original example.  As it happens, the continued fraction expansion starts with 1 (because 1.414...) and goes on infinitely, producing 2 (doing this on a real computer will eventually discover rounding errors, but all irrationals actually have a repeating sequence in this form!).  So we can pick ratios of:
1 + 1/(2) = 3/2 = 1.5
1 + 1/(2 + 1/(2)) = 7/5 = 1.4
1 + 1/(2 + 1/(2 + 1/(2))) = 17/12 = 1.41666...
and so on.

5:7 turns ratio isn't too bad, so we might settle for that.  In a pinch, 2:3 isn't even too bad, giving a +12.5% impedance error.

Small ratios are also practical to build using transmission line transformer designs that don't have upper frequency limits.  Large ratios get unwieldy though, especially with lots of prime factors, like 5, 7 and 17.



Example 2:
A vacuum tube amplifier might need an impedance ratio around 6600:8, or a turns ratio of 28.72...  A ratio of 28:1 or 29:1 is pretty good, but the high impedance will end up needing quite a lot of turns (a few thousand), so we might as well calculate up to that point and see how accurate we can get!
28, 1, 2, 1, 1, 1, 1, 4, 1, 1, 1, 1, 2, 1, 56, ...
These give:
28
29
86/3
115/4
201/7
316/11
517/18
2384/83 (this is probably reasonable for a real transformer of this type)
2901/101
5285/184
(more is probably not practical; 5000 turns is a lot of winding!)



Example Fun:
What if we do pi?  We can continue-fraction that quite easily, sure:
3, 7, 15, 1, 292, 1, 1, 1, 2, 1, 3, 1, ...
No, there's no pattern in this case: pi is transcendental.  (Irrational (algebraic) numbers do have a repeating fraction.)  You can see 7, 15 and 292 are pretty damn good steps (the next best is 84, a dozen or so steps later).  These correspond to, guess which ratios?  Let's write them out...

3 = 3/1 = 3
3 + 1/(7) = 22/7 = 3.142857...
3 + 1/(7 + 1/(15)) = 333/106 = 3.141509...
Which isn't bad already!

The famous ratio 355/113, high by only 85ppb, is produced by this series:
3 + 1/(7 + 1/(15 + 1/(1))) = 355/113 = 3.1415929...

The next better ratio takes many more digits:
3 + 1/(7 + 1/(15 + 1/(1 + 1/(292)))) = 103993/33102 = 3.1415926530... (-0.18ppb)

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Online IanB

  • Super Contributor
  • ***
  • Posts: 11891
  • Country: us
Re: Transformer Ratio Design Tip
« Reply #1 on: March 12, 2016, 08:53:56 pm »
I've often found it convenient to set this calculation up in a spreadsheet. Much less tedious than doing it by hand on a calculator, and gives instant results.
 

Offline orolo

  • Frequent Contributor
  • **
  • Posts: 352
  • Country: es
Re: Transformer Ratio Design Tip
« Reply #2 on: March 12, 2016, 11:22:49 pm »
Beautiful mathematics. Anyway, with a little brute force is it not easy to find the best approximations to a given limit?

If you want to approximate a number x by a fraction a/b, you are looking for a = b*x, and the best approximation is a = round(b*x). So you can scan all the candidates in O(n) time and memory, with an algorithm like this:

Code: (Python) [Select]
from math import *
from fractions import gcd

x = sqrt(2)

limit = input("Denominator limit: ")

fractions = []

for n in range(1,limit+1):
    num = round(n*x)
    eps = abs(x - (1.0*num)/n)
    if (gcd(num, n) != 1): continue  # Remove equivalent fractions.
    fractions.append([eps, num, n])
   
result = sorted(fractions, key=lambda f : f[0])

total = input("How many fractions? ")
print "Best %d fractions in order:" % total
for n in range(0, total):
    print "%d / %d  (error = %.10f)" % (result[n][1], result[n][2], result[n][0])

For sqrt(2), we get:

Code: [Select]
Denominator limit: 30
How many fractions? 10
Best 10 fractions in order:
41 / 29  (error = 0.0004204589)
24 / 17  (error = 0.0024488565)
17 / 12  (error = 0.0024531043)
31 / 22  (error = 0.0051226533)
38 / 27  (error = 0.0068061550)
27 / 19  (error = 0.0068390692)
37 / 26  (error = 0.0088633607)
7 / 5  (error = 0.0142135624)
10 / 7  (error = 0.0143578662)
33 / 23  (error = 0.0205690463)

As expected, the continued fractions give the best results. A very interesting electronics use of continued fractions (the other I know about is in filter design.) Many thanks for the idea!

Just for the lulz, in the pi approximation:

Code: [Select]
Denominator limit: 1000
How many fractions? 10
Best 10 fractions in order:
355 / 113  (error = 0.0000002668)
2818 / 897  (error = 0.0000095990)
2862 / 911  (error = 0.0000099809)
2463 / 784  (error = 0.0000110209)
2507 / 798  (error = 0.0000113564)
2108 / 671  (error = 0.0000129218)
2152 / 685  (error = 0.0000131858)
1753 / 558  (error = 0.0000155927)
1797 / 572  (error = 0.0000157380)
1442 / 459  (error = 0.0000195468)

Zu's fraction for pi is that good!
« Last Edit: March 12, 2016, 11:25:18 pm by orolo »
 

Online IanB

  • Super Contributor
  • ***
  • Posts: 11891
  • Country: us
Re: Transformer Ratio Design Tip
« Reply #3 on: March 13, 2016, 12:16:52 am »
But you need something a little more systematic than brute force if you want to find out that \$\pi\$ can be approximated by 245850922/78256779.
« Last Edit: March 13, 2016, 12:23:46 am by IanB »
 

Offline The Electrician

  • Frequent Contributor
  • **
  • Posts: 743
  • Country: us
Re: Transformer Ratio Design Tip
« Reply #4 on: March 13, 2016, 01:03:07 am »
Example 2:
A vacuum tube amplifier might need an impedance ratio around 6600:8, or a turns ratio of 28.72...  A ratio of 28:1 or 29:1 is pretty good, but the high impedance will end up needing quite a lot of turns (a few thousand), so we might as well calculate up to that point and see how accurate we can get!
28, 1, 2, 1, 1, 1, 1, 4, 1, 1, 1, 1, 2, 1, 56, ...
These give:
28
29
86/3
115/4
201/7
316/11
517/18
2384/83 (this is probably reasonable for a real transformer of this type)
2901/101
5285/184
(more is probably not practical; 5000 turns is a lot of winding!)

You missed one: 1867/65


Example Fun:
What if we do pi?  We can continue-fraction that quite easily, sure:
3, 7, 15, 1, 292, 1, 1, 1, 2, 1, 3, 1, ...
No, there's no pattern in this case: pi is transcendental.  (Irrational (algebraic) numbers do have a repeating fraction.)  You can see 7, 15 and 292 are pretty damn good steps (the next best is 84, a dozen or so steps later).  These correspond to, guess which ratios?  Let's write them out...

3 = 3/1 = 3
3 + 1/(7) = 22/7 = 3.142857...
3 + 1/(7 + 1/(15)) = 333/106 = 3.141509...
Which isn't bad already!

The famous ratio 355/113, high by only 85ppb, is produced by this series:
3 + 1/(7 + 1/(15 + 1/(1))) = 355/113 = 3.1415929...

The next better ratio takes many more digits:
3 + 1/(7 + 1/(15 + 1/(1 + 1/(292)))) = 103993/33102 = 3.1415926530... (-0.18ppb)

The next better ratio is 52163/16604, not 103993/33102.
 

Offline The Electrician

  • Frequent Contributor
  • **
  • Posts: 743
  • Country: us
Re: Transformer Ratio Design Tip
« Reply #5 on: March 13, 2016, 02:03:23 am »
Just for the lulz, in the pi approximation:

Code: [Select]
Denominator limit: 1000
How many fractions? 10
Best 10 fractions in order:
355 / 113  (error = 0.0000002668)
2818 / 897  (error = 0.0000095990)
2862 / 911  (error = 0.0000099809)
2463 / 784  (error = 0.0000110209)
2507 / 798  (error = 0.0000113564)
2108 / 671  (error = 0.0000129218)
2152 / 685  (error = 0.0000131858)
1753 / 558  (error = 0.0000155927)
1797 / 572  (error = 0.0000157380)
1442 / 459  (error = 0.0000195468)

Zu's fraction for pi is that good!

The idea is to find approximations with smaller denominators, not larger:

Code: [Select]
355 / 113  (error = 0.0000002668)
333/106  (error = -0.0000832196)
311/99  (error = -0.0001785122)
289/92  (error = -0.0002883062)
267/85  (error = -0.0004161832)
245/78  (error = -0.0005670132)
223/71  (error = -0.0007475832)
201/64  (error = -0.0009676542)
179/57  (error = -0.001241782)
« Last Edit: March 13, 2016, 02:06:32 am by The Electrician »
 

Offline The Electrician

  • Frequent Contributor
  • **
  • Posts: 743
  • Country: us
Re: Transformer Ratio Design Tip
« Reply #6 on: March 14, 2016, 06:32:51 pm »
There's a very detailed write-up on how all this works at: http://www.americanscientist.org/issues/pub/2000/7/on-the-teeth-of-wheels/1

The link above is no longer working.  The paper can be found here: http://bit-player.org/wp-content/extras/bph-publications/AmSci-2000-07-Hayes-gears.pdf
« Last Edit: October 29, 2022, 01:01:11 am by The Electrician »
 

Offline T3sl4co1lTopic starter

  • Super Contributor
  • ***
  • Posts: 21688
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Transformer Ratio Design Tip
« Reply #7 on: February 18, 2020, 10:47:46 pm »
Oh hey, remembered this thread in my post history, and I have an update on the subject -- I've automated the algorithm here:
https://www.seventransistorlabs.com/Calc/Frac.html
We now return you to your regularly scheduled eternal thread slumber, etc. :P

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 
The following users thanked this post: BravoV, ratio

Offline gbaddeley

  • Regular Contributor
  • *
  • Posts: 205
  • Country: au
Re: Transformer Ratio Design Tip
« Reply #8 on: February 19, 2020, 01:27:46 am »
Unless you need high precision, getting the turns ratio to within 1% is good enough. Errors in the source and load impedances and losses in the transformer are quite often more than 1%. However, the posts are an interesting mathematical exercise.
Glenn
 

Offline T3sl4co1lTopic starter

  • Super Contributor
  • ***
  • Posts: 21688
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Transformer Ratio Design Tip
« Reply #9 on: February 19, 2020, 02:50:57 am »
Yeah the most useful application, to me, is when the number of turns is constrained, like in RF transformers where the winding wire length is a transmission line length, which sets limits on bandwidth (LL and Cp).  Here you prefer a thick core (high A_L) and least turns.  So you pick the smallest convergent that gives acceptable accuracy.

Typical example: 50 to 75 ohms, or 50 ohms to 25 or 100 (turns ratios of sqrt(1.5) = 1.2247... or sqrt(2) ~= 1.4142...).  These aren't very friendly irrationals, so you tend to need a fair number of turns to get a reasonable ratio (e.g. 7/5 = 1.4 ~= 1.4142...).

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline ArthurDent

  • Super Contributor
  • ***
  • Posts: 1193
  • Country: us
Re: Transformer Ratio Design Tip
« Reply #10 on: February 19, 2020, 03:19:16 am »
Where I used to work they made instrument transformers to measure current going through high tension lines. The smaller transformers were toroidal ‘donuts’ with the current carrying conductor going through the center of the transformer and the ratio was determined by the number of turns on the core (secondary). Sometimes these ratios didn’t work out quite right so one of the engineers came up with an idea which he patented. Say you needed 50.5 turns to get the ratio you needed. What was done was the secondary was wound with two windings, one with 50 turns and another with 51 turns and these were put in parallel to give the equivalence of 50.5 turns. It might be a little more inefficient because of the small difference in voltage between the two windings, but it was simple. Of course these are line frequency iron core transformers and not R.F. but it illustrates another way to get odd ratios.
 

Offline T3sl4co1lTopic starter

  • Super Contributor
  • ***
  • Posts: 21688
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Transformer Ratio Design Tip
« Reply #11 on: February 19, 2020, 03:27:13 am »
Uhhh yikes!  That's not how that works!

Erm, if you mean "in parallel" as in feeding a common burden resistor, with resistance between windings, or not actually on the same core, that will work however.

Possibly the windings had enough resistance to begin with, that external resistors weren't needed.

In any case, that sets up a circulating current of one turn over, whatever the impedance of that loop is.  Which acts in parallel with the burden resistor (if this is all connected normally).  So it's like getting 50.5 turns but you get a burden resistor that's 2% lower than you thought (say if the windings are ~25 ohms each and the burden is 1 ohm).

Tim
« Last Edit: February 19, 2020, 03:34:28 am by T3sl4co1l »
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline Wimberleytech

  • Super Contributor
  • ***
  • Posts: 1133
  • Country: us
Re: Transformer Ratio Design Tip
« Reply #12 on: February 19, 2020, 03:32:14 am »
Hmmm...I checked out at NON-RPN...lol
 

Offline ArthurDent

  • Super Contributor
  • ***
  • Posts: 1193
  • Country: us
Re: Transformer Ratio Design Tip
« Reply #13 on: February 19, 2020, 04:42:51 am »
Uhhh yikes!  That's not how that works!

Erm, if you mean "in parallel" as in feeding a common burden resistor, with resistance between windings, or not actually on the same core, that will work however.

Possibly the windings had enough resistance to begin with, that external resistors weren't needed.

In any case, that sets up a circulating current of one turn over, whatever the impedance of that loop is.  Which acts in parallel with the burden resistor (if this is all connected normally).  So it's like getting 50.5 turns but you get a burden resistor that's 2% lower than you thought (say if the windings are ~25 ohms each and the burden is 1 ohm).

Tim

There were indeed 2 secondary windings wound together turn by turn on the same core with the ends of the secondaries connected together and no resistors other than wire resistance in the secondaries. Like I said, losses were a little higher but it worked. That is also basically the description you gave of the variac where you have one or more turns connected to the same point (through the graphite wiper).  The patent dated from the 1940s or 1950s and I don't know of any production transformers ever being made.

There have been other schemes including one described in this patent from HP called "Transformer providing half-turn secondary windings". https://patents.google.com/patent/US3768055A/en .
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf