astra/nema17-stepper-motor-controller-spring-clamp-rp2040

A 4-layer RP2040 controller board that negotiates USB‑C PD motor power and drives a NEMA17 stepper via a DRV8825, with current sensing, thermal shutdown, RGB status LED, buzzer alarm, optional AS5600 encoder, protection/filtering, and test points.

Version
1.4.0
License
unset
Stars
0

schematic/ThermalProtectionSection.tsx

import { revisionPlacement } from "../mechanical/revision-placement";
import { TMP102AIDRLR } from "../imports/TMP102AIDRLR";
import { SN74LVC1G08DBVR } from "../imports/SN74LVC1G08DBVR";
import { logicTrace, schematicSheets } from "./config";

// Signal width requested by the sensor circuit. The validated route plan
// includes fine-pitch escapes and local supply/ground connections.
const thermalTrace = logicTrace;

const section = {
  schSheetName: schematicSheets.thermalProtection,
  schSectionName: "thermal_protection",
} as const;

/** Sensor is beside the larger DRV8825 package, beside its grounded thermal area.
 * GPIO26/27: I2C1 SDA/SCL. GPIO24: active-low hardware temperature alert.
 * The AND gate preserves the existing MCU + USB-PD enable interlock.
 */
export const ThermalProtectionComponents = () => (
  <>
    <TMP102AIDRLR name="U_TEMP" schWidth={1.6} schHeight={1.2}
      schX={-3} schY={1} schPinStyle={{pin4: {marginLeft: 0.5}}}
      schPinArrangement={{
        leftSide: { pins: [1, 6], direction: "top-to-bottom" },
        rightSide: { pins: [3], direction: "top-to-bottom" },
        topSide: { pins: [5], direction: "left-to-right" },
        bottomSide: { pins: [2, 4], direction: "left-to-right" },
      }} {...section} {...revisionPlacement("U_TEMP", {x:-5.625,y:-8.25})} />
    <SN74LVC1G08DBVR name="U_THERM_GATE" schWidth={1.0} schHeight={0.8}
      schX={4} schY={1}
      schPinArrangement={{
        leftSide: { pins: [1, 2], direction: "top-to-bottom" },
        rightSide: { pins: [4], direction: "top-to-bottom" },
        topSide: { pins: [5], direction: "left-to-right" },
        bottomSide: { pins: [3], direction: "left-to-right" },
      }} {...section} {...revisionPlacement("U_THERM_GATE", {x:-5.625,y:-8.25})} />
    <capacitor name="C_TEMP" capacitance="100nF" footprint="0402" maxDecouplingTraceLength={4}
      supplierPartNumbers={{ jlcpcb: ["C1525"] }} schX={-6} schY={-3}
      schOrientation="vertical" {...section} {...revisionPlacement("C_TEMP", {x:-5.625,y:-8.25})} />
    <capacitor name="C_THERM_GATE" capacitance="100nF" footprint="0402" maxDecouplingTraceLength={4.5}
      supplierPartNumbers={{ jlcpcb: ["C1525"] }} schX={-4} schY={-3}
      schOrientation="vertical" {...section} {...revisionPlacement("C_THERM_GATE", {x:-5.625,y:-8.25})} />
    <resistor name="R_TEMP_SDA" resistance="4.7k" footprint="0402"
      supplierPartNumbers={{ jlcpcb: ["C25900"] }} schX={-8} schY={1.4}
      schOrientation="pos_bottom" {...section} {...revisionPlacement("R_TEMP_SDA", {x:-5.625,y:-8.25})} />
    <resistor name="R_TEMP_SCL" resistance="4.7k" footprint="0402"
      supplierPartNumbers={{ jlcpcb: ["C25900"] }} schX={-6} schY={1.6}
      schOrientation="pos_bottom" {...section} {...revisionPlacement("R_TEMP_SCL", {x:-5.625,y:-8.25})} />
    <resistor name="R_TEMP_ALERT" resistance="10k" footprint="0402"
      supplierPartNumbers={{ jlcpcb: ["C25744"] }} schX={0} schY={1.5}
      schOrientation="pos_bottom" {...section} {...revisionPlacement("R_TEMP_ALERT", {x:-5.625,y:-8.25})} />
    <resistor name="R_ENABLE_PD" resistance="100k" footprint="0402"
      supplierPartNumbers={{ jlcpcb: ["C25741"] }} schX={2} schY={-3}
      schOrientation="vertical" {...section} {...revisionPlacement("R_ENABLE_PD", {x:-5.625,y:-8.25})} />
    <resistor name="R_MCU_ENABLE_PD" resistance="100k" footprint="0402"
      supplierPartNumbers={{ jlcpcb: ["C25741"] }} schX={-1} schY={-3}
      schOrientation="vertical" {...section} {...revisionPlacement("R_MCU_ENABLE_PD", {x:-5.625,y:-8.25})} />
  </>
);

export const ThermalProtectionTraces = () => (
  <>
    <trace name="TEMP_SDA" from=".MCU > .U1 > .GPIO26_ADC0" to=".U_TEMP > .SDA" schDisplayLabel="TEMP_SDA" {...thermalTrace} />
    <trace name="TEMP_SCL" from=".MCU > .U1 > .GPIO27_ADC1" to=".U_TEMP > .SCL" schDisplayLabel="TEMP_SCL" {...thermalTrace} />
    <trace name="TEMP_ALERT_MCU" from=".U_TEMP > .ALERT" to=".MCU_GPIO24_ESCAPE > .bottom" schDisplayLabel="TEMP_OK" {...thermalTrace} />
    <trace name="TEMP_HARDWARE_INTERLOCK" schDisplayLabel="TEMP_OK" from=".U_TEMP > .ALERT" to=".U_THERM_GATE > .B" {...thermalTrace} />
    <trace name="THERMAL_SLEEP_OUTPUT" from=".U_THERM_GATE > .Y" to=".DRIVER > .nSleep" schDisplayLabel="nSLEEP" {...thermalTrace} />
    <trace name="TEMP_GND" from=".U_TEMP > .GND" to=".DRIVER > .EP" {...thermalTrace} thickness="0.3mm" />
    <trace name="TEMP_ADDR_0X48" from=".U_TEMP > .ADD0" to=".U_TEMP > .GND" {...thermalTrace}
      pcbPath={[".U_TEMP > .GND"]} />
    <trace name="THERM_GATE_GND" from=".U_THERM_GATE > .GND" to=".DRIVER > .EP" {...thermalTrace} />
    <trace name="TEMP_POWER" from=".U_TEMP > .V_POS" to=".MCU > .L_AVDD > .pin1" schDisplayLabel="V3V3" {...thermalTrace} />
    <trace name="THERM_GATE_POWER" schDisplayLabel="V3V3" from=".U_THERM_GATE > .VCC" to=".U_TEMP > .V_POS" {...thermalTrace} />
    <trace name="TEMP_DECOUPLE" schDisplayLabel="V3V3" from=".C_TEMP > .pin1" to=".U_TEMP > .V_POS" {...thermalTrace} />
    <trace name="THERM_GATE_DECOUPLE" schDisplayLabel="V3V3" from=".C_THERM_GATE > .pin1" to=".U_THERM_GATE > .VCC" {...thermalTrace} />
    <trace name="SDA_PULLUP" schDisplayLabel="TEMP_SDA" from=".R_TEMP_SDA > .pin1" to=".U_TEMP > .SDA" {...thermalTrace} />
    <trace name="SCL_PULLUP" schDisplayLabel="TEMP_SCL" from=".R_TEMP_SCL > .pin1" to=".U_TEMP > .SCL" {...thermalTrace} />
    <trace name="ALERT_PULLUP" schDisplayLabel="TEMP_OK" from=".R_TEMP_ALERT > .pin1" to=".U_TEMP > .ALERT" {...thermalTrace} />
    <trace name="ENABLE_PULLDOWN" from=".R_ENABLE_PD > .pin1" to=".U_THERM_GATE > .A" schDisplayLabel="PD_MCU_ENABLE" {...thermalTrace} />
    <trace name="MCU_ENABLE_PULLDOWN" from=".R_MCU_ENABLE_PD > .pin1" to=".Q_PD_ENABLE > .source" schDisplayLabel="MCU_ENABLE" {...thermalTrace} />
    {["R_TEMP_SDA", "R_TEMP_SCL", "R_TEMP_ALERT"].map(name => (
      <trace key={name} name={`${name}_3V3`} schDisplayLabel="V3V3" from={`.${name} > .pin2`} to=".U_TEMP > .V_POS" {...thermalTrace} />
    ))}
    <trace name="C_TEMP_GND" from=".C_TEMP > .pin2" to=".U_TEMP > .ADD0" {...thermalTrace} />
    <trace name="C_THERM_GATE_GND" from=".C_THERM_GATE > .pin2" to=".U_THERM_GATE > .GND" {...thermalTrace} />
    <trace name="R_ENABLE_PD_GND" from=".R_ENABLE_PD > .pin2" to=".DRIVER > .EP" {...thermalTrace} />
    <trace name="R_MCU_ENABLE_PD_GND" from=".R_MCU_ENABLE_PD > .pin2" to=".R_SLEEP_PD > .pin2" {...thermalTrace} />
  </>
);