Hardware Design for an Electro-Mechanical Bicycle Simulator in an Immersive Virtual Reality Environment

- Roughly 50,000 people are injured in bicycle collisions with motor vehicles each year. The Hank Bicycle Simulator provides a virtual environment to study and reduce this risk by safely investigating the interaction of bicycle riders and traffic, particularly for bicyclists crossing streets. The bicycle simulator design focuses on the bicycle and rider inertia, the predominant dynamic element for riders moving from a stopped position. The Hank Bicycle Simulator’s flywheel provides instantaneous inertial response while a servomotor provides simulated wind resistance to pedaling. This work describes the simulator design and a validation experiment that compares the simulator performance to theoretical predictions. The Hank Bicycle Simulator achieved initial acceleration with less than 0.20% error at realistic rider weights. The observed terminal velocity achieved less than 3.75%, with smaller errors for heavier riders. This allowed the rider to cross a street with about a 60 ms time difference between the simulator and a real-life rider. The Hank Bicycle Simulator was also validated through various physical experiments measuring the system inertia, the time delay of the electrical components, and overall system performance. Such careful system validation for a mechanical feedback system is relatively rare in simulation research and is unique among previous reports of bicycle simulators.


INTRODUCTION
Of the 50,000 people injured in bicycle collisions with motor vehicles each year, approximately 6,000 involve children younger than 14. Fifty such collisions each year result in child fatalities (National Center for Statistics and Analysis, 2014). Virtual reality provides a unique opportunity to safely investigate the interaction between children and traffic. The Hank Bicycle Simulator has been instrumental in this type of investigation for over a decade and has provided unique insights into the perceptions and decision-making processes of both children and adults who encounter traffic on a bicycle (Grechkin et al., 2013;Plumert et al., 2004;Plumert et al., 2007). The Hank Bicycle Simulator includes an instrumented bicycle fixed at the center of three projection screens and a projection floor (Babu et al., 2009). The movement of the bicycle is synchronized with graphics so that the rider is presented with a three-dimensional view consistent with the experience of riding through a town or countryside. A motor connected through the bicycle's drivetrain provides resistance to pedaling consistent with the resistance perceived during normal bicycling.

Figure 1. Hank Bicycle Simulator fixed at the center of the virtual reality environment.
Several bicycle simulators have been designed, primarily for exercise purposes. The KAIST simulator (Kwon et al., 2001;Kwon et al., 2002) completely immerses a rider in a bicycle race with other riders on similar bicycles and features one of the more sophisticated control systems. The bicycle is mounted on a six-degree-of-freedom Stewart platform, with motions emphasizing the vertical movement (heave), side-to-side (roll), and front-to-rear (pitch) movements. A magneto-rheological fluid brake provides pedal resistance while an AC servomotor simulates acceleration due to gravity as the rider goes down a slope. The rider wears a head-mounted display and graphics are synchronized with a second bicycle over a network. Tang et al. (2007) designed a simulator to enable riders to exercise in a confined space. Their bicycle rests on a platform with spring supports on the bottom, permitting riders to slightly tilt as they pedal and turn. A damper is attached to the rear wheel to provide resistance from wind and road friction. An AC servomotor produces decelerating or accelerating torque based on the slope of the rider's environment. Kikuchi et al. (2012) designed their simulator to provide people with cognitive and physical impairments an opportunity for safe exercise without the need to worry about other riders or traffic. Pedaling resistance is provided from a custom-designed magneto-rheological fluid brake. The magneto-rheological fluid brake was equipped with an enhanced braking torque by increasing the magnetic field's distribution along the area of the cylindrical surface. This design enhancement enables the movements of the bicycle to be restricted using a single movement system, rather than the two different systems used in most other simulators. The Kikuchi et al. study (2012) reported the pedaling torques of riders traveling virtually on different slopes but does not compare this to a predicated bicycle response or to real-world data.
Several other bicycle simulators have been designed primarily for research and education. Miyanoue et al. (2015) designed a bicycle simulator for traffic safety education and safety analysis of a wide variety of traffic situations. The rear wheel stand enables the rider to lean slightly to either side but does not provide the natural lean a rider feels while turning. Another simulator designed by He et al. (2005) features a complex, bicycle dynamics model. The model has two submodels: the stability sub-model, and the vibration sub-model. The stability sub-model solves equations for the rider's current bicycle movement. The vibration sub-model solves equations for the vibrations that result from the bicycle's current surface. The researchers validated their mathematical submodels by comparing data of the calculated steering and tilt angle to the measured values. They put forward methods to evaluate the pedal torque, however, they never provided any information on the resistances the specific rider must overcome to move the bicycle in the forward direction. Consequentially, the resistances applied to the rider in their bicycle simulator is not scientifically validated.
Typically, bicycle simulators focus on steady-state riding instead of starting and stopping situations. The psychological experiments conducted with the Hank Bicycle Simulator focus on street-crossing scenarios from a stopped position, where participants must avoid traffic. Consequently, our bicycle design is focused on the dynamics of the bicycle starting from a stopped position, as the time it takes to cross the street depends on accurately modeling the bicycle's acceleration. These dynamics are heavily dependent on the rider's inertia because of the slower starting speeds, and as such, our simulation is particularly focused on this aspect.
Also, because of the role of the bicycle in formal psychological experiments, we seek to publish the details of the simulator's behavior and describe how the performance was validated. That way, other researchers can consider how these details might affect the results of the psychological tests and ultimately improve on our results. To our knowledge, no scientific team has attempted to statistically validate or analyze the performance of their bicycle simulator against their theoretical model, nor have they postulated how the details of their implementation may affect the scientific conclusions reached with their simulator.
In this work, we first describe the physical model we use for the bicycle. We then describe the simulator's construction and the two experiments we conducted to measure the time delay of the bicycle's response. Finally, we test the response of the simulator to a constant torque input.

II. BACKGROUND 2.1 The Physical Model of the Bicycle
The time it takes a rider to directly cross a street from a stopped position is almost entirely a function of the energy the rider puts into the pedals and the resistance to rotation provided from the pedals. At low velocities, nearly all of the pedal resistance is related to the effects of inertia, which is mostly a function of the weight of the rider and the bicycle. At higher velocities, wind resistance increases and becomes a larger impediment to further acceleration than the effects of inertia. Since the rider's expectation of how long it will take to cross a street in the virtual world is presumably based on their past experience in the real world, it is important to create a system that accurately reproduces the effects of inertia and wind resistance so that the relationship between the rider's exerted energy and the time it takes to cross the street matches their past experiences in the real world.
A bicycle transfers torque from the pedal rotation into a propulsive force, " in Newtons (N), acting between the rear wheel and the ground. This propulsive force accelerates the rider and bike's inertia when it overcomes the drag, # , the slope resistance, $ , the rolling resistance, % , the bump resistance, & , and the mechanical inefficiencies, ' (Wilson, 2005).
The acceleration force, ()) , of the total bicycle system can then be described as: where is the combined mass of the bicycle and rider in kilograms (kg), and , is the acceleration of the bicycle in meters per second squared (m/s 2 ).
In this study, the potential effects of slope and bump resistance are ignored because of the assumption that the rider will have a flat, smooth surface as he or she crosses the street.
% is a fraction of a percent of the total system weight due to the rolling resistance coefficient, which can be anywhere from 0.002% to 0.008% (Wilson, 2005). Since % is such a small value of the rest of the system, it is considered to be negligible in our calculations.
The mechanical efficiency, ' , is the ratio of the output power compared to the input power. There can be as low as a 1% loss of energy to as high as a 20% loss of energy in the bicycle system (Kyle & Berto, 2001). This force will be considered in the calculations, though the rider will naturally compensate to the inefficiencies similar to the real-life experience of pedaling a bicycle. The efficiency of the simulator should be similar to that of a regular bicycle.
Given these parameters, Equation (2.1) is simplified to: The inertial force depends mostly on the mass of the rider and the bicycle, , although the rotational inertia of the rotating components on the bike are also important factors. Since the theater of our simulation presumes that the rider is using an unfamiliar bicycle, it seems reasonable to assume that so long as the bicycle parameters are within the range of similarly sized commercial bicycles, the validity of this will be dominated by the mass of the rider and bicycle.
The force of wind drag, # , is a function of the square of the velocity: where is the air drag constant in kg/m, and is the velocity in m/s, in terms of position. The drag constant is described as follows: where is the air density in kg/m 3 , 6 is the drag coefficient (unitless), and A is the area of the rider in m 2 . Our simulator treats each of these variables as constants, adjusting the area of the rider with the size of the bicycle.
For simplicity, we will combine the terms, " and ' into the constant propulsive force variable, . Accounting for drag and inertia results in the following second order, partial differential equation: where is the acceleration, in terms of position.
Solving Equation (2.5) for gives the position of the rider, , at time : where 3 and 2 are constants. Assuming the bicycle initially starts from a resting point, we can apply those boundary conditions of 0 = 0 and 0 = 0 . From those boundary conditions, we produce the values of the constants to be 3 = 2 = 0 . This produces the fundamental equation of our bicycle traveling in a straight line under a constant propulsive force, P: The derivative of this equation describes the velocity of the bicycle as a function of time:  Thus, if our simulator is driven by a constant torque, we expect the initial acceleration to be described by Equation (2.9) and the terminal velocity to be described by Equation (2.8).

Specific Aims
Because of our interest in bicyclists avoiding traffic when crossing a street from a complete stop, two important variables are: 1) the time delay between the rider input and the movement of the virtual environment; and 2) the inertial response of the bicycle to the rider's input. These are important elements of the control system design. The specific aims of this study are the following: 1. To measure the time delay from when the user turns the handlebars to the response of the virtual reality environment. 2. To analyze the time it takes the bicycle to reach terminal velocity given a constant input torque.
If testing indicates that the system has a short lag time with the visual system and accelerates appropriately for input torques of the expected range, the bicycle will possess the dymanics suitable for this virtual reality environment.

Selection of the Bicycles
Because the system was to be used by both children and adults, we expected that it should be capable of accommodating several bicycle sizes. The design parameters for the bicycles were that they should: be a step through bicycle.
Using standard growth charts, we determined that we would need three bicycles of different sizes to cover our intended age and size ranges, as measured by their tire diameter: a 20-inch, 24-inch, and 26-inch wheel. The 20in. bicycle would only accommodate 84% of 6-year olds, but implementing a smaller bike was determined by the researchers to be too costly. The 26-in. bicycle would accommodate up to the 25th percentile of 20year old males, and the 90th to 95th percentile of 20-year old females. Again, the researchers felt that because the studies typically focused on children, this upper range was sufficient.

Designing the Flywheel
The goal of the design is to accurately simulate a street crossing, or to accurately reproduce the rider's position in time, given the rider's mass and torque input. The flywheel simulates the inertia of the bicycle and the rider, and the motor simulates resistance from wind drag.
Neglecting the rotational inertia of the bicycle wheels, the linear kinetic energy, in joules (J), of a bicycle and the rider is: where is the combined mass of the bicycle and the rider, and is the velocity of the bicycle. The rotational kinetic energy of the inertial system is: where is the angular velocity of the flywheel in radians per second (rad/s), and is the moment of inertia in kg(m 2 ). Equating Equation (3.1) and Equation (3.2) gives: Thus, with an appropriate gear system matched with a flywheel with appropriate inertia, the gears may be adjusted to simulate a large range of rider masses. In our case, we designed a cylindrical flywheel with a thickness of 0.709 in. and radius of 6.339 in. The inertia of this flywheel is 0.152 kg(m 2 ). We coupled this with an 11-speed, internally geared hub (Alfine Internal Geared Hub for Disc Brake Use, Shimano, Irvine, CA) that could shift between gear ratios from 0.527 to 2.153. When combined with the other fixed gears in the drivetrain, the overall gear ratio ranged from 2.306 to 9.419. With this design, the Hank Simulator can accommodate riders as small as 10 lbs. on the small bicycle, using gear 1 of the internally geared hub, and riders as large as 253 lbs. on the large bicycle, using gear 11 on the internally geared hub. Figure 3 presents an image of the flywheel and its gear train, without its protective box. The internally geared hub includes a freewheel that prevents the inertia of the flywheel from being transferred to the rider's shins, in the case of coasting, when the velocity of the bicycle goes slower than the flywheel. A motor connected to the flywheel simulates the velocity-dependent air drag.

Simulating the Air Drag
A motor (AKM53K-BKCNC-00, Kollmorgen, Radford, VA) and motor controller (AKD-P01206-NBAN-0000, Kollmorgen, Radford, VA) resist the flywheel rotation to simulate wind resistance as described in Equation (2.3). The bicycle velocity is measured from the motor output, factoring for the gear ratio between the motor to the rear wheel. The drag is based on the following assumptions: (a) air density, ρ, is 1.184 kg/m3, (b) the area facing the wind, A, is 0.4 for the 20-inch bicycle, 0.5 for the 24inch bicycle, and 0.6 for the 26-inch bicycle, and (c) the drag coefficient, C D , is 1.1 for each bicycle (Gross, et al.).
A microcontroller (Uno, Arduino, Ivrea, Italy) receives the velocity signal from the motor controller, interprets the velocity, and calculates the corresponding air drag, 6 , according to the equation: The microcontroller then sends a new torque command to the motor as an analog voltage input.
The flywheel, motor, and internally geared hub are housed in a case made of ¼ in. ABS plastic supported by an extruded aluminum frame. The case helps to dampen the gear train noise from the system and protect experiment participants from the moving parts. The entire assembly is mounted on three parallel T-slot tracks screwed into a 24 x 96 in., 1 in. thick white melamine board. This arrangement allows the chain tension to be adjusted between the inertial system and the rear wheel of the bicycle, held in place by a commercial stand (Rock-the-Bike, Oakland, CA), which is also fixed to the melamine board.   Figure 6 illustrates the connections between the microcontroller, the front hub motor controller, the back motor controller, the steering potentiometer, and the potentiometer that indicates the current gear ratio. The microcontroller sends velocity and steering angle updates to the virtual environment computer over a USB connection. Full system details are available in (Powell, 2017).

IV. EXPERIMENT I: TIME DELAY
System lag, the time between when a user acts and the system responds, is very important in an immersive virtual environment because lags of more than approximately 100 ms have been identified as a factor contributing to motion sickness. The overall system lag includes the time to send the signals from the bicycle hardware to the computer rendering the graphics plus the time to actually render and display the graphics.
The following experiment measures only the time to send the signal to the computer.

Methods
When displaying the microcontroller output directly on a text terminal, it appears that the microcontroller produces a new output every 21 ms. That estimate includes the time to transmit the serial information to the text terminal, however, the lag between the microcontroller and the rendering computer may be more accurately estimated by writing a simple program on that computer to echo messages from the microcontroller back to the microcontroller and using the echoed signal to toggle the output voltage on one of the microcontroller's pins. This approach avoids the time-consuming process of writing to a monitor.  provided an appropriate input signal. We programmed the microcontroller to toggle one output pin between 0 and 5V whenever the handlebars were turned past the zerodegree position. It also sent a single character "H" or "L" to the rendering computer over the USB connection. Python code on the rendering computer echoed the signal back to the microcontroller, which then toggled a second output pin between 0 and 5V. An oscilloscope connected to the two output pins could then measure the time interval between the two signals. Figure 7 shows a diagram of the set-up of the delay experiment.

Results
The oscilloscope indicated that the time between the handlebar movement through the zero-degree position and the echo from the rendering computer was 40 ms. This is the round-trip time, so the lag to the rendering computer is half of that, or 20 ms.

Discussion & Conclusion
The microcontroller appears to loop through its code every 21 ms and another 20 ms is required to send the signal to the rendering computer. The difference between the moment at which the microcontroller samples the handlebar signal and the moment when that processed signal begins its trip to the rendering computer is some fraction of the loop time. In this experiment, the output pin designating the initiation of the signal was set right after the signal was sampled, so only a few microcontroller clock ticks expired between the sampling time and the changing of the pin value. Thus, the roundtrip estimate is likely to be an accurate measure of the whole lag, and it is not necessary to add the loop time plus half the round-trip time to estimate the lag. The net lag between the user's movement of the handlebars and the arrival of the signal at the rendering computer is just 20 ms.

V. EXPERIMENT II: SUMMATIVE SYSTEM PERFORMANCE
The second experiment measured whether the inertia system and the motor modeling wind resistance provided the expected feedback. A second motor (AKM53K-BKCNC-00, Kollmorgen) controlled by its own motor controller (AKD-P01206-NBAN-0000, Kollmorgen, Radford, VA), referred to as the input motor, replaced the pedals in order to provide a consistent torque. We expected that the system would respond as predicted by the solution to the differential equation presented in Equation (2.8).

Methods & Results
Three constant torques spaced 0.157 Nm apart were applied to gears 1, 3, and 5. As the system accelerated towards the terminal velocity associated with each torque input, the microcontroller reported the time and velocity of the rear wheel.      Table 1 presents the input torque, the initial acceleration, and the terminal velocity, both experimentally and theoretically predicted, for each of the three gears. The estimates of the initial acceleration were derived from a nonlinear fit model using the following equation:

Microcontroller
This equation describes the velocity of the Hank Simulator at a given time, . The derivative of the nonlinear fit model is the acceleration of the Hank Simulator at any point in time. The initial acceleration is the acceleration of the simulator at = 0, which simplifies the initial acceleration results to be .

Discussion & Conclusion
The initial accelerations across the three gears was better than 2%, and much better than 1% for most cases that would be encountered for heavier riders. The terminal velocities were better than 5.5%, again most accurate for heavier riders. Given the mechanical and electrical complexity of the system, this is quite good and most likely sufficient for the application scenario.

VI. GENERAL DISCUSSION
The purpose of the Hank Simulator is to observe the behavior of children and adults riding across a street on a bicycle, with particular emphasis on how participants judge the gaps between passing cars when choosing their moment to cross. Participants' decisions are likely to be dominated by their estimates of how long it will take to cross the street. This estimate is likely to be a function of their past experience with bicycles, an experience dominated by the challenge of physically overcoming the mechanical inertia of the system. Velocity (m/s) Thus, the most important factor in the Hank Simulator is the simulation of the inertial force. As seen in the second experiment, the flywheel produces the expected kinetic energy. The error on the starting acceleration is 0.20% or less for gears 3 and 5, the gears that are most frequently used in normal simulator operation.

Highest Torque Condition
The air drag produced by the back motor ultimately determines the terminal velocity for a constant input pedaling force. The terminal velocity will rarely be a practical factor in the Hank Simulator experiments because the riders typically cross the street or ride for short distances. Nevertheless, the second experiment suggests that the system's terminal velocity, and by extension its representation of the wind drag, were quite favorable. For gears 3 and 5 the error was 3.73% or less; the rider's terminal velocity was only about 0.20 m/s faster than the predicted terminal velocity. In the best case, the error was only 0.07%, less than 0.01 m/s faster than the predicted value.
Based on the results from the system performance experiment, given a constant propulsive force, the time to cross a street can be found. The street that the Hank Simulator is crossing in the virtual reality environment is about 10 ft. wide or 3.06 m. From the data of the experiments, we can calculate the time it takes the rider to move 10 ft. starting from rest and pedaling at a constant propulsive force. The average time difference between the predicted and observed time to cross the street in gears 1, 3, and 5 is about 80 ms. For the more commonly used gears 3 and 5, the Hank Simulator is typically 60ms faster than the theoretical expectation. Actual riders may exert higher torques, which will decrease the time it takes to cross the street and the discrepancy between the theoretical and experimental time. Practically, this time discrepancy is quite small.
A study by Plumert et al. (2004) observed 10year olds, 12-year-olds, and adults crossing a two-lane intersection using a bicycle simulator. When the rider stopped at the intersection, traffic approached the intersection from the left of the rider in the lane closest to them. The rider would then have to choose an appropriate gap width to safely cross the intersection. On average, all participants chose to cross the intersection during the 3.5 s gap size between vehicles. They found that the average time left to spare when the rider cleared the lane of the approaching vehicle decreased with the younger riders. The average time left was 1.13 s for the 10-year-old riders, 1.49 s for 12-year-old riders, and 1.98 s for the adult riders. The 60 ms time difference between the predicted and observed times will have little to no effect on the performance of the riders in the Hank Simulator. The riders will typically be around 60 ms ahead of where they may predict, however, that 60 ms results in a displacement difference of only a few inches. For example, in the worst-case scenario in which there is a difference of 104 ms, if we assume a constant propulsive force of 2.920 Nm in gear 5, this will result in an observed displacement of about five inches ahead of the predicted displacement.

VII. CONCLUSIONS
The next step for the Hank Simulator is to compare the behavior of riders in the simulator with a real bicycle in a physical environment. Of particular interest would be the observation of force patterns exerted by a rider in a natural environment and the bicycle motion, which could then be compared to their behavior and the bicycle response in the simulator. Differences in simulator response and bicycle motion would then drive further refinements, with an eye on the net time differences these refinements might create in the street-crossing scenario.
The mechanical simulation of inertia in the Hank Simulator provides an accurate and immediate reproduction of the expected inertia. How this compares with other simulators, particularly those relying on electrical motors and magneto-rheological fluid brakes is unclear, as previous studies have not provided enough performance detail to be able to make a valid comparison. We hope that the current study will encourage future researchers to report the details of their underlying models and their system performance, particularly those with ties to the physical parameters of the simulation they wish to reproduce, so that the community may move forward together, taking the best elements of each system.