Skip to content

Implementation of SimpleFOC library (simplefoc.com) for driving hoverboard motor with 2 IBT2 modules and Raspberry Pi Pico

License

Notifications You must be signed in to change notification settings

suryavip/SimpleFOC-Hoverboard-IBT2-Pico

Repository files navigation

SimpleFOC x Hoverboard x IBT2 x Pico

Examples for implementing SimpleFOC library for driving hoverboard motor with 2x IBT2 modules and Raspberry Pi Pico.

Warning:

Powering Hoverboard motor is involving a lot of power. You can use my code and follow my guide, but at your own risk. Don't proceed until you understand the risk and how to mitigate and handle it.

Also, this project is still in progress. So far I'm able to make it work with open-loop velocity mode. The goal of this project is close-loop mode for Force Feedback Steering Wheel application.

Hardware:

  • Raspberry Pi Pico.
  • 2x of IBT2 H bridge driver module (each module have 2x BTS7960).
  • Hoverboard motor.
  • AS5600 magnetic sensor module.
  • 12V power supply. 24V might do better for hoverboard motor.

Software & Libraries:

Software Preparation:

At least on SimpleFOC v2.2.3, there will be compiling errors when using Arduino-Pico board library by @earlephilhower (Something about pwm_gpio_to_slice_num is not declared in this scope). To fix that, locate this file

<your arduino libraries folder>/Simple_FOC/src/drivers/hardware_specific/rp2040_mcu.cpp

and add this line after other #include:

#include "hardware/pwm.h"

Wiring Connections:

You can see Raspberry Pi Pico's pinout diagram here.

Pi Pico 1st IBT2 2nd IBT2 Power Supply Motor AS5600
3V3_OUT VCC VCC VCC
GND GND GND GND
GP0 SDA
GP1 SCL
GP12 R_EN
GP13 RPWM
GP14 L_EN
GP15 LPWM
GP16 R_EN
GP17 RPWM
B+ B+ + terminal
B- B- - terminal
M+ Phase A
M- Phase B
M+ Phase C
M-

About

Implementation of SimpleFOC library (simplefoc.com) for driving hoverboard motor with 2 IBT2 modules and Raspberry Pi Pico

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages