DANIEL YIN

Fully custom FOC stepper driver

Designed from component selection through PCB layout: MCU, dual encoders, driver, current sensing, clock, power management and communication module. The firmware is a custom software fork of SimpleFOC.

The NEMA23 steppers reached 3,000 rpm, achieving QDD-level dynamics in my Tepan system at 1/100 the cost. After all bugs were fixed, the system remained stable over 18 months of continuous use.

sneak peak to my development process

pcb-design

development · 2024–2025
theni

Hey guys i'm pretty new to this, made this with JLC's own app and parts. This is for a 36V, 2.8A nema23 2phased stepper motor with inline current sensing to take advantage of the new update, It has two encoders for permanent absolute position over multiple full rotations. Would really appreciate a quick review. Many thanks in advance!

Initial stepper driver schematic, including MCU, power circuits and two encoders
theni

Here's the schematic after all the changes!

  • F401 -> G431
  • AS5600(I2C) -> MT6816(SPI)
  • NRST incorporated into SWD connector (i couldn't find a normal looking 1.27 connector from JLC for some reason, do you know the part name?)
  • Didn't do anything to the BOOT0 coz i don't have any other way to debug and i'll just assume NRST SWD works
  • Pullups added to both nCS lines
(edited)
Revised schematic with G431 MCU, SPI encoders and updated debug connector
theni

Hey guys so my first layer is mostly done, i put most of the power and switching circuits on the upper left portion of the top layer. One thing i had to sacrifice is the analogue sense line from the two current sensors on the top left has to go through one of the center layers (green traces) (currently it's passing through the analogue ground layer across some power traces on the top layer which i tried to minimize).

(edited)
PCB layout showing switching circuits, current sensing and inner-layer signal routing
theni

[redacted] so this is what i ended up doing, PGND only meets rest of the ground through the thermal pad under the driver.

PCB ground plane joining power ground through the driver thermal pad
theni

i had to add __weak to some platformio ststm32 libraries to even make my hal callback compile

(edited)
STM32 HAL UART callbacks updated with the __weak attribute
theni

Its an aliexpress one for testing up to 10Nm static with 0.04Nm accuracy

Stepper motor and custom driver mounted on a static torque testing instrument
probing and debug after full robot assembly
theni

very weird new bug where whenever the system reaches a high speed it looses control and continues at that speed all the way until the end of the mechanical system and bounces back to the other end and oscillates. I really don't think it's a pid issue tho since i tried all kinds of combinations. This happens in both torque mode and velocity mode. But can be effectively prevented by setting a constrain on velocity.

(edited)
Motor telemetry plots showing high-speed oscillation and velocity constraint debugging

... all bugs were fixed and system remained stable over 18mo of continuous use, more to show after product launch...

DANIEL YIN

Custom FOC Stepper Driver

Fully custom NEMA23 FOC stepper driver, from MCU, encoders and driver to clock, power management and communications. Custom SimpleFOC-based firmware reached 3,000 rpm, delivering QDD-level dynamics in my Tepan system at 1/100 the cost.

AR Robotic Sandbox

An AR virtual sandbox that tells a Franka Panda robotic arm where to place bricks. The AR application records and outputs brick sequence and position to a path planning system built using ROS. Robot control was implemented through Movelt.

Modular Smart Button

A innovative structural design for modular smart buttons in the form factor of a men's shirt button. The one in the picture shows an IC Button housing a 32-bit SAM Microcontroller and its power regulating circuit. The button can also house batteries, sensors and actuators. The buttons connect to each other with up to 8 conductive threads.

Audio Processing Dancing Segway

A self-balancing robot that dances to the beat of any music. Coded from scratch from a set of sensors, drivers and an empty pyboard.

3D printer designs and builds

Over 2 years of founding and running the Creative Engineering Workshop at his highschool, Daniel and the team designed and built 3 different 3d printing systems. He was later invited as the youngest member of the additive manufaturing association of the Guangdong province in China and secured his first internship at Riton Lazers co., ltd.

Dynamic Stress Propagation & Energy Absorption of Lattices

Generated and investigated the dynamic stress propagation and energy absorption properties of several novel lattice structures via Rhino w/ Grasshopper -> LS-Dyna simulation. And grounding with physical test rig, 6 axis force sensor and high speed camera.

Mûzone

An in development indie game that originated from one of Daniel's personal projects at a 3-months coding bootcamp at General Assembly.

MozArt

A physical computer that turns sketches into songs. Mozart is currently being developed into a full music composition app aiming to initially penetrate the market of chinese wechat users.

Donaco

Daniel was the full-stack developer and UIUX designer for an AI for Charity startup Donaco from April to September 2017. The startup has won first place at the 2017 Microsoft Imagine Cup UK Finals and being selected as Imperial College London's 3 startups of that year.

iLock!

An ultra intuitive screen unlocking system that utilizes the 2 halves of the phone and tapping and swiping actions. This prevents leaving any decipherable smudges on the screen and allows blind tactile input that cannot be caught on camera. (Microsoft 3-hack best design award)

The tetromino project

A custom written algorithm designed to fill in a tetromino shade that has an arbitrary size and density, achieving accuracy of 96% and filling 10k squares in 3.2 seconds. The algorithm runs in linear time complexity.

Reverse Engineering Project

A materials and production analysis project for the interior of a mini sewing machine. A bill of material and production process was made and their properties and environmental impact analyzed.

Pal-V Flying Car Chassis

An iterative structural design process for the chassis of Pal-V, a personal flying car. Utilizing the finite element analysis features in solidworks.

Materials Design Project

A material analysis and selection project for a sea turtle egg carrying case

Robot Pathfinder and Soccer Challenges

The quickest robot to find it's way out a maze and the most nimble and accurate soccer shooter

Catapult Trajectory Calculation Project

An introductory mechanics project calculating for counter weight and firing angle to shoot a ball into a basketball net 20 meters away.