• Hello ES! We could use some help to get us past the finish line on building the new knowledgebase for the forum.
    Can you donate? Please see our fundraising page. Thank you!

BAFANG M215 (BBS01 CAN bus), M315 (BBS02 CAN bus), M510, M560, M820, CR-A101 FOC Open Source EBiCS Firmware for GD32F303 processors

Have you tried to do a factory reset (calibrate torquesensor)?
Yes, I’ve tried it. Most parameters get reset, but not 3203. The values I tried to write appear there, but they aren’t actually stored in the controller. I also tried loading the original firmware header into the controller and setting the rest of the values to FF (to overwrite the existing data). After loading a normal EBiCS firmware, the problem is still there. BESST and BESST Pro can’t read this data either when using the EBiCS firmware. With the original firmware, this parameter block reads and writes normally.
 
Hm, I have to check this, but I can't test it with a M560, as I don't have one any longer.
Most likely, there’s no need for further testing. My controller is indeed behaving strangely. For example, it keeps supplying voltage to the display (any display, any firmware) even after being turned off — the display then shows error 30 due to a lack of data.
In the end, I managed to write the “3203” parameters using the original firmware and then flashed the rest with Ebics. So, I’ll be able to use the motor until I replace the controller.
P.S: This response (and everything above) refers to the M510 FC 3.0 motor and controller.
After comparing the M560 and M510 motors, I like the M510 better. It’s quieter, legally compliant, noticeably lighter, and powerful enough for my needs.
 
Last edited:
In the end, I managed to write the “3203” parameters using the original firmware and then flashed the rest with Ebics.
Hm, this has no effect on the values, that EBiCS is using for the 3203 parameters. EBiCS is using the default parameters from the config.h on the very first install. After that it reads the values from the virtual EEPROM.
I'll check it later!
 
I'll check it later!
I tried it on the M215, as it is on my workbench at the moment and the CAN communication is identical to the M510/M560 branch. For me it works as expected. The values can be read and written and the last setting is present after a restart of the controller. 🤷‍♂️
But I recommend to reload the Canable GUI in your webbrowser (use the reload button of your webbrowser) after writing and then read the parameters again, to make sure, that you read the latest data really.

1783252920550.png
 
Last edited:
The torque signals drifts a lot obviously. If you restart the system, the offset is calibrated again, that solves the issue of course.
We have two possibilities:
1. increase the threshold to a value even higher than 800
2. Recalibrate the offset from time to time at runtime, if there is obviously no force on the pedal. We would need to find a condition that lets us identify this situation reliably.
I tried pressing hard on the pedal while simultaneously turning on the motor. At first, the motor would only start with a strong pedal press, but after just a few pedal turns, it would start with the slightest touch of the pedal.
 
Can you write down the torque value from the Calories field without load on the pedal in the various situations? (right bin file required, see #569)
This is a feature of the torque sensor. If you turn on the motor with strong pedal pressure, the sensor shows 740 mV up to this pressure, and then the voltage rises sharply to, say, 2500 mV. After a few pedal revolutions, the sensor resumes normal operation.
 
So I have to get a new controller before I can start testing on the real M215 motor
I got a new M315 controller now, as expected it's the same controller as on the M215.
Flashed the EBiCS firmware by the Canable tool, executed the position sensor calibration and it runs with throttle on the first attempt :cool:


PAS is not working yet, I have to check this now.
 
Could you give me some tips on which file to modify which parameters to reduce jerking in the M560 when starting suddenly? There's no PI parameter adjustment in main.c?

Could you put a version of ebics on github with the added ability to adjust the throttle progression?
 
Could you put a version of ebics on github with the added ability to adjust the throttle progression?
The code is in the M510+M560 branch already:


There's no PI parameter adjustment in main.c?
The parameters are defined in the config.h and applied during the initialisation. The only parameter that is directly defined in the main.c is the shift factor.

You could merge the PI-control from the M820 branch to the M510/560, there I switched to floats, that makes it easier to understand and the shift factor is not needed.
 
Last edited:
the BBS01 has a max cadence of just 75/min at 39V with no load
I found, that the original controller of the M215 (that I got as defective with a burnt controller) was labelled with 48V/12A, so I guess the motor is wound with more turns than the 36V version. At 49V the motor reaches a max cadence about 90/min without load.

I did a first test ride with a 48V battery. The default setting with this firmware is 100% for all levels, so if you want to try it, adjust the levels in the Assist (full) tab of the canable tool first. I suggest to set the ECO level to something about 10% and the max motor current to 40 amps. As always, you have to run the position sensor calibration after flashing once.
The minimum cadence to start the motor is depending on the value you set for the PAS timeout. So you have to find a balance of an early start and a long overrun.

The M215 controller has only 6 FETs, the M315 has 12 FETs, but the boards are identical.
1783781195968.png
Here's a photo of my old tinker bike with the M215 (BBS01) installed. The chainline is terrible, I can't use the three largest sprockets. But I don't plan on using the M215 for anything beyond a few test rides, so it doesn't matter..🤷‍♂️


1783781535445.png

In the graph you can see the different logic of the motor current control vs. the battery current control.
The motor current is ramped up with the cadence. The ramp is definded by the two parameters PAS Time Out and Ramp End
If you pedal faster than defined by Ramp End, the motor current keeps constant.
1783782550385.png

If you use a high assist level, the battery current limitation (set to 12 amps in my test ride) kicks in soon, so the wanted motor current can't be maintained.
If the cadence/BEMF get's too high, the battery voltage is to low, to keep the current, so the current drops from some point.
1783783742313.png


regards
stancecoke
 

Attachments

  • EBiCS_for_M215+315_v0.001.zip
    60.5 KB · Views: 1
Last edited:
No volunteers here? I thought the BBS01/BBS02 is still quite popular in the DIY community!
Yes, I need some time to try it. I am moving to a new house. So I will.
You need to spread it, it is hard to find your work. Also I suggest add the M315/BBS02S CAN to your titles, it is easier to find it for many people. I guess there are many waiting to your work!
 
Also I suggest add the M315/BBS02S CAN to your titles
I've changed the title and the first post of this thread.

BAFANG M215 (BBS01 CAN bus), M315 (BBS02 CAN bus), M510, M560, M820, CR-A101 FOC Open Source EBiCS Firmware for GD32F303 processors

I've posted the link in the Telegram BAFANG CAN bus group already...

@mdi has just released v2.2 of the Canable Tool, the EBiCS parameter meaning is shown now in the GUI. Many Thanks! It's much easier now to use it for EBiCS@Bafang (y)

1783867867878.png
 
Last edited:
Back
Top