Friday, July 21, 2006

A Linear Coil Winder Part 3

I went through several phases when I designed the control electronics. My primary design goal, and this was more to maintain a clean state around the house than anything else, was to avoid buying anything if possible.

My first thought was a simple "power follower" linear regulator. I already had all the passives, op-amps and heat sinks to make this happen. I nixed this idea because to implement forward/reverse, I'd either have to make a class-B output stage and have a transformer of twice the voltage, or I'd have to use some MOSFET switches to flip the motor polarity. But MOSFET switches immediately suggest an H-bridge. That allows forward/reverse/speed control in one fell swoop. I thought, OK a PIC microcontroller is perfect for this job. Not only do they have PICs with dedicated PWM outputs, I'll be able to implement the turn counter at no added cost! But to me, there's something fundamentally unsatisfying about writing some dumb C routine with interrupts and system timer calls (because it is after all a PIC, not real C) that flips a bit at some given time to produce a pretty PWM wave. Call me old fashioned (not a hater, because at least I program PICs when absolutely necessary) but I didn't want to build a software project. My other beef with that was I still needed gate drivers something the PICs I had didn't do. So I'd end up doing some circuit design with this implementation as well. Obviously everyone makes single chip H-bridge drivers (some with integrated MOSFETs as well) but I didn't want to buy anything, right?

So I decided, I'm going to build this all in TTL logic. My plan was to use a Bose oscillator (at least that's what I and a few others call it) to generate a one-bit Sigma-Delta value for the duty cycle, feed it into a TTL circuit which handles forward/reverse as well as non-overlapping clock generation, and then use the TTL to power some 2N3904 and 2N3906's which function as gate drivers to drive my IRF5305 and IRF3707 power MOSFETs, which I had laying around. After some thinking, I came up with this non-overlapping clock driver circuit:

I'm not sure what's wrong with me, but I really care about non-overlapping clocks. In switched capacitor circuits we use them because the charge on a node is of critical importance, but in power electronics we use them to prevent "shoot-through" current. This happens all the time with digital logic, it accounts for why CMOS dynamic current consumption is more than necessary. Take an inverter. As there is no such thing as infinite rise and fall times, its input will pass through a middle ground around VDD/2 where both N and P MOSFETs are in saturation. (assuming normal VDD) during this time, the two MOSFETs are fighting each other for control over the output node, and a huge amount of power is being shorted from VDD to ground. Imagine instead if we first turned of the "on" device before switching on the "off" device. Result? For a split second (wow, that's normally a figure of speech but here I mean it) the output node is floating, which maaaay in some circumstances be bad, but you win in the fact that there's never a direct path from VDD to ground.

Anyway again I'm a moron because the non-overlap of this circuit is in the 10's of nanoseconds, but if I'm going to drive my gates with a homebrew discrete driver, I'll be lucky if my switching time is in the 500 nanosecond range. On top of this, the TTL gates were really starting to annoy me. The pinouts were weird, half my inverters in the CMOS hex inverter (for level shifting to the 12V VDD the motor needs) were blown, so I got fed up with this digital abstraction garbage and went back to analog roots.

I designed a simple PWM controller with a triangle wave generator and two comparators. For the triangle wave generator, I used LM741's. Now most of you will think, who uses 741's anymore? Well I'll be honest, I had a load of LM348's (quad 741's) but just one TL084 (quad JFET op-amp) so I decided to save my better op-amp and use the crummy one. There was just one problem with this... I couldn't make the 741's oscillate cleanly above 20KHz, which means I will be in the audio range. I tried to pick some nice sounding frequency, so I landed in the few hundred Hertz range. The trimpot in the oscillator adjusts the triangle wave offset so that when the speed control is at zero, the duty cycle of the drive signals is 50%.

The LM311 comparator is really a neat chip. Not only can it can source up to 50mA through its output stage, it has an open collector and floating emitter, so you can drive a phase splitter like this:

This circuit is also great for me because it automatically does symmetric level shifting. The two comparator voltages are offset by a diode drop, which will give me non-overlapping clocks. (yay!) Finally, I put in another 100 Ohm collector resistor in the drive stage to remove some of the stress on the LM311. So putting everything together, this is what I came up with:

Note that all the bypass and filter caps aren't shown, but don't worry they're there. All protoboarded out, we get something that looks like this:

Of course, here are my non-overlapping clock signals. See how neither of the signals are high simultaneously? Now I can finally shut up about them.

Here is the completed drive section. I used a 14V switcher DC power supply, so I didn't have to have an exposed transformer and live wiring. To make sure the MOSFETs survived during intense coil winding sessions, (calm down) I used a cut piece of aluminum angle brace to heatsink them all together.


Now, all together the coil winder is complete. I had some fun and used a two-color LED, so it lights up red whenever it is plugged in but off, and when you turn it on it turns green. Just adding some flair!

Here are a few details. The drive shaft is spring loaded on one side to maintain position and not slide around:

Here is the back of the drive electronics. If you look closely, you'll notice the left standoff screw is missing... Idiot me didn't drill the hole in the base deep enough, so it bottomed out and the head snapped off when I torqued it. (honestly, calm down)

Here's the first coil I'm winding. First I sanded the acrylic surface down, and now I'm flame polishing it.

Well, in the middle of winding, I'd say it works alright... The great advantage here is I can wind the coil without touching the form or the wire, so that I don't get finger grease and salts, which are potential causes of breakdown in Tesla coils.

Ok, so here's what's wrong with it.
  1. Why did I think a threaded rod from Home Depot would be perfectly straight?
  2. Switching frequencies in the audible range... Way too loud. It sounds pretty awful.
  3. My MOSFETs still get hot... I think that is because I am not overdriving them enough, only about 3.5V, so the Rds,on is not insignificant. Perhaps I should remove the collector resistors of the LM311's, they stay cold.
  4. I'm relying too much on the speed control and not gear reduction ratio, so at low speeds the motor (9 pole permanent magnet) is a bit too jerky for smooth winding. I'd do better to make the shiv much bigger and run the motor at higher speeds.
  5. What happened to the turn counter, you might ask. Well, here's the story... I got a few seven segment common cathode displays. The 7447 IC which drives these are open collector, which means I'd have to use 28 inverters to drive four digits. This sucks. Furthermore, the 74LS90, a BCD decade counter, is the most idiotic IC I've seen. As far as I can tell, it does not have carry-out logic, making cascading these stages really annoying. I'd need a four input AND gate for each stage. The CMOS equivalents, CD4510 and CD4511 are much more reasonable, but I didn't have fast access to them, and I needed to finish this project in a day. So I guess no turn counter until next time, but I do have board space for it.
  6. This thing is too big... Where's it going to go?
A huge thanks to Bob Lasher at Al Lasher's Electronics for lending me equipment. If you're ever in Berkeley and need electronics fast, this is the place to go!

0 comments: