background

Odds and Ends


Experiments, unfinished projects, odds and ends that don't fit into a complete project.
Updated: 21/11/2014

Subwoofer Amplifier (WIP)

I started designing this amplifier after having a subwoofer plate amplifier fail. I attempted to repair the original amp after it failed, only to have it run for 10 minutes and then blow the output stage in the same way again. I suspect the cause was thermal runaway in the output biasing but did not get as far as pin pointing the issue. The amp was a mediocre design so I thought I would take the opportunity to design a drop-in replacement power amp board with significantly better performance.

The original amp is based on the same design as NHT's 'SuperSub' (schematics shown below). The main difference excepting component choices is that the Dayton amplifier has an additional mains-powered SMPS which supplies opamp U6 on the input board and controls mains power to the transformer, considerably lowering standby power consumption.

Original power amp PCBsChassis Layout

Original power amp PCBs, Chassis layout

Original power amp schematicOriginal input board schematic

Original amp schematics

The larger PCB contains the output stage, biasing circuitry, bridge rectifier, smoothing caps and an 18V linear regulator. The secondary of the transformer is about 90Vac center tapped, which gives ~+/-65Vdc rails. The output transistors are mounted on the back of the PCB and sandwiched against the heatsink. The smaller daughter board contains the power amp input stage and soft-limiter circuit (reduces the harshness of clipping as output reaches supply rails).

10,000uF on each supply rail seems awfully inadequate for a 4ohm output with 65V rails. I guess they are relying on the supply rails drooping significantly with a 4ohm load to keep the dissipation in the output transistors down. Two TO-3P output devices per rail would be overloaded with solid +/-65V rails and a reactive 4ohm load. 8ohm loads should be OK (barely).

Protection circuitry in the original design is somewhat limited. There is a temperature sensor which brings the unit into standby temporarily when an over temperature condition is detected. Additionally there is over-current detected across the emitter resistors in the output stage. Unfortunately the over current circuit is capacitor filtered so it is probably too slow to adequately protect the output transistors in all situations; it is however latching. There is no DC offset protection and the speaker output is permanently connected to the amplifier. If the output becomes shorted to the supply rail or the input stage holds the output at significant DC offset, destruction of the speaker driver is almost guaranteed.

Redesign

My proposed amplifier design uses a complementary pair differential input stage with improved wilson current mirror, complementary Class-AB output stage and dual-slope V-I limiter to protect the output transistors.

Additional supporting circuitry includes a muting circuit with fade-in, DC offset protection and output relay driver. It uses a power-up sequence which minimises thumps/pops through the speaker when the amp comes out of standby.

Power amplifier schematicMuting/Protection schematic

Amplifier schematic, Supporting circuitry

Output spectrum simulation, 8ohm loadV-I limiter simulation

Simulated spectrum/distortion, Simulated V-I limiter operating area

PCB Layout (WIP)

PCB Layout (WIP)

555 Boost Converter (with jellybean partslist)

I decided to build this just for fun/educational value. I looked around for a decent 555 based SMPS design but all of the designs I came across either had limited output current, terrible efficiency, dubious stability or required speciality components. I took inspiration from a few different designs and came up with my own boost converter design.

My design uses a single 555 as a pulse width modulator driven by an opamp integrator to provide regulation. A discrete gate driver provides a lower impedance drive to the MOSFET's gate than the 555 can provide. The gate driver is also bootstrapped from the output to drive the gate to around 11V which is required to achieve low MOSFET drain-source resistance. The circuit is designed for 5V input and 15V output but be easily reconfigured to work with different voltages. Component selection was mostly dictated by what I already had on hand. The choice of opamp is not too critical - I've used an LMC6482 but the only real requirements are an output that includes the negative rail, input common-mode range that includes the reference voltage and no phase reversal if the input common-mode range is violated. I initially placed R5 and R6 to prevent the 555 being driven to 100% duty cycle (which was possible with the ideal SPICE model I initially simulated with) and causing a short circuit deadlock. In practice with the bipolar NE555 driven from a 5V rail this is not the case though I kept the resistors since they can be used as a current limiter.

Efficiency reaches about 83% at 500mA output but this can surely be improved by swapping the MTP3055V MOSFET and 1N5822 diode with components that have lower Rds(on) and lower Vf. The breadboard probably isn't helping efficiency either. Quiescent input current is 16mA at 5V. The 555, opamp and voltage reference should probably be powered by a linear regulator or at least placed behind an RC lowpass filter to ensure that secondary oscillation doesn't occur due to ripple on the input voltage rail - this was observed on the breadboarded circuit at >1A output current and is part of the reason for the overkill amount of capacitance used. The inductor should preferably be >100uH, I only had low permeability cores and 20AWG wire to work with so a compromise had to be made between inductance, DC resistance and spending an excessive amount of time winding a core by hand.

555 SMPS Schematic

Schematic

555 SMPS Breadboarded

One messy breadboard :)

Audio Power Amplifier 'Dynamometer'

This is an evolution of the Pocket Audio Distortion Meter I previously designed. It more or less started as an experiment to see how much performance could be extracted from the on-chip 10bit ADC in the Atmel ATMega series of microcontrollers.

The main addition is a relay-configurable resistive load, using four 4ohm banks of power resistors. Two 400Watt and two 800Watt banks allow for a 1600W configuration at 1, 2, 4, 8 and 16ohm. Additional load impedances are possible to configure with varying power handling. The load can also be disconnected for high impedance measurement.

Changing the ATMega328 to an ATMega128 provides the extra I/O needed to drive the dot matrix LCD display and extra peripherals. An voltage reference was added (the handheld meter used the internal uC reference) which together with calibration data (of input stage gain and load resistances) allows voltage, current and power to be measured in addition to distortion.

The sampling rate is configurable up to 76KHz, but bandwidth is limited to 10KHz due to an analogue low pass filter. The ADC capture is triggered from a hardware timer to ensure low jitter. The sampled data is decimated to reduce noise and increase resolution. The display can be user configured to display any combination of total harmonic distortion, voltage, current or power in various units.

Currently the test signal frequency needs to be input by the operator, though I would like to add the functionality for it be auto-detecting.

One problem I have encountered so far is the wetting current of the relays, which is as much as 100mA. It could be alleviated either by implementing a circuit which provides a burst of current through the relays/load whenever they are reconfigured, or by shunting the larger relays with smaller relays which have a much smaller wetting current requirement.

Front panelInterior Layout
Relay BoardLinear powersupply and Microcontroller board
'Live' measurement display'Live' measurement displayprogrammable sample rate and test signal frequency
FFT spectrum displayload selection'Live' measurement display

LED based Spectrometer

I built this 'spectrometer' to investigate the characteristic of regular LEDs being used as photodiodes. The idea was to produce a device that could be placed on a flat object of solid colour and evaluate it as a 24bit RGB color.

Phosphor based LEDs (white, cyan, pink) are used for back-lighting. Each group of back-light LEDs can be varied in brightness by the MCU using RC-smoothed 8bit PWM outputs as basic DACs.

Red, yellow, green and blue LEDs are used as photodiodes. The current from each LED is fed into a high gain amplifier and then sampled by the MCU's ADC.

Without access to any test equipment able accurately characterise the absorption spectrum of the LEDs, I made some crude measurements by shining different coloured LEDs onto them. It would appear that most LEDs have a peak absorption roughly around the same wavelength as the peak emission and are somewhat sensitive to shorter wavelengths but not longer. The overlapping bandwidth of each type of LED and lack of any LED with a peak sensitivity to green light makes it difficult to map to RGB. If the exact frequency response of each LED was known, it might be possible to determine R, G and B as a function of the different LED outputs.

A better colour detector can be made by using a single photodiode with a wide frequency response and multiplexed coloured back-lighting.

Spectrometer front  Spectrometer Rear

Spectrometer Rear

Typical LED Emission Spectrum  Approximate LED absorbtion spectrum

Pulse width modulator / Class-D amplifier

This is a low power semi-discrete class-D audio amplifier - only opamps, comparators, schmitt triggers and discretes are used. It consists of a triangle/ramp oscillator, comparator, MOSFET output stage with shoot-through protection and a low pass filter suited to a 4-16ohm load impedance.

Without feedback, performance is not spectacular (around 1Watt into 4ohm @ 1% THD). The triangle oscillator runs up to around 1MHz without significant distortion, however the switching speed of the output MOSFETs limits low distortion operation to around 200KHz.

The feedbackless comparator and output stage can be used to perform wave-shaping if a non-ideal (non-triangle) oscillator is used.

Class D Amplifier Front  Class D Amplifier Rear

Triangle Oscillator

Arduino compatible Touchscreen GUI

This is a touchscreen GUI for a type of Arduino compatible colour touchscreen LCD module/'shield' that is commonly available on ebay.

It extends on the ITDB02_Graph16 graphics library (now superseded by UTFT). GUI objects such as function buttons and text variables are easily created. Numeric variables are easily modified with a popup numeric keypad. Objects can be placed in frames/windows allowing groups of objects to be easily hidden, brought to the front or sent to the back.

One improvement that needs to be done is the creation of a colour class to define RGB colours and perhaps a class to define colour schemes, as defining individual RGB values each time a GUI object constructor is called doesn't make for easily readable code.

Function Generator example GUI

Arduino Touch GUI Library (.zip 425KB)

Pressure sensitive touch demonstration with ADS7843

It is possible to derive the pressure on a resistive touchscreen with the ADS7843 touch controller, as described on page 12 of the ADS7846 datasheet. I found with the cheap touchscreen I had there was not a great physical range between barely registering a touch and saturating the resistive elements.

gMenu

gMenu is an object-oriented menu library for graphic LCDs on Arduino that allows simple creation of menus to manipulate variables.

Features:

  • Automatic sizing based on menu position, display resolution, number of menu entries, display width of entries
  • Scrolling
  • Supports Boolean and Integer data types (with min and max limits)

draw3D

draw3D projects 3D vectors into 2D space, provides basic manipulation such as 3-axis rotation around a given point, translation and configurable camera position, rotation and FOV.