- KiCad project generated by pcb/tools (design, route, schematic, fab outputs). - v0.4 fixes the v0.3 review findings: low-dropout 3.3 V regulator, OR'd 5 V supply, polyfuse, USB ESD protection, input clamps, ceramic decoupling at the drivers, A4988/DRV8825 jumper, ground stitching. DRC/ERC clean. - v0.3 (as ordered) kept in pcb/archive/v0.3. - FluidNC config.yaml for the board; rho hard limit on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
184 lines
14 KiB
Python
184 lines
14 KiB
Python
"""SandTable Controller (version in VERSION): single source of truth for parts, placement and nets.
|
|
|
|
Board coordinates are mm, y down, origin at the board's top-left corner.
|
|
x = 0 is the edge that faces the table wall (power + USB); x = 80 faces the
|
|
table centre (motor/sensor connectors). The 4 mounting holes reuse the
|
|
Arduino Uno hole pattern so the board drops onto the existing deck standoffs.
|
|
"""
|
|
|
|
VERSION = '0.3'
|
|
BOARD_W = 80.0
|
|
BOARD_H = 63.34
|
|
ORIGIN = (100.0, 100.0) # where board (0,0) lands in KiCad coordinates
|
|
|
|
# ---------------------------------------------------------------- parts
|
|
# ref: (symbol lib_id, footprint lib_id, value, x, y, rot, lcsc, description)
|
|
PARTS = {
|
|
'U1': ('RF_Module:ESP32-WROOM-32E', 'RF_Module:ESP32-WROOM-32E', 'ESP32-WROOM-32E-N8', 43.0, 50.59, 180, '', 'Wi-Fi MCU module (FluidNC)'),
|
|
'U2': ('Interface_USB:CH340C', 'Package_SO:SOIC-16_3.9x9.9mm_P1.27mm', 'CH340C', 22.0, 47.0, 0, 'C84681', 'USB-UART bridge'),
|
|
'U3': ('Regulator_Linear:AMS1117-3.3', 'Package_TO_SOT_SMD:SOT-223-3_TabPin2', 'AMS1117-3.3', 66.0, 41.5, 0, 'C6186', '5V -> 3.3V LDO'),
|
|
'U4': ('74xGxx:74AHCT1G125', 'Package_TO_SOT_SMD:SOT-23-5', '74AHCT1G125', 65.5, 30.0, 0, '', '3.3V -> 5V LED data buffer'),
|
|
'PS1': ('Converter_DCDC:R-785.0-0.5', 'Converter_DCDC:Converter_DCDC_RECOM_R-78E-0.5_THT', 'R-78E5.0-0.5', 18.0, 35.0, 0, '', '12V -> 5V switching regulator'),
|
|
'A1': ('Driver_Motor:Pololu_Breakout_A4988', 'Module:Pololu_Breakout-16_15.2x20.3mm', 'DRV8825 StepStick (theta/spin)', 38.1, 1.9, 270, '', 'Stepper driver socket (DRV8825, 1/32 step)'),
|
|
'A2': ('Driver_Motor:Pololu_Breakout_A4988', 'Module:Pololu_Breakout-16_15.2x20.3mm', 'DRV8825 StepStick (rho/arm)', 59.1, 1.9, 270, '', 'Stepper driver socket (DRV8825, 1/32 step)'),
|
|
'J1': ('Connector:Barrel_Jack', 'Connector_BarrelJack:BarrelJack_CUI_PJ-063AH_Horizontal', '12V DC 5.5x2.1', 12.3, 25.0, 270, '', 'Power input'),
|
|
'J2': ('Connector:USB_C_Receptacle_USB2.0_16P', 'Connector_USB:USB_C_Receptacle_HRO_TYPE-C-31-M-12', 'USB-C', 3.4, 44.0, 270, 'C165948', 'Programming / serial'),
|
|
'J3': ('Connector_Generic:Conn_01x04', 'Connector_JST:JST_XH_B4B-XH-A_1x04_P2.50mm_Vertical', 'SPIN MOTOR', 4.5, 3.4, 270, 'C158012', 'Theta motor (XH-4, matches motor cable)'),
|
|
'J4': ('Connector_Generic:Conn_01x04', 'Connector_JST:JST_XH_B4B-XH-A_1x04_P2.50mm_Vertical', 'ARM MOTOR', 76.5, 3.4, 270, 'C158012', 'Rho motor via slip ring'),
|
|
'J5': ('Connector_Generic:Conn_01x03', 'Connector_JST:JST_XH_B3B-XH-A_1x03_P2.50mm_Vertical', 'HOME SW', 76.5, 18.5, 270, 'C144394', 'Rho home switch (via slip ring)'),
|
|
'J6': ('Connector_Generic:Conn_01x03', 'Connector_JST:JST_XH_B3B-XH-A_1x03_P2.50mm_Vertical', 'HALL', 76.5, 29.6, 270, 'C144394', 'Optional theta hall sensor (5V)'),
|
|
'J7': ('Connector_Generic:Conn_01x03', 'Connector_JST:JST_XH_B3B-XH-A_1x03_P2.50mm_Vertical', 'LED STRIP', 76.5, 40.7, 270, 'C144394', 'WS2812B strip (5V, small strips only)'),
|
|
'J8': ('Connector_Generic:Conn_01x04', 'Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical', 'EXPANSION', 77.5, 52.0, 0, '', '3V3 / IO32 / IO25 / GND'),
|
|
'D1': ('Device:D_Schottky', 'Diode_SMD:D_SMA', 'SS34', 16.0, 22.0, 270, 'C8678', 'Reverse-polarity protection'),
|
|
'D2': ('Device:D_Schottky', 'Diode_SMD:D_SOD-123', 'B5819W', 29.0, 35.0, 0, 'C8598', '5V OR-ing (regulator)'),
|
|
'D3': ('Device:D_Schottky', 'Diode_SMD:D_SOD-123', 'B5819W', 13.0, 39.8, 0, 'C8598', '5V OR-ing (USB)'),
|
|
'D4': ('Device:LED', 'LED_SMD:LED_0603_1608Metric', 'GREEN', 34.0, 30.0, 0, 'C72043', 'Power LED'),
|
|
'D5': ('Device:LED', 'LED_SMD:LED_0603_1608Metric', 'BLUE', 38.0, 30.0, 0, 'C72041', 'Status LED (IO2)'),
|
|
'Q1': ('Transistor_BJT:MMBT3904', 'Package_TO_SOT_SMD:SOT-23', 'MMBT3904', 28.0, 47.2, 0, 'C20526', 'Auto-reset (EN)'),
|
|
'Q2': ('Transistor_BJT:MMBT3904', 'Package_TO_SOT_SMD:SOT-23', 'MMBT3904', 28.0, 51.2, 0, 'C20526', 'Auto-reset (IO0)'),
|
|
'SW1': ('Switch:SW_Push', 'Button_Switch_SMD:SW_SPST_B3U-1000P', 'RESET', 27.5, 55.0, 0, 'C231329', 'EN / reset button'),
|
|
'SW2': ('Switch:SW_Push', 'Button_Switch_SMD:SW_SPST_B3U-1000P', 'BOOT', 22.0, 55.0, 0, 'C231329', 'IO0 / boot button'),
|
|
'C1': ('Device:C_Polarized', 'Capacitor_SMD:CP_Elec_8x10', '100uF 25V', 24.0, 21.0, 0, '', 'Theta driver VMOT bulk'),
|
|
'C2': ('Device:C_Polarized', 'Capacitor_SMD:CP_Elec_8x10', '100uF 25V', 45.5, 21.0, 0, '', 'Rho driver VMOT bulk'),
|
|
'C3': ('Device:C', 'Capacitor_SMD:C_1206_3216Metric', '10uF 25V', 20.5, 39.6, 0, 'C13585', '12V input decoupling'),
|
|
'C4': ('Device:C', 'Capacitor_SMD:C_1206_3216Metric', '10uF 16V', 26.0, 39.6, 0, 'C13585', 'Regulator output'),
|
|
'C5': ('Device:C', 'Capacitor_SMD:C_0805_2012Metric', '10uF', 59.6, 44.0, 90, 'C15850', 'LDO input'),
|
|
'C6': ('Device:C', 'Capacitor_SMD:C_0805_2012Metric', '22uF', 59.6, 39.5, 90, 'C45783', 'LDO output'),
|
|
'C7': ('Device:C', 'Capacitor_SMD:C_0603_1608Metric', '100nF', 27.0, 43.0, 90, 'C14663', 'CH340C decoupling'),
|
|
'C8': ('Device:C', 'Capacitor_SMD:C_0603_1608Metric', '1uF', 54.6, 52.7, 0, 'C15849', 'EN reset delay'),
|
|
'C9': ('Device:C', 'Capacitor_SMD:C_0805_2012Metric', '10uF', 57.5, 54.6, 90, 'C15850', 'ESP32 bulk decoupling'),
|
|
'C10': ('Device:C', 'Capacitor_SMD:C_0603_1608Metric', '100nF', 55.0, 55.0, 90, 'C14663', 'ESP32 decoupling'),
|
|
'C13': ('Device:C', 'Capacitor_SMD:C_0603_1608Metric', '100nF', 61.0, 18.5, 0, 'C14663', 'Home switch filter'),
|
|
'C14': ('Device:C', 'Capacitor_SMD:C_0603_1608Metric', '100nF', 61.0, 20.7, 0, 'C14663', 'Hall filter'),
|
|
'C15': ('Device:C', 'Capacitor_SMD:C_0603_1608Metric', '100nF', 61.0, 30.0, 90, 'C14663', 'Buffer decoupling'),
|
|
'R1': ('Device:R', 'Resistor_SMD:R_0603_1608Metric', '5.1k', 11.5, 42.75, 0, 'C23186', 'USB-C CC1 pull-down'),
|
|
'R2': ('Device:R', 'Resistor_SMD:R_0603_1608Metric', '5.1k', 11.5, 45.75, 0, 'C23186', 'USB-C CC2 pull-down'),
|
|
'R3': ('Device:R', 'Resistor_SMD:R_0603_1608Metric', '10k', 31.0, 45.0, 90, 'C25804', 'Q1 base'),
|
|
'R4': ('Device:R', 'Resistor_SMD:R_0603_1608Metric', '10k', 31.0, 49.5, 90, 'C25804', 'Q2 base'),
|
|
'R5': ('Device:R', 'Resistor_SMD:R_0603_1608Metric', '10k', 54.6, 51.0, 0, 'C25804', 'EN pull-up'),
|
|
'R6': ('Device:R', 'Resistor_SMD:R_0603_1608Metric', '10k', 31.0, 37.5, 0, 'C25804', 'IO0 pull-up'),
|
|
'R8': ('Device:R', 'Resistor_SMD:R_0603_1608Metric', '10k', 47.0, 31.0, 0, 'C25804', 'Driver enable pull-up (off at boot)'),
|
|
'R9': ('Device:R', 'Resistor_SMD:R_0603_1608Metric', '10k', 54.0, 18.5, 0, 'C25804', 'Home switch pull-up'),
|
|
'R10': ('Device:R', 'Resistor_SMD:R_0603_1608Metric', '1k', 57.5, 18.5, 0, 'C21190', 'Home switch series'),
|
|
'R11': ('Device:R', 'Resistor_SMD:R_0603_1608Metric', '10k', 54.0, 20.7, 0, 'C25804', 'Hall pull-up'),
|
|
'R12': ('Device:R', 'Resistor_SMD:R_0603_1608Metric', '1k', 57.5, 20.7, 0, 'C21190', 'Hall series'),
|
|
'R13': ('Device:R', 'Resistor_SMD:R_0603_1608Metric', '330', 70.0, 30.0, 90, 'C23138', 'LED data series'),
|
|
'R14': ('Device:R', 'Resistor_SMD:R_0603_1608Metric', '1k', 34.0, 32.5, 0, 'C21190', 'Power LED'),
|
|
'R15': ('Device:R', 'Resistor_SMD:R_0603_1608Metric', '1k', 38.0, 32.5, 0, 'C21190', 'Status LED'),
|
|
'H1': ('Mechanical:MountingHole', 'MountingHole:MountingHole_3.2mm_M3', 'M3', 15.24, 7.54, 0, '', 'Uno hole'),
|
|
'H2': ('Mechanical:MountingHole', 'MountingHole:MountingHole_3.2mm_M3', 'M3', 13.97, 55.8, 0, '', 'Uno hole'),
|
|
'H3': ('Mechanical:MountingHole', 'MountingHole:MountingHole_3.2mm_M3', 'M3', 66.04, 22.78, 0, '', 'Uno hole'),
|
|
'H4': ('Mechanical:MountingHole', 'MountingHole:MountingHole_3.2mm_M3', 'M3', 66.04, 50.72, 0, '', 'Uno hole'),
|
|
}
|
|
|
|
# ---------------------------------------------------------------- nets
|
|
NETS = {
|
|
'GND': ['J1.2', 'J2.A1', 'J2.A12', 'J2.B1', 'J2.B12', 'J2.S1', 'C1.2', 'C2.2', 'C3.2', 'C4.2', 'C5.2',
|
|
'C6.2', 'C7.2', 'C8.2', 'C9.2', 'C10.2', 'C13.2', 'C14.2', 'C15.2', 'PS1.2', 'U3.1', 'U2.1',
|
|
'U1.1', 'U1.15', 'U1.38', 'U1.39', 'A1.1', 'A1.7', 'A2.1', 'A2.7',
|
|
'J5.3', 'J6.3', 'J7.3', 'J8.4', 'SW1.2', 'SW2.2', 'R1.2', 'R2.2', 'D4.1', 'D5.1', 'U4.1', 'U4.3'],
|
|
'VIN_RAW': ['J1.1', 'D1.2'],
|
|
'+12V': ['D1.1', 'C1.1', 'C2.1', 'C3.1', 'PS1.1', 'A1.8', 'A2.8'],
|
|
'+5V_REG': ['PS1.3', 'C4.1', 'D2.2'],
|
|
'VBUS': ['J2.A4', 'J2.A9', 'J2.B4', 'J2.B9', 'D3.2'],
|
|
'+5V': ['D2.1', 'D3.1', 'U3.3', 'C5.1', 'U4.5', 'C15.1', 'J6.1', 'J7.1'],
|
|
'+3V3': ['U3.2', 'C6.1', 'U1.2', 'C9.1', 'C10.1', 'U2.16', 'U2.4', 'C7.1', 'R5.1', 'R6.1', 'R8.1',
|
|
'R9.1', 'R11.1', 'R14.1', 'J5.1', 'J8.1',
|
|
# DRV8825 sockets: VDD/FAULT, M0-M2 high (1/32 step), RESET + SLEEP high (awake)
|
|
'A1.2', 'A1.10', 'A1.11', 'A1.12', 'A1.13', 'A1.14',
|
|
'A2.2', 'A2.10', 'A2.11', 'A2.12', 'A2.13', 'A2.14'],
|
|
'USB_DP': ['J2.A6', 'J2.B6', 'U2.5'],
|
|
'USB_DM': ['J2.A7', 'J2.B7', 'U2.6'],
|
|
'CC1': ['J2.A5', 'R1.1'],
|
|
'CC2': ['J2.B5', 'R2.1'],
|
|
'U0TXD': ['U1.35', 'U2.3'],
|
|
'U0RXD': ['U1.34', 'U2.2'],
|
|
'DTR': ['U2.13', 'R3.1', 'Q2.2'],
|
|
'RTS': ['U2.14', 'R4.1', 'Q1.2'],
|
|
'Q1B': ['R3.2', 'Q1.1'],
|
|
'Q2B': ['R4.2', 'Q2.1'],
|
|
'EN': ['Q1.3', 'U1.3', 'R5.2', 'C8.1', 'SW1.1'],
|
|
'IO0': ['Q2.3', 'U1.25', 'R6.2', 'SW2.1'],
|
|
'DRV_EN': ['U1.16', 'R8.2', 'A1.9', 'A2.9'],
|
|
'X_STEP': ['U1.30', 'A1.15'],
|
|
'X_DIR': ['U1.31', 'A1.16'],
|
|
'Y_STEP': ['U1.12', 'A2.15'],
|
|
'Y_DIR': ['U1.13', 'A2.16'],
|
|
'X_1A': ['A1.4', 'J3.1'], 'X_1B': ['A1.3', 'J3.2'], 'X_2A': ['A1.5', 'J3.3'], 'X_2B': ['A1.6', 'J3.4'],
|
|
'Y_1A': ['A2.4', 'J4.1'], 'Y_1B': ['A2.3', 'J4.2'], 'Y_2A': ['A2.5', 'J4.3'], 'Y_2B': ['A2.6', 'J4.4'],
|
|
'HOME_RAW': ['J5.2', 'R9.2', 'R10.1'],
|
|
'HOME': ['R10.2', 'C13.1', 'U1.6'],
|
|
'HALL_RAW': ['J6.2', 'R11.2', 'R12.1'],
|
|
'HALL': ['R12.2', 'C14.1', 'U1.7'],
|
|
'LED_DATA': ['U1.9', 'U4.2'],
|
|
'LED_BUF': ['U4.4', 'R13.1'],
|
|
'LED_DOUT': ['R13.2', 'J7.2'],
|
|
'EXP_IO32': ['U1.8', 'J8.2'],
|
|
'EXP_IO25': ['U1.10', 'J8.3'],
|
|
'STAT': ['U1.24', 'R15.1'],
|
|
'STAT_A': ['R15.2', 'D5.2'],
|
|
'PWR_A': ['R14.2', 'D4.2'],
|
|
}
|
|
|
|
# Pins intentionally left unconnected (get no-connect flags in the schematic)
|
|
NO_CONNECT = ['U1.4', 'U1.5', 'U1.14', 'U1.17', 'U1.18', 'U1.19', 'U1.20', 'U1.21', 'U1.22', 'U1.23',
|
|
'U1.11', 'U1.26', 'U1.29', 'U1.32', 'U1.33', 'U1.36', 'U1.37',
|
|
'U2.7', 'U2.8', 'U2.9', 'U2.10', 'U2.11', 'U2.12', 'U2.15',
|
|
'U1.27', 'U1.28', 'J2.A8', 'J2.B8']
|
|
|
|
# ---------------------------------------------------------------- rules
|
|
# net class -> (track width, clearance)
|
|
NETCLASS = {
|
|
'Default': (0.2, 0.16),
|
|
'Power': (0.8, 0.2),
|
|
'Motor': (0.6, 0.2),
|
|
'Rail': (0.5, 0.2),
|
|
}
|
|
NET_TO_CLASS = {}
|
|
for n in ('GND', 'VIN_RAW', '+12V'):
|
|
NET_TO_CLASS[n] = 'Power'
|
|
for n in ('X_1A', 'X_1B', 'X_2A', 'X_2B', 'Y_1A', 'Y_1B', 'Y_2A', 'Y_2B'):
|
|
NET_TO_CLASS[n] = 'Motor'
|
|
for n in ('+5V', '+5V_REG', 'VBUS', '+3V3'):
|
|
NET_TO_CLASS[n] = 'Rail'
|
|
|
|
VIA = (0.6, 0.3) # diameter, drill
|
|
|
|
# PCBWay standard process: 6/6 mil track/space, 0.3 mm min hole, 0.15 mm annular ring.
|
|
# Library footprints with smaller holes (the ESP32's thermal vias are 0.2 mm) are enlarged to fit.
|
|
MIN_DRILL = 0.3
|
|
MIN_RING = 0.2
|
|
|
|
# ---------------------------------------------------------------- sourcing (PCBWay BOM)
|
|
# (refs, manufacturer, manufacturer part number, description, notes). Blank MPN = any brand to the description.
|
|
SOURCING = [
|
|
(['U1'], 'Espressif', 'ESP32-WROOM-32E-N8', 'Wi-Fi + Bluetooth module, 8 MB flash, PCB antenna', ''),
|
|
(['U2'], 'WCH', 'CH340C', 'USB to UART bridge, SOIC-16', ''),
|
|
(['U3'], 'Advanced Monolithic Systems', 'AMS1117-3.3', 'LDO regulator 3.3 V 1 A, SOT-223', 'Any AMS1117-3.3 equivalent ok'),
|
|
(['U4'], 'Texas Instruments', 'SN74AHCT1G125DBVR', 'Single buffer, TTL-level input, SOT-23-5', ''),
|
|
(['PS1'], 'RECOM', 'R-78E5.0-0.5', 'Switching regulator 5 V 0.5 A, SIP-3', ''),
|
|
(['J1'], 'Same Sky (CUI Devices)', 'PJ-063AH', 'DC barrel jack, 2.0 mm pin, fits 5.5 x 2.1 mm plugs', ''),
|
|
(['J2'], 'Korean Hroparts Elec', 'TYPE-C-31-M-12', 'USB-C receptacle, USB 2.0, 16 pin', ''),
|
|
(['J3', 'J4'], 'JST', 'B4B-XH-A(LF)(SN)', 'XH header, 4 pin, 2.5 mm pitch, vertical', ''),
|
|
(['J5', 'J6', 'J7'], 'JST', 'B3B-XH-A(LF)(SN)', 'XH header, 3 pin, 2.5 mm pitch, vertical', ''),
|
|
(['J8'], 'Sullins', 'PRPC004SAAN-RC', 'Male pin header 1 x 4, 2.54 mm pitch, vertical', ''),
|
|
(['A1', 'A2'], 'Sullins', 'PPTC081LFBN-RC', 'Female pin header 1 x 8, 2.54 mm pitch, 8.5 mm tall', '2 headers per driver (4 total). Sockets only: the DRV8825 modules are supplied by me'),
|
|
(['D1'], '', 'SS34', 'Schottky diode 40 V 3 A, SMA', 'Any brand'),
|
|
(['D2', 'D3'], '', 'B5819W', 'Schottky diode 40 V 1 A, SOD-123', 'Any brand'),
|
|
(['D4'], '', '', 'LED green, 0603', 'Any brand'),
|
|
(['D5'], '', '', 'LED blue, 0603', 'Any brand'),
|
|
(['Q1', 'Q2'], 'onsemi', 'MMBT3904LT1G', 'NPN transistor 40 V 200 mA, SOT-23', 'Any MMBT3904 ok'),
|
|
(['SW1', 'SW2'], 'Omron', 'B3U-1000P', 'Tactile switch, SMD, 3 x 2.5 mm', ''),
|
|
(['C1', 'C2'], 'Panasonic', 'EEE-FK1V101GP', 'Aluminium electrolytic capacitor 100 uF 35 V, SMD 8 x 10.2 mm', ''),
|
|
(['C3', 'C4'], '', '', 'Ceramic capacitor 10 uF 25 V X5R, 1206', 'Any brand'),
|
|
(['C5', 'C9'], '', '', 'Ceramic capacitor 10 uF 16 V X5R, 0805', 'Any brand'),
|
|
(['C6'], '', '', 'Ceramic capacitor 22 uF 10 V X5R, 0805', 'Any brand'),
|
|
(['C7', 'C10', 'C13', 'C14', 'C15'], '', '', 'Ceramic capacitor 100 nF 50 V X7R, 0603', 'Any brand'),
|
|
(['C8'], '', '', 'Ceramic capacitor 1 uF 16 V X7R, 0603', 'Any brand'),
|
|
(['R1', 'R2'], '', '', 'Resistor 5.1 k 1%, 0603', 'Any brand'),
|
|
(['R3', 'R4', 'R5', 'R6', 'R8', 'R9', 'R11'], '', '', 'Resistor 10 k 1%, 0603', 'Any brand'),
|
|
(['R10', 'R12', 'R14', 'R15'], '', '', 'Resistor 1 k 1%, 0603', 'Any brand'),
|
|
(['R13'], '', '', 'Resistor 330 1%, 0603', 'Any brand'),
|
|
]
|
|
SOURCING_QTY = {('A1', 'A2'): 4} # BOM lines whose piece count differs from the designator count
|