shibosoftwaredev/f1c100s-linux-nema17-stepper-controller
A four-layer NEMA 17 motor-controller PCB combining an Allwinner F1C100S Linux computer, USB‑PD/buck power system, W5500 Ethernet, STM32 real-time motion control, DRV8825 stepper driver, protection/temperature/current telemetry, USB interfaces, and local LED/buzzer diagnostics.
- Version
- 0.4.56
- License
- unset
- Stars
- 0
power-telemetry.tsx
import { AO3400A } from "./imports/AO3400A"
/** Monitor raw PD voltage separately from the existing hardware enable gate.
* BSS138 and AO3400A share the SOT-23 G/S/D land pattern. The reused CAD body
* is package-equivalent, not a claim that the fitted part is an AO3400A.
* The 3 Mohm gate divider loads the 49.9 kohm pull-up by <0.35 V at 21 V,
* well below the AO4407A's minimum 1.7 V turn-on threshold. Never connect the
* VBUS-referenced HUSB238A GATE directly to an MCU input.
*/
export function PowerTelemetry() {
const resistor = ({name, value, position}: {name: string; value: string; position: {x: number; y: number}}) =>
<resistor name={name} resistance={value} footprint="0402" layer="bottom"
manufacturerPartNumber={value === "1M" ? "0402WGF1004TCE" : "0402WGF1003TCE"}
supplierPartNumbers={{jlcpcb:[value === "1M" ? "C26083" : "C25741"]}}
pcbX={position.x} pcbY={position.y} schX={position.x} schY={position.y}
schRotation={-90} />
const wire = (name: string, ends: { from: string; to: string }) =>
<trace name={name} {...ends} thickness={0.15} />
return <group name="POWER_TELEMETRY" schSheetName="power_monitor" schX={0} schY={0}>
<net name="PD_ADC" />
<net name="PD_POWER_GOOD" />
{resistor({name:"R_PD_ADC_TOP", value:"1M", position:{x:-10,y:6}})}
{resistor({name:"R_PD_ADC_BOTTOM", value:"100k", position:{x:-10,y:3}})}
<capacitor name="C_PD_ADC" capacitance="100nF" maxVoltageRating={16}
footprint="0402" manufacturerPartNumber="CL05B104KO5NNNC"
supplierPartNumbers={{jlcpcb:["C1525"]}} layer="top"
pcbX={-7} pcbY={3} schX={-7} schY={3} schRotation={-90} />
{wire("PD_ADC_RAW_INPUT", {from:".R_PD_ADC_TOP > .pin1",to:".U_PD > .VBUS"})}
{wire("PD_ADC_DIVIDER", {from:".R_PD_ADC_TOP > .pin2",to:".R_PD_ADC_BOTTOM > .pin1"})}
{wire("PD_ADC_FILTER", {from:".C_PD_ADC > .pin1",to:"net.PD_ADC"})}
{wire("PD_ADC_OUTPUT", {from:".R_PD_ADC_BOTTOM > .pin1",to:"net.PD_ADC"})}
{wire("PD_ADC_MCU", {from:".U_MOTION > .pin8",to:"net.PD_ADC"})}
{wire("PD_ADC_RETURN", {from:".R_PD_ADC_BOTTOM > .pin2",to:"net.BOARD_GND"})}
{wire("PD_ADC_FILTER_RETURN", {from:".C_PD_ADC > .pin2",to:"net.BOARD_GND"})}
<AO3400A name="Q_PD_STATUS" manufacturerPartNumber="BSS138"
supplierPartNumbers={{jlcpcb:["C52895"]}} layer="bottom"
pcbX={5} pcbY={4} schX={5} schY={4} />
{resistor({name:"R_PD_STATUS_TOP", value:"1M", position:{x:0,y:7}})}
{resistor({name:"R_PD_STATUS_BOTTOM_A", value:"1M", position:{x:0,y:3}})}
{resistor({name:"R_PD_STATUS_BOTTOM_B", value:"1M", position:{x:0,y:0}})}
{resistor({name:"R_PD_STATUS_PULLUP", value:"100k", position:{x:8,y:7}})}
{wire("PD_STATUS_GATE_INPUT", {from:".R_PD_STATUS_TOP > .pin1",to:".U_PD > .GATE"})}
{wire("PD_STATUS_GATE_DIVIDER", {from:".R_PD_STATUS_TOP > .pin2",to:".Q_PD_STATUS > .G"})}
{wire("PD_STATUS_DIVIDER_TOP", {from:".R_PD_STATUS_BOTTOM_A > .pin1",to:".Q_PD_STATUS > .G"})}
{wire("PD_STATUS_DIVIDER_SERIES", {from:".R_PD_STATUS_BOTTOM_A > .pin2",to:".R_PD_STATUS_BOTTOM_B > .pin1"})}
{wire("PD_STATUS_DIVIDER_RETURN", {from:".R_PD_STATUS_BOTTOM_B > .pin2",to:"net.BOARD_GND"})}
{wire("PD_STATUS_SOURCE_RETURN", {from:".Q_PD_STATUS > .S",to:"net.BOARD_GND"})}
{wire("PD_STATUS_OUTPUT", {from:".Q_PD_STATUS > .D",to:"net.PD_POWER_GOOD"})}
{wire("PD_STATUS_PULLUP", {from:".R_PD_STATUS_PULLUP > .pin1",to:"net.PD_POWER_GOOD"})}
{wire("PD_STATUS_PULLUP_SUPPLY", {from:".R_PD_STATUS_PULLUP > .pin2",to:".U_MOTION > .pin4"})}
{wire("PD_STATUS_MCU", {from:".U_MOTION > .pin20",to:"net.PD_POWER_GOOD"})}
</group>
}