Design of Virtual Reality-Based Hippotherapy Simulator Exergaming Software and Its Controller for Rehabilitation of Children with Cerebral Palsy in Indonesia: An Engineering Concept

Horse riding exercise, also known as hippotherapy is a popular treatment for children with cerebral palsy (CP). However, the need for trained therapist, massive land use, and expensive maintenance of the horse ranch makes hippotherapy not affordable or even available for most patients in Indonesia. This problem motivates us to consider mechanical horse riding simulator machines to replace actual horse hippotherapy. However, most patients are children and are easily bored when asked to do monotonous activities for an extended period. The room setting also does not give the patient visual inputs that usually help motivates the children in real-horse hippotherapy activities. To solve this problem, we designed an exercise game (exergaming) software which we named Sirkus Apel , providing the patients with fun activities while doing the therapy. We also design an inertial sensor-based controller that lets the patients control the in-game horse by their back movements, which also beneﬁts CP patients. To make the visual input enjoyable to the user while also considering the user’s safety, we built a convex mirror-based dome virtual reality to provide an immersive 3-D experience. We then project the game content to the dome to provide an immersive experience to the patients making it as if they are riding a real horse inside the game.


Introduction
Cerebral palsy (CP) refers to a group of permanent motor disorders attributed to a non-progressive lesion in the immature brain [1].Children with CP may have a limitation or impairment in their movements, which can disrupt their daily activities [2,3].
Hippotherapy is a form of physical therapy, a rehabilitation method that use a horse's movement characteristics to provide motor and sensory input to the patients [4].Hippotherapy, or recreational horseback riding exercise, is a proven method in children with CP rehabilitation that improves motor function, symmetry of muscle contraction, spasticity, posture, and walking [5].Some researchers supported this fact by reporting positive results on randomized controlled trials and a studies of hippotherapy to support the method's effectiveness.However, hippotherapy activities are costly and challenging to conduct due to several factors.The therapy instructor has to have a horse riding instructor license and therapist qualification.They also must be able to prepare the horse and guide the patients in a session.Finding a therapist with the skill mentioned earlier is challenging in a developing country like Indonesia.Aside from human resource costs, horse-keeping requires massive land use for a ranch or farm, which is expensive and impossible to do in urban environments [6].Currently, no place offers a hippotherapy session with real horses in Indonesia.The last activity reported about hippotherapy sessions in Indonesia was in 2009 [7], making access to real-horse hippotherapy unavailable for children with CP in Indonesia.Some researchers suggest using a Horse Riding Simulator (HRS) instead of using actual horses because it can significantly reduce the cost of hippotherapy.An HRS device is commonly available in the market as an exercise or fitness machine.Many recent studies [8][9][10][11] reported that HRS usage also shows positive results for CP treatments similar to hippotherapy with a real horse.Using a simulator, we only need a room with all the required equipment, eliminating the need for large horse farms in rural areas.However, this setup also has several drawbacks.Children are quickly bored doing monotonous and repetitive actions in a room without fun stimuli.The room setup also loses visual stimulation from the outside environment, which usually helps motivate the children to finish the therapy session and return to the next session.
Providing fun content to the children is essential to prevent the lack of enthusiasm of the children.One of the fun activities is exergaming or active video gaming that requires bodily movements to play [12].Exergaming also benefits children with CP by improving muscle strength [13], balance [14], range of motion [15], and physical fitness [16] depending on the type of body movements required to control the game.In this report, we design an exergaming video game to solve the problem mentioned earlier in the form of a horse racinglike game with tasks to pick apples and avoid obstacles.We name the game Sirkus Apel, which means "apple circus" in Indonesian.We also develop a controller that requires the user to move their back to control the in-game horse.A case report shows that back exercises also benefit children with CP, with the subject showing excellent motor progression [17].
A room setup also removes the refreshing view of a horse ranch which provides visual stimulation to the children.This problem motivates us to design the game in an immersive virtual reality (VR) environment to enhance the exergaming experience.However, considering the safety of the children with CP, we decide not to use the usual head-mounted display (HMD) for this purpose.The use of HMD can be hazardous for children because it obstructs their view of the environment, especially when riding an HRS device.Numerous researchers [18][19][20][21][22] also report another problem of HMD usage: motion sickness caused by the inconsistency between the visual input of the eyes and the user movements.This condition can cause nausea, headache, disorientation, and vomiting, which is very dangerous and uncomfortable, especially for children with CP.
Considering the problems mentioned before, we built a dome-based VR.By creating a dome-like structure, we can project the VR content to a specialized dome instead of to the HMD.Taking the VR content outside of HMD also eliminates the view obstruction problem and minimizes the risk of motion sickness [23].We built our dome-based VR using the design of iDome by Paul Bourke [24].The design of iDome is inspired by a planetarium hemisphere shape.The hemisphere is cut in half to place the users in front of the dome, not under it.This setup provides a broad immersive view without any obstruction of projection hardware but keeps the user aware of the surroundings.
We then integrate the exergaming software, VR dome, HRS machine, and all the necessary equipment to be a whole hippotherapy simulator platform illustrated in Figure 1, providing children fun experiences while giving them the therapy benefit to improve their conditions.The rest of the paper is organized as follows.We review and discuss the most recent studies on hippotherapy simulators, virtual reality, and exergaming design in Section 2. In Section 3, we explain our overall system design and parts for the hippotherapy simulator platform.Section 4 discuss the building, rationale, and decisions of the VR dome and the exergaming design.Section 5 explains the equipment required, design, and development of the controller, enabling the user to control the in-game horse by moving their back.Section 6 discusses how we integrate all the parts into a hippotherapy simulator platform and presents the platform's performance compared to a real horse hippotherapy.Finally, Section 7 concludes the paper.

Related Works
The use of VR and exergaming device like Nintendo Wii for the motor rehabilitation of children with CP is relatively new but popular.A systematic review [25] on the VR and exergaming device researches in the last decade reported that most of the studies yield positive results, improving balance and motor skills in children and adolescents with CP.Another review [26] reports that VR gaming combined with task-specific training improves gross motor and augments hand function.However, combining a Horse Riding Simulator, VR, and exergaming for CP rehabilitation is a relatively rare and new idea.
In [27], the authors implemented an indoor HRS device combined with an exergaming device, Nintendo Wii Fit, designed for improving the dynamic balance ability.Each participant of the study was asked to play 25 min sessions of exergaming activities like Ski Slalom and Balance Bubble in Nintendo Wii Fit using Wii Remote on top of the HRS device.However, the participants were limited to normal healthy adults, not children with CP.The exergaming device is a regular game console, not an immersive VR device, which reduces the exergaming experiences for the participants.
In [28], the researchers use an HRS device combined with an immersive VR by using an HMD.The HMD device is connected to the VR content server using Bluetooth to prevent a tripping hazard.The VR content is a 360 • video showing a moving landscape around the speed of the horse riding equipment for 20 min in a session.However, the experiment did not require the participants to participate in the game actively.Showing a moving video while the participants were stationary while riding the HRS device can cause motion sickness.The author did report that some participants complained about dizziness and other motion sickness-related symptoms.The use of HMD also caused an obstructed view for the participants, increasing the risk of falling from the HRS device.
In [29], the researches uses a HRS device, a HMD to provide an immersive VR experience and a pair of hand-tracking devices for controlling the VR game content.Each session consists of the following cycle: warm-up, first training program, rest period, second training program, and cool down for a total of about 30 min.During the training program the riders play a game that require them to avoid obstacles by tilting their trunks laterally on a moving saddle and reach a target by raising their arms.However, this experiment requires a safety harness to be installed in the HRS device to minimize the risk of falling when the participants wear the HMD.
Most related works use HMD for an immersive VR experience, which inherently increases the risk of motion sickness, falling hazards due to the obstruction of the view of the environment, and tripping hazards because of the number of cables needed to run an HMD-based VR.An extra safety measure must be implemented when using the HMD, especially with children with CP.The use of other types of VR projection such as sphericalsky projection view (similar to a planetarium) or dome-based VR which reduces the risk of motion sickness, falling, and tripping hazards has not been considered in previous research.

System Architecture
Our hippotherapy simulator station consists of three main parts: dome-based VR parts, an HRS device, and exergaming platform parts.The dome-based VR consists of a projector, a spherical convex mirror, and a specialized dome to project the reflection of the projector from the mirror.The HRS device is the base for simulating actual horseback movements, in which the speed can be controlled.The exergaming platform consists of a PC or a laptop as the VR content server, which runs the video game, an inertial-sensors-based controller installed to the patient's back, and the video game software itself.

Dome-Based VR
To reduce the risks of motion sickness and eliminate the falling and tripping hazard, we implement a dome-based VR device based on the design of iDome by Paul Bourke [24].This VR system consists of a laptop/PC to host the VR content, an LCD projector to project the content to a specialized shape convex mirror, and a dome to receive the reflected projection.Figure 2 shows all the equipment we use and the dimension of the iDome.Our iDome is made from fiber-reinforced polymers (FRP) [30] for the following reasons: the material has an excellent strength-to-weight ratio making it light-weighted despite large shape dimensions, it has a relatively affordable price for small-scale production, and it can also be easily molded into any shape without any requirement of sophisticated tools.The iDome needs to be white or other bright colors to minimize the reflection.Therefore, we painted our iDome with a light shade of gray non-reflective paint.
The iDome shape is a semi-sphere truncated in the bottom part to make it able to stand on the floor.The inside radius of the iDome is 1.5 m with a thickness of 12 cm.We drilled a small hole at the bottom-middle part of the iDome for the projection beam from the LCD projector to pass through.The details of the iDome dimension can be seen in Figure 3.An LCD projector and a spherical mirror are required to project the VR content to iDome.For the LCD projector, we use one of the projectors recommended by the inventor [31], Infocus IN3118HD, which supports 1920 × 1080 HD resolution and 3600 lumens.We tried various diameters in the 66 to 80 cm range for the spherical mirror.By trial and error, we decided to use a spherical mirror with a diameter of 80 cm, and the distance from the projector is around 1.3 to 1.6 m, calibrated before the iDome use.

Horse Riding Simulator (HRS) Device
We use a horse riding simulator (HRS) device, Jufit JFF043QM [32], manufactured by Jufit Smart Tech (Shanghai Co., Shanghai, China).A person can ride the device with a maximum weight of 150 kg, which is ideal for children's use.The device also has an affordable price which is really helpful in a developing country like Indonesia.
The device is typically used as an exercise tool to improve the user's posture.The HRS device has features to control the speed simulating a horse walking and running on a 0-20 scale.The device also provides a timer, a handy feature for measuring a therapy session's length for a patient.

Exergaming Platform: Sirkus Apel
To provide a fun and entertaining experience during a therapy session, we develop a game called sirkus apel which means "apple circus" in Indonesian.The game was developed in Blender 3D using Blender Game Engine (BGE) [33], which provides an easy platform for rendering 3D models and simple interactive prototype games.The game play is a horse racing-like game with additional tasks of avoiding obstacles and picking apples from the ground.The race tracks consists of three lines where an apple or an obstacle randomly appears on one of the line.For each apple picked or obstacle avoided, the game rewards the player with a point.The goal of the game is to get the points as high as possible during the therapy session, usually 5 to 10 min.The points are useful to motivate the children, as they often desire to beat their own previous scores.
To enhance the exergaming experience, we developed an inertial sensor controller that can be placed on the user's back so that the player can control the in-game horse by leaning leftward, rightward, forward, and backward.We implement the controller using Arduino UNO R3 and 9-axes motion shield.We also write a Python script for bridging the controller to the game.
Figure 4 shows our HRS and exergaming equipment.We will discuss the details of the game design in Section 4 and the controller design in Section 5.

Game Design
We name our game Sirkus Apel or apple circus in English based on the fact that the user's tasks are to avoid obstacles by moving the in-game horse and picking up appearing apples from the ground.The game consists of four "levels" or, more accurately, scenes.The only difference between the levels is the view.Each scene resembles a time of the day: morning, bright daylight, afternoon, and night-time view.We animate a horse's head view to make the user feel like they are riding an actual horse.The scenes conceal the actual three horse tracks as illustrated in Figure 5.The game prototype is a keyboard-only controlled game with W, A, S, and D keys.The key-action pairs are listed in Table 1.We formalized the relationship between the key-action pairs in Algorithm 1.

Algorithm 1
The update(t, v) function for the user's keyboard input.
t ∈ {1, 2, 3}: Current horse track v ∈ {0, 1, 2}: Current horse velocity (0: stationary, 1: walking, 2: running) k ∈ {'W', 'A', 'S', 'D'}: Keyboard button the user pressed The game starts with the user selecting a level.After a level is determined and the user starts the game, the therapy session begins.The score of the participants will be set to zero.At the start of a game session, a horse will appear on the center track in the beginning and will move forward automatically.An apple or an obstacle will randomly appear on one of the tracks.If an apple appears, the user should go to the track where the apple is located.When the participants successfully reach the apple, the score will be increased by one point.In case an obstacle shows up, the user should avoid the track of the obstacles.The obstacles are drawn as stacked wooden boxes on the track.When the user fails to avoid the obstacles, the horse will be stuck there, not moving forward, until the user successfully moves the horse to other tracks.
Our game accommodates two modes of simulation velocity: a horse walking and running slowly, which we call mode '1' and mode '2', respectively.The user can control the horse's speed by pressing 'W' for toggling from walking to running.Conversely, pressing 'D' will toggle from running to walking.We also add mode '0' where the horse is stationary.This case only happens when the participants fail to avoid obstacles, making the horse stuck.
A game session is designed to have a length of 5 min.After a game session, the participants can be given a two or three-minute break before the cycle starts again.The total length of a therapy session is about 20 min or about three game sessions.After 5 min, the game will show a finish line, and the game is ended when the user reaches it.
The final scene of a game session shows the final user's score, a handy tool for the therapist to motivate children to participate in the next session.We formalize the game action explained in the Algorithm 2. To enable an exergaming experience while playing the game, we design a controller to simulate the keyboard input by using inertial sensors placed on the user's back, allowing the user to control the game by their back movements in four directions.We will discuss the engineering design details in the next chapter.

Inertial Sensors-Based Controller Design
We use an Arduino UNO R3 to implement the inertial sensors-based controller because of its simplicity and affordability.We use 9-Axis Motion Shield as the interface of the BNO055 [34] IC absolute orientation sensor.The stacked Arduino R3 and the motion shield are packaged in a small wearable backpack the user wears.For the rest of the paper, we will refer to the set of Arduino and the shield placed on the user's back as the back-controller.We connect the back-controller to the game host-PC using a USB cable with a considerable length.The back motion data from the back-controller is sent to the PC using serial communication.A python script will receive the serial data and then translate it into a keyboard input which is fed to the game.Figure 6 shows the diagram block of the explained process.
A user's back motion is a rotational movement typically notated by pitch, roll, and yaw.However, this term is relative to the user, the device, and the coordinate system.Therefore a schematic is essential to tell about the coordinate system, especially the x, y, and z-axis directions, their signs, and their corresponding rotational coordinates.We define the pitch, roll, and yaw rotation, or in tuple notation θ, ψ, φ relative to the motion sensors, not the user.We define θ is 90 • polar (pitch) angles, and ψ (roll) and φ (yaw) are azimuthal-directivity angles.The right-hand rule defines the relationship between the linear x, y, z axes and rotational θ, ψ, φ axes.Figure 7 shows the coordinate system of our system at the device perspective and when placed on the user's back.The 9-axis motion shield provides two types of orientation data: one is its native quaternions representation q = q 1 + q 2 i + q 3 j + q 4 k (1) and the other one is Euler's angles from its sensor fusion functions.However, some references [35,36] and our early experiments show that the use of their Euler's angle is prone to a gimbal lock phenomenon due to a flaw in their sensor fusion algorithm.We want to avoid that case by converting the sensor's raw data in quaternions by ourselves without using the sensor fusion function of the shield by the following equation: where q 1 , q 2 , q 3 , q 4 are the coefficient of quaternion representation of the user's rotation.We redefine the key-action pairs in Table 1 regarding the user's back movements.By trial and error with some users, we define the angle thresholds when the user is leaning left, right, forward, or backward.When a user passes the threshold, we simulate the keyboard press.Our thresholds are 20 • for leaning left, right, and forward and 10 • for backward, relative to the upright sitting position.
Two special cases are needed to accommodate moving between two tracks, for example, from track 3 to track 2, then track 2 to track 1.Without special treatment, the user will need to make the following motions: lean to the left, back to the straight position, and lean to the left again.To avoid this case, we add an additional threshold so that the users only need to lean more left after the first one.Similar things are also considered when the user is leaning right twice.Table 2 shows the back movements, their thresholds, simulated key press, and in-game action.
Decrease the horse's speed 1 Special case when moving between two tracks.
To summarize, our back-controller works as the following: the motion shield reads the quaternion representation of the user's movements, which is then sent to the host PC by Arduino via serial communication.The sensor data then received a python script which converts the quaternion into angles, translate them into motion-representation based on the determined threshold, and finally sends the simulated keyboard press to our game, Sirkus Apel.We formalize the back-controller workflow in Algorithm 3.

Algorithm 3
The back-controller flow algorithm.q 1 , q 2 , q 3 , q 4 ∈ R: The user back-motion quaternion representation coefficients sent by Arduino and the shield.key(n): The function to simulate keyboard press of the character n.
Measuring latency is a tricky part because we only have the timestamp on the PC side.In order to accurately measure latency between the user's back motion to in-game motion, we designed a simple experiment: 1.
From the PC, we send a signal to Arduino via serial communication.

2.
In Arduino, we simulate the signal sending from the 9-axes motion sensors, sending them back to PC via serial.

3.
In PC, after the signal is received, we simulate the keyboard press which make the in-game horse move.

4.
The timestamp difference between (1) dan ( 3) is twice the latency, therefore we divide them by 2.
We did the experiment five times and averaged the results.We get the average latency results of about 85 ms, which is a quite reasonable motion-to-photon latency compared to other device such as HMD which has about 25-50 ms [37].
We designed a small plastic box for the packaging that fits the stacked Arduino and motion shield.We put the box inside a tight-fit backpack which can easily be worn by the children or with the help of their parents.We also design the packaging to facilitate a USB cable plug-in in the bottom part.

System Integration, Discussion, and Future Plans
We put all the components in our lab at Institut Teknologi Bandung (ITB), Indonesia.We assembled all the necessary parts into a whole integrated system of a hippotherapy simulator.Our team members tried to play a game session by wearing the back-controller.We tried all the functionality of the HRS simulator device, Sirkus Apel game, sensors, projectors, and iDome, which is illustrated in Figure 8.We designed our device to support an age range of 3 to 18 years old.Our lower age limit, about 3-4 years old, can start using our device as long as they can sit safely on the horse saddle and are able to understand a simple instruction by the therapist.We also set the limit of gross motor classification system (GMFCS) that able to use our device is level I to IV [38].
The upper limit for a device designed for "children" is 18 years old, according to Indonesian law of child protection (Indonesian Law No. 23/2002).However, this does not mean that our device cannot be used by adults.Our HRS device supports an adult with maximum weight of 150 kg and height of 185 cm.

Performance Evaluation by Testing Participants
Six healthy adult participants, all healthy females 23 to 36 years old, consisting of our team members and our students, were asked to test our device.Each participant was asked to try sitting on the HRS, wear the back-controller, and play the exergaming content for 15 min.
After testing, we gave the participants a questionnaire with a set of questions regarding their anthropometry, motion-sickness symptoms, the device's safety, and the performance of the motion sensors.Each participant was asked to give a score on a Likert scale between 1 to 5, where "Strongly disagree" is 1 and "Strongly agree" is 5.
Table 3 shows the subjective response of the participants and their given score averaged over all six participants.From the answers, we can see that the participants did not show symptoms of motion sickness: nausea, disorientation, dizziness, and vomiting.They also felt relatively safe while testing the device.They also felt the immersiveness of the iDome.For the subjective performance of our back-controller, the participants mostly felt that the in-game horse moves according to their back movements but some feel a significant lag between their back and in-game horse movements.We do feel that the design of the back controller and its packaging can be improved further.

Comparison to Other Works
Based on our questionnaire results in the previous sections, we compare four factors of our works to similar works of other researchers.Those four factors are motion-sickness susceptibility, immersivity, motion-to-photon latency, and safety.Table 4 shows our assessment of other similar works on those factors mentioned before.
The main advantages of our design compared to others are that we provide a lower risks of motion sickness, lower risks of falling or tripping hazards, while providing some degree of immersive virtual environments.

Limitation of Our Design
During our experiments, we found that our design has some limitations which we listed below: 1.
The store-bought HRS does not have an adjustable saddle and footrest.To support children from age 3 all the way to 18 years old, an adjustable and flexible saddle and footrest is a necessity.

2.
The distance between projector and convex mirror needs to be calibrated every time the device is started.

3.
The inertial sensors also needs to be calibrated at the start of its usage.4.
The monotony of the HRS motion or gait.In our HRS simulator, there is only one type of motion: cantering motion with various speed.Meanwhile, when riding an actual horse there are various gait: walk, trot, canter, and gallop.Various type of motions are a recommended practice in a hippotherapy session.

Cost Effectiveness of Our Design
We do think that investing in an HRS simulator, projector, and other tools that is needed to built our design will be a cost-effective investment.Moreover, we will donate our design to Dr. Hasan Sadikin Hospital, which our team members are affiliated to.Therefore, they can be used on the future patients.
Considering that the cost of Horse-Riding session in Indonesia is about $25 to $50 one session, and hippotherapy needs at least 2-3 times exercises a week for total of 8-12 weeks [40], while a HRS simulator is almost free after it is set-up, we do think that our device is cost-effective.Real horse hippotherapy is also not covered by Indonesian healthcare, while licensed therapists are.By designing this equipment, we also provide an alternative method available for CP rehabilitation.

Potential Future Works
In the future, we are also interested in testing the effectiveness of the therapy performed by the Hippotherapy Simulator device on children with CP, especially in their postural control.We have already gotten some volunteers to conduct further research in this area.However, it is outside the scope of this report.
Aside from CP rehabilitation, hippotherapy has been known to be an effective rehabilitative method for patients with neurological and other disabilities such as stroke victims, autism, head injury, arthritis, multiple sclerosis, spinal cord injury, and many others [4].Each type of rehabilitation may require specific horse movements, which may be provided by mechanical means.
A potentially interesting future research is to create a mechanical horse that is tailored to do horse riding simulation in therapy.We mentioned that the store-bought HRS simulator only provides one type of horse gait.By designing our own tailored mechanical horse, we can address the limitations of our design: we can create movements for all the needed gaits.We can also design a flexible saddle and footrest to accommodate all the age ranges of the patients.

Conclusions
In this report we presented an engineering concept or design of VR-based Hippotherapy Simulator which consists of three main parts: the dome-based VR immersive virtual environment, the exergaming content, and the HRS simulator.The Dome reduce the need for HMD to provide an immersive virtual environment, removing the patient's view obstruction, while also reducing the risk of motion sickness.The exergaming provides fun content to the patient while also being beneficial for their conditions.Finally, the hippother-apy simulator reduces the cost of the same therapy using actual horses that requires a large amount of land for running a horse ranch.

Figure 3 .
Figure 3. iDome front and side view dimensions in millimeters.

Figure 6 .
Figure 6.The back-controller diagram block related to Host-PC and the VR iDome device.

Figure 7 .
Figure 7.The back-controller's linear and rotational coordinate system conventions: (a) In relative to the Arduino UNO R3 and 9-axis motion shield, (b) In relation to the user when the controller placed on their back.The arrows indicates the direction of positive signs for each axis.

Figure 8 .
Figure 8.A user plays a game session of Sirkus Apel in complete system environment: (a) Selecting level scene, (b) Sitting upright during a game, (c) Leaning left, moving the horse left, (d) Leaning right, moving the horse right, (e) Leaning forward, increasing the horse's speed, (f) Leaning backward, decreasing the horse's speed.

Table 1 .
Keyboard press and in-game action.

Table 2 .
Gestures, threshold, simulated keyboard press, and in-game action.