Creating Custom Joysticks with the AnalogReader
The Endurance R/C AnalogReader can be used to create custom PC based sensors but it can also be used to create custom joysticks. The AnalogReader will appear to Windows as a standard Joystick or gamepad type device and is compatible with the Microsoft DirectX SDK and any DirectInput compatible software. This means is that you can design a custom joystick or control device for games, flight simulators, or anything that can already take advantage of a joystick.
Creating custom joysticks can be useful for certain situations where a normal joystick purchased in a store cannot be used or used effectively. In this tutorial I will go through the steps necessary to create a custom input device for a robot arm. This type of device is most commonly referred to as a telemetry suit and is often used by animatronics technicians or puppeteers in movies.
To begin creating a custom joystick, first decide how many degrees of freedom you need. A simple 2 axis joystick would have 2 degrees of freedom(x and y axis). For this tutorial I am using a robot arm with 5 degrees of freedom. Since I want the arm to match the movement of my custom joystick exactly I will need 5 degrees of freedom for each of the parts of the arm (base, shoulder, elbow, wrist, and gripper). The AnalogReader can read up to 8 inputs from any +5V type sensor. In the case of a joystick, potentiometers will be needed.
If you are not familiar with a potentiometer you may have used them hundreds of times but just didn’t know it. Potentiometers, or pots for short, can be found on many different household devices, like a volume knob on a stereo for example. A potentiometer is a variable resistor. It works by taking in a certain voltage and then outputting a voltage proportionate to the position of the knob. For example, turn the knob all the way to the right and the voltage goes to 0V, turn it all the way left and the voltage goes to 5V. Pot’s will have a resistance rating in OHMs associated with them. This is the maximum amount of resistance the pot will have if turned to its max setting. A pot wired up and ready to be used can be found here: http://www.endurance-rc.com/accessories.html#pot If you want to avoid soldering this pot will get you up and running quickly. This is a nice pot for this type of project due to its large size and durability.

Wired 10K OHM Pot
Once you decide on how many degrees of freedom you need you can begin creating your joystick. A joystick and be made from many different materials and you should use whatever you feel comfortable using, whether it’s wood, aluminum, plastic, or steel. For this tutorial I used aluminum strips found at my local hardware store. I chose aluminum strips because they are easy to drill and bend and can be used to create almost any form I needed. To create accurate movements with the input arm the parts were designed to match the dimensions of the robot arm exactly to create a 1 to 1 movement effect.

Close up of the main joints in the control arm
Once I had my basic shape designed I began cutting and bending the aluminum strips to the shapes needed. In total I had about 8 pieces but your project will probably vary. After all the shapes were cut and bent I began drilling holes to accommodate the potentiometers. For this tutorial I used the large 10K wired potentiometers pictured above.

The custom control arm with AnalogReader
The potentiometers were attached to the aluminum parts by drilling a hole on one aluminum piece, placing the potentiometer through the hole and securing it with the supplied nut. The rotary end of the pot is a little more difficult to attach. You may have already noticed from the picture of the wired pot above that there is no way to attach the second aluminum piece without modifications. The solution I came up with was to drill a hole in the rotary shaft of the pot, tap it to create threads, and then attach the other end with a screw. This solution required no custom machining and was simple to do however this solution puts a fair amount of stress on the pot and may not be best for a solution where a lot of stress will be put on the joystick. For this application attaching the aluminum pieces directly to the pots worked fine but you may need to come up with an alternate solution for your particular project.
Add any necessary parts to the input device to make the joystick comfortable. Once your arm is assembled you may decide that there is something you don’t like about how it operates. In my case I first designed the gripper control as just a pot on the end of the radius/ulna section. This method worked but I found it very difficult to use and the point of this was to make the robot arm control natural. After playing around a bit, and a lot of trial and error, I finally found a configuration that worked and allowed me to operate the gripper with the opening and closing of my fingers. A piece of ‘C’ shaped aluminum provides a place for my thumb allowing me to keep a constant grip on the input arm. This allowed me to naturally point the arm in any direction just with the movement of my hand. At this stage I really didn’t have a clear Idea of how to create my gripper control in the way I wanted so from here on out it was experimentation that led me to the working solution you see below.

Gripper control
Like I said, designing a custom joystick like this is a lot of trial and error. The gripper arm I created seemed to slip off my finger a lot and I found it difficult to make it comfortable while staying on my hand. I solved this by inserting a few short pieces of R/C model fuel tubing on the ends. This was a nice and simple solution to keep my index finger in place.
Using the AnalogReader means that there is no programming involved to create your own joystick. Sample PC code is available so you could do programming if you wanted to but none was needed for this application. Once the AnalogReader is connected to a PC you will notice the AnalogReader's detection. No drivers are needed but some setup may be required. To dial in the joystick go to the control panel and then into the game controller properties. Configure the joystick as needed.

Windows configuration settings for the AnalogReader
Once the joystick assembled and functional you can now begin programming or setting up your software. For the sake of this tutorial I used the ServoCommander software. ServoCommander is software designed to take input from devices like joysticks or other input devices and uses these to control a servo controller or PCTx. This software allowed for easy setup and I was able to get the robot arm moving with the control arm in a matter of minutes. With ServoCommander I was easily able to scale and invert any axis as needed which the shoulder portion of my arm and wrist required. Since ServoCommander is able to see windows joysticks by default and nothing extra was required for it to see the custom input arm joystick.
The robot arm being controlled is a custom design using six Hitec 645MG servos. Some of the parts found on the arm were recycled from left over PT-2 pan and tilt kits and is made from the same ABS sheet. At the time of writing this I didn’t have a base designed for the arm yet so it has been temporarily mounted on an RV-1 rover chassis. The servos are being controlled with a 25 Servo Controller but could just as easily be made wireless with a PCTx and R/C transmitter. Everything is tied together with an off screen PC which runs the ServoCommander software.

Robot arm mounted on the RV-1
You can find all the parts necessary to re-create this tutorial at www.endurance-robotics.com. You will need:
- Any R/C servo based robot arm and servos (Lynxmotion, CrustCrawler, custom design)
- Battery to power the servos
- Endurance R/C AnalogReader
- Endurance R/C 25 Servo Controller or PCTx*
- ServoCommander or custom controller software*
- Windows PC
- Your own joystick design or anything that you think would work for your application
* ServoCommander, 25 Servo Controller, or the PCTx are not required but programming will be required.