Skip to content

henryk3dp/bambu_foc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FOC Motor Controller for Bambulab Extruder Servo

The goal is to run Bambulab's proprietary extruder servo motor from the P2S 3D printer on Klipper-based 3D printers. Uses an ESP32 and a FOC driver to translate step/dir commands from standard printer mainboards (e.g. Manta M8P) into closed-loop FOC control.
Bambulab's extruder servo uses a proprietary interface. This adapter makes it work with any Klipper mainboard that outputs step/dir signals.

How it works: Klipper mainboard sends step/dir pulses to ESP32
ESP32 counts pulses using hardware PCNT and converts to target angle
SimpleFOC library drives the BLDC motor with closed-loop FOC control
MT6835 magnetic encoder provides position feedback

Quick Start

# Build and upload using platformio
pio run -e main -t upload

# Monitor serial output
pio device monitor -b 115200

Wiring Guide

Components

  1. Bambulab Extruder Servo Motor, (FAM018) integrated MT6835 encoder
  2. FFC Breakout Board, 20-pin, 0.5mm pitch
  3. ESP32 Dev Board
  4. BLDC Motor Driver 3PWM type (SimpleFOCMini, DRV8313)
  5. Klipper Mainboard (e.g. Manta M8P)
  6. 24V PSU

Bambulab Motor

Servo Pinout

Pin Connections

ESP32 to Motor Driver (PWM Control)

ESP32 Pin Driver Pin
GPIO 32 IN1
GPIO 33 IN2
GPIO 25 IN3
GPIO 26 EN

ESP32 to MT6835 Sensor (SPI via FFC)

ESP32 Pin FFC Pin Function
GPIO 5 19 SPI CS
GPIO 18 16 SPI CLK
GPIO 19 18 SPI MISO
GPIO 23 17 SPI MOSI
3.3V 20 VCC
GND 13 GND

Klipper Mainboard to ESP32 Step/Dir Inputs

ESP32 Pin Mainboard Pin
GPIO 13 Klipper STEP
GPIO 14 Klipper DIR
GND GND

Motor Driver to BLDC Motor (via FFC)

Driver Pin FFC Pins
OUT_U 1-4
OUT_V 5-8
OUT_W 9-12

Power Supply Connections

Power Supply Component Pin
+24V (PSU) Driver VM
GND (PSU) Driver GND
GND ESP32 GND
+5V or USB ESP32 VIN or USB

About

getting a bambulab servo motor to work with step/dir

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors