Monday, 20 October 2014

Tube Simulator - Practical Implementation - Chassis, face plate (3)

Face plate design

For the face plate design I used Inkscape. Inkscape is a free vector graphics editor and design tool for professional and amateur use. There are lots of tutorials, videos and materials for fast and easy learning. Cool free fonts can be found in the internet. It is important to install the fonts in the computer used for design but also in the computer used for printing, otherwise default fonts will be selected.
I wanted a simple design with a cool, coloured background but that could match well with the natural aluminium colour of the rest of the box, so I used a kind of steel or aluminum grey and then I used a liquid effect.
This is the result:
It's important to have the right dimensions that correspond with the placement of the potentiometers, switches, jacks and other components in the PCB layout. Since the board was mounted on standoffs in the base plate, the height of PCB and standoffs has to be considered.

The design can be very easily flipped horizontally before printing. I printed the design in A3 printing transparencies used for presentation slides with a laser printer. Since the design is printed flipped in the A3 transparent sheet, the ink stays in the side that has to be glued to the enclosure, which helps protecting the ink from scratching if it were exposed outside.

Cut out front and rear face plates from the transparent sheets and verify that everything is in the right place. You can actually see the effect of not installing the proper fonts in the computer used for printing.

Front face plate placed in position (not glued yet):
Rear face plate placed in position (not glued yet)

Chassis assembly

Before fixing the face plate to the chassis, holes must be drilled in the chassis.
Instead of using regular metal drills I recommend using a multi-drill bit and of course a drill support, a much higher precision of drilling is obtained.
Not flipped design can be printed in a regular paper, placed in position and with a hammer and a punch tool the center of the holes to be drilled can be marked.

Once the holes have been drilled, chassis cover must be put in place because very often components are not perfectly aligned or they don't have the exact diameter, so the holes must be adjusted with a file.

Once printed, the design is cut out with some scissors and fixed to the chassis faceplate using transparent glue in spray:
Aluminum chassis must be perfectly clean with no traces of dust, grease or fingerprints. Some acetone can be used for cleaning it.
The glue must dry for 2 or 3 minutes before applying to the chassis, it must be positioned carefully and properly aligned trying to avoid that bubbles form between the face plate and the chassis. Use a clean cloth and apply some force to stick the face plate to the chassis.
Once the face plate is in place, a cutter can be used to remove the face plate in those areas corresponding to the holes.



Now the chassis is fixed to the PCB and base plate, inserting the front components in their holes that were previously verified. rear components are soldered with wires to the board. Nuts are added to potentiometers, switches and jacks with black plastic spacing washers.
Insert the rubber buttons with the potentiometers completely turned anti-clockwise and the dials pointing at 0, and the job is done!!

Front view of finished chassis:
Rear view of the finished chassis

The Tube Simulator is finished, now is the time to plug it and see how it sounds!!
But wait I need a cabinet speaker to plug my Tube Simulator amplifier...

Monday, 8 September 2014

Tube Simulator Practical Implementation - PCB layout, manufacturing, assembly (2)

PCB layout


The PCB has been designed in two layers, using a maximum of ground and power planes surface and numerous vias, specially in the central ground pads below ICs that dissipate more power: regulators and power audio amplifiers.

PCB width is mostly imposed by the front panel controls: switches, potentiometers and jacks.
With that in mind a proper aluminum box was chosen:
Hammond Manufacturing 1444-1372 13 x 7 x 2 inches (W x D x H) 

The L shape of the PCB leaves some space for AC power inlet, AC power switch, 1A AC fuse, AC/DC power supply, and the posibility of adding a PCB module for FX loop effects or digital reverb circuit (these modules have not been implemented yet)

Top layer


Bottom layer


PCB manufacturing


For PCB manufacturing I used Eurocircuits web site. Eagle CAD files can be uploaded and there is a very practical Price Calculator that allows having immediate quotes with options for standard pool or PCB prototypes for small PCBs . They also have the possibility to verify the PCB layout after file uploading.
I paid 140 euros (transport and taxes included) for one prototype on a 7 day working days delivery. Usually is recommended to manufacture at least two prototypes. PCBs are manufactured in Europe, they have a factory in Hungary.

Quality is very good with nice finish:

PCB assembly


The assembly drawing and the PCB ready for soldering components. SMD DC-DC converters with central pads where previously mounted using solder paste and hot soldering gun.
The solder paste that appears in the photo below was purchased in a generic DIY store and created lots of problems of oxidation. I recommend using a solder paste specific for electronic use with lowt melting temperature, usually RoHS (not leaded) solder pastes have a quite high melting point, but there are some RoHS compatible solder pastes like alloy 58 Bi / 42 Sn with a melting point as low as 138°C. The one I use is EDSYN - CR11 58/42 Bi/Sn from Farnell

It is very important to leave thermal reliefs on pads, specially in a design like this with large power and ground planes, otherwise solder iron heat will dissipate through the plane and soldering those pads will be a nightmare. I know because it happened to me.

The PCB with most of the components soldered. Rear connectors must be soldered with wires to allow PCB assembly in the chassis.

The AC/DC power supply module used was a Murata MVAD040-24 40W (23 euros) open switching power supply module with 120/230V AC@50/60Hz input and +24V DC@1.67A 40W. 



PCB mounted on the chassis aluminium base plate, with AC/DC power supply, 1A AC fuse and AC power switch:

Friday, 18 July 2014

Tube Simulator - Practical implementation -Schematics, BoM (1)

For the practical implementation of the Tube Simulator, Eagle CAD was used for schematics capture and PCB layout.

Component Selection and Bill of Materials:

SMD devices where used for smaller sizer, 0603 resistors are a good compromise between easy hand solderability and small size.

Texas Instruments LME49723 audio dual operational amplifier was chosen as a good compromise between low distortion, quality, cost, size, nice SOIC packaging and high power supply voltage.
I particularly like TI website for its quick and easy selection of components by means of a parameters table and a large choice of components.

Even though I am a big fan of MLCC (multilayer ceramic capacitors) I read in a series of articles in EDN website (Signal distortion from high-K ceramic capacitors and the follow-up More about understanding the distortion mechanism of high-K MLCCs) that film capacitors are better suited for audio applications since they are more linear in its frequency response and have less harmonic distortion than ceramic capacitors. MLCC capacitors experience large changes in capacitance as the voltage across them changes, which can result in harmonic distortion. So I decided to use film capacitors everywhere where the capacitor value was key to filtering the audio signal.

But I still used MLCC for signal bypassing and power supply decoupling.

The BoM was created in the Mouser website, with a huge selection of components and hardware

This is the link to he whole Bill of Materials on the Mouser website:

Input Preamp and Output Amp Schematics (page 1)


Each opamp stage is based in the aforementioned LME49723 device consisting of two opamps.

In the first opamp stage, zener diodes are used to clip signal levels. A 6.2V zener diode BZX84C6V2LT1G is used in the positive cycles and a 4.3V zener diode BZX84C4V3LT1G is used in the negative cycles.

After the first opamp stage a Schottky diode BAT54 in series with a 470k resistor is used for soft clipping, this provides a clipping closer to germanium diodes.

On the second opamp stage there is a feedback branch with a NPN transistor (MMBT2907ALT1SMD) which has its base biased at 1.65V, a TI LM4041CIDBZ shunt voltage reference was used. Another feedback branch uses a 2.7V zener diode BZX84C2V7LT1G in series with a diode MMBD4148 and a 470ohm resistor for clipping negative cycles. A third branch used another 2.7V in series with a higher 10K resistor for soft clipping of positive cycles.

The third opamp stage is just a follower to send the signal to an external effect circuit and to the output amp section. The return is also input to this stage.

An equivalent circuit to the VOX AC30 bass/treble equalizer is placed at the input of the output amp section. The equalization switch adds a deeper mid notch when activated.

The first opamp stage of the output amp adds harder clipping with two silicon diodes MMBD4148 in parallel for clipping both positive and negative cycles. And also a schottky diode in series with a 47 ohm resistor that provides a kind of germanum diode clipping in the negative cycles.

The second opamp stage adds additional clipping in both cycles by using silicon diodes MMBD4148.

A log 100K potentiometer provides volume level control of the output amp.
The forth opamp is a double follower that sends the signal to the speaker simulator and the Line out connector.

Speaker Emulator and Headphone Amplifier Schematics (page 2)

The second page of schematics shows the speaker emulator circuit based on four Sallen-Key low-pass filter sections to provide a frequency response similar to that of a 12'' speaker like Celestion Vintage 30, as shown in a previous post. This filter enhances considerably frequencies around 2.5 kHz.

A log 100K potentiometer provides speaker emulator volume level.

A switch selects Line out signal from the speaker emulator output or the output amp to be connected to an external guitar amplifier.

The headphone input is always selected from the speaker emulator output.

The headphone amplifier used is a TI TPA6111A2D 150 mW stereo headphone amplifier in a SOIC-8 device connected to a 3.5 mm mini-jack.

25W Class D Amplifier, mounting holes, fiducials (page 3)

The third page of the schematics shows the 8ohm speaker amplifier based on a very efficient (94%) 25W Class-D amplifier TI TPA3112D1PWP with less than 0.1% THD+N from a +24V supply.

The high efficiency of this new class-D amplifiers allows a relatively high power output of 25W without the need of a heatsink on a small HTSSOP 28-pin device which considerably reduces PCB layout size. Special careful must be taken with the design of the central pad connected to the ground plane by numerous vias to allow proper heat dissipation.

Power Supplies (page 4):

An independent switching power supply module converts 220V AC@50Hz into +24V DC. A Murata MVAD040-24 40W (23 euros) open switching power supply module is used. The module has its own PCB and is mounted inside the box with standoffs and screws.

The main PCB is then powered at 24VDC. This is the highest voltage used for output class-D 25W power amplifier.
From 24V, discrete switching regulators generate +15V and +15V  to power the operational amplifiers.
From +15V a discrete switching regulator generates +5V to power the headphone amplifier.

The maximun power consumption budget is distributed as follows:
+24V @ 1.1A = 25W for the class D speaker power amplifier (94% efficiency)
+24V to +15V @ 0.6A = 9W for the positive rail of opamps
+15V to +5V @ 0.1A  = 0.5W for the headphone amplifier
24V to -15V @ 0.5A = 7.5W for the negative rail of opamps

Total maximum power consumption is 40W

All discrete DC-DC converters have been designed using TI Webench Design Center, a very useful tool for designing power supplies that allows optimizing BoM cost, footprint and efficiency.

The Webench tool generates the whole BoM and it even allows to export schematics and layout to several of the most common CAD applications including Eagle. Sometimes the results are not very good but at least the footprint of mos common components can be created.

Most regulators are based on step-down or buck topology using integrated controllers (power switching MOSFET integrated in the controller device) except for the +24V to -15V that uses inverting buck-boost topology.

The +24 to +15V DC-DC converter is based on TI LM25011 step-down regulator.
The +24V to -15V DC-DC converter is based on TI LM25575 step-down regulator in inverting buck topology
The +15V to +5V DC-DC converter is based on TI LM25019 step-down regulator

This schematic page also includes external Power-on LED and internal SMD power-on LEDs for every power rail: +24V, +15V, -15V and +5V as well as 24VDC power in connector to main PCB from external AC-DC power supply

Saturday, 8 February 2014

Tube Simulator - Speaker simulator (3)

Stephan Möller speaker simulator is based on 4 consecutive sections of low-pass LC filters followed by 2 low-pass RC filters an 2 opamp followers with a potentiometer in the middle for level adjust as the figure below shows.
Since there is no information on frequency response or component values, I decided to do a completely new approach. I chose the frequency response of a good 12-inch guitar speaker and tried to simulate its frequency response with opamp based filters with no inductors which usually are quite large and bulky. The figure below shows the 12-inch Celestion Vintage 30 speaker and its frequency response:




The figure below shows the 12-inch Celestion G12M Greenback speaker and its frequency response:


As it can be seen, SPL (Sound Pressure Level) frequency response ramps up from 70 dB to approximately 100 dB between 20 Hz to 150 Hz, it stays flat at 100 dB until 1 kHz, it has a small 6 dB notch at 1.5 kHz, and it goes abruptly  up close to 110 dB at 2.5 kHz, and then it starts to go down to 80 dB with a steep fall of 10dB at 6Khz. At 20 kHz is somewhere between 60 dB and 70 dB.

In order to replicate a similar speaker frequency response, I designed a 4 section filter based on Sallen-Key opamp topology. I used TI Filter Designer tool to design the speaker simulator filter.
The figure below shows Speaker Simulator schematics.
The resulting frequency response is shown in the figure below:

The design basically consists of four low pass filters with some resonance around 2.5kHz, this enhance frequencies around these resonances and makes the ramp at high frequencies quite abrupt.


Blog update on July 18th, 2014:


The following figure shows approximation in two steps  to final frequency response by using four stages Sallen-Key filters:

There are much more complex speaker or cabinet simulator designs. Some of them can be found at HEXE Guitar Electronics.

To be honest, I am not sure how efficient these cabinet simulators are, because the obtained sound is filtered by the response of the headphones which may vary quite significantly. I guess that the different resonances in the cabinet even if it's open-back and the room itself change the frequency response, so I am not sure how SPL reflects the frequency response of a speaker in a cabinet in a particular room. I guess that first we should get the frequency response in a particular environment, not only amplitude but also phase! then we should get the frequency response and phase! of the headphones (which may vary depending on the model) specially if they are Dr. Dre crap!! and then we should be able to implement a filter that is able to compensate headphones response to reproduce cabinet speaker and room response.

Wednesday, 5 February 2014

Tube Simulator- End stage amplifier simulations (2)

End stage amplifier simulations

The figure below shows the schematics of the VoxAC30 end stage amplifier. It starts with a 2-band equalizer for bass and treble and a switch  for equalization shift that adds a deeper notch in the mid tones when activated.

It is followed by an amplification stage based on two 12AX7A valves. It is a valve version of a differential amplifier. It is followed by the high power end stage amplifier based on 4 EL84 valves that feeds the audio transformer and the speaker.


The figure below shows the schematics of the Tube Simulator end stage amplifier. It starts with an almost identical 2-band equalizer, where the values have been scaled to have the same frequency response but more reasonable values. Capacitor values have been multiplied by 100, from 56 pF to 5.6 nF and 22 nF becomes 2.2 uF. Resistor values have been divided by 100 to keep the RC ratio and the same frequency response, so 100 kohm becomes 1 kohm, 10 kohm becomes 100 ohm, and the 1 Mohm potentiometer become 10 kohm. The 2-band equalizer is followed by an RC high pass filter (100 nF, 24 kohm)

The Tube Simulator end stage amplifier consists also of two amplifier sections but opamp based.
Unity gain opamp amplifiers are used to separate each section. Unity gain has been used instead of followers to allow some gain adjusting between sections if required.
The first opamp section includes soft clipping based on silicon diodes plus negative clipping based on germanium plus a series resistor. Another RC high pass filter is added afterwards.

The second opamp section includes soft clipping based on silicon diodes followed by another RC high pass filter.


The following plot compares the time response of a 400Hz sinusoid exponentially decreasing with 50Hz time constant after the 2-band equalizer (top plot), first amplifier section (middle plot) and second amplifier section (bottom plot) of the end stage amplifier for tube simulator (green trace) and AC30 valve amp (red trace).
Different voltage levels have been scaled for comparison.



The following plot shows frequency response from 10 Hz to 20 kHz . Frequency response of Tube Simulator matches that of Vox AC30 amplifier. Different voltage levels have been scaled for comparison.

Tuesday, 4 February 2014

Tube Simulator - Preamp Simulations (1)

This work is based on Stephan Möller Vox AC30 Amplifier Simulator. It is basically a reverse engineering of his work, so it is fair to start by giving credit to his amazing work. Some schematics can be found on the internet with incomplete component values.
It consists of three stages:
  • Preamplifier
  • End stage amplifier
  • Speaker Simulator
In order to implement a reverse engineering of this project I created an LTSPice simulation of a simplified version of the real VOX AC30 amplifier and an equivalent LTSpice simulation of the tube simulator. I tried to adjust the component values in order to obtain a similar time and frequency response in both circuits for each stage.

Let's start with the Preamplifier stage.

The Preamplifier stage

The Vox AC30 preamplifier consists of two valve amplifier stages, a first stage with one 12AX70 valve followed by a second stage with two 12AX70 valves with a gain potentiometer between both amplifier stages.
These are the schematics for the Vox AC30 preamplifier:

The Tube Simulator preamplifier also consists of two amplifier stages but opamp based and a gain potentiometer between them.
The first opamp stage includes soft clipping based on zener diodes in the opamp feedback with different voltage values to provide some unbalanced clipping or saturation at positive and negative values. I found that a 6.2V and a 4.3V zener where more adequate to match VOX AC30 response. Between the opamp and the gain potentiometer there is a positive hard cliping section based on a Schottky diode with a series resistor. A high value of 470K is used that quite mitigates the diode clipping. This part is quite tricky because actually does not match valve response but having an important clipping affected negatively the next stages.

The second opamp stage includes 4 different types of soft clipping blocks:
Two blocks (positive/negative) based on 2.7V zener diodes + silicon diode in series (not sure the silicon diodes are any useful here) + series resistor (470 ohms / 10 Kohms)
One block based on a germanium diode + series resistor (91 Kohms)
One block based on a 2N2907 PNP transistor with biased base (Rq1 = 47 kohms). Real implementation of the bias will be explained later in the pratical implemention of the circuit.

The figure below shows the schematics of the Tube Simulator preamp:
The following plot compares the time response of a 500Hz sinusoid exponentially decreasing with 50Hz time constant after the first (top plot) and second (bottom plot) stage of the preamplifier for tube simulator (green trace) and AC30 valve amp (red trace). This is a bit tricky, but positive clipping is reduced in the tube simulator for a better stability and signal matching in the next amplifier stage. Voltage levels are higher in the valve amp, so signals are scaled for comparison.
 As it can be observed in the next figure frequency response from 10 Hz to 20 kHz matches very closely.

Sunday, 26 January 2014

Germanium diodes vs Schottky diodes for audio distortion

Germanium diodes are a preferred choice for use in distortion guitar pedals for their unique sounding characteristics when clipping an audio signal. Germanium clipping is softer than that of regular rectifier silicon diodes. A softer clipping generates less high frequency harmonics and hence it produces a more agreeable sound to the ears, closer to that produced by valves.

Germanium diodes also have a lower forward voltage than silicon diodes and hence they are able to clip signals at lower levels than silicon diodes.

But unfortunately, germanium diodes are scarce an expensive these days since their use as rectifiers in electronics is quite reduced and they have been displaced by a variety of different types of diodes made out of silicon. Regular silicon diode rectifiers have an abrupt I-V curve more adequate for rectification purposes, which translates in a hard clipping of the signal at approximately 600mV. On the other hand, Germanium diodes have a much less abrupt I-V curve which means that they provide a much softer clipping that starts at approximately 300mV.

Germanium diodes (like 1N34A) are hard to find in usual large distributors such as Digikey, Mouser, Newark, Farnell or RS, they are mostly found in specialised audio and guitar pedal boutiques since their use is more and more reduced to audio distortion in fuzz pedals. They are only found in conventional through-hole mounting (glass DO-7 package) but not in SMD packages.
The 1N34A can be found from 0.4€ to 1.71$ in a glass DO-7 package.


Schottky diodes (like BAT54) are a special but quite common type of silicon diodes used as rectifiers with very low forward voltage 200mV, similar to that of germanium diodes, but they also show a very abrupt I-V curve that generates hard clipping at a much lower voltage than regular silicon diodes. They can be found in many different packages including small SMD packages with the advantage that two diodes can be included in the same package, reducing BoM costs additionally. The BAT54S can be found as cheap as 0.022$ in SOT-23 SMD package.


In order to be able to replace Germanium diodes by Schottky diodes and reduce the steep ramp it only requires adding a resistor in series with the diode so that an increasing voltage drop is added with an increasing current. Using a variable resistor o potentiometer can additionally provide control on the clipping softness, higher resistor value means more clipping softness.

The figure below shows the schematics used with LTSpice simulator in order to compare the I-V and V-I curves of the most common germanium diode (1N34A) with a quite common and cheap Schottky diode (BAT54).

The schematics with diodes in series allows comparing voltage drop in both cases: Germanium vs Schottky + series resistor for a given range of current. Simulation is repeated for Schottky diode with different resistor values. Series resistor is entered as parameter Rx from 5 to 500 ohms.

The schematics with diodes in parallel allows comparing current through the diodes in both cases for a given range of input voltage and for different resistor values.

The figure below shows the resulting I-V curves with V ranging from 0V to 1V and current from 0mA to 90mA.

The red curve shows the I-V curve of the Germanium diode while green curves show the I-V curve for Schottky diode with different values of series resistor from 5 ohms to 500 ohms, the higher the resistor value the flatter the curve.
As it can be seen, there is no way to exactly replicate the germanium diode curve with a Schottky diode, but the Schottky diode may actually provide softer curves than the germanium diode which is the main purpose of using germanium diodes. For low values of current, the resistor must be higher in order to overlap the germanium curve, when current increases, the resistor must be lower, for 5 ohms both curves run parallel showing an asymptote or convergence in the infinity.

The figure below shows the V-I curves with current ranging from 0mA to 1mA and voltages ranging from 0 to 600mV.

At very low current values the voltage curves overlap for highest resistor value (500 ohms), but at higher current values the voltage curves overlap for 67 to 80 ohms.

Let's see the effects of both diodes in a real simulation using soft clipping and hard clipping configurations.
The schematics below show a circuit with both types of diodes using a soft clipping section followed by a hard clipping section.

The soft clipping section consists of an opamp amplifying ten times the input signal. Soft clipping diodes are added in both directions (for positive and negative clipping) in the opamp feedback circuit between the negative input and the output of the opamp. The chosen reference resistor (Rin) between negative opamp input and ground is 10 kohms. The feedback resistor is 100 kohm for a x10 gain of the opamp. Varying this 10k value may require adjusting the series resistor of the Schottky diodes to match germanium diode response. The series resistor value required to match germanium diode response in this case is 250 ohms.

The hard clipping section consists of two diodes in both directions between the output of the opamp and ground after a decoupling capacitor of 4.7uF. The series resistor value required to match germanium diode response in this case is 14 ohms.

Figure below shows soft clipping signal comparison for germanium (green) and Schottky (red) for an input sinusoidal signal of 440Hz and 600mV and series resistor values of 5, 25, 100, 250 and 500 ohms. Soft clipping signal in this simulation is probed between the opamp negative input and the opamp output. As it can be seen, Schottky signal (in red) is in general lower than germanium signal (in green) for most resistor values except for 500 ohms, but the waveform shape seems closer to germanium waveform for 250 ohms.

Figure below shows hard clipping signal comparison for germanium (green) and Schottky (red) for an input sinusoidal signal of 440Hz and 600mV and series resistor values of 5, 10, 15 and 20 ohms. Hard clipping in this simulation is probed between the signal connecting output decoupling cap and diodes, and GND. Schottky signal (in red) is closer to germanium signal (in green) for a series resitor value of 15 ohms.
The figure below shows the time response signal in mV for both soft clipping (top plot) and hard clipping (bottom plot) respectively. The input is a sinusoidal signal of 440 Hz that starts at 1V and exponentially decreases with a time constant of 30 Hz.

The use of a exponentially decreasing signal is chosen to recreate the response to a real audio signal source with different voltage levels from 1V to several tens of mV. Clipping is higher for higher voltage levels. The choice of Schottky and Germanium diodes also allows clipping starting at lower voltage levels (200 to 300 mV) compared to silicon (500 to 600mV) or LED (>1200mV) diodes.

The figure below shows the FFT signal (frequency domain spectrum) in dB between 300 Hz and 30kHz for soft clipping (top plot) and hard clipping (bottom plot) signals respectively using a Blackman window to soften the signals and enhance harmonics visibility.

As it can be seen, frequency spectrum for both types of diodes (germanium and Schottky) are very similar and almost overlap perfectly.
Soft clipping shows a higher level of second order harmonics (nicer to the ears and closer to valve response) which is more suitable for overdrive distortion while hard clipping reinforces third order harmonics (harsher sound) more suitable for fuzz distortion.

Conclusion

Spice simulations show that germanium diodes can be replaced by Schottky diodes plus series resistor for distortion applications with almost no difference in the waveform signals obtained.
But these simulations must be completed with real life experiments to confirm simulation results.

I plan to implement a version of the famous and noisy Shin-Ei Fuzz-Wah with the option of germanium or Schottky diodes for comparison. Stay tuned to my blog for Spice simulations of this pedal and real implementation of it.