{
  "metadata": {
    "id": "rev-spark-flex-rev-11-2159",
    "name": "SPARK Flex Motor Controller",
    "type": "motor_controller",
    "manufacturer": "REV Robotics",
    "part_number": "REV-11-2159",
    "datasheet_url": "https://docs.revrobotics.com/brushless/spark-flex/specs",
    "schema_version": "1.4.0",
    "version": "0.2.0",
    "description": "Dockable smart motor controller with integrated power and shared CAN/PWM control wiring, USB-C, and 10-pin Data Port."
  },
  "domains": [
    {
      "domain": "electrical",
      "supply_voltage_V": [
        6,
        24
      ],
      "power_domains": [
        {
          "id": "main_12v",
          "name": "Main DC Input",
          "nominal_voltage_V": 12,
          "voltage_range_V": [
            6,
            24
          ],
          "max_current_mA": 100000,
          "ground_reference": "common",
          "isolation_type": "non_isolated",
          "description": "Main robot DC bus; absolute max 30V."
        },
        {
          "id": "usb_5v",
          "name": "USB VBUS",
          "nominal_voltage_V": 5,
          "voltage_range_V": [
            4.75,
            5.25
          ],
          "max_current_mA": 500,
          "ground_reference": "common",
          "isolation_type": "non_isolated",
          "description": "USB-C provides 5V for internal microcontroller (not for motor output)."
        },
        {
          "id": "data_5v",
          "name": "Data Port 5V Output",
          "nominal_voltage_V": 5,
          "voltage_range_V": [
            4.75,
            5.25
          ],
          "max_current_mA": 500,
          "ground_reference": "common",
          "isolation_type": "non_isolated",
          "description": "5V sensor supply available on Data Port; current may be reduced on USB-only power."
        }
      ],
      "resources": [
        {
          "id": "power_pos",
          "name": "+ Main Power Lead",
          "description": "Integrated red power input wire (12 AWG, ~450 mm).",
          "connector_type": "pigtail_wire",
          "power_domain_id": "main_12v",
          "functions": [
            {
              "name": "power_input",
              "direction": "sink",
              "signal_class": "power"
            }
          ]
        },
        {
          "id": "flex_dock_connector",
          "name": "Flex Dock Connector",
          "description": "Connector for the Flex Dock.",
          "connector_type": "flex_dock_connector",
          "functions": [
            {
              "name": "flex_dock_connector"
            }
          ]
        },
        {
          "id": "power_neg",
          "name": "- Main Power Lead",
          "description": "Integrated black power/return wire (12 AWG, ~450 mm).",
          "connector_type": "pigtail_wire",
          "power_domain_id": "main_12v",
          "functions": [
            {
              "name": "ground",
              "direction": "sink",
              "signal_class": "ground"
            }
          ]
        },
        {
          "id": "control_yellow_pair",
          "name": "CANH / PWM Signal (yellow pair)",
          "description": "Two yellow 26 AWG control wires; used as CAN_H in CAN mode or PWM signal in PWM mode. Wires are duplicated in parallel for standardized in/out connectors.",
          "connector_type": "pigtail_wire",
          "functions": [
            {
              "name": "can_h",
              "direction": "bidirectional",
              "signal_class": "data",
              "shareable_with": [
                "pwm_input"
              ]
            },
            {
              "name": "pwm_input",
              "direction": "sink",
              "signal_class": "data",
              "shareable_with": [
                "can_h"
              ]
            }
          ]
        },
        {
          "id": "control_green_pair",
          "name": "CANL / Ground (green pair)",
          "description": "Two green 26 AWG control wires; used as CAN_L in CAN mode or ground/return in PWM mode. Wires are duplicated in parallel for standardized in/out connectors.",
          "connector_type": "pigtail_wire",
          "power_domain_id": "main_12v",
          "functions": [
            {
              "name": "can_l",
              "direction": "bidirectional",
              "signal_class": "data",
              "shareable_with": [
                "ground"
              ]
            },
            {
              "name": "ground",
              "direction": "sink",
              "signal_class": "ground",
              "shareable_with": [
                "can_l"
              ]
            }
          ]
        },
        {
          "id": "usb_dp",
          "name": "USB D+",
          "description": "USB 2.0 D+ on USB-C port.",
          "connector_type": "usb_c",
          "functions": [
            {
              "name": "usb_dp",
              "direction": "bidirectional",
              "signal_class": "data"
            }
          ]
        },
        {
          "id": "usb_dm",
          "name": "USB D-",
          "description": "USB 2.0 D- on USB-C port.",
          "connector_type": "usb_c",
          "functions": [
            {
              "name": "usb_dm",
              "direction": "bidirectional",
              "signal_class": "data"
            }
          ]
        },
        {
          "id": "usb_gnd",
          "name": "USB Ground",
          "description": "USB-C ground.",
          "connector_type": "usb_c",
          "power_domain_id": "usb_5v",
          "functions": [
            {
              "name": "ground",
              "direction": "sink",
              "signal_class": "ground"
            }
          ]
        },
        {
          "id": "usb_vbus",
          "name": "USB VBUS",
          "description": "USB-C VBUS (5V from host).",
          "connector_type": "usb_c",
          "power_domain_id": "usb_5v",
          "voltage_input_V": 5,
          "max_continuous_current_mA": 500,
          "functions": [
            {
              "name": "vbus",
              "direction": "sink",
              "signal_class": "power"
            }
          ]
        },
        {
          "id": "data_p1",
          "name": "Data Pin 1",
          "description": "Reserved (Data Port connector pin).",
          "connector_type": "samtec_isdf_2x5_pin",
          "power_domain_id": "data_5v",
          "functions": []
        },
        {
          "id": "data_p2",
          "name": "Data Pin 2",
          "description": "+5V sensor supply (Data Port connector pin).",
          "connector_type": "samtec_isdf_2x5_pin",
          "power_domain_id": "data_5v",
          "functions": [
            {
              "name": "power_output",
              "direction": "source",
              "signal_class": "power"
            }
          ],
          "voltage_output_V": 5,
          "max_continuous_current_mA": 500
        },
        {
          "id": "data_p3",
          "name": "Data Pin 3",
          "description": "Analog Input (0..Vout) (Data Port connector pin).",
          "connector_type": "samtec_isdf_2x5_pin",
          "power_domain_id": "data_5v",
          "functions": [
            {
              "name": "analog_input",
              "direction": "sink",
              "signal_class": "sense"
            }
          ]
        },
        {
          "id": "data_p4",
          "name": "Data Pin 4",
          "description": "Forward Limit Switch Input (Data Port connector pin).",
          "connector_type": "samtec_isdf_2x5_pin",
          "power_domain_id": "data_5v",
          "functions": [
            {
              "name": "digital_input",
              "direction": "sink",
              "signal_class": "sense"
            }
          ]
        },
        {
          "id": "data_p5",
          "name": "Data Pin 5",
          "description": "External Encoder - B Input (Data Port connector pin).",
          "connector_type": "samtec_isdf_2x5_pin",
          "power_domain_id": "data_5v",
          "functions": [
            {
              "name": "QUAD_B",
              "direction": "sink",
              "signal_class": "data"
            }
          ]
        },
        {
          "id": "data_p6",
          "name": "Data Pin 6",
          "description": "Absolute Encoder - Duty Cycle Input (Data Port connector pin).",
          "connector_type": "samtec_isdf_2x5_pin",
          "power_domain_id": "data_5v",
          "functions": [
            {
              "name": "pwm_input",
              "direction": "sink",
              "signal_class": "data"
            }
          ]
        },
        {
          "id": "data_p7",
          "name": "Data Pin 7",
          "description": "External Encoder - A Input (Data Port connector pin).",
          "connector_type": "samtec_isdf_2x5_pin",
          "power_domain_id": "data_5v",
          "functions": [
            {
              "name": "QUAD_A",
              "direction": "sink",
              "signal_class": "data"
            }
          ]
        },
        {
          "id": "data_p8",
          "name": "Data Pin 8",
          "description": "Reverse Limit Switch Input (Data Port connector pin).",
          "connector_type": "samtec_isdf_2x5_pin",
          "power_domain_id": "data_5v",
          "functions": [
            {
              "name": "digital_input",
              "direction": "sink",
              "signal_class": "sense"
            }
          ]
        },
        {
          "id": "data_p9",
          "name": "Data Pin 9",
          "description": "External Encoder - Index Input (Data Port connector pin).",
          "connector_type": "samtec_isdf_2x5_pin",
          "power_domain_id": "data_5v",
          "functions": [
            {
              "name": "digital_input",
              "direction": "sink",
              "signal_class": "data"
            }
          ]
        },
        {
          "id": "data_p10",
          "name": "Data Pin 10",
          "description": "Ground (Data Port connector pin).",
          "connector_type": "samtec_isdf_2x5_pin",
          "power_domain_id": "data_5v",
          "functions": [
            {
              "name": "ground",
              "direction": "sink",
              "signal_class": "ground"
            }
          ]
        }
      ],
      "interfaces": [
        {
          "id": "power_input",
          "name": "Main Power Input",
          "description": "Main DC power input via integrated 12 AWG leads.",
          "protocol": {
            "type": "power",
            "role": "input"
          },
          "requires": [
            {
              "function": "power_input",
              "count": 1
            },
            {
              "function": "ground",
              "count": 1
            }
          ],
          "constraints": {
            "min_wire_gauge_awg": 12
          }
        },
        {
          "id": "flex_dock_connector",
          "name": "Flex Dock Connector",
          "description": "Connector for the Flex Dock.",
          "connector_type": "flex_dock_connector",
          "requires": [
            {
              "function": "flex_dock_connector",
              "count": 1
            }
          ]
        },
        {
          "id": "control_can_pwm",
          "name": "CAN/PWM Control",
          "description": "Shared control wiring for CAN or servo-style PWM. Device auto-detects CAN vs PWM on the same twisted, duplicated yellow/green pair. Yellow pair is CAN_H (or PWM signal); green pair is CAN_L (or PWM ground). PWM input timing: 1000/1500/2000 µs nominal, valid 500–2500 µs, 50–200 Hz; 50 ms timeout.",
          "protocol": {
            "type": "can",
            "role": "peer"
          },
          "requires": [
            {
              "function": "can_h",
              "count": 1
            },
            {
              "function": "can_l",
              "count": 1
            }
          ],
          "constraints": {
            "min_wire_gauge_awg": 26
          }
        },
        {
          "id": "usb_c",
          "name": "USB-C Configuration",
          "description": "USB-C port for configuration/control (USB 2.0). Can power internal MCU but not motor output. USB is one of the supported control interfaces.",
          "protocol": {
            "type": "usb",
            "role": "device"
          },
          "requires": [
            {
              "function": "usb_dp",
              "count": 1
            },
            {
              "function": "usb_dm",
              "count": 1
            },
            {
              "function": "ground",
              "count": 1
            }
          ],
          "constraints": {
            "requires_impedance_matching": true,
            "max_cable_length_m": 5
          }
        },
        {
          "id": "data_port",
          "name": "Data Port (2x5 keyed/locking)",
          "description": "10-pin Data Port for sensor I/O: 5V supply, analog input, quadrature A/B/index, limit switch inputs, and duty-cycle input for absolute encoder.",
          "protocol": {
            "type": "custom",
            "role": "device"
          },
          "requires": [
            {
              "function": "power_output",
              "count": 1
            },
            {
              "function": "ground",
              "count": 1
            },
            {
              "function": "analog_input",
              "count": 1
            },
            {
              "function": "QUAD_A",
              "count": 1
            },
            {
              "function": "QUAD_B",
              "count": 1
            },
            {
              "function": "pwm_input",
              "count": 1
            },
            {
              "function": "digital_input",
              "count": 3
            }
          ]
        }
      ],
      "pin_count": 18
    },
    {
      "domain": "mechanical",
      "resources": [
        {
          "id": "mount_hole_1",
          "name": "Mounting Hole 1",
          "description": "#10-32 threaded mounting hole on 2 in bolt circle (max depth 0.25 in).",
          "connector_type": "threaded_hole",
          "functions": [
            {
              "name": "mounting_hole"
            }
          ]
        },
        {
          "id": "mount_hole_2",
          "name": "Mounting Hole 2",
          "description": "#10-32 threaded mounting hole on 2 in bolt circle (max depth 0.25 in).",
          "connector_type": "threaded_hole",
          "functions": [
            {
              "name": "mounting_hole"
            }
          ]
        },
        {
          "id": "mount_hole_3",
          "name": "Mounting Hole 3",
          "description": "#10-32 threaded mounting hole on 2 in bolt circle (max depth 0.25 in).",
          "connector_type": "threaded_hole",
          "functions": [
            {
              "name": "mounting_hole"
            }
          ]
        },
        {
          "id": "mount_hole_4",
          "name": "Mounting Hole 4",
          "description": "#10-32 threaded mounting hole on 2 in bolt circle (max depth 0.25 in).",
          "connector_type": "threaded_hole",
          "functions": [
            {
              "name": "mounting_hole"
            }
          ]
        },
        {
          "id": "mount_hole_5",
          "name": "Mounting Hole 5",
          "description": "#10-32 threaded mounting hole on 2 in bolt circle (max depth 0.25 in).",
          "connector_type": "threaded_hole",
          "functions": [
            {
              "name": "mounting_hole"
            }
          ]
        },
        {
          "id": "mount_hole_6",
          "name": "Mounting Hole 6",
          "description": "#10-32 threaded mounting hole on 2 in bolt circle (max depth 0.25 in).",
          "connector_type": "threaded_hole",
          "functions": [
            {
              "name": "mounting_hole"
            }
          ]
        }
      ],
      "interfaces": [
        {
          "id": "mounting_holes",
          "name": "Mounting Holes",
          "description": "Threaded mounting holes (#10-32 on 2 in bolt circle, max depth 0.25 in).",
          "protocol": {
            "type": "threaded_connection",
            "role": "mounting_point"
          },
          "requires": [
            {
              "function": "mounting_hole",
              "count": 6
            }
          ]
        }
      ],
      "metadata": {
        "mounting_method": "threaded_holes",
        "field_serviceable": true,
        "requires_special_tools": false
      }
    },
    {
      "domain": "thermal",
      "resources": [],
      "interfaces": []
    },
    {
      "domain": "pneumatic",
      "resources": [],
      "interfaces": []
    },
    {
      "domain": "hydraulic",
      "resources": [],
      "interfaces": []
    },
    {
      "domain": "network",
      "resources": [],
      "interfaces": []
    }
  ]
}