A modern, responsive web interface for testing and monitoring LK Motor drivers via RS485.
- 🎨 Modern Dark Theme - Sleek, responsive design optimized for all devices
- 📊 Real-time Monitoring - Live metrics and charts updated every second
- ⚙️ Complete Motion Control - All 8 motion control commands with intuitive UI
- 📈 Live Charts - Real-time visualization of encoder, torque, speed, and angles
- 🔧 Full Protocol Support - Implements all 27 commands from RS485 Protocol V2.35
- Install dependencies:
pip install -r requirements.txtEdit app.py to configure your motor connection:
MOTOR_CONFIG = {
'port': 'COM20', # Change to your serial port
'motor_id': 1, # Motor ID (1-32)
'baudrate': 115200 # Baud rate
}- Start the web server:
python app.py- Open your browser to:
http://localhost:5000
- Motor model and firmware version
- Real-time connection status
- Temperature, voltage, and error status
- Basic Controls: Motor ON/OFF, Stop, Clear Error
- Motion Control:
- Torque Control (MF/MH/MG series)
- Speed Control
- Multi-loop Angle Control (with/without speed limit)
- Single-loop Angle Control (with/without speed limit)
- Increment Angle Control (with/without speed limit)
- Position Controls: Clear multi-angle, Set zero position
-
Real-time Metrics: 9 live metric cards showing:
- Temperature, Voltage, Speed
- Torque/Power, Encoder Position, RPM
- Motor State, Multi-loop Angle, Single-loop Angle
-
Live Charts: 5 real-time charts:
- Encoder Value
- Torque Current
- Speed (dps)
- Single-loop Angle
- Multi-loop Angle
GET /api/status- Get current motor statusGET /api/telemetry- Get telemetry data for charts
POST /api/motor/on- Turn motor onPOST /api/motor/off- Turn motor offPOST /api/motor/stop- Stop motorPOST /api/motor/clear-error- Clear errors
POST /api/motion/torque- Torque controlPOST /api/motion/speed- Speed controlPOST /api/motion/multi-angle-1- Multi-angle control 1POST /api/motion/multi-angle-2- Multi-angle control 2POST /api/motion/single-angle-1- Single-angle control 1POST /api/motion/single-angle-2- Single-angle control 2POST /api/motion/increment-angle-1- Increment angle 1POST /api/motion/increment-angle-2- Increment angle 2
POST /api/position/clear-multi-angle- Clear multi-loop anglePOST /api/position/write-zero-ram- Set zero to RAM
- Backend: Flask (Python)
- Frontend: HTML5, CSS3, JavaScript
- Charts: Chart.js
- Motor Driver: Custom RS485 driver implementation
- All motion control commands include TX/RX logging in the server console
- Telemetry data is stored for the last 100 data points
- Updates occur every 500ms for optimal performance
- The interface is fully responsive and works on desktop, tablet, and mobile
Proprietary - LK Motor RS485 Protocol V2.35