Bafang M500/M600 thread

As a some-time firmware developer, to me the transition to CANbus is annoying but not so much fatal.

All CANbus really does is establish a "network" of the devices on the bike rather than use a 1:1 serial bus like UART. Less wiring required for more devices on the same broadcast domain, and allows things like the controller communicating "directly" with the battery and sensors rather than having to ask the motor to do so. This also ends up simplifying the firmware on the motor since it doesn't have to serve as a proxy for those other devices. Both CANbus and UART models accept commands and parameters over that connection, the distinction is that the UART models accepted a lot more parameters controlling firmware functions.

Put another way, CANbus didn't really lock us out, but the firmware Bafang wrote for the CANbus motor controller greatly narrowed the range of commands it will accept. It very easily could have gone the other direction and opened up even more customization (or remained the same), but they chose this path, limiting the control surface to wheel diameter and max speed. Stuff like reading torque sensors should now be a function of the CANbus network, and doesn't necessarily involve the motor.

Honestly, if they did it "right" there are no more control surfaces to discover until either Bafang adds them back or someone else writes and publishes their own firmware.

Regarding "change assist levels", my ideal firmware would allow me to specify an assist curve, or select a starting amperage and a linear, logarithmic, or exponential curve to apply according to the assist level thereafter. Even better if it also allowed specifying a maximum for a given assist level, so I could specify stuff like "PAS1 starts at 25W, maxes out at 250W" and "PAS10 starts at 250W, maxes out at 1500W", with a linear/logarithmic/exponential curve between.
 
AHicks said:
casainho said:
I am being trying to write down a list of potential things we would win if developing our own motor firmware. For now, it is:
1. change assist levels
2. unlimited battery voltage range (24V up to 52V)
3. improve Walk assist: original Walk assist rotates the wheel at 1 or 2 km/h, which is very slow, rendering useless this feature

Please expand on what you mean by "change assist levels".
I am being trying to write down a list of potential things we would win if developing our own motor firmware. For now, it is:
1. Customize assist levels: original firmware lowest level 1 is to much powerful for my needs.
2. Improve Walk Assist: original Walk Assist rotates the wheel at 1 or 2 km/h, which is VERY slow, rendering this feature useless.
3. Unlimited battery voltage range: choose between 24V / 7S up to 52V / 14S cells batteries.
 
About CAN, it is a different technology but very well known, with no difficult at all to implement and use.

Our EasyDIY display works very well with CAN for Bafang M500/M600 or on TSDZ2 EBike mid drive motor using UART.

CAN is much better for building more complex systems, as are some new EBikes and electric scooters, where there are like 3 different subsystems exchanging CAN commands and data: motor controller; battery BMS and display. On the Bafang M500/M600, there is a 4th subsystem exchanging CAN commands and data: torque sensor.
 
casainho said:
About CAN, it is a different technology but very well known, with no difficult at all to implement and use.

Our EasyDIY display works very well with CAN for Bafang M500/M600 or on TSDZ2 EBike mid drive motor using UART.

CAN is much better for building more complex systems, as are some new EBikes and electric scooters, where there are like 3 different subsystems exchanging CAN commands and data: motor controller; battery BMS and display. On the Bafang M500/M600, there is a 4th subsystem exchanging CAN commands and data: torque sensor.

Thanks for expanding on the "change assist levels" for me! Much appreciated. Looking forward to your work there.

If CAN works well and is very well known, can you help me understand why the delay in a user interface that's easy for us "non-programmers" to use to modify the programming on our CANbuss M600 and M620's? Maybe something comparable to what we have available for UART based mid drive Bafangs?

Is it because of the way Bafang has locked it down? If so, is there anyone working on that?

Thanks again.
 
AHicks said:
If CAN works well and is very well known, can you help me understand why the delay in a user interface that's easy for us "non-programmers" to use to modify the programming on our CANbuss M600 and M620's? Maybe something comparable to what we have available for UART based mid drive Bafangs?

Is it because of the way Bafang has locked it down? If so, is there anyone working on that?

It’s exactly because of the way Bafang locked it down. What they’ve done is akin to welding the hood of a car shut on top of hardwiring all of its internal connections. There could have been user-serviceable parts inside, but short of sawing it open and ripping out and replacing all the parts, we’re forced to live with the parts and performance choices they made. The analogy is a little strained, but hopefully that helps.
 
casainho said:
AHicks said:
casainho said:
I am being trying to write down a list of potential things we would win if developing our own motor firmware. For now, it is:
1. change assist levels
2. unlimited battery voltage range (24V up to 52V)
3. improve Walk assist: original Walk assist rotates the wheel at 1 or 2 km/h, which is very slow, rendering useless this feature

Please expand on what you mean by "change assist levels".
I am being trying to write down a list of potential things we would win if developing our own motor firmware. For now, it is:
1. Customize assist levels: original firmware lowest level 1 is to much powerful for my needs.
2. Improve Walk Assist: original Walk Assist rotates the wheel at 1 or 2 km/h, which is VERY slow, rendering this feature useless.
3. Unlimited battery voltage range: choose between 24V / 7S up to 52V / 14S cells batteries.
What is the minimum intensity at level 1 on M500/M600?

the level should not be lowered too much because the efficiency drops at low level
Below is a BBS01 wheel in the air measurement to see the power needed to overcome friction
(chain + motor) -> loss about 12W (0.3A at 42V)

5ve5.jpg
 
SUPERJC said:
What is the minimum intensity at level 1 on M500/M600?

the level should not be lowered too much because the efficiency drops at low level
Below is a BBS01 wheel in the air measurement to see the power needed to overcome friction
(chain + motor) -> loss about 12W (0.3A at 42V)

5ve5.jpg
I want to improve my health and so I want a very low assist level, a value of motor power that compensates for the friction of the motor itself and extra weight of the motor and battery. For me, the assist level 1 goes up to 180W. On TSZD2, my lowest preferred value is 75W, so, 2.4 times less!

0.3A seems a very low value for the usual 0.5A or more I see on this motors when running alone, not installed on the frame.
 
casainho said:
SUPERJC said:
What is the minimum intensity at level 1 on M500/M600?

the level should not be lowered too much because the efficiency drops at low level
Below is a BBS01 wheel in the air measurement to see the power needed to overcome friction
(chain + motor) -> loss about 12W (0.3A at 42V)

5ve5.jpg
I want to improve my health and so I want a very low assist level, a value of motor power that compensates for the friction of the motor itself and extra weight of the motor and battery. For me, the assist level 1 goes up to 180W. On TSZD2, my lowest preferred value is 75W, so, 2.4 times less!

0.3A seems a very low value for the usual 0.5A or more I see on this motors when running alone, not installed on the frame.
75W, I chose the same value :mrgreen:

14ec.jpg
 
…and if the current measurement of the M500/600 is reliable
the consumption measurement can be added to the DIY display or/and Garmin

qs63.jpg
 
SUPERJC said:
…and if the current measurement of the M500/600 is reliable
the consumption measurement can be added to the DIY display or/and Garmin
It is already done, working!!
 
casainho said:
SUPERJC said:
…and if the current measurement of the M500/600 is reliable
the consumption measurement can be added to the DIY display or/and Garmin
It is already done, working!!
Good !
now to improve your health and test the bike you are ready to do that :mrgreen:
https://www.trans-portugal.com/mtb/en/
 
SUPERJC said:
casainho said:
SUPERJC said:
…and if the current measurement of the M500/600 is reliable
the consumption measurement can be added to the DIY display or/and Garmin
It is already done, working!!
Good !
now to improve your health and test the bike you are ready to do that :mrgreen:
https://www.trans-portugal.com/mtb/en/
Not that one, but since we will have some holidays here next week, I will to go Santigo de Compostela during 4 days. But not before on this weekend to do one full day here.

I really wish to decrease the Bafang M500/600 assist levels, to improve the battery range, for this full days riding. For now, I will carry with me a 48V 4A charger in the hope to charge 50% while making 1h break for lunch.
 
A LOT less scientific method, but I can share that PAS 1 settings for the KT controllers/displays work pretty good down around 75-100 watts indicated. Good for maintaining a speed of maybe 6 mph or so. Any slower and the bike is hard for this old man to maintain balance, so lower speed not necessary. If you need more, go to a higher PAS level.

75-100 watt PAS 1 setting successfully used on 1000w MAC 12t geared hub, 500w Bafang geared hub, a very similar knock off, a 1500w Leaf direct drive, even a Bafang Ultra! A few others have been tried too, so fairly confident that amount (75-100 watts) should work well.

"Welded Hood" works, answers my question perfectly. Thank you!
 
@casainho
to lower the level without touching the firmware
On the BBS01 I use the PWM method:
if you have a level 0 (no motor) you can try to do
quickly alternate level 1 and 0 to have an intermediate level
250mS between each level send
Given the progressiveness the engine firmware averages
 
Bafang has already implemented can addresses to set many controller operating parameters, but they do not work on M500 / M600 firmware.
There may be a test firmware that uses Bafang, or there is a lock key on the firmware.
We should have the opportunity to speak to some Bafang technician to clarify this.

Controller operating parameters link:
https://github.com/OpenSourceEBike/Bafang_M500_M600/blob/main/BESST%20Parameter%206011-6012-6017-6018.md
 
casainho said:
..
Some one told me this: "Bafang M500/M600 has a bit inferior control to Shimano and Bosch. In single track, stops and starts. In Shimano the control is as if you don't have a motor." -- does anyone understand or knows the difference?
I have been riding Shimano E7000, Bosch Gen 3 (small "funny" sprocket) and Yamaha PW-X3. When comparing how Shimano responds: it is not intrusive, it is following you but have no or little overrun. The ramp up is under controll so still you have the feeling that you pedal and motor is only giving you gentle assistance. Also progressive mode works pretty well. Bosch was too powerfull and Yamaha having immediate response (sometimes to fast)
 
szkuba said:
casainho said:
..
Some one told me this: "Bafang M500/M600 has a bit inferior control to Shimano and Bosch. In single track, stops and starts. In Shimano the control is as if you don't have a motor." -- does anyone understand or knows the difference?
I have been riding Shimano E7000, Bosch Gen 3 (small "funny" sprocket) and Yamaha PW-X3. When comparing how Shimano responds: it is not intrusive, it is following you but have no or little overrun. The ramp up is under controll so still you have the feeling that you pedal and motor is only giving you gentle assistance. Also progressive mode works pretty well. Bosch was too powerfull and Yamaha having immediate response (sometimes to fast)

I would simply like to remind this group that not all riders have the same priorities/objectives. A bike/motor set up for technical (rock garden) trail work is not necessary if the majority of it's use will be on multi use paths riding with people walking their dogs and pushing baby strollers, or even when commuting is a priority. Point being, to my way of thinking anyway, a rider should have some say in how HIS bike is set up, for HIS priorities. If there was a single setup that would excel in all 3 of these scenarios, it wouldn't be as much an issue. Thanks! -Al
 
CiDi said:
Bafang has already implemented can addresses to set many controller operating parameters, but they do not work on M500 / M600 firmware.
There may be a test firmware that uses Bafang, or there is a lock key on the firmware.
We should have the opportunity to speak to some Bafang technician to clarify this.

Controller operating parameters link:
https://github.com/OpenSourceEBike/Bafang_M500_M600/blob/main/BESST%20Parameter%206011-6012-6017-6018.md

Very interesting, I wasn't aware of those or that document. I wonder whether they're placeholders (implemented in the UI before being implemented in the firmware), or if like you said - perhaps there's a debug firmware that Bafang uses. Have you traced back in the UI to find where these are actually used? I've read that BESST only sets wheel size and top speed, and there's a lot more UI here than that.

Now I'm going to have to get geared+wired up and see if I can get these addresses to work on my M620.
 
boudin said:
CiDi said:
Bafang has already implemented can addresses to set many controller operating parameters, but they do not work on M500 / M600 firmware.
There may be a test firmware that uses Bafang, or there is a lock key on the firmware.
We should have the opportunity to speak to some Bafang technician to clarify this.

Controller operating parameters link:
https://github.com/OpenSourceEBike/Bafang_M500_M600/blob/main/BESST%20Parameter%206011-6012-6017-6018.md

Very interesting, I wasn't aware of those or that document. I wonder whether they're placeholders (implemented in the UI before being implemented in the firmware), or if like you said - perhaps there's a debug firmware that Bafang uses. Have you traced back in the UI to find where these are actually used? I've read that BESST only sets wheel size and top speed, and there's a lot more UI here than that.

Now I'm going to have to get geared+wired up and see if I can get these addresses to work on my M620.

These parameters are in the BESST software.
To view them you need to use the python login, which gives you access in constructor mode.

https://endless-sphere.com/forums/viewtopic.php?t=100777&start=434
 
CiDi said:
These parameters are in the BESST software.
To view them you need to use the python login, which gives you access in constructor mode.

https://endless-sphere.com/forums/viewtopic.php?t=100777&start=434

Thanks, I had read that and was skimming through the source of the app from BESST/src. I find that's easier (as a programmer) than setting up a VM and trying to wade through GUI options. It's unfortunate that things like firmware lists are locked behind auth, which means that they can control things like what versions a given user can access.

My guess is that the firmware is written to ignore unknown parameters, and that the above interesting parameters are either newer than your firmware or not enabled on it (hence your comment about test/debug firmware). I wish I had a login to see what firmware is available.

The spec sheets in your repo for the chipsets are somewhat daunting. I would hate to start from nothing, and envy Luna's apparent code access. Do you have a starting point as well, or are you trying to start from a black box?
 
boudin said:
CiDi said:
These parameters are in the BESST software.
To view them you need to use the python login, which gives you access in constructor mode.

https://endless-sphere.com/forums/viewtopic.php?t=100777&start=434

Thanks, I had read that and was skimming through the source of the app from BESST/src. I find that's easier (as a programmer) than setting up a VM and trying to wade through GUI options. It's unfortunate that things like firmware lists are locked behind auth, which means that they can control things like what versions a given user can access.

My guess is that the firmware is written to ignore unknown parameters, and that the above interesting parameters are either newer than your firmware or not enabled on it (hence your comment about test/debug firmware). I wish I had a login to see what firmware is available.

The spec sheets in your repo for the chipsets are somewhat daunting. I would hate to start from nothing, and envy Luna's apparent code access. Do you have a starting point as well, or are you trying to start from a black box?

I am an expert in CAN communication that I use for work in the automation field, I have no experience on software of this type.
I have a BESST account and although there is a function to download firmware online, it never worked.
All the firmware available on github have been requested from the Bafang assistance service.
 
casainho said:
I am being trying to write down a list of potential things we would win if developing our own motor firmware. For now, it is:
1. Customize assist levels: original firmware lowest level 1 is to much powerful for my needs.
2. Improve Walk Assist: original Walk Assist rotates the wheel at 1 or 2 km/h, which is VERY slow, rendering this feature useless.
3. Unlimited battery voltage range: choose between 24V / 7S up to 52V / 14S cells batteries.

3a. Right now (at least my controller) seems to accept a "52V" battery at "full" charge which is ~58.4V, or ~4.17V/cell. There are some circuit board components with ~58-60V ratings, so this range of ~58.4V should be a pretty hard / red line limit. I think a 15S battery is going to be over the max rated limit for some components on the stock controller. Though would be good if the "battery %" could be calibrated to a given battery voltage.

4. Improve (reduce) the lag between applying force to the pedal and the electric assist kicking in.

5. Improve (reduce) the lag between stopping pedaling and the motor continuing assist.

6. Improve / adjust the rate at which assist is 'ramped up' / 'ramped down'. In some cases, it seems like assist kicks in too hard, moves the pedal forward faster than my leg can keep up, then drops off. This makes for a very weird pedaling experience where it feels like you almost fall forward for a second when assist kicks in, only to crash into a 'wall' when the assist suddenly stops again.
 
4pir2 thats right, that delay when you stop pedalling. Last firmware is faulty (if I rememver 46.8, M600 48V) it runs like 1.5s when you stop pedalling. I had to put older firmware.

Would be good if it can stop even faster. 250ms would be best. :)
 
Hi Guys
another idea.I would love to use the mi band as display.They are oled ,look good , cheep and will be just the perfect bike display.
 
savaoaknyc said:
Hi Guys
another idea.I would love to use the mi band as display.They are oled ,look good , cheep and will be just the perfect bike display.
Do you plan to make that development??
 
Back
Top