Transformer Corner part 3

Designing your own HV Transformer

In Transformer Corner Part 2, I looked at the power supply used in my early Prototype, and showed how to determine the key requirements for the HV transformer.

Now, let’s see how I could choose the materials and design the transformer – without any pesky mathematical formulae!

A hand-wound HV transfomer!

The end goal – a hand-wound HV transfomer!

Picking a core

The first challenge was to find a suitable core from my junk box. First off, recall from Part 1 that this couldn’t be iron (too ‘slow’ for 151 kHz), and it couldn’t be air (too ‘weak’ for 25mA). I suppose I could have tried plastic, milk, or even beer – but I knew better. I knew about a substance called Ferrite.

Ferrite is a beautiful, fascinating substance – lightweight yet capable of hosting intense magnetic fields at high frequencies. But there are many different types and grades of the material, with different characteristics. The choice must not be taken lightly! I looked at each of my transformers carefully, and evaluated them strictly on which one looked the coolest. Very scientific…

The core I picked for the Prototype – sorry, no pix of what it looked like before winding

Well, to cut a long story short, this junk core did work in the Prototype. But only barely. The transformer doesn’t have much power, so the image on the screen is a little dim. And it gets very, very hot. Thank goodness for my Auto Power-off feature!

Picking a BETTER core

Later, long after the Prototype was complete, I learned a far smarter way to choose materials. I discovered that transformer cores and bobbins with published technical specifications are actually available in hobbyist quantities (like one), from large houses like RS Components, and from numerous mom-and-pop shops around the globe.

Selection of cores & bobbins from my local mom-and-pop shop

Selection of cores & bobbins from my local mom-and-pop shop

Core & bobbin specs

Core & bobbin specs

Inside the specifications, there is a characteristic called “AL-value“, which tells you how much inductance you get per square-of-turns around the core. This is really helpful, because we know what primary inductance we want (we calculated this in Part 2).

TDK Transformer specs example

But, this AL-value by itself won’t help us in choosing a core. You could choose a low-inductance core and have many turns, or a high-inductance core and have only a couple turns, and theoretically get the same total inductance!

… Here is where losses come in. For a small current output, using a massive core with just a couple primary turns will work – but it’ll be pretty inefficient. Think of my ‘inertia’ analogy – it makes the thing just too dang lunky, and to keep up the induction the switcher will have to pass some pretty heavy current through the primary winding. And you’d have to use thicker wire. And the core itself would heat up. All so very wasteful.

But at the other extreme, if you choose a small core and have lots of primary turns, you end up with a different set of problems:

  • Since the wire itself has some resistance, with many turns, power will be lost in the winding, generating heat. Lovely.
  • Why not use thicker wire for the primary to lower the resistance? Sure! But… how many turns of thick wire can you fit around the tiny bobbin? Not many.
  • Let’s say you manage to squeeze 50 turns of thick wire on the primary. Congratulations! But uh-oh. You forgot you have to wind the secondary, with 14 times more turns. That’s a whopping 700 turns! You could use super-thin wire to fit it on the bobbin, but then you face the resistance and heat problem again – there just wouldn’t be much power for the poor old Oscilloclock.

So, therein lies the compromise, and it’s an important choice.

For my proposed circuit, I would choose something like the TDK PC44-EPC19 core. It nestles nicely in the hand, is not too heavy, and has the most luscious fragrance to it. OK, ignore the last part – but generally it just feels ‘right’.

How many turns?

The primary inductance of my transformer needs to be around 80 µH. The specification above tells me that the PC44-EPC19 core will give me 940 nH (or 0.94 µH) inductance per square of turns. Arghh.. there is a little bit of maths involved! 80 divided by 0.94 gives around 85 square-of-turns. The number of turns is the square-root of that, which is 9.2 turns.

But wait!! Look closer at the AL-value in the spec. It says 940 nH plus or minus 25%. This means that, depending on the core’s manufacturing lot and also on how it’s mounted physically, the square-of-turns could be anywhere from 68 to 113, and hence the turns required could be anywhere from 8.25 to 10.6. What if we wound 9 turns, but our core was on the ‘light’ side? We’d end up with a fair bit less than 80 µH. Would it matter so much?

Nope. These switching regulator ICs are pretty smart. They can adjust switching speed and duty cycles to work with your transformer’s inductance, to a certain extent. So for now, let’s just assume we’ll wind 9½ turns, and move on.

Picking the wire

Copper wire for transfomers, or magnet wire, comes in all kinds of gauges (diameters). We need to pick a wire gauge for both the primary, and the secondary.

The key factor for choosing this is going to be the resistance per unit length. My antique but trustworthy ARRL Handbook shows this as “Ohms per 1000 ft”, as shown below. (Ugh. Feet!! Normally, I boycott non-metric measurements, but I love this book so much that I’m going to use this chart anyway.)

Wire gauge table from my 1953 Radio Amateur's Handbook

Wire gauge table from my 1953 Radio Amateur’s Handbook

1. Primary Winding

The main concern here is the primary resistance, which we know from Part 2 should total around 0.08 ohms. We need to pick a wire that, with 9½ turns around the bobbin, will match that value. If we look at the specs for the BEPC19-1111 bobbin that goes with my core, the lW measure tells us that the length of wire for each turn around the core is 34.4 mm.

Even the bobbin has specs... the key parameter here is lW

Even the bobbin has specs… the key parameter here is lW

At 9½ turns, the length of wire is 326.8mm, about 1.07 feet. Now let’s go back to the wire gauge chart, and look at a few choices:

  • #28 gauge: 0.06617 ohms/ft x 1.07 ft = 0.0708 ohms
  • #29 gauge: 0.08344 x 1.07 = 0.0893 ohms
  • #30 gauge: 0.1052 x 1.07 = 0.1126 ohms

To get 0.08 ohms, we should choose something between #28 (dia. 0.3211 mm) and #29 (dia. 0.2859 mm). But you know what? I have a nice big spool of 0.25 mm coil wire that I bought 25 years ago that I really want to use up. This is a tad thinner than #30 – the resistance will end up close to 0.12 ohms. But I DON’T CARE! I’m going to use this wire. We’ll see soon whether it works okay or not.

25 years old and still got heaps to go!

25 years old and still got heaps to go!

2. Secondary Winding

We know from Part 2 that the secondary turns ratio is 1:14. If we have 9½ turns on the primary, then we’ll have 133 turns on the secondary.

The first thing to worry about when choosing wire for the secondary is whether it will handle the required current, without too much power loss in the form of heat. Let’s see how it turns out:

If I use the same 0.25 mm diameter wire, then the total resistance for 133 turns calculates to about 1.6 ohms. But in practice, it’ll be closer to 2 ohms, because we’re going to have to overlap turns (133 turns at this diameter simply won’t fit on the bobbin in a straight line), and that will cause increased resistance.

Now, if I fully load down my output to 25 mA, then I have .025 squared x 2 ohms = 1.25 mW of power loss in my winding. Compared to the total power output, 150V x 25mA = 3.75 W, this is miniscule. And also, .025 x 2 = 0.05V voltage loss is tiny compared to 150V. Great!

What if I used super-thin, super-cheap #40 gauge wire? Ha – still only 9.75 mW and 0.4V loss! All this just proves an Oscilloclock theorem:

In the case of low current HV outputs, secondary wire gauge doesn’t really matter! Just use whatever you have handy.

There is just ONE possible problem left. Will the required number of turns fit around the bobbin? Well, manufacturers have charts showing the maximum number of turns for each bobbin and given wire size. See below. It says maximum 1,600 turns of 0.25 mm wire will fit around the bobbin – so my 133 turns is well within the limits.

Exceeded the maximum turns??

Exceeded the maximum turns?? Check the spec

If we look at it the other way around, the maximum diameter I could use to fit 133 turns would be around 0.48 mm, or about #25 gauge.

So… Design complete!

We’ve decided on the following:

  • Core (TDK PC44-EPC19)
  • Bobbin (TDK BEPC19-1111)
  • Primary and Secondary wire (0.25 mm)
  • Primary turns (9½)
  • Secondary turns (133)

In the last post in the series, I’ll examine the hand-winding process, and we’ll see just how well (or poorly?!) my transformer works. Stay tuned!

Transformer Corner part 2

In Transformer Corner part 1, I introduced one of the key parts of the Oscilloclock – the HV transformer, and tried to illustrate some of the concepts and history behind it.

Next, let’s explore the Prototype’s power supply configuration. This will tell us a lot more about the transformer I had to wind!

Power supply design

My greedy little Oscilloclock wanted lots of different voltages:

  1. 6.3V AC for the CRT heater
  2. 60-80V DC for the blanking circuit, feeding the CRT grid
  3. 5V DC to drive the blanking optoelectronics
  4. 300V DC to drive the horizontal and vertical amplifier circuits
  5. 3kV DC to accelerate the electron stream to unfathomable speeds

A key constraint is that the first 3 outputs have to float at cathode potential, around -3kV with respect to the power supply’s input. Hence they need to be isolated from the input and from the other outputs.

The most common way to obtain lots of isolated voltages at different potentials, is to use a flyback topology circuit, and a transformer with multiple secondary windings – one for each output needed.

Typical multiwinding flyback circuit - as used in production model Oscilloclocks

Typical multiwinding flyback circuit – as used in production model Oscilloclocks

Well, winding such a complicated transformer by hand would have been way beyond me!

Continue reading

Do chips have bugs?

There are probably many people who think that microcontrollers are bug-free. After all, they are glorified integrated circuits; a hard-wired jumble of infinitesimal transistor logic gates. There should be no unexpected behavior, as long as you operate the device within the rated voltage and temperature parameters….

Wrong!

What we tend to forget from our CPU architecture classes is that a CPU actually has a program inside. Known as microcode, its primary function is to interpret each instruction into the right electrical signals to drive the various parts of the CPU. For example, an addlw 0x7F instruction might involve directing the ALU’s input to the next word in program memory (0x7F), and then telling the ALU to add it to WREG, with output set back in WREG. The microcode for addwf MyVar would be different again; it needs to get a value in RAM, and set the result back there too.

Well, where there is a program, there will definitely be bugs.

My first experience with a microcontroller bug cost me several weekends of frustration, fretting, and frantic but fruitless rework. Here’s how it happened:

Oscilloclock Gone Wild

It was the early days of the Prototype, And things were looking great! My dream was coming to fruition! Except… every once in a while, the clock would go absolutely berserk. Seemingly at random, it would start displaying crazy, meaningless images, and controls would cease to function. Sometimes it would recover; other times, it would exhibit brain death – requiring a hard reset.

April Fool's? No - it's a PIC bug!

April Fool’s? No – it’s a PIC bug!

No amount of testing or experimentation could tell me what the problem was. I rewrote huge blocks of code. I removed massive chunks to simplify the code. I drank more and more coffee. Sleepless nights and grumpy days ensued, wasting my precious youth!

Continue reading

Font & Figure Creator!

Those of you who own, or are building, an Oscilloclock may have realized how tedious it is to create a new character or drawing. My little Casper (October, Seasonal Treats post) required a grueling 5 hours to get him looking good!

Casper - as drawn by my son (L) and then the Oscilloclock (R)

Casper – as drawn by my son (L) and then the Oscilloclock (R)

The current method – Painful

I have another blog post series in progress describing the theory behind Circle Graphics figure display, so I won’t elaborate on details, but the current process of getting a figure from paper to screen is very much manual:

  1. Roughly sketch out your figure on graph paper.
  2. Split out your lines and curves into blanked circle and line segments.
  3. For each segment, roughly ascertain the circle’s radius (width and height) and centre coordinates.
  4. Type the numbers into the code file, in PIC assembly language syntax.
  5. Build the code and Program the PIC.
Easy?

NO.The figure looks NOTHING like you expect. The size is wrong. The edges don’t meet up. The curvature is out. The thing is upside down. All of the above!

  • Repeat steps 3, 4, 5 for several hours. Drink coffee. Redraw and repeat for yet another few hours.

  • Finally – Celebrate the birth of a new figure!

The Easier Way

The new Oscilloclock Figure Creator utility allows you to easily create and modify font characters, graphic images, and sprites – interactively.

Continue reading

Circle Graphics – Lissajous figures

By the time you read this post, you must have seen the term “Circle Graphics” in a thousand places across the site.

In fact, “Circle Graphics” is not an official term – I just use it to describe how shapes are drawn on these clocks:

Everything you see on this screen is made up of CIRCLES! Blank out part of a circle and you get an arc. Squish an arc and you get a line. This clock simply draws circles, lines, and arcs of different sizes at various points around the screen. It does it quickly. And it does it very, very well!

The effect of using circles is beautiful – shapes are smooth and precise, with no jagged edges or pixelation.

Beautiful circles with no jagged edges

Making “perfect” circles

I carry on as if it were some incredible new concept or discovery, like the Higgs boson. But in fact, the analog technique of constructing perfect circles, ovals, and lines on a CRT is very, very old. These figures are really part of a class of shapes called Lissajous Figures.

Continue reading

BOO!

Oscilloclock.com proudly presents a new feature – Seasonal Treats !

This month, the ghosts come out of the attic and merge with the electron stream, leaving their telltale prints in the phosphor… but if you get too scared? Just push the button and blow them up!

Continue reading

Transformer Corner

The atmosphere at Oscilloclock.com has been charged lately. Mails have been pouring in from folks who want to generate high voltage for their CRT projects, but have instead ended up with high tension from frustrated attempts. The primary culprit? Lack of a decent HV transformer.

HV Transformer basics

CRTs require high voltage, to coax electrons out of the electron gun and then accelerate them towards their fiery demise at the screen. This voltage can range from hundreds of volts for small tubes, to tens of kilovolts for large tubes! In the case of the Prototype and Model 1 CRTs, around 3kV was needed.

My Oscilloclock needed 3kV to draw this!

Continue reading

The Invisible … Beam?

One of the most exciting things you can do with a Scope Clock is to simply look at it from behind! In many CRTs, the anode coating (a conductive black surface sprayed onto the inside of the glass) doesn’t extend all the way to the screen – leaving a nice gap of clear glass from which to observe the beautiful electron beam.

Ha – you can put down your magnifying glasses now.

Continue reading