Bafang M500/M600 thread

CiDi said:
casainho said:
Please draw colors on the traces, so we can understand where they go. Change the color when there is another component on the path, like that resistors. Measure the values of each that resistors, maybe you can number them and say here their value. For now, let's focus on the Vcc pin and on/off pin.

Are those components capacitors or resistors?
You are going well!!

That tiny black like between orange line and red, should be all resistors. Please measure them. If they were capacitors, you would probably measure a very high resistance like 1Mohms or even higher. For instance that resistor between the yellow and GND, I expect be be a low value, maybe something lower than 500ohms - that one is in series with GND signal, it is probably just for protection against wrong cable connection or such.

That bigger ones near the red line, are probably diodes. You need to measure them with the multimeter on the specific option to measure didoes - on didoes the current just can flow in one direction and we need to know where is the negative, cathode pin, that usually has a line on on the package.

What is the 0/1 pin on the keypad? is it the on/off button? -- my expectation is that buttons only short each pin to the GND, you can check with multimiter also.
If 0/1 is on/off button, than we already can see Vcc will have a connection to on/off button trough some resistors.

That 2 diodes, it is very important to understant the signals there. I think there are resistors probably to make a pull up (or pull down) - you can check it while not pressing the keypad buttons, if that buttons are 3.3V or 0 volts. We can clearly see the traces then going to the connector on the bottom right, that connects to the other board where is the microcontroller.
 
casainho said:
CiDi said:
casainho said:
Please draw colors on the traces, so we can understand where they go. Change the color when there is another component on the path, like that resistors. Measure the values of each that resistors, maybe you can number them and say here their value. For now, let's focus on the Vcc pin and on/off pin.

Are those components capacitors or resistors?
You are going well!!

That tiny black like between orange line and red, should be all resistors. Please measure them. If they were capacitors, you would probably measure a very high resistance like 1Mohms or even higher. For instance that resistor between the yellow and GND, I expect be be a low value, maybe something lower than 500ohms - that one is in series with GND signal, it is probably just for protection against wrong cable connection or such.

That bigger ones near the red line, are probably diodes. You need to measure them with the multimeter on the specific option to measure didoes - on didoes the current just can flow in one direction and we need to know where is the negative, cathode pin, that usually has a line on on the package.

What is the 0/1 pin on the keypad? is it the on/off button? -- my expectation is that buttons only short each pin to the GND, you can check with multimiter also.
If 0/1 is on/off button, than we already can see Vcc will have a connection to on/off button trough some resistors.

That 2 diodes, it is very important to understant the signals there. I think there are resistors probably to make a pull up (or pull down) - you can check it while not pressing the keypad buttons, if that buttons are 3.3V or 0 volts. We can clearly see the traces then going to the connector on the bottom right, that connects to the other board where is the microcontroller.

For the moment I have done this, when I have more time I do the rest.

COM 0/1= Power button
COM + = Plus button
COM - = Minus button
 

Attachments

  • Bafang_DP-C241.jpg
    Bafang_DP-C241.jpg
    2 MB · Views: 705
CiDi said:
For the moment I have done this, when I have more time I do the rest.

COM 0/1= Power button
COM + = Plus button
COM - = Minus button

file.php


So after that 2 diodes, that 2 resistors, may be pull up ones. Would be nice to understand which voltage they are connected - 5 or 3.3V? if 3.3V, you can check against with multimeter on microcontroller 3.3V pins. And we need to know that resistor values.

What we see is that both on/off and - buttons connect to Vbattery through the same resistors and circuit, expect one has a 0.5k resistor and the other 1.5k resistor. And there is space to put other resistors in parallel, probably to configure a specific resistor value... so this seems to me a way to code / know which button was pressed comparing the different output voltages due to that different resistors...

We need also to check to where the P+ pin is connected - is only to the big resistor on top?? and find if that IC with 8 pins is a DC-DC converter and which one for the leters on the package...
 
Ok, that DC-DC is this one, marked as S81B: https://www.mouser.com/datasheet/2/405/lm5007-442351.pdf

So as we can see, the board uses 2 of that S81B, I bet one for output 3.3V and other for 5V for USB charging. Please verify this by reading the resistors Rfb1 and RFB2, on pins 1 and 5, as seen on the datasheet. This device will control the Vout in a way the FB pin 5 will be 2.5V. An higher or lower resistor RFB2, will make the output to be lower or higher, so the VOUT value is configured with this resistors values.

 
CiDi, here is the schematic I could understand until now.

If you want to edit directly, you can edit with Kicad 6, here: https://github.com/OpenSourceEBike/Bafang_M500_M600/tree/main/Hardware/Display/DP_C240_241/schematic-DP_C240_C241

See that we need to know the values of R1, R4, Rfb1, RFb2, the +3.3V ?? for R1 and R4, Vin for LM5007.

When ONOFF button is not pressed, the signal for the microcontroller will be 3.3V, as Vbat (or the 4.5V) or higher voltage will not cross because of the diode.

 
Hello guys

Came after like 3 months and been shocked to read more than 10 pages. Please keep it technical, at least on endless. FB groups are full of BS. ;)

Please setup a new thread for custom made display with BT. I would recon to keep this thread for M500/600 original components and tweaks.

Also surprised, how Casainho was curious about magnet on rotor shaft, it was here discovered and mentioned like 1.5y ago. That github is a nice project, just dont manage yourself over this forum, it is just balast for others.

And no, 3D printed case is not waterproof, maybe water resistant. ;)) Just print a vase and pour with water. :)
 
Uhhh? Casainho and CiDi you are doing interesting work, please keep posting here. Ignore the above post. It is all obviously relevant and anyway you have revived the thread and attracted new readers.
 
ksbk said:
Uhhh? Casainho and CiDi you are doing interesting work, please keep posting here. Ignore the above post. It is all obviously relevant and anyway you have revived the thread and attracted new readers.
I also think the thread was stopped, no new developments / information. But still writing messages here and attaching images it to much slow, I am on other telegram groups doing development and is much faster - so I plan to ask CiDi to join the telegram group so we can do the heavy development there but keep announcing here any interesting news or the projects status.
 
Anyone that want to join the development group, for actively participating on development or just follow it: https://t.me/bafang_m500_m600_development
 
casainho said:
Anyone knows what are that 2 missing components on the motor controller board? could it be 2 power resistors to measure the motor phase current?

image.png

Did you get a reply to this? The "2" missing components should be 100uF, 63V electrolytic capacitors, rated 105°C. The other (6) 'missing' components are mosfets. The M600 controller has 2 'high' and 2 'low' mosfets per phase, the M500 controller only has one high/one low per phase.
 

Attachments

  • caps.jpg
    caps.jpg
    634.8 KB · Views: 618
  • X1 Ludicrous Controller M600 - Caps.jpg
    X1 Ludicrous Controller M600 - Caps.jpg
    676.1 KB · Views: 618
Guys,
I have connected the M600 controller to M500 engine, but it seems do not want to work.
The wires are OK, the speed sensor is ok.

The symptoms - i can hear the engine when i use the throttle or start paddle very fast but there is no force given to engine, paddles and rear wheel are not rotatig and after a while the error 21 comes.

Any ideas?
 
Kyokushin said:
Guys,
I have connected the M600 controller to M500 engine, but it seems do not want to work.
The wires are OK, the speed sensor is ok.

The symptoms - i can hear the engine when i use the throttle or start paddle very fast but there is no force given to engine, paddles and rear wheel are not rotatig and after a while the error 21 comes.

Any ideas?

Did you do the speed sensor calibration with the BESST interface or with the CAN interface?
The motor could run backwards.
 
Yes, with green and yellow wire swapped ofc - i made an adapter, MR60 input from controller to MR30 on engine. But its ok now, calibration was an issue.

I went to firmware with 15Amps. 18Amps is too much - will eat a plastic gear (confirmed with other one who tried this mod, but 15 is fine).
 

Attachments

  • C4997A0E-28DE-4815-BEAC-627CD79BF7D6.jpeg
    C4997A0E-28DE-4815-BEAC-627CD79BF7D6.jpeg
    601.2 KB · Views: 607
Kyokushin said:
Okay, the speed sensor calibration done job, thanx.
It is not correct to say calibration of the speed sensor. Because the calibration is to know the position rotation of the magnet related to the magnetic hall sensor on the board.

That sensor is only used for motor control algorith and it needs to know accurately the position of the motor shaft.

That is the calibration of the position sensor.
 
4πr^2 said:
casainho said:
Anyone knows what are that 2 missing components on the motor controller board? could it be 2 power resistors to measure the motor phase current?

image.png

Did you get a reply to this? The "2" missing components should be 100uF, 63V electrolytic capacitors, rated 105°C. The other (6) 'missing' components are mosfets. The M600 controller has 2 'high' and 2 'low' mosfets per phase, the M500 controller only has one high/one low per phase.
Thanks. I saw after other picture of the board and realized are capacitors. Even now that we know there is no need for power resistors, the magnetic position sensor should be even better then them.
 
Kyokushin said:
Yes, with green and yellow wire swapped ofc - i made an adapter, MR60 input from controller to MR30 on engine. But its ok now, calibration was an issue.

I went to firmware with 15Amps. 18Amps is too much - will eat a plastic gear (confirmed with other one who tried this mod, but 15 is fine).

Why put M600 controller on M500?
What are the advantages?
 
Slightly higher peak power.
There is no 15A firmware for M500, so the option is to change controller or add shunt resistor to M500 controller to get it working.

I found relatively cheap m600 controller so i swapped that.
 
Doing the development on the chat of Telegram is much faster!!

CiDi could understand the circuit needed to turn on the motor controller. I updated the display schematic as also a WIP page with notes for How to build the display: https://opensourceebike.github.io/build_display-bafang_m500_M600.html

Developers / users interested in helping the development / testing, can now start buying the components as some of them may take like 1 month to arrive due to the war in Europe, etc.

Here the current schematic:

schematic-Bafang_M500_M600.png
 
casainho said:
Doing the development on the chat of Telegram is much faster!!

CiDi could understand the circuit needed to turn on the motor controller. I updated the display schematic as also a WIP page with notes for How to build the display: https://opensourceebike.github.io/build_display-bafang_m500_M600.html

Developers / users interested in helping the development / testing, can now start buying the components as some of them may take like 1 month to arrive due to the war in Europe, etc.

Here the current schematic:

schematic-Bafang_M500_M600.png
I think it is interesting to add Throttle option on schematic
The first thing that pushed me to make a DIY display was the poor management of walk mode
the walk mode is very important in difficult mountain biking
I advise you to go through the NRF52 display (Throttle -> DIY display -> controller)
this will improve the regulation (PID Controller)
lots of functions can be done if the Throttle signal comes out of the NRF
for walk mode:
-not repeatedly press down button until the walking mode is activated
-Walking mode same speed whatever the rear gear
-walk cruise control

on the esp32 there is a DAC
on the NRF you can do that with the output PWM + Capacitor

z5tu.jpg
 
SUPERJC said:
I think it is interesting to add Throttle option on schematic
The first thing that pushed me to make a DIY display was the poor management of walk mode
the walk mode is very important in difficult mountain biking
I advise you to go through the NRF52 display (Throttle -> DIY display -> controller)
this will improve the regulation (PID Controller)
lots of functions can be done if the Throttle signal comes out of the NRF
for walk mode:
-not repeatedly press down button until the walking mode is activated
-Walking mode same speed whatever the rear gear
-walk cruise control

on the esp32 there is a DAC
on the NRF you can do that with the output PWM + Capacitor

z5tu.jpg
!!! Good contribution.

There was an idea / request on the telegram, to implement the street and offroad modes. Where on street mode was asked to set max speed limit to 25om/h and that is done with a CAN command. Also to disable the throttle, but it is a separated analog signal, would need some extra electronics.

Well, myself I do not plan to install throttle. So, all this need to be implemented is a way that is modular, for a user like me being able to simple not install that extra electronics.

As for the project, I hope that we go in very small steps of features, so we can get faster small increasing releases to get value from the display as soon as possible and not need to wait for an endless project.
So the very first version, I would not add this part for the throttle. But developers can always keep developing ahead :)

So, the knowledge you shared is really relevant but will be lost here over the time. The best would be to put on the repository issues list, as an idea about throttle.
 
casainho said:
SUPERJC said:
I think it is interesting to add Throttle option on schematic
The first thing that pushed me to make a DIY display was the poor management of walk mode
the walk mode is very important in difficult mountain biking
I advise you to go through the NRF52 display (Throttle -> DIY display -> controller)
this will improve the regulation (PID Controller)
lots of functions can be done if the Throttle signal comes out of the NRF
for walk mode:
-not repeatedly press down button until the walking mode is activated
-Walking mode same speed whatever the rear gear
-walk cruise control

on the esp32 there is a DAC
on the NRF you can do that with the output PWM + Capacitor

z5tu.jpg
!!! Good contribution.

There was an idea / request on the telegram, to implement the street and offroad modes. Where on street mode was asked to set max speed limit to 25om/h and that is done with a CAN command. Also to disable the throttle, but it is a separated analog signal, would need some extra electronics.

Well, myself I do not plan to install throttle. So, all this need to be implemented is a way that is modular, for a user like me being able to simple not install that extra electronics.

As for the project, I hope that we go in very small steps of features, so we can get faster small increasing releases to get value from the display as soon as possible and not need to wait for an endless project.
So the very first version, I would not add this part for the throttle. But developers can always keep developing ahead :)

So, the knowledge you shared is really relevant but will be lost here over the time. The best would be to put on the repository issues list, as an idea about throttle.

What value should the capacitor have?
Don't you want anything else?
 
CiDi said:
on the esp32 there is a DAC
on the NRF you can do that with the output PWM + Capacitor
There is a very tiny DAC board for Arduino that we could use:
 
Back
Top