HIL Bench Control Platform
ReactDjangoPostgreSQLREST APIFastAPIDocker
A comprehensive web-based platform for monitoring and controlling Hardware-In-Loop test benches
Project Overview
The HIL Bench Control Platform is a comprehensive web-based solution developed to address the challenges of managing multiple Hardware-In-Loop (HIL) test benches used in autonomous vehicle development.
The platform enables engineers to remotely monitor bench status, schedule usage, control power and simulation parameters, and collect usage metrics—all from a single intuitive interface. This project significantly improved development efficiency by centralizing bench management and reducing the need for physical bench access.
The Challenge
Prior to this platform, HIL bench management was largely manual and decentralized:
- Engineers needed physical access to benches to control power and settings
- No centralized system existed for scheduling or tracking bench usage
- Status monitoring required physical inspection or numerous separate dashboards
- Configuration management was inconsistent across different bench types
- Bench hardware control required custom tooling for each bench type
- Usage reporting and optimization was difficult without consolidated data
The Solution
I designed and built a comprehensive solution with three main components:
Frontend (React)
- Interactive dashboard showing real-time bench status with filtering
- Scheduling interface with calendar and conflict detection
- Remote control panel for power cycling and configuration changes
- Usage metrics and reporting visualizations
- User authentication with role-based permissions
Backend (Django)
- RESTful API for bench communication and data exchange
- Database design and optimization for bench metadata
- Authentication and permission management
- Background task processing for status updates and notifications
- Data aggregation and reporting endpoints
Bench Agent (FastAPI)
- Dockerized agent running on each HIL bench
- High-performance FastAPI-based API for real-time control
- Hardware interface abstraction layer
- Secure communication with central server
- Local caching for operation during network outages
- Automatic service discovery and registration
Hardware Integration
- Custom protocols for communicating with various bench types
- Power control integration with networked PDUs
- Monitoring integration with existing telemetry systems
- Standardized interfaces for heterogeneous bench environments
System Architecture
The platform follows a distributed architecture with three primary components working together:
Central Server
The Django-based central server hosts the web application, database, and core API. It manages user authentication, scheduling, and coordinates communication with individual bench agents. This component handles global state and provides the primary user interface.
Bench Agents
Each HIL bench runs a containerized FastAPI agent that provides local control and monitoring capabilities. These agents abstract the hardware-specific details of each bench and expose a standardized API for remote control. The containerized approach ensures consistent deployment and isolation from other bench software.
Communication Layer
Secure communication between the central server and bench agents is handled through encrypted REST APIs with authentication tokens. Background tasks handle periodic polling and error recovery.
FastAPI Bench Agent
The FastAPI bench agent was a critical innovation in this project, solving several key challenges:
Technical Features
- Asynchronous API endpoints for non-blocking hardware control
- Automatic OpenAPI documentation for easy integration
- Docker containerization for consistent deployment across bench types
- Hardware abstraction layer with plugin architecture
- Local state caching for resilience during network outages
Key Benefits
- Enabled true remote control of physical bench hardware
- Standardized interface across heterogeneous bench environments
- High performance with minimal resource usage on bench computers
- Simplified addition of new bench types through the plugin system
- Resilient local operation even during network connectivity issues
Implementation
The agent was implemented in Python using FastAPI and packaged as a Docker container for easy deployment. Each bench required minimal configuration to specify hardware details, and the agent would automatically discover available hardware and register capabilities with the central server. This approach dramatically simplified onboarding new benches and reduced maintenance overhead.
Results & Impact
- Reduced bench setup and configuration time by approximately 60%
- Eliminated the need for physical bench access for routine operations
- Improved bench utilization by 35% through better scheduling and monitoring
- Provided valuable usage metrics that informed future bench investments
- Enabled remote work capabilities during COVID-19 restrictions
- Standardized bench management practices across the organization
- Successful deployment across 150+ HIL benches of varying configurations
- Platform became the standard for bench management
Technical Details
Technology Stack
- Frontend: React with RSC and Tailwind for CSS
- Backend: Django and Django REST Framework
- Bench Agent: FastAPI, Pydantic, Docker, Python Hardware SDKs
- Database: PostgreSQL
- DevOps: Docker, Kubernetes, CI/CD pipelines
- Monitoring: Prometheus, Grafana
Architecture Overview
The system follows a microservices architecture with separate services for bench communication, user management, scheduling, and metrics collection. The combination of a centralized Django backend with distributed FastAPI agents provided both scalability and flexibility while making it easier to add support for new bench types over time.
Key Features
- Real-time status updates via WebSockets
- RESTful API for integration with other tools
- Role-based access control with fine-grained permissions
- Automated hardware discovery and registration
- Customizable alerting and notifications
- Remote power control and configuration
- Usage analytics and reporting
Lessons Learned
This project provided valuable insights and learning experiences:
- The importance of stakeholder involvement throughout the design process
- The value of a distributed architecture for hardware control systems
- Challenges of designing interfaces for users with varying technical expertise
- Balancing security requirements with ease of use
- Managing hardware heterogeneity through abstraction layers
- The power of containerization for consistent deployment
- Implementing robust error handling for hardware communication