Showing posts with label Clone. Show all posts
Showing posts with label Clone. Show all posts

2010-08-11

Drop-in replacement PCB

for Nintendo Controller (model 004)

A dear friend of mine has passed away.
We'd often made potentially career ending bets that I'd do some incredible thing (instead of the conservative assigned duty) and my friend would keep admin off of me long enough for me to pull it off.
I've felt fustrated not being able to celebrate completion of the last bet, esp. with ideas for the next.

But this has given me food for thought whilst I wait for parts to arrive for my other projects. I've made many similar (though less damning) bets with other friends, and I'd hate to see them gone before I've finished.


This PCB is for one of my friends who is a NES freak.

This (surviving) friend has [reportedly 1 dozen of the] 'original' controllers that are so badly worn that even the repeated application of a chemtronics.comrubber key repair kit does no good since it the PCB and/or the plastic caps that have completely worn away.

For a laptop I bet that I would produce a replacement controller from a broken NES controller. This controller would either precisely match the original and use the same case, or it would be clever and be far more ergonomically correct.

I got the laptop within a week but my friend has never sent me a broken controller. I have never had a NES myself. And years later, I've now decided to search the internet and see if I can find the information I need to make a replacement PCB for the NES controler.


Search results:
NES ControllerI first tried working from the photo on slagcoin.com but was disappointed by the insufficient 0.05" resolution I'd achieved in the result. I believe that I miscalculated the trapezoidal transformation.

Rather than repeat the process I searched again using a number of premutations and eventually found an x-ray on flickr.com that was perfect; No distortion, square and true. All I had to do was measure and scale.

The result:
  • A drop in replacement PCB that is within 0.025" of the original model-004 (rev.11) NES controller PCB using the original components.
  • Tact (10xx) switches have been drawn to allow replacement in controllers where the button/key caps have worn out.
  • Combs instead of panels to improve the useful life of the membrane switch, and minimize alignment issues.
  • The header has been changed from rev.11's {GND,CLK} to rev.5's {GND,VCC}.
  • 'Umbrellas' have been drawn under the resistors to prevent the ground mask from raining on the use of printed resistors.

Since I have no 4021 I am unable to build this circuit today (without ordering parts). The CMOS 40xx series of IC has been displaced by the TTL 74xx series. If I needed to I would need to make an extra a 74xx design based on what parts I have on hand. This extra design would also make sense if my friend has lost the original PCB or wants to make a spare.

A 74xx redesign:
  • The original printed M5923 resistors have been replaced with common throughhole 207's. These are grouped where the original 4021 was for stylistic reasons.
  • The original 4021 has been replaced with a surface-mount 74HC165 (since that is what I have on hand).
  • A transistor replaces the header and inverts P/S to output SH/LD because the 74165 loads on high unlike the 4012 that loads on low. (see nxp.com datasheets HEF4021B.pdf, 74HCt165)
  • All resistors can be 10k (though not optimum for the transistor inverter/NOT gate).

Modifications not implemented:
  • 40xx instead of 10xx switch because the larger 40xx would break compatibility with the original layout unless I were to intersect the pads, which would then make assembly very difficult.
  • Use of a resistor array instead of discrete components because I'd be inclined to use a single surface mount IC, and evidently a pitch of 0.012" is too small for most people to assemble by hand.
  • LEDs that are activated by button presses because I do not have a NES to test if this works.
  • Turbo/pulser because adding a single IC programmible division counter or frequency generator w/ selector switches would require my (not an electronics hobyist) friend to handle too many pieces, and would require modification of the original case.


2010-07-08

Cloning for fun or profit

Cloning a piece of hardware is an excelent way to learn about how it is designed, and how it works. This is often viewed as a seedy trade inwhich people bastardise the hard-work of honest engineers and other designers to produce the same product without the overhead cost of design and marketing.

Unfortunately in my experience design documentation is almost always lost and the only way to recover (or sometime resume production of) a product is to clone it and there is little discussion on techiques for achieving this.

Generally when I 'clone' a product, I build an exact replica (in so far as component layout and electrical connections). Then I go looking for what can be made cheaper. Then better. Then the maintence cycle begins.

I like to use high-resolution photography and logic probes to start with; however grainy photographed pages from a foreign trade magazine from a random website is more than enough to clone a product and start development.

Take for example the Solid State Diskdrive for the IBM XT featured on K. Giannopoulos' website (microwave.gr:Build your own Vintage PC-XT Computer). From these massive bitmaps, and roms we can produce plans for a clone and then some.

Step 1: Preparing the reference material
To obtain the reference board art start by tracing the bitmaps with Inkscape. This allows evaluation the quality of the reference material and gives me a reference for the wiring of the first clone.

Next using the outside corners as reference points calculate how much to rotate these layers to align their edges horizontally.

Top layer
  • (1463.789,5.971)
    0.233716199°
  • (1468.760,3.486)
    0.135987303°
  • 0.184851751°

Bottom layer
  • (1464.944,2.279)
    0.089134448°
  • (1468.780,9.950)
    0.388134564°
  • 0.238634506°


Okay;
In this example because the bottom layer is clearly out of square as the angle does not match, this could be because of perspective, a transform can fix that if it is flat. There is also noticable distortion bacause the pages were not pressed flat when the picture was taken, but maybe I will get lucky and manage to align it anyways.

Nope.



The red top layer does not completely align with the blue bottom layer. There are also a number of 'broken' traces where the line did not render very well. Even if this image was rescaled a pcb made precisely to this image the pcb would require significant repairs where the components do not fit, where the layers do not connect and where the wires are disconnected. Fixing this would be quite difficult.

If it were in alignment we could then replace the polygons with wires and convert this into gerber format using a script. But it's not so I will be drafting the board art manually. Fortunately this website also posted a schematic and parts list.


Step 2: Using the reference material.
Add all of the parts necessary to a new Eagle schematic. I found that I needed to add two 'new' comonents to the library: the three lead capacitor and the DIP32 RAM.

Working from one corner to the other recreate populate the schematic and board with approximately the same layout. Once populated wire the schematic and board as close to the original as is practical. The reference art can be coloured to track progress and distinguish different signals easier.

I think lavender is a fine colour for the data bus.


While I was doing this I made a few interesting discoveries: most significantly was the omission of CLK from the cardedge to IC19 on the original schematic, without this a clone card made only from the schematic would not work.

The secret CLK.


The Address and Data lines were also shuffled around by the orignal designer to help with board layout. This is good since even with the bits shuffled around each address is still unique and the data (provided it is always stored in the same order) will still read back correctly.
As evidenced by the vias inside the array of memorychips the previous designer got bored and used the autorouter resulting in some spectacularly stupid wiring.
I've duplicated most of the 'stupid' so that my colleagues will not harass me about differing from the original "too much", though while linking the data and address lines from the memory chips I made a hash of it since I intend to design that out entirely.

And here is the result of eleven hours of unpaid work: a clone of the original board, minus some stupid, plus some sloppyness when I got bored.


Now that we have a hardware/software compatible clone we can make it cheaper by substituting components.

Part3: to be continued


Note: I was unable to upload the PDF, SVG, brd, sch and lbr files I had intended to illustrate this post with. I am also disinclined to seekout a file host for these if nobody asks for them.

Edit: I have been contacted, links to follow.

Edit: Build your own Vintage PC-XT Computer files are availble in the Solid state disk section.