Bafang M500/M600 thread

casainho said:
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.


m600-photo1.png
 
4πr^2 said:
casainho said:
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.


m600-photo1.png

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.
 
Can someone please upload the new CRX10NC4818i132046.8 firmware for testing please?
 
ornias said:
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?.
 
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...
 
PadreParada said:
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

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.View attachment SenCan.jpg
PCBSensorA7.jpg

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
On a working sensor, all 3 bytes should change when you press the pedal with your foot.

Photo of the disassembled sensor:
PCBSensor.jpg
HallIC.jpg
ElecObchiiSensor.jpg



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.
 
ornias said:
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.
 
Efim_Rus said:
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??
 
casainho said:
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
 
Efim_Rus said:
... 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/Files/Datasheets/A1425-Datasheet.ashx
https://www.digikey.com/en/products/detail/allegro-microsystems/A1425LK-T/1006070
 
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
 
Efim_Rus said:
PadreParada said:
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
 
4πr^2 said:
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
 
Efim_Rus said:
4πr^2 said:
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.
 
Very cool, so like an AB Quadrature encoder?

quadrature.jpg


In a nutshell, it was a component failure.

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

Andy
 
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?
 
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.
 
4πr^2 said:
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.
 
Hello, do not tell me how to reset the total ODO mileage. Maybe there is some CAN command?
 
PadreParada said:
Efim_Rus said:
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/knowledge-base/motors-and-kits/62296-bafang-ultra-teardown-of-torque-sensor-assembly
If you need to buy a new one, you may find it here:
https://www.greenbikekit.com/bafang-8fun-spare-parts/ultra-g510-mid-motor-parts/bafang-ultra-motor-torque-sensor-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.
 
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
 
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.7 KB · Views: 1,120
Hey Guys, has anybody of you an idea when the new Bafang M510 is available?

https://bafang-e.com/en/oem-area/components/component/motor/mm-g522250c/


Gesendet von iPhone mit Tapatalk
 
Sandur-Rx said:
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.
 
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
 
Back
Top