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

EndlessCadence said:
Funny how we all experience this issue but didn't talk about it before :D Yes I have the same problem but I thought it was because of the aforementioned setting. I think this behaviour is quite annoying.
I verified I changed PAS cadence calculation in a way it is fast to detect stop of pedaling and also is is slower to detect start of pedeling -- maybe if we go back to previous values it will work well again.

Can you guys go back to previous values on main.h file and test??

Previous:
Code:
// PAS_ABSOLUTE_MAX_CADENCE_PWM_CYCLE_TICKS = (x / PAS_NUMBER_MAGNETS)
#define PAS_ABSOLUTE_MAX_CADENCE_PWM_CYCLE_TICKS  (6250 / PAS_NUMBER_MAGNETS) // max hard limit to 150RPM PAS cadence
#define PAS_ABSOLUTE_MIN_CADENCE_PWM_CYCLE_TICKS  (156250 / PAS_NUMBER_MAGNETS) // min hard limit to 6RPM PAS cadence

Current values:
Code:
// x = (1/(150RPM/60)) / (0.000064)
// PAS_ABSOLUTE_MAX_CADENCE_PWM_CYCLE_TICKS = (x / PAS_NUMBER_MAGNETS)
#define PAS_ABSOLUTE_MAX_CADENCE_PWM_CYCLE_TICKS  (6250 / PAS_NUMBER_MAGNETS) // max hard limit to 150RPM PAS cadence
#define PAS_ABSOLUTE_MIN_CADENCE_PWM_CYCLE_TICKS  (93750 / PAS_NUMBER_MAGNETS) // min hard limit to 10RPM PAS cadence
 
EndlessCadence said:
Funny how we all experience this issue but didn't talk about it before :D Yes I have the same problem but I thought it was because of the aforementioned setting. I think this behaviour is quite annoying.
This happens with my bosch ebike too and it is more annoying on that one than the tsdz2. I am still running 0.3 JB version (sorry) and it still happens on that version as well. It may think you are starting from rest. Easy fix is just to check the speed sensor. I will check the code and see if I can find it ?

Will be upgrading when my temperature sensors come in, so may changes but for me I am 99% happy with how the bike performs with my settings on 0.3.
 
casainho said:
I verified I changed PAS cadence calculation in a way it is fast to detect stop of pedaling and also is is slower to detect start of pedeling -- maybe if we go back to previous values it will work well again.

Can you guys go back to previous values on main.h file and test??

I have a issue with my LCD 3 , when I move / touch it it is going for reset or switching off.
have to look into it today .
Then I will continue testing
 
casainho said:
I verified I changed PAS cadence calculation in a way it is fast to detect stop of pedaling and also is is slower to detect start of pedeling -- maybe if we go back to previous values it will work well again.


Maybe the change in torque sensor value is good ro detect the start of pedaling
 
Did a new release V0.11: Now each assist level and boost level are defined in watts.

I also updated the wiki page to reflect this changes.
 
I just flashed this version I think, with a compiler
Thank you for the fitness bike :) I was suprised to see the assistance levels

but no more than 260 W 7.4 amps
Crosschecked all parameters.

But I have to admit that I first flashed the motor firmware on the LCD
But I recognized my fault directly after flash!
 
Hi Casainho, thanks for your hard work! I'm developing some features as well but I find it hard to keep up with your changes. Is it possible for you to have the new features beta tested before they end up in master? Now it feels like everything changes every day :p I experience some bugs as well and I'm constantly in doubt whether I just introduced that particular bug or not :D

I've just created a PR with a fix for one the bugs, the lights couldn't be turned off.
 
EndlessCadence said:
Is it possible for you to have the new features beta tested before they end up in master?
I tend to agree, we are trying to get new users to use this firmware but realistically there are potentially bugs everywhere and all we will end up with are a lot of disgruntled people.
So the branch should stay out of the master until at least one person tests it, unless it is just an easy bug fix
 
Dirkro said:
I just flashed this version I think, with a compiler

but no more than 260 W 7.4 amps
Crosschecked all parameters.

Maybe a RTFM Error, I thought thet the value for assistance where percentage, not watts
Will give it a try this evening
One more thing I faced: The standard power for the Batterie was 8000 wh.
 
jbalat said:
EndlessCadence said:
Is it possible for you to have the new features beta tested before they end up in master?
I tend to agree, we are trying to get new users to use this firmware but realistically there are potentially bugs everywhere and all we will end up with are a lot of disgruntled people.
So the branch should stay out of the master until at least one person tests it, unless it is just an easy bug fix
Then I think I will create the "development" branch an put there the new code. Let's see if this will work well.

EndlessCadence said:
I've just created a PR with a fix for one the bugs, the lights couldn't be turned off.
Great!! Let's see if we get lights working as expected!! I will test (although I have no lights) and close the issue if is fixed.
 
casainho said:
EndlessCadence said:
I've just created a PR with a fix for one the bugs, the lights couldn't be turned off.
Great!! Let's see if we get lights working as expected!! I will test (although I have no lights) and close the issue if is fixed.
Thanks to your pull request and info I could understand what was wrong -- my code!! I put the new code on "development" branch. Can someone please test? I want to make a new firmware release as this is important for some users.

That was not good code... you see, that if only happens when I turn on the lights bit but when I reset, the if never happens and then it does not reset the lights.

And for me, I can switch on/off the lights and the motor assistance keep working as expected.

Code:
       // set lights state
-      if (p_motor_controller_data->ui8_lights == 1) ui8_tx_buffer[2] |= 0x01;
-
       // walk assist level state
-      if (p_motor_controller_data->ui8_walk_assist_level == 1) ui8_tx_buffer[2] |= 0x02;
+      ui8_tx_buffer[2] = (p_motor_controller_data->ui8_lights & 1) |^M
+          ((p_motor_controller_data->ui8_walk_assist_level & 1) << 1);^M
 
Casainho, I don't understand why you've fixed it again yourself. You could just have completed the PR (or at least discuss about it), albeit to the development branch. It was already tested!! Also, I don't know why this should fix the motor assistance issue when the lights are turned on. That's why I created a separate bug report for that issue.

This isn't the first time and as much as I appreciate your work and time devoted to this project (I really do!), do you want collaboration or do you prefer to develop it by yourself? This makes it almost impossible for me to contribute to this project...

That said, it's great that we have a development branch now :D
 
EndlessCadence said:
Casainho, I don't understand why you've fixed it again yourself. You could just have completed the PR (or at least discuss about it), albeit to the development branch. It was already tested!! Also, I don't know why this should fix the motor assistance issue when the lights are turned on. That's why I created a separate bug report for that issue.

This isn't the first time and as much as I appreciate your work and time devoted to this project (I really do!), do you want collaboration or do you prefer to develop it by yourself? This makes it almost impossible for me to contribute to this project...

That said, it's great that we have a development branch now :D
I didn't understand very well your changes but I did understand what was wrong and it was very quick to fix, I did and then I tested. I also tested and found I have no issue about the assistance and so I kept my changes. I closed the issues about that because I don't have them and I can't see what can be failling.

I am kind if new to pull requests but I accepted them before. It is also new to me to have other developers doing pull requests. Maybe we should first discuss before anyone start implementing a new feature?? -- I can say I am now trying to implement simple things like adding battery voltage configuration to reset the WH counter -- I am trying to add to EEPROM a few of variables for that small things that are on issue list.

For instance, I am not working on walk assist feature as you told you were.
 
casainho said:
EndlessCadence said:
Casainho, I don't understand why you've fixed it again yourself. You could just have completed the PR (or at least discuss about it), albeit to the development branch. It was already tested!! Also, I don't know why this should fix the motor assistance issue when the lights are turned on. That's why I created a separate bug report for that issue.

This isn't the first time and as much as I appreciate your work and time devoted to this project (I really do!), do you want collaboration or do you prefer to develop it by yourself? This makes it almost impossible for me to contribute to this project...

That said, it's great that we have a development branch now :D
I didn't understand very well your changes but I did understand what was wrong and it was very quick to fix, I did and then I tested. I also tested and found I have no issue about the assistance and so I kept my changes. I closed the issues about that because I don't have them and I can't see what can be failling.
A PR is a perfect occassion for discussing the feature or bug fix! Feel free to ask for clarification of the code!
Regarding the other issue: if you don't experience the issue that doesn't always mean there is no issue, especially if you're not using lights yourself.
I am kind if new to pull requests but I accepted them before. It is also new to me to have other developers doing pull requests. Maybe we should first discuss before anyone start implementing a new feature?? -- I can say I am now trying to implement simple things like adding battery voltage configuration to reset the WH counter -- I am trying to add to EEPROM a few of variables for that small things that are on issue list.
No problem, we should help each other to collaborate and improve the firmware together. I work with PR's on a daily basis. Yes we should discuss issues/features before implementing, we did this already with the speed limit feature but you did that one yourself too.

Of course you master this firmware but with a little help and patience others can help as well, including myself. Also with testing :D
For instance, I am not working on walk assist feature as you told you were.
Great! I need your help on that one! See https://github.com/OpenSource-EBike-firmware/TongSheng_TSDZ2_motor_controller_firmware/issues/7

Btw, I had offroad mode implemented as well and was testing it but then then you merged many changes back into master one day. :p I have to fix the merge conflicts first and will create a PR then, okay? Here or when the PR is created we can discuss and improve further before merging the feature back into master or development.
 
Dirkro said:
Maybe a RTFM Error, I thought thet the value for assistance where percentage, not watts
Will give it a try this evening
One more thing I faced: The standard power for the Batterie was 8000 wh.

Was not RTFM
No way to get more than 250 W

Is there a secret 250W limit in version 10 when 25 hm/h is on?
anyone same experiance with 36 V Motor 36V Batt.

Regards

Dirk
 
I implemented the "battery voltage reset value for WH counter" and created a new wiki page for the information about configs as the code is only on development branch:

Code:
Voltage to reset Wh counter

54.2 (volts)

On power on the LCD, this value is compared to the battery voltage and if is lower, means that battery is fully charged and the Wh counter is reset.
To find the correct value for this field, fully charge your battery and measure the voltage on LCD3, use a slight lower voltage value for this field, example: my 48V battery charges up to 54.6 volts and so I use the value 54.2.

https://github.com/OpenSource-EBike-firmware/TSDZ2_wiki/wiki/TSDZ2-and-KT-LCD3-advanced-features-with-Flexible-OpenSource-firmwares----DEVELOPMENT
 
Dirkro said:
one stupid newbe question:
How do I reset the EEPROM
I know why you ask.

The firmware was implemented with a key value on EEPROM address 0, that if is different of the expected value when system boot, will write all values to the default. So, you just need to write 0 to the first address or to change the key value on EEPROM file of the firmware.
 
casainho said:
I know why you ask.

The firmware was implemented with a key value on EEPROM address 0, that if is different of the expected value when system boot, will write all values to the default. So, you just need to write 0 to the first address or to change the key value on EEPROM file of the firmware.

For a simple mechanical engineer, this maybe needs a litte bit more explanation:
What I would try..
So if I open the flash tool, I go to the data memory , read it, and put 00 to the upper left ?
then write, restart firmware
right procedure?
:?
 
Dirkro said:
casainho said:
I know why you ask.

The firmware was implemented with a key value on EEPROM address 0, that if is different of the expected value when system boot, will write all values to the default. So, you just need to write 0 to the first address or to change the key value on EEPROM file of the firmware.

For a simple mechanical engineer, this maybe needs a litte bit more explanation:
What I would try..
So if I open the flash tool, I go to the data memory , read it, and put 00 to the upper left ?
then write, restart firmware
right procedure?
:?
I just added an option for LCD configurations to be reset to default values. It is on development branch. I am implementing a few configurations and I will document in the end of today.
 
casainho said:
I just added an option for LCD configurations to be reset to default values. It is on development branch. I am implementing a few configurations and I will document in the end of today.

When I want to flash the developement branch, this is only the LCD, Will this work together with the master of the 011 firmware for the motor?
Please confirm that the hard coded 250W limit is off for this version !!! :evil:
 
EndlessCadence said:
Which hardcoded 250w limit are you talking about?

It was in the one Version
I flashed on 11to September
I connot get it over that limit,

@ EndlessCardence: Is your "Off Road " Fork wready for use ? How to confirure? What are the files working toghether?

Regards

Dirk
 
Dirkro said:
@ EndlessCardence: Is your "Off Road " Fork wready for use ? How to confirure? What are the files working toghether?
Hi Dirk, if you want to try it, go ahead! I would like to encourage other beta testers as well! :D It could be that power limiting isn't working yet but speed limiting should work as desired. I've no more time to test here today because it's dark and the motor assistance doesn't work with the lights turned on :p Does anybody else have this issue as well?

Let me know what you think of the offroad feature!

You can download the version including offroad functionality here:
https://github.com/endlesscadence/TongSheng_TSDZ2_motor_controller_firmware/tree/offroad_mode (motor controller)
https://github.com/endlesscadence/Kunteng_LCD3_firmware/tree/offroad_mode (display)

[strike]Beware that you have to compile the hex files yourself as the included hex files are outdated.[/strike]
edit: pre-compiled hex files can be downloaded here:
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.
 
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?

Regards

Dirk
 
Back
Top