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

manufacturing-legend.ts

/** Compact production legend. Reference designators remain in the assembly
 * source/BOM/CPL; do not print hundreds of unreadable, overlapping tiny names.
 * Keep the four screw-head rings and footprint polarity outlines unchanged.
 */
export const manufacturingLabels = [
  { text: "D", layer: "top", x: -1.5, y: 16.4 },
  { text: "PD", layer: "top", x: 19, y: 19.45 },
  { text: "R", layer: "top", x: 12, y: -0.4 },
  { text: "FEL", layer: "top", x: -18, y: 19.45 },
  { text: "N17", layer: "bottom", x: -0.6, y: 11.8 },
  // Pin numbers track the physical J_MOTOR pads, not a guessed colour order.
  { text: "4", layer: "bottom", x: 0, y: -17.25 },
  { text: "3", layer: "bottom", x: 2, y: -17.25 },
  { text: "2", layer: "bottom", x: 4, y: -17.25 },
  { text: "1", layer: "bottom", x: 6, y: -17.25 },
] as const

export function applyManufacturingLegend(board: any) {
  const db = board.root.db
  const subcircuit = db.source_trace.list().find((t: any) => t.name === "PD_CC1_TO_SINK_CC2")?.subcircuit_id
  if (!subcircuit) throw new Error("Missing carrier for manufacturing legend")
  for (const text of db.pcb_silkscreen_text.list())
    db.pcb_silkscreen_text.delete(text.pcb_silkscreen_text_id)
  for (const [index, label] of manufacturingLabels.entries())
    db.pcb_silkscreen_text.insert({
      pcb_silkscreen_text_id: `manufacturing_label_${index}`,
      text: label.text, layer: label.layer,
      anchor_position: { x: label.x, y: label.y }, anchor_alignment: "center",
      font: "tscircuit2024", font_size: 1.7, ccw_rotation: 0,
      subcircuit_id: subcircuit,
    })
}