gokul/macro-six-usbc

A six-key macro keyboard PCB paired with a separate physical enclosure.

Version
0.1.16
License
unset
Stars
0

Use with the tscircuit CLI

tsci is the tscircuit CLI. Install it with npm install -g tscircuit.

tsci clone gokul/macro-six-usbc  # download the package files into ./macro-six-usbc
tsci add gokul/macro-six-usbc    # add it to your project as @tsci/gokul.macro-six-usbc

In a cloned or new (tsci init) project: tsci dev starts a local preview, tsci build outputs Circuit JSON, and tsci push publishes to tscircuit.com.

simulation/RESULT.md

PCBPCB preview for simulation/RESULT.md
SchematicSchematic preview for simulation/RESULT.md
# Simulation correction and verification

## Fixed locally

AO3401A now uses a native MOSFET component and an explicit PMOS symbol: pin 1 gate, pin 2 source, pin 3 drain. Both Q_MAIN and Q_RGB preserve the manufacturer part, footprint, placement and numbered PCB connections. Passive pin attributes describe their electrical ports without inventing supply pins.

The candidate rebuild checks zero circuit errors, absence of the nine reported source warnings, physical pin/net connections, pads, drills, vias and saved routes. Correct gate/source/drain roles are asserted. Regenerated pours are independently checked for copper/drill clearance. TypeScript checking passes with the clean current dependency installation.

## Simulation executed

The installed tscircuit ngspice engine ran 12 DC operating-point scenarios from the candidate's power-net connectivity and actual resistor/capacitor values. The actual physical pins determine Q_MAIN/Q_RGB terminals, and semantic role assertions prevent the original mismatch returning.

Cases: main off, main on/RGB off, normal RGB load, full-white stress load. Input voltages: 4.4, 5.0, 5.25 V.

Explicit assumptions:
- 1.5 ohms total input-path resistance represents fuse/cable/contact losses; it is not a measured or guaranteed part value.
- AO3401A is approximated as a voltage-controlled switch with 85 milliohms on resistance, a body diode and 1.3 V gate threshold. These bounds draw on the manufacturer datasheet; this is NOT its manufacturer SPICE model. No temperature sweep or switching-time validation.
- MCU load is 20 mA; RGB load is 30 mA normally or 216 mA for stress. Current loads taper below 3.5 V to avoid unphysical constant-current behavior at an unpowered rail. This taper is a numerical testbench assumption, not an RGB datasheet model.
- Power LED uses a generic diode; power-switch operation and MCU gate drive are imposed stimuli. Firmware is not executed by this testbench.

Results at 5 V input:

| Case | VCC | LED rail |
| --- | --- | --- |
| Main off | about 0.88 microvolts | effectively 0 V |
| RGB off | about 4.97 V | below 1 microvolt |
| Normal load | 4.920 V | 4.918 V |
| Full-white stress | 4.625 V | 4.607 V |

At 4.4 V input with full-white stress, LED voltage falls to 4.007 V in this model. These values demonstrate sensitivity to supply losses, not a guaranteed minimum operating margin. No claim is made that every actual component remains in specification under every tested condition.

Full-white stress exceeds the firmware's declared 100 mA USB budget. It is not an approved operating mode. Existing firmware uses 8/255 per channel with green limited to 32/255 for pressed keys; retain that limit. Firmware already drives data low before removing RGB power. The model does not validate actual RGB data-pin injection or USB suspend current.

## Other issues checked

Power LED polarity and switch physical pin definitions showed no counterpart of the MOSFET gate/drain mismatch. Whole-board automatic SPICE export still lacks models for MCU, RGB controllers, fuse, encoder and crystal. The power testbench explicitly models the relevant omitted supply/load behavior; it is not a whole-keyboard emulator. No additional confirmed upstream tscircuit bug was established.

## Files and rerun

From the project root:

    bun simulation/build-candidate.tsx
    bun simulation/power-simulation.ts
    ./node_modules/.bin/tsc --noEmit

Evidence: candidate.circuit.json, candidate-schematic.svg, build.log, power-results.json and twelve power-*.cir netlists.

Included in v0.1.11. Current dependencies regenerate the ground pours and fabrication Gerbers. Physical pad geometry, drill sizes, pin/net connections and firmware remain unchanged; v0.1.11 relocates one SW6 ground via with verified copper/drill clearance. v0.1.10 adjusts the C_X2 ground path and VCC trace angle; independent copper connectivity and clearance checks pass. No PR opened.

This establishes the stated DC model checks only. USB enumeration, firmware execution, actual current/voltage, temperature, inrush and physical assembly still require further testing. It does not certify the board as fully functioning or production-ready.

Manufacturer reference: https://www.aosmd.com/products/mosfets/p-channel-mosfets-8v-60v/ao3401a