Debugging a Laser

We were going to write a post a few weeks ago about our new laser cutter. Unfortunately, after a relatively short time, it stopped cutting. This post is about how we’ve gone about diagnosing the problem, since it’s hard to find this sort of information online.

Before I get into things, please be warned: Lasers used for cutting are extremely hazardous – the diffuse radiation from the laser can blind you without staring into the beam, and the carbon dioxide lasers commonly used produce a beam which is mostly invisible! Additionally, the power supplies produce extremely high voltages (on the order of 25kV – that’s enough to cross a significant air gap), and can supply enough current to produce a lethal shock (it only takes 27mA). Don’t do this unless you know what you are doing – and even then, please have someone working with you.

That being said, let me get on with the article!

Firstly – some basics. I’m not a laser expert by any means, but I’ll attempt to describe the requirements around the operation of one. A carbon dioxide laser relies on electrical excitation of the gas molecules to produce radiation, which leads to laser operation. To excite the gas, a high voltage must be applied to the tube, which ionises the gas and “strikes” the tube. Once ionised, the gas begins to pass electrical current, which then sustains the laser operation. For our tube, around 25kV is required to strike it, after which the voltage reduces to around 2kV. The power supply regulates the current supplied, to stabilise the power output of the tube.

The aim of our diagnosis was to determine which of these components was most likely the cause of the fault:

  • The laser tube
  • The high voltage power supply
  • The laser controls

We’d already eliminated the basics – mains power issues, fuses, etc. The next thing we checked was whether there was any sign of laser power. Once we’d determined there was no sign of laser activity, we flipped open the laser cover to observe the tube. We could see some faint glowing around the electrodes, which suggested that there was some ionisation of the gas, but not enough to strike the tube.

The first thing we attempted to rule out was the panel controls. We found the data sheet for the laser supply. The power supply has a regulation input of 0-5V, which controls the current to the laser. On our cutter, this is directly wired to a potentiometer on the front panel. We checked this using a multimeter, and verified that the output varied smoothly, with no jumps or dirty spots. We also checked that the test button was able to drive the input terminal on the power supply, that the panel ammeter was able to pass current, and that the wiring was sound.

Since we had no guarantee that our laser tube was OK, we needed to create a test circuit that “looked” like a laser tube to the power supply. This would then provide a means to check whether the power supply was able to produce the high voltage required to strike the tube, and whether it was capable of supplying the current to sustain operation.

Since testing the supply’s sustain current was the simplest thing to do, we calculated an appropriate resistor value to load the supply. As we knew our tube was a 40W model, and worked at about 20mA current, we chose a 100kOhm resistor (20mA into 100k produces 2kV, 2kV x 20mA = 40W). We purchased a large, high wattage ceramic coated resistor for this, both to ensure sufficient power dissipation, and to be certain the high voltage wouldn’t arc over the resistor. The resistor was wired in instead of the laser, and we used the earth terminal on the cutter’s chassis as the return path, after verifying that this connected to the power supply’s return terminal. We also connected a 100 ohm resistor in series, at the earth side of the power resistor – this provided a 1000:1 resistance ratio, which was suitable for connecting a voltmeter to, so we could see the voltage produced by the supply.

We began testing with our control potentiometer turned all the way down, and tested for a few seconds at increasing levels. The result showed a gradual increase in current with no sign of a problem. We then held the supply at its maximum current (which was about 18.5mA) for 10 seconds to check it produced a steady current.

Laser Supply Tester - Circuit Schematic

Laser Supply Test Hardware

Laser test hardware

Laser test hardware

To test the striking voltage, we used a simple spark-gap setup in series with the resistor. Dry air has a breakdown voltage of about 3kV/mm. We used some bare copper wire to assemble a simple gap which could be varied by bending the wires. While this didn’t provide a way to directly measure the striking voltage, the gap would provide an approximation – with the rest of the circuit acting as a realistic dummy load and providing a means to check the current and running voltage.

Starting with a gap of about 1mm, we tested the supply. At 1mm, we got a nice clean purple arc. Increasing the gap, we got to around 3mm before we hit trouble. At this point, the breakdown voltage was about 9kV, but the supply would only strike with the control potentiometer in a particular position, and wouldn’t sustain operation. Increasing the gap further resulted in no striking at all.

As the laser required around 25kV to strike, this setup should have worked up to a gap of about 8-9mm, so we were quite far off.

This seemed to indicate a problem with the power supply – most likely, some form of insulation breakdown in the flyback transformer.

We’ve since ordered and installed a new power supply, and I’m pleased to report that the laser cutter is now back in working order!

Talking V.23 to a Prism VTX 5000

This is the third post in a multi-part series about viewdata. A few members of the hackspace are working on a project to connect a ZX Spectrum with Prism VTX 5000 modem to an emulation of a viewdata system, providing a live demonstration experience.

A word in advance – this post is quite theory-heavy, and contains quite a bit of technical information. However, hopefully it’s of interest to people. You can find the complete source code for my softmodem at https://github.com/aquila12/v23.

Modems for viewdata systems use Mode 2 of the ITU V.23 standard for communication. This specifies the signal format for encoding the data as transmitted across a phone line. Mode 2 allows a maximum of 1200 baud operation, and specifies the mark (logic ‘1’) and space (logic ‘0’) frequencies as 1300Hz and 2100Hz, respectively. The standard also specifies a backward channel running up to 75 baud, using 390Hz and 450Hz for mark and space, respectively.

Viewdata uses the faster forward channel to deliver data to the customer’s terminal, while key presses are transmitted immediately over the backward channel. With the standard 7-bit ASCII data, even parity bit and the stop and start bits, the frames are a total of 10 bits long – so the forward channel can relay 120 characters per second, with the backward channel running at the much slower 7.5 characters per second. Viewdata frames are up to 40 characters wide, with 24 lines. This divides out neatly so that three complete lines of of non-escaped data can be sent each second (escape codes are used for display attribute changes), with a full frame taking around 8 seconds to transmit.

While a regular V.23 compatible modem could be used, these are somewhat rare now. To communicate with the Prism, we decided to use a software modem. While we’d had some success with minimodem, I found it slightly problematic to use in practice. On my laptop, it used a lot of CPU to demodulate signals, and it struggled to synchronise with the incoming data. I decided to put my somewhat rusty signal processing theory to practice and wrote a V.23-only softmodem to use for this project. My aim was to avoid performing any fourier transforms (e.g. FFTs) on the signal, as these are computationally expensive, and instead stick to simple operations such as moving-average filters and differentiators, as these can be made very computationally efficient.

My first arrangement has limited success, but was too sensitive to noise. The arrangement, briefly, did amplitude demodulation on the mark and space frequencies, then compared the magnitudes to see which was stronger, and fed the output to a shift register which detected the serial frames. Once I’d thought a bit more about the problem, I decided to attempt demodulation using an approach more suited to the frequency-shift-keyed modem signal, which produced much better results. I’ll describe that in more detail here.

Taking an input signal, I multiply on a complex local oscillator which runs halfway between the mark and space frequencies. This essentially moves the frequency spectrum down to DC – anything lower than the oscillator is seen as a “negative” frequency, while anything above is seen as a “positive” frequency – see the image below for a brief illustration. For a complex (I-Q) oscillator, this means that the direction of rotation of the output vector tells you whether the dominant frequency at the input is above or below the local oscillator frequency.

It’s worth mentioning that multiplying on the local oscillator doesn’t just “move” the spectrum – it causes two copies. One is shifted down around DC (the “difference” spectrum), while the other is shifted upwards (the “sum” spectrum). Because of this, and also because the input isn’t completely clean (in fact, it might contain other signals), the signal must be filtered before determining the direction the vector is rotating in. I used a moving-average filter for this.

Signal Processing 101

Signal Processing 101

Moving-average filters are very simple – essentially the samples between two points in time are summed. This is easy to implement efficiently as you only need to keep track of the samples within that period, and keep a running total. As each sample is added to the total, the sample added least recently is subtracted and removed from the buffer. These filters have a very characteristic transfer function (i.e. what frequencies they reject). The moving-average filter completely rejects signals at regular frequencies, and those frequencies occur depending on the period the filter is averaging over – the illustration shows the shape of the response. I used this fact to specifically tune the demodulation filters. When demodulating the forward channel, I placed the first “null” to eliminate the backward channel signal as much as possible (as in the picture), as the backward channel is within the side-bands of the forward channel. For demodulating the backward channel, since the band is quite narrow, I just placed the first null so it was away from the frequencies of interest.

The filtered signal is then passed to a function which determines the current phase of the vector. This essentially divides the vector components to produce the tangent of the phase angle, and then passes that through a function to determine the angle. As the precise angle isn’t important for this, I used a simple approximation for this – the tangent function, between -45° and +45°, is nearly a straight line, and it’s straightforward to replicate this approximation through the entire circle by flipping the division upside down to stay in this quadrant.

Once the phase angle is determined, we just need to average its change over each bit, and use the sign of this (positive or negative) to correctly demodulate the signal. The simplest way to write this was to take the derivative of the phase, and then run this through a moving-average filter. The output is then fed to the same frame-detection routine as I’d drafted for my first attempt, which I’ve illustrated below.

Frame Detection

Frame Detection using a Shift-Register

I’m aware this topic has been quite in-depth as far as the implementation goes, but I’m hoping it makes some sense to those of you who perhaps dabble in filters or radio-related topics! If you’d like me to expand on anything I’ve discussed here, please get in touch and I’ll do my best to address your query.

Next time, I’ll talk a bit about the viewdata frame format and how we’re writing our frames.

Simulating a Phone Line

Line Simulator built in an old ADSL filter box

This is the second post in a multi-part series about viewdata. A few members of the hackspace are working on a project to connect a ZX Spectrum with Prism VTX 5000 modem to an emulation of a viewdata system, providing a live demonstration experience.

Viewdata connections, much like dial-up internet access which followed later, relied on audio frequency telephone communication to transfer data between the user’s terminal and the information provider they were logged into. I’ll cover details of the signal modulation in a separate article; in this article I’ll describe how I connected a real Prism VTX5000 modem to a laptop’s sound card.

A UK telephone line, like that in most countries, is a relatively simple circuit. The line is supplied from a bank of batteries with approximately 50V DC, with earth on the positive side (to prevent line corrosion by offering cathodic protection). This would have originally been supplied via a pair of relay coils, which have three main effects:

  • The coils have a DC resistance, which in practice limits the off-hook condition of the line to about 8V at 20mA
  • The coils present a large inductance, which prevents AC (i.e. the audio signal) from being lost into the supply
  • The relay contacts are used to detect when the line is off-hook

For the purposes of our simulation, we only need the line simulator circuit to behave like a line in the off-hook state. This means it can run from a low-voltage supply of 9-12V. We’re also not interested in providing a ring signal (typically around 90V AC), as it’s also not required for this project.

On a telephone line, the AC audio signal sees a resistance of around 600 ohms. Audio signals are coupled to the phone line via capacitors, which pass the audio signal but block the DC supply.

The line simulator therefore has the following requirements:

  • To provide approximately 20mA at around 8V DC with a telephone connected off-hook
  • To provide several kilohms of dynamic resistance at DC
  • To provide around 600ohms of resistance to AC
  • A means to inject an audio signal from a laptop onto the line
  • A means to take off an audio signal to feed a laptop’s line input
  • Protection to prevent overloading of the sound card

Starting with the DC requirements, a fairly simple transistor circuit can be made to act roughly like a current source, up to near the circuit’s supply voltage. Adding a bypass resistor permits the introduction of a controlled dynamic resistance at DC, and this also affects the off-hook voltage level.

To provide the required AC resistance and injection capability, the circuit can be coupled via a capacitor and series resistor to the laptop’s headphone jack. A second resistor to ground helps to block the DC supply. A headphone output has a very low resistance of a few ohms at most. A 680 ohm resistor increases this to a more suitable level. While this is slightly on the high side, it leaves some room for other parallel resistances of a few kilohms, which the circuit will introduce.

The protection and take-off requirements can be met simply by placing two signal diodes in inverse-parallel; this limits the line signal to 0.7V peak, and also limits the extent of transients when the line switches between on- and off-hook conditions.

Line Simulator Circuit Schematic

Line Simulator Circuit Schematic

The complete line simulator circuit is shown above. The LED and series resistor are used to provide suitable biasing to the transistor. An unintended side-effect is that when the phone is on-hook, the LED supply is bypassed by the transistor, so the LED also acts as an off-hook indicator.

This circuit can easily be built on a small piece of stripboard. ADSL filters are widely available, and often going spare. These provide a suitable project box and, with the rest of the filter components removed from the board, a pair of phone jacks which can be connected to the line simulator circuit. Note that the circuit as presented is not suitable for connection to a PC microphone jack as the signal level is far too high; to use this an attenuator would need to be built in, which could be achieved with a simple resistive divider.

Once constructed, check the voltage at the phone socket is about right, then plug in an old phone to check it’s working. You’ll probably hear some quiet line noise, and the LED should light when the receiver is lifted. If you connect the circuit to a laptop or music player, you should be able to hear audio played clearly through the phone, complete with that lovely tinny quality.

Viewdata – A Brief Overview

This is the first post in a multi-part series about viewdata. A few members of the hackspace are working on a project to connect a ZX Spectrum with Prism VTX 5000 modem to an emulation of a viewdata system, providing a live demonstration experience.

Back in the early ’80s, before the world wide web was a thing, there was something a little like Teletext called Viewdata.

Viewdata pages look a lot like Teletext – they share the same frame formats – and viewdata terminals likely used the same IC to produce the video signal (The Mullard SAA5050, also used in the BBC Micro for its text-only mode). While teletext pages are transmitted in the blanking interval of a TV signal, in rotation so a receiver needs to wait for the right page, viewdata operates over a telephone line and so is more interactive.

When a subscriber wanted to log onto the service, they dialed the provider they wanted to access – for example Prestel – and provided their ten-digit ID number and password to log in.

Once logged on, the user was presented with the main page, and navigated using the number keys and enter. Pages were generally arranged hierarchically, so page 1234 would be below 123, and is reached from that page by pressing ‘4’. Like Teletext, viewdata pages could consist of multiple frames, so pages longer than one frame could be constructed.

Companies who wanted to host information on a viewdata service would pay the information provider (IP); this would involve a payment for a particular length of prefix (shorter prefixes would typically be more expensive), and also per page hosted. They could edit frames using special editing software, and then uploaded these to the IP. Frames weren’t restricted to being completely passive – “submission” frames could be authored, allowing people to order goods or fill in forms. Frames could also be marked with a cost, allowing companies to collect money against a user’s account when they accessed the information.

Often, information providers would have a mailbox system, allowing users to send each other messages, which could be retrieved and read when the user logged in. Some terminals would allow these, as well as other frames, to be retrieved and stored locally, so they could be read offline without the user keeping the line open.

As well as centralised information providers, such as BT’s Prestel, software later emerged allowing people to host their own viewdata systems – often bulletin boards – or set up peer-to-peer connections. Peer-to-peer connections allowed users to phone each other, and as long as they set their modems correctly, information could be transferred half-duplex. Bulletin boards could be run on systems such as the BBC Micro, and would present themselves in the same manner as an IP.

The modem standard – v.23 – used for viewdata is asymmetric. The forward channel (download) runs at 1200 bits per second (120 characters per second taking framing into account), while the reverse channel (upload) runs at 75 bits per second (7.5 characters per second). A terminal – apart from any storage functionality – is relatively “dumb”, and transmits key presses immediately. The information provider’s system reacts as needed – whether this means sending a new frame, or echoing characters typed into a response frame. The slow reverse channel is still generally fast enough to transmit the user’s keypresses, and is fairly noise-resistant because of the low bandwidth.

There are sites which contain demonstrations of some viewdata systems – https://www.viewdata.org.uk/ is a good example of this. Follow the “Logon Now” link to access an example.

Extra Open Evenings in May. Come and look around.

York Hackspace open evenings for May 2017

Open Evenings at the space in May.

We’ll be running a couple of extra open evenings on Thursday 25th and Tuesday 30th May for people who want to come and look around the hackspace but are unable to attend our regular Wednesday night open evenings.

Same time as usual, 8pm-11pm.

See https://york.hackspace.org.uk/wiki/Weekly_Open_Evening for more information including how to find us!

Corduroy aprons are this year’s must have hackspace accessory

I decided that I need an apron. I mostly turn up at the space in whatever I am wearing from work and sometimes things might get messy. An apron should do the trick but as it’s a hackspace I can’t just buy the first one I see. So it’s time to break out the sewing machine.

Me at the sewing machine. First off I needed a pattern or something to to copy from. Luckily Aimee already had something so I set about finding some suitable material. Traditionally these things seem to be made from something like a heavy cotton or even leather. I went for chord. Brown chord with blue trim.

Cutting out the template

I laid the pattern apron out on the big table over my cloth and after some pondering we decided to mark up a rectangle of the right length and width and just mark up the curved parts that go under the arms from the pattern. A small bit of scrap ply-wood was brought in to use as a square to get things lined up and a point of no return was passed as I made the first cut. Pinking shears are great fun, it’s like setting an alligator to work and you end up with a zig-zag cut that should not fray.
I added a centre line to help keep things lined up then chalked out the curve from the template apron. Then cut both curves in one with the sheet folded in half.
Sewing the boarders onto the materialNow for some practice runs on the machine. It’s been a while since I last had a go with this so here was some browsing of the PDF copy of the manual to see how it threads together. Then some tweaking of the tension to get it sewing right on the chord. ( I make this sound simple but I think this bit took almost the most time but I now consider myself an “expert” ) I added a plain hem along the bottom and its almost straight.

Adding the boarder.For the first attempt to attach the tape round the sides I used pins the tape in place I found that it moved about too much and the pins then made it to difficult to correct so I switched to just feeding things in an adjusting the fold as it went which worked quite well. In the end I had to unpick things quite a bit on the first run but then worked out that I needed to have a bit more tape on the front or it would work itself out.

Then finally adding on the the loop round the top and the strings round the back and it was done.

It may be a little long and I should have made the strings round the back, up the sides and around the neck from the a single piece. I also think the bit under the neck is a little to wide so it sticks out a bit but other than that I’m pretty happy with it. ( Oh and it could do with an iron, we should probably get one for the space)


Spacehack upgrades, Just in time!

You may have spotted a little while ago that we got a place at Maker Faire UK for the fourth year in a row.

For the past few years, setting up Spacehack hasn’t been a simple job, mainly because of how the server box (the gold pyramid) was a flimsy cardboard box with various things taped to it. We also had issues with the four consoles. Many LCDs were failing, pots not rotating correctly, switches not working or missing. So we had to do some upgrades.

One of the most ambitious upgrades was the server box upgrade. We wanted to get this one done before the Maker Faire this weekend, to make setup easier. I’m pleased to say that we have completed it on time! You can look forward to seeing the new server box this weekend.

The upgrades have enabled us to make the server more rugged and much more compact. We’ve eliminated the need for three of the five power supplies by making everything run on 5v. We even have a touch-screen GUI for managing the game. The GUI’s written in pascal, of course. 🙂

Just to be clear about why this needed doing; see this picture of the guts of the original server box. Yuk!

Need to etch PCBs? We can help!

Nat needed a PCB recently, so we decided to see if we could make good use of the PCB etching equipment we have in the hackspace. It’s a fairly simple process, print a positive on some laser-printer-acetate, stick it to a pre-sensitised PCB, expose it to UV, dip it in developer, then dip it in etchant.

The UV exposure box

The UV exposure box

At least, we thought it was that simple. We had a couple of failed attempts before we got a good board. We couldn’t agree on the correct time for exposure and development. On our third attempt, with two minutes in the light box and about thirty seconds in the developer solution, we got a decent image.

The first two attempts

The first two attempts

Now we really should have rubber gloves for this next bit, but we couldn’t find any. Fortunately we did have a pair of thick plastic carrier bags for handling the etching chemicals.

After allowing plenty of time in the etchant, agitating it for extra speed, we finally got a good looking PCB out.

Some of the tracks needed a little bit of fixing up afterwards, but this was just a quick test board. If this works, there will be two more done properly.

Now that we know how best to use the kit we have, if you have a project that requires a home-made PCB then why not come along and let us lend a hand?

The Long-Awaited Low-Temperature Tuck Shop.

After having this lovely glass-sided fridge in the hackspace for many weeks, we’ve finally got it to a working state.

We got the fridge for free, in mostly working condition. It really needed a clean and the fan motor was very noisy. It also had a fluorescent light bulb in the top, which wasn’t working. We tried fixing the fan, but couldn’t get it quiet-enough to prevent it being a nuisance to people working in the hackspace. In the end we decided to replace the fan with an old PC cooling fan that was much quieter.

While we had the thing open, we decided to do something about the lighting. We removed the old light bulb and instead fitted some much lower power LED strips inside the fridge. Nick did a great job of wiring these up to the switch for the old light and even added a little microswitch to detect the door opening and turn on the white lights to make it a little easier to see. (As pretty as the blue and red lights are, they’re not ideal for reading labels on things.)

Let us know what we should stock!

 

We’ll be back at Maker Faire UK this year

Despite crashing the USS guppy into the Life Science Centre’s unique exhibition space numerous times, somehow we’ve been invited back for the next Maker Faire UK.

This will be the fourth year that we’ve been at the Maker Faire UK. We will, of course, be taking spacehack. We’ll also be bringing along some other projects too. John’s tetris table shall be making an appearance and we’ll no doubt have some other goodies you can play around with.

Be sure to check out http://www.makerfaireuk.com/ when details of who else is exhibiting are released.

Some photos of our past adventures in the Life Science Centre…

York Hackspace at MakerFaire UK 2014

1 2 3 4