New free Open Source Firmware for Xiaomi M365 Scooter available

stancecoke

100 kW
Joined
Aug 2, 2017
Messages
1,808
In the Scooter community the hacked firmware for the M365 is very popular. You'll find it with very few searching on the internet.

We have developed our own firmware now, that is based on the EBiCS project, not on the (hacked) original firmware.

Our firmware can be flashed over the air by Bluetooth, just like the hacked one. It's tested with downG from the android play store.

It is still in beta-stadium, but it works pretty good already. Everything you do with it, is on your own risk ;)

Features:
- individual current and speed settings for the modes ECO, normal and sport
- linear regen with the brake lever
- flux weakening in sport mode for higher speed
- ....

Still missing:
communication with the original battery

For the "how to" see the README at github:
https://github.com/Koxx3/SmartESC_STM32_v3

[youtube]XAlSl5xWpAk[/youtube]

There is a parallel project, that uses the code from the ST Motor Control Workbench and can be set up by the VESC Tool. Very fancy too! 8)
https://github.com/Koxx3/SmartESC_STM32_v2

regards
stancecoke
 
YES!!

I am being testing this firmware but not yet riding with it. It seems good and I am very confident with it since I understand well the source code. I am still riding with the "hacked" original firmware and I have some issues that I hate, I hope to start soon riding with this our OpenSource firmware.

And thanks to this M365 OpenSource firmware, I plan to develop an extended version, where I will add to the original dashboard, a small 0.96 inches OLED display and external remote buttons. With this I will be able to quick increase / decrease the max speed as also the motor torque / current, as this is the most features I fell the need while riding my M365, because I can not control very well the speed it is locked on cruise control, usually I can only lock at max speed that is about 35km/h which is to much fast sometimes and I want to be able to reduce it.

With this display and remote buttons, I will also implement a configurations menu, so all scooter configurations for motor, battery and the display itself, will be done directly on the display.
And things like seeing in real time the battery voltage or the motor power, will be possible with this display.

In fact, the display and his firmware, are already developed and I use on my EBikes, running our OpenSource firmware: https://opensourceebike.github.io/

 
Exciting!! I got a M365 PRO with PRO dashboard BLE090. Can it work with it?
I have a 14S setup. Should i change anything in config.h for that? CAL_V? CAL_I?
 
pinkflozd said:
I have a 14S setup
First, thank you for your interest!
Are the 14S a mod, or do they come with this battery from factory?
You have to change the voltage limits for 14s, they are hardcoded for 10s at the moment:
https://github.com/Koxx3/SmartESC_STM32_v3/blob/0a7bf948e23c62762c2d9ca06655859981dd18c7/Core/Src/M365_Dashboard.c#L221

I don't know, if there are differences in the calibration factors or in other things like UART protocol. Just try it (on your on risk of course!)... :)

regards
stancecoke
 
stancecoke said:
Are the 14S a mod, or do they come with this battery from factory?

It's a custom 14s6p battery with an extender on my m365 pro + modded controller with 100V caps and thicker traces

Goin to try it, gonna first order a stlink just in case
 
Small update: You can flash our firmware with no use of a laptop or PC now. All can be done by your mobile phone. See the updated readme:
https://github.com/Koxx3/SmartESC_STM32_v3/blob/master/README.md

regards
stancecoke
 
stancecoke said:
Small update: You can flash our firmware with no use of a laptop or PC now. All can be done by your mobile phone. See the updated readme:
https://github.com/Koxx3/SmartESC_STM32_v3/blob/master/README.md

regards
stancecoke


Hmm, with the smartphone....?
But the zip file has to be generated first?
I already fail with the "fork icon" where should it be?
 
Paulflieg said:
I already fail with the "fork icon" where should it be?
You have to turn your phone to landscape orientation, then you'll see.
I'm preparing a YouTube tutorial actually, maybe there will be a first version during the weekend :idea:

regards
stancecoke
 
stancecoke said:
Paulflieg said:
I already fail with the "fork icon" where should it be?
You have to turn your phone to landscape orientation, then you'll see.
I'm preparing a YouTube tutorial actually, maybe there will be a first version during the weekend :idea:

regards
stancecoke

Hmm??
 

Attachments

  • IMG_20220114_185239.jpg
    IMG_20220114_185239.jpg
    3.3 MB · Views: 6,807
Paulflieg said:
stancecoke said:
Paulflieg said:
I already fail with the "fork icon" where should it be?
You have to turn your phone to landscape orientation, then you'll see.
I'm preparing a YouTube tutorial actually, maybe there will be a first version during the weekend :idea:

regards
stancecoke

Hmm??
Hi.

Unfortunately the current code has an issue and does not run the motor well. I am testing it and I hope l, with the help of Stancecoke, to make it working. Once it works, we will write a message here and we can also uploaded the firmware of that version so anyone can try.
 
Paulflieg said:

You have already forked our repo successfully and you are in your own fork now. You can't fork your own fork, as it is already there ;)

Forks on 2022_01_15.PNG

regards
stancecoke
 
I've just published a small tutorial at github. Everything is still in beta-stadium.
Everything you do, is on your own risk.

[youtube]Pe2UTPPxX7U[/youtube]

regards
stancecoke
 
stancecoke said:
I've just published a small tutorial at github. Everything is still in beta-stadium.
Everything you do, is on your own risk.

I tested on first and second mode only. I didn't test on the third mode because it uses field weakening and I am afraid it can fail...

There is still a small issue, sometimes there is a strong noise and vibration of the motor, but it is for very short time - it is present at least 2 times on the next video, but hard to spot.

Here is my testing:

[youtube]LVHyRP0o2uw[/youtube]
 
casainho said:
Unfortunately the current code has an issue and does not run the motor well

We fixed the issues now, but had no chance to do longer test rides yet, due to snow in Northern Europe :)

regards
stancecoke
 
frenchie said:
can you really do 35km/h on it?
We don't know yet :wink:
Nobody tried the flux weakening function on the road yet. With the wheel in the air, more than 60kph are no problem.

I don't own a M365 scooter, I'm testing only on my teststand with a Shengyi middrive or a BionX Direct drive or a small hoverboard motor.

We are looking for a brave guy who will test sport mode and report😉

regards
stancecoke
 
frenchie said:
cool project guys congrats
can you really do 35km/h on it? how about bigger wheels? not sure I'd fancy that speed with those small ones lol
I am not yet using our OpenSource firmware, but I am using the hacked firmware and I installed the 10 inches tires, and on my M365 Pro 2, on flats, I can get at 35km/h when the battery is over 70% charged.

By the way, I am also working on our DIY, customizable, easy to to build and repair motor controller, running our OpenSource firmware. Here is it driving a M365 motor:

[youtube]NelnB91Vqgw[/youtube]

I am being cleaning up the code and doing reorganization, and now the specific motor control code lives on his own repository here: https://github.com/EBiCS/EBiCS_motor_FOC while the M365 specific code will be kept on the same repository.

Next I will focus on developing and testing the M365 code, as I wish to start riding with it soon.


 
frenchie said:
cool project guys congrats
can you really do 35km/h on it? how about bigger wheels? not sure I'd fancy that speed with those small ones lol

Im using a VESC based Flipsky 75100 FOC ESC powered by 14s6P on a Ninebot Max I get 24mph or 38.6kph all day long.

The torque is incredible and will get me up to speed in seconds. Its super fun and has turned the Max into a beast. I haven't even come close to running out of range, I've never tested it but I can say scooting around aggressively on flat terrain with full throttle used except for stopping and starting I will use about 5000mAh after a 10 miles/16km ride. My pack's capacity is 19,200mAh. I could probably do an aggressive 30miles or 48km comfortably.

This firmware on the stock controller should give similar performance if not better if field weakening (FW)is enabled. From what I gathered FW does consume more power so range will probably be affected but probably not much if used as a "turbo mode". That said I could be wrong as I haven't experimented with field weakening on the FS 75100 FOC yet.

I tried but could not get faster with the stock 10s pack. I worked my way up from 10s to 12s, 13s until 14s where I felt satisfied. I dont think my scooter has a 2nd gen motor on it as its an older ex rental from Lyft. Supposedly the Gen 2 motors have a bit more grunt to them so its possible the scooter could be faster if in fact my motor is a 1st gen version.

BTW Im totally comfortable with the stock 10" wheels at full throttle. In fact, Im sorta craving more speed. Lol!

Im totally interested in trying this firmware on the stock controllers. I have several lying around and if I would have saw this project earlier I could have saved myself several hundred $$!

Hats off to the developers that have the skill and imagination to make this a reality. If it works as well as I think it will it is a total gamechanger for scooters. Im not overstating this either, its a really big deal!

Question for the developer. Do you think this will work on the controller for the Ninebot SNSC 2.3 Max Pro. The 2.3 is a commercial/rental only version. The controller should be similar but its a different form factor. I guess there only one way to find out but it would be comforting if it was confirmed.
 
barthchris said:
Question for the developer. Do you think this will work on the controller for the Ninebot SNSC 2.3 Max Pro. The 2.3 is a commercial/rental only version. The controller should be similar but its a different form factor. I guess there only one way to find out but it would be comforting if it was confirmed.

I don't know, if the schematic is exactly the same, we know the processor pinout for the M365 and for the G30 yet. You would have to reengineer the schematic, if no one have done it yet.

regards
stancecoke

PinoutM365vsG30.png
 
frenchie said:
barthchris said:
powered by 14s6P on a Ninebot Max I get 24mph or 38.6kph all day long.

sounds v.cool congrats!
that's a big battery pack, where is it attached?

Sorry, just saw this. Its totally contained under the deck. I removed the stock ESC, the stock battery charger(yes, they incorporated a small 10s 2.8A AC charger into the scooter.) At first I used the stock 10 battery pack and a DIY 4s6P pack with JST balance leads. I charged the 10s pack and the 4s pack separately. Everything was a tight fit but worked well.

I recently decided to build a 14s4p pack out of molicel p42a 21700 cells. I removed the stock battery and have plenty of room to spare. Actually there is so much room to spare Im considering purchasing 28 more cells. This will give me a 25,200mAh 14s6p pack :warn: :eek: :shock:! Since I dont have a BMS I configured it as two 7s packs connected in series for a 14s pack. Each has its own 7s JST balance leads, Charge both packs in parallel with a Charger 1030 RC charger. Works great! Cells dont even get warm after aggressive riding. I added a small voltmeter to avoid getting anywhere near 3V per cell which is not going to happen unless I forget to remove my ghetto loop key and leave the scooter powered on for a week or so. I havent dropped below 3.8V per cell at the end of my longest ride.
 
So, I was able to find my stash of ninebot G30 controllers. PCB is potted in clear silicone gel, will be easy to pick off to expose the SWD pads. The only concern is the 63V cap. I'd like to use this with 14s (60.2V fully charged). Even with regen possibly exceeding 63V at 14s Im not super concerned about the cap at that voltage but Im assuming the cap will need to be changed if used with higher voltages?


Sorry if I missed it. Are there any resources beyond Github for this project? I have everything needed to do this. Im definitely no pro, but with my various hobbies Im no stranger to flashing microcontrollers including ST32 via a ST linker V2.
 
stancecoke said:
barthchris said:
Question for the developer. Do you think this will work on the controller for the Ninebot SNSC 2.3 Max Pro. The 2.3 is a commercial/rental only version. The controller should be similar but its a different form factor. I guess there only one way to find out but it would be comforting if it was confirmed.

I don't know, if the schematic is exactly the same, we know the processor pinout for the M365 and for the G30 yet. You would have to reengineer the schematic, if no one have done it yet.

regards
stancecoke

PinoutM365vsG30.png

Thank you for showing the ST32 pin out differences between the Xiaomi M365 vs ninebots G30. Not going to be as plug and play as I anticipated. Wish I has the skills to make the necessary changes :cry: ! Totally understand the hardware side of things but no experience with software changes other than tweaking a few commits even though I have almost 30yrs of experience as an industrial electrician/electronics tech.

Im confident that someone with the necessary skills will come along given the G30s similarity and popularity.
 
Great work! I am in the process of designing a prototype of a small go-kart like automated vehicle and selected the M365 ESC and motor as a candidate for the dual motor drive line and ordered the components separately (without the e-scooter). Then I found these open source firmware projects which seem just what I was looking for. I tried cloning the V3 repo, created the zip file, but was unable to update the firmware. DownG connected to my BLE but complains that it could not get scooter information. Did I miss something? Is there another way to update the firmware?

Alternatively, I could also use the V2 repo. In the end I would like to use it without the BLE, by providing velocity (or better torque) setpoints to the two ESCs through the UART connector from my own custom controller. Btw, after flashing with STlink is there a way to restore the original firmware (with bootloader) again?

Please advise which firmware (V2 or V3) can best be used.
 
Back
Top