Skip to main content

Work Log (Week 1)

· 3 min read
Ben Li
Software engineer

Current Progress

  • Deng FOC V4 board, can rule two motor with Deng FOC V4 library only, limitated to i2c. ( PID adjust required)
  • Simple FOC library works in one MOTOR with esp32 only with 2.2.1 library + 2.0.17 ESP32 library. ( some known issue with dual motor, will fix in 2.3.5)
  • Simple FOC with STM32-F103 works with encoder only, due to time group issue, i2c will not work simply.

Failed test:

  • Simple FOC with F411 black pill board: Issue time group

Issue Found:

  • Simple FOC will pull up (HIGH) PIN13, 14 by default, witch will make STlink fail.
  • ESP32 can not work with dual motor on Simple FOC library, known issue, will fix in 2.3.5.
  • STM32 other than F103 and G431 not worked yet, need more analysis.

Final Objective

To be able to have 12 DOF robot with BLDC control, I need cheap, reliaable BLDC FOC module that canble replciate. WIFI on esp32 is not required, also size is too big and no can, leave me STM32 as best option.

I need to test mroe STM32 option, to find best MCU + Encoder + driver conbonation to be reliable and eazy to build also cheap.

I want to fix the module selection, this case code and pid can be replciate easly.

Motor I will decide between 5010 260kv and 5056 140kv, board I will decide between 3 options:

  • odrive v3.6 50$ for 2 motors (50A) - Support Odrive, SImpleFOC
  • STM32G431-ESC-1 30$ for 1 motors (30A) - support SimpleFOC and STM Motor SDK
  • Drive Shiled + STM32 G431 15$ for 1 motor (20A) - support SimpleFOC

Build simple project like balance bot or Desk Arm is good for intergrating test with above set up.

  • Balance bot (FOC control for 2 motor, PID control)
  • 2 leg balance bot (FOC control for 2 motor, PID control, RC controll, )

Future Planning

Because currently I stuck on running simple FOC code with ESP32, I need to do more testing, with more valid working case, I can make final decision related to STM32 G4 serial.

  • I need stop work on esp32 two motor project untill ( Simple FOC 2.3.5).

  • I can start pick up 2 leg bot while wating G4 chip.

  • 3 5010 motor arm, greate for 1 leg project.

    • G474 + 3 driver + 3 5010
    • (F103 + driver + 5010) * 3
  • need to make decision, is odrive needed?

  • Or G431-esc with power shiled, 30A is enough? Need to torque test.

Decision:

  1. 5010 260kv motor with 10:1 gear: torque output per Amps.
  2. 5056 140KV motor with 10:1 gear: torque output per Amps.

if 5010 is enought, 30A drive is enought.

if 5056 50A required, odrive is must have.

FOC TEST List:

  • STM32G431-ESC
    • Simple FOC
    • STM Motor SDK (SK)
  • STM32G474 ( able to control 3 driver)
    • Simple FOC
  • STM32F407
    • Simple FOC
  • ESP32 ( Okay for hobby and POC, not sutable for dog.)
  • STM32 F103 ( back up for G431) ( only working version)
  • STM32 F411 ( no working)
  • STM32 H750 ( optional test)
  • STM32 H753 ( over kill for FOC only)
  • STM32 F405 ( 2 driver )

Roadmap to Embedded & Robotics Engineering

· 23 min read
Ben Li
Software engineer
Chat GPT
AI Assistant

Month 1: ROS 2 Foundations & Microcontroller Basics (Weeks 1–4)

  • Week 1 – ROS 2 Setup and Fundamentals: Install ROS 2 (latest LTS) and set up your Linux development environment. Review ROS 2 architecture (nodes, topics, services, parameters) and command-line tools . Complete introductory tutorials (talker/listener, turtlesim) to build basic ROS 2 skills . Milestone: You can run a simple ROS 2 talker/listener demo and understand the core concepts.

Companion Computers in Drones

· 41 min read
Ben Li
Software engineer
Chat GPT
AI Assistant

Introduction

Drones across various industries are increasingly equipped with onboard computers (also called companion computers) that serve as the “brain” alongside the flight controller. These onboard systems process sensor data (especially camera feeds) in real time to enable high-level functions such as autonomous navigation, obstacle avoidance, and AI-based analysis (Top 5 Companion Computers for UAVs | ModalAI, Inc.). Traditionally, a drone’s flight controller handled basic stabilization and GPS waypoint following, but modern use cases demand greater autonomy and on-site intelligence. Advances in compact, powerful processors (GPUs, NPUs, etc.) now allow drones to perform complex tasks like object detection, tracking, and mapping locally at the edge, which was not feasible just a few years ago (AERO: AI-Enabled Remote Sensing Observation with Onboard Edge Computing in UAVs). This shift to onboard edge computing yields low latency decisions and reduces reliance on constant communication links, an important benefit since drones often operate beyond reliable network coverage (Towards Real-Time On-Drone Pedestrian Tracking in 4K Inputs) (AERO: AI-Enabled Remote Sensing Observation with Onboard Edge Computing in UAVs).