Skip to the content
4 layers85 × 56 mmWLKJ2025011CAR MOTOR V1.2, the printed circuit board in 3D

WLKJ2025011CAR MOTOR V1.2

TUO4742/SeedlingRobot

Full-stack ROS2 automatic seedling clamping robot covering mechanical, hardware, STM32/FreeRTOS and motion control.

Size
85 × 56 mm
Copper layers
4
Thickness
1.6 mm
Parts
96
Nets
116
Pads
450
Tracks, vias
387, 159
Pours
27
Routed
Yes
KiCad
KiCad 8.0 (file 20240108)
Created
30 Aug 2026
Updated
20 Oct 2026

Overview

WLKJ2025011CAR MOTOR V1.2 is an open-source printed circuit board by TUO4742, from the TUO4742/SeedlingRobot repository on GitHub. It is a 4-layer board of 85 × 56 mm with 96 parts on 116 nets, routed with 387 tracks and 159 vias.

It is built around the M2.5, KH-6X6X5H-STM and DC-044A-A200, with the SK-22F02-G060 and TYPE-C-16PIN-0 among its other parts. Its parts include 31 capacitors, 20 resistors, 19 connectors, 8 ICs and 5 diodes. It belongs with the robots and motor control boards and the 8051 (CH55x, STC, AT89) boards of this library.

Main components

5

README

README.md

ROS2 自动夹苗机器人

一套面向自动取苗 → 运输 → 放苗作业的全栈移动机器人:从机械结构、自制 PCB、STM32/FreeRTOS 固件, 到 ROS2 导航与定位,全部由本人完成。

起源于 2026 睿抗机器人开发者大赛(CAIR 工程竞技赛道),赛后将工程整理为可复现的开源版本。

Robot assembly

演示视频:docs/media/automatic-seedling-clamping-demo.mp4


1. 这套系统能做什么

能力实现位置状态
麦克纳姆四轮全向移动(前后 / 横移 / 斜行 / 原地旋转)firmware/stm32/Robot/chassis_task.c实机验证
四路编码器测速 + 增量式 PID 闭环firmware/stm32/Headware/encoder.c实机验证
四舵机取苗 / 夹苗 / 放苗姿态与缓动firmware/stm32/Robot/arm_control.c实机验证
PS2 手柄遥控 + 组合键机械臂点动firmware/stm32/Headware/ps2_usart5.c实机验证
300 ms 失联停车、短刹、模式互锁、回中解锁firmware/stm32/Robot/chassis_task.c实机验证
ROS2 导航(AMCL + NavFn + MPPI 全向)ros2_ws/代码完成,待实机联调

2. 系统架构

text
        ┌──────────────────────────────┐
        │  ROS2 (Ubuntu / RDK)          │
        │  chassis_node → /odom → EKF   │
        │  Nav2: AMCL + NavFn + MPPI    │
        └──────────────┬───────────────┘
                       │ UART 14B 下行 / 22B 上行
                       ▼
        ┌──────────────────────────────┐
        │  STM32F103RCT6 + FreeRTOS     │
        │  ┌────────────┬─────────────┐ │
        │  │ 底盘控制    │ 机械臂/舵机  │ │
        │  │ 逆解 + PID  │ 姿态 + 缓动  │ │
        │  └────────────┴─────────────┘ │
        │  安全:失联停车 / 模式互锁      │
        └──────────────┬───────────────┘
                       ▼
            TB6612 ×2 · 编码器 ×4 · 舵机 ×4

3. 实时软件(如实说明)

固件里只有 2 个 FreeRTOS 任务:

任务优先级栈周期作用
defaultTaskNormal512 B1 msCubeMX 生成的占位空任务
chassisTaskHigh4 KB20 ms唯一的业务主循环

chassisTask 在单个循环里串行完成:手柄帧解析 → 三级安全互锁 → 机械臂输入 → 麦轮逆解 → 编码器闭环 → 舵机输出。

刻意不使用队列 / 信号量 / 互斥量,中断与任务之间用 volatile 标志 + 单行双缓冲 + __disable_irq 临界区通信。 理由是控制链路本身是严格顺序的,引入跨任务 IPC 只会增加调度抖动,对 20 ms 周期没有收益。

真正的时间基准由 TIM6 中断(50 Hz) 提供,vTaskDelayUntil 保证任务周期无累积漂移。


4. 底盘运动学

轮序 0=FL, 1=RR, 2=RL, 3=FR(物理接线 remap 后的顺序,不是 FL/FR/RL/RR), K = L + W = 0.168 m,轮径 0.065 m。

逆解(chassis_task.c)

text
FL = vx - vy - K·wz      RR = vx - vy + K·wz
RL = vx + vy - K·wz      FR = vx + vy + K·wz

正解(encoder.c)

text
vx = ( FL + RR + RL + FR) / 4
vy = (-FL - RR + RL + FR) / 4
wz = (-FL + RR - RL + FR) / (4K)

两个方向严格互逆,已验证误差 < 1e-15(见第 8 节自检工具)。


5. 执行机构

定时器资源受限,四路舵机用两种方式驱动:

  • CH1 / CH2:硬件 PWM(PA0 / PA1)
  • CH3 / CH4:比较中断 + GPIO 软件翻转(PC5 / PB0)

时基统一为 TIM5 @ 1 MHz,周期 20 ms(50 Hz),脉宽 500 + angle × 2000 / 180 µs, 限幅 0–180°,缓动步进 2°/20 ms(约 100 °/s)。


6. ROS2 导航栈

ros2_ws/ 是按本机实际参数重写的,不是从别的项目复制。详见 ros2_ws/README.md 与 docs/ROS2导航设计与验证.md。

环节选型
底盘桥接自研 seedling_chassis(C++,50 Hz)
里程计四轮编码器正解 → 积分 → /odom
融合robot_localization EKF(无 IMU,仅轮速)
定位AMCL OmniMotionModel(麦轮必须)
规划NavFn / Dijkstra
控制RotationShim + MPPI motion_model: Omni
限速vx 0.35 / vy 0.30 / wz 0.80

两个麦轮专属坑已避开:

  1. AMCL 不用 OmniMotionModel → 横移会被当成噪声;
  2. velocity_smoother.max_velocity 第二项留空 → 横移在输出前被截成 0。

7. 仓库结构

text
firmware/stm32/     STM32F103RCT6 + FreeRTOS 固件(Keil MDK)
  Robot/            底盘任务、机械臂状态机、麦轮逆解
  Headware/         电机 / 编码器 / 舵机 / PS2 / I2C 驱动
  Doc/              接线说明、ROS2 接口说明
ros2_ws/            ROS2 导航栈(底盘桥接 + Nav2 参数 + URDF)
hardware/           自制控制板 KiCad 工程
mechanical/         四自由度平行夹爪与整车的 STEP / STL / DXF
docs/               媒体素材与设计文档

8. 快速开始

8.1 固件

text
1. Keil MDK 打开 firmware/stm32/MDK-ARM/1_template_led.uvprojx
2. 确认时钟 72 MHz、TIM5 舵机时基、TIM2 PWM、编码器定时器
3. 编译并烧录 STM32F103RCT6
4. 上电前核对:电机方向、舵机零位、急停、通信波特率

8.2 ROS2

bash
cd ros2_ws
source /opt/ros/humble/setup.bash
colcon build --symlink-install
source install/setup.bash

# 建图
ros2 launch seedling_bringup slam.launch.py

# 导航(需先有地图)
ros2 launch seedling_bringup nav2.launch.py map:=/path/to/map.yaml

接入导航前需要给固件补一组二进制串口帧,见 firmware/stm32/Doc/ROS2接口说明.md。

8.3 自检(无需硬件)

bash
python3 ros2_ws/tools/kinematics_check.py    # 正解/逆解闭环、符号语义、分辨率
python3 ros2_ws/tools/protocol_selftest.py   # 14B/22B 帧编解码与校验

两者均为纯 Python,无第三方依赖,退出码 0 表示通过。


9. 已知限制

  • ROS2 导航尚未实机跑通:代码完成并通过静态校验,固件侧接口未实现。
  • 无 IMU:航向完全依赖四轮正解,打滑会导致 yaw 漂移。
  • 低速量化:1320 counts/转,20 ms 采样下 1 个计数 = 7.7 mm/s,低于约 8 mm/s 时速度分辨率明显。
  • 麦轮横移效率低:vy_max 已收敛到 0.30 m/s,不要盲目调高。
  • 无看门狗:stm32f1xx_hal_conf.h 中 IWDG/WWDG 宏被注释,长期无人值守运行需自行补上。
  • 无 HardFault 现场保存:四个 fault handler 均为空 while(1)。

10. 路线图

  • 固件实现 ros_bridge.c,打通 14/22 字节串口协议
  • 实机验证 /odom 尺度与 AMCL 定位精度
  • 补 IWDG 与 HardFault 寄存器快照
  • 用 EKF + 轮速做里程计标定表(替代单一轮径)
  • 加装 IMU(WT9011G4K)后启用 imu0 融合

11. 许可

本项目自研代码采用 MIT License,见 LICENSE。

仓库中的 Drivers/(ST HAL + CMSIS)与 Middlewares/(FreeRTOS)为第三方组件, 遵循其原始许可条款,不受本项目 MIT 许可覆盖。


English Summary

A full-stack ROS2 mecanum mobile robot for automatic seedling clamping: mechanical design, custom PCB, STM32/FreeRTOS firmware (20 ms control loop, 4-wheel incremental PID, 4-servo actuation, lost-link safety), and a ROS2 navigation stack (encoder odometry → robot_localization EKF → AMCL OmniMotionModel → NavFn → MPPI Omni). Kinematics and the serial protocol ship with self-checking scripts. Firmware is field-proven; the ROS2 navigation layer is implemented and statically verified but not yet validated on hardware.

Parts

96
QtyValueFootprintReferences
11100nF/50V/0603WIT_Capacitor_SMD:C_0603_1608MetricC2, C3, C4, C9, C11, C12, C17, C19, C24, C26, C27
710K/1%/0603WIT_Resustor_SMD:R_0603_1608MetricR1, R4, R6, R9, R10, R11, R16
62.54排针/3PIN/直插Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ9, J11, J12, J14, J15, J16
4100K/1%/0603WIT_Resustor_SMD:R_0603_1608MetricR3, R7, R17, R20
410uF/10V/0603WIT_Capacitor_SMD:C_0603_1608MetricC20, C21, C29, C30
410uF/50V/1206Capacitor_SMD:C_1206_3216MetricC5, C6, C13, C14
422uF/25V/1206Capacitor_SMD:C_1206_3216MetricC7, C8, C15, C16
4M2.5MountingHole:MountingHole_2.7mm_M2.5H1, H2, H3, H4
4PH2.0/6PIN/直插Connector_JST:JST_PH_B6B-PH-K_1x06_P2.00mm_VerticalJ1, J2, J3, J4
3100uF/25V/D6.3xL7Capacitor_THT:CP_Radial_D6.3mm_P2.50mmC1, C18, C23
31K/1%/0603WIT_Resustor_SMD:R_0603_1608MetricR2, R14, R18
32.2uF/25V/0603WIT_Capacitor_SMD:C_0603_1608MetricC10, C22, C31
34.7K/1%/0603WIT_Resustor_SMD:R_0603_1608MetricR12, R13, R15
3翠绿色/0603LED_SMD:LED_0603_1608MetricD2, D3, D4
21uF/25V/0603WIT_Capacitor_SMD:C_0603_1608MetricC25, C28
22.54排母/22PIN/直插Connector_PinSocket_2.54mm:PinSocket_1x22_P2.54mm_VerticalJ7, J8
25.6uH/6A/0630/FXL0630-5R6-MWIT_Inductr:L_Changjiang_FXL0630L1, L2
2KH-6X6X5H-STMWIT_Button_Switch_SMD:SW_PUSH_6x6SW2, SW3
2SY8286ARAC/QFN20-3x3Package_DFN_QFN:QFN-20-1EP_3x3mm_P0.45mm_EP1.6x1.6mmU1, U3
2TB6612FNG/SSOP-24Package_SO:SSOP-24_5.3x8.2mm_P0.65mmU2, U5
2XH2.54/4PIN/直插Connector_JST:JST_XH_B4B-XH-A_1x04_P2.50mm_VerticalJ10, J13
10.01R/1%/1W/W1206Resistor_SMD:R_1206_3216MetricR19
113K/1%/0603WIT_Resustor_SMD:R_0603_1608MetricR8
11N5819WS/SOD323Diode_SMD:D_SOD-323_HandSolderingD1
12.54排针/2x4PIN/直插Connector_PinHeader_2.54mm:PinHeader_2x04_P2.54mm_VerticalJ18
12N7002/SOT23-3Package_TO_SOT_SMD:SOT-23Q1
18.66K/1%/0603WIT_Resustor_SMD:R_0603_1608MetricR5
1CH559T/SSOP-20Package_SO:SSOP-20_5.3x7.2mm_P0.65mmU6
1DC-044A-A200WIT_Connector_BarrelJack:BarrelJack_CUI_PJ-079BH_HorizontalJ6
1IP2723T/QFN24-4x4Package_DFN_QFN:QFN-24-1EP_4x4mm_P0.5mm_EP2.5x2.5mmU8
1KF301-5.0-2P/P5.0mmTerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-2_1x02_P5.00mm_HorizontalJ5
1LOGOWIT_LOGO:WIT_20x8G***
1ME6206A33XG/SOT23-3Package_TO_SOT_SMD:TSOT-23U4
1NCEP3040Q/DFN8-3.3x3.3Package_SON:VSON-8_3.3x3.3mm_P0.65mm_NexFETQ2
1QMB-09B-03/D9mmH5.5mmWIT_Buzzer:Buzzer_D9_H5.5_P5BZ1
1SK-22F02-G060WIT_Switch:SK-22F02SW1
1SMAJ12A/SMADiode_SMD:D_SMAD5
1TYPE-C16PIN/卧插Connector_USB:USB_C_Receptacle_GCT_USB4105-xx-A_16P_TopMnt_HorizontalJ19
1USBA/10.0 QHHTZB6.3WIT_USB:USB_A_TH_10x6.8mm_HorizontalJ17
1W25Q32JVSSIQ/SOP-8Package_SO:SOIC-8_5.23x5.23mm_P1.27mmU7

Similar boards

  • 4 layers90 × 100 mmPump board, the printed circuit board in 3D

    Pump board

    TrendBit/SMBR-hardware

    Design file for SMBR hardware modules in KiCAD.

    204 partsGPL-3.0
  • 2 layers50 × 30 mmDAP Link V0 1, the printed circuit board in 3D

    DAP Link V0 1

    do-del/Dap-link

    学习如何制作DapLink中

    44 parts1
  • 2 layers100.5 × 144.5 mmSp-1, the printed circuit board in 3D

    Sp-1

    guthmanny/feahi_rp2350

    Soran SP-1 sampler firmware (RP2350 + ESP32-C6) and CBI-40 hardware

    296 parts
  • 2 layers237 × 139 mmMothbox 5.0.4, the printed circuit board in 3D

    Mothbox 5.0.4

    Digital-Naturalism-Laboratories/Mothbox_Electronics

    This is where the electronics for the Mothbox are developed, such as the PCB! It's copied over from https://github.com/Digital-Naturalism-Laboratories/Mothbox/tree/main/Hardware/PCB so you can check that out if you want…

    182 parts3MIT
  • 2 layers95 × 147.3 mmBadge, the printed circuit board in 3D

    Badge

    hackthenorth/badge-hardware

    KiCAD Files for the 2026 Hacker Badge

    124 parts4
  • 2 layers40 × 61 mmEsp32-4to20ma board, the printed circuit board in 3D

    Esp32-4to20ma board

    Diode663/ESP32_4-20mA_Sensor

    Single-channel industrial 4-20 mA current-loop reader for ESPHome / Home Assistant. ESP32-S3 + INA226, USB-C powered, 24 V loop supply with a constant-current limiter. KiCad 10, generated from Python.

    59 partsCERN-OHL-P-2.0
  • 2 layers106 × 148 mmChirstmas Card, the printed circuit board in 3D

    Chirstmas Card

    emaneric/Electronic-Christmas-Card

    A christmas card made from a PCB with a STM32, LED display, buttons, and buzzer.

    86 partsMIT
  • 4 layers204 × 184 mmPanel, the printed circuit board in 3D

    Panel

    ItsShadowCone/tmfl

    2,711 parts

Questions

How big is the WLKJ2025011CAR MOTOR V1.2 PCB?

It measures 85 × 56 mm and has 4 copper layers, 1.6 mm thick.

What parts does the WLKJ2025011CAR MOTOR V1.2 use?

96 parts, built around the M2.5, KH-6X6X5H-STM, DC-044A-A200 and SK-22F02-G060. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the WLKJ2025011CAR MOTOR V1.2 KiCad files?

From the TUO4742/SeedlingRobot repository on GitHub, at the commit this page was made from: the board is hardware/睿抗-摘苗机器人pcb/WLKJ2025011CAR-MOTOR-V1.2.kicad_pcb and its schematic hardware/睿抗-摘苗机器人pcb/WLKJ2025011CAR-MOTOR-V1.2.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the WLKJ2025011CAR MOTOR V1.2 design in my own project?

Its repository states no licence, so its author keeps all rights: ask TUO4742 before reusing the design.