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

How are the motor temps at that level
The one kW was applied for a very few seconds only, so there was no significant heating, I guess...
I can prepare a bin file with 52V
Here you are. The corresponding commit can be found here:
https://github.com/stancecoke/BAFAN...mmit/1278a131e4fb4a9e6f39fa5134131d3afc2ec198

@Avatarkhorn: It would be great, if you would log the position sensor calibration! No need to make a graph, just the csv is OK! Maybe the offset on the calibration value will not work for your motor, as you told, that your motor runs in the other direction....

regards
stancecoke
 

Attachments

  • EBiCS_for_M510_BL38_v0.007.zip
    27.1 KB · Views: 3
Last edited:
@Avatarkhorn: It would be great, if you would log the position sensor calibration! No need to make a graph, just the csv is OK!
I've tried this before. I only get one thing working: either the logger or Node.js, since they're both accessing the same USB device. I couldn't figure out how to run the logger and calibration at the same time.
 
It's fixed, but not in last rls. Can be used by running from source code.
I started from the source code. You've added new values up to 72V. Thanks!
At first, I encountered the same problem: whenever I changed the voltage parameter, it would immediately reset to the original value. Only after I disconnected the display connector was I able to record the correct value, 52V.
Does this mean the problem is somehow related to the data exchange between the controller and the display?
Update: The procedure with the display disconnected only worked on a third-party SW-102T display. Disconnecting the DPC245 connector causes the controller to shut down, and no data is written.
 
Last edited:
Maybe the offset on the calibration value will not work for your motor, as you told, that your motor runs in the other direction....
I don't know what it was. After the latest calibrations, the motor spins as expected with the "Motor = 1" value.

I've calibrated it, and the idle current doesn't exceed 1.2A.
I'll record the ride tomorrow. I'll also try to find the maximum adequate power assist level to reach 1 kW.
 
Well, it's not difficult. You can spin the wheel first to get a speed sensor reading.
I was not able to do the trick :(

But I've compared the efficiency of the EBiCS firmware with the original firmware. I was only able to test at 20kph on the roller trainer. Same load, same gear with the same battery voltage, the current was almost the same. I measured the battery current with a powermeter and the speed with an extra speedo, to make sure, that the values are comparable. I don't trust the values in the display ;). I can't test at higher speeds, as the original firmware allows no changes of the speed limit with the Canable tool 🤷‍♂️
 
was not able to do the trick
Testing #5 – Something went wrong.
Bafang M510 FC 3.0 | Throttle – not in use. | Battery – 52v (14S).
DPC245 Screen | FW - EBiCS_for_M510_BL38_v0.007

1) EBiCS was updated to v0.007. Settings reset. Motor calibration performed using EBiCS.

2) The no-load test showed no issues (current 1.2 A). I'll repeat this test in an hour.

3) I experienced a "wall effect" at high power and cadence.

4) At an assistance level of 130, the power output is already quite high. I wouldn't be surprised if 150-170 EBiCS units would be sufficient to achieve maximum power.
 

Attachments

  • Testing #5 CSV.zip
    1 MB · Views: 2
I experienced a "wall effect" at high power and cadence
The position calibration went wrong obviously, U_d is much too high again.
1775159441659.png

in the V0.0071, the calibration value is shown in the calories field, the rest is the same. After flashing it, please check the value of "calories" and then run the position calibration two or three times and check if the calories value changes significantly after each calibration, or if it is stable. Thanks in advance!
 

Attachments

  • EBiCS_for_M510_BL38_v0.0071.zip
    27.1 KB · Views: 1
After flashing it, please check the value of "calories" and then run the position calibration two or three times and check if the calories value changes significantly after each calibration, or if it is stable.
It took me over 10 calibrations to get stable readings in the 63-65 range. The starting value was 124, then 140+, then 90+, and then gradually decreased to the stable values described above.
It's likely that the original calibration procedure takes longer and uses a higher current for a reason...

I'm seeing something strange when working in Canable. Both in the official release v. 1.9 and when running from the source code.
 
Last edited:
Thats normal, higher assist level must have equal or bigger value then prevoius one.
Well, yes. For a regular firmware, that would be fine. In the case of EBiCS, a higher number means smoother operation and reasonable operation in Eco mode. I think I could have set any value before.
I changed the "Startup Angle" parameter to 2. Then I changed it back to 1. After that, everything returned to "normal." Still, it looks like a minor bug.
 

Attachments

  • Assist.png
    Assist.png
    66.9 KB · Views: 8
I'll check it out today.
It's strange, that you get lower values over the calibration runs. In my tests, I got lower U_d with higher values... The z-pulse happens near electrical 180 degree with your motor. The encoder sends 4096 A-B quadrature pulses per mechanical revolution, 4096/5 ~ 820 pulses per electrical revolution.
For my motor I found a value of about 480 (+60), this is an angle of about 30 degrees electrical.
 
Guys we must be getting near the heat sink limits of these engines. Is there anyway you could add the temperature reading of the motor to the CAN output whilst in test mode. In theory if we then use a DPC245 we could display this in say the speed section of the display. It might help us before we do damage a motor or two.
 
It's send with the CAN messages, just like in the original firmware.
Thw M820 controller has an extra NFC glued to a MOSFET, the M510 hasn't this. The temperature is measured by the processor itself, but this internal measurement is very inaccurate.

IMG_20260403_112625_119~2.jpg
 
Last edited:
Bafang CAN displays show the motor and controller temperatures? Where is that information? I know I can browse through mileage, cadence, power and so on shortly pressing the power button on the display, but I did not see temperatures there.
 
It's send with the CAN messages, just like in the original firmware.
Thw M820 controller has an extra NFC glued to a MOSFET, the M510 hasn't this. The temperature is measured by the processor itself, but this internal measurement is very inaccurate.
Even relatively inaccurate would be enough to get a rough idea that we are over heating the engine.

Interesting that you are already looking at the M820 controller, its the one engine that most interests me. Dado at the KK1 devices has a problem with that temperature reading on his BBR devices, is it sent over the CAN in a different format ?
 

Even relatively inaccurate would be enough to get a rough idea that we are over heating the engine.
The motor temperature reading is accurate, there is a NTC on the motor directly. The controller temperature reading on the M510 may be inaccurate.

Bafang CAN displays show the motor and controller temperatures?
The information is on the bus and shown in the live data of the Canable tool.
One temperature is shown in the App also, but it shows zero with the original firmware. I can't test, if it works with EBiCS at the moment.

Screenshot_20260403-114245.png

I just see, that I'm misusing the internal temperature field for debug information at the moment :)

But the motor temperature is read and is available.
https://github.com/stancecoke/BAFAN...39fa5134131d3afc2ec198/src/CAN_Display.c#L268

https://github.com/stancecoke/BAFAN...b4a9e6f39fa5134131d3afc2ec198/src/main.c#L413
 
Last edited:
Back
Top