Tuesday, 1 July 2008

Building Custom Controls

Considering building some controls for your PC but not ready to spend ten years and $230,000 to build a 747 simulator in the garage? There are some experts out there like Mikes Flight Deck and the guys at MyCockpit.org. There is also a whole lot of people building custom controls and gauges for car racing sims. You can even buy ship and train controls or make your own arcade controller.

You can build very simple devices like pedals using just the gameport interface of your PC. Like these dodgey rudder pedals I made. To use additional switches and inputs you need something more than the gameport.

To interface your controls with your PC you are going to need a controller. The cheapest is to pull apart a keyboard and locate the controller that will have row and columns using a matrix (more on button matrices below).


Keyboard showing controller and button matrix. The black squares connected to the wires are the row and column matrices.


The following diagram demonstrates the functioning of a button matrix. When a button is depressed a circuit closes for a particular row and column combination. To prevent "phantom" key presses where keys you aren't intending to press are pressed diodes (the triangular & line symbol) are used. Keyboards don't use diodes because they are not designed to have multiple keys pressed simultaneously. If you plan to use a keyboard controller for a custom controller it does become a problem.



You'd think having USB and lots of buttons keyboards would be cheap and easy. But keyboard controllers are a major pain, because they appear to your PC as, well, a keyboard. This makes them extremely fiddly because you have to laboriously determine which row/column combination generates which key and then ensure you are wiring your switches to the right row/column combination. Gets even more complicated if you have to simulate two keys like CONTROL + M. Take a look at the top image of the keyboard, tracing keys back to the row/column inputs isn't easy. Alternatively you can randomly connect up the controller to your switches and then remap your keys in your simulation to suit the keypresses your switches end up generating. Remapping within the simulation isn't a good solution because you have to remember this remap as you may have to still use the keyboard if say a switch is in the wrong position and you can't move the switch but you still want to send the command.

One option might be to use Petr Medek's very clever HID Macros utility that allows you to remap the keys on a particular USB keyboard if you have multiple keyboards plugged into your computer. That may save you the hassle of working out the key matrix and just remapping the keys. Keyboards however don't have any axes for rotary or movement inputs like pedals, flaps, rudder, trim or throttle inputs and really aren't designed to have a lot of keys depressed at once.

The biggest problem with a keyboard interface is that they are designed for momentary switches (switches that you press and release) and not toggle switches. If you are using a toggle switch, when you turn the switch "on" the keyboard keeps repeating the keystroke. The only way around that is adding complexity with circuitry to eliminate the continued keypresses or pretty complicated reengineering of the toggle switch. There is some information on keyboard hacking for controllers at the 777 Project.

The next option is to pull apart a controller like a gamepad or joystick. This allows your controls to appear to Windows as a game controller allowing you to assign commands to the inputs. However the number of buttons on something like a gamepad or old joystick may become a limiting factor. You can use free software like SVMapper to only generate one keypress/button press with toggle switches and game controllers. SVMapper is a free utility found on the Sokhoi forums that allows you to map keys to game controller inputs, it can also handle toggle switches including mapping keys to the release of the toggle switch.

The next option is to make a USB controller from plans on the Internet. There are designs like the MJoy16. The original mindaugas.com site for the Mjoy16 is now offline, but the content is available from Webarchive.org. I gave this a go but could never get the thing to work, but was probably my fault. There there are several versions of this board (including versions not on the original website) some that don't work and several versions of the firmware. I've also read it can be fussy about the USB it is plugged into. But I probably cooked a component with my clumsy soldering. You can also buy DIY kits for Flight Simulator with components like the Master Card Kits from OpenCockpits or the FSBus project and Pic Home Cockpit Controller. Or you could completely custom build a PIC or AVR solution.

If you don't want to build, you can buy a USB controller and there is a LOT to choose from. Choosing the boards basically comes down to how much you want to spend, what you need to do (in terms of number of switches and axes you need) and whether you want to integrate gauges and light.

For a basic button and analogue inputs (for dials, pedals, throttles etc) Leo Bodnar has a couple of very inexpensive and feature rich boards including boards that support load cells. Load cells are force sensitive devices that allow you to push down on a pedal and have that force translate into throttle or braking without the pedal having to move. Load cells are popular with people building car racing controls. Leo also has a new board that allows direct cabling into the board and does not require any diodes:




I have one of his earlier boards that use a matrix:



There are others like the EPIC and Hagstrom boards, but these are more expensive than Leo's board and aren't as feature rich or easy to implement as the slightly more expensive Beta Innovations boards. Beta Innovations provides software called Falcon 4 Interface Manager that supports the Falcon 4 Shared Memory allowing lights and gauges to be driven. It is the easiest and best interface solution for Falcon 4. Beta Innovations has similar software called RSim for car racing sims including Rfactor, LFS and GTR allowing you to have speedometers and tachometers. Recently the Beta Innovations Plasma MM2 is price competitive with the Leo Bodnar board with a similar feature set.

If money is no object you can buy complete setups from places including:

FlightDeck Solutions
Fly Engravity
Cockpit Sonic
Hisapanels

Labels:

1 Comments:

Blogger Select Materials said...

Is this interface still available . I heard that it was now out of production. I am building a 737
aicraft throttle and was banking on using something like this card to do the job.

28 October 2009 4:14 AM  

Post a Comment

<< Home