Showing posts with label Keyboard. Show all posts
Showing posts with label Keyboard. Show all posts

Friday, 12 March 2010

Open Sesame...

THE CONTROL PANEL

Two things are on my mind this time round.  Last time, I positioned the controllers way too close to the edges of the panel, and it made it quite difficult to fit the micro-switches and cables on the buttons near the edges.  Also, because I built the whole arcade machine as one unit (two sides, one top, one bottom) it made it quite tricky to get in and around inside the control panel - if a connection was loose, I had to start unscrewing things to fix it.

So I'm going to make a stand-alone control panel (7 panels, top, slope, bottom, front, back and 2 sides) and have a single USB cable coming out of the back or possibly bottom (you'll see why when I get to the PC bit at a later date)

Something like this:

[caption id="attachment_128" align="aligncenter" width="300" caption="control panel design"]control panel design[/caption]

To slope or not to slope?

Surely slopes on the control panel surface is contrary to good ergonomic design, but every image of every machine I can find shows a slope.  I toyed with the idea of a flat surface so I could rest my beer on it :-), but I've gone for this little touch of authenticity.

Access to the gubbings

That problem of accessing the wiring and stuff without unscrewing the panels has got me thinking.

I am plagued with insomnia, and a night or two ago, an idea came to me that should solve this problem, and offer some opportunities to make the control panel a little more functional this time around.

This all hinges on something special - did you see what I did there?







If I add a hinge to the front lower edge, I should be able to pull up and out on the sticks, and have the whole underneath of the sticks and buttons exposed for maintenance and upgrades.

And the cream on the cake? I can stash a keyboard and a mouse in this discrete control panel unit for those tricky "if only I had a keyboard and a mouse, I could fix that little problem easily" moments.

Good, eh? Well, let's see if I can build it, then I can say whether or not it was a good idea.

And for those attention-to-detail types of you, the single USB coming out can be achieved by a little cheap hub in the control panel that has the IPAC, the keyboard, and the mouse connecting in, and one usb coming out.

Genius!

Thursday, 11 March 2010

The story so far...again...

ROMS

OK. I had a couple of hundred ROMS, but as the MAME engine has been moving on, more and more of them have been marked as "not working" so I've bit the bullet and bought an eBay auction for a set of DVDs with 6500 ROMS. Nice :-)

The disks arrived yesterday and I spun disk 1 for the first time today without issues - I'll make the assumption the rest are OK and get round to playing them when I have some time.

INTERFACE CONTROLLER

If you scan back through the history of this blog, you'll see the fun I had hacking a keyboard to serve as an interface controller. I thoroughly enjoyed that experience, not least because I discovered a lot more about how they all work, but I suppose I get a kick out of that kind of stuff. Sad. I know.

I did occasionally experience a problem with my homebrew controller that I've spotted in a couple of google searches, that there's a limit to the amount of simultaneous keypresses on a standard keyboard controller - I think it's 6. I could have built 2, or I'm sure USB doesn't suffer, or 2 USBs. UPDATE: more searching reveals this is a hardware issue with almost all keyboards.

But, I've decided to buy a proper interface controller, so I've plumped for the I-PAC VE controller from Ultimarc. I looked at these carefully last time round, and back then couldn't justify the 30 quid for the little clever box, when I could crack open a keyboard and build my own for the cost of a bit of wire and a strip of block connectors.

Ultimarc have several versions of these gizmos - I've picked this one because I only need 2 players - I did think about 4, but know full well it'll never be used enough to justify it. The VE version has a couple of minor limitations over the standard version, buy I don't need them, plus it currently has a free shipping offer, which makes all the difference in price.

It's on order, and could be the best part of 3 weeks before it gets here. Watch this space.

BUTTONS

Back in Blighty, we have Gremlin Solutions, who I purchased my sticks and buttons from last time. They're not cheap (about 35 quid for my needs) so i've got my eye on an eBay auction of someone who, just like me the first time, bought the kit and never even unpacked it. I eBayed my parts last time for a pittance, so I'm hoping the Karma fairy pays me a visit and let's me win this auction for a reasonable outlay.

Cost so far = £35
Rom DVDs - £5
Interface Controller - £30

Friday, 18 January 2008

Keyboard Hacking!

As mentioned previously, I want to build my own keyboard interface. I think I'm a fairly bright guy, so I should be able to figure out how a keyboard works and how to hack (the old version of the word, as in "opening something up, figuring out how it works, and possibly modifying it to do something different/better") one, right?

This ended up being not as difficult as I thought it might be. A warning for the faint-hearted though - the pictures in the blog show that the final product is by no means pretty - I'm sure with funds, time, effort the resultant object could be significantly prettier, but that isn't a priority for me - if it is for you, check out the I-PAC from Ultimarc.

I've used my own terminology in the process that I know is wrong, but it makes sense to me, and maybe it'll make sense to you.

The process:
1. get an old/unused keyboard and open in up
I used an unused PS2 keyboard - I think this process would work fine for USB but I've never opened a USB keyboard so I'm not sure.

2. de-construct the keyboard paying careful attention to what goes where

First Open the Keyboard
In the top right hand corner (looking at the "opened" keyboard the way you would use it, if it were closed) is the brains circuit board - notice the little metallic "tabs" in a line across the bottom - these connect to the "nervous system"

3. seperate the "brains" from the "nervous system"
The nervous system is the term I use to describe the two thin, plastic sheets with circuits drawn on them - we'll call these the "membranes". Membrane Package

The two sheets are stamped "upper" Upper Membrane and "lower"Lower Membrane - the upper sheet connects to the "brain" by contact with 8 of the 26 metallic tabs Upper Membrane - Contacts, the lower sheet has contacts that rest on metallic tabs 9 through 26 Lower Membrane - Contacts - there is a layer in between to separate the upper from the lower with holes under each of the keys on the keyboard Membranes Exploded!, effectively masking out the tracks except for the holes where the upper track can be pushed down to make contact with the lower track.

EUREKA!

It's at this point that I realise for the first time in my life how a keyboard works (call me naive if you like, but I've never had need to know before)

When you press a key, the upper track and lower track connect. Let's take my RETURN key - on the upper layer, if I trace all the way back to the contact points, the upper track for the RETURN key connects to the "brain" at tab 4, and the lower track connects at tab 14. Thus, when I press RETURN, connections 4 and 14 are joined - this is read by the brain and the "RETURN key signal" is sent by the keyboard's "brain" to the PC.

4. figure out which "nerve combination" sends what keypress to the PC
I have good eyesight (I don't wear glasses) and was always good at the "first out which string is connected to the balloon" drawings in kids books. This skill, I hadn't realised until now, is a critical life skill if you want to trace keyboard "nerves" back to the brain.

I set the wife up with a bottle of Merlot and a "chick flick" and I sat next to her on the sofa for 2 hours, with the keyboard nervous system on one knee, and an A4 pad on the other, and traced the combinations for each and every key on my board. I started out with the intention of tracing only the keys I needed for 2 players worth, and some interface controls, but at some it either became easier to do them all, or my notorious OCD kicked in.

I found the best method to do this was to draw the keyboard keys onto each "membrane", then process them a layer at a time. I took the upper layer, started with connection tab 1, then traced tab one writing down every key on the tab 1 path. When finished, I started with tab 2, and so on until the top layer was finished at tab 8.

I repeated this for the lower layer, which started at tab 9 through to 26.

5. map out all the "nerve combinations" (or just the ones you need)
At this point, I have 2 sheets of A4 - one with upper layer listings Tracing - Keyboard Contact Pairings, and one with lower Tracing Summary Page 2. I took a third sheet of A4, wrote out all the keys in some order that made sense to me (left to right, top to bottom) then created two columns - I went through the upper layer listings jotting the tab number into the first column for each key, then the lower layer in the second column. I now have a sheet that tells me every nerve combination for every key on my keyboard Tracing Summary Page 1. I can now dispose of the membranes (actually I mounted them on the wall near my PC as some form of trophy, testifying to the effort required to trace these combinations)

5.5 the big test
Full of excitement, I grab a paper-clip, stretch it out, plug the remaining "brain" into my laptop, and hesitantly try connecting "tabs" together to send key presses to the computer. The first one works exactly as I thought it would, and I could not contain a small "woo-hoo!" 5 minutes later and I've spelled my name in a text editor using my paper-clip - I feel like I've just built a rocket ship!

6. replace the "nerves" with screw connector blocks
Now this is one of those points in this process where I'll point out things I would do differently second time around - i strip both ends from a series of 26, 6 inch "bell wire" (anything fairly small diameter, up to 1mm per wire) and start to solder the wires onto the metallic tabs.

DO THIS DIFFERENTLY - the wires liked to move around a lot as they were only resting on top of the tabs as I soldered. I have a 1mm drill bit and a small, rotary drill tool used for engraving, etc. (like a Dremel) and I would have drilled little holes through each of the tabs, to make soldering the wires a lot(!) easier.

I used a hot glue gun and blurbed all over the connections to make sure they stayed in place and as insulation - seemed like a good idea at the time, but not pretty to look atHot Glue Blub.

DO THIS DIFFERENTLY - the PS2 wire into the "brain" was very secure whilst in the keyboard housing, but very fragile now out of the housing - use some insulation tape or hot glue to prevent accidentally twisting or pulling this loose (like I did, and had to trim and re-solder these wires back into placeFragile PS2 Connection.

At the other end of the 26 wires, screw them into screw-block connectors and you have your I-PAC equivalent board, ready to go (looks nowhere near as nice as the I-PAC, but YOU built it, and that's got to count for something?)Dodgy Wiring 1

I mounted mine on a firm piece or corrugated card (again, liberal use of the glue gun) and trimmed - isn't she a beauty?Controller Mounted on Cardboard!

How to control this beast!

When you first start using MAME on a PC, you'll be using a keyboard, possibly a mouse, joystick, gamepad, etc. - what you are unlikely to be using at the start, is an arcade control console. One of the most time consuming processes (if you build from scratch like me) in this arcade machine build is figuring out how to build and connect an arcade-machine-type-control-console to a regular PC in order to have something more authentic to play your games with.

It might be worth pointing out at this point, that this is my second (maybe third) attempt at building this arcade machine contraption. My first serious attempt involved the purchasing of higher specification components when I had a lot more disposable cash than I have today.

The first time around, I purchased an I-PAC interface board from Ultimarc - if you click the links you'll see that this is a very neat looking "screw-plugs to PS/2 or USB connection" board. The purpose of this board is so that you can connect two wires to anything (a switch or button for example) and have that send a keystroke along your normal keyboard connection - very swish - straightforward, no mess, a sensible approach to take. When my first attempt was aborted for a number of reasons (mostly due to the birth of my children and my severe reduction in available time and money) this particular item went for a song on eBay - lucky buyer!

This time around I don't have the money (and I would likely cry) to buy another. "So", me thinks, "I can build one of those monkeys, no problem at all!" thus begins my keyboard hack.