Electron: net purpose of Q3, Q4, R66, R67, C11, C25?

for bbc micro/electron hardware, peripherals & programming issues (NOT emulators!)
Post Reply
ThomasHarte
Posts: 459
Joined: Sat Dec 23, 2000 5:56 pm
Contact:

Electron: net purpose of Q3, Q4, R66, R67, C11, C25?

Post by ThomasHarte » Wed Apr 11, 2018 7:45 pm

I am a dunce. I am an electronics dunce. I was nevertheless browsing the Electron schematic and noticed these components sitting in a conflagration between the ULA's SOUND O/P and the speaker — on that schematic they're all just slightly to the right of the ULA, not quite halfway down.

It looks like possibly some sort of low-pass IIR filter, after a voltage change? I'm speculating wildly — it's frustratingly just different from any of the sample circuits I can find, and I'm too thick confidently to work it out from first principles. If it is a low-pass filter, is there a way to figure out what the intended frequency range is?

User avatar
hoglet
Posts: 7242
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: Electron: net purpose of Q3, Q4, R66, R67, C11, C25?

Post by hoglet » Wed Apr 11, 2018 7:57 pm

They form a Class B amplifier stage, to allow the audio to drive a low-impedance loud speaker.

User avatar
1024MAK
Posts: 7564
Joined: Mon Apr 18, 2011 4:46 pm
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: Electron: net purpose of Q3, Q4, R66, R67, C11, C25?

Post by 1024MAK » Thu Apr 12, 2018 10:42 am

R66 and C25 are a power line filter. This reduces noise between the +5V rail and the class B audio amplifier formed by Q3 and Q4. It also reduces the current spikes caused by the audio amplifier from upsetting the +5V rail.

R61 limits the current flow from Q3 and Q4 to the speaker (effectively raising the impedance of the speaker circuit, as the speaker used is a 16 ohm type).

C11 is needed so that the speaker gets AC current. When Q3 is on, current flows via R66, Q3, R61, C11 and the speaker. This leaves a charge on C11. So when Q4 switches on, current now flows from the speaker via C11, R61 and then via Q4 due to the charge on C11. C11 is then discharged.

Because the input signal is a two state digital signal, this class B amplifier does not include any bias circuitry to hold Q3 and Q4 in their linear region.

Mark
For a "Complete BBC Games Archive" visit www.bbcmicro.co.uk NOW!
BeebWiki‬ - for answers to many questions...

ThomasHarte
Posts: 459
Joined: Sat Dec 23, 2000 5:56 pm
Contact:

Re: Electron: net purpose of Q3, Q4, R66, R67, C11, C25?

Post by ThomasHarte » Thu Apr 12, 2018 3:10 pm

Thanks! These facts I shall attempt to internalise.

If it's not too much of a divergence, I read elsewhere that "[w]herever a voltage is artificially held away from zero, there will be leakage and the actual output will decay towards zero at a rate proportional to the offset from zero: dV/dt = -kV". Is that the universal truth I've made it sound like through selective quoting? In this case would it mean that a sufficiently low frequency would look quite unlike a square wave? The non-zero peaks would observably decay back towards zero?

User avatar
1024MAK
Posts: 7564
Joined: Mon Apr 18, 2011 4:46 pm
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: Electron: net purpose of Q3, Q4, R66, R67, C11, C25?

Post by 1024MAK » Thu Apr 12, 2018 5:58 pm

Not really.

Electric current is the flow of electrons. Voltage is the potential difference between two points. If the insulation between two points is perfect, then no current will flow. Hence the voltage between these points will not change.

Of course, there is no such thing as a perfect insulator, but modern electronics gets pretty close. So in practical terms, a waveform that would be affected by leakage currents would be such a low frequency, that we would actually classify it as a DC voltage.

Mark
For a "Complete BBC Games Archive" visit www.bbcmicro.co.uk NOW!
BeebWiki‬ - for answers to many questions...

User avatar
hicks
Posts: 84
Joined: Fri Sep 29, 2017 10:39 am
Location: UK
Contact:

Re: Electron: net purpose of Q3, Q4, R66, R67, C11, C25?

Post by hicks » Mon Apr 30, 2018 9:27 pm

This blog post might be of some help. I simulated the effects of those components when working on improving my FPGA Electron core's sound output. The oscilloscope waveforms from fpga were just not a good match to the real electron and those components were why.

User avatar
1024MAK
Posts: 7564
Joined: Mon Apr 18, 2011 4:46 pm
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: Electron: net purpose of Q3, Q4, R66, R67, C11, C25?

Post by 1024MAK » Tue May 01, 2018 8:01 am

hicks wrote:This blog post might be of some help. I simulated the effects of those components when working on improving my FPGA Electron core's sound output. The oscilloscope waveforms from fpga were just not a good match to the real electron and those components were why.
Yes, C11 and R61 along with the speaker will form a filter, but the primary purpose of C11 is to convert the digital "on/off" / high/low pulses (which are referenced to the system 0V/GND) to a alternating current so that the speaker cone can move in and out.
The larger the value of C11, the less filtering affect it will have. But larger values cost more money and this is a budget computer. Hence the relatively low value used.

Mark
For a "Complete BBC Games Archive" visit www.bbcmicro.co.uk NOW!
BeebWiki‬ - for answers to many questions...

ThomasHarte
Posts: 459
Joined: Sat Dec 23, 2000 5:56 pm
Contact:

Re: Electron: net purpose of Q3, Q4, R66, R67, C11, C25?

Post by ThomasHarte » Thu May 03, 2018 2:54 pm

hicks wrote:This blog post might be of some help. I simulated the effects of those components when working on improving my FPGA Electron core's sound output. The oscilloscope waveforms from fpga were just not a good match to the real electron and those components were why.
That blog is like catnip for me, thanks for posting the link! I'm an emulator author that aspires to an understanding of electronics; maybe one day I'll get there.

If there's an implied high-pass filtering that occurs not because of the purpose of the electronics but as a side effect of the implementation then possibly think that's probably what the author of the "[w]herever a voltage is artificially held away from zero, there will be leakage and the actual output will decay towards zero" quote was trying to articulate — it's from a document on another sound chip even though stated as an abstract truth, so possibly the domain-specific concern of conversion to analogue should be implied. A high-pass filter will obviously always return any constant value to 0.

Did you keep any of your original sample files? As a distinct topic from hardware, it'd be interesting to try to figure out the parameters that would describe a bandpass filter to process perfect audio closer to the Electron, similarly to the effect achieved in hardware by your FPGA implementation.

User avatar
hicks
Posts: 84
Joined: Fri Sep 29, 2017 10:39 am
Location: UK
Contact:

Re: Electron: net purpose of Q3, Q4, R66, R67, C11, C25?

Post by hicks » Thu May 03, 2018 3:54 pm

I didn't have any sample files for the above tests. I just used the BASIC commands on the Acorn to output low/high frequency tones, then generated the same frequency tone in LTSpice. Although LTSpice does spit out a few wav files as part of running the simulation if that is what you're referring to?

If it's of any use, this is the sim dir I have. It includes the ext sound circuit and a test for ltspice as well as a display logic sim that can be loaded into logisim. You'll need to edit the path it saves the generated wav files to, unless you happen to have /home/gary too :)

I consider myself very much a newb when it comes to Electronics too, so take anything in the blog posts with a pinch of salt :mrgreen:
sim.tar.gz
Electron Sound LTSpice sim and Display logic Logisim
(20.29 KiB) Downloaded 9 times

ThomasHarte
Posts: 459
Joined: Sat Dec 23, 2000 5:56 pm
Contact:

Re: Electron: net purpose of Q3, Q4, R66, R67, C11, C25?

Post by ThomasHarte » Thu May 03, 2018 5:05 pm

hicks wrote:I didn't have any sample files for the above tests. I just used the BASIC commands on the Acorn to output low/high frequency tones, then generated the same frequency tone in LTSpice. Although LTSpice does spit out a few wav files as part of running the simulation if that is what you're referring to?
From the blog it looked like you had WAV captures of both the original machine and the simulation; those are what I was referring to. I'm unfortunate enough to live in an NTSC country, so getting hold of a real Electron and then actually being able to use it would be problematic.

User avatar
hicks
Posts: 84
Joined: Fri Sep 29, 2017 10:39 am
Location: UK
Contact:

Re: Electron: net purpose of Q3, Q4, R66, R67, C11, C25?

Post by hicks » Thu May 03, 2018 7:31 pm

Aside from the couple of wav files that ltspice generated, the rest of the captures were just the images of the oscilloscope traces.

Post Reply