A professional optical encoder disc designer with advanced pattern generation capabilities. Create custom slotted discs for optical encoders with precise control over slot patterns, inner flow geometry, and manufacturing specifications.
- Multiple Pattern Types: Straight, S-curve, lightning, spiral, curved, and zigzag inner flow patterns
- Advanced Controls: Flow amplitude, frequency, spiral factor, density, symmetry, decay, and phase shift
- Outer Edge Shapes: Sine wave, S-curve, lightning, and curved outer edge geometries
- Real-time Preview: Live visualization of disc patterns as you adjust parameters
- Physics Analysis: Comprehensive calculations for timing, forces, and manufacturing specs
- Export Options: Save as CSV coordinates, DXF for CAD, or detailed manufacturing reports
- Professional UI: Tabbed interface with separate controls for different aspects of design
The application provides real-time visualization of your optical encoder disc design with separate tabs for:
- Basic setup and main preview
- Outer edge pattern configuration
- Inner flow pattern controls
- Beam analysis and sensor positioning
- Comprehensive physics calculations
- Export and manufacturing specifications
- Python 3.7+ (3.8 or higher recommended)
- Operating System: Windows 10+, Linux, or macOS
- RAM: 4GB minimum, 8GB recommended
- Disk Space: 500MB for Python dependencies
-
Install Python:
- Download Python from python.org
- IMPORTANT: Check "Add Python to PATH" during installation
- Verify installation by opening Command Prompt and typing:
python --version
-
Run the Application:
- Download/clone this repository
- Double-click
Prototype.bat - The batch file will automatically install required packages and launch the application
-
Manual Installation (if batch file doesn't work):
pip install matplotlib numpy python Prototype.py
-
Install Python and pip:
# Ubuntu/Debian sudo apt update sudo apt install python3 python3-pip python3-tkinter # CentOS/RHEL/Fedora sudo dnf install python3 python3-pip python3-tkinter # or: sudo yum install python3 python3-pip tkinter # Arch Linux sudo pacman -S python python-pip tk
-
Install Python dependencies:
pip3 install matplotlib numpy
-
Run the Application:
# Make the shell script executable chmod +x Prototype.sh # Run via shell script ./Prototype.sh # Or run directly python3 Prototype.py
-
Launch the application using the appropriate method for your OS
-
Configure basic parameters in the "Basic Setup" tab:
- Outer radius (disc size)
- Number of slots
- RPM (rotation speed)
- Duty cycle (slot width ratio)
-
Design patterns:
- Outer Edge Shapes: Configure edge geometry in the "Outer Edge Shapes" tab
- Inner Flow Patterns: Design slot flow patterns in the "Inner Flow Patterns" tab
-
Advanced Controls:
- Pattern Density: Controls smoothness (higher = smoother curves)
- Pattern Symmetry: Controls regularity (1.0 = symmetric, other values = asymmetric)
- Amplitude Decay: Controls how amplitude changes from outer to inner edge
- Phase Shift: Rotates the entire pattern around the disc
-
Analysis: View comprehensive physics calculations in the "Physics Analysis" tab
-
Export: Save your design using the "Export & Manufacturing" tab
- Straight: Simple radial slots with subtle effect controls
- S-Curve Inward: Smooth flowing S-shaped paths
- Lightning Inward: Jagged lightning bolt patterns
- Spiral Inward: Spiral paths with angular progression
- Curved Inward: Smooth sinusoidal curves
- Zigzag Inward: Sharp zigzag patterns
- Flow Amplitude (-15 to 15): Pattern intensity and direction
- Flow Frequency (-4 to 4): Oscillation/wave frequency
- Spiral Factor (-3 to 3): Radial and angular twist effects
- Auto Counterbalance: Alternates pattern direction for mechanical balance
- "Python is not recognized": Python wasn't added to PATH during installation. Reinstall Python and check "Add Python to PATH"
- Permission errors: Run Command Prompt as Administrator
- Package installation fails: Check internet connection, try
pip install --user matplotlib numpy
- "tkinter not found": Install the tkinter package for your distribution (see installation section)
- Permission denied: Run
chmod +x Prototype.shto make the script executable - Display issues: Ensure X11 forwarding is enabled if using SSH:
ssh -X username@hostname
- Slow performance: Reduce pattern density for faster updates
- Memory errors: Close other applications, ensure 4GB+ RAM available
- Display scaling: Adjust system display scaling if UI elements are too small/large
The application uses advanced parametric equations for pattern generation:
- Angular offset:
Δθ = A_eff × pattern_function(f_flow, σ, t) / (r × 100) - Radial offset:
Δr = S × A_flow × t × 0.02 - Effective amplitude:
A_eff = A_flow × (1 - A_decay × t)
Where t ∈ [0,1] represents progression from outer to inner edge.
- CSV Export: Coordinate data for CNC programming
- DXF Export: CAD-compatible format for design software
- Manufacturing Reports: Detailed specifications for production
This is an open-source project. Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
For issues, questions, or feature requests, please open an issue on the project repository.
- v1.0: Initial release with basic pattern generation
- v1.1: Added advanced pattern controls and physics analysis
- v1.2: Enhanced inner flow patterns with systematic parameter support
- v1.3: Added comprehensive documentation and cross-platform support