Skip to content

creapunk/TunePulse-RS

Repository files navigation

TunePulse Firmware based on Rust

License Rust Discord Ko-fi

TunePulse is an upcoming open-source firmware designed to:

  • Control a wide range of motors (DC, STEPPERS, BLDC, PMSM, LINEAR)
  • Operate across various control modes (CLOSED-LOOP, FOC, POSITION, SPEED, TORQUE, etc.)
  • Feature compatibility with multiple interfaces (STEP-DIR, UART, I2C, CAN/CAN-FD, USB)
  • Support various protocols (GCODE, KLIPPER, etc.)

Its primary goal is to advance the development of closed-loop systems and simplify their integration into existing applications.

Note: This firmware is under active development and currently lacks documentation. For more information, join the Creapunk community on Discord.


Getting Started

To get started with TunePulse, ensure you have the required Rust tools installed:

rustup target add thumbv7em-none-eabihf
cargo install flip-link

For additional setup instructions, see the Probe.rs Installation Guide and Probe Setup Guide.

  1. Connect the ST-Link port to your computer and run the updater downloaded from the official ST-Link website.
  2. Plug the controller into the programmer's single port and flash the blink example for testing:
cargo flash --release --package blink --chip STM32G431CBTx

After flashing, the controller should cycle through the Red, Green, and Blue LEDs.

Optional: Install the Probe.rs Debugger extension for VSCode.


Flashing

  1. Connect your computer to the ST-Link port on the programmer.
  2. Connect the controller to the programmer's single port.
  3. Run the following command to flash the firmware:
cargo run --package blink

Progress

Algorithms

  • ☑️ PID controller with a FeedForward component (integer and floating-point implementations)
  • ☑️ Integer-math LPF filter with a variant for handling zero-crossing transitions
  • ☑️ Encoder coordinate system with zero-crossing handling and full rotation counting
  • ☑️ Calculation of motor instantaneous speed using a circular buffer
  • ☑️ Normalization of ADC input channels relative to vref
  • ☑️ Calculation of supply voltage with filtering
  • ☑️ Motor type selection algorithm via selector:
    • ☑️ DC motor
    • ☑️ Stepper motor
    • ☑️ BLDC motor (SVPWM with limiting for insufficient supply voltage)
  • ☑️ Phase commutation algorithm based on a predefined pattern
  • ☑️ Fast sine/cosine calculation via lookup table

Drivers

  • ☑️ PWM center-aligned timer
  • ☑️ Encoder readings with DMA
  • ☐ ADC voltage and current readings with DMA

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published