aj0070/dual-motor-encoder

A 60×45 mm dual-motor controller board built around an RP2040 MCU with QSPI flash, USB‑C, encoder inputs, dual DRV8871 H‑bridge drivers, protected power input, 5 V buck and 3.3 V LDO rails, connectors, filtering, and status LEDs.

Version
1.0.0
License
unset
Stars
0

Use with the tscircuit CLI

tsci is the tscircuit CLI. Install it with npm install -g tscircuit.

tsci clone aj0070/dual-motor-encoder  # download the package files into ./dual-motor-encoder
tsci add aj0070/dual-motor-encoder    # add it to your project as @tsci/aj0070.dual-motor-encoder

In a cloned or new (tsci init) project: tsci dev starts a local preview, tsci build outputs Circuit JSON, and tsci push publishes to tscircuit.com.

parts/drivers.tsx

import React from "react"
import { DRV8871DDAR } from "../imports/DRV8871DDAR"
import { KF128_5_08_2P_AA } from "../imports/KF128_5_08_2P_AA"

export const Drivers = () => (
  <>
    <schematicsheet name="MOTOR" displayName="Motor drivers" sheetIndex={3} />
    <schematicsection name="MOT_A" displayName="Motor A" />
    <schematicsection name="MOT_B" displayName="Motor B" />

    <DRV8871DDAR
      name="U3"
      schSheetName="MOTOR"
      schSectionName="MOT_A"
      schX={-8}
      schY={4}
      schWidth={1.96}
      schHeight={1.2}
      pcbX={17.0}
      pcbY={10.0}
      connections={{
        IN1: "net.MOTA_IN1",
        IN2: "net.MOTA_IN2",
        VM: "net.VM",
        GND: "net.GND",
        PGND: "net.GND",
        EP: "net.GND",
        ILIM: "net.MOTA_ILIM",
        OUT1: "net.MOTA1",
        OUT2: "net.MOTA2",
      }}
    />
    <resistor
      name="R13"
      resistance="33k"
      footprint="0603"
      schSheetName="MOTOR"
      schSectionName="MOT_A"
      schX={-11.4}
      schY={4}
      schRotation={270}
      pcbX={11.5}
      pcbY={16.8}
      connections={{ pin1: "net.MOTA_ILIM", pin2: "net.GND" }}
      pcbRotation={90}/>
    <capacitor
      name="C28"
      capacitance="10uF"
      footprint="1206"
      schSheetName="MOTOR"
      schSectionName="MOT_A"
      schX={4}
      schY={4}
      schRotation={270}
      pcbX={11.0}
      pcbY={12.42}
      connections={{ pin1: "net.VM", pin2: "net.GND" }}
    />
    <capacitor
      name="C30"
      capacitance="100nF"
      footprint="0603"
      schSheetName="MOTOR"
      schSectionName="MOT_A"
      schX={5.2}
      schY={4}
      schRotation={270}
      pcbX={11.0}
      pcbY={10.41}
      connections={{ pin1: "net.VM", pin2: "net.GND" }}
    />
    <KF128_5_08_2P_AA
      name="J3"
      pinLabels={{ pin1: "MOTA1", pin2: "MOTA2" }}
      schSheetName="MOTOR"
      schSectionName="MOT_A"
      schX={2}
      schY={8}
      schWidth={1.341}
      pcbX={26.9}
      pcbY={10.0}
      pcbRotation={90}
      connections={{ pin1: "net.MOTA1", pin2: "net.MOTA2" }}
      schHeight={0.4}/>

    <DRV8871DDAR
      name="U4"
      schSheetName="MOTOR"
      schSectionName="MOT_B"
      schX={-8}
      schY={-4}
      schWidth={1.96}
      schHeight={1.2}
      pcbX={17.0}
      pcbY={-10.0}
      connections={{
        IN1: "net.MOTB_IN1",
        IN2: "net.MOTB_IN2",
        VM: "net.VM",
        GND: "net.GND",
        PGND: "net.GND",
        EP: "net.GND",
        ILIM: "net.MOTB_ILIM",
        OUT1: "net.MOTB1",
        OUT2: "net.MOTB2",
      }}
    />
    <resistor
      name="R14"
      resistance="33k"
      footprint="0603"
      schSheetName="MOTOR"
      schSectionName="MOT_B"
      schX={-11.4}
      schY={-4}
      schRotation={270}
      pcbX={12.0}
      pcbY={-14.87}
      connections={{ pin1: "net.MOTB_ILIM", pin2: "net.GND" }}
      pcbRotation={90}/>
    <capacitor
      name="C29"
      capacitance="10uF"
      footprint="1206"
      schSheetName="MOTOR"
      schSectionName="MOT_B"
      schX={4}
      schY={2.5}
      schRotation={270}
      pcbX={11.0}
      pcbY={-12.1}
      connections={{ pin1: "net.VM", pin2: "net.GND" }}
    />
    <capacitor
      name="C31"
      capacitance="100nF"
      footprint="0603"
      schSheetName="MOTOR"
      schSectionName="MOT_B"
      schX={5.2}
      schY={2.5}
      schRotation={270}
      pcbX={11.09}
      pcbY={-10.09}
      connections={{ pin1: "net.VM", pin2: "net.GND" }}
    />
    <KF128_5_08_2P_AA
      name="J4"
      pinLabels={{ pin1: "MOTB1", pin2: "MOTB2" }}
      schSheetName="MOTOR"
      schSectionName="MOT_B"
      schX={2}
      schY={-8}
      schWidth={1.341}
      pcbX={26.9}
      pcbY={-10.0}
      pcbRotation={90}
      connections={{ pin1: "net.MOTB1", pin2: "net.MOTB2" }}
      schHeight={0.4}/>
  </>
)