Stroke can leave people with reduced upper-limb mobility, making repetitive rehabilitation exercises an important part of recovery. However, conventional rehabilitation can be difficult to continue outside clinical environments.
Our project set out to develop a prototype 2D upper-limb rehabilitation robot for potential home use, combining physical movement with interactive games to make repetitive exercises more engaging.
Rather than treating rehabilitation as a purely mechanical task, we wanted to create a system where the user's physical movements directly control an interactive virtual environment, while their movement data can be recorded and analysed.
We developed FarmReach, an interactive rehabilitation system built around an existing MyPAM upper-limb rehabilitation robot.
The system combines a custom wrist pronation/supination attachment with the existing 2D arm mechanism. The wrist module uses a geared DC motor and incremental encoder to provide controlled wrist movement and position feedback. The mechanical components were designed and manufactured specifically for the project, including 3D-printed mounting components.
At the embedded level, an ESP32 handles encoder acquisition, motor control and communication with the rest of the system. Encoder feedback from the robot is processed in real time, while PWM signals are used for motor control.
Bringing the Robot into the GameThe physical robot is connected to a Unity-based rehabilitation environment, allowing the user's movements to control an on-screen character.
We created a low-poly farm environment called FarmReach, with a series of rehabilitation minigames designed around different movement tasks. These include crop watering, apple picking, sawing, hammering and a memory game. Difficulty can also be adjusted to change the demands of the exercises.
This gives the rehabilitation session a simple gameplay loop:
Move the robot → control the character → complete the task → receive feedback → record the session.
Connecting Everything TogetherThe system uses ROS 2 to process and analyse movement data between the physical robot and the Unity environment.
The overall architecture is:
MyPAM + Wrist Module↓ESP32↓USB Serial↓Unity ↔ ROS 2↓Kinematic Analysis + Data Logging
ROS 2 is used for movement processing and kinematic calculations, while Unity provides the interactive rehabilitation environment. Session and movement data can also be stored for later analysis.
The system doesn't just control a game — it also allows us to analyse how the user moves.
Encoder data is used to calculate measures such as movement efficiency, velocity, acceleration and jerk. These metrics can provide information about how a movement is performed and allow performance to be tracked over repeated sessions. The system stores relevant session data using SQLite.
We tested the communication and integration between the robot, ESP32, Unity and ROS 2.
During communication testing, the system achieved an average update rate of 63.47 Hz, corresponding to an average interval of 15.76 ms, with 0% missed messages during the recorded test.
The wrist mechanism and encoder were also calibrated and tested, while the complete system was evaluated with healthy participants to assess usability and interaction. The participant testing was intended to evaluate usability rather than clinical effectiveness.
What We LearnedThe project demonstrated that a physical rehabilitation robot can be integrated with embedded control, ROS 2 and a game-based Unity environment into a single system.
There were also limitations. In particular, the intended PID-based assistive control could not be fully integrated because of communication issues, and mechanical backlash affected the accuracy of the wrist mechanism. Further testing with stroke patients would also be required before drawing conclusions about clinical effectiveness.
The result is therefore best considered an engineering prototype, rather than a clinically validated rehabilitation device.








Comments