A 3-DOF robot arm control system with web-based interface, featuring real-time 3D visualization, inverse kinematics, and direct hardware communication via Web Serial API.
- 3D Robot Visualization: Real-time 3D rendering using Three.js and URDF models
- Interactive Control: Smooth joint sliders with real-time feedback
- Inverse Kinematics: Browser-based IK solver for intuitive end-effector control
- Web Serial Communication: Direct hardware communication to STM32 microcontroller
- Protobuf Integration: Type-safe, efficient serialization for serial communication
- CDN-Powered Assets: Optimized asset delivery via Cloudflare R2
- Modern UI: Carbon Design System with responsive design
- Onshape Integration: Automated CAD export and processing
- Asset Optimization: STL mesh processing with hashing and CDN deployment
- URDF Generation: Robot description file creation with proper joint constraints
- CDN Deployment: Automated upload to Cloudflare R2 for fast global delivery
open_arm/
βββ apps/
β βββ webconnect/ # SvelteKit web application
β βββ firmware/ # STM32 firmware (STM32CubeMX + Keil MDK)
βββ packages/
β βββ proto/ # Protobuf definitions for serial communication
β βββ proto-c/ # Generated C code for firmware
β βββ proto-es/ # Generated TypeScript code for web app
β βββ cad/ # CAD processing and CDN deployment
βββ docs/
β βββ paper.md # Technical research paper
βββ .github/workflows/ # GitHub Actions (if needed)
- Frontend: SvelteKit + TypeScript + Three.js
- Backend: STM32F103C8T6 microcontroller
- Communication: Web Serial API + Protobuf packet protocol
- Assets: CDN-hosted URDF models and STL meshes
- Processing: Python-based CAD pipeline with
onshape-to-robot
- Framework: SvelteKit 2.x with TypeScript
- Runtime: Bun (package manager + runtime)
- 3D Graphics: Three.js with URDFLoader
- UI Components: Carbon Design System
- Linting: Biome (ESLint + Prettier replacement)
- Build: Vite with static adapter for GitHub Pages
- Language: Python 3.13+
- Package Manager: uv
- CAD Integration: onshape-to-robot
- Cloud Storage: Cloudflare R2 (S3-compatible)
- Asset Processing: Custom processors for CDN optimization
- Microcontroller: STM32F103C8T6 (ARM Cortex-M3)
- PWM Control: PCA9685 I2C servo driver
- Communication: USB CDC (Virtual COM Port)
- Protocol: Custom packet-based serial protocol
- Bun (latest stable)
- Python 3.13+ with uv
- Chrome/Edge browser (Web Serial API support)
- Keil MDK + STM32CubeMX (for firmware development)
git clone <repository-url>
cd open_arm
# Install dependencies
bun installcd packages/cad
# Install Python dependencies
uv sync
uv pip install -e .
# Setup environment
cp env.example .env
# Edit .env with your Onshape and R2 credentials
# Export and process CAD assets
uv run onshape-to-robot .
# Upload to CDN
uv run python scripts/upload_to_cdn.pycd apps/webconnect
# Setup environment
cp env.example .env
# Edit .env with your CDN URLs
# Start development server
bun run dev
# Open http://localhost:5173 in Chrome/Edgecd apps/firmware
# Open firmware.ioc in STM32CubeMX
# Generate code for MDK-ARM, then open in Keil MDK
# Build and flash to STM32F103C8T6- Connect Hardware: Flash STM32 firmware and connect via USB
- Open WebConnect: Navigate to the web app in Chrome/Edge
- Connect Serial: Click "Connect Serial" and select the STM32 port
- Control Robot: Use sliders or drag the end-effector in 3D view
- Update Onshape: Modify your robot design in Onshape
- Process Assets: Run the CAD processing pipeline
- Deploy to CDN: Upload processed assets to Cloudflare R2
- Update WebConnect: Refresh the web app to load new assets
# Onshape API
ONSHAPE_ACCESS_KEY=your_access_key
ONSHAPE_SECRET_KEY=your_secret_key
# Cloudflare R2
R2_ACCOUNT_ID=your_account_id
R2_ACCESS_KEY_ID=your_access_key
R2_SECRET_ACCESS_KEY=your_secret_key
R2_BUCKET_NAME=openarm-cad-assets
R2_PUBLIC_URL=<your-r2-public-url># CDN Configuration
VITE_CDN_MANIFEST_URL=<your-cdn-manifest-url>/manifest.json
VITE_CDN_PUBLIC_URL=<your-cdn-public-url>The webconnect application is deployed to Vercel, providing a seamless and scalable hosting solution.
- Build Command:
cd apps/webconnect && bun run build - Output Directory:
apps/webconnect/.vercel/output - Framework: SvelteKit
For detailed deployment instructions, please refer to the apps/webconnect/README.md.
bun run dev # Start development server
bun run build # Build for production
bun run preview # Preview production build
bun run check # Type checking
bun run lint # Lint code
bun run format # Format code
bun test # Run testsuv run onshape-to-robot . # Process CAD assets
uv run python scripts/upload_to_cdn.py # Upload to CDNβββ config/ # Configuration constants
βββ core/ # Error handling, logging, environment
βββ cdn/ # CDN asset loading and caching
βββ urdf/ # URDF model loading and asset resolution
βββ three/ # Three.js scene, renderer, controls
βββ ik/ # Inverse kinematics solver
βββ serial/ # Web Serial port management
βββ protocol/ # Packet protocol implementation
βββ state/ # Svelte stores (connection, robot, joints)
βββ ui/ # UI components
βββ utils/ # Utility functions
- Sync Word: 0xAA55
- Commands: Set joint angles, ACK, telemetry
- Checksum: XOR validation
- Rate: 100Hz maximum update rate
- Engine: Three.js with WebGL
- Models: URDF format with STL meshes
- Controls: OrbitControls for camera manipulation
- IK: CCDIK solver for end-effector control
- Asset Caching: CDN with immutable caching (1 year)
- Real-time UI: Immediate visual feedback with throttled serial
- Code Splitting: Dynamic imports for better loading performance
- Memoization: Cached calculations for IK and math operations
- Technical Report - Technical report
- CAD Processing - Asset processing pipeline
- WebConnect - Web application details
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
- Use TypeScript strict mode
- Follow SOLID principles
- Write clean, modular code
- Add tests for new features
- Update documentation
This project is licensed under the MIT License - see the LICENSE file for details.
- Onshape: CAD platform integration
- Three.js: 3D graphics library
- SvelteKit: Web framework
- Carbon Design System: UI components
- STM32: Microcontroller platform
- Live Demo: openarm.vercel.app
- CAD Assets: Onshape
- Documentation: Wiki
Note: This project requires a Chromium-based browser for Web Serial API support. Firefox and Safari are not supported for hardware communication.