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
coil-current.tsx
import { INA241B1IDDFR } from "./imports/INA241B1IDDFR"
import { TCC0201X7R104K160ZT as Capacitor0201 } from "./imports/TCC0201X7R104K160ZT"
import { Fragment } from "react"
import { HoLRT1206_1W_300mR_1_ } from "./imports/HoLRT1206_1W_300mR_1_"
/** Independent inline telemetry; do not change the DRV8825 regulation shunts.
* Gain 10 x 0.30 ohm = 3 V/A. REF1=VDDA and REF2=GND center the signed
* readings at VDDA/2. At +/-0.40 A, nominal outputs are 0.45 / 2.85 V.
* Input pairs must be Kelvin-connected to the two inline resistor pads.
*/
export function CoilCurrent() {
const trace = (name: string, ends: {from: string; to: string; thickness?: number; maxLength?: number}) =>
<trace name={name} thickness={0.15} {...ends} />
return <group name="COIL_CURRENT" pcbX={0} pcbY={0} schX={0} schY={0} schSheetName="coil_current">
{[{phase:"A",y:3,mcu:12,motor:4},{phase:"B",y:-3,mcu:15,motor:1}].map(({phase,y,mcu,motor}) => <Fragment key={phase}>
<net name={`COIL_${phase}_ADC`} />
<HoLRT1206_1W_300mR_1_ name={`R_INLINE_${phase}`} layer="bottom"
pcbX={0} pcbY={y} schX={-6.5} schY={y} schOrientation="vertical" />
<INA241B1IDDFR name={`U_CURRENT_${phase}`} layer="bottom"
pcbX={5} pcbY={y} schX={-3} schY={y} schWidth={1.6} schHeight={1.5}
schPinArrangement={{leftSide:[8,1],rightSide:[5],topSide:[6,7],bottomSide:[2,3,4]}} />
{/* Reuse the checked 0201 land pattern, not its depleted catalog code.
The regulated 3.3 V VS bypass uses an orderable 10 V X7R part. */}
<Capacitor0201 name={`C_CURRENT_${phase}_SUPPLY`} maxVoltageRating={10}
manufacturerPartNumber="TCC0201X7R104K100ZT" supplierPartNumbers={{jlcpcb:["C7393837"]}}
layer="bottom"
pcbX={8} pcbY={y} schX={-10} schY={phase === "A" ? 1 : -0.5} schRotation={-90} />
<resistor name={`R_CURRENT_${phase}_FILTER`} resistance="1k" footprint="0402"
manufacturerPartNumber="0402WGF1001TCE" supplierPartNumbers={{jlcpcb:["C11702"]}}
layer="bottom" pcbX={9} pcbY={y} schX={1} schY={y} />
<capacitor name={`C_CURRENT_${phase}_FILTER`} capacitance="100nF" maxVoltageRating={16}
footprint="0402" manufacturerPartNumber="CL05B104KO5NNNC"
supplierPartNumbers={{jlcpcb:["C1525"]}} layer="bottom"
pcbX={11} pcbY={y} schX={3.5} schY={y-1.5} schRotation={-90} />
{trace(`MOTOR_${phase}_SENSED_PLUS`, {from:`.R_INLINE_${phase} > .pin2`,to:`.J_MOTOR > .pin${motor}`,thickness:0.3})}
{trace(`CURRENT_${phase}_KELVIN_POS`, {from:`.U_CURRENT_${phase} > .IN_POS`,to:`.R_INLINE_${phase} > .pin1`})}
{trace(`CURRENT_${phase}_KELVIN_NEG`, {from:`.U_CURRENT_${phase} > .IN_NEG`,to:`.R_INLINE_${phase} > .pin2`})}
{trace(`CURRENT_${phase}_SUPPLY`, {from:`.U_CURRENT_${phase} > .VS`,to:".U_MOTION > .pin4"})}
{trace(`CURRENT_${phase}_REF_HIGH`, {from:`.U_CURRENT_${phase} > .REF1`,to:`.U_CURRENT_${phase} > .VS`})}
{trace(`CURRENT_${phase}_GROUND`, {from:`.U_CURRENT_${phase} > .GND`,to:"net.BOARD_GND"})}
{trace(`CURRENT_${phase}_REF_LOW`, {from:`.U_CURRENT_${phase} > .REF2`,to:"net.BOARD_GND"})}
{trace(`CURRENT_${phase}_RESERVED_GND`, {from:`.U_CURRENT_${phase} > .NC`,to:"net.BOARD_GND"})}
{trace(`CURRENT_${phase}_DECOUPLE`, {from:`.C_CURRENT_${phase}_SUPPLY > .pin1`,to:`.U_CURRENT_${phase} > .VS`,maxLength:8})}
{/* Explicit terminal-to-terminal ground-tree budgets. Both capacitors
also have a nearby full-stack ground stitch; the generic inferred
1 mm component-to-component limit does not describe that return. */}
{trace(`CURRENT_${phase}_DECOUPLE_GND`, {from:`.C_CURRENT_${phase}_SUPPLY > .pin2`,to:"net.BOARD_GND",maxLength:phase==="A"?8:3})}
{trace(`CURRENT_${phase}_OUTPUT`, {from:`.U_CURRENT_${phase} > .OUT`,to:`.R_CURRENT_${phase}_FILTER > .pin1`})}
{trace(`CURRENT_${phase}_FILTER`, {from:`.R_CURRENT_${phase}_FILTER > .pin2`,to:`net.COIL_${phase}_ADC`})}
{trace(`CURRENT_${phase}_FILTER_CAP`, {from:`.C_CURRENT_${phase}_FILTER > .pin1`,to:`net.COIL_${phase}_ADC`})}
{trace(`CURRENT_${phase}_FILTER_GND`, {from:`.C_CURRENT_${phase}_FILTER > .pin2`,to:"net.BOARD_GND"})}
{trace(`CURRENT_${phase}_MCU`, {from:`.U_MOTION > .pin${mcu}`,to:`net.COIL_${phase}_ADC`})}
</Fragment>)}
</group>
}