Giter Club home page Giter Club logo

smartesc_stm32_v2's Introduction

SmartESC

SmartESC (aka SESC) is an alternative firmware for Xiaomi M365 and Ninebot G30 controller.

image

Overview

Avantage over other Xiaomi custom firmwares :

  • you can put any motor since it can detect all motor parameters and optimize them
  • you can use any battery, even 20s (with hardware modifications), change the voltage divider and set the new value in the controller
  • you can change the shunts values and set the new value in the controller
  • you can setup the controller very easily with VESCTool and make a lot of performance/stability tests
  • you can use the controller with any other device, event without any display
  • soon, we hope to support multiple linked controller

Cons :

  • you loose the ability to monitor M365 BMS for now (work in progress), but don't worry, you still have the voltage ;)
  • you loose the ability to update firmwares through bluetooth
  • for now, it needs hall sensors (no sensorless mode). [work in progress]

It can interface :

  • the stock M365/G30 display
  • VESCTool through VESC interface on the BMS UART (full duplex UART).

Nota : this firmware is in beta.

You'll be able to setup and control the controller/motor from VESCTool interface with a simple USB/Serial adapter. With any small arduino, use analog acceleration/brake throttles to control any electic moving device like escooter, gokart, electric skateboard without using the stock display.

Download

Download the latest build for M365 : Package Control total downloads

Build

Last automatic build status : Build on commit

If you want to build it manually, for an easier build, you need git and docker.

Clone the project

git clone https://github.com/Koxx3/SmartESC_STM32_v2.git

Build on Linux

Launch from terminal:

chmod +x docker_build*; ./docker_build_m365.sh

chmod +x docker_build*; ./docker_build_g30.sh

Build on Windows

Double click :

docker_build_m365.sh

docker_build_g30.sh

Programming

You need a ST-Link device to reprogram the M365/G3O controller. It costs 3/4โ‚ฌ on Aliexpress.

Plug the st-link following this schematic : image

With STM32 ST-Link Utility, disable Re&d out protection.

Menu "Target" => "Option bytes" image

VescTool

Use VescTool to setup the motor and input properties.

Use a serial USB adapter to connect the Xiaomi controller as an USB VESC : image

Launch VESCTool and connect with COM port. image

Launcher Motor setup wizzard. image

Enter all your settings in the different windows.

Enable the keyboard control :

image

You're ready to test your M365 controller with your keyboard !

ESP32 test module

M365 connections : image

Use ESP32 prototype board with and ESP32-devkit-c module : image

Use the code provided in the serial-trottle-brake-esp32 folder with Platform.io

Error Code SESC (Smart ESC) in VESC Tool

Can read it in "VESC Terminal" (or others Serial Terminal)

  • 0 = MC_NO_ERROR (No error)
  • 0= MC_NO_FAULTS (No error)
  • 1 = MC_FOC_DURATION (FOC rate to high)
  • 2 = MC_OVER_VOLT (Software over voltage)
  • 4 = MC_UNDER_VOLT (Software under voltage)
  • 8 = MC_OVER_TEMP (Software over temperature)
  • 16 = MC_START_UP (Startup failed)
  • 32 = MC_SPEED_FDBK (Speed feedback)
  • 64 = MC_BREAK_IN (Emergency input (Over current))
  • 128 = MC_SW_ERROR

Command available in VESCTool terminal

  • help (see all available commands)
  • foc_openloop [current] [erpm] (Exemple : foc_openloop 10 500)
  • ... (lot of other commands)

smartesc_stm32_v2's People

Contributors

netzpfuscher avatar koxx3 avatar chrisgotboost avatar foujiwara avatar bastiii98 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.