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

jbalat said:
I tried it with a 5v source and it seems to work. It went from +25mv to 100mv when I heated it up
So I am only getting 4.4v from the motor ? Perhaps I need to find another point or use a buck converter ?
Good that your sensor works and you could validate it.

So next step is to validate the wiring to the motor controller.

I can't say that 4.4V are not ok. Please make sure you are connecting/measuring to GND and 5V wires of the motor controller. You can try to wire the sensor to the motor controller but keep the output signal not wired and then validate again the output signal and if it works, finally connect to the throttle wire (make sure you are really connecting to throttle wire). Also then look at the ADC value of the throttle that is the raw value measured (5V equals to 255 value).

Also, I think the LM35 can work ok also with a voltage as low as 3.3V...
 
Eremit said:
I am able to build a little code with the Arduino, but it's quite another thing to hack a device; come to some sort of bootloader, finding out how you get graphics onto the display. And I actually never did graphics with an arduino. Making some sort of widgets for a series of customizable screens is something within my abilities, doing it the way you need for open source projects (without a 'to personal style' not - but I'm trying to learn that right now).
I think we can forget the original installed bootloader and instead flash directly our firmware as we do on STM8 KT-LCD3 and TSDZ2. Also only like that we can debug the code, which is really good for development.
And note that the programmer/hardware to flash and debug the code on this LCD is just the same dirty cheap STLinkV2 (or clone) we use for the STM8 KT-LCD3 and TSDZ2 --- (and you know that inside the STLinkV2 clone there is the STM32F103 that is the "same" microcontroller of this LCD??).

About doing the graphs on LCD, seems the GD32F103RET6 supports the interface with 6800 and 8080 LCD types -- as we can see on the board pictures, we will be able to easily find the connections to LCD. Also I bet the LCD is some popular version, cheap, also used on Arduino -- for my experience, they use a lot of ICs that are popular and cheap and used on Arduino world.
As for software, I know there are well know OpenSource libraries to drive this 6800 and 8080 LCD types and draw text and basic shapes, just like the UTFT library hurzhurz is using to develop for xh18lcd.

I hope to get the color LCD from KT Kunteng and the other from Bafang to start play, let's see if I get them in 2 weeks...
 
Today I've tested firmware version 0.13. Worked great and so did offroad mode! I agree with others that the wiki wasn't correct, I solved the problems I found in the 0.13 (and upcoming 0.14) wiki. Didn't test the ODO functionality yet.

I think the new display ideas are interesting but not really something for me personally. I just hate those huge displays, sorry can't help it. I would even prefer a solution without any display or just a small one. That's why I want to go the bluetooth route... I'm also looking into Ant+ to make the motor work with my Garmin smartwatch or bicycle computer :D

Something like the xh18lcd or eggrider (both I don't have) in combination with advanced control and configuration via bluetooth/Ant+ is probably all I need. If I want more I just mount my smartphone to the bike! There are very nice mounting options available. Then I have GPS navigation, GPS logging, music, you name it....
 
Thanks for improving the wiki!!

Any news about the walk assist mode?

About the LCD, I also think they are big and also seem fragile to me, and expensive!!
Well, Bafang has a new small color LCD like xh18lcd and I bet it is equal internally as the bigger versions and so this mean the firmware should be adapted more or less easily to it. We also know they should add Bluetooth to this LCDs in future.

xh18lcd we know that is very limited in terms of flash memory.

eggrider, I can't find it on ebay or AliExpress - I think is risky to develop for a product that may suddenly disappear from the market.

Bafang and Kunteng are popular companies of ebikes that I think is safe to develop for because their products are sold in many places and for long time. Also they are cheap and use popular and cheap technology inside, wich permits the development relatively easy.
 
EndlessCadence said:
Today I've tested firmware version 0.13. Worked great and so did offroad mode!

With me, with offroad mode enabled but switched off, Bike exceeds the 25 km/h. Still.
Also, "Battery Charge in the Temperature Field" enabled, shows nothing there.

So if that works with you but not with me, what could be the problem? Still using 24V Battery Pack.
 
Casainho I am using very thin wires on the sensor. Maybe I need to go to higher gauge if we are only measuring mv?

Endless cadence. I get 2 seconds of assist and then nothing. No assist levels were set up. You need to work on the lcd menu that sets up a default profile. At the moment it's all a big mess. I'm pretty sure that's why everyone is having random experience with this version.
 
Eremit said:
EndlessCadence said:
Today I've tested firmware version 0.13. Worked great and so did offroad mode!
With me, with offroad mode enabled but switched off, Bike exceeds the 25 km/h. Still.
Also, "Battery Charge in the Temperature Field" enabled, shows nothing there.

So if that works with you but not with me, what could be the problem? Still using 24V Battery Pack.
About showing SOC, I am a bit lost I must say, because of changes I did on previous versions and the current version I use that is on development branch (no version released yet).
Other than enable that option of refer, you may need to ON/OFF + DOWN click to cycle between show nothing to show SOC or motor temperature (if is enable). Please try and report!!

1. So you are using a 24V battery pack??
2. Did you calc what is the max speed your motor should give?? please do it and compare to the motor ERPS speed you can read on LCD3. Probably you are getting max motor speed for 24V.
 
jbalat said:
Casainho I am using very thin wires on the sensor. Maybe I need to go to higher gauge if we are only measuring mv?
I don't think so. Please post pictures of your connections!!

You need to validate that the sensor works when connected to motor controller, as you did when it is connected outside to a power supply.
 
Do you guys also reset the data memory before using the firmware?

jbalat said:
Endless cadence. I get 2 seconds of assist and then nothing. No assist levels were set up. You need to work on the lcd menu that sets up a default profile. At the moment it's all a big mess. I'm pretty sure that's why everyone is having random experience with this version.
Correctly me if I'm wrong but this sounds a bit harsh? Can you describe all your settings thoroughly and the problems you have? Do you compile the firmware yourself or are you using the precompiled versions? Casainho and I are both making changes in the firmware sometimes those changes are just plain bugs sorry for that, we're not perfect!
Also version 0.13 isn't even "my" version, offroad mode was added in version 0.12. :wink:

Because we now have separate wiki pages for each version of the firmware users have the possibility to remain on a specific version or downgrade to a previous version. [strike]In this case I think there must be another issue and we should be able to solve it.[/strike]

[strike]I can upload a new compiled version of 0.13 if you want, maybe we have an issue with the hexfiles?[/strike]

edit: I've made a mistake while testing the firmware and my reports of it working great are incorrect, has something to do with my fork of the project and merging etc. Long story short, yesterday I've actually tested 0.12 not 0.13 (of the motor firmware).
I'll test 0.13 soon but to be honest I'm not interested in the features of 0.13 and I too think it's a bit annoying when things are constantly breaking because I need a working bicycle.
The only issue I've fixed in 0.13 was a throttle issue which was reported by a user and was confirmed working again. We should change the versioning and use major and minor version for features and bug fixes, I've suggested this before. The throttle fix for instance shouldn't end up in 0.13 with a bunch of other features. We need something like 1.0, 2.0 for features and 2.1 for a fix etc.

I would advise anyone to stick with version 0.12 (which, at least for me, works great! :D ) until we have fixed the issues.

And again we should use beta testers before releasing the firmware. That's why I asked a few users to test offroad mode (and throttle fix too) and used their feedback before releasing it. Yes, this meant I had to wait for more than a week before releasing it. :wink:
Do we both agree on this Casainho?
 
casainho said:
Thanks for improving the wiki!!

Any news about the walk assist mode?
No problem!

No not yet. Haven't really looked at your comments (from yesterday?) yet. I asked the questions quite some time ago and since then the firmware has moved on quite a bit. Also I don't need this feature myself and just trying to help here. But I'll try it another time :wink:

eggrider, I can't find it on ebay or AliExpress - I think is risky to develop for a product that may suddenly disappear from the market.
I've found a link somewhere in a german forum: https://www.alibaba.com/product-detail/electric-bike-power-meter-Electric-Bike_60701805997.html?spm=a2700.7724857.main07.294.c8451353nqrcBJ

Well, Bafang has a new small color LCD like xh18lcd and I bet it is equal internally as the bigger versions and so this mean the firmware should be adapted more or less easily to it.
Interesting! Do you have a link?
 
EndlessCadence said:
edit: I've made a mistake while testing the firmware and my reports of it working great are incorrect, has something to do with my fork of the project and merging etc. Long story short, yesterday I've actually tested 0.12 not 0.13 (of the motor firmware).
I'll test 0.13 soon but to be honest I'm not interested in the features of 0.13 and I too think it's a bit annoying when things are constantly breaking because I need a working bicycle.
The only issue I've fixed in 0.13 was a throttle issue which was reported by a user and was confirmed working again. We should change the versioning and use major and minor version for features and bug fixes, I've suggested this before. The throttle fix for instance shouldn't end up in 0.13 with a bunch of other features. We need something like 1.0, 2.0 for features and 2.1 for a fix etc.
Another thing I miss is a commit when we make a release! Now I can't got to git commit logs and clearly see where I release did happen and that makes very hard to follow the changes on each version.

About V0.13, I am using it, because I am using the code on development branch. I didn't tested the "off road" feature because I don't need it but also I have no issue with the firmware working as expected.

Also, I am being implementing little changes and the ones that are on issue list, that are mostly the ones the users are asking. And also I usually understand the risk of each change. I think some issues are due to being difficult to understand all the options... and others because of missing documentation.

EndlessCadence said:
And again we should use beta testers before releasing the firmware. That's why I asked a few users to test offroad mode (and throttle fix too) and used their feedback before releasing it. Yes, this meant I had to wait for more than a week before releasing it. :wink:
Do we both agree on this Casainho?
I agree if you agree to make that management - as you did for the release V0.13. If I were develop alone, I would take shortcuts but having help of others, I do agree.

Also, I feel that I am starting to leave LCD3 in favor of the color LCD. I mean that I do not expect to make much more big implementations on LCD3 - but I would love to see others keep improving it and I would love to help a bit here and there.

Things I think should be implemented/improved (looking at issue list):
- walk assist level (this is more on motor controller)
- improve the odometer
- as the odometer, implement the travel time, total travel time, etc
- add calculated pedal human power to odometer field

About your problem with lights, I think it is an limitation of hardware for the amount of current it can drive external lights. But let's keep the issue open until we get more feedback.
 
EndlessCadence said:
eggrider, I can't find it on ebay or AliExpress - I think is risky to develop for a product that may suddenly disappear from the market.
I've found a link somewhere in a german forum: https://www.alibaba.com/product-detail/electric-bike-power-meter-Electric-Bike_60701805997.html?spm=a2700.7724857.main07.294.c8451353nqrcBJ
Still It does not change my opinion. Also I would need to see how it is inside, to see how easy is to develop for... and I am not motivated to buy one to do that. Do you guys have pictures of the internals??

EndlessCadence said:
Well, Bafang has a new small color LCD like xh18lcd and I bet it is equal internally as the bigger versions and so this mean the firmware should be adapted more or less easily to it.
Interesting! Do you have a link?
This one:
[youtube]cbV1wSO-Ccw[/youtube]
 
Hi endless cadence
Didn’t mean to be harsh I love you guys :D but at the moment I have a non working bike. This isn’t stressing me it’s more thinking about new users, that’s all. I used the pre compiled versions 0.13

What I did...
I went to the options tab and locked the firmware then unlocked it to erase it all from scratch
I flashed 0.13 on both
I went to the lcd menu and set the value to 10 to set defaults
Screen went blank
When I restarted I had no assist levels so I set up 4 of them
I went through to do my basic settings and noticed there are 2 spots to set up the number of cells
As I’m going through the menus some have zero and some have numbers from the next menu items so they were not aligned with the documentation.
Now I peddle from start and it works. Once I stop peddling then start again I get no assistance. I need to turn off the motor and turn it on again to get one more peddle of assistance.

I understand that when you compile stuff yourself you can easily fix stuff that’s broken. Your versions will always work and always be better than the released one.

Throughts for the future...
Question is when you publish a new master you should wipe everything and just try it from scratch just to confirm it all works from the point of view of a new user. Really if you do a proper test yourself then there is no reason for further beta testing but it needs to be thorough and from a clean slate.

Edit.. just had a thought after you have tested the releases version upload the memory tab to the firmware folder as well so everyone can have a good working setup from the start. No need to worry about clearing memory and setting defaults ?? will this work ?

Do you have any idea what I may have done wrong or anything I can try ? Should I be clearing everything before I start ?
 
Sorry to post again

I reflashed my old version 0.3 main, data and options tab on the motor

I didn’t have backups of the ktlcd3 so I used an old version like 0.2
But I didn’t have memory or options to flash

Everything is set up as before but I’m getting no assist at all ??? :(

Torque sensor still working

Help !!
 
Hello, this is my first post,
for jbalat, meanwhile, thanks for your tests, I also had your same installation problems with ver 0.13, the engine gave an impulse and no longer gave, 'I tried to flash the ver. 0.12 but it worked the same way ... I solved the first flashando ver. 0.3 and after a bakup I had some ver. 0.12, but 'I used the foresight to hold the power button on the KT LCD3 and also to disconnect the cable from the TDSZ2. I will make subsequent tests to confirm.
For casainho congratulations for your great work I am as you said Mauri78 I'm testing your work in Italy and I reported my impressions on the Italian forum Jobike, meanwhile I ask you if you can solve the problem of braking when turning backwards, then as regards your idea of ​​color dispay I must say that I do not like so much, first because they are not seen well in the day and then because they are more expensive, eggrider stimulates me a lot because it is small and on the handlebars is safer in case of falls and transferring the data on the smartfone there are many possibilities for configurations, data recording, etc. who is using it in the Bafang world, nor is it highly satisfied. Thanks again for the excellent software and good work!
 
Hi,

I ride V0.12:
Lights: work
offroad: work
onroad Speed Limit: work
basically a good and usable firmware.

For my opinion, I whish a non linear power. A low cadence should be more PAS and current driven, high cadences torque - but I didn't test this. In former versions, I remember, you could choose between PAS and torque in the settings but I didn't try it.

BTW: there is a further Display on the market:
https://www.atmparts.eu/p24_eu/eshop/de/2W/BBS-560C

The 560C is a tiny Color Display that would be my favourite!
My favourite Feature list for a "new" Display: 8)

[*] basic bike computer functions with ODO, DST, MAX and AVG, Time
[*] tiny (like 500C, 560C or the eggdriver (colour is not so important). A dot Matrix Display gives much more Options to arrange the important Information.
[*] Flash the Firmware over the UART port OR
[*] Bluetooth functionality for the settings and the probability to load new Software (nice to have)
[*] works with the TSDZ2 ;)

Regards
 
casainho said:
EndlessCadence said:
And again we should use beta testers before releasing the firmware. That's why I asked a few users to test offroad mode (and throttle fix too) and used their feedback before releasing it. Yes, this meant I had to wait for more than a week before releasing it. :wink:
Do we both agree on this Casainho?
I agree if you agree to make that management - as you did for the release V0.13. If I were develop alone, I would take shortcuts but having help of others, I do agree.
I can do this for you no problem! It's best if we both add new features in new branches and this way I can maintain the master branch and thus the official releases. Beta testers can use the version from the development branch. Maybe I need more access to the repository to do this properly and quick.
Also it really helps if we can migrate to a mono repository. All parts of the firmware in one repository, display and motor controller (and wiki?). LCD and controller are strongly tied together after all, this way we prevent mismatches. Later on we can new displays and other extensions as well, share code etc...
Also, I feel that I am starting to leave LCD3 in favor of the color LCD. I mean that I do not expect to make much more big implementations on LCD3 - but I would love to see others keep improving it and I would love to help a bit here and there.

Things I think should be implemented/improved (looking at issue list):
- walk assist level (this is more on motor controller)
- improve the odometer
- as the odometer, implement the travel time, total travel time, etc
- add calculated pedal human power to odometer field

About your problem with lights, I think it is an limitation of hardware for the amount of current it can drive external lights. But let's keep the issue open until we get more feedback.
I have no problem with you focussing on other displays but let's not forget that many users made the switch to LCD3 just a short time ago. This means we should maintain it. Having a mono repository for all displays and the controller firmware really helps here!

Before you move on to other displays are you willing to focus together on a few things in the motor controller first? e.g. resistance when driving backwards, walk assist...
 
casainho said:
EndlessCadence said:
eggrider, I can't find it on ebay or AliExpress - I think is risky to develop for a product that may suddenly disappear from the market.
I've found a link somewhere in a german forum: https://www.alibaba.com/product-detail/electric-bike-power-meter-Electric-Bike_60701805997.html?spm=a2700.7724857.main07.294.c8451353nqrcBJ
Still It does not change my opinion. Also I would need to see how it is inside, to see how easy is to develop for... and I am not motivated to buy one to do that. Do you guys have pictures of the internals??

EndlessCadence said:
Well, Bafang has a new small color LCD like xh18lcd and I bet it is equal internally as the bigger versions and so this mean the firmware should be adapted more or less easily to it.
Interesting! Do you have a link?
This one:
[youtube]cbV1wSO-Ccw[/youtube]
I agree with you regarding the eggrider. It's more of an example of the form factor I would prefer personally. Nice display btw!
 
I deleted the V0.13 hex files and edited to wiki to point to V0.12 as the current version.

I found the LCD3 option to reset to defaults is not working but I could not understand why :-(

EndlessCadence, about the offroad mode, there are 2 things I would like you to change:
1. no blinking of assist symbol, just keep it disable. For me blinking is kind of alert and in my ebikes I keep offroad mode always enable, that is the default for me and so I prefer no blinking.
2. ON/OFF buttons and UP and DOWN were already used before offroad mode, can you please change the keys for offroad mode? why not using UP + ON/OFF + DOWN to switch the modes?
 
If someone has set up version 0.12 and is very happy can they just upload the memory hex dump to the firmware repository.. until you can get the reset defaults working ?

I have some assist now but I need to stand on the peddles to get it to work. Will be riding my trek into work tomorrow. At least I have a few bikes I can fall back on:)
 
jbalat said:
If someone has set up version 0.12 and is very happy can they just upload the memory hex dump to the firmware repository.. until you can get the reset defaults working ?

I have some assist now but I need to stand on the peddles to get it to work. Will be riding my trek into work tomorrow. At least I have a few bikes I can fall back on:)
The defaults should work fine. To get the defaults you have three options:
1. Reset to defaults using the display, but casainho reports this isn't working?
2. Using ST Visual Programmer, directly program the data memory after opening STVP without reading the data memory tab (basically writing all zero's to the data memory). This will give a verification error because the firmware will directly overwrite the data memory, but then you have your defaults.
3. Using ST Visual Programmer, write 00 to the first two positions of the data memory at address 004000.

My sequence which works anytime:
1. Update the display firmware
2. Clear display data memory using method 2 above (won't give verification error)
3. Update the motor controller firmware
4. Clear motor controller data memory using method 2 above (will give verification error)

I'll create a update guide (Windows) very soon.
 
EndlessCadence said:
jbalat said:
If someone has set up version 0.12 and is very happy can they just upload the memory hex dump to the firmware repository.. until you can get the reset defaults working ?

I have some assist now but I need to stand on the peddles to get it to work. Will be riding my trek into work tomorrow. At least I have a few bikes I can fall back on:)
The defaults should work fine. To get the defaults you have three options:
1. Reset to defaults using the display, but casainho reports this isn't working?
2. Using ST Visual Programmer, directly program the data memory after opening STVP without reading the data memory tab (basically writing all zero's to the data memory). This will give a verification error because the firmware will directly overwrite the data memory, but then you have your defaults.
3. Using ST Visual Programmer, write 00 to the first two positions of the data memory at address 004000.

My sequence which works anytime:
1. Update the display firmware
2. Clear display data memory using method 2 above (won't give verification error)
3. Update the motor controller firmware
4. Clear motor controller data memory using method 2 above (will give verification error)

I'll create a update guide (Windows) very soon.
Once we have firmware correctly implemented, reset will work perfectly and even user will not need to care about it!!

Code:
  // start by reading address 0 and see if value is different from our key,
  // if so mean that eeprom memory is clean and we need to populate: should happen after erasing the microcontroller
  ui8_data = FLASH_ReadByte (ADDRESS_KEY);
  if (ui8_data != KEY) // verify if our key exist
  {
    eeprom_write_array (array_default_values, ((uint8_t) EEPROM_BYTES_STORED));
  }
At startup, the system looks for the KEY value and if is wrong (like on a very first flash time), it will write the defaults values.
The KEY value is stored on firmware and what I do, is increment that vale every time I do a new LCD firmware release, because I usually always improve/change the EEPROM variables. Since I increase the key value, the older one stored on EEPROM will not be equal and so defaults are written.

So, it is up to developers to increase the EEPROM KEY value at every firmware release and users should never need to touch on configuration to reset to defaults.

So EndlessCadence, please help improving the firmware instead and avoid to write an extended/long instructions for users every time they flash a new firmware version. Would be great if you could understand why eeprom_erase_key_value (); is not working....
 
Back
Top