RPM: an open-source Rotation Platform for open-and closed-loop vestibular stimulation in head-fixed Mice

Head fixation allows the recording and presentation of controlled stimuli and is used to study neural processes underlying spatial navigation. However, it disrupts the head direction system because of the lack of vestibular stimulation. To overcome this limitation, we developed a novel rotation platform which can be driven by the experimenter (open-loop) or by animal movement (closed-loop). The platform is modular, affordable, easy to build and open source. Additional modules presented here include cameras for monitoring eye movements, visual virtual reality, and a micro-manipulator for positioning various probes for recording or optical interference. We demonstrate the utility of the platform by recording eye movements and showing the robust activation of head-direction cells. This novel experimental apparatus combines the advantages of head fixation and intact vestibular activity in the horizontal plane. The open-loop mode can be used to study e.g., vestibular sensory representation and processing, while the closed-loop mode allows animals to navigate in rotational space, providing a better substrate for 2-D navigation in virtual environments. The full build documentation is maintained at https://ranczlab.github.io/RPM/.


Introduction
Head-fixation of mice proved exceedingly useful in recent years to allow acute electrophysiological and optical recordings in awake, behaving animals (Harvey et al., 2009;Helmchen et al., 2018;Russell et al., 2022).Furthermore, it facilitates camerabased tracking of behaviourally relevant features (e.g.eye movements) and allows for the controlled delivery of sensory stimuli and rewards.On the other hand, head-fixation disables the vestibular system, a key sensory component underlying navigation (Smith et al., 2009), largely limiting experimental environments to one-dimensional corridors (Minderer et al., 2016).Activation of the head-direction (HD) network is particularly needed for spatial navigation (Gibson et al., 2013;Winter et al., 2015) and depends on J o u r n a l P r e -p r o o f information from the horizontal semicircular canals (Valerio and Taube, 2016).Thus the lack of vestibular input evoked by horizontal rotation is a plausible reason for a lower percentage of place cells in head-fixed, virtual environments (Chen et al., 2013;Aghajan et al., 2015).Compared to visual VR environments, using a floating real-world environment improves spatial information rates in hippocampal place cells (Go et al., 2021).While the orientation of an animal in a floating environment was shown to be accurately encoded in the retrosplenial cortex if visual and proprioceptive input was present, a subset of presumed HD cells showed dependence on vestibular input to represent spatial orientation accurately (Sit and Goard, 2023).
Our motivation for developing a novel rotation platform was to control horizontal angular vestibular input in head-fixed mice.Previous approaches were limited to passive rotation (Vélez-Fort et al., 2014) and thus lacked the ability of the animals to control rotation, i.e. navigate.When navigation in rotation space was allowed by fixing the animal's head to a bearing (Chen et al., 2018), there was no option to control the rotation either passively or actively.An elegant alternative approach was used by Voigts et al. (Voigts and Harnett, 2020) where headpost torque was used to read out the animal's intention to rotate its head and fed back through a rotational motor.However, this approach is difficult to combine with visual virtual reality, requires frequent calibration, is not documented in detail and requires significantly more expertise to build.Here we present an open-source rotational platform which can be used to control and interfere with the sensory environment.We provide documentation for building it and two use cases for studying vestibular evoked eye movements and head-direction cell activity during head-fixed, animal-controlled rotation.

Animals and headplate surgery
All animal experiments were prospectively approved by the local ethics panel of the Francis Crick Institute (previously National Institute for Medical Research) and the UK Home Office under the Animals (Scientific Procedures) Act 1986 (PPL: 70/8935).Animals were housed in individually ventilated cages under a 12 hr light/dark cycle.Both male and female mice were used.Surgeries were performed under isoflurane anaesthesia and carprofen analgesia; every effort was made to minimize suffering.Briefly, the head of the animal was fixed using ear-bars and a nose clamp.Local J o u r n a l P r e -p r o o f analgesia over the dorsal surface of the head was provided by lidocaine.The scalp was opened with an incision in the midline and the connective tissue covering the bone was removed with a bone scraper.An aluminium head plate was secured to the dorsal surface of the skull using dental acrylic, and the skin was fixed to it using VetBond.Animals were allowed to recover for at least 5 days before any experiments.

Eyemovement recordings
A virtual drum consisting of gratings with a frequency of 0.16 cycles per degree (cpd) was displayed on 4 monitors (Dell U2412B) around the setup and drifted during the entire recording at 1Hz.The vestibular stimulus was delivered by the rotation platform in clockwise (CW) and counterclockwise (CCW) directions at 40 ° \ s.Pupil images were recorded using an ELP-USBFHD01M web camera at 30 Hz.The pupil outlines were detected as illustrated in Figure 4b using DeepLabCut (Nath et al., 2019).Briefly, 8 points were detected on the edge of the pupil (red circles), onto which an ellipse was fitted (cyan line).The pupil position was defined as the centre of the ellipse (red square).Data were acquired and analysed using custom-written Python scripts.

HD cell recordings
We followed the recording method from Peyrache et al., 2017.Acute recordings were made from the post-subiculum (AP: -4.25 mm; ML: -1 to -2.5 mm; DV 1.25 to 1.75 mm from pia) from 2 adult male mice.The RPM apparatus was placed inside a black plexiglass cylinder of 50 cm diameter containing one salient visual cue (a white A3 page in portrait orientation).The cylinder was illuminated from above.Recordings were made for at least five full bidirectional rotations in passive mode and at least 1, but typically 3-4 full cycles in active rotation.Extracellular recordings were made using a tetrodearranged silicone probe Neuronexus), connected to a digitizing headstage (RHD2132, Intan technologies) via an adaptor (Adpt.A32-Omnetics32, Neuronexus).Voltage signals were filtered (0.1 -7.5 kHz) and digitized at 24414 Hz using an LR10 interface and SynapseLite software (both from Tucker-Davies Technologies, TDT).Data were extracted using the TDT python SDK; spikes were detected and clustered using klusta (Rossant et al., 2016) and further analysed using custom-written Python scripts.Tuning curves were calculated at 1° resolution and smoothed (6° Gaussian).HD cells were defined as in (Peyrache et al., 2015(Peyrache et al., , 2017)).Briefly, a von Mises function was fitted to the tuning curve, and only units with  > 1, peak firing rates > 1 Hz and probability of non-uniform distribution < 0.001 (Rayleigh test) were included.Two-sided, paired Student's t-tests were used for statistical comparison.

Design criteria
We set out to develop a rotation platform capable of open-loop and closed-loop vestibular stimulation for mice which are head-fixed but able to move on an airsupported spherical treadmill.We use the engineering terms open-and closed-loop to represent the source of the rotation command: external (experimenter-driven) or internal (animal movement driven) to the control system, respectively.Principal requirements were: 1. accurate tracking of the movement of mice; 2. control of the platform rotation in open-and closed-loop modes; and 3. compatibility with physiological and behavioural recording modalities.Furthermore, we aimed to develop a modular, low-cost and opensource device.

Implementation
We provide full documentation, including assembly instructions, design choices and characterization of the components and the platform, as well as software requirements and code at https://ranczlab.github.io/RPM/.
In brief, the movement of the spherical treadmill is read out by optical sensors and fed through the rotary joint to connect to a microcontroller (PJRC Teensy3.5).In addition, the microcontroller receives information from a homing sensor and a rotary encoder (Figure 1a).The microcontroller, in turn, controls the platform movement through the motor controller (Figure 1b) and outputs the position of the spherical treadmill and the platform for recording.Other signals recorded on the platform, e.g. from cameras, or signals to the platform to control additional devices, can also be fed through the rotary joint (Figure 1c).Ultimately the device can be configured to run different types of experiments and attach a micro-manipulator for extracellular recordings (Figure 1d).

Characterization and validation of platform in closed-and open-loop
No load performance, minimal incremental motion and backlash The rotary platform's accuracy and repeatability have been evaluated by recording the platform's actual position using an incremental encoder and comparing it to the target position set by the microcontroller.Figure 2a shows an example test of the stage performance without the load of the head-plate holder.The stage was repeatedly (n = 7) sent to two set points (0 and 360°).The final positions were highly accurate (360.06 ± 0.11° and 0.04 ± 0.07°), suggesting little error accumulation (Figure 2a).This data also show that the stepper counter in the microcontroller provides an accurate measure of the platform position.Further characterization was carried out with a typical load condition (i.e.head-plate holder included).
The measured minimum incremental motion (MIM) was 0.1° (Figure 2b).The backlash, in the worst-case scenario corresponding to the offset created by the change in the direction of the MIM tests, has been 0.04°.

Accuracy and repeatability
In order to evaluate the accuracy and repeatability of the rotary platform, a sequence of increments of 45°. in both rotation directions have been performed, collecting 8 position deviations in each direction in a trapezoidal motion profile (Figure 2c).The results show a high directional accuracy (0.37°) and repeatability (0.10°) in experimental load conditions.Figure 2d show the distribution of the absolute average position deviation mapped across the range of angular velocity and acceleration values (20-100 °*s -1 and 200-1200 °*s -2 ).The equations for the calculation of these measures can be found in the methods section.

Closed-loop stability
The closed-loop algorithm drives motor rotation in response to the motion sensed by the optical sensor, i.e., due to the Styrofoam ball rotation actuated by the animal.The system thus has to respond to rapid changes in the target position.We have simulated sudden and unpredictable changes in the input angle as a step function of 90°.The experiment has been performed with the same load conditions as the closed-loop algorithm.Stability has been evaluated by the analysis of the step response for all previously described conditions (20-100 °*s -1 and 200-1200 °*s -2 , Figure 2e).The contour plot has been extracted to be used as a map to avoid regions of inaccuracy and instability.Sometimes even achieving a small error, the stage can overshoot, as shown J o u r n a l P r e -p r o o f in Figure 2e.The regions with more instability correspond to the regions where the average absolute position deviation is higher (Figure 2f).This behaviour usually corresponds to conditions of high speed and not high enough acceleration.These performance measures should be conducted whenever the load or load distribution on the platform is altered.

Add-ons
A ring-shaped instrument platform can be mounted around the sphere to hold several devices, such as an animal head-holder, cameras, and manipulators for electrical recording and optogenetic stimulation.Below we present options for head-plate holders and instruments for manipulating recording probes or optical fibres, as well as for installing cameras and video screens for eye-movement tracking and virtual navigation, respectively.

Head-holder
We designed a head fixation system with three degrees of freedom along three perpendicular translational axes (Figure 3a).The height of the head-plate holder can be adjusted to accommodate mice of different sizes.In addition, two axes can be used to adjust the position of the animal's head in the horizontal plane.This is particularly useful in vestibular experiments to centre the platform rotation axis on the vestibular organ of interest.The head-holding system consists of 3 manual translational stages (Thorlabs Inc.MT1/M) to ensure reliability and repeatability across experiments.The resolution of the system is 10 microns with a range of 13 mm in all directions.The stages are connected using a 3D printed linker, and various head-plate holders can be attached to the vertical stage (e.g. for attaching micro-manipulators and cameras).

Micro-manipulator and probe holders
The head-holder in Figure 3a was designed to attach a manual micro-manipulator (Märzhäuser Wetzlar MM33) and provide a capability for attaching e.g.electrophysiological (Figure 3b) or optical (Figure 3c) probe holders.The device provides fine adjustment (0.1 mm) on the three axes with a finer adjustment (0.01 mm) for the vertical axis and a travel range of 37,20 and 25 mm for the x,y, and z axes, ideal for precise adjustment of the position and depth of various probes.

Cameras
On-platform cameras provide useful capability to image e.g.eye-, face-or body movements.We have implemented a camera system to monitor pupil movements (Figure 3e).The animal's pupil is illuminated by an infrared LED, and the image is J o u r n a l P r e -p r o o f reflected from a hot mirror (Thorlabs Inc.FM02R) with an incidence angle of 45°.Both the mirror and camera position and angle can be adjusted for adequate positioning.An IR-sensitive camera with USB connectivity (ELP-USBFHD01M) was placed behind a long-pass filter (Thorlabs Inc.FEL0750) to record the image of the pupil without contamination from other light sources.
J o u r n a l P r e -p r o o f

Embedded displays and virtual reality
We attached two 8" TFT displays to the rotary platform using Thorlabs RS6P/M posts, 3D printed parts and a laser-cut display frame so that the displays rotate together with the animal(Figure 3d).The displays can be used to display various visual stimuli and allow navigation in a 2D virtual environment.
The VR environment runs in Godot on a Raspberry Pi 4 Model B running Raspbian 10 (Buster).The single board computer was placed on the platform and connected to the screens via micro HDMI cables, while power was provided through the rotary joint.The optical sensor inputs transformed on the microcontroller to calculate the motor displacement were converted into HID commands on the PCB and transmitted to the Raspberry Pi via one of the USB connections of the rotary ring.The environment consisted of a virtual corridor, with regularly placed white cues on the right-hand side wall and terminating with a uniform green wall.The displacement of the ball measured by the optical sensors controlled both the angular displacement of the platform and the navigation within the virtual environment.

Eye-movement recording during open-loop configuration
We carried out pupil recordings to illustrate the utility of the platform for vestibular and visually evoked eye movements.Visual stimuli were provided by 4 screens surrounding the platform, and the pupil position was tracked using an on-platform camera (Figure 4a).The position of the pupil was detected using a deep-learning-based approach (Nath et al., 2019, Figure 4b).Drifting gratings were used to evoke the optokinetic reflex, while platform rotation was used to evoke the vestibulo-ocular reflex simultaneously.Eye movements showed typical nystagmus beating in the direction of the physical rotation (Figure 4c-d).These data demonstrate the utility of the platform for open-loop vestibular stimulation and eye tracking.
J o u r n a l P r e -p r o o f The postsubiculum was chosen as it has been reported to contain head-direction cells in large proportion (Cullen and Taube, 2017).In turn, HD cells are known to depend on intact vestibular activity (Valerio and Taube, 2016) and can be activated by passive rotation as well (Shinder and Taube, 2011).The rotation platform was placed in the middle of a black cylinder containing one salient visual landmark.Animals were familiarised with the apparatus and the environment before the recordings.Example traces of unit (0.3 -5 kHz) and LFP (1 -100 Hz) recordings as well as position, velocity and acceleration, are shown in Figure 5a.There were no discernible artefacts or changes in noise level at the onset of motion or rapid change in direction.We could readily record (HD) cells (n = 7 J o u r n a l P r e -p r o o f cells from 2 animals) from the PoS.We identified HD cells using established criteria (see Peyrache et al., 2017 and methods) during passive rotation with a range of ± 360° (Figure 5b).Next, we allowed animals to actively rotate at least one (but typically 3-4) full rotations.Directional tuning curves between active and passive rotation showed no significant difference in the preferred direction (Figure 5c-d; mean difference -18 ± 25°, n = 7, p = 0.1, paired t-test).Similarly, maximum firing rates between active and passive conditions were not significantly different (Figure 5e; mean firing rate 15.5 ± 5.5 Hz vs 15.7 ± 6.8 Hz, n = 7, p = 0.9, paired t-test).Thus the vestibular platform is suitable for electrophysiological recordings, and HD activity is present during both active (closedloop) and passive (open-loop) rotation.
J o u r n a l P r e -p r o o f

Discussion
There are inherent limitations in angular velocities and acceleration achievable by the rotation platform, depending e.g. on the weight and distribution of the platform assembly.Furthermore, animals of higher weight can also cause oscillation as their posterior part can swivel the ball during a change of direction.This can be counteracted by installing guard walls at the sides of the head holder assembly, keeping the mouse slightly constrained.Average and sustained head motion velocities in natural selfmotion are relatively slow (±150 °*s -1 , Meyer et al., 2018); nevertheless, mice can experience up to 1300 °*s -1 angular velocity (Carriot et al., 2017).The rotation platform and assembly presented here can reliably reach up to 100 °*s -1 angular velocity and 1200 °*s -2 acceleration.This is adequate for most experiments, as published studies typically use up to 80 °*s -1 (Vélez-Fort et al., 2018;Bouvier et al., 2020).Finally, we show that the HD network is robustly activated during self-guided rotation.It is important to note that the HD system also receives proprioceptive and motor efferent signals (Medrea and Cullen, 2013), which may be different on the device presented (especially regarding head-on-body motion).
In summary, we provide an open-source device with build documentation, which can serve as a starting point for researchers interested in performing both closed and openloop vestibular experiments.We also provide various alternatives on how to adapt the experimental setup to achieve different experimental scenarios.

Figure 1 .
Figure 1.RPM: Rotation Platform for Mice (a) High-level I/O, (b) algorithmic implementation, (c) RPM device, 3D model (left) and photograph (right), (d) Top view with VR screens and recording assembly.A -

Figure 2
Figure 2 Rotary stage performance.(a) Rotary encoder and stepper motor signals during full revolution cycles.(b) Minimum incremental motion measurement.(c) A sequence of bi-directional movements to measure accuracy and repeatability.(d) Average absolute position deviation (°) across all angular speed and acceleration conditions tested.(e) Example step responses at two different angular

Figure 3
Figure 3 Platform add-ons.(a) 3D printable head-plate holder modified to attach a micro-manipulator, (b) a micro-manipulator with the extracellular recording probe holder, (c) a micro-manipulator in the

Figure 4
Figure 4 Analysis of vestibulo-visual evoked eye-movements (a) Recording configuration.(b) Example camera image and detection points.(c) Example trace showing pupil movement (y-axis) during clockwise (CW) and counterclockwise (CCW) platform rotation.Scale bar: y: 4 pixels, x: 1 second.Insert: amplitude and interval measures on a single saccade.(d) Distribution of peaks saccade amplitudes vs duration.Average of 16 trials across 4 different miceExtracellular recording in open-and closed-loop configurationNext, we have set out to test the suitability of the vestibular platform for electrophysiological recordings.We recorded extracellular voltage signals with acutely inserted silicone probes.We targeted the postsubiculum (PoS) in awake mice during passive rotation (open-loop, rotation controlled by the experimenter) and active rotation (closed-loop, rotation driven by the movement of the animal).The postsubiculum was chosen as it has been reported to contain head-direction cells in large proportion(Cullen and Taube, 2017).In turn, HD cells are known to depend on intact vestibular activity(Valerio and Taube, 2016) and can be activated by passive rotation as well(Shinder and Taube, 2011).The rotation platform was placed in the middle of a black cylinder containing one salient visual landmark.Animals were familiarised with the apparatus and the environment before the recordings.Example traces of unit (0.3 -5 kHz) and LFP (1 -100 Hz) recordings as well as position, velocity and acceleration, are shown in Figure5a.There were no discernible artefacts or changes in noise level at the onset of motion or rapid change in direction.We could readily record (HD) cells (n = 7

Figure 5
Figure 5 Extracellular recordings during rotation.(a) Example extracellular voltage traces showing multiunit (0.3 -5 kHz) and LFP (1-100 Hz) activity recorded during the start of movement (left) or an abrupt change of direction (right).Note the lack of discernible artefacts.(b) Spike positions from an isolated single unit during passive and active (i.e.animal-driven) rotation.(c) Polar plot of firing rate as a function of direction for the unit in b.Peak firing rates are given.Black: passive rotation.Red: active rotation.(d) Polar plots of firing rate for a further 6 HD tuned units.(e) Bar graph showing preferred head direction (top) and peak firing rate (bottom) between passive (black) and active (red) rotation.