Bafang M500/M600 thread

Discussions related to motors other than hub motors.
This includes R/C motors, botttom bracket, roller and geared drives.
4πr^2   10 W

10 W
Posts: 67
Joined: Feb 28 2020 11:44am

Re: Bafang M500/M600 thread

Post by 4πr^2 » Dec 23 2021 4:46pm

casainho wrote:
Dec 23 2021 12:36pm

I am working with other Xiaomi M365 developers to develop an OpenSource EBike and EScooter motor controller. My idea is to have a generic EBike and EScooter motor controller, with room for custom electronics, easy do DIY and repair. ...
This is very good and wish you the best, though as this was M500/600 thread, what I, and I believe Ornias, were talking about was basically a 'drop-in' replacement for either the locked down OEM M500/600 controller or the 'unobtanium' Luna V2 controller. It would have to fit in the original M500/600 case which most likely means almost all surface mount components, likely a 4-layer PCB and an MCU which is likely going to be north of 50-60+ pins on a tiny chip.

I believe the VESC controller designs are all open source, too. Need to spend some time researching what is the latest/greatest/most recent revisions. But seems a good start would be looking to fit one of those deigns on a board shaped for the M motors.


Image

ornias   10 W

10 W
Posts: 69
Joined: Jul 18 2021 3:38am

Re: Bafang M500/M600 thread

Post by ornias » Dec 23 2021 6:50pm

4πr^2 wrote:
Dec 23 2021 4:46pm
casainho wrote:
Dec 23 2021 12:36pm

I am working with other Xiaomi M365 developers to develop an OpenSource EBike and EScooter motor controller. My idea is to have a generic EBike and EScooter motor controller, with room for custom electronics, easy do DIY and repair. ...
This is very good and wish you the best, though as this was M500/600 thread, what I, and I believe Ornias, were talking about was basically a 'drop-in' replacement for either the locked down OEM M500/600 controller or the 'unobtanium' Luna V2 controller. It would have to fit in the original M500/600 case which most likely means almost all surface mount components, likely a 4-layer PCB and an MCU which is likely going to be north of 50-60+ pins on a tiny chip.

I believe the VESC controller designs are all open source, too. Need to spend some time researching what is the latest/greatest/most recent revisions. But seems a good start would be looking to fit one of those deigns on a board shaped for the M motors.


Image
The most challanging part would be if we can make it somewhat cost effective to replace.
To be somewhat reasonable the pricepoint has to be <100EURO.

ornias   10 W

10 W
Posts: 69
Joined: Jul 18 2021 3:38am

Re: Bafang M500/M600 thread

Post by ornias » Dec 23 2021 6:51pm

Can someone please upload the new CRX10NC4818i132046.8 firmware for testing please?

Animalector   10 kW

10 kW
Posts: 976
Joined: Mar 17 2012 4:50pm
Location: Mareeba - Queensland

Re: Bafang M500/M600 thread

Post by Animalector » Dec 23 2021 7:17pm

ornias wrote:
Dec 23 2021 6:50pm


The most challanging part would be if we can make it somewhat cost effective to replace.
To be somewhat reasonable the pricepoint has to be <100EURO.
If I recall from my micro Lebowski build I can't even buy the parts for $100Euro let alone the PCBs plus assembly. You'd need to make thousands of them to be cost effective. Isn't luna charging like $500 or something as an upgrade?.

4πr^2   10 W

10 W
Posts: 67
Joined: Feb 28 2020 11:44am

Re: Bafang M500/M600 thread

Post by 4πr^2 » Dec 23 2021 10:48pm

I think they have the V2 as a $400 upgrade right now. Though the previous 'ludicrous' upgrade was $300 and consisted of about 20 cents worth of shunt resistors so who knows what the actual controller costs. Plus, Luna is obviously a business so have to have mark-up on products. I wouldn't be surprised if 50%+.

100 EUR price point might be pretty tough, though. Especially in small quantities. You might be able to build a basic ~500W replacement for that, but if you want to duplicate the "2500W+" V2 controller with all the bluetooth bells/whistles, it would likely run more. Quality mosfets and the big smoothing capacitors can easily run 2-3 bucks a piece and it runs 12 mosfets and likely 4 capacitors. Plus I think the MCU is going to run $15+, so pretty easy to blow a big chunk of that budget in components. Though conversely if the choices are between a $200 open source board, 'nothing', or an 'unobtainable' controller from luna...

Efim_Rus   100 µW

100 µW
Posts: 8
Joined: Dec 10 2021 7:35pm

Re: Bafang M500/M600 thread

Post by Efim_Rus » Dec 24 2021 6:39am

PadreParada wrote:
Dec 15 2021 6:02am
Hi Efim, after my motor was water damage I had the same problem as you described, with no pedal assistance. I was able to ride but with the trigger pressed....
Hi PadreParada.
I solved this problem. I would like to share some observations.
This is how my torque sensor looked like:
torqueSensor.jpg
torqueSensor.jpg (5.22 MiB) Viewed 1052 times
Everything is in order with him, but there were problems with the electrical circuit.
Some I will describe here:
Problem number 1:
When only the third byte (pedal speed in the photo) changes at the address 01F83100 when pedaling, this means that some element in the coil control circuit is faulty. The coil serves as a force sensor. In my case, the A7 BAV99 dual diode was faulty, see the photo.
SenCan.jpg
SenCan.jpg (3.43 MiB) Viewed 1052 times
PCBSensorA7.jpg
PCBSensorA7.jpg (1.58 MiB) Viewed 1052 times
Problem number 2:
When only the second and first byte (pedaling force) at address 01F83100 changes during pedaling, it means that the Hall sensor labeled M51 839 is faulty. See photo.
HallIC_M51.jpg
HallIC_M51.jpg (1.13 MiB) Viewed 1052 times
On a working sensor, all 3 bytes should change when you press the pedal with your foot.

Photo of the disassembled sensor:
PCBSensor.jpg
PCBSensor.jpg (2.88 MiB) Viewed 1052 times
HallIC.jpg
HallIC.jpg (2.42 MiB) Viewed 1052 times
ElecObchiiSensor.jpg
ElecObchiiSensor.jpg (4.76 MiB) Viewed 1048 times


The compound was removed with a hot air gun at a temperature of 300 degrees, it becomes forever soft.
After replacing the faulty elements, the bikes worked again as expected.

I also have a problem where to find such a Hall sensor M51 839, since for the experiment I had to remove the sensor from the working bike.
Last edited by Efim_Rus on Dec 24 2021 6:51am, edited 2 times in total.

Efim_Rus   100 µW

100 µW
Posts: 8
Joined: Dec 10 2021 7:35pm

Re: Bafang M500/M600 thread

Post by Efim_Rus » Dec 24 2021 6:46am

ornias wrote:
Dec 22 2021 5:40pm
Nice pictures!
We could use your help on the technical github:
https://github.com/OpenSourceEBike/Bafang_M500_M600
Ask what you want. I will help with all I can.

casainho   100 GW

100 GW
Posts: 5777
Joined: Feb 14 2011 2:43pm

Re: Bafang M500/M600 thread

Post by casainho » Dec 24 2021 7:11am

Efim_Rus wrote:
Dec 24 2021 6:39am
I also have a problem where to find such a Hall sensor M51 839, since for the experiment I had to remove the sensor from the working bike.
Great sharing knowledge!!

So If I could understand correctly, the torque sensor communicates with main board using CAN??
- TSDZ2 and OpenSource EV display: 128x64 OLED display, easy to build as DIY, Bluetooth and ANT, OTA wireless updates, easy to repair and customize for other EVs.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: OpenSource EV display, Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays.

Efim_Rus   100 µW

100 µW
Posts: 8
Joined: Dec 10 2021 7:35pm

Re: Bafang M500/M600 thread

Post by Efim_Rus » Dec 24 2021 7:20am

casainho wrote:
Dec 24 2021 7:11am
So If I could understand correctly, the torque sensor communicates with main board using CAN??
Yes. You are right, there is microcontroller inside and the tja1042 CAN driver

4πr^2   10 W

10 W
Posts: 67
Joined: Feb 28 2020 11:44am

Re: Bafang M500/M600 thread

Post by 4πr^2 » Dec 24 2021 11:22am

Efim_Rus wrote:
Dec 24 2021 6:39am
... I also have a problem where to find such a Hall sensor M51 839, since for the experiment I had to remove the sensor from the working bike.
In some cases these seem to be 'custom' Chinese parts not available on the general retail market, so may not be possible to match an exact number. But if you can narrow down the form, function, estimated specifications, it is possible to find common retail components.

As a first guess:

https://www.allegromicro.com/~/media/Fi ... sheet.ashx
https://www.digikey.com/en/products/det ... -T/1006070

Animalector   10 kW

10 kW
Posts: 976
Joined: Mar 17 2012 4:50pm
Location: Mareeba - Queensland

Re: Bafang M500/M600 thread

Post by Animalector » Dec 24 2021 3:56pm

Were the "part failures" actual part failures or mechanical issues (dry solder joint, failed wire connection etc)

Diode failure is a worry (cheap parts)..

Anyways excellent work

Andy

PadreParada   1 mW

1 mW
Posts: 16
Joined: Jun 11 2021 5:04am

Re: Bafang M500/M600 thread

Post by PadreParada » Dec 25 2021 5:56am

Efim_Rus wrote:
Dec 24 2021 6:39am
PadreParada wrote:
Dec 15 2021 6:02am
Hi Efim, after my motor was water damage I had the same problem as you described, with no pedal assistance. I was able to ride but with the trigger pressed....
Hi PadreParada.
I solved this problem. I would like to share some observations.
This is how my torque sensor looked like:
torqueSensor.jpg
:bigthumb: :bigthumb: :bigthumb: Congrats and Thanks for sharing, this very good information.

PadreParada

Efim_Rus   100 µW

100 µW
Posts: 8
Joined: Dec 10 2021 7:35pm

Re: Bafang M500/M600 thread

Post by Efim_Rus » Dec 25 2021 12:28pm

4πr^2 wrote:
Dec 24 2021 11:22am
In some cases these seem to be 'custom' Chinese parts not available on the general retail market, so may not be possible to match an exact number. But if you can narrow down the form, function, estimated specifications, it is possible to find common retail components.
I can describe how it works when it works.
The sensor has four leads, in my photo you can see the colors of the wires that are connected to it.
1. Orange is the positive power lead 4.7V (+)
2. Purple - OUT 1
3. White - OUT 2
4. Black is the negative GND pin (-)

On a working sensor, when the shaft rotates, OUT 1 and OUT 2 are alternately pulled to GND. If you just bring the magnet with one pole to the sensor, then both pins will be pulled to GND, if you bring the magnet with the opposite pole, then a voltage of 3.25V will appear on these pins, which is formed by pulling these pins to a positive 4.7V power source through a resistor on the electrical circuit.

On the faulty sensor, I noticed that OUT 1 or OUT 2 do not react to a magnetic field.
HallIC_M51.jpg
HallIC_M51.jpg (1.13 MiB) Viewed 978 times

casainho   100 GW

100 GW
Posts: 5777
Joined: Feb 14 2011 2:43pm

Re: Bafang M500/M600 thread

Post by casainho » Dec 25 2021 12:36pm

Efim_Rus wrote:
Dec 25 2021 12:28pm
4πr^2 wrote:
Dec 24 2021 11:22am
In some cases these seem to be 'custom' Chinese parts not available on the general retail market, so may not be possible to match an exact number. But if you can narrow down the form, function, estimated specifications, it is possible to find common retail components.
I can describe how it works when it works.
The sensor has four leads, in my photo you can see the colors of the wires that are connected to it.
1. Orange is the positive power lead 4.7V (+)
2. Purple - OUT 1
3. White - OUT 2
4. Black is the negative GND pin (-)

On a working sensor, when the shaft rotates, OUT 1 and OUT 2 are alternately pulled to GND. If you just bring the magnet with one pole to the sensor, then both pins will be pulled to GND, if you bring the magnet with the opposite pole, then a voltage of 3.25V will appear on these pins, which is formed by pulling these pins to a positive 4.7V power source through a resistor on the electrical circuit.

On the faulty sensor, I noticed that OUT 1 or OUT 2 do not react to a magnetic field.

HallIC_M51.jpg
That should be the cadence sensor. On TSDZ2 is similar output signals as you described. And because they are alternating, it is possible to detect rotation forward or backwards.
- TSDZ2 and OpenSource EV display: 128x64 OLED display, easy to build as DIY, Bluetooth and ANT, OTA wireless updates, easy to repair and customize for other EVs.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: OpenSource EV display, Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays.

Animalector   10 kW

10 kW
Posts: 976
Joined: Mar 17 2012 4:50pm
Location: Mareeba - Queensland

Re: Bafang M500/M600 thread

Post by Animalector » Dec 25 2021 4:08pm

Very cool, so like an AB Quadrature encoder?

Image

In a nutshell, it was a component failure.

Thanks for doing that diagnosis and taking the time to explain. Merry Christmas

Andy

garbageman918   1 µW

1 µW
Posts: 1
Joined: Dec 25 2021 10:10pm

Re: Bafang M500/M600 thread

Post by garbageman918 » Dec 25 2021 11:44pm

Can someone help enlighten me, as this thread scared me away from considering a bike with a m500/m600. It sounds like the stock bafang controller/tune sucks compared to premium brands and there isn't a way to properly tune it to ones liking even with the Luna tune.

But from what it sounds like, the m620 does have some good user tuning capability?

Animalector   10 kW

10 kW
Posts: 976
Joined: Mar 17 2012 4:50pm
Location: Mareeba - Queensland

Re: Bafang M500/M600 thread

Post by Animalector » Dec 26 2021 1:02am

Quite the contrary, I have a Bafang M500 and 600. Not Luna versions but OEM versions and I think the stock firmware is awesome. Under normal conditions it feels the same to me as a Shimano or Bosch or Yamaha. They (the big brands) have advanced their firmware with fancy adaptive power settings but in general the Bafang firmware provides a great ride.

ornias   10 W

10 W
Posts: 69
Joined: Jul 18 2021 3:38am

Re: Bafang M500/M600 thread

Post by ornias » Dec 27 2021 10:00am

4πr^2 wrote:
Dec 23 2021 10:48pm
I think they have the V2 as a $400 upgrade right now. Though the previous 'ludicrous' upgrade was $300 and consisted of about 20 cents worth of shunt resistors so who knows what the actual controller costs. Plus, Luna is obviously a business so have to have mark-up on products. I wouldn't be surprised if 50%+.

100 EUR price point might be pretty tough, though. Especially in small quantities. You might be able to build a basic ~500W replacement for that, but if you want to duplicate the "2500W+" V2 controller with all the bluetooth bells/whistles, it would likely run more. Quality mosfets and the big smoothing capacitors can easily run 2-3 bucks a piece and it runs 12 mosfets and likely 4 capacitors. Plus I think the MCU is going to run $15+, so pretty easy to blow a big chunk of that budget in components. Though conversely if the choices are between a $200 open source board, 'nothing', or an 'unobtainable' controller from luna...
Yeah that's why It might even be more interesting to just port VESC to the S32 controller.
The m500/m600 controller board, is actually a super solid board.
The thing holding it back is just the lack of software for the S32 main controller.

Efim_Rus   100 µW

100 µW
Posts: 8
Joined: Dec 10 2021 7:35pm

Re: Bafang M500/M600 thread

Post by Efim_Rus » Dec 27 2021 10:58am

Hello, do not tell me how to reset the total ODO mileage. Maybe there is some CAN command?

Sandur-Rx   1 mW

1 mW
Posts: 18
Joined: Dec 17 2020 6:12am

Re: Bafang M500/M600 thread

Post by Sandur-Rx » Dec 28 2021 5:39pm

PadreParada wrote:
Dec 15 2021 6:02am
Efim_Rus wrote:
Dec 10 2021 8:08pm
Some bicycles will only ride while holding down the "-" button. In this case, they do not respond to the pedals.
Hi Efim, after my motor was water damage I had the same problem as you described, with no pedal assistance. I was able to ride but with the trigger pressed. The controller was fine but the torque sensor was broken because of the water. I was able to fix it by completely tearing it down, and cleaning the inside where the magnetic stripes are fixed to the axel. See picture below.

This is how my torque sensor looked like:
Dirty torque sensor..png

And it should look like this:
Clean torque sensor.jpg


I have not tried this, but think that the Bafang Ultra uses the same torque sensor as the M600.
You may find how to tear it down here:
https://electricbike.com/forum/forum/kn ... r-assembly
If you need to buy a new one, you may find it here:
https://www.greenbikekit.com/bafang-8fu ... -m620.html


PadreParada
I am placing my Luna silent gear now. I found the axle quite noisy so dismantled it with the torque sensor. The sound came from the left small bearing but I also checked the torque sensor because it feeling like grinding a bit. by dismantling it. I found some minor wear on it like you had. But when al put together after cleaning it stil feels the same. Did you feel the same? Maybe others here that also opent it up? Torque sensor always worked perfect for me.

CGT   1 µW

1 µW
Posts: 3
Joined: Nov 01 2020 7:38pm

Re: Bafang M500/M600 thread

Post by CGT » Jan 01 2022 5:50pm

To be transparent I'm involved with VMG bikes, admin please delete if not allowed.

There is a new frame available for the M500, M510 and M600 motors. Full builds or framesets available for shipping in March.

www.vmgbikes.com/typhon

User avatar
Knetjester   1 µW

1 µW
Posts: 2
Joined: Jan 05 2022 8:08pm

Re: Bafang M500/M600 thread

Post by Knetjester » Jan 05 2022 8:32pm

Hi, I've just joined, many thanks to everyone for all the great advise. I've followed CiDi's guide & I'm awaiting the InnoMaker USB to CAN & the HMI link cables in the post. I've also got the BEEST software working with the script hack & if the InnoMaker doesn't work I'll look into buying the BEEST tool.

I've got a tricycle with 20" wheels & a 250w Bafang M500/48v 14ah battery, I'm maybe going to change the speed setting. I'm fairly new to all this, but I have some knowledge of electronics/computers, so I'm pretty confident.

What's the Frame ID? Is the number produced by reading the firmware/controller or do I have to enter it manually?

Could someone please just have a quick look over these numbers I've converted, just to confirm they're correct, I'm considering either 30,35, or 40kph, is that too much for the 250w? (only on PAS, not on walk mode/thumb throttle)

Cheers.

60kph (37.2mph) = 6000Dec = 1770Hex = 70 17
50kph (31.0mph) = 3100Dec = 0C1CHex = 1C 0C
45kph (27.9mph) = 4500Dec = 1194Hex = 94 11
40kph (24.8mph) = 4000Dec = 0FA0Hex = A0 0F
35kph (21.7mph) = 3500Dec = 0DACHex = AC 0D
30kph (18.6mph) = 3000Dec = 0BB8Hex = B8 0B
Attachments
InkedScreenshot_90.jpg
InkedScreenshot_90.jpg (97.72 KiB) Viewed 670 times

mirkoser100   10 mW

10 mW
Posts: 31
Joined: Jul 30 2020 12:07am

Re: Bafang M500/M600 thread

Post by mirkoser100 » Jan 07 2022 12:07pm

Hey Guys, has anybody of you an idea when the new Bafang M510 is available?

https://bafang-e.com/en/oem-area/compon ... -g522250c/


Gesendet von iPhone mit Tapatalk

PadreParada   1 mW

1 mW
Posts: 16
Joined: Jun 11 2021 5:04am

Re: Bafang M500/M600 thread

Post by PadreParada » Jan 10 2022 1:55pm

Sandur-Rx wrote:
Dec 28 2021 5:39pm

I am placing my Luna silent gear now. I found the axle quite noisy so dismantled it with the torque sensor. The sound came from the left small bearing but I also checked the torque sensor because it feeling like grinding a bit. by dismantling it. I found some minor wear on it like you had. But when al put together after cleaning it stil feels the same. Did you feel the same? Maybe others here that also opent it up? Torque sensor always worked perfect for me.
Yes, It felt a little grinding when turning the axle. But it has been working ok since I closed it.

CGT   1 µW

1 µW
Posts: 3
Joined: Nov 01 2020 7:38pm

Re: Bafang M500/M600 thread

Post by CGT » Jan 12 2022 7:33am

It's very very good

Took it for a test ride on the VMG Typhon this afernoon

A BIG step up on the M500
20220112_135251.jpg
20220112_135251.jpg (4.07 MiB) Viewed 560 times

Post Reply