Wednesday, January 15, 2014

Sig's ATTiny85 SSTC Interrupter

In preparation for offering an interrupter kit to go along with the USSTCC (sstc controller kit) I got the first batch of ATTiny85 chips in today. So, I spent the day porting my program over to a standalone ATTiny85. I'd tested and proven my code on both Digispark and Arduino, so I knew it was solid, but there's always glitches when changing processors. It turned out to be the same naming glitch that pops up with the Digispark; ADC 1 is real pin 7, which is pin 2 in datasheets, which is actually pin "A2" in code. Aside from the code aspect I had to build an ISP programming board to mate the Arduino UNO to the ATTiny85. Simple stuff but still needed doing.

Everything checks out and things are a GO! I only ordered 3 MCU chips, and I have need of one myself. I accidentally bricked one by making a dumb mistake on the breadboard and connected ADC3 up to V+ instead of the regulated Vcc line, DOH! No worries, they're cheap, the code is solid, and my ISP (programming tool) is all set. So, only one will be for sale, much like with the first three USSTCC boards, lol (3rd board wasn't bricked there, but given to my design partner).

Here's the ArduinoIDE (C++) code for the Interrupter program.
Here's the application schematic:

Here's the BOM (Bill of Matierals):

Video showing low power testing with the Digispark version:

Tuesday, January 14, 2014

Building a ca.1928 Dual Triode Class-A Audio Amplifier

This is another recap of a previous project.

Basically the task came to me to clean up an old Victrola Radiola audio cabinet from 1928. The phonograph worked fine so it was left be, but the radiola (the AM radio) was toast. I figured I might at best get a few tubes to play around with or just a couple of inductors. It turns out nearly all of the tubes were good, and the PSU worked fine, but the tuning coils and caps were wrecked. I spent a bit over a week going through various experiments with the old tubes and modern tech to see just what all I could do with the parts I found. Here are the data files and the videos of progress:
Power Supply and Output Coupling:
RF amp, tuning, and AF amp "final" sections:

Simplified schematic:
Modified schematic showing rebuild as dual triode Audio Amp:
Videos detailing the various incarnations and progress:

Final Result:
The trickiest part, which is not on the last schematic shown, was finding a good negative feedback scheme (NFB) to try to balance the frequency response (enhance bass response by impeding treble's gain) and cut down on some of the hum. Unfortunately not all of the hum can be removed without remaking the entire power supply section, because these triodes are directly heated cathode tubes (filament valves) powered by AC, so since the filament IS the cathode the AC on the filament is imposed on the output by design. One has to remember that back in 1928 having sound come out of a box without a little man inside it was AMAZING, and having hum was of no consequence.
NFB on thermionic amplifiers simply involves taking some of the antiphase output from the output transformer and feeding it in to either the grid or the cathode (most often the cathode) of first amplifier stage. This is as simple as a resistor and a capacitor in series between the antiphase leg of the output or impedance matching transformer and the pre-amp triode's filament. I can't remember the values I used, but that info is of little consequence really.
What all this really shows is that triode class-A amplifiers are SUPER SIMPLE if you can find the right parts. The real unspoken hero here is the interstage transformer that takes the output of the first triode and couples it to the grid of the second triode. This is a job of both precision impedance matching and voltage transformation. There are no modern equivalents to get off a shelf. Interstage transformers were abandoned in the 30s for the most part when capacitive coupling was chosen as its successor. Using capacitive coupling is far cheaper, but it does require the engineer to figure out a proper value of anode resistor. The resistor forms a voltage divider with the tube, think of it this way; the tube becomes a variable pull-down resistor. The capacitor then couples off the dV (change in voltage) seen at the voltage divider output node. This scheme may be much cheaper to implement but there is a marked reduction in gain to having a series transformer directly couple the output. Such is the way of technology progression though.


How to Phase your Gate Drive Transformer (GDT)!

My video on the subject pretty much explains it. Simple stuff, but none the less needs to be learned from somewhere.

Monday, January 13, 2014

Arduino: High Quality Audio Modulated PWM

This project shows how to increase the clock speed of the Arduino UNO's ADC Analog pins to allow for a 77KHz sampling rate (up from the default ~10KHz), and increase the PWM carrier frequency on the PWM Digital Output pins to 64KHz on pins 5 and 6, or 32KHz on the other PWM outputs. This sampling rate is higher than your PC's audio card inputs!

This allows one to use an arduino UNO as a high quality audio PWM modulator. For the purpose of demonstration I have terminated the PWM output into a Low Pass filter to show the demodulated data, but in practice one would feed the output from the arduino to a Class-D type amplifier for amplification, and then feed that output into a Low Pass filter for data/signal recovery. This lends itself well to audio modulating a flyback transformer, as most flybacks perform well around 60KHz. One could simply feed the arduino output to a BJT totem or MOSFET gate drive chip like the TC4420 or UCC37322/UCC37321 pair or the dual inverting/non-inverting UCC37325 to attain the needed voltage and current amplification for driving power transistors (MOSFETs or IGBTs). Such an implementation of Arduino -> UCC37325 -> Half-Bridge Inverter -> Low Pass Filter is the basis for a super simple high powe audio amplifier. In this way the arduino emulates such chips as the SG3525 or TL494 without the complicated wiring needed to actually use one of these chips, as most of the work is done natively on the arduino.

The only components needed to get high quality audio modulated PWM out of the arduino UNO are two (2) 10k ohm resistors and one (1) capacitor. For the capacitor the higher the capacitance the better, and if you can get a nonpolar one all the better. The reason for nonpolar is that depending on what audio source you are hooking the arduino up to you need to know which has a higher DC bias; the arduino's 2.5V DC offset bias formed by the 10k resistors or the output of your audio source in order to properly install a polarized capacitor. If you can find a nonpolar capacitor, it doesn't matter which way you orient it. The larger the capacitance the better the bass response.

Example 1: iPod audio source.
Your iPod has no DC offset on its output so the arduino's 2.5V DC Offset Bias is higher, thus the positive terminal of the capacitor has to go towards the arduino, and not towards the iPod.

A -+2Vpk (4Vp-p) maximum audio signal can safely be input into the arduino, and the software is built around this. The code is dead simple though so it can easily be tweaked in software to allow for stronger or weaker modulation, but it is even simpler to just turn up or down the volume of the audio source.

Here is the input/output schematic detailing the resistor divider and DC-blocking capacitor on the arduino input, and the Low Pass filter on the output needed for signal/data recovery. You will find that this filter attenuates frequencies within the normal range of hearing. To get a better high end response simply reduce the value of R3 in the schematic. I experimented with values between 100Ohms and 1Kohms but found that too much carrier frequency (actually lower sidebands) was present for my liking below about 300Ohms.

Here is the arduino code for this program. Most of the magic happens in the void setup() block, as this is where the I/O speeds are increased. The void loop() block just has some basic signal processing math and feeds the processed data to the output pins.
Here is a video I uploaded showing it all in action. Forgive the poor audio quality shown; it is an artifact of the audio amplifier used, not the arduino. I didn't have a spare speaker or amplifier laying around other than my 1928 Dual Triode Vacuum Tube Audio Amplifier I built, which has a nasty 60Hz hum and nonlinear frequency response.

The nice thing about using a real SG3525 or TL494 is that you can easily set the carrier frequency with external components. In the case of the SG3525/KA3525 you have a range of up to 400KHz. The arduino emulation works great for when the carrier frequency doesn't really matter (other than being high enough to easily filter out) like with audio amplification. 

Sunday, January 12, 2014

Blog Inception!

Hey everyone, this blog is brand new. Over the coming [insert period of time] I'll be updating this blog with the results of my various projects and experiments. This will be a place to find out what I've been up to as well as get the important data and information on things I've developed.