Skip to content

[WIP] Generate ISO-style technical drawing for Magic Cane#2

Draft
Copilot wants to merge 1 commit intomainfrom
copilot/generate-iso-style-technical-drawing
Draft

[WIP] Generate ISO-style technical drawing for Magic Cane#2
Copilot wants to merge 1 commit intomainfrom
copilot/generate-iso-style-technical-drawing

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 22, 2026

Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.

Original prompt

Objective

Use the Murphy System's AsBuiltGenerator (from IKNOWINOT/Murphy-System) to produce an ISO-style technical drawing of the Magic Cane. The drawing should be committed as documentation in the IKNOWINOT/Magic_cane repository.

Context

Magic Cane Hardware

The Magic Cane is a blind-assist navigation system (ESP32-S3-based) with the following sensor/connectivity suite (from docs/architecture.md and docs/bom.md):

Cane Sensor & Connectivity Suite:

Component Bus Purpose
4× VL53L5CX ToF I²C (multiplexed via TCA9548A) Near-field 8×8 zone ranging in 4 quadrants
1× TFmini-S LiDAR UART1 Forward long-range distance (12 m)
1× VL53L1X downward ToF I²C Drop-off / stair detection
BNO086 IMU I²C Orientation, step detection, tilt
SIM7080G Cellular Modem UART2 LTE Cat-M1/NB-IoT advisory uplink
Nano-SIM Slot Multi-carrier: T-Mobile, AT&T, Verizon
ESP32-S3-DevKitC-1 Main MCU with BLE + Wi-Fi
LiPo Battery 3.7V 2000mAh Power with TP4056 USB-C charge board

360° Haptic Belt (companion device):

Component Bus Purpose
ESP32-S3-DevKitC-1 Belt MCU with BLE + Wi-Fi
8× ERM Vibration Motors GPIO (via DRV2605L drivers) Directional haptic feedback
8× DRV2605L Motor Drivers I²C Haptic driver ICs
BNO086 IMU I²C Belt orientation sensor
LiPo Battery 3.7V 1200mAh Power with TP4056 USB-C charge board

Communication Protocol (Cane → Belt, BLE at 10 Hz):

  • Byte 0: Header 0xCA
  • Bytes 1: Sequence number
  • Bytes 2–9: Motor intensities [0–255] for 8 belt motors
  • Byte 10: Flags (bit 0 = emergency-stop pattern)
  • Byte 11: Checksum (XOR of bytes 0–10)

Murphy System's AsBuiltGenerator

The Murphy System (IKNOWINOT/Murphy-System) includes an AsBuiltGenerator class in Murphy System/src/as_built_generator.py that generates control diagrams from equipment specifications. Key capabilities:

  • AsBuiltGenerator.from_equipment_spec(spec, system_name)ControlDiagram
  • AsBuiltGenerator.generate_point_schedule(diagram) → CSV-ready control point table
  • AsBuiltGenerator.generate_schematic_description(diagram) → text schematic with equipment, instruments, notes
  • AsBuiltGenerator.export_as_built(diagram, fmt) → JSON export
  • DrawingDatabase for deduplication and reference enrichment
  • DrawingElement types include: EQUIPMENT_TAG, INSTRUMENT_TAG, SENSOR, CONTROLLER, SIGNAL_WIRE, POWER_WIRE, CONTROL_WIRE, etc.
  • PointScheduleEntry with point_name, point_type (AI/AO/DI/DO), description, engineering_units

The Murphy System also has a REST API endpoint: POST /api/industry/as-built that can generate control diagrams from equipment specs.

Requirements

1. Create a Python script: docs/generate_iso_drawing.py

This script should:

  • Import/use the Murphy System's AsBuiltGenerator data model patterns (replicate the key dataclasses locally if needed, since Murphy-System is a separate repo)
  • Define the Magic Cane's equipment spec covering ALL components across both the cane and belt
  • Generate an ISO-style isometric/technical drawing in text/ASCII art format that shows:
    • The cane shaft with all sensor positions (4× VL53L5CX in quadrants, TFmini-S forward, VL53L1X downward)
    • The ESP32-S3 MCU and its bus connections (I²C, UART1, UART2)
    • The TCA9548A I²C multiplexer
    • The SIM7080G cellular modem with LTE antenna
    • The BNO086 IMU
    • The LiPo battery and USB-C charge board
    • The 360° haptic belt shown separately with 8 motors around the circumference
    • BLE connection between cane and belt
    • A proper ISO drawing title block with: project name, drawing number, revision, date, scale notation

2. Generate the actual drawing: docs/magic_cane_iso_drawing.txt

The script should output a comprehensive text-based ISO-style drawing file that includes:

  • Sheet 1: System Overview — Isometric view showing cane + belt + phone as three connected subsystems
  • Sheet 2: Cane Control Diagram — All sensor connections to ESP32-S3, showing I²C bus (with MUX), UART1, UART2, BLE radio
  • Sheet 3: Belt Wiring Diagram — 8 motors with DRV2605L drivers, BNO086 IMU, ESP32-S3 MCU
  • Sheet 4: Point Schedule — Table of all control/sensor points (AI/AO/DI/DO classification)

3. Generate a JSON export: docs/magic_cane_as_built.json

Using the Murphy System's export_as_built() format:

{
  "format": "json",
  "generated_at": "<ISO timestamp>",
  "diagram": { ... },
  "point_count": <n>,
  "element_count": <n>,
  "summary": "..."
}

ISO Drawing Standards to Follow

  • Use first-angle projection (ISO standard)
  • Include proper line types: continuous thick (visible edges), continuous thin (dimension/leader lines), dashed (hidden edges)
  • Use ASCII representations: ═══ for thick lines, ─── for thin lines, - - - for dashed/hidden
  • Include dimension annotations where mean...

This pull request was created from Copilot chat.


⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants