# PenguinCAM Team Configuration (Version 2)
# This file defines machine-specific settings and machining preferences
#
# VERSION 2 FEATURES:
# - Support for multiple machines with different settings
# - Each machine can have its own materials with custom feeds/speeds
# - Machine-specific dimensions, tooling, and preferences
#
# All values are optional - any missing values will use Team 6238 defaults.

# =============================================================================
# CONFIG VERSION AND DEFAULT MACHINE
# =============================================================================
version: 2

# Which machine to use by default (if not specified in UI)
default_machine: Velox

# =============================================================================
# TEAM INFORMATION (applies to all machines)
# =============================================================================
team:
  number: 4909
  name: "Bionics"

# =============================================================================
# MACHINES
# =============================================================================
# Define each machine your team uses. Each can have different:
# - Work envelope dimensions
# - Feeds/speeds for each material (based on machine rigidity)
# - Default tooling
# - Controller settings

machines:
  omio_x8:
    name: "Velox"

    # Machine specifications
    machine:
      manufacturer: "Velox"
      controller: "Mach3"

      # Machine work envelope (inches)
      dimensions:
        x_max: 50
        y_max: 50
        z_max: 8

      # Park position (machine coordinates for safe part access)
      park_position:
        x: 0.5      # X position when parking (machine coords)
        y: -0.5     # Y position when parking (machine coords)
        z: -0.5     # Z position for safe clearance (machine coords, negative = below home)

      # Coordinate systems
      standard_work_offset: "G54"       # Work offset for standard operations
      tube_jig_work_offset: "G55"       # Work offset for tube jig operations

      coolant: "Air"                    # Air, Flood, Mist, None

    # Default tooling for this machine
    default_tool:
      diameter: 0.125                   # 1/8 inch end mill

    # General machining preferences
    machining:
      # Z-axis reference system
      z_reference:
        sacrifice_board_depth: 0.008    # How far to cut into sacrifice board (inches)
        clearance_height: 0.5           # Clearance above material for rapid moves (inches)

      # Tab parameters (for perimeter operations)
      tabs:
        enabled: false                   # Whether to use tabs at all
        width: 0.25                     # Default tab width (inches)
        height: 0.15                    # Default tab height (inches)
        remove_tabs: true               # Automatically remove tabs at end of job

      # Hole detection
      holes:
        detection_tolerance: 0.0001     # Tolerance for detecting circular holes (inches)
        min_millable_multiplier: 1.2    # Minimum hole diameter as multiple of tool diameter

      # Fixturing options
      fixturing:
        pause_before_perimeter: true   # M0 pause before perimeter for screw fixturing

    # Tube facing parameters (for aluminum tube operations)
    tube_facing:
      depth_margin: 0.005               # Extra depth beyond half tube height (inches)
      max_roughing_depth: 0.3           # Maximum depth per roughing pass (inches)
      max_finishing_depth: 0.51         # Maximum depth per finishing pass (inches)

      phase_1:
        roughing_tool_edge: 0.05        # Phase 1 roughing position (inches)
        finishing_tool_edge: 0.0625     # Phase 1 finishing position (inches)

      phase_2:
        roughing_tool_edge: -0.0125     # Phase 2 roughing position (inches)
        finishing_tool_edge: 0.0        # Phase 2 finishing position (inches)

      arc_advance: 0.04                 # Arc advance distance in X (inches)
      arc_radius: 0.05                  # Arc radius for clearing moves (inches)

    # Material-specific settings for THIS MACHINE
    # Desktop mill with good rigidity - moderate speeds
    materials:
      plywood:
        name: "Plywood"
        description: "Standard plywood settings - 18K RPM, 70 IPM cutting"

        spindle_speed: 18000            # RPM
        feed_rate: 70.0                 # Cutting feed rate (IPM)
        ramp_feed_rate: 45.0            # Ramp feed rate (IPM)
        plunge_rate: 32.0               # Plunge feed rate for tab Z moves (IPM)
        traverse_rate: 200.0            # Lateral moves above material (IPM)
        approach_rate: 50.0             # Z approach to ramp start (IPM)

        ramp_angle: 20.0                # Ramp angle in degrees
        ramp_start_clearance: 0.150     # Clearance above material to start ramping (inches)
        stepover_percentage: 0.65       # Radial stepover as fraction of tool diameter
        helix_radius_multiplier: 0.75   # Helix entry radius as fraction of tool radius
        max_slotting_depth: 0.4         # Maximum depth per pass for perimeter slotting (inches)
        peck_drill_depth: 0.05          # Peck depth for G83 drilling small holes (inches)

        tab_width: 0.25
        tab_height: 0.15

      aluminum:
        name: "Aluminum"
        description: "Aluminum - 18K RPM, 50 IPM cutting, 4° ramp"

        spindle_speed: 18s000
        feed_rate: 50.0
        ramp_feed_rate: 32.0
        plunge_rate: 14.0
        traverse_rate: 200.0
        approach_rate: 35.0

        ramp_angle: 4.0
        ramp_start_clearance: 0.050
        stepover_percentage: 0.25
        helix_radius_multiplier: 0.5
        max_slotting_depth: 0.2
        peck_drill_depth: 0.05          # Peck depth for G83 drilling small holes (inches)

        tab_width: 0.25
        tab_height: 0.15

      polycarbonate:
        name: "Polycarbonate"
        description: "Polycarbonate - similar to plywood settings"

        spindle_speed: 18000
        feed_rate: 70.0
        ramp_feed_rate: 45.0
        plunge_rate: 18.0
        traverse_rate: 200.0
        approach_rate: 50.0

        ramp_angle: 20.0
        ramp_start_clearance: 0.100
        stepover_percentage: 0.55
        helix_radius_multiplier: 0.75
        max_slotting_depth: 0.25
        peck_drill_depth: 0.05          # Peck depth for G83 drilling small holes (inches)

        tab_width: 0.25
        tab_height: 0.15

    # Integrations (Google Drive, etc.)
    integrations:
      google_drive:
        enabled: false
        # folder_id: "your_folder_id_here"  # Get from Drive folder URL

# =============================================================================
# NOTES
# =============================================================================
# - To use this config, upload it to the root of your Onshape document tree
# - as "PenguinCAM-config.yaml" and make sure it is shared with your classroom
# - AND with the PenguinCAM app.
#
# - The machine selector will appear in the UI if you have multiple machines
# - Each machine can have completely different feeds/speeds based on rigidity
# - You can add custom materials to any machine
# - V1 configs (without "version: 2") still work and are treated as single machine
