Bafang 850C color LCD, currently working for TSDZ2 motor -- Flexible OpenSource firmware

Thanks @casainho!
I've tested with v0.4.2 the display was flipped and it really hard to navigate the settings.

BTW I'm a developer and I'm planning to help with this project in my spare time. If you have any suggestions that I can try to fix this issues please let me know.
I need the throttle working because I take my little grill to the kindergarten on Monday and I can not paddle while I have her with me on the bike. :)
 
genuev said:
Thanks @casainho!
I've tested with v0.4.2 the display was flipped and it really hard to navigate the settings.

BTW I'm a developer and I'm planning to help with this project in my spare time. If you have any suggestions that I can try to fix this issues please let me know.
I need the throttle working because I take my little grill to the kindergarten on Monday and I can not paddle while I have her with me on the bike. :)
I really hope you can ride with your little girl!!

There is a new version with the change log:

Note that I didn´t tested throttle but I think I clearly found the issue on the code

And sorry, right now I dn´t have time to talk about things. But on my head, we need to improve the communciation protocol to hold the bigger configurations. Please join the gitter channel where we talk only development.

Changelog beta.2:
- corrected issue where throttle would not work even if was activated
- corrected automatic timer off

Changelog beta.1
- automatic detection of the two different known LCDs based on ILI9481 and ST7796 controllers (no more need to configure for each one the axis flip)
- new firmware, with common base shared with SW102
- now user can easily choose the variable to shown on each of the four numeric fields (as also choose the variable shown on the graph)
- some limits are now shown on the graph like motor temperature, with yellow color for a value over min limit and red color over max limit
- warnings on lower text field, when some variables goes over max value
- Configurations menu now have sub menus

These release would not be possible without the recent work of the developers: geeksville, lowPerformer and casainho.

NOTE: this version was developed for the TSDZ2 motor controller firmware v0.19.0 (current stable version).
 
I've flashed the latest release 850C_v0.5.0-beta.2 but still no luck with the throttle. :-|
I've also re-flashed the TSDZ2-v0.19.0.hex just to make sure.

It is a shame because I really need it the throttle. We have a saying in Romania "The thing that you are afraid of you will never escape!"

Thank you anyways for you quick response.
 
After some more tries I've managed to kind of make it work.
I've changed the Motor temperature/ feature to throttle and it works but it is on/off.
But I guess it is good enough for now. ;)

Once again thanks! :-D
 
I've went outside to test it and the throttle seems to be working fine. It has some kind of burst when it first engages.
I've found two minor issues:
1. When pressing full throttle the warning message for temp control shows up.
2. When entering screen layout settings the hole screen switches off and when pressing one more time it comes back but all values on the screen like battery voltage, speed, etc, are changing randomly. I had to pull out the battery to stop this madness.

Have a nice weekend!
 
genuev said:
I've went outside to test it and the throttle seems to be working fine. It has some kind of burst when it first engages.
I've found two minor issues:
1. When pressing full throttle the warning message for temp control shows up.
2. When entering screen layout settings the hole screen switches off and when pressing one more time it comes back but all values on the screen like battery voltage, speed, etc, are changing randomly. I had to pull out the battery to stop this madness.

Have a nice weekend!
Nice to know that throttle works. The way it works is in the motor firmware side.

2. I would like to know what means entering screen layout...
 
Yes, I'm not sure what I should call it other then "main screen layout settings" but the main screen can be configured by double pressing the power button and on the second press it is a long press.

Hope it helps!

PS. I've sent you a small donation on PP. Thanks again! :)
 
Unfortunately something went really wrong.
I've left my bike with the screen on for 1h and when I came back and tried to turn it on I've realized that the back light was on but and it did not turn on when I pressed the power button.
I've removed the battery thinking that it just got stuck and it should be fine after that.
But when I've reconnected the battery the back light of the screen comes on but the screen is black.
After some tries it seems that the screen is turning on only when I connect the battery and hold the power button pressed. All functions seem to work fine.
When I want to turn it off I have to remove the battery otherwise the back light will not turn off and it will drain the battery.
Also the USB plug it is not working anymore.

Any ideas what I can do?

I've re-flashed the firmware but nothing changed. It dose not seem to be a hardware issue.

Thanks.
 
genuev said:
Unfortunately something went really wrong.
I've left my bike with the screen on for 1h and when I came back and tried to turn it on I've realized that the back light was on but and it did not turn on when I pressed the power button.
I've removed the battery thinking that it just got stuck and it should be fine after that.
But when I've reconnected the battery the back light of the screen comes on but the screen is black.
After some tries it seems that the screen is turning on only when I connect the battery and hold the power button pressed. All functions seem to work fine.
When I want to turn it off I have to remove the battery otherwise the back light will not turn off and it will drain the battery.
Also the USB plug it is not working anymore.

Any ideas what I can do?

I've re-flashed the firmware but nothing changed. It dose not seem to be a hardware issue.

Thanks.
I think is important to understand if the firmware is running but the LCD is not working for some reason. Try to change assist level with the up down buttons and see if you feel the change on the motor assistance.

Knowing that you can program is good.

I wonder if is something with the data saved on flash memory to store things like configurations and odometer. It should save data before auto power off, maybe something went wrong. I would try to full erase the flash memory with the programmer you use.
 
casainho said:
1. I think is important to understand if the firmware is running but the LCD is not working for some reason. Try to change assist level with the up down buttons and see if you feel the change on the motor assistance.

Knowing that you can program is good.

2. I wonder if is something with the data saved on flash memory to store things like configurations and odometer. It should save data before auto power off, maybe something went wrong. I would try to full erase the flash memory with the programmer you use.

1. It does not seem to be an issue with the LCD. Like I've said the issue seems to be with powering on the display. Right now I can turn it on only if I hold the power button while I connect the battery. There seems to be a routine or something when the display is connected to a power source and it gets stuck.
I've connected the display to a 25 v current source with all other pins disconnected and when I turn on the power source without touching the power button it constantly consumes ~50 mA current and if I press the power button it gose to ~60 mA but it does not power on. Before all this happened it use to consume 50 mA for less then a second and then it went to 0 mA and if I pressed the power button the display will turn on and current went up to around 114 mA.

While the LCD is off(just after I connect the battery) the firmware does not seem to be working. But if the display is on and I turn it off from the off button the LCD turns off, the back light remains on and all the function like throttle and paddle assist works. I have to disconnect it from the battery to turn it off completely.

2. I'm using 'APT BURN TOOLS' to flash the firmware. Can this tool reset the flash? Do I need to open the display erase the flash? Can you recommend a software for resetting the flash?

Thanks! :)
 
genuev said:
casainho said:
1. I think is important to understand if the firmware is running but the LCD is not working for some reason. Try to change assist level with the up down buttons and see if you feel the change on the motor assistance.

Knowing that you can program is good.

2. I wonder if is something with the data saved on flash memory to store things like configurations and odometer. It should save data before auto power off, maybe something went wrong. I would try to full erase the flash memory with the programmer you use.

1. It does not seem to be an issue with the LCD. Like I've said the issue seems to be with powering on the display. Right now I can turn it on only if I hold the power button while I connect the battery. There seems to be a routine or something when the display is connected to a power source and it gets stuck.
I've connected the display to a 25 v current source with all other pins disconnected and when I turn on the power source without touching the power button it constantly consumes ~50 mA current and if I press the power button it gose to ~60 mA but it does not power on. Before all this happened it use to consume 50 mA for less then a second and then it went to 0 mA and if I pressed the power button the display will turn on and current went up to around 114 mA.

While the LCD is off(just after I connect the battery) the firmware does not seem to be working. But if the display is on and I turn it off from the off button the LCD turns off, the back light remains on and all the function like throttle and paddle assist works. I have to disconnect it from the battery to turn it off completely.

2. I'm using 'APT BURN TOOLS' to flash the firmware. Can this tool reset the flash? Do I need to open the display erase the flash? Can you recommend a software for resetting the flash?

Thanks! :)
No way it can use 50mA, it must be burned. Sorry.
 
genuev said:
1. It does not seem to be an issue with the LCD. Like I've said the issue seems to be with powering on the display. Right now I can turn it on only if I hold the power button while I connect the battery. There seems to be a routine or something when the display is connected to a power source and it gets stuck.
I've connected the display to a 25 v current source with all other pins disconnected and when I turn on the power source without touching the power button it constantly consumes ~50 mA current and if I press the power button it gose to ~60 mA but it does not power on. Before all this happened it use to consume 50 mA for less then a second and then it went to 0 mA and if I pressed the power button the display will turn on and current went up to around 114 mA.

While the LCD is off(just after I connect the battery) the firmware does not seem to be working. But if the display is on and I turn it off from the off button the LCD turns off, the back light remains on and all the function like throttle and paddle assist works. I have to disconnect it from the battery to turn it off completely.

2. I'm using 'APT BURN TOOLS' to flash the firmware. Can this tool reset the flash? Do I need to open the display erase the flash? Can you recommend a software for resetting the flash?

Thanks! :)
Sorry for my last erroneous message.

For me, at 25V, it uses about 50mA.

I would say that maybe the LCD is broken but the board is working because the firmware works??

I can tell you that I already burned 2 LCDs but it was during development... I found that I should not power on/off the lab power supply but instead I need first to unconnect the 850C positive power wire.

For full flash erase, I think a firmware file need to be created with full of "0xff"/all ones.

I will release soon another version, maybe you should try.
 
New firmware release: https://github.com/OpenSource-EBike-firmware/Color_LCD/releases/tag/850C_v0.5.0-beta.3

Changelog beta.3:
- corrected SOC
- corrected issue with ADC reading voltage (the display would always enter in simulation mode)
- corrected firmware strings at boot screen

Changelog beta.2:
- corrected issue where throttle would not work even if was activated
- corrected automatic timer off

Changelog beta.1
- automatic detection of the two different known LCDs based on ILI9481 and ST7796 controllers (no more need to configure for each one the axis flip)
- new firmware, with common base shared with SW102
- now user can easily choose the variable to shown on each of the four numeric fields (as also choose the variable shown on the graph)
- some limits are now shown on the graph like motor temperature, with yellow color for a value over min limit and red color over max limit
- warnings on lower text field, when some variables goes over max value
- Configurations menu now have sub menus

These release would not be possible without the recent work of the developers: geeksville, lowPerformer and casainho.

NOTE: this version was developed for the TSDZ2 motor controller firmware v0.19.0 (current stable version).


67594142-9ecf9680-f75b-11e9-83ed-2dd076b83946.jpg


67594143-9ecf9680-f75b-11e9-8e2a-bc2547fcbec2.jpg


67594146-9f682d00-f75b-11e9-90c1-61560dfc3a0c.jpg


67594145-9f682d00-f75b-11e9-8c62-14e39a0fd144.jpg
 
WOW, great work. Excellent to have option to switch main display readout, and also submenu, very nice!

I can't wait until we get the new 860C - with the extra button, and extra visibility in high sunlight.

I have received the new information to modify the firmware to work with it... although my knowledge is limited, it seems like a very easy crossover...
 
I did find a small glitch just so you know, on the main screen when I'm changing what is shown in the grid of four parameters, when I'm cycling through sometimes an odd icon will show instead of odometer motor power human power etc, and sometimes then it shows a fault screen with a code. Next time I'll take a picture of the fault code if that would help but I wasn't thinking shut it off.

Also in the menu sometimes I would have to exit out and then go back in from the main screen after I left a sub menu because it would freeze up quite often.

Last thing for some reason I actually couldn't get to set the motor power from the main screen like usual, have the buttons changed and I missed it?
 
eyebyesickle said:
I did find a small glitch just so you know, on the main screen when I'm changing what is shown in the grid of four parameters, when I'm cycling through sometimes an odd icon will show instead of odometer motor power human power etc, and sometimes then it shows a fault screen with a code. Next time I'll take a picture of the fault code if that would help but I wasn't thinking shut it off.

Also in the menu sometimes I would have to exit out and then go back in from the main screen after I left a sub menu because it would freeze up quite often.

Last thing for some reason I actually couldn't get to set the motor power from the main screen like usual, have the buttons changed and I missed it?
That first issue is solved now.

The freeze you mention, never happened to me so will be hard to debug.

Yes, set motor max power was not implemented yet.
 
casainho said:
Sorry for my last erroneous message.

For me, at 25V, it uses about 50mA.

I would say that maybe the LCD is broken but the board is working because the firmware works??

I can tell you that I already burned 2 LCDs but it was during development... I found that I should not power on/off the lab power supply but instead I need first to unconnect the 850C positive power wire.

For full flash erase, I think a firmware file need to be created with full of "0xff"/all ones.

I will release soon another version, maybe you should try.

The LCD works fine. I've been using it this week. Right now all functions work fine only the power on/off of the display that I have issues with. I just have to disconnect it from the battery to fully turn off.

I'm not sure if this is a hardware issue or software.
I will try the new firmware to see if it fixes anything.

Thanks! :)
 
genuev said:
casainho said:
Sorry for my last erroneous message.

For me, at 25V, it uses about 50mA.

I would say that maybe the LCD is broken but the board is working because the firmware works??

I can tell you that I already burned 2 LCDs but it was during development... I found that I should not power on/off the lab power supply but instead I need first to unconnect the 850C positive power wire.

For full flash erase, I think a firmware file need to be created with full of "0xff"/all ones.

I will release soon another version, maybe you should try.

The LCD works fine. I've been using it this week. Right now all functions work fine only the power on/off of the display that I have issues with. I just have to disconnect it from the battery to fully turn off.

I'm not sure if this is a hardware issue or software.
I will try the new firmware to see if it fixes anything.

Thanks! :)
You can also try older firmware versions.

There is a switch on hardware that turns off the power to the motor controller, maybe it is damaged...
 
casainho said:
1. You can also try older firmware versions.

2. There is a switch on hardware that turns off the power to the motor controller, maybe it is damaged...

1. I did try with older versions and it behaved the same.

2. The 850c displays it behaves the same when is connected to the motor controller or not. So it seems that something in the display is wrong. Also if I turn it off from the button it saves the current state before it freezes with the LCD back light on. The STM32(like) chip seems to run the code just fine.

One think that can be wrong is the is the fact that the DC to DC converter is not turned off. The display is powered by XL7015E1 DC to DC converter has an enable pin that I guess is not turned off.
This can be a software or hardware issue.
But for some reason I feel it is a software issue. :-|

I will get to the bottom of this even if I have to destroy it in the process.
In other words "Fix it till is broken!" :)
 
Hi,

Should I be posting this stuff on github?

A few things:

1) I think the speed reading in MPH, still shows metric, so the speed is off... (seems like all versions)

2) when using the throttle, I keep seeing 'temp shutdown' flash at the bottom (just new version)

3) when leaving a sub menu after changing something especially, it is freezing and I have to exit the menu, and re-enter to scroll (just new version)

4) throttle is glitchy, and not really variable, especially at slower speeds, the stock is variable and smooth, the OSF is not (all versions)

Let me know if I should be using github... I tend not to go there much, but would be happy to since I am using this alot now...

Thanks
 
eyebyesickle said:
Hi,

Should I be posting this stuff on github?

A few things:

1) I think the speed reading in MPH, still shows metric, so the speed is off... (seems like all versions)

2) when using the throttle, I keep seeing 'temp shutdown' flash at the bottom (just new version)

3) when leaving a sub menu after changing something especially, it is freezing and I have to exit the menu, and re-enter to scroll (just new version)

4) throttle is glitchy, and not really variable, especially at slower speeds, the stock is variable and smooth, the OSF is not (all versions)

Let me know if I should be using github... I tend not to go there much, but would be happy to since I am using this alot now...

Thanks
Please post on github, and one issue for each point/issue.

Throttle you must put on motor firmware issues.
 
How much mA does this setup consume when it's switched off?
I have a 36V battery that automatically should switch off after 1 hour.
If it sees current, it stays on. I haven't tested it's treshold yet.
Maybe someone connected it to a lab supply and could give me an estimate.
 
Hi there,
I’ve got the motor flashed with 0.19 and the 850C flashed with 0.5 beta3. But I can’t seem to turn the motor. I get throttle 0-255 feedback but it isn’t enabled or something. Reading online I see that I should be able to enable it in the ‘motor configuration’ page, but it doesn’t appear to be in my firmware. Also I’m not sure if the torque sensor is working properly either because it doesn’t show any feedback in the technical page. The bike is still on a stand as I put it together and I haven’t installed the drivetrain yet, maybe that has something to do with it not sure. Any help would be appreciated. Thanks
 
Powerhour said:
Hi there,
I’ve got the motor flashed with 0.19 and the 850C flashed with 0.5 beta3. But I can’t seem to turn the motor. I get throttle 0-255 feedback but it isn’t enabled or something. Reading online I see that I should be able to enable it in the ‘motor configuration’ page, but it doesn’t appear to be in my firmware. Also I’m not sure if the torque sensor is working properly either because it doesn’t show any feedback in the technical page. The bike is still on a stand as I put it together and I haven’t installed the drivetrain yet, maybe that has something to do with it not sure. Any help would be appreciated. Thanks
Enable throttle on motor temperature config section.

850C firmware needs a good improvement as also documentation on wiki. It will take some time.
 
Back
Top