Joysticks - Fun & Games for HMI Designers

11/24/2021 Know-How

When C.B. Mirick had his invention patented as a control system for unmanned aircraft in 1926, he could not have foreseen how it would later be used in numerous fields and applications. Several construction designs are available to choose from when it comes to developing a joystick. An overview.

"Joysticks have quickly become an established feature of control tools in many industrial and medical applications, for trains, ships, agricultural machinery and construction machinery, and also for simulators such as flight simulators. In the entertainment industry, they are used for console and PC gaming as well as radio-controlled aircraft, cars, and ships." Today, joysticks are an integral feature of industrial applications, consumer products and automotive development.

The initial design of a joystick was based on switched contacts, which is considered to be a digital joystick. The simplest design had four contacts and offered 4 bits of information declaring "on" and "off" states, which also made it possible to register diagonal movements.

Analog joysticks measure the direction and angle between the movement and the axes, for which potentiometers or optical or magnetic sensors are used. These are contactless and are therefore not subject to wear and tear.

An optical joystick has two encoder disks, each attached to an axial joint. Each disk consists of slots and plates, with a diode on one side and a photo cell on the other. These are either discrete or connected to a light barrier. When light from the diode passes through the slot, the photo cell converts it into a current. If there is no slot, no current will be present at the photo cell's output. An algorithm in the microcontroller uses the number of current pulses to calculate the position.

In a potentiometer joystick, there is a potentiometer on each of the two rotary joints, one for the x-axis and one for the y-axis. They detect changes in resistance when the joystick is moved and the angle of the rotary joints changes. A microcontroller then outputs the corresponding values.

Revolving Joints (Dual Hall Effect Sensor Construction)

The original mechanical contact joysticks using potentiometers have a disadvantage, namely that friction causes the detection and control performance of the potentiometer to degrade. This disadvantage is overcome by replacing the potentiometers with magnets and contactless Hall effect sensors (Figure 1). This also enhances precision and reliability, and improves the control experience.

The dual Hall effect sensor construction is also very practical-as with a potentiometer, the movement of the joystick handle is read as the rotation of the magnets positioned at the end of the shaft, which is read by the Hall effect sensor. Existing complex mechanical joystick designs only need minimal adjustments if any.

However, there is one problem with this construction because the relationship between the Hall effect sensor output and the actual movement of the joystick exhibits non-linear properties, these need to be converted into linear values using set points.

Gimbal Joint Joystick

Figure 2 illustrates another construction. In such a gimbal joint joystick, there is a rotating permanent magnet under the handle that is pointed towards the Hall effect sensor. The contact between the permanent magnet and the single Hall effect sensor allows the movement of the joystick to be projected to the 2D detection range. As long as the joystick moves within approx. ±30°, the output signal offers good linearity.

The challenge with such a construction is managing the mechanical system. As the mechanical system ages through wear and tear, the sensor-the centerpoint of rotation-shifts without being noticed, and this cannot be compensated by static means.

Universal Joint Joystick

A universal joint mount is a good alternative for solving the problem of declining precision caused by frame friction (Figure 3). The mechanism is not only more robust against friction, but also simplifies the production process and reduces production costs. It also benefits from ease of linearization and a simple mechanical construction. The key improvement in this design is that the joystick handle rotates around a Cardan joint and always points to the center of this joint.

Kits-Using the "Surprise Egg" Approach

To evaluate the various construction options, an equally versatile joystick platform and a flexible Hall effect sensor are required. Many suppliers offer joystick kits to provide potential buyers with a sensor that they can use to test in their application, providing data for simulations.

The "Joystick Evaluation Platform" from TDK-Micronas (Figure 4) is strongly reminiscent of the "surprise egg" approach-only without the chocolate. The various components can be put together much like a toy in a surprise egg to allow for any of the three mechanical joystick geometries.

In addition to the TDK-Micronas HAL 3900 sensors, the kit also contains PCBs, 3D-printed mechanisms, magnets, accessories and detailed instructions. Additional sensor PCBs enable direct integration of the sensors into an application.

The HAL 3900 not only enables precise detection of magnetic fields but also synchronous measurement of all three magnetic field components BX, BY and BZ at a single point. This allows the sensor to detect the direction of the magnetic field. This unique concept also allows six z-Hall plates and two Hall pixel cells to be fitted to provide 2D stray field compensation. This makes the sensor suitable for a variety of measurement tasks, and for any sensor/magnet geometry that previously required different sensors. Because the HAL 3900 sensor array is highly flexible, design engineers can simply select the best operating mode for any given measurement task. Depending on the measurement mode selected, it is possible for example to output raw temperature-adjusted values for BX, BY, BZ or up to two calculated angles.

To reduce non-linearity errors in the overall system or even in order to generate random output behavior, the sensor offers "fixed set points" at up to 33° with one activated channel, or fixed set points at up to 17° per channel if two channels are activated. If variable set points are required, there are up to 18 set point ranges when using one channel or up to eight ranges per channel when using two channels.

As an SEooC (Safety Element Out of Context) according to ISO 26262, the HAL 3900 is qualified for safety-critical (ASIL) applications. Stray field compensation (in accordance with ISO 11452-8) is already integrated into some measurement modes and is done automatically. An SPI interface handles communication with the sensor.

The digital HAL 39xy does not require external signal processing or complicated compensation algorithms. The measurement modes with three or six z Hall plates and the revolving joint construction can be used to create a stray field-compensated joystick.

The sensor data of the joystick kit can be read using an Arduino or the TDK-Micronas SPI Programmer. Using the downloadable "Joystick Evaluation Platform" software (Figure 6), users have a tool at their disposal that lets them import key RAM registers from the sensor's signal paths, visualize measurements for specific joysticks, and move a rendered joystick to be exported for further analysis as a .csv file.

To achieve the best possible joystick performance, the LabView Programming Environment of the HAL 3900 combined with the TDK-Micronas SPI Programmer allows for sensor calibration and adjustment of the required measurement modes.

For Arduino platforms, TDK-Micronas provides downloadable source code for reading the required HAL 3900 registers. For quick evaluation of the new products, for example, various ARM Cortex M0 boards with Arduino-compatible connectors are suitable.


Find components at

Subscribe to our newsletter and stay updated.

Figure 1: Dual Hall Effect Sensor Construction