Medical grade BLDC motor FOC Controller with LCD and fiber optic wire control

Medical-grade BLDC FOC controller with LCD and fiber-optic control

We designed a high-precision embedded control platform designed to drive a BLDC motor using Field-Oriented Control (FOC), control the position of a fiber-optic light delivery wire for medical therapy, and provide a user-programmable motion interface via a full TFT touch display.

The architecture uses two dedicated STM32 MCUs for deterministic motor control and robust system management.

System Architecture

Main Control Unit – STM32H743

  • Runs the UI, system logic, scripting engine, safety supervision, logging, and communications
  • Drives the 2.4" TFT LCD capacitive touch screen (240×320)
  • Loads files, animation assets and logs from SD card and external SPI Flash
  • Monitors power domains (battery/charger/Vin) and system health
  • Issues motion commands to the motor MCU over UART
  • User defines motor movement scripts via touch UI
  • Manages:
    • RGB status LED
    • Touch input, buttons, external sensors
    • Error logging to SD
    • USB/UART communication with host device

Motor Control Unit – STM32H750

  • Dedicated FOC motor controller
  • Implements closed loops for:
    • Position
    • Speed
    • Current (torque)
  • Interfaces with:
    • Magnetic encoder (12-bit, absolute)
    • Hall sensors (internal + external)
    • Friction wheel IR encoders
    • Light interrupters for safety zones
    • Shunt current sensors (INA240)
  • Executes motion trajectories received from main MCU
  • Reports status, errors, and feedback in real-time

Unique Mechanism – Fiber Optic Wire Positioning

A medical fiber optic wire is mechanically moved by the BLDC motor. To determine its precise position:

SensorPurpose
IR1 / IR2 / IR3Detect wire motion and motion validity (Go/No-Go safety)
Friction wheel IR encoderTracks actual wire displacement and direction
Absolute Hall sensorReference Point B – guarantees repeatable absolute stop
Motor internal encoderReference Point A – relative position
STM32 FOC loopsMaintain accurate motion, torque, and velocity

This allows the system to always locate and return the wire to the exact same position, even after power cycles.

The wire emits strobed light for medical therapy, synchronized to the movement script.

Motor & FOC Capabilities

The system incorporates advanced motor control features:

  • Field-Oriented Control (FOC) for maximum torque efficiency
  • 4-quadrant operation
  • Low-speed torque stability
  • Velocity and position loops with PID
  • 5.5V – 24V motor supply
  • 3A continuous / 5A peak output
  • Integrated 12-bit magnetic encoder
  • Script-driven motion profiles
  • C++ / Python controllable through library

Motor driver: L6234 3-phase bridge

Current sense: INA240 high-precision bidirectional amplifier

Power System

Multi-stage protected power design supporting:

ModeBehavior
Vin primaryCharges battery, powers system, disables battery load
Battery modeRuns system from 18650 pack
Sleep modePartial shutdown, wake from touch/button

Components include:

  • Hot-swap and protection: TPS25983 (2.7–26V, 18A, transient protected)
  • Battery charger: BQ25308 (1-cell 3A charging)
  • Buck 5V, Boost 12V, Multiple LDO rails
  • Over-current, over/under voltage, load monitoring
  • Clean ground segmentation and EMI filtering

Physical Interfaces

InterfaceFunction
TFT LCD + Capacitive TouchUI for setting motion scripts
SD CardLogs, images, configs, motion programs
External SPI FlashFailsafe boot storage
UART to hostDiagnostics, control
Multiple sensor JST/Pico connectorsWire location, safety, encoders
Trigger buttonStart motion
Motor connectorBLDC + Hall + encoder

FOC Control block diagram

FOC control block diagram

And this is the complete PID loop:

The complete PID loop

photos of the assembled system:

Assembled system
Assembled system, detail

How did we compute the FOC algorithm parameters:

FOC parameter computation Torque / current reference

Outputs a torque or current reference.

Clark Transform:

Clarke transform

Park Transform:

Park transform

Current PI gains:

Current PI gains

Inverse Park:

Inverse Park

Inverse Clark to drive voltages (SVPWM):

Inverse Clarke / SVPWM
StageEquation Purpose
EncoderCompute θe, ω
Position PIDConvert position error → speed ref
Speed PIConvert speed error → torque/current ref
ClarkeConvert 3-phase currents → iα, iβ
ParkConvert to id, iq using θe
PI Current loopsGenerate vd, vq to correct error
Inverse ParkConvert back to vα, vβ
SVPWM / Inverse ClarkeGenerate 3-phase PWM signals
Share
05 — Contact

Have a hard engineering problem?

Email
rotem@segevtech.com
Tel
+972-52-6444408
Studio
Tel Aviv, Israel