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

For handcycles we use different defaults. I would like to know how we can modify the settings before we flash with the defaults we would like to use.
Will someone please share how we can modify the setting before we flash?
THANKS!
 
HughF said:
safeaschuck said:
Hi, I am sinning by double posting, the SW102 thread looks like it has been idle for a couple of weeks and I am suoer keen to crack on!

Any idea what i might be doing wrong?
Wires are soldered through the side entry method and connected as illustrated in the wiki, unit is powered when attempting to flash.
The display is receiving power from the TSDZ2 which has already been flashed with firmware version 1 beta 4.

Other info that may be of use:
A couple of seconds after powering up the display it shows error 30 then displays the speed, allows you to access menu's etc, the battery icon is flashing empty even though the battery is charged.
I cannot detect a bluetooth signal from the unit on the phone app either, it is picking up other bluetooth devices nearby so the phone seems to be functioning O.K.

I did read some of the technical discussions about units shipping with and without bluetooth enabled but it quickly got too technical for me!

Thank you, and thanks for everyone's hard work that is contributing to this. I blew up my 860C before I got it working with the motor so keen to get it right second time! :lol:

50084260138_9f752fd428_k.jpg
So you've flashed the bootloader using the physical connection, and you have then put the sw102 into Bluetooth bootloader flash mode and used nrf toolbox to put the osf onto the display?

Thanks Hugh,

I don't think I have sucsessfully physically flashed it yet?

Maybe I have, but this program, shown above, did not seem to run through all the operations shown on the wiki,* so I assumed failure to flash.

After attempting to flash I tried to turn on the SW102 in the mode sugessted.
M Button first, then power button, hold both for 8 seconds or more, boots but screen stays dark.
(At this point I have no idea whether it has booted because the screen stays dark, but i followed the instructions, so I am assuming it is booted and ready for bluetooth flashing at this point).

This did not make it appear on my list of bluetooth devices.
Next I tried powering up the SW102 and looked, within it's internal menu's for a way to enable bluetooth, couldn't find one.

I have repeated the process a couple more times, still stuck at the same place.


*on the wiki there were 2 example screenshot's of firmware flashing failures. (Great starting point for me to begin to understand this, thanks to the uploader.)
One was failed - no connection,
The other was failed - bad connection.
Mine seemed to get further than both of those, but it didn't get as far as the screenshot of a sucsessful physical flash.
 
safeaschuck said:
Thanks Hugh,

I don't think I have sucsessfully physically flashed it yet?

Maybe I have, but this program, shown above, did not seem to run through all the operations shown on the wiki,* so I assumed failure to flash.

After attempting to flash I tried to turn on the SW102 in the mode sugessted.
M Button first, then power button, hold both for 8 seconds or more, boots but screen stays dark.
(At this point I have no idea whether it has booted because the screen stays dark, but i followed the instructions, so I am assuming it is booted and ready for bluetooth flashing at this point).

This did not make it appear on my list of bluetooth devices.
Next I tried powering up the SW102 and looked, within it's internal menu's for a way to enable bluetooth, couldn't find one.

I have repeated the process a couple more times, still stuck at the same place.


*on the wiki there were 2 example screenshot's of firmware flashing failures. (Great starting point for me to begin to understand this, thanks to the uploader.)
One was failed - no connection,
The other was failed - bad connection.
Mine seemed to get further than both of those, but it didn't get as far as the screenshot of a sucsessful physical flash.
Ah, understood... I flashed mine using stm8flash under linux as I haven't had much success with any flashing from Windows.
 
jeff.page.rides said:
For handcycles we use different defaults. I would like to know how we can modify the settings before we flash with the defaults we would like to use.
Will someone please share how we can modify the setting before we flash?
THANKS!

Hi Jeff,

I am currently working on a handcycle using a TSZ2 and would like to run the latest firmware, would you be able to share the settings you recommend for handcycles? Currently, I am running the stock firmware and its hunting very badly.

Cheers

Neil
rsz_img_20200628_134732.jpg
https://empoweredpeople.co.uk/2020/06/29/adding-a-mid-drive-motor-tsdz2-to-a-handtrike/
 
How does the tsdz2 handle the torque sensor values not being in a left /right/left /right pattern that you will have, with the cranks being clocked the same way?
 
jeff.page.rides said:
For handcycles we use different defaults. I would like to know how we can modify the settings before we flash with the defaults we would like to use.
Will someone please share how we can modify the setting before we flash?
THANKS!

I asked this question a while back and got this answer.

https://endless-sphere.com/forums/viewtopic.php?f=30&t=93818&p=1539245&hilit=rydon+defaults#p1539245
 
perryscope said:
jeff.page.rides said:
For handcycles we use different defaults. I would like to know how we can modify the settings before we flash with the defaults we would like to use.
Will someone please share how we can modify the setting before we flash?
THANKS!

Hi Jeff,

I am currently working on a handcycle using a TSZ2 and would like to run the latest firmware, would you be able to share the settings you recommend for handcycles? Currently, I am running the stock firmware and its hunting very badly.

Cheers

Neil

I am quad so I type very slow, I just spent 40 minutes typing the reply pushed submit and it disappeared to nowhere. I am so p***** *** I'm not going to do it again. At least not until tomorrow when I cool down. From now on I'm gonna copy all the text before I push submit so it doesn't disappear into who knows where!
 
casainho said:
vshitikov said:
Rydon said:
If you get this figured out for windows can you please document it? I would like to compile a version with my own defaults. I flash a lot of TSDZ2 motors and configuring them after flashing them is laborious.

Hi. Yes I will certainly try to document a little more on how to compile on windows, however I'm a relative beginner in the firmware, I'm more into electronics.
Not sure if you already look at this great resource
https://github.com/OpenSource-EBike-firmware/TSDZ2_wiki/wiki/Development
You don't need Eclipse to build the code. Eclipse is needed only if you want to develop and debug.

For the ones looking to build with specific configurations, just need to edit the eeprom.h file, the default values. Then, to build the code, you just need to call the Makefile and have the GCC (compiler, etc) to build the code.

I downloaded the source and after some tinkering I got it to compile. However, there is no eeprom.h in TSDZ2-Smart-EBike-TSDZ2-v1.0.0 among the sources. What file do I edit to change the defaults in the compiled firmware?
 
Benoit said:
cavi said:
One other software issue that bugs me is that the trip meter resets every time you kill the power. Many times on a ride I will stop and turn off the bike and then when I restart the trip meter has reset....... Could we possibly change this for next firmware, then maybe like the BBSHD press both up and down at once and it would reset?

I'm currently working on it !

What is already done : 2 trip memories ("A" and "B") with :
  • time
  • distance
  • average speed
  • max speed

Trip A and B are independant. Datas are saved/load in EEPROM.
It's working fine for me, I have to test it again to be sure.

I now have to implement the reset feature : manually and automaticaly (for 850/860C as SW102 has no RTC).

As soon as all will be done, I'll made a pull request.

My source code is available here ("WIP-trips-memories" branch) : https://github.com/Kenny-54/Color_LCD/tree/WIP-trips-memories
But I did not provide on Github the compiled firmware so if you want to test it you'll have to compile it yourself, or MP me.

For those who are interested on that feature, I'm still working on it. I use my bike every day to go to work since last week, so now I can affirm this works pretty well.
But the distance is a little buggy : I made a mistake in the code calculating it. I will correct it soon.

Last thing, I have a question about the boost feature. I read a few old pages of that thread but I'm not sure to understand what exactily is buggy in that feature.
Could anyone explain it to me ?
I know the enable/disable option is inverted but that not the only issue, right ?
 
Benoit said:
Last thing, I have a question about the boost feature. I read a few old pages of that thread but I'm not sure to understand what exactily is buggy in that feature.
Could anyone explain it to me ?
I know the enable/disable option is inverted but that not the only issue, right ?
I want to make a new release, even with some changes on the motor firmware. Can you please make a PR, even if new feature is a little buggy, no issue at all.
 
Rydon said:
I downloaded the source and after some tinkering I got it to compile. However, there is no eeprom.h in TSDZ2-Smart-EBike-TSDZ2-v1.0.0 among the sources. What file do I edit to change the defaults in the compiled firmware?
You need to make changes only on the display firmware, on the firmware/common/include/eeprom.h file.
 
jeff.page.rides said:
perryscope said:
jeff.page.rides said:
For handcycles we use different defaults. I would like to know how we can modify the settings before we flash with the defaults we would like to use.
Will someone please share how we can modify the setting before we flash?
THANKS!

Hi Jeff,

I am currently working on a handcycle using a TSZ2 and would like to run the latest firmware, would you be able to share the settings you recommend for handcycles? Currently, I am running the stock firmware and its hunting very badly.

Cheers

Neil

I am quad so I type very slow, I just spent 40 minutes typing the reply pushed submit and it disappeared to nowhere. I am so p***** *** I'm not going to do it again. At least not until tomorrow when I cool down. From now on I'm gonna copy all the text before I push submit so it doesn't disappear into who knows where!

Oh no! I totally understand how frustrating that can be, and thanks for considering a second reply, but please no rush, any advice you have for best operation with handcycles using single rotation parallel cranks would be very much appreciated.

You may remember I had a similar issue months ago with a trike rider (conventional cranks) who rides with a prosthetic leg. At the time I was using the V 0.20.0-Beta that Bubu did a lot of development work on. That included 'cadence mode' so I could get around the issue very well with that. However, that build limits me to the KT-LCD3 display and for this hand Trike, I want to use the SW102 display ideally, as well as using the latest firmware if at all possible. So anything that will help me keep the power on for a full rotation should help with the hunting. I noticed there is now a 'Torque sensor filter' that may delay the motor response? maybe that will help delay the motor reacting to a lack of torque through the second half of the rotation?

Thanks

Neil
 
casainho said:
Benoit said:
Last thing, I have a question about the boost feature. I read a few old pages of that thread but I'm not sure to understand what exactily is buggy in that feature.
Could anyone explain it to me ?
I know the enable/disable option is inverted but that not the only issue, right ?
I want to make a new release, even with some changes on the motor firmware. Can you please make a PR, even if new feature is a little buggy, no issue at all.

When do you plan ton make a new release ?
 
Benoit said:
casainho said:
Benoit said:
Last thing, I have a question about the boost feature. I read a few old pages of that thread but I'm not sure to understand what exactily is buggy in that feature.
Could anyone explain it to me ?
I know the enable/disable option is inverted but that not the only issue, right ?
I want to make a new release, even with some changes on the motor firmware. Can you please make a PR, even if new feature is a little buggy, no issue at all.

When do you plan ton make a new release ?
Maybe at the end of next week. There are some small changes to the FOC, that was sent to me by an user.
 
casainho said:
Maybe at the end of next week. There are some small changes to the FOC, that was sent to me by an user.

Ok, so I'll try to make the PR in the next days, maybe this weekend. If I don't have time to fix my mistake about the distance calculation, I'll make PR with my current commit. (And I still have to change the daily RTC counter reset to make the auto reset trip memories above 24h works)


And about the boost feature, what is buggy ? I would like to see if I can fix it but I don't know what's wrong with it.
 
Benoit said:
casainho said:
Maybe at the end of next week. There are some small changes to the FOC, that was sent to me by an user.

Ok, so I'll try to make the PR in the next days, maybe this weekend. If I don't have time to fix my mistake about the distance calculation, I'll make PR with my current commit. (And I still have to change the daily RTC counter reset to make the auto reset trip memories above 24h works)


And about the boost feature, what is buggy ? I would like to see if I can fix it but I don't know what's wrong with it.
Ok, good idea.

About boost feature, I lost the track of what is wrong.
 
Benoit said:
casainho said:
Maybe at the end of next week. There are some small changes to the FOC, that was sent to me by an user.

Ok, so I'll try to make the PR in the next days, maybe this weekend. If I don't have time to fix my mistake about the distance calculation, I'll make PR with my current commit. (And I still have to change the daily RTC counter reset to make the auto reset trip memories above 24h works)


And about the boost feature, what is buggy ? I would like to see if I can fix it but I don't know what's wrong with it.
It seems from my testing that the enable/disable logic is inverted - that is all.

Set it to 'disabled' and I had a tunable boost function, it seemed to take account of values for duration and fade.
Set it to 'enabled' and it had no startup boost.

I tested this by starting from standstill on a very long, steady hill. This was on my singlespeed frame that I don't ride anymore (my TSDZ2 is now in my hardtail MTB with hub gears)
 
HughF said:
Benoit said:
casainho said:
Maybe at the end of next week. There are some small changes to the FOC, that was sent to me by an user.

Ok, so I'll try to make the PR in the next days, maybe this weekend. If I don't have time to fix my mistake about the distance calculation, I'll make PR with my current commit. (And I still have to change the daily RTC counter reset to make the auto reset trip memories above 24h works)


And about the boost feature, what is buggy ? I would like to see if I can fix it but I don't know what's wrong with it.
It seems from my testing that the enable/disable logic is inverted - that is all.

Set it to 'disabled' and I had a tunable boost function, it seemed to take account of values for duration and fade.
Set it to 'enabled' and it had no startup boost.

I tested this by starting from standstill on a very long, steady hill. This was on my singlespeed frame that I don't ride anymore (my TSDZ2 is now in my hardtail MTB with hub gears)

Agree with Hugh comments. And the boost works better "disabled", high current ramp (8-10amps) and specially with "assist w/o rotation" feature "enable". The problem is that this 3 features are in different menus and seems that there are no relation between them. Perhaps a heads up in the wiki description of the boost feature could cover this.
 
Nfer said:
HughF said:
Benoit said:
casainho said:
Maybe at the end of next week. There are some small changes to the FOC, that was sent to me by an user.

Ok, so I'll try to make the PR in the next days, maybe this weekend. If I don't have time to fix my mistake about the distance calculation, I'll make PR with my current commit. (And I still have to change the daily RTC counter reset to make the auto reset trip memories above 24h works)


And about the boost feature, what is buggy ? I would like to see if I can fix it but I don't know what's wrong with it.
It seems from my testing that the enable/disable logic is inverted - that is all.

Set it to 'disabled' and I had a tunable boost function, it seemed to take account of values for duration and fade.
Set it to 'enabled' and it had no startup boost.

I tested this by starting from standstill on a very long, steady hill. This was on my singlespeed frame that I don't ride anymore (my TSDZ2 is now in my hardtail MTB with hub gears)

Agree with Hugh comments. And the boost works better "disabled", high current ramp (8-10amps) and specially with "assist w/o rotation" feature "enable". The problem is that this 3 features are in different menus and seems that there are no relation between them. Perhaps a heads up in the wiki description of the boost feature could cover this.
Wish I could find the time to fix this, my day job is as an embedded developer, but alas, no time outside of work. I barely have time for riding at the moment.

I digress... Glad you were able to reproduce my findings.
 
Ok so I noticed the same behaviour about boost feature. I thought there was something else too.
I had already check the code a few weeks ago and I had not notice any thing special.
I'll check again to see why enable / disable logic is inverted and figure out if I can fix it.

Thanks guys for you replies about this bug !
 
I would like to share this video, where I am controlling the TSDZ2 wireless board using my cycling GPS unit. As a test, I am changing assist level on the display and when value is zero it disable the motor voltage (45V from my power supply) and enable the motor voltage when assist level higher than zero:

[youtube]P9KJfSMeXSI[/youtube]

Soon I hope to have a first working version as the only new thing that is the wireless part, is done!

The board is very cheap, 25€, and simple for DIY, this is the current board and I hope to simplify even a bit more - see the project page:

image.png
 
Fantastic work Casainho... Can't wait for this to be a reality.
 
Hi Casainho,
would love to hear some talking in your video to describe what is going on.. I didn't quite understand it.

I assume you still need the controller and this can basically set different actions via your garmin?

What I would love to see and I think you may already do this is to log gps/heart rate, etc via your smart watch (which I can do now) but marry it up to data from the bike like cadence, assist level, human power and bike power. Then create an overlay video with Dashware http://www.dashware.net/how-it-works/ to add some data to my videos

In terms of where I think we can use ANT+ devices for ebikes I was thinking if we could get a signal from an external power meter such as those mounted to cranks or pedals then we could use that signal to drive any type of motor for instance some motor just rubbing on the back tyre or driving a sprocket on the other side of the back wheel attached under the disk brake. Only problem is that such power devices are still more expensive than just buying the tsdz2...

Anyway great work as always, keep it up !!
 
jbalat said:
Hi Casainho,
would love to hear some talking in your video to describe what is going on.. I didn't quite understand it.

I assume you still need the controller and this can basically set different actions via your garmin?

What I would love to see and I think you may already do this is to log gps/heart rate, etc via your smart watch (which I can do now) but marry it up to data from the bike like cadence, assist level, human power and bike power. Then create an overlay video with Dashware http://www.dashware.net/how-it-works/ to add some data to my videos

In terms of where I think we can use ANT+ devices for ebikes I was thinking if we could get a signal from an external power meter such as those mounted to cranks or pedals then we could use that signal to drive any type of motor for instance some motor just rubbing on the back tyre or driving a sprocket on the other side of the back wheel attached under the disk brake. Only problem is that such power devices are still more expensive than just buying the tsdz2...

Anyway great work as always, keep it up !!
On the video I was changing the assist level of the EBike on the GPS unit and controlling enabling/disabling the motor voltage to the TSDZ2 controller, meaning the system will enable/disable the motor just like now when when press the on/off button on the display.

The EBike works like just another ANT+ cycling sensor, where it outputs data like cadence, human power, battery voltage, motor temperature, etc. All this data goes to the GPS unit and then it will be recorded simultaneous with other data like GPS position, speed, heart rate, ambient temperature, data from any other cycling sensors you have. You can then use any software you already use - just the TSDZ2 data is sent to the GPS unit as also it can be controlled by the display unit, like changing the assist level.

Here a picture of me broadcasting my heart rate value from my watch to the GPS unit, that was recordind a cycling fitness activity and showing the heart rate graph. On the 860C display I see the TSDZ2 data and in future the 860C will not be needed anymore as I will see TSDZ2 data on the GPS unit as also control the assist level, light state, etc.

image.png


The wireless board works like a display for TSDZ2 and will be able to send and receive any data by ANT and simultaneous by Bluetooth, meaning we will be able to send and receive data from any sensor. The configurations will be done by a mobile app (using Bluetooth communication).

And here a feature I like a lot in the GPS that is automatically identification of hill and show it like this:

image.png

[/quote]
 
Thanks Casainho what you are doing is pretty cool. I like where this is going.

So thinking about best options for the near future, I have people asking me which firmware to use and which display to buy. Although I am still on the ktlcd3 (and am very happy besides no field weakening code).. right now I can only recommend the 860c, but is this really the best recommendation ?

Looking at the work you are doing lately would the best solution be to keep the standard display and implement Bluetooth to enable extra data on a Garmin or mobile phone ?
What is your recommendation for new users ?
 
Back
Top