TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

buba said:
Therefore, I had the chance to quickly test the changes I have been working on. All seems fine. To be honest I am very excited to get it out for you all to test for yourselves! :) There will always be room for some improvements or bug fixes. Especially now that the entire firmware is getting optimized at the same time new functions are implemented.

Note that I am prioritizing making the current functions and features work and will later try to add the GREAT suggestions from all of you. When we come to a point where everything works we can make this version official and then work on a new version with new additions.

Changelog:
------------------------------------------------------------------------------------------------
- Fixed bug that did not set the screen brightness until user toggles lights
- Improved screen brightness setup, now the user immediately sees the screen brightness during setup
- Fixed bug that did not show imperial units in the new Wheel Speed sub menu in the odometer field
- Implemented a safer cruise/walk assist
- Developed a better Main Screen Setup with more custom settings
- It is now possible to set what to display in the temperature field, such as pedal cadence
- Removed the quick-change-temperature-field
- Optimized UART communication
- Made overall improvements: faster and takes up less space
- Changed the motor acceleration to amps per second, more intuitive
- Implemented an enable/disable throttle toggle. This maybe makes two hex versions for the motor controller (throttle and no-throttle) unnecessary as user can toggle the function on or off via firmware. But this is maybe unsafe to do and it may still be better with two separate versions.
- Some other smaller fixes
------------------------------------------------------------------------------------------------

The pull request is submitted and as always, I look forward to feedback from Casainho and of course from all users!

In this new update the firmware has been optimized and it is very important to RESET to default values OR go through the entire Configuration Menu and CONFIRM that everything is set to correct values so that it works as expected! Sorry if this causes any inconvenience!

Updated wiki:
https://github.com/OpenSource-EBike-firmware/TSDZ2_wiki/wiki/Features-and-configurations-for-version-0.18.X-(beta)

I have given it an extensive test over 2 days and about a 100 miles over all terrains and happy to confirm the new Beta works well. Pleased to see you have restored the thumb throttle too. :thumb:


Usual gripe but always worth mentioning though is that with gloves on or in the dark when increasing the assist level with the up button it is all too easy to enter the set power mode as the on/off button is inadvertently pressed at the same time. And as the up button was pressed it usually goes from 0 (disabled) to 25watts and cuts off power to the motor just when it's needed to increase motor assist not switch it off. Very frustrating indeed. I still can't see why this function is needed anyway and believe me I have tried to as the user can easily and quickly control motor power by adjusting the assist level anyway.


Great job Buba :bigthumb:
 
Rafe said:
Usual gripe but always worth mentioning though is that with gloves on or in the dark when increasing the assist level with the up button it is all too easy to enter the set power mode as the on/off button is inadvertently pressed at the same time and as the up button was pressed
I'm having the same problem. With gloves I accidentally go into power adjustment mode. It's been cold here lately.
 
Popo15 said:
Good Morning! beta v 0.18.2 excellent, only inconvenient, the on / off button together button up is activated very soon when wearing gloves, thank you very much for your time and dedication. :idea:

I agree with this, and also find I am accidentally entering the motor power setup option by mistake. However, I do really like that option at the moment as it quickly allows me to get a feel for the maximum motor power setting while riding and so I would miss not having it.

I think this has been mentioned before but what I would like to see is an option to lock all the configuration menu once 'Tinkering' is complete. The Bafang 850C/DPC-14 display has a 4 pin lock you can enable to do this, which I'll be honest is overkill ( see my post all about hacking my way into one with a lost pin! https://empoweredpeople.co.uk/2018/...lay-when-you-have-forgotten-the-secuirty-pin/) but I know I have riders who would not want to be able to edit any settings by mistake, and just need user controls so I would like to lock the config menu's and require maybe a very long press of all three buttons to unlock? (or another more creative combination)

This would be possible to do on the road if needed but not so easy to do by mistake?
 
perryscope said:
also find I am accidentally entering the motor power setup option by mistake. However, I do really like that option at the moment as it quickly allows me to get a feel for the maximum motor power setting while riding and so I would miss not having it.

I think this has been mentioned before but what I would like to see is an option to lock all the configuration menu once 'Tinkering' is complete. The Bafang 850C/DPC-14 display has a 4 pin lock you can enable to do this, which I'll be honest is overkill ( see my post all about hacking my way into one with a lost pin! https://empoweredpeople.co.uk/2018/...lay-when-you-have-forgotten-the-secuirty-pin/) but I know I have riders who would not want to be able to edit any settings by mistake, and just need user controls so I would like to lock the config menu's and require maybe a very long press of all three buttons to unlock? (or another more creative combination)

This would be possible to do on the road if needed but not so easy to do by mistake?


The problem with set power is that it is not in the configuration menu and is easily accessed in the main display by just a quick up button press and the on/off button (inadvertently) at the same time. There isn't a problem of entering the configuration menu in error which requires long presses of both the up and the down buttons at the same time which can't happen by accident. I don't see why the set power has to be so readily available in the main screen but I must be missing something that should be obvious to me.
 
Buba, should I create a stable release with the pull request since feedback is good?
 
casainho said:
Buba, should I create a stable release with the pull request since feedback is good?

Thanks for asking! That would be great but could you accept the current pull request and I will submit another final one? And then after this you can release the stable version?

This is because I found a ridiculously small bug and room for a really small improvement for safety. This is in total maybe five lines of code. No beta testing required. You will understand what I mean when I send you the next pull request. I can finish it and also submit the pull request today. Then after this you can release the stable release whenever you feel like it!

After this stable release I will look into all the feedback posted (I read everything) and try to sort things out in the next version!


Rafe said:
I have given it an extensive test over 2 days and about a 100 miles over all terrains and happy to confirm the new Beta works well. Pleased to see you have restored the thumb throttle too. :thumb:

Thank you, Rafe! Good to hear, appreciate it as always!

No problems with the Cruise or Walk Assist being activated even when the user lets go of the down button? Have you tried to replicate this problem? I was not able to do so. But took the opportunity to make it even safer in 0.18.0 beta 2 from your feedback. The stable release 0.18.0 should be even more safe.
 
buba said:
casainho said:
Buba, should I create a stable release with the pull request since feedback is good?

Thanks for asking! That would be great but could you accept the current pull request and I will submit another final one? And then after this you can release the stable version?

This is because I found a ridiculously small bug and room for a really small improvement for safety. This is in total maybe five lines of code. No beta testing required. You will understand what I mean when I send you the next pull request. I can finish it and also submit the pull request today. Then after this you can release the stable release whenever you feel like it!

After this stable release I will look into all the feedback posted (I read everything) and try to sort things out in the next version!
I did the release: https://github.com/OpenSource-EBike-firmware/TSDZ2-Smart-EBike/releases/tag/v0.18.0

Please update the wiki main page to point on that new page for v0.18.0.
 
casainho said:
I did the release: https://github.com/OpenSource-EBike-firmware/TSDZ2-Smart-EBike/releases/tag/v0.18.0

Please update the wiki main page to point on that new page for v0.18.0.

I will update the wiki main page!

If you only want one HEX file for the controller it is necessary to remove the "if THROTTLE" in the controller code. I did not do that because I did not know if you wanted to do it like that.
 
buba said:
casainho said:
I did the release: https://github.com/OpenSource-EBike-firmware/TSDZ2-Smart-EBike/releases/tag/v0.18.0

Please update the wiki main page to point on that new page for v0.18.0.

I will update the wiki main page!

If you only want one HEX file for the controller it is necessary to remove the "if THROTTLE" in the controller code. I did not do that because I did not know if you wanted to do it like that.
I think we should go with one hex only, if the throttle is disabled by default (on controller and LCD). User will to to explicity enable it.

If you are using windows, maybe you could update the release script. I did already for linux.

I will release 0.18.1 when you get this of throttle done.
 
casainho said:
buba said:
casainho said:
I did the release: https://github.com/OpenSource-EBike-firmware/TSDZ2-Smart-EBike/releases/tag/v0.18.0

Please update the wiki main page to point on that new page for v0.18.0.

I will update the wiki main page!

If you only want one HEX file for the controller it is necessary to remove the "if THROTTLE" in the controller code. I did not do that because I did not know if you wanted to do it like that.
I think we should go with one hex only, if the throttle is disabled by default (on controller and LCD). User will to to explicity enable it.

If you are using windows, maybe you could update the release script. I did already for linux.

I will release 0.18.1 when you get this of throttle done.

Okay, will change the Windows script and update the code if you think it is better with one HEX only!

Will send pull request within a couple of minutes!

Here is the changelog and changes since version 0.17.0 by the way:


Changelog:
--------------------------------------------------------
- Walk Assist function
- Cruise function
- Improved screen brightness setup, now the user immediately sees the screen brightness during setup
- A new Main Screen Setup with more custom settings for the main screen
- Display of speed, average speed and max speed in odometer field
- It is now possible to set what to display in the temperature field
- Removed the quick-change-temperature-field
- Current ramp up settable from screen, adjustable acceleration
- Implemented an enable/disable throttle toggle. This makes two hex versions for the motor controller unnecessary as user can toggle the function on or off via firmware
- Experimental higher cadence mode for 48 V motor
- Overall code optimization and improvements
--------------------------------------------------------
 
Casainho, I have submitted the pull request. You can edit the release 0.18.0 with these changes or make a new version, version 0.18.1. I feel it might be better to change and update the 0.18.0 release but it is up to you!

Either way, this should be it and this great community has a new official release! :)
 
buba said:
Thank you, Rafe! Good to hear, appreciate it as always!

No problems with the Cruise or Walk Assist being activated even when the user lets go of the down button? Have you tried to replicate this problem? I was not able to do so. But took the opportunity to make it even safer in 0.18.0 beta 2 from your feedback. The stable release 0.18.0 should be even more safe.


Absolutely no problems with either walk assist or cruise. Yes tried to replicate and no re-occurrence, as soon as the button was released they dropped out every time. They work very well too and are a great addition.
 
Hello everyone,

what a fast paced devlopment :D. I finally could get version 17 up and running and it feels great! Thank you very much for this nice piece of project.

BTW:
I set up a dev environment with Eclipse/SDCC/openOCD/STM8 binutils in a Xubuntu 18.04 virtual machine. Although I am quite experienced with STM32/Eclipse/GNU MCU this was a challenge ;)
Is there maybe a interest of sharing this virtual machine? It runs with VMware which is free for non-commercial use and I could upload this to my google drive but it is compressed ~3.5 Gb of size.

Greeting
Niklas
 
Nick said:
Hello everyone,

what a fast paced devlopment :D. I finally could get version 17 up and running and it feels great! Thank you very much for this nice piece of project.

BTW:
I set up a dev environment with Eclipse/SDCC/openOCD/STM8 binutils in a Xubuntu 18.04 virtual machine. Although I am quite experienced with STM32/Eclipse/GNU MCU this was a challenge ;)
Is there maybe a interest of sharing this virtual machine? It runs with VMware which is free for non-commercial use and I could upload this to my google drive but it is compressed ~3.5 Gb of size.

Greeting
Niklas

I would be interested in giving that a try. :)
 
Having some issues with v18.0.0 release for KTLCD3. I have been running KTLCD3-v.0.18.0-beta-2 without issue and decided to upgrade to the release.

However, in STVP I get the following when i load the program file...


File Checksum is 0x2DE60F is that correct?

This does not look right , It will upload but the screen refuses to start, when you pres power it just flashes all LCD elements and goes blank.

I switched back to KTLCD3-v.0.18.0-beta-2. and its working fine again.

Has anyone else tested the release yet? have I missed a step? I noticed the v18 release is 1K bigger than the beta 2 91KB vs 90KB
 
perryscope said:
Nick said:
...
Is there maybe a interest of sharing this virtual machine? ...

I would be interested in giving that a try. :)

Everybody else who has interest just leave me a PM.

@v18.0.0 Address out of range error:
Same for me. There seems to be some "garbage" at the end of the hex file?
 
perryscope said:
Having some issues with v18.0.0 release for KTLCD3. I have been running KTLCD3-v.0.18.0-beta-2 without issue and decided to upgrade to the release.

However, in STVP I get the following when i load the program file...

File Checksum is 0x2DE60F is that correct?

This does not look right , It will upload but the screen refuses to start, when you pres power it just flashes all LCD elements and goes blank.

I switched back to KTLCD3-v.0.18.0-beta-2. and its working fine again.

Has anyone else tested the release yet? have I missed a step? I noticed the v18 release is 1K bigger than the beta 2 91KB vs 90KB

I do not recommend to use the release just yet. There was a problem with the scripts that generate the release on GitHub and the HEX files. I think Casainho will update this as soon as possible!
 
casainho said:
buba said:
casainho said:
2. Remove specific menu for setup max power and instead implement the following code that I am using on Bafang 850C LCD...

Will definitely look into that! Nice work on the 850C by the way!
I am happy on the memory limitation of KT-LCD3 and so we will finish the project. What is your next project? Bafang 850C color LCD or the smaller KT-LCD5??

KT-LCD5 has the advantage of being smaller and is to be placed on one side on the handle bar, leaving free the center space for a mobile, GPS, etc.

KT-LCD5 is very similar to KT-LCD3 but has less the power field on the LCD, so the firmware would need the power field code removed (but the power field can still be shown on the odometer field, so is just the same code as LCD3 minus the power field code).

As you can see, the LCD driver IC is just the same 1622. The pins of STM8 may be different. I have 2 units of LCD5 to play and with my help and with your experience, I bet we could port the firmware in less then 1 week. Would be to place #ifdefs on the code differences of both LCDs, that would be on power field code, on LCD driver code and STM8 pins code.

See here the datasheets and pictures: https://opensourceebikefirmware.bitbucket.io/development/Motor_controllers--BMSBattery_S_series--LCD_control_panel.html




Hello casainho, I saw that you are interested in transferring your software to other displays and I would like to ask you two questions:
- are you continuing to work on the LCD5 display?
- I found on the site of the Italian seller this color display that looks just like the bafang 850C:
http://www.future-bike.it/shop/kit-di-trasformazione-3/display-vertical-a-colori/
  if it really is he definitely solves the problem of cutting the cables for the connection to the engine that you think?
 
zappan said:
Hello casainho, I saw that you are interested in transferring your software to other displays and I would like to ask you two questions:
1. are you continuing to work on the LCD5 display?
2. I found on the site of the Italian seller this color display that looks just like the bafang 850C:
http://www.future-bike.it/shop/kit-di-trasformazione-3/display-vertical-a-colori/
  if it really is he definitely solves the problem of cutting the cables for the connection to the engine that you think?
1. yes.
2. I don´t know... but that one is very expensive!!! You can buy at half of that price on Aliexpress and I guess that with adding costs for taxes will be lower than doubling the price.
 
After we found an issue with the generated hex files, I had created anew version that should be ok now: https://github.com/OpenSource-EBike-firmware/TSDZ2-Smart-EBike/releases/tag/v0.18.2
 
casainho said:
After we found an issue with the generated hex files, I had created anew version that should be ok now: https://github.com/OpenSource-EBike-firmware/TSDZ2-Smart-EBike/releases/tag/v0.18.2

Is the configuration wiki changed compared to buba's 0.18beta?
Thanks
 
casainho said:
After we found an issue with the generated hex files, I had created anew version that should be ok now: https://github.com/OpenSource-EBike-firmware/TSDZ2-Smart-EBike/releases/tag/v0.18.2

Installed and working fine Thanks!

However, I did notice that after a 'Factory reset from the display configuration menu' I had to re-enter some of the 'default' settings such as each of the Walk Assist levels? These were defaulted after a factory reset as in the wiki document in the beta. Not a big issue but it's worth checking through each menu item to be sure they are as expected.
 
thineight said:
casainho said:
After we found an issue with the generated hex files, I had created anew version that should be ok now: https://github.com/OpenSource-EBike-firmware/TSDZ2-Smart-EBike/releases/tag/v0.18.2

Is the configuration wiki changed compared to buba's 0.18beta?
Thanks

The wiki is applicable on 0.18.2 and has not changed in any way. Everything is the same. Only thing that has changed is the scripts that generate the HEX files.
 
Rafe said:
Absolutely no problems with either walk assist or cruise. Yes tried to replicate and no re-occurrence, as soon as the button was released they dropped out every time. They work very well too and are a great addition.

That is great! Thanks a lot for the testing!


perryscope said:
Installed and working fine Thanks!

However, I did notice that after a 'Factory reset from the display configuration menu' I had to re-enter some of the 'default' settings such as each of the Walk Assist levels? These were defaulted after a factory reset as in the wiki document in the beta. Not a big issue but it's worth checking through each menu item to be sure they are as expected.

Good point! Always good to look through the menus, especially with big new versions.

I think there is a long-lived bug with the factory reset. I do not know how far back it has existed. Basically, after you activate the reset and the system powers down, you need to hold down the on/off button. The screen will be black and nothing will happen. But when you release the button and then click it again the system will power on and everything is then reset to default values. Have not looked too much into this to be honest.


Popo15 said:
Good morning, installed version 0.18.2, everything working very well 43 km. thank you

Thank you for the feedback!
 
Back
Top