Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Optical Disc Prototype

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.

Features

  • 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

Screenshots

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

System Requirements

  • 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

Installation

Windows Setup

  1. 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
  2. Run the Application:

    • Download/clone this repository
    • Double-click Prototype.bat
    • The batch file will automatically install required packages and launch the application
  3. Manual Installation (if batch file doesn't work):

    pip install matplotlib numpy
    python Prototype.py

Linux Setup

  1. 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
  2. Install Python dependencies:

    pip3 install matplotlib numpy
  3. Run the Application:

    # Make the shell script executable
    chmod +x Prototype.sh
    
    # Run via shell script
    ./Prototype.sh
    
    # Or run directly
    python3 Prototype.py

Usage

Basic Operation

  1. Launch the application using the appropriate method for your OS

  2. Configure basic parameters in the "Basic Setup" tab:

    • Outer radius (disc size)
    • Number of slots
    • RPM (rotation speed)
    • Duty cycle (slot width ratio)
  3. 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
  4. 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
  5. Analysis: View comprehensive physics calculations in the "Physics Analysis" tab

  6. Export: Save your design using the "Export & Manufacturing" tab

Pattern Types

  • 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

Key Parameters

  • 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

Troubleshooting

Windows Issues

  • "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

Linux Issues

  • "tkinter not found": Install the tkinter package for your distribution (see installation section)
  • Permission denied: Run chmod +x Prototype.sh to make the script executable
  • Display issues: Ensure X11 forwarding is enabled if using SSH: ssh -X username@hostname

General Issues

  • 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

Technical Details

Mathematical Implementation

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.

File Formats

  • CSV Export: Coordinate data for CNC programming
  • DXF Export: CAD-compatible format for design software
  • Manufacturing Reports: Detailed specifications for production

Contributing

This is an open-source project. Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

Support

For issues, questions, or feature requests, please open an issue on the project repository.

Version History

  • 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

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages