Skip to content

Ineso1/bldcFOC_teensy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 

Repository files navigation

BLDC Teensy Control

Overview

This project provides embedded code for Teensy microcontrollers to control BLDC motors using Trapezoidal and FOC (Field-Oriented Control) algorithms. It includes PID velocity control and is structured for easy integration with motor feedback systems.

Features

  • Trapezoidal Control: Simple, efficient control for basic BLDC operation.
  • FOC Control: Smooth and precise field-oriented control.
  • PID Velocity Control: Adjustable PID parameters for speed regulation.
  • Logging Support: Motor and control data can be logged for analysis.

Repository Structure

BldcFOC_teensy/
├── Bldc/          # Base motor control structures and helpers
├── Foc/           # FOC algorithm implementation
├── Trap/          # Trapezoidal control implementation
├── logs/          # Logging utilities

Requirements

  • Teensy microcontroller (compatible with Teensy 3.x or 4.x series)
  • Arduino IDE or PlatformIO for building and uploading
  • BLDC motor with Hall sensors or encoder for feedback

Installation & Usage

  1. Clone the repository:

    git clone https://github.com/Ineso1/bldcFOC_teensy.git
    cd bldcFOC_teensy
  2. Open the desired folder (Foc or Trap) in Arduino IDE or PlatformIO.

  3. Configure your PID parameters and motor setup in the main file.

  4. Upload to your Teensy board.

  5. Monitor the serial output for velocity and status logs.

Demo

Watch the following video to see the BLDC motor control in action:

BLDC Motor Control Demo

Notes

  • FOC provides smoother operation and higher efficiency at low and high speeds.
  • Trapezoidal control is faster to deploy for simple applications.
  • Logging helps tune PID gains and monitor motor behavior in real-time.

References

  • Field-Oriented Control (FOC) principles
  • Teensy microcontroller documentation
  • BLDC motor datasheets

About

Embedded Teensy firmware for BLDC motor control supporting trapezoidal and FOC algorithms with PID velocity control, designed for precise motor operation and real-time performance logging.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • C++ 100.0%