[Paper Review] Blue River Controls: A toolkit for Reinforcement Learning Control Systems on Hardware
Blue River Controls is a toolkit that enables training and deploying reinforcement learning (RL) agents directly on real hardware using a Gym-like interface, with support for Quanser’s Qube Servo2-USB platform. It bridges simulation and real-world deployment by providing a unified interface, hardware abstraction, and benchmarks, enabling direct comparison of RL and classical control methods on physical systems with minimal engineering overhead.
We provide a simple hardware wrapper around the Quanser's hardware-in-the-loop software development kit (HIL SDK) to allow for easy development of new Quanser hardware. To connect to the hardware we use a module written in Cython. The internal QuanserWrapper class handles most of the difficult aspects of interacting with hardware, including the timing (using a hardware timer), and ensuring the data sent to hardware is safe and correct, where safety corresponds to safe operating voltage and current for the specified hardware. Much of the recent success of Reinforcement learning (RL) has been made possible with training and testing tools like OpenAI Gym and Deepmind Control Suite. Unfortunately, tools for quickly testing and transferring high-frequency RL algorithms from simulation to real hardware environment remain mostly absent. We present Blue River Controls, a tool that allows to train and test reinforcement learning algorithms on real-world hardware. It features a simple interface based on OpenAI Gym, that works directly on both simulation and hardware. We use Quanser's Qube Servo2-USB platform, an underactuated rotary pendulum as an initial testing device. We also provide tools to simplify training RL algorithms on other hardware. Several baselines, from both classical controllers and pretrained RL agents are included to compare performance across tasks. Blue River Controls is available at this https URL: https://github.com/BlueRiverTech/quanser-openai-driver
Motivation & Objective
- Address the lack of tools for transferring high-frequency RL algorithms from simulation to real hardware.
- Enable seamless deployment of RL agents across simulation and physical hardware using a unified interface.
- Provide benchmark baselines—both classical control and pretrained RL agents—for performance comparison on real-world control tasks.
- Facilitate reliable, safe, and low-latency interaction with real hardware through a hardware abstraction layer and real-time control wrapper.
- Support extensibility to other Quanser hardware platforms and future hardware integration via standardized interfaces.
Proposed method
- Implement a Gym-compatible interface that abstracts both simulation and real hardware into a single environment API.
- Develop a Quanser hardware wrapper using Cython to ensure low-latency, real-time communication with the Qube Servo2-USB platform.
- Integrate a hardware timer and safety checks (voltage/current limits) to ensure stable and safe actuation during RL training.
- Design a Quanser Interface layer that synchronizes state initialization, state observation (including velocity estimation from encoder data), and reset logic between simulation and hardware.
- Use sparse and dense reward functions with normalized scaling (e.g., r ≈ 0 to 1) to ensure consistent performance evaluation across tasks.
- Provide pre-trained PPO agents and classical control baselines (e.g., PID, swing-up controllers) for direct performance comparison.
Experimental results
Research questions
- RQ1Can a unified Gym-like interface effectively support both simulation and real hardware deployment for high-frequency RL control tasks?
- RQ2How do RL agents trained with PPO perform on real hardware compared to classical control baselines like PID and swing-up controllers on the Qube platform?
- RQ3What role does simulator fidelity and domain randomization play in enabling successful sim-to-real transfer for RL control?
- RQ4To what extent can hardware abstraction layers reduce the engineering burden of deploying RL agents on physical systems?
- RQ5How do safety mechanisms and real-time timing constraints affect the reliability and performance of RL agents on physical hardware?
Key findings
- The Blue River Controls toolkit successfully enables end-to-end RL training and deployment on real hardware using a single, consistent interface across simulation and physical systems.
- The toolkit supports real-time operation at 250 Hz, with hardware abstraction ensuring safe and stable actuation through voltage and current monitoring.
- Performance benchmarks show that PPO agents can achieve near-optimal performance on tasks like Qube Balance and Qube Swing-Up, with maximum episode rewards approaching 1.0 in simulation and stable performance on hardware.
- Classical control baselines such as swing-up controllers and PID controllers serve as strong performance references, demonstrating that RL can match or exceed their performance on complex tasks.
- The use of a hardware abstraction layer and state estimation (e.g., velocity from encoders) enables consistent state observation across simulation and real hardware, reducing domain gap issues.
- The toolkit’s modular design allows for straightforward extension to other Quanser hardware platforms, such as UAVs, cranes, and active suspension systems.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.