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

Thank you, I am keen to try!
I am a fan of a 35 km/h offroad mode
have a day off today, good weather, will try!

Do I need to reset the EEPROM? and if, how, programmer or is the a menue?
 
EndlessCadence said:
...
I would like to encourage other beta testers as well!
Let me know what you think of the offroad feature!
...

Super EndlessCadence!!! This feature has been on my wishlist for a long time.
I will try to test it this weekend if I have the time.

Thanks for this feature and i will let you know how it works.
 
Dirkro said:
Thank you, I am keen to try!
I am a fan of a 35 km/h offroad mode
do I need to reset the Eprom?
Hi Dirk, you can configure any speed you want. Yes I would clear the data memory to be certain, whether it is necessary depends on the previous firmware you were using.

bart1006 said:
Super EndlessCadence!!! This feature has been on my wishlist for a long time.
I will try to test it this weekend if I have the time.

Thanks for this feature and i will let you know how it works.
Hi Bart, I needed this feature myself as well. If I have the time I will test again tonight and see if I can create a final version with power limiting working as well. Stay tuned, maybe it's ready before the weekend. I'll let you guys know when I have the final version ready.
 
I did the first test ride with the new off road firmware.
Unfortunatly the speed limit from Menue 0 is totaly ignored, also at "non offroad mode"
I had problems to set up parameters in menue 1, Can anybody help me wher the new parameters are documented?
I found out: 0- max Amperage somwhere later I found the cell numbe..

rest was very nice
 
Dirkro said:
I did the first test ride with the new off road firmware.
Unfortunatly the speed limit from Menue 0 is totaly ignored, also at "non offroad mode"
I had problems to set up parameters in menue 1, Can anybody help me wher the new parameters are documented?
I found out: 0- max Amperage somwhere later I found the cell numbe..

rest was very nice
Thanks for reporting back! Did the offroad mode work? Also the offroad speed and power limit? Enable/disable on system startup? What exactly did you test?

The speed limit from menu 0 (so, not the offroad speed limit) should still work, will test this myself tonight.

Regarding menu 1: Looking at the code the following is correct (for beta version only!):
0 - battery max current
1 - battery low voltage cut off
2 - battery cells number
3 - battery pack resistance (don't know how this works)
 
EndlessCadence said:
...

Thanks for reporting back! Did the offroad mode work? Also the offroad speed and power limit? Enable/disable on system startup? What exactly did you test?

The speed limit from menu 0 (so, not the offroad speed limit) should still work, will test this myself tonight.

....

I was able to switch on the Off- Road Mode, and the Power may have changed... I dont konw which power is set?

The speed limit unfortunatly was allways the value from Offroad Mode.
A said, starting and riding was smooth!!

The Vvltage gauge sas much less fluctuating ! Thank you Casahio
The resistance of the system is maybe for the value in mOhm.
I will try to find this value by setting 7 Amps as maximum and look at the woltage drop when starting.
So far a software I am very happy with, the speed issue should be easy to solve :)
 
EndlessCadence said:
Who is using lights here? I'm having this issue and would like to know if others are having this issue as well: https://github.com/OpenSource-EBike-firmware/TongSheng_TSDZ2_motor_controller_firmware/issues/35

Hi EndlessCadence, I can confirm the issue, I have the same... If you go back to the topic You can see my post the same day casainho released v0.9 on 05 september but nobody seems to have seen my report, probably because nobody believes a user with a few posts!
I do not know the programming language used for this firmware, I think it is C, but I use easily sql and visual basic, so I know the basics of programming! Besides, if you can help, I have no problem in flashing a new firmware every day, test it and give a feedback on the changes carried out if this can help the development.
In this days I'm building a cylindrical copper waterblock to put around the motor winding for a water cooling system, so I'll post some pictures once done!
For casainho: I tested the new versions with assist level in watt and in my opinion is not a good choice! I think that for boost level the watt adjust is the best way, but for assist level the previous mode (factor) was much smart for me! Why did you change that?
Thats all for now, thank You guys, wonderfull job!
 
fi7ippo said:
For casainho: I tested the new versions with assist level in watt and in my opinion is not a good choice! I think that for boost level the watt adjust is the best way, but for assist level the previous mode (factor) was much smart for me! Why did you change that?
I changed because an user told he couldn't understand the factor and asked if was relative to motor power. In the end, it is just another factor. But took me a lot of time to do that change and so I do not plan to go back.
 
I do not have lights installed bit I verified with oscilloscope the signal and it switches as expected. I also looked at the board untill I found what was the pin and found it controls the enable pin of an IC that works as DC-DC step down converter.

When I ride my bicycle at night, I always turn on the lights on LCD3 so I have the background light -- like that I have no problem......
 
Well I have a serious issue unfortunately. After fixing the last issue in the offroad mode I flashed the new hex files to the controller and display. I've also cleared the data memory. When I powered the system the LCD turns on but everything on display remains on and the display isn't initialized.
The EEPROM of the display is written on startup. This isn't the case with the motor controller, it's data memory remains empty. I've tried everything, reprogramming/clearing, older versions of the firmware.
Programming still works fine but the controller doesn't work anymore? What can I do? :cry:
 
EndlessCadence said:
Well I have a serious issue unfortunately. After fixing the last issue in the offroad mode I flashed the new hex files to the controller and display. I've also cleared the data memory. When I powered the system the LCD turns on but everything on display remains on and the display isn't initialized.
The EEPROM of the display is written on startup. This isn't the case with the motor controller, it's data memory remains empty. I've tried everything, reprogramming/clearing, older versions of the firmware.
Programming still works fine but the controller doesn't work anymore? What can I do? :cry:
That happens when there is no communication between controller and LCD. Or you are using a wrong pair of firmwares or maybe a TX or RX wires are not connected anymore.
 
casainho said:
EndlessCadence said:
Well I have a serious issue unfortunately. After fixing the last issue in the offroad mode I flashed the new hex files to the controller and display. I've also cleared the data memory. When I powered the system the LCD turns on but everything on display remains on and the display isn't initialized.
The EEPROM of the display is written on startup. This isn't the case with the motor controller, it's data memory remains empty. I've tried everything, reprogramming/clearing, older versions of the firmware.
Programming still works fine but the controller doesn't work anymore? What can I do? :cry:
That happens when there is no communication between controller and LCD. Or you are using a wrong pair of firmwares or maybe a TX or RX wires are not connected anymore.
Thanks casainho! I'm very happy that it is fixed now! I changed no cabling and the firmware combination was correct. It was simply an error in the option bytes! When reading the option bytes of the motor controller I got an error that they were incorrect and needed to be reprogrammed again. When I did that all problems were gone, did you experience this before?
 
EndlessCadence said:
casainho said:
EndlessCadence said:
Well I have a serious issue unfortunately. After fixing the last issue in the offroad mode I flashed the new hex files to the controller and display. I've also cleared the data memory. When I powered the system the LCD turns on but everything on display remains on and the display isn't initialized.
The EEPROM of the display is written on startup. This isn't the case with the motor controller, it's data memory remains empty. I've tried everything, reprogramming/clearing, older versions of the firmware.
Programming still works fine but the controller doesn't work anymore? What can I do? :cry:
That happens when there is no communication between controller and LCD. Or you are using a wrong pair of firmwares or maybe a TX or RX wires are not connected anymore.
Thanks casainho! I'm very happy that it is fixed now! I changed no cabling and the firmware combination was correct. It was simply an error in the option bytes! When reading the option bytes of the motor controller I got an error that they were incorrect and needed to be reprogrammed again. When I did that all problems were gone, did you experience this before?
The firmware checks for needed bits enbale on option bytes, if they are not, will write them. Maybe that piece of code can be improved for check to all full bytes of option bytes...
Never happened to me.
 
casainho said:
The firmware checks for needed bits enbale on option bytes, if they are not, will write them. Maybe that piece of code can be improved for check to all full bytes of option bytes...
Never happened to me.
Thanks for clarifying. I will take a look at this code.

I've thoroughly tested the offroad feature and everything is working fine except for the power limiting. Casainho, is it possible for you to look at my code? I would like to finish this because many of us, including me, need this feature.

Maybe I have a mistake in the current calculation from the configured power? See: https://github.com/endlesscadence/TongSheng_TSDZ2_motor_controller_firmware/blob/offroad_mode/ebike_app.c

Most interesting part from line 644. Thanks in advance! :D
 
EndlessCadence said:
casainho said:
The firmware checks for needed bits enbale on option bytes, if they are not, will write them. Maybe that piece of code can be improved for check to all full bytes of option bytes...
Never happened to me.
Thanks for clarifying. I will take a look at this code.

I've thoroughly tested the offroad feature and everything is working fine except for the power limiting. Casainho, is it possible for you to look at my code? I would like to finish this because many of us, including me, need this feature.

Maybe I have a mistake in the current calculation from the configured power? See: https://github.com/endlesscadence/TongSheng_TSDZ2_motor_controller_firmware/blob/offroad_mode/ebike_app.c

Most interesting part from line 644. Thanks in advance! :D
Ok but I am being very busy, I hope to do it during next week.
 
casainho said:
EndlessCadence said:
casainho said:
The firmware checks for needed bits enbale on option bytes, if they are not, will write them. Maybe that piece of code can be improved for check to all full bytes of option bytes...
Never happened to me.
Thanks for clarifying. I will take a look at this code.

I've thoroughly tested the offroad feature and everything is working fine except for the power limiting. Casainho, is it possible for you to look at my code? I would like to finish this because many of us, including me, need this feature.

Maybe I have a mistake in the current calculation from the configured power? See: https://github.com/endlesscadence/TongSheng_TSDZ2_motor_controller_firmware/blob/offroad_mode/ebike_app.c

Most interesting part from line 644. Thanks in advance! :D
Ok but I am being very busy, I hope to do it during next week.
Ok, no problem but can we add this version to the main firmware then? It is working perfect and for me (probably most) the power limiting is optional after all.

Two questions:
- there is no development branch for the motor controller?
- You've used the power button + button down combination for the temperature feature if I see it correctly? I'm using the same buttons for offroad as discussed in Github...
 
I've updated the hex files (see links below) with minor improvements. Offroad mode enabled on system startup is now working. The power limiting isn't working yet but the speed limiting is.

I've succesfully tested a combination of two speed limits. E.g. a 35 km/h speed limit when in offroad mode using the speed limit setting which is in menu 0 and a second speed limit of 25 km/h from the offroad configuration menu when offroad mode is not active.

EndlessCadence said:
KT_LCD3_Flexible_OpenSource_firmware-v0.11_offroad_beta.hex
TSDZ2_Flexible_OpenSource_firmware-v0.11_offroad_beta.hex

Configuration:
Use configuration menu 7
0. Offroad functionality -> enable/disable, default disabled
1. Offroad mode active (unlimited speed) on system startup -> enable/disable, default disabled
2. Speed limit when offroad mode not active but enabled (setting 0) -> km/h, default 25 km/h
3. Power limit -> enable/disable, default disabled
4. Power limit -> watts, default 250W

Using (only applicable if setting 0 above is enabled):
1. Offroad mode is shown by the motor assist symbol (directly above the assist level)
  • No blinking -> offroad mode inactive
  • Blinking -> offroad mode active
2. Button on/off + button up (together and both just a short press) -> offroad mode active
3. Button on/off + button down (together and both just a short press) -> offroad mode inactive

Keep in mind that the other speed limit can still be used, so for instance it's possible to have two limits e.g. 25 km/h and 35 km/h.
 
EndlessCadence said:
casainho said:
EndlessCadence said:
casainho said:
The firmware checks for needed bits enbale on option bytes, if they are not, will write them. Maybe that piece of code can be improved for check to all full bytes of option bytes...
Never happened to me.
Thanks for clarifying. I will take a look at this code.

I've thoroughly tested the offroad feature and everything is working fine except for the power limiting. Casainho, is it possible for you to look at my code? I would like to finish this because many of us, including me, need this feature.

Maybe I have a mistake in the current calculation from the configured power? See: https://github.com/endlesscadence/TongSheng_TSDZ2_motor_controller_firmware/blob/offroad_mode/ebike_app.c

Most interesting part from line 644. Thanks in advance! :D
Ok but I am being very busy, I hope to do it during next week.
Ok, no problem but can we add this version to the main firmware then? It is working perfect and for me (probably most) the power limiting is optional after all.

Two questions:
- there is no development branch for the motor controller?
- You've used the power button + button down combination for the temperature feature if I see it correctly? I'm using the same buttons for offroad as discussed in Github...
Go ahead.
There is no development branch on motor firmware yet because I didn't changed that firmware since we dicided yet.
Well, or you try a different button or you need to change the ones I use. I must say I am not totally happy with buttons and how things change and user understand (or not understand) what is changing -- I think we need to revise that we future but for now, let's keep going further because I think we are finishing now the firmware -- look at the issue list!!
 
I am developing the odometer and for that I am changing the communication because more data need to be sent to LCD. I hope next week to finish odometer, even because I will have a long ride on montains of 350kms in 2 days of the weekend -- I want odometer to help me track how many kms I did travel....
 
casainho said:
There is no development branch on motor firmware yet because I didn't changed that firmware since we dicided yet.
Can you create one then I can create a PR with the offroad feature to that branch.

Well, or you try a different button or you need to change the ones I use. I must say I am not totally happy with buttons and how things change and user understand (or not understand) what is changing -- I think we need to revise that we future but for now, let's keep going further because I think we are finishing now the firmware -- look at the issue list!!
I fully agree with you. The difficulty is that we have only three buttons to play with. In this case I probably won't change your buttons but disable them when offroad mode is enabled, I have no other options? We definitely should look into this.

The same applies to the configuration options, there are a lot of them I don't know if we need all. Maybe we should add a choice between basic or advanced mode as the first configuration option, now users are probably overwhelmed by the amount of options. A quick setup screen (wizard like) would be nice too.
 
EndlessCadence said:
casainho said:
There is no development branch on motor firmware yet because I didn't changed that firmware since we dicided yet.
Can you create one then I can create a PR with the offroad feature to that branch.

Well, or you try a different button or you need to change the ones I use. I must say I am not totally happy with buttons and how things change and user understand (or not understand) what is changing -- I think we need to revise that we future but for now, let's keep going further because I think we are finishing now the firmware -- look at the issue list!!
I fully agree with you. The difficulty is that we have only three buttons to play with. In this case I probably won't change your buttons but disable them when offroad mode is enabled, I have no other options? We definitely should look into this.

The same applies to the configuration options, there are a lot of them I don't know if we need all. Maybe we should add a choice between basic or advanced mode as the first configuration option, now users are probably overwhelmed by the amount of options. A quick setup screen (wizard like) would be nice too.
I am away from PC but using mobile were I can accept pull requests, so go ahead.
 
casainho said:
EndlessCadence said:
casainho said:
There is no development branch on motor firmware yet because I didn't changed that firmware since we dicided yet.
Can you create one then I can create a PR with the offroad feature to that branch.

Well, or you try a different button or you need to change the ones I use. I must say I am not totally happy with buttons and how things change and user understand (or not understand) what is changing -- I think we need to revise that we future but for now, let's keep going further because I think we are finishing now the firmware -- look at the issue list!!
I fully agree with you. The difficulty is that we have only three buttons to play with. In this case I probably won't change your buttons but disable them when offroad mode is enabled, I have no other options? We definitely should look into this.

The same applies to the configuration options, there are a lot of them I don't know if we need all. Maybe we should add a choice between basic or advanced mode as the first configuration option, now users are probably overwhelmed by the amount of options. A quick setup screen (wizard like) would be nice too.
I am away from PC but using mobile were I can accept pull requests, so go ahead.
Thanks! I think I found out why the power limiting wasn't working for offroad mode, I was using an incorrect UART package variable ID. Will test the fix tomorrow and create a pull request afterwards.

Meanwhile the beta hex files have been updated for others to test.
 
Nice to hear, that offroad is working well now!

just one question about the speed limit in different menues:
- in menue 0, isnt that the "standard "speed limit, ?
and
- the speed limit in the offroad menue, should be the offroad speed limit?
this would be my first and logucal guess
But from your explanation it looks otherway round.

Regarding the issues of bad comunication between LCD and Motor: I had this issue with 0.9 when I compiled it myself.

My opinion about factor or power limit : First I was confused too, but after playing with the watts, for me the power solution is more handy. Specaly for low leves, when you want to get range.
You must be "brave" put in values high values like 1200-1500 on the high levels.
Once you find this values (my personal favorite are 6 levels from 250-1500) imho. it is real great.


Unfortunatly I will not be able to test coming week til Saturday :(
 
Dirkro said:
Just one question about the speed limit in different menues:
- in menue 0, isnt that the "standard "speed limit, ?
and
- the speed limit in the offroad menue, should be the offroad speed limit?
this would be my first and logucal guess
But from your explanation it looks otherway round.
If I understand you correctly it is the other way around, but it's quite hard to explain and get's confusing quickly :D
I'll try to explain better:

I have the following example settings:
- menu 0 speed limit: 35 km/h
- offroad feature speed limit: 25 km/h (when offroad is inactive!)

When the offroad mode feature is completely disabled:
- menu 0 speed limit is always used

When offroad mode feature is enabled:
- offroad mode inactive: speed limit from offroad configuration menu is used, in this example 25 km/h
- offroad mode active: speed limit from menu 0 is used, in this example 35 km/h
- optionally the power is limited as well

Summarizing, when using/enabling the offroad feature:
- speed limit of menu 0 acts as a upper speed limit, set high enough for unlimited speed. Of course this is not allowed on public roads in certain countries.
- speed limit of offroad configuration menu acts as a lower limit, this is for road usage. Typically set to 25 km/h
- optionally, power can be limited as well. In EU countries this can be 250W.

Unfortunatly I will not be able to test coming week til Saturday :(
No problem! By then I hope that this feature is officially released already.
 
Back
Top