Vectrex Buzz Fix… Enjoy the Silence

One of the famous features of the Vectrex is the annoying buzz from the speakers. After a while, it was just too irritating and I decided to try and fix it. Some purists say that the buzz is an authentic part of the Vectrex experience, but I’m sure the engineers who designed it didn’t intend it to buzz 🙂

Unfortunately, the LM386-3 audio amplifier (pictured below) is mounted on the power board, right next to the wires which drive the CRT yoke magnets. The amplifier is fed by a poorly screened audio cable which runs to the logic board. The screened cable is only connected to ground at one end (the power board). Consequently, it picks up a lot of interference…

vectrex_power_board_removal3

The usual fix is to install some better quality screened cable, and disconnect one of the ground leads (the theory being that this eliminates a ground loop). However, the new cable may not completely eliminate the noise, because it doesn’t address the issue of the amplifier being located on the power board, and I didn’t like the idea of disconnecting ground. Another approach is to add a pre-amplifier to boost the level before it reaches the LM386.

I decided to try a different approach, by installing another power amplifier, well away from the power board and magnets. Originally, I planned to buy an LM386 chip and assemble an amplifier on strip-board. However, I then discovered you can buy a ready made module built around the LM386 for about the same price as the components:

lm386_module

These modules cost about £0.99 on eBay, and are widely available. I couldn’t find a schematic, so reverse engineered it (below):lm386_circuit

For comparison, here’s the original amplifier schematic for the Vectrex:

vectrex_audio_amp

The main difference is that the Vectrex has pin (1) on the LM386 not connected, which sets the gain to 20. However, the new LM386 module has a gain of 200, due to the capacitor C1 bridging pin 1 and 8 on the module. With this much gain, we might still get the buzz, and we could also get clipping/distortion.

Fortunately, this is easy to fix by removing R1 from the module (actually R1 is a 0 ohm link, perhaps provided for this purpose). This disconnects the capacitor between pin 1 and 8 of the LM386, reducing the gain to 20, the same as the Vectrex.

The module has two screw terminals for the output, so a couple of short wires in these allow the existing speaker connector to push fit:

lm386_module_pins

Next, I removed the Logic Board and replaced the audio cable with a higher quality foil screened cable, soldering it to the ground and wiper of the Vectrex volume potentiometer, on the component side of the Logic Board:

vectrex_new_audio_cable

Although the original Vectrex LM386 is powered from the +9V rail, I decided to power the new amplifier module from the +5V rail on the Logic Board, to avoid having to run a +9V power line from the Power Board. To do this, I ran a twisted pair of red/black wires from the +5V and GND rails nearby the AY3-8192.

The audio cable, 5V and GND are installed in a 0.1″ crimp housing to fit the 4-pin head on the module. The finished assembly is shown being tested outside the Vectrex below, before it was finally installed inside the machine:

vectrex_audio_module

To mount the board, I used a self-adhesive cable tie base just inside the cabinet above the speaker. The module is cable-tied to this base.

The end result is a massive improvement, completely eliminating the buzz!

Here’s a photo of the final installation:

As shown above, the 5V power comes from a supply junction between the AY-3-8912 and the 6522, and the GND comes from a ground plane via near the top right of the 6522.

I recently stumbled on this nice video (in German) where someone has tried this same modification:

Vectrex Repair (Black Screen / No Vector)

I’ve wanted a Vectrex Console for quite a while, and finally acquired a broken Vectrex for a reasonable price on eBay (where else) with the idea of repairing it…

It didn’t begin well when the courier who delivered the package left it hidden behind a car… overnight… in the rain:

hermes1

It was sitting in a puddle, and got a fairly good soaking. Here’s the Vectrex emerging from the box:

hermes3

Fortunately, after drying it out carefully, it didn’t look like it had sustained any serious damage, so I set about trying to repair the fault.

Exactly as described by the seller, when it was powered on, the game sounds were playing, but the screen was completely black, not even a white dot visible on maximum brightness.

Looking at the troubleshooting guide, the first suggestion for “No Vector” is to “check for +/-5 VDC and -13 VDC at connector J204. Left to Right -5, GND, +5, -13”. When I checked J204 on the Logic Board, the -13V DC rail was missing (just measured about 0.67V which looks like a diode voltage drop). I checked the other end of the -13V wire on P204 on the Power Board, with the same result. This confirmed the wires and connectors were OK, and it was a problem on the Power Board.

From the service manual, here’s a diagram of the -13V power supply circuit on the Power Board:

vectrex-13v-repair1

The two lines at bottom right are the incoming power supply which is about 9~10V AC. The Diodes D106 & D107 and the Capacitors form a voltage doubler, boosting this to 18~20V, which is then regulated by a 13V Zener DZ102.

I switched off power and tested D106 and D107 in circuit with a DMM, and it looked as though D107 was short-circuit. The resistor R106 looked fine. Since there were only a few components, and the 34 year old (!) Electrolytic capacitors were probably not in the best shape, I decided to replace the whole -13V regulator circuit.

The -13V rail is only used by IC301 (the MC-1408P8 DAC) and the circuit diagram even states “TO IC301 PIN3 ONLY” next to the -13V line so, after a quick visual check of the Logic Board and connectors, I couldn’t see any obvious signs of a short on the -13V rail which might cause it to fail again. It’s always worth checking before replacing parts though!

To do this repair, the whole Power Board needs to be removed, which involves removing 5 connectors, removing the HV lead (CAUTION: ensure it is discharged first) and desoldering 2 ground leads, 3 power leads and 4 leads connecting the CRT deflection yoke. The board is secured with two small cross-head self tapping screws.

Here’s a close up of the components to be replaced (C120, C121, C122, D106, D107 and DZ102):

vectrex-13v-repair2

This picture highlights them more clearly:

vectrex-13v-repair3

After removing the components, the most difficult part of the repair was clearing solder from some of the holes connected to the ground plane…

Once the original components were removed, I was able to test them out of circuit and found the following:

  • D106 was OK
  • D107 had failed Short Circuit
  • DZ102 was OK and measured 13.2V
  • C120 measured 44.1uF, 2.1Ω ESR, Vloss 4%
  • C121 measured 49.9uF, 0.65Ω ESR, Vloss 3%
  • C122 measured 234uF, 0.13Ω ESR, Vloss 1.3%

Presumably with D107 short circuit, this may have also damaged C120 by putting AC directly across the polarised electrolytic. In any case, I decided to replace them all with new parts.

For the Zener diode, I used a 1N5243BTR (0.5W, 13V. DO-204AH). The diodes D106 and D107 were replaced with 1N4148 as used originally, and C120, C121, C122 replaced with equivalents.

After refitting all the connectors and soldering all the cables back in place, I left the connector at J204 disconnected from the Logic Board and tried measuring the -13V rail with the DMM probes touching the connector contacts. Initially, it wasn’t looking good as the -5V and +5V rails were present, but -13V wasn’t…. anyway, I decided to plug it into J204 and power on again…. and happily the Vectrex sprung back into life again! Perhaps the DMM probes were just not making a good contact with the connector?

Here’s the first power up after the repair:

For a machine that’s over 30 years old, I was astonished how beautiful and sharp the vectors looked – the display is amazing! (the video above does not do it justice). I’m very excited to finally have a Vectrex to tinker with… now I just need some more games and overlays!

The console has the famous “Vectrex buzz” from the speakers, and I think the next project will be to try and fix that…

Upgraded valve in the compressed air rocket launcher…

The first valve I used in my rocket launcher was a “direct acting” type, which has a very small aperture, limiting the flow rate. Although the launcher worked well in practice, I was curious to see if I could find a better valve, with a larger flow rate to get a more spectacular launch!

Here’s the original layout with the direct acting valve:

rocket_outlet

After a bit of research, it sounded like an “indirect acting” type would have a higher flow rate (these are also known as “servo operated” or “pilot operated” valves). There’s a good explanation of the working principles here.

As this is just a fun project, I also wanted something quite cheap! The valve I chose was a 12V solenoid with a claimed pressure rating of 0.02-0.8MPa (3psi – 116psi). Note that the minimum is typical of a servo valve, as it will not open without some pressure on the input side. The valve had two 1/2″ BSP male threads for input/output, and another removable plastic plug with 1/2″ BSP thread which is intended to provide access to clean a removable filter. In my case, I removed the filter and used that spare port to attach the pressure sensor.

The new output side of the launcher is pictured below. It’s basically a complete replacement for the assembly shown above, and connects directly to the plastic pipework.

rocket_new_valve

The upright 15mm copper tube is the output, and a longer “launch tube” is attached to that with a push-fit 15mm coupler (allowing it to be removed for easier storage..) The input side is the disconnected compression fitting at the bottom left. The pressure sensor is the cylinder on the right side (car oil pressure sensor).

The new valve did not disappoint! It performs much better than the direct acting valve. The first launch at about 40psi was maybe 3x the altitude with the previous valve at 80psi, showing that the valve flow rate was the limiting factor. Unfortunately on the second launch I lost the rocket in a neighbour’s garden and had to go and ask for it back… ahem.

Estimating Ulka EP5 Pump Inductance

As part of my work to modulate the Ulka EP5 pump pressure in my Espresso machine, I decided to try and simulate the pump in SPICE. This would necessarily be a very simplified model, but might be useful nonetheless to understand the behaviour of snubber circuits for the pump PWM controller. To create the model, I needed an estimate of the pump inductance.

Previous attempts

I could only find one previous reference to the pump inductance online. It’s not clear which Ulka pump was used, but it looks like an E5 type (EP5 or EX5) and a circuit diagram refers to 41W rating (consistent with the 120V 60Hz EP5). They took the approach of measuring the current drawn by the pump at 0.57A and, assuming a line voltage of 120V, calculated the reactance as follows:

XL = V/I = 120V / 0.57A (AC) = 211

With the formula XL = 2πfL = 2π * 60Hz = 377L, the inductance L was estimated as follows (for a 120V 60Hz pump):

L = 211 / 377L = 0.56H = 560mH

However, XL = VPEAK/IPEAK and the above voltage current values may be average or RMS values rather than peak values. For 120V AC mains the peak voltage would be VPEAK =12√2 = 170V. Similarly, when measuring AC current, some multimeters only give accurate results for a sinusoidal AC waveform, and may not be accurate for AC chopped by the series diode in the Ulka pump. This doesn’t necessarily mean the result is wrong of course, just difficult to be certain.

Manufacturer data on the pump

The manufacturer data states that:

  • Ulka EP5 240V~50Hz is rated at 48W
  • Ulka EP5 120V~60Hz is rated at 41W

Estimating pump electrical properties

There’s an integrated series diode in the pump, but the type is not indicated. However, based on similar Ulka pump models described in Ulka/CEMA specifications, the diode is assumed to be 1N4007 which according to manufacturer datasheets have a typical forward voltage VF = 1.0V when IF = 1.0A (noting that there are some small variations in the specifications for 1N4007 between manufacturers).

Attempting to measure the pump coil resistance directly with a resistance meter could give misleading results, due to the internal diode. To overcome this, a known DC voltage and current can be used to estimate the resistance.

With a ~12V DC power supply connected across the Ulka EP5 240V~50Hz pump, the measured voltage was 12.33V and the measured current was 70.1mA. At this relatively low current, it is likely that the diode forward voltage will be less than 1.0V. To estimate the diode VF, an individual 1N4007 diode was connected in series with a 220R resistor and ~12V power supply, giving IF = 51.9mA and VF = 0.775mV.

Assuming that VF = 775mV at IF = 70.1mA, the actual voltage across the coil will be reduced to (12.33 – 0.775) = 11.56V and therefore a first estimate of the pump coil resistance is as follows:

R = 11.56 / 70.1×10-3 = 165Ω

To calculate the inductance, the manufacturer voltage and power ratings are used to estimate the reactance as follows:

Although the Ulka EP5 240V~50Hz model is rated 48W, the internal diode means that the pump is only active for half the cycle. Considering the coil without the series diode, we therefore assume that the AC power consumption would be 96W and use this figure to calculate the AC current:

P=VI therefore I=P/V

IRMS = PRMS/VRMS = 96/240 = 0.4A

Note that the mains line voltage and current will of course vary in practice due to local mains supply quality.

The peak voltage and current are then estimated as follows:

VPEAK   = VRMS√2 = 24√2 = 339V

IPEAK      = IRMS√2 = 0.4√2 = 0.57A

The inductive reactance for an inductor energised by a sine wave is calculated as follows:

XL = VPEAK/IPEAK =  339 / 0.57 = 599.27

The inductance can be calculated based on the reactance and frequency as follows:

L = XL / 2πf

Where f is the mains line frequency 50Hz:

L = 599.27 / (2π × 50)  = 599.27 / 314.159 = 1.91H

However, on closer inspection, I noticed that the exact pump model I tested is labelled 230V~50Hz on the side. Repeating these calculations with 230V, the following results are obtained:

IRMS = 96/230 = 0.42A

VPEAK = VRMS√2 = 23√2 = 325V

IPEAK  = IRMS√2 = 0.4√2 = 0.59A

XL = VPEAK/IPEAK = 325 / 0.59 = 550.59

L = 550.59 / 314.159 = 1.75H

So this estimate puts the pump inductance for the 230V~50Hz EP5 pump at somewhere between 1.75H and 1.91H and the resistance at 165Ω.

Simulating the pump in SPICE

Running an LTSpice model with a 240V, 50Hz AC supply in circuit with a 1N4007 diode and an inductor modelled with L=1.75H, R=165Ω gives the following results:

Iavg=0.34A, Irms=0.46A, Vrms=240V, Pavg=35.67W

This doesn’t look too far off, however it is obviously lower than the rated power of 48W indicated by the manufacturer. Adjusting the LTSpice model inductance to L=1.37H gives results closer to the manufacturer ratings:

Iavg=0.39A, Irms=0.54A, Vrms=240V, Pavg=47.93W

Measuring the pump inductance

More recently, another attempt was made to directly measure the inductance. This was achieved by drilling a small 1mm hole in the pump to access the coil terminal before the series diode. The measured inductance and resistance was L=854mH and R=165Ω. The series diode forward voltage was measured as 706mV.

Conclusions

Modelling the pump as a simple inductor is obviously a gross simplification, as the pump is a spring loaded solenoid, whose inductance will vary as the internal plunger vibrates. Also, the hydraulic pressure in circuit is not considered. Finally, with high frequency PWM switching, the parameters estimated at 50Hz / 60Hz frequency may not be correct.

Nevertheless, the inductance values above when used in SPICE provide a first approximation which may be useful to estimate how the system will behave in practice, and do seem to give behaviour very similar to the real system.

If anyone has any corrections, comments, improvements or information to add, drop me a line in the comments below.

First Rocket Launch

Here’s one of the first few test launches of the compressed air rocket. Please excuse the portrait video, I didn’t film it…

This was about 60psi, although the limiting factor is really the restricted flow rate through the valve. You can hear the air hissing out for a good long while after the rocket is clear of the launch tube.

It’s great fun to play with!

At some point, I plan to try an indirect acting solenoid valve, with a larger aperture. When the weather improves that is…

Rocket control panel finished!

I’ve basically finished my rocket control panel, except for a few software tweaks I have planned. It now has an LCD display to display pressure and status!

rocket_lcd1

I decided to have a round LCD gauge display. This is actually a rectangular 1.8″ TFT display with 160×128 resolution, mounted behind a circular 32mm diameter hole. To make a circular mask to hide the edges of the backlight, I printed a black circular frame onto an Inkjet Transparency, and sandwiched this between the LCD and the front panel. It also serves as a protective film for the LCD.

The display I’m using is the Hobbytronics TFT Serial, largely because I had one spare from another project. This display is unusual in having an on-board Arduino ATmega328 to control the display in response to a basic set of drawing commands sent over 9600 baud serial.

For this application, I wanted to have an analogue gauge effect, which meant filling circular arcs. To achieve this, I wrote a scanline polygon filling routine, which is used to draw small quads, for each 10 degree segment of the arc. To get good performance, I added this polygon fill to the LCD firmware, so that only the polygon coordinates need to be sent via serial.

The gauge is only selectively redrawn (only the parts that change) to improve performance. With these tweaks, the display is fast enough to produce a smoothly animated gauge.

The brains of the operation is a small Arduino Nano board (actually a cheap clone). This has a serial output to drive the display, and various analogue and digital I/O pins to control the rocket.

There are several switches used to operate the launcher:

  • Key switch to select low/high pressure modes (safety feature)
  • Fire button (push button, triggers the solenoid valve)
  • Arm switch (toggle switch, enables the fire button)
  • Pump switch (toggle switch, enables the compressor pump to pressurise the launcher) All switches are active low, and pull individual GPIO pins to ground. Internal GPIO pull-ups are used, rather than external resistors.

There’s a 2-channel relay board used to switch a 12V car tyre compressor (100psi maximum pressure) to pressurise the system, and a 12V solenoid valve to launch. These are controlled by two active low GPIO pins.

Pressure is measured using a car oil pressure gauge (rated 0-100psi and 18-126ohm). This is connected to an analogue input, with a 1K resistor to the 5V rail forming a potential divider. ADC raw values were recorded at several 10psi increments, and a straight line fitted in Excel to get the (hard coded) parameters needed to approximately convert ADC values to PSI.

All the connections between the controller and the main launcher go over a long 4 core screened cable, with 5-pin DIN connectors at both ends (5V, /Fire, /Pump, Pressure, Ground=Screen).

The code for the controller is up on Github here: nano-launcher. The TFT display firmware isn’t yet committed, pending a bit of clean up.

Making the Rocket Control Panel…

Heh heh, this is going to be the control panel for the rocket:

rocket_panel1

I wanted this thing to look the part, so I’ve got a toggle switch with a flip up cover to “arm” it, and the mandatory big red button to fire. The toggle switch at the bottom left will be for the pump, and the key switch at top left will limit the maximum pressure. The big black hole in the middle is for a display, yet to be fitted.

The case is made of black ABS with a brushed aluminium front panel. The front panel is fairly thin (about 1mm) and was drilled using a step drill, including the large 32mm hole in the centre.

The switches make a very satisfying clunk when toggled!

Compressed Air Rocket Launcher!

Inspired by an existing project I saw linked on Hackaday, I couldn’t resist having a go at building a compressed air rocket launcher. To keep the costs down, I tried to use commonly available plumbing fittings where possible (40mm solvent weld waste pipe). Originally I planned to use larger diameter pipe, but reducing fittings didn’t seem that easy to source locally.

Here’s my first prototype assembled, with the rocket (made of 15mm pipe insulation foam) in situ. The rocket is concealing a length of 15mm copper pipe which serves as the launch tube:

rocket_pipework

To get a reasonable volume of air in a small footprint, the pipework is folded into an S shape, rather than having one long length. The two parallel pipes at the left were intended to be closer together, but I accidentally welded in a longer pipe than I planned, and there was no going back 🙂

The 40mm pipe is solvent welded, and has two screw on access plugs at either end. These have been drilled through, and fitted with tank connectors, along with the various reducing fittings needed to connect the inlet and outlet valves.

This next shot shows a close-up of the outlet side which consists of a 12V solenoid valve (the black cylinder) which is normally closed, and fires a blast of compressed air when it opens. The other cylindrical component is an oil pressure sensor, which I plan to use to measure the air pressure. The pressure sensor has NPT thread, so an adaptor is needed for BSP thread. There’s also a 1/4 BSP female 3 way tee fitting used to connect the pressure sensor in circuit.

rocket_outlet

Various 1/4″ and 1/2″ brass hexagon busheshexagon nipples and other parts are needed to connect these together, with PTFE tape used on all joints. The final output is through a compression wallplate elbow, with a vertical 15mm copper pipe for the launch tube.

The inlet is a standard Schrader valve, so that a 12V car tyre pump compressor can be used to pressurise the system.

rocket_inlet

There was some guesswork in the design, because I didn’t bother to calculate what sort of volume of air was needed, and wasn’t sure if the solenoid valve would have a high enough flow rate (it has quite a narrow bore). I just decided to try it and see what happens.

Obligatory warning: if you build something like this, be aware that the plastic pipe could explode and shatter under pressure.

Having built it, I donned safety glasses, retired to a safe distance and pressurised it. At the first attempt I managed to get it up to 30psi, due to a slow air leak. The first launch was pretty impressive, and the foam rocket (lacking flights at this point) narrowly missed landing on the roof of the house! Adding some cardboard flights to the rocket improved the aim dramatically.

Some reassembly of the outlet joints cured the leak, and I’ve since had it up to 60psi. I’m going to box it up before pushing it to higher pressures. The compressor is rated for 100psi (just under 7 bar) so it will be interesting to see how high this thing can go 🙂

Next steps are to build a box for it, and to make the control unit. I’m planning to give it a mission control look with key switch, flip up covered toggle switch and big red button to launch… to be continued!

Hmm, I think this dough has risen sufficiently…

We decided to go out for something to eat at the weekend, and I left some bread dough to rise while we were out. This is what I found when we returned:dough_monsterThis is pretty amazing really, because that glass bowl weighs 1.5kg! After punching it down and final proving, the bread turned out great, but it reminded me of this.

Raspberry Pi SD card corruption repair

This morning my Espresso machine wouldn’t boot up, which was a bit of a shock. Fortunately the Minipresso was nearby as a backup.

It turned out that the SD card in my machine was corrupted. I pulled the SD card from the Pi and inserted it into a PC running Ubuntu Linux. It appears as several partitions, and the main file-system partition showed up at: /dev/mmcblk0p2

To fix the file-system, I used fsck as follows:

sudo fsck /dev/mmcblk0p2

I had to do that twice, then ejected it and put it back in the Pi. The Pi did another fsck and fixed some issues, and fortunately it rebooted OK. This time I was lucky I guess…

There is a much better explanation here!