Skip to content

davefiddes/stm32-sine

 
 

Repository files navigation

stm32-sine M3_DU

Build status

Firmware for Damien Maguire's Tesla Model 3 inverter replacement project. This firmware is a maintained fork of Johannes Huebner's stm32-sine firmware.

Though not a prime focus of the project it should run on any revision of the "Huebner" hardware https://github.com/jsphuebner/inverter-hardware as well as any derivatives such as the Open Source Tesla controller https://github.com/damienmaguire.

Features

Over the original stm32-sine firmware this fork adds:

  • Support for the M3_DU inverter PCB
  • Configuration and fault monitoring of the M3_DU gate drivers
  • Tesla Model 3 oil pump control
  • Robust configuration over CAN using OpenInverter CAN Tool or esp32-web-interface

Binary releases

Binary releases can be found on the releases page.

Hardware

The replacement Tesla Model 3 Drive Unit PCB V3.2 required to run this firmware can be purchased from the EV BMW web shop.

Further reading

Development is documented in this forum thread: https://openinverter.org/forum/viewtopic.php?t=575

Progress of the hardware and system integration is documented on Damien Maguire's YouTube channel: https://www.youtube.com/@Evbmw

A comprehensive guide to the Huebner inverter system can be found here: https://openinverter.org/docs

Compiling

Building the firmware requires Linux and an arm-none-eabi toolchain.:

On Debian/Ubuntu install the toolchain by running:

sudo apt-get install build-essential git gcc-arm-none-eabi

On Fedora:

sudo dnf group install c-development development-tools
sudo dnf install arm-none-eabi-gcc-cs arm-none-eabi-newlib

The only dependency is libopencm3 which is maintained as a git submodule. You can download and build this by running:

make get-deps

Now you can build the FOC firmware for rear drive units by running:

make CONTROL=FOC

or SINE firmware for front drive units by running:

make CONTROL=SINE

And upload it to your board using a JTAG/SWD adapter using openocd:

make flash

or with OpenInverter CAN Tool:

oic upgrade stm32_foc.bin

About

Firmware for Damien Maguire's Tesla Model 3 inverter replacement project

Topics

Resources

License

Stars

Watchers

Forks

Contributors

No contributors

Languages

  • C++ 75.6%
  • C 17.8%
  • Shell 3.6%
  • Makefile 2.6%
  • Linker Script 0.4%