Razer Hydra is a pretty decent 6DOF tracker (position + orientation) for the price, so a natural choice. However, the controllers do not lend themselves very well for tracking props or an HMD due to their size and shape and no different sensor is available from Razer. Some people have attempted to disassemble the controller and remove as much as possible, leaving only the sensing coils (it is a magnetic tracker). The disassembly procedure is well described here: http://www.mtbs3d.com/phpBB/viewtopic.php?f=120&t=14036 (registration required to see the images). However, a small mod is required for this to work properly.
What is inside
The controller contains two boards, one with the 3 sensing coils (about 20 mH each), two AD8656 dual opamps and an ADG794 electronic switch/mux with 4 channels. The smaller board contains all the buttons, the joystick and the trigger potentiometer, along with an LPC1111F microcontroller that senses the buttons and measures the potentiometers for the joystick and trigger. These data are then sent using a serial protocol to the base. The boards are connected by a flat flex cable with 8 wires.
The opamps amplify and buffer the signals from the sensing coils, the switch is controlled both by the base and the microcontroller on the joystick board, allowing to short the inputs of each of the opamps and disable the signal. Only the base seems to be controlling the /EN signal – holding it high (pull-up) keeps the Dx (x = 1-4) outputs floating (high-impedance state). When low, this pin activates the mux and connects the Dx pins to one of the SxA or SxB pins, depending on the state of the IN pin. When IN is low, Dx is connected to the SxA pin, when high, to the SxB pin. The IN pin is controlled by the microcontroller.
The way the opamps are configured through the mux allows the micro to either short the opamp inputs through a 680R resistor (effectively disabling the coils) when IN is high or to allow normal functioning (bypassing the 680R resistor) when IN is low. What I have observed is that the base turns the /EN pin low when the device is opened (e.g. the vrpn_server is started) and the IN pin constantly low – the coil signals are enabled. When the device is closed, the /EN goes high, disabling the mux (but not the coils), effectively disconnecting the MCU from the board and connecting a 680R resistor in series with the inverting inputs of the opamps. The preliminary schematics below shows the circuit, hopefully making it clearer.
I have never seen a transition on the IN line, but the VRPN driver uses very little functionality from the Hydra. Perhaps it is used in some undocumented mode (e.g. the gamepad mode? That one doesn’t use the coils.) or a left-over from the days when the SDK was wireless – maybe the micro was disabling the coils while it was transmitting info to the base, in order to not cause spurious data being received because of the voltages induced by transmission in the sensing coils. Who knows. Any suggestions on this are welcome.
The description above holds for the 3 switches in the mux, the 4th one is used only as a pass-through for one of the opamps because of the way the board is routed – essentially a “wire” jumper.
Detour to magnetic tracking
The following three images are captures from my oscilloscope measuring the signals on the opamp outputs – the amplified coil signals. It is quite obvious how the magnetic tracker works. There are three pulses, each 2ms long, followed by a pause of 2ms again, giving about 125Hz refresh rate. The three pulses correspond to each of the three crossed coils in the base – they are pulsed in series. The receiver coils in the controller receive each of the pulses with different amplitudes, depending on the relative orientation of the receiving and transmitting coils. If their axes are aligned, the corresponding signal is strong. If they are not aligned, the signal is weaker, being weakest when the axes are perpendicular. Changing the distance of the controller from the base changes the amplitude of all three signals in the same way. From this information the DSP in the base can determine the orientation and position of the controller using some complicated math.
Disclaimer: The following hack was tested on my Linux machine with the VRPN driver. It did work (the tracking is working), but I haven’t tested the accuracy of the modified Hydra or any other adverse effects – caveat emptor. This hack could ruin your device and will most certainly void your warranty. Don’t blame me if that happens.
The obvious solution how to make the controller smaller and more amenable to e.g. an HMD installation is to remove the joystick board by disconnecting the flat flex cable. Some people were supposedly successful, however most often the Hydra stops tracking (sends random data). The problem seems to stem from the fact that the base unit will not power up the controller properly, resulting in garbage being sent to the CPU in the base.
One way to do this is to solder a 10k resistor between the positions of the unpopulated diode D24 and the unpopulated R97 resistor. That will make the base power the board properly and the device will work. I strongly suggest putting a strip of insulating tape over the resistor or a drop of hot-melt glue to hold it down against the PCB, in order to avoid snagging it on something or floating around and putting stress on the thin traces. Otherwise the traces could lift off/break and ruin the board.
With this mod I am able to use the controller with the VRPN driver even without the joystick board and everything is working. I haven’t tested it with the official drivers/SDK – I am interested in hearing any success/failure reports if someone decides to try this hack. I am also interested in hearing any hypotheses/info on why is the power to the controller board behaving in such a weird way and what could be the reason for the multiplexer on the board, as it doesn’t seem to be really used for anything.
I have confirmation from Jane Peters from the Iowa State University in the US and from Justin Scaniglia that they have been able to reproduce the mod. However, it seems to work only with VRPN, not the standard Windows SDK.
A very nice music composition/performance project by Byron Mallett (aka @Mystfit) using this hack: