A complete GUI application for controlling DDSM115 and DDSM210 servo motors with automatic motor type detection.
Connection Setup |
Motor Control |
System Information |
- Dual Motor Support: Full support for both DDSM115 and DDSM210 motors
- Automatic Detection: Automatically detects motor type and configures interface
- Smart Control: Adaptive control based on motor capabilities
- DDSM115: Velocity, current, and position control modes
- DDSM210: Velocity control with heartbeat monitoring
- Real-time Monitoring: Live status updates and graphing
- Safety Features: Emergency stop, communication monitoring, heartbeat system
- User-friendly Interface: Clean 3-tab interface with intuitive controls
- Touch-friendly Design: Large buttons and sliders optimized for touch screens
- Diagnostic Tools: Built-in motor testing and diagnostic functions
- Motors:
- DDSM115 Direct Drive Servo Motor (Waveshare) - Full position/velocity/current control
- DDSM210 Direct Drive Servo Motor (Waveshare) - Velocity control only
- Interface:
- DDSM115: USB to RS485 adapter (typically /dev/ttyUSB*)
- DDSM210: Direct USB connection (typically /dev/ttyACM*)
- Power:
- DDSM115: 12-24V DC supply (18V recommended)
- DDSM210: 24V DC supply
- Computer: Any computer with USB port running Python 3.8+
-
Download all files to a folder
-
Run the unified launcher:
chmod +x start.sh ./start.sh
- Automatically handles first-time setup
- Creates virtual environment if needed
- Installs dependencies automatically
- Launches the application
-
Connect your hardware:
- Connect motor to 12-24V power supply
- Connect USB-RS485 adapter between computer and motor
- Power on the motor
Manual Setup:
# Install dependencies manually
pip install pyserial matplotlib numpy
python3 src/ddsm115_gui.pyDevelopment Setup:
# Use existing setup scripts
chmod +x scripts/setup.sh
./scripts/setup.sh- Select your USB-RS485 port (usually
/dev/ttyUSB0or/dev/ttyACM0) - Click Connect
- Motors will be auto-detected and displayed
DDSM115 Control Modes:
π Velocity Control:
- Range: -143 to 143 RPM
- Good for continuous rotation applications
β‘ Current Control:
- Range: -8A to 8A
- Direct torque control
π Position Control:
- Range: 0Β° to 360Β°
- Precise positioning with holding
DDSM210 Control Modes:
π Velocity Control Only:
- Range: -210 to 210 RPM
- Built-in heartbeat monitoring when idle
- Position and current controls disabled (motor limitation)
π Emergency Stop:
- Immediately stops motor
- Halts all motor commands
- Switches to safe velocity mode
π Real-time Monitoring:
- Adjustable scan rate (50ms - 5000ms)
- Live position, velocity, torque display
- Temperature monitoring
- Baudrate: 115200 (default, don't change)
- Timeout: 200ms
- Protocol: Custom 10-byte with CRC8
- DDSM115: Motors use IDs 1-10 (auto-detected), multiple motors supported
- DDSM210: Fixed motor ID 1 (motor ID selection disabled)
- Automatic motor type detection and interface adaptation
β No serial ports found
β Check USB-RS485 adapter is connected
β Check driver installation
β Connection failed
β Try different port (/dev/ttyUSB0, /dev/ttyACM0)
β Check motor power supply
β Verify RS485 wiring
β No motors detected
β Check motor power (12-24V)
β Verify RS485 connections (A+, B-, GND)
β Try manual ID scan in Connection tab
β Motor doesn't move
β Check emergency stop isn't active
β Verify motor is enabled
β Check error codes in monitoring tab
β Slow updates
β Reduce monitoring interval to 100-200ms
β Disable unnecessary logging
β Commands not working
β Check motor is in correct mode
β Use emergency stop and try again
β Check communication status in Connection tab
- OS: Windows 10, macOS 10.14, or Linux (Ubuntu 18.04+)
- Python: 3.8 or higher
- RAM: 100MB
- Disk: 50MB
pyserial>=3.5(for RS485 communication)- Standard Python libraries (tkinter, threading, etc.)
- β Ubuntu 20.04/22.04 (x64)
- β Windows 10/11 (x64)
- β macOS 11+ (Intel/Apple Silicon)
- β Raspberry Pi OS (ARM)
- Always use emergency stop if motor behaves unexpectedly
- Ensure adequate power supply (minimum 2A at 18V)
- Check connections before powering on
- Motor can generate significant torque - secure mounting
- Use appropriate fusing/protection in power circuit
ddsm115-motor-control/
βββ start.sh # Unified launcher (handles setup & launch)
βββ requirements.txt # Python dependencies
βββ README.md # This documentation
βββ .gitignore # Git ignore rules
βββ src/ # Source code
β βββ ddsm115.py # DDSM115 motor control library
β βββ ddsm210.py # DDSM210 motor control library
β βββ ddsm115_gui.py # GUI application (supports both motors)
β βββ example_cli.py # Command-line example
β βββ motor_diagnostic.py # Diagnostic tools
β βββ motor_command_queue.py # Command queue system with auto-detection
β βββ gui_diagnostic.py # GUI diagnostic tools
βββ tests/ # Test suite
β βββ test_*.py # Unit tests
β βββ stress_test_gui.py # Stress testing
βββ scripts/ # Development scripts
β βββ setup.sh # Development setup
β βββ install.sh # Installation script
β βββ run.sh # Run script
β βββ setup.py # Python setup
βββ docs/ # Documentation
βββ ddsm115-portable/ # Generated portable installation
from src.ddsm115 import DDSM115
# Create motor controller
motor = DDSM115(port="/dev/ttyUSB0")
# Connect
if motor.connect():
# Find motors
motors = motor.scan_motors()
# Control motor
motor_id = motors[0]
motor.set_velocity(motor_id, 100) # 100 RPM
# Get feedback
feedback = motor.request_feedback(motor_id)
print(f"Position: {feedback.position}Β°")
# Stop and disconnect
motor.emergency_stop(motor_id)
motor.disconnect()from src.ddsm210 import DDSM210
# Create motor controller
motor = DDSM210(port="/dev/ttyACM0")
# Connect
if motor.connect():
# DDSM210 always uses motor ID 1
motor.set_velocity(1, 150) # 150 RPM
# Get feedback (includes heartbeat when idle)
feedback = motor.request_feedback(1)
print(f"Velocity: {feedback.velocity} RPM")
# Stop and disconnect
motor.set_velocity(1, 0)
motor.disconnect()from src.motor_command_queue import MotorCommandQueue
# Auto-detect motor type
motor_queue = MotorCommandQueue(port="auto") # Will detect port and motor type
if motor_queue.connect():
motor_type = motor_queue.get_motor_type()
print(f"Detected: {motor_type.upper()}")
# Control works regardless of motor type
motor_queue.set_velocity(1, 100)
motor_queue.disconnect()from src.ddsm115 import DDSM115, MotorFeedback
def on_feedback(motor_id: int, feedback: MotorFeedback):
print(f"Motor {motor_id}: {feedback.position:.1f}Β°")
motor = DDSM115()
motor.on_feedback = on_feedback
motor.connect()
# Start automatic monitoring
motor.start_monitoring([1, 2, 3], interval=0.1)- Check the troubleshooting section above
- Run the debug script:
python3 debug_modes.py - Check the connection log in the GUI
- Verify hardware connections
- Port permission issues (Linux):
sudo usermod -a -G dialout $USER - Driver issues (Windows): Install CH340/FTDI drivers
- Python/tkinter missing: Install python3-tk package
This project is licensed under the MIT License - see the LICENSE file for details.
The MIT License is a permissive free software license that allows you to:
- β Use the software for any purpose
- β Modify and distribute the software
- β Include it in proprietary software
- β Sell copies of the software
The only requirement is including the copyright notice and license text in copies.
Quick Start Summary:
- Install Python 3.8+
- Run:
chmod +x start.sh && ./start.sh - Connect motor hardware
- Click "Connect" in the GUI and start controlling!


