Exergaming Emulation IV: Computer Athlete (DOS)
129 Views, 2 Favorites, 0 Comments
Exergaming Emulation IV: Computer Athlete (DOS)
This is the fourth installment in my series on emulating old exergaming systems on newish hardware.
Computer Athlete was a patented system by Robert Caruso and others that connected an exercise machine to minigames running on an IBM PC compatible computer in the late 90s. The minigames are walking as a robot on some planet, running, rowing, skiing and biking. It may not be as much fun as Wii Fit, but it is a lot fun than just going on an exercise machine.
The original hardware had two hand controllers that you attached to the exercise machine, each with an action button and a reset button (I think you had to press both reset buttons together to get the reset action), a hookup to what was probably an optical sensor connected to the exercise machine, and on the PC side connected to the serial port (but was actually a four-bit parallel interface using the control lines in the modem status register).
My emulated setup uses dosbox for emulation and an ESP32-based Bluetooth controller that connects to the exercise machine, with 3D printed hand controllers, a box with a reset button and a connection to the exercise machine's own rotation sensor. Pleasantly, Computer Athlete allowed using the joystick game port, and so the ESP32 (using Arduino) emulates a gamepad which dosbox automatically picked up by default.
The Computer Athlete software is available on archive.org and you can also buy new in box original kits on ebay still (presumably they come with a disc you can copy files from). The archive.org page comes with a review from Robert Caruso who doesn't sound unhappy with its availability (but he may not own the copyright). My ESP32 Arduino code is here.
My focus in this Instructable is on the hardware. I assume you know how to run DOS games under dosbox and that you know how to download firmware from Arduino to an ESP32.
If you want to try out the software before deciding if building the hardware is worthwhile, you can install the software in dosbox and control it with the keyboard:
- 4: left green
- 6: right blue
- 8: left + right together
- 5: movement sensor
- ESC: red reset
Note: I just saw that Robert Caruso has an iPhone version of Computer Athlete called "ExerFit" that cleverly uses a BLE-based accelerometer tile you attach to a shoe.
Supplies
- ESP-32
- three tact buttons
- 3D printer
- soldering iron
- optional: laser cutter for acrylic project box
Connect to Exercise Machine's Movement Sensor
You need to tap into your exercise machine's movement sensor. I long ago did this for our elliptical and recumbent bike machines, and installed barrel jacks so I could hook things up to them. Instructions are in step 1 here. Note that if your machine uses more than about 3.3V, you may need to implement some sort of step-down for the ESP32's safety (though some people on the web say that the ESP32 does work with 5V inputs). Both of my machines have active low lines on their rotation sensors. If yours is active high, change
to
in my computerathlete.ino file.
You might also consider adding a USB port to your exercise machine for powering the ESP32.
Hand Controllers: Buttons
The 3D printable files are all on Thingiverse, with OpenSCAD source. Ideally one might use some small, low profile commercial arcade buttons, but I just 3D printed my own.
So, first print two button sets. Ideally, one would be green (left) and the other would be blue (right), to match the text in the Computer Athlete software. The buttons assemble from four pieces: a well, a plunger, a crown and a standard 6mm tactile button.
- First, check that the plunger, well and crown fit together as in the diagram.
- If the plunger doesn't move smoothly, do some sanding.
- Remove plunger from well.
- Straighten the legs of the tactile button with needlenose pliers.
- Press the tactile button into the bottom of the well, using needlenose pliers. This is difficult. I had to use a file to clean up the depression to make it fit well.
- If you do it right, the button will be neatly and securely in place, and the legs will slightly protrude from the bottom.
- Assemble the button. Make sure it clicks well.
- Solder shortish wires (about 50mm / 2inches) to the tips of two legs at diagonal corners. This is hard because of how little the legs stick out.
- Because the connection won't be very secure, put some glue over them (e.g., hot glue or Shoe Goo).
Hand Controllers: Assemble
- Solder longer cables to the shorter wires on the arcade buttons. The cables should be able to withstanding repeated bending (especially if the controllers are mounted on moving arms, such as in an elliptical) and be long enough to reach from the hand controllers to the control box. Secure the connections with heat shrink tubing.
- Print hand controller bodies. Either use the version with built-in supports or else carefully set your slicer support settings to make sure that there are no supports inside the rectangular slits for attachment straps.
- Insert buttons. They should fit snugly and not need glue.
- Fit the cables into the channels at the bottom of the hand controllers and glue them down.
Firmware
Download my Arduino sketch. Change the LED pin number to match your board if necessary (mine was GPIO 2).
Make sure you have the esspressif esp32 package in Boards Manager.
In Library Manager, install the ESP32-BLE-Gamepad library and NimBLE-Arduino 2.1.2.
Upload the sketch to your ESP32 board.
As soon as it's powered up, you should be able to pair it with your computer like any BLE gamepad. This is a good time to test pairing.
Project Box
First, 3D print the PCB holder for your ESP32. If your board dimensions are different from mine, you will need to load the file into OpenSCAD. The holder has long screw columns. The ESP32 board's component side (including the LEDs) goes on the shorter column side.
I recommend printing the box out of transparent filament so you can see the LEDs for troubleshooting, or else laser cutting out of clear acrylic. I laser cut mine, and glued all the sides except the top lid with superglue.
Connections
Straighten the third tact button's legs. This will be the game's reset button. Solder wires to the legs at the two diagonally opposed corners. Make sure the wires are thin enough to fit through the holes in the box's top. Pull the wires through the holes in the box's top and press the tact button in place. If you need, you can put a drop of glue, but I didn't need to.
Solder:
- Left controller to ESP32's 3.3V and pin 32
- Right controller to ESP32's 3.3V and pin 33
- Reset tact button to ESP32's 3.3V and pin 14
- ESP32 ground to exercise machine connector's ground (I used a barrel connector)
- ESP32 pin 13 to exercise machine rotation detector
Assemble
- Slide ESP32 into its holder.
- Put holder in box, long side of columns down, ESP32 LED up.
- Attach with small screws to bottom.
- Put lid on top, with cables for the hand controllers and exercise machine sticking out.
- Put some sort of strain relief on the cables. I wound a rubber band around them.
- Screw on lid.
- Put hook and loop straps (e.g., cable straps) or rubber bands through the holes in the hand controllers for attaching to exercise machine handles.
You may consider putting a hook and loop fastener on the bottom of the control box and on the exercise machine.
Setup and Testing
Connect the controller to the exercise machine and make sure it's paired with your computer. Now test it, e.g., by running joy.cpl on Windows or with evtest on Linux. The two hand controller buttons should move the virtual joystick, and the reset button and the exercise machine's rotation sensor should register as buttons 2 and 1, respectively. If this doesn't work, check your connections and pairing.
Put your Computer Athlete executable in some folder, and start dosbox pointing to that folder (e.g., put it in ATHLETE and start dosbox ATHLETE). Plug your controller into the exercise machine. Start Computer Athlete from the DOS commandline by typing
You should get a CSA title screen and then a hardware installation test screen. Press ENTER. Then you should get to the hardware installation test screen. Follow the instructions: press the buttons for both hand controllers, use the exercise machine to get the speed display to move, and press the reset button to reset.
For troubleshooting, note that you can also control Computer Athlete via the keyboard, as mentioned in the intro.
Now you can select the minigame and play. Make sure that the in-game clock runs at the correct speed. If it's not, tweak your dosbox settings.
There is one tricky thing. Looking at this video, it looks like a lot of the setups of the original device would involve legs or other body parts interrupting the signal beam twice per rotational cycle. To emulate this, given that my exercise machines have only one signal per rotation, my Arduino sketch generates a second signal half a cycle (based on previous cycle data) later. If you feel this makes you move too fast in the game, you can switch to one signal per rotation mode. To switch between one-signal and two-signal modes, just hold the reset button when starting up the ESP32. On startup, the device does one or two or two blinks of the LED to indicate which mode it's in. Additionally, the device blinks the LED (which normally indicates connection status) each time it sends a rotation signal, so you can check that the system is working.
Play!
You can now play to your heart's content. Note that the minigame you choose doesn't have to match your exercise machine. E.g., you can row on an exercise bike.
Gameplay: Your score goes positive from going forward, for passing other racers (4X bonus if you press both buttons at the same time while passing), and for gaining bonuses on the side of the road (staying on striped regions or going over stars and other bonus items). You need to stay on the road or its edges, and avoid on-coming traffic. There is no harm from going through other racers moving in the same direction as you.