What This Shows
The full competition system boundary: physical crane structure, electronics integration, STM32 firmware, sensors, and actuators. Yellow dashed nodes are supported by the casefile; blue nodes are supported by inspected code.
Team: Yongye Hu Zhixiong Zhang Qiangjian He Huaying Wang Jiali Chen Jiahao Zhou Show all
Advised by: Professor Gang Zhao
Mechanical / PCB Integration Lead
Improved from national third prize to national second prize across two competition seasons.
Built and iterated a competition crane platform across two China University Student Crane Competition seasons. The project combined STM32-based embedded control, distance and attitude sensing, multi-axis motion, servo/pump object handling, mechanical packaging, and custom electronics integration. The public story is intentionally scoped to the competition crane; later mining-crane research and PLC work are separate from this case.
portfolio-gpt-pro-pack/reference/20260417-mechatronic-crane-reference.json and include the competition scope, award progression, hydraulic/fuzzy-PID rationale, 4-layer KiCad PCB consolidation, EMI debugging, and inverse kinematics. The visible 2023 firmware contains a conventional Position_PID implementation; fuzzy PID is supported by the casefile narrative rather than by the inspected 2023 code dump.flowchart LR Operator["Competition operator
starts run"] --> Crane["Mobile crane platform"] subgraph Physical["Physical System"] Mech["Mechanical frame
CAD + packaging"] Hydro["Hydraulic actuation
(casefile-backed)"] Gripper["Servo grippers
vacuum pump"] end subgraph Electronics["Electronics Integration"] PCB["Consolidated 4-layer PCB
(casefile-backed)"] STM32["STM32F103 controller
CubeMX / HAL"] Sensors["Distance, line, limit,
encoder + attitude sensors"] end subgraph Firmware["Firmware Modules"] Init["HAL init + UART callbacks"] Planning["Scan / slot map
task sequencing"] Motion["Stepper, motor,
servo + pump drivers"] Control["Position PID
encoder feedback"] end Crane --> Mech Mech --> Hydro Mech --> Gripper PCB --> STM32 Sensors --> STM32 STM32 --> Init Init --> Planning Planning --> Motion Control --> Motion Motion --> Gripper Motion --> Hydro classDef casefile fill:#fff7df,stroke:#b7791f,color:#2d2410,stroke-dasharray: 5 4; classDef code fill:#eaf4ff,stroke:#2b6cb0,color:#102a43; class Hydro,PCB casefile; class STM32,Sensors,Init,Planning,Motion,Control code;
The full competition system boundary: physical crane structure, electronics integration, STM32 firmware, sensors, and actuators. Yellow dashed nodes are supported by the casefile; blue nodes are supported by inspected code.
The project was not just a controller or a mechanical build. It required co-design across packaging, electronics, sensing, actuation, and firmware behavior.
I helped turn a competition crane from a set of mechanical, electronics, and firmware subsystems into a competition-ready mechatronic platform. The architecture required coordinating physical packaging, custom electronics, STM32 control firmware, sensing, and actuator reliability rather than optimizing any one subsystem in isolation.
Key support: portfolio-gpt-pro-pack/reference/20260417-mechatronic-crane-reference.json, Crane_8_2023/fire_vet6_usart/Core/Src/main.c, GLOBAL/global.c, BSP_STEP, BSP_SERVO, BSP_DISTANCE, BSP_MOTOR, BSP_PID, BSP_ENCODER, packet/packet, plus earlier-season Crane_7_2022/User modules.
flowchart LR Start["Start Run
operator trigger"] Prepare["1. Prepare
init + home axes"] Perceive["2. Perceive
navigate + scan slots"] Pick["3. Pick Objects
boxes + cola/bottle"] Return["4. Return + Signal
reposition + beep"] Start --> Prepare --> Perceive --> Pick --> Return classDef actor fill:#fff7df,stroke:#b7791f,stroke-width:2px,color:#2d2410,font-size:16px; classDef firmware fill:#eaf4ff,stroke:#2b6cb0,stroke-width:2px,color:#102a43,font-size:16px; classDef sensed fill:#edf7ed,stroke:#2f855a,stroke-width:2px,color:#132a1d,font-size:16px; classDef output fill:#fdf2f8,stroke:#b83280,stroke-width:2px,color:#3b1026,font-size:16px; class Start actor; class Prepare firmware; class Perceive sensed; class Pick firmware; class Return output;
A reader-friendly view of one competition run, from operator start to completion feedback. It groups the 2023 firmware sequence into four task phases instead of showing every call.
The flow separates preparation, sensing, manipulation, and completion. That makes it clear how the crane turns sensor information into physical actions without turning the portfolio diagram into raw control-flow code.
The competition routine starts by preparing the embedded controller and recovering a known reference frame, then uses slot scanning to guide object pickup and return. This diagram shows how low-level sensing and actuator routines were composed into a complete crane run rather than isolated device demos.
Key support: Core/Src/main.c calls Servo_Init(), backTo0(), chassis_PosCTRL(), scan(), Catch_BOX(), Catch_COLA(), and BeepApp(); GLOBAL/global.c owns homing/scanning helpers and object-slot bookkeeping; BSP_DISTANCE/bsp_distance.c supports ultrasonic recognition; BSP_SERVO/bsp_servo.c owns pickup routines.
flowchart LR
subgraph Inputs["Inputs"]
UART["UART callbacks
gyro + packet bytes"]
Sense["Ultrasonic, ADC,
limit + encoder reads"]
end
subgraph Processing["Processing"]
Packet["Frame parsing
angle / x / y packet"]
Recognize["Slot recognition
recognize()"]
Book["Occupancy map
book[6]"]
Planner["Task planner
scan + catch order"]
end
subgraph Outputs["Actuation"]
Stepper["Stepper commands
Yaw / X / Z / chassis"]
Servo["Servo + pump
grip and release"]
PID["Position_PID
encoder correction"]
end
UART --> Packet
Sense --> Recognize
Recognize --> Book
Packet --> Planner
Book --> Planner
Planner --> Stepper
Planner --> Servo
Sense --> PID
PID --> Stepper
The main firmware pipeline: interrupt-driven serial input, sensor recognition, occupancy mapping, task planning, and actuator commands. The PID block is limited to the conventional position controller present in the inspected code.
Real-world robotics code has to bridge asynchronous inputs, noisy sensing, persistent state, and timed motion commands. The pipeline shows where data becomes decisions and where decisions become physical movement.
The firmware connects UART packet handling, sensor recognition, object-slot bookkeeping, and actuator control into one processing pipeline. This structure made it possible to reason about object handling as a sequence of verified sensor decisions and bounded motion commands.
Key support: Core/Src/main.c UART callbacks and run sequence; packet/packet.c frame parsing; BSP_DISTANCE/bsp_distance.c ultrasonic recognition; GLOBAL/global.c slot scanning and book[6]; BSP_STEP/bsp_step.c motion commands; BSP_SERVO/bsp_servo.c gripping/pump control; BSP_PID/bsp_pid.c and BSP_ENCODER/bsp_encoder.c for position feedback.
flowchart LR Init["1. Initialize
Boot STM32, configure HAL, enable UART"] Home["2. Home Axes
Reset servo, yaw, X/Z, and limit references"] Scan["3. Navigate + Scan
Move to task zone and map object slots"] Pick["4. Pick Objects
Run box and cola pickup routines"] Finish["5. Return + Signal
Reposition, return, and beep complete"] Init --> Home --> Scan --> Pick --> Finish classDef lifecycle fill:#f7fbff,stroke:#2b6cb0,stroke-width:2px,color:#102a43; class Init,Home,Scan,Pick,Finish lifecycle;
A five-stage lifecycle inferred from the sequential calls in main.c. It is a readable abstraction of the run order, not an explicit enum-based state machine in the firmware.
The lifecycle makes the competition routine easy to review: setup, homing, scan-and-map, pickup, and completion each have different hardware assumptions.
The firmware follows a sequential competition routine that can be understood as five hardware phases. This diagram keeps the lifecycle approachable for reviewers while clearly marking it as an inferred model, not a formal state-machine implementation.
Key support: Core/Src/main.c sequential run order and callbacks; GLOBAL/global.c homing/scanning; BSP_STEP/bsp_step.c motion phases; BSP_SERVO/bsp_servo.c object-handling phases.
flowchart LR Noise["Observed instability
EMI, noise, or drift"] Split["Isolate source
mechanical, electronics, or control"] Hardware["Hardware fix
PCB consolidation + wiring"] Control["Control check
Position_PID + motion routine"] Retest["Retest run
pickup, motion, return"] Boundary["Evidence boundary
casefile + inspected firmware"] Noise --> Split Split --> Hardware Split --> Control Hardware --> Retest Control --> Retest Retest --> Boundary Retest -. repeat if unstable .-> Noise classDef code fill:#eaf4ff,stroke:#2b6cb0,stroke-width:2px,color:#102a43; classDef casefile fill:#fff7df,stroke:#b7791f,stroke-width:2px,color:#2d2410,stroke-dasharray: 5 4; classDef inferred fill:#edf7ed,stroke:#2f855a,stroke-width:2px,color:#132a1d; class Noise,Hardware,Boundary casefile; class Control code; class Split,Retest inferred;
A reliability loop that separates casefile-backed EMI/noise debugging from code-observed position control. It is a debugging model for explaining the work, not a claim that every step appears as one formal firmware routine.
Competition hardware failures can look like controller problems until the physical, electrical, and firmware paths are isolated. This loop shows how the crane story should be read: hardware reliability first, control behavior verified second.
The crane improvement story should emphasize reliability debugging across electronics, packaging, and firmware behavior. The page keeps EMI and PCB consolidation as casefile-backed context while grounding inspected control details in the available STM32 code.
Key support: portfolio-gpt-pro-pack/reference/20260417-mechatronic-crane-reference.json for EMI and PCB consolidation context; BSP_PID/bsp_pid.c, BSP_ENCODER/bsp_encoder.c, BSP_STEP/bsp_step.c, and Core/Src/main.c for inspected firmware behavior.