CNC finally running

The CNC mill got into a working state right before christmas eve. I know it’s not a present in that sense, but still! :3

Some parts of it are still fixed with a lot of glue and tape (or zip-ties ^^), but for now that’s perfectly sufficient. Right now. it can already mill hard wood and MDF, so I will be redoing some critical parts that lack in precision and/or quality before I write up the whole project as one. Unfortunately, I fear that the original plan about using an (older) EPIA 800 board as a controller can not be followed, EMC2 just refuses to start on that thing. Grrrr…

More pictures and text will follow in a few day’s time. Until then, enjoy the holidays and have a nice and safe start into the new year!

Oh, right, and two Stellaris Launchpad eval-kits from TI that I ordered back in September arrived JUST ON the 24th. How great of a timing is that? I don’t care about the wait, it was well worth it and I knew up front – but thanks again to the girls and guys of the TI support, for solving all the technical difficulties along the way :-)

PBG12201 plasma displays

Bar display with reservoir cap in HV circuit

I picked up some unusual plasma displays from ebay some weeks ago, which I have been searching for quite some time now. The picture above shows an illuminated Burroughs PBG-12201 plasma bargraph display. They are pretty hard to get by now, and if available, prices are a real shocker. Some shops in the US that carry them ask for 230 USD and some even more. Sometimes they appear on ebay for about 50 USD, but you have to be real quick to get some. Best chances are with surplus stores that sell off leftover production stocks or disassembled devices that originally contained such tubes. A few very retro and very popular mixing consoles for audio applications used them as main VU meters (eg. made by Lexicon),  as well as some current professional grade standalone meters (eg. RTW, one of those is where I first saw such a display and was absolutely fascinated by the deep orange hue). As they eventually get old and start flickering or burning in if not properly cared for, spare parts have become rare, and since Vishay – the most recent producer of these displays – has discontinued the product line in early 2012, I would expect the market to dry up even more.

Mine were obviously scavenged from some kind of device by a Hungarian ebay seller, he offered some 10+ pieces of the PBG-12201 type display for 8 Euros each – a real steal! I just couldn’t resist and got myself three of them, together with matching sockets. Thinking back, I don’t get why I ordered three instead of four…oh well, it’s done. The tubes show some signs of wear, like glass chipped off around the edges and burn marks on the cathode traces, but they all work fine. Continue reading

Workbench #3

Work on the CNC continues…the end draws nearer. I am currently disassembling the whole thing as far as necessary to clean up all the edges and burrs and fix the positions of the parts relative to each other using hammered-in stainless steel pins. After that, it is just coupling the threaded rods to the moving parts and bring the stepper drivers alive.

DNS problems with Netgear FVS equipment

A follow-up on the recent DNS-related stuff:

I figured out today that my router had a hand in those weird random connection problems. What made me especially nervous was the almost systematic way that DNS and other random UDP packets vanished from the ‘net during browsing or testing with various tools. The requests were shown to be sent in both the Wireshark protocols and the router packet capture, but an answer never arrived. As it turns out, Enterprise-class devices have their firewall preconfigured to block UDP flood from inside the local network.

The definition of “flood” used here is:

“20 simultaneous, active UDP connections from a single computer on the LAN”

http://documentation.netgear.com/fvs336g/enu/202-10257-01/FVS336G_RM-06-09.html

Now, somehow my setup managed to step over that line, and from what I gather on the ‘net I am not the only one experiencing this. Sometimes the system will run clean for a few days, then bug in increasing frequency until I get fed up with it and kill the whole DNS process plus cache. Apparently, this fixes the problem for some time as a good reset almost always does, but it is no permanent solution.

To debug, first turn on the attack-related logging functions in the router and clear the logs. Then call up “nslookup” on Windows based systems and fire some random URL DNS requests in fast sequence. In my case, after four requests the firewall kicks in and UDP flood warnings appear in the log. Maybe Windows 7 just leaves the ports open a little too long, I don’t know and I haven’t checked. However, since this feature has been turned off in the firewall settings I had no further DNS problems, and the speed of browsing has increased a little.  Hopefully that was all there was to it.

Another point of interest: Some Netgear devices have developed a habit of kicking lots of NBSTAT-packets on the LAN, one about every 5 seconds or so. Seems to belong to some type of NETBIOS detection mechanism, though the sense escapes me. The packets are of unicast-type and therefore disrupt everything one could possibly have in the way of wake-on-unicast, which linux supports to wakeup devices from standby if they are talked to directly. NETBIOS features are nowhere to be found in the configuration menu, so I guess at some point the checkbox for that must have gotten mislabeled. The one responsible is “ARP broadcast” found with the LAN settings. Turning it off quiets things down a lot.

But: You lose the capability to show unknown devices in the LAN clients list for simple management of DHCP fixed leases. You can still turn on ARP for a few minutes if you need to detect anything, though.

Faulty IRC DNS lookup

I’ve been having some problems connecting to IRC through the miranda client on Win 7 lately.

Miranda features several “serverlists” for different IRC networks – QuakeNet in my case. Some of the lists work, some don’t, some work at some times. Now, upon clicking edit only one fixed web address shows up. The way this works is, the DNS server knows multiple IP subentries for those servers. You can check with some web-based lookup tools that show all of those entries. Windows’ own command (“nslookup <address>”) only shows the one delivered by the server, as it needs only one precise IP to communicate.

Multiple entries exist to balance load between servers, they are delivered round-robin. If you flush your dns cache locally (Win 7 wants you to do “ipconfig /flushdns” on the console in admin mode, for example) a new IP is acquired – and this one is ideally different from the one before. Now, because Windows does not clear the cache between requests for several logical reasons (it’s a cache, right?) the client program obviously also knows only one of the possible IPs. All the better if exactly that IP is down.

It took me quite some time to figure out where the problem was (all the while thinking there may be something wrong with the router or the net is just in a weird mood today). After checking the DNS entries sequentially using ping and a connection attempt through Miranda, I found to my surprise that while some lists work partially others are simply dead.

irc.quakenet.org 1/8 working Compilation of all subranges
se.quakenet.org 1/3 working
de.quakenet.org 1/2 working
uk.quakenet.org 1/3 working

Remember that this data is momentary from the time I checked the servers. The status might be different now. Anyways, this is some russian roulette!

The lists may fluctuate though, I am pretty sure I got a connection using the german list at some time. It is also possible, that the lists are updated dynamically from time to time, but I haven’t seen it so far.

Fixing this mess is quite easy: just edit or add a list in Miranda for the corresponding network and enter the exact IP. You best find that one yourself by pinging, start with one of the shorter lists you are comfortable with. You will experience trouble if that server goes down, but at least then you will know what the heck is wrong right from the start. Saves time and nerves.

Workbench #2

So much for the current status of the CNC milling machine. I have made some first experiments with L297/298 motor drivers and found out the hard way that these are quite overloaded with such strong motors. Burnt out in a matter of seconds. But, as BJT driver bridges are not state of the art anyways, and I want to take a lesson from this project, I decided to finally get myself some of those specialized ATMEL controllers (AT90PWM1) and try to design my own FET bridge driver.

I even have one in spare that I can use for experiments with a self-designed high intensity discharge lamp driver – I have attached an image of an early prototype to the gallery for your entertainment. Worked quite well for some time, but the driving was very crude – there are some logic gates on the bottom of that small pcb that generate half-bridge signals for the two FETs, but no care taken about anti-shoot-through and so on. VERY crude. I will report how well the new controllers work out, seeing that very few experiences are found :-)

As for the CNC, I am quite confident that I will finish the mechanics part within the next holidays (around easter). Then, all that remains is the ‘intelligent’ part.

Last but not least, I notice that I still do not manage to describe my projects in my self-desired level of detail. Thus I will focus more on taking pictures during the process and explaining from now on.

UV pcb exposure box

Today, I want to write a few words about another of my older projects.

UV exposure box - whole view

A while ago, I started building this DIY UV exposure box. The electrical part consists of a self-designed count-down timer based on an AVR Tiny2313 CPU, 4x8W PHILIPS UV tubes, ignition/driver circuits from cheap fluorescent bulbs, a multiplexed numeric LED display, a rotary encoder and some wiring. A piece of ~4mm aluminum serves as a faceplate, picture frame glass as the exposure surface. We’ll have a look inside in a moment.

When turned on, the controller presents the configuration menu first. All options are preset – or should I say ‘preprogrammed’ because the preset cannot be changed, as of yet – to the values I use most frequently. Configuration includes the time (up to 9min 59sec), a variable tube preheat time up to 59 seconds and a zone selection. The zone selection does nothing at the moment, but the pcb features a mounting spot for a second solid state relais which I have not yet installed. Which means, all four tubes are activated.

Exposure box - menu
Minutes…

Exposure box - menu
Seconds…

Exposure box - menu
Zones…

Exposure box - menu
Preheat…

Exposure box - menu
…ready to go!

Exposure device - running
Enjoy

Press the selector one more time and the process starts. To stop again, either press the button again, switch off the mains or wait patiently until the time runs out.

Now, on to the inner values. After undoing 7 torx screws, the lid can be removed to access the elecronics compartment behind the front panel:

Exposure device - mains part
Mains input and ignitors

Exposure device - microcontroller
Microcontroller board

Exposure device - electronics compartment
Electronics compartment

Inside the compartment is the four-fold ballast circuit, which consists of four board found in the sockets of fluorescent energy saving lights. These are pretty cheap compared to commercial electronic or inductive ballasts and they can be used right as they come. The only crucial number is the power rating – my tubes are rated for 8W while the ballasts came from 9W bulbs, which works just fine. Care has to be taken when opening the sockets, though. The bulbs should be left lying around for some time prior to “dissection” because they contain a pretty juicy capacitor. The circuit inside is basically a simple switchmode current supply. When that’s done, an easy way is to cut them open along the circumfence about in the middle of the socket’s height with a fine saw blade. Don’t cut too deep or you will damage the pcb. Once the casing is open, mark the pairs of wires coming from each end of the tube before cutting them. These pairs need to go to the ends of the UV tube, don’t mix them up or you’ll short out the circuit. How the two wires connect to the two pins of the tube on each side is completely up to your choice, though.

As always, remember the hazards involved when dealing with mains equipment, especially such that was never designed to be opened or even run in the open. Also, don’t go breaking any fluorescent tubes as they might contain traces of mercury.

The four ballasts are wired in parallel to the mains, with just a fuse, the power switch and a solid state relais in series. Fuse-wiring got a little complicated because I forgot to place separate fuse sockets for controller and drivers onto the pcb, but nothing dangerous here. A connection between faceplate and protective earth is also present for safety reasons, seeing that there is lots of live wiring very near. You may have noticed the absence of any cooling fan or holes – these are not necessary as the device is run for a few minutes at a time and never unobserved. The ballast circuits are designed for operation in a very tight unventilated space anyways, so no trouble to that end. After ~5 minutes of exposure the glass surface becomes just noticeably warm.

To the right is the control circuit, consisting of said ATTiny2313, a small 6VA transformer-powered 5V supply, the solid state relais (SHARP S202S02) and three npn transistors as segment drivers for the LED display. I still have some pictures from back when I made the pcb (about a year ago now):

Drilling holes…

Finished pcb

…all soldered.

I have used this exposure box several times now and am pretty content with the results. There still remains some creepage of light between the layout print and the photosensitive layer, resulting in fuzzy edges of traces and larger groundplanes sprinkled with small holes. This is partly thanks to an absolutely ridiculous laser printer made by HP (Color LaserJet 2600nse). No matter what settings are used (even in the expert options), the printer will never do dense black withing planes and very often blur traces on either the leading or trailing edge. Text works fine, though.

You may download the schematics in Eagle 6 format at your leisure. I do not guarantee correctness of the layout, though. There was a small problem in an earlier version (Pin 1 of ribbon cable connector was not connected to ground) which I have fixed now.

I do not take any responsibility for whatever happens to you. It’s up to you to decide if you want to and are able to build something like this.

>> EAGLE 6.0.0 Schematic and Layout

>> Script files for older versions of EAGLE – untested!

>> Sourcecode and .hex for ATTiny2313

* NOTE: Make sure that pin 1 of the front panel connector is really connected to ground, the traces were etched away in my case. The result is erratic behaviour of the rotary encoder.

CNC update

Alright, time for another update linked to the CNC mill! I just finished the linear carriage for the X-direction. Still having some minor trouble getting a tight fit between the bearing-rollers and the rails, but I suspect this will be correctable later through adjustment. The whole thing needs to be carefully calibrated and aligned anyways before real milling action is anywhere near possible.

To be honest, I don’t think the alignment of the parts will keep up with vibration and forces for too long, which is why the most crucial parts will be remade with this mill while it works – that was the goal from the beginning.

The next step now is to connect the threaded rod to the carriage and to finish the drive system for the Y-direction, which will reside below the table and pull the whole portal sled through a rod that passed through the table. The table supports and Y-rails are still sitting in the workshop, waiting to be cleaned up.

Repairing a remote car key

I’ve had this lying in a drawer for some time, it stopped working from one moment to the other. Imagine unlocking your car, driving around some, and then being unable to lock it again. Good thing that mechanical locks are not totally uncommon. I still had one remote in spare though, and together with a bought new one the set was complete once again. To be precise, these are pretty old models (’94-’96) made by Volvo and cost some 40 Euros or thereabouts. I would guess that is pretty much the same for each car manufacturer, as are the inner workings.

All was well until another key broke down – same procedure, different day. Maybe static electricity was to blame, I don’t know. But it made me wonder if it could be fixed – so I cracked it open.

Volvo remote keyThis picture was taken after the repair, which explains the flux residues ;-). The circuit you are seeing can be identified using an EPCOS resonator AppNote linked at the bottom of this article. The resonator (marked in picture) is a S+M R701, manufactured by Siemens Matsushita Components, a joint venture that later brought forth EPCOS. While there are other manufacturers like RFM, these models seem to be a pretty common brand for such keys as far as I have seen. Inside the metallic-ceramic casing is a parallel LC resonance circuit which has been precisely trimmed for a specific resonant frequency. The current types are mostly pin compatible to the old ones.

Just in case: Those resonators cost you a few cents at Farnell, but I would guess Digikey also has them. Use the datasheets to get the correct one for your frequency and pin layout. They are a real pain in the ass to solder by hand! But, to be fair, they were not really designed for it. Use hot air or reflow techniques if you can, or else heat the ground plane from the side, OR remove the resonator by applying a small amount of solder to the case top and heat it up completely. Take care not to rip the copper traces off the pcb, as the glue keeping them there becomes flexible when overheated. To solder on the new one, place it onto the cleaned pads and flow solder underneath the pins from the side, for each pin individually. Do not heat the resonator for too long. I did it like this twice, but as said – pain!

A good place to start is the EPCOS R920 resonator.

As I found out later, the resonator was perfectly working. I swapped it anyways – even swapped the old one back once I found the error – to make sure, but the real culprit was the HF output transistor which I have marked in the lower left.

How it works, in easy words: The signal generated by the microcontroller is a digital pulse signal containing the remote code. This signal is fed into the resonator through a resistor and a capacitor, and from the resonator back through said capacitor to the base of the output transistor. The resistor limits the output impedance of the controller pin to prevent it from clamping the transistor base to a fixed voltage and allow the resonator to overlay an AC component onto the DC voltage. Now, as the resonator…well…resonates at its designed frequency, excited by the impulse coming through the capacitor when the controller pin turns ON, the resonance waveform is coupled into the base of the transistor, which in turn amplifies it and pushes it out onto the antenna. Imagine repeatedly hitting a tuning fork with a small hammer and touching it to stop the vibration in a certain pattern while picking up the generated sound with a microphone to amplify it.

What you get is a high frequency signal during each high-level time of the remote code signal and no signal during each low-level time. This is called OOK, or on-off-keying. It can be seen as an extreme example of amplitude modulation (AM), and the principle is identical to the way TV remotes work – only that RF is used instead of IR light. There is a lot more theory behind this, you can look it up in dedicated books about high frequency circuits and transmitter circuits. As for this circuit, have a look at page 6 of the AppNote linked below. It features a standard circuit that very closely resembles my remote key, plus a detailed function explanation.

Back to the repair – checking the original transistor with a standard multimeter showed proper diode behaviour (meaning it was a bijunction npn or pnp transistor), but this is not always sufficient for a diagnosis of a working device in HF circuits. The output to the antenna (the copper strip along the left edge) appeared near-zero and the pulse signal after the coupling resistor was pretty deformed, too. With some remote keys you can test the RF output by holding a radio scanner set to 433,92 MHz or whatever frequency the key uses next to it and listening for pulsing tones/noise upon a key press. If you don’t get any response, you are either unable to hear the specific modulation (uncommon, as the modulation is pretty slow to ensure good reception) or the transmitter is (still) be broken. In the end, you probably have to find out by trial and error. Owning a GHz scope greatly simplifies the task, of course. I don’t, so I’d advise you to first swap the transistor and then the resonator. R/C/L are pretty uncommon to fail, whereas the transistor is sensitive to static electricity like most semiconductors. What you can measure, though, is the pulse signal from the controller.

Now, to get a suitable replacement, you can either buy a transistor that works for frequencies up to above the operating frequency of your device and has the same pinout – or you can simply go look for a cheap remote controllable wall socket, wireless weather station or the likes. Whatever you choose should use the same frequency, of course, and run on batteries. The probability of finding a suitable transistor inside such a transmitting device is very high. This will be the one nearest the feeding point of the antenna, like in the picture above. You’ll need to confirm the pinout by looking into the circuit or searching for a datasheet by the SMD marking on the case – if present.

I had to try two different transistors, the first one was probably already dead before transplantation (I already wondered why I never used that remote control). A second one worked like a charm! I have noted the designation of the found replacement in the picture above. The last thing to try is the range, but there is not much to gain with only about 3V of operating voltage – ideally, you’ll get whatever range the key had before. If the range is much less, the transistor is most likely not up to the job.

Remember that most car keys “forget” their assigned codes upon battery removal. You will need to reassign the key to your vehicle according to the proper method designated by the manufacturer.

Links:

Amp measurements (updated)

Here go the measurements. I use RMAA 5.5 free to do these.

All measurements were taken off an 5R6 load resistor. The maximum output power reached at 1 kHz sine into 5.6 ohms was 2.49 Weff resp. 4.97 Wpk, which is right on the money. Soft-clipping occurs right above that. I am not yet satisfied with the rise above 20 kHz, which I suspect to originate from a missing bypass cap in parallel to the feedback resistor. The cap short-circuits the feedback resistor at high frequencies to prevent oscillation (which currently occurs at 30-50 kHz when the volume isn’t turned all the way to the max).

The 50 Hz spike, on the contrary, is lower than I expected as I didn’t bother placing the output transformers away from the power transformer or putting them at an angle to prevent the magnetic fields from interfering. Another of those times when function follows form. Shielding in the wiring compartment could be improved a bit, though. Dunno if I should really photograph this mess.

UPDATE: And here comes a screen of the schematic. No need to do it in EAGLE as there is no PCB, the whole amp is air-wired. Enjoy.

The usual word of warning: This circuit operates at voltage levels of >= 275 Vdc at relatively low supply impedance, so please be aware that you build this circuit at your own risk, and proceed with caution! I am not responsible for any damage/injury that might occur related to this circuit.

As I already mentioned, there are lots of parallels to the linked amps from the last post. A few annotations concerning the schematic:

  • C5 is still missing in my case, estimate by trial and error.
  • Some parts dissipate a noteable amount of power, as marked – choose for at least 2W of dissipation to be on the safe side. You might want to oversize a bit here, to minimize aging of the parts due to thermal stress.
  • The coupling caps C3,C4 should be designed to handle voltages > 300 Vdc at least.
  • R9 is the loudspeaker, of course ;-)

Another piece of advice I learned during testing: If the connected audio source device is somewhat valuable, it is wise to install a suppressor diode directly across the input in such a way that is shorts high potential at the input to ground. In case any high voltage potential gets through the capacitor in form of a spike (like it did through a damaged socket in my case), this will at least save your soundcard a lot of undue stress.