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

jbalat said:
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 ?
I don't know because there is the need to develop yet the mobile app. Maybe we can have something.more stable in 2 months? 3 or 4 months??

Using the mobile app only will make a cheap and very clean installation.

860C firmware is stable, is a good bet for someone that like it and want a stable EBike.
 
I almost wish there is a simple analog indicator for assist levels and buttons the rest goes to mobile app or something. Sw102 is useless in bright sunshine especially with polarized sunglasses. I have to tilt my head 45 degrees while riding to try to figure out what's the current assist level.

Still waiting on esp32 board to arrive and maybe switch back to vlcd5. I really like unsuspicious looking of sw102 and the fact that it has bluetooth was promising but noone stepped up to create android app for it.
 
hefest said:
I almost wish there is a simple analog indicator for assist levels and buttons the rest goes to mobile app or something. Sw102 is useless in bright sunshine especially with polarized sunglasses. I have to tilt my head 45 degrees while riding to try to figure out what's the current assist level.

Still waiting on esp32 board to arrive and maybe switch back to vlcd5. I really like unsuspicious looking of sw102 and the fact that it has bluetooth was promising but noone stepped up to create android app for it.
Interesting that you change assist levels. I tend to ride everywhere on one level, I never change it.
 
HughF said:
hefest said:
I almost wish there is a simple analog indicator for assist levels and buttons the rest goes to mobile app or something. Sw102 is useless in bright sunshine especially with polarized sunglasses. I have to tilt my head 45 degrees while riding to try to figure out what's the current assist level.

Still waiting on esp32 board to arrive and maybe switch back to vlcd5. I really like unsuspicious looking of sw102 and the fact that it has bluetooth was promising but noone stepped up to create android app for it.
Interesting that you change assist levels. I tend to ride everywhere on one level, I never change it.

I guess that depends on the hills. It's mostly flat and than there are several 8% inclines. Unleass you are riding in top assist levels all the time.
 
hefest said:
I almost wish there is a simple analog indicator for assist levels and buttons the rest goes to mobile app or something. Sw102 is useless in bright sunshine especially with polarized sunglasses. I have to tilt my head 45 degrees while riding to try to figure out what's the current assist level.

Still waiting on esp32 board to arrive and maybe switch back to vlcd5. I really like unsuspicious looking of sw102 and the fact that it has bluetooth was promising but noone stepped up to create android app for it.

I just bought a polarized PCV film and sticked it at 45deg, not perfect but at least I can see how fast I go.

If someone will expose all the characteristics via BLE, I'm willing to write an Android app. Configuration via phone would be so much easier! And stats!
 
Hello everyone!

Flashed v1.0.0 on SW102 and controller a few days ago. :flame:

1. Found out that lights are not working for me :( UI shows 'LIGHT', but 0V from controller on lights line. Do You maybe know what might be wrong?

2. After full charging display showed 17% of charge. Right now it shows 0% and BMS shows 4/4. Wondering what happened? :shock:

Thanks in advance!
 
gatorsean said:
casainho said:
gatorsean said:
I would be happy to try and fix this and do a pull request, but I just ask for a little high level theory of how the throttle works in the code.

casainho, if you read, this, can you take a look at the problem or maybe leave a note here about how the throttle is intended to work in the code?
Looking at the code, I can´t understand why throttle does work as you guys are saying.

Please look at the code, mainly on:

Code:
  // throttle
  apply_throttle(&ui16_m_adc_target_current, ui8_assist_enable);

And put the questions here that you may have when trying to understand the code.

Hi Casainho!

I looked over this section like you advised. I can't see where this variable "ui16_target_current" is used? Can you tell me how the controller is using ui16_target_current and perhaps it is being confused with "ui16_m_adc_target_current?" It is much easier to see how ui16_m_adc_target_current is being used.

Perhaps someone else reading here is familiar with these two variables?
 
lasercat said:
Hello everyone!

Flashed v1.0.0 on SW102 and controller a few days ago. :flame:

1. Found out that lights are not working for me :( UI shows 'LIGHT', but 0V from controller on lights line. Do You maybe know what might be wrong?

2. After full charging display showed 17% of charge. Right now it shows 0% and BMS shows 4/4. Wondering what happened? :shock:

Thanks in advance!
You need to set the charge reset value (I forget the exact term for the setting) to the resting voltage of your battery pack, or a little below. That way, when your charger has filled your battery and shut itself off, the next time you turn the sw102 on, it will sense the battery voltage and reset the % display.
 
Hey All,
I am now using an 860C with version 1.0.0 on my handcycle. I had the LCD3 with a special firmware flash that mbrusa did for me that is dialed in and working great for handcycles. Many thanks to him for all his work, it is an awesome setup. We will be still using it for those that purchased a system from https://www.electrifybike.com/ with the LCD3 and don't want to upgrade to the 860C - 850C Displays.

I know it's possible to get this firmware for the 860C - 850C to work even better, it's just a matter of getting it all set up correctly.

I'm having trouble getting the 860C V1.0.0 dialed in, and I need some help with 5 different settings. I adjusted these a little bit one at a time and didn't notice a noticeable difference.
I want to make the torque sensor as sensitive as possible!

(1) Maximum Battery Current,
No matter how many times I turn it up past 16 amps and no matter what I've tried, once I turn off the system when it turns back on its back at 16 amps.
What do I need to do to keep it at a higher amp setting?

(2) Minimum current value (in ACD steps),
What does a higher number setting do compared to a lower number setting?
I want to make the torque sensor as sensitive as possible!

(3) Torque ACD threshold value,
What does a higher number setting do compared to a lower number setting?
I want to make the torque sensor as sensitive as possible!

(4) Coaster Brake ACD steps,
What does a higher number setting do compared to a lower number setting?
Does a higher or lower number make it easier to pull back?

(5) After I get this all figured out and working correctly, I need to set up a flash so that it will flash all these default settings that we need for handcycles.

Will someone do that for me if I give them the settings after I get them figured out?

Without this OSF Firmware, the TSDZ2 just doesn't work well for handcycles.
So I and all the other hand cyclist are very grateful for all the work that everyone's put into making this OSF Firmware, work on handcycles.

With the original firmware, if you hold back on the cranks and turn the system on and wait for it to boot while holding back the pressure, then it works. But if you pulled too hard with too much pressure as it boots then when you wanted to stop rotation it would jump a couple of times before stopping with the coaster brake motor. Or have too much run on with a standard motor. So what is happening when you do this is it's making the torque sensor more sensitive.

I gave it a try with this firmware and it did help make the bike go forward better, but I couldn't pull back on the cranks for the brakes without a lot of resistance.

In the LCD3 version that mbrusa did for me, the torque sensor sensitivity adjustment was called. (9) ADC Pedal torque offset adjustment, (0-35) (0) was the same as before when this was not available (5) is the default that works better for every rider. (10-15) was for most handcycles and (15-20) was what I use on my handcycle. With this setting available all I needed to do is put my cranks in the same place every time and it was consistent every time I boot the system, with no need to pull back as the system boots.
As I stated earlier it works awesome!

I know it's possible to get this firmware for the 860C - 850C to work even better, it's just a matter of getting it all set up correctly.

Thanks & Please Help,
Jeff
 
casainho said:
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.

Thanks, Casainho! I was able to get it to compile under Linux so I am all set.
 
jeff.page.rides said:
(5) After I get this all figured out and working correctly, I need to set up a flash so that it will flash all these default settings that we need for handcycles.

Will someone do that for me if I give them the settings after I get them figured out?

Without this OSF Firmware, the TSDZ2 just doesn't work well for handcycles.
So I and all the other hand cyclist are very grateful for all the work that everyone's put into making this OSF Firmware, work on handcycles.

Thanks & Please Help,
Jeff

Hi Jeff, I am happy to do that for you.

Casainho pointed me to where the defaults are located in the 860C code and I now have a Linux development environment set up so I can recompile the OSF firmware with different default settings. Just PM me the settings you want.
 
Rydon said:
jeff.page.rides said:
(5) After I get this all figured out and working correctly, I need to set up a flash so that it will flash all these default settings that we need for handcycles.

Will someone do that for me if I give them the settings after I get them figured out?

Without this OSF Firmware, the TSDZ2 just doesn't work well for handcycles.
So I and all the other hand cyclist are very grateful for all the work that everyone's put into making this OSF Firmware, work on handcycles.

Thanks & Please Help,
Jeff

Hi Jeff, I am happy to do that for you.

Casainho pointed me to where the defaults are located in the 860C code and I now have a Linux development environment set up so I can recompile the OSF firmware with different default settings. Just PM me the settings you want.

You told me you thought you could figure it out, it's good to see that you have!
I'm having trouble getting V1.0.0 working as good as we have the LCD3 working.
Now I just need help with the maximum battery current not saving and figuring out the 3 ADC settings. I'm hoping we can get V1.0.0 working even better than the LCD3.
 
Flashed and installed today Open source firmware and 860c display to my TSDZ2. It is WOW - Thank you very much for your great work. :D

I have mounted lights to my bike. Noted if I put lights on motor stops working. Tried to search here if there is fix to this but did not found. So can this issue be fixed by configuring settings somehow?
 
lasercat said:
hefest said:
I almost wish there is a simple analog indicator for assist levels and buttons the rest goes to mobile app or something. Sw102 is useless in bright sunshine especially with polarized sunglasses. I have to tilt my head 45 degrees while riding to try to figure out what's the current assist level.

Still waiting on esp32 board to arrive and maybe switch back to vlcd5. I really like unsuspicious looking of sw102 and the fact that it has bluetooth was promising but noone stepped up to create android app for it.

I just bought a polarized PCV film and sticked it at 45deg, not perfect but at least I can see how fast I go.

If someone will expose all the characteristics via BLE, I'm willing to write an Android app. Configuration via phone would be so much easier! And stats!

im working on the tsdz2 fully wireless android/ios app. i think it can be used for the sw102 too - the sw102 uses a board from the same manufacturer and uses the same SDK as the nrf52 we use on the fully wireless project. so if the dongle implements the profiles, they should be portable to the sw102.

the app will have a configuration interface which is defined by the device that needs configuration (the dongle or the sw102 will tell the app which config options are available and the app will just render them). The idea behind this is to be able to configure different firmware versions with the same app without the need to update the app for every new firmware. if the sw102 gets the same bluetooth configuration interface, the app will work with it, so there is no need to start a new app.

the plan is indeed to create ONE app for all open source ebike firmwares with bluetooth capabilities.

not #1 priority, but when the dongle supports the standard bluetooth profiles (cycling speed and cadence, battery, temperature, ...) i will also implement them in the app for a dashboard display like it is on the 860c. so if the sw102 also implements these profiles, it will also work with it.
 
raw said:
the app will have a configuration interface which is defined by the device that needs configuration (the dongle or the sw102 will tell the app which config options are available and the app will just render them). The idea behind this is to be able to configure different firmware versions with the same app without the need to update the app for every new firmware. if the sw102 gets the same bluetooth configuration interface, the app will work with it, so there is no need to start a new app.
This seems to be powerful - you must do it and I will need it very soon, this week or on the next. I am implementing the firmware for the wireless board and I started to put the firmware on the same project was SW102 and 860C displays - I call to the wireless firmware as "wireless_virtual_display_NRF52840" - and virtual because I hope to develop a real wireless display with the same board NRF52840.

As soon as we have the mobile app working for the wireless virtual display, then porting to SW102 should be quick. And on SW102, the Bluetooth already works on current firmware, it is just missing the mobile app and interface with it.

I also would like to prepare the configurations and document the process to flash and debug the firmware, for developers, so more people can help find the issues and solve. I would like to document the flash and debug using Visual Code Studio for:
- STM8 on the TSDZ2 motor controller
- STM32 on the 860C display
- NRF51822 on the SW102

- NRF52840 on the wireless virtual display is already done here:

Screenshot-from-2020-07-10-16-47-10.png
 
casainho said:
I also would like to prepare the configurations and document the process to flash and debug the firmware, for developers, so more people can help find the issues and solve. I would like to document the flash and debug using Visual Code Studio for:
- STM8 on the TSDZ2 motor controller
- STM32 on the 860C display
- NRF51822 on the SW102
I develop with VS-Code now and would appreciate the configuration and documentation when it comes. Although short on time, I would like to try and find/make the time to contribute back to this project.
 
HughF said:
casainho said:
I also would like to prepare the configurations and document the process to flash and debug the firmware, for developers, so more people can help find the issues and solve. I would like to document the flash and debug using Visual Code Studio for:
- STM8 on the TSDZ2 motor controller
- STM32 on the 860C display
- NRF51822 on the SW102
I develop with VS-Code now and would appreciate the configuration and documentation when it comes. Although short on time, I would like to try and find/make the time to contribute back to this project.
You can try look at the NRF52840 configuration and adapt to others.
 
Veko said:
I encountered error message "Error Brakes" on the first boot. I searched the forums and found casainho's post earlier this year indicating it might also be related to TX error as well as to brakes. This leads me to think that my harness wiring might be wrong, but looking at it, I can't really find error on my end. My TSDZ2 has a 8 pin male connector, so I wired 1T4 bafang 8 pin cable to a female 8 pin connector according to a post I found on another thread. I checked Bafang wiring diagram and the wiki wiring diagram and couldn't find errors in the wiring shown below in the image. Any idea what might be the problem?

EC5zbo2.jpg

NMk675h.jpg


The display and motor firmware updates were successfull on the first round. I tried to flash both again for the second time, but same error persists.

During the display flashing process, at first it didn't work when CP2102 was wired according to the picture as shown in wiki (TX to RX, RX to TX), so I reversed it and the update process worked after that. Could it be that TX and RX wires are somehow reversed in my 860C cable?

Thanks for this very useful post on the wiring for the 8-pin TSDZ2 with 860C and the 1T4 cable with a male end. I think I have exactly the same setup as you. I have been struggling finding consistent info. There seem to various different cables and versions out there.

I have the throttle version of TSDZ2 with 8-pin male connector. bought the 1T4 bafang cable which has a male 8 pin one end. The 4 ends have a green 5 pin lead and 3 yellow 3 pin leads (one male, two female). I separately bought a higo 8 pin extension lead (so one end female, the other male) with the intention of cutting off the female end and wiring it to the 1T4. I like you am worried about blowing something up if the connections are wrong! But I came to the exact same wiring mapping as you. I also found that when I wired the 860c programming cable with the USB device that I had to reverse TX and RX.

My question is whether you ended up reversing TX/RX in the main 8 pin cable (so different from the diagram you posted)? That would mean HIGO Yellow to 1T4 Yellow (RX), and HIGO Brown to 1T4 Green (TX). Also I am assuming the pin layout for the higo given in the wiki for 8 pin here is the correct pin order to match to the motor 8-pin male: https://github.com/OpenSource-EBike-firmware/TSDZ2_wiki/wiki/Wire-860C-850C-to-TSDZ2

Any help much appreciated!
 
How is this the light issue - when lights on stops pedaling motor stops assisting untill you switch lights off ? Is it better to buy DC-DC converter or is it any fix to try?
 
jtsavola said:
How is this the light issue - when lights on stops pedaling motor stops assisting untill you switch lights off ? Is it better to buy DC-DC converter or is it any fix to try?

...and I tried this option "ADC lights" with all values but did not help...
 
These guys in Barcelona are developing a similar system with SW102 and/or app. Different approach that Swytch

https://www.nordicsemi.com/News/2020/07/Unlimiteds-eBike-Kit-employs-nRF52832-SoC
https://www.indiegogo.com/projects/the-unlimited-ebike-conversion-kit#/
 
Hey All,
I am now using an 860C with version 1.0.0 on my handcycle.

I'm having trouble getting the 860C V1.0.0 dialed in, and I need some help with 4 different settings. I adjusted these a little bit one at a time and didn't notice a noticeable difference.
I want to make the torque sensor as sensitive as possible!

(1) Maximum Battery Current,
No matter how many times I turn it up past 16 amps and no matter what I've tried, once I turn off the system when it turns back on its back at 16 amps.
What do I need to do to keep it at a higher amp setting?

(2) Minimum current value (in ACD steps),
What does a higher number setting do compared to a lower number setting?
I want to make the torque sensor as sensitive as possible!

(3) Torque ACD threshold value,
What does a higher number setting do compared to a lower number setting?
I want to make the torque sensor as sensitive as possible!

(4) Coaster Brake ACD steps,
What does a higher number setting do compared to a lower number setting?
Does a higher or lower number make it easier to pull back?
 
Hi guys,

I have two small issues with the 1.0 firmware. Not sure if it is 1.0 related as this is the first firmware I've tried (I just got the motor).

Issue 1: Speed always reads zero

I have confirmed it is not a hardware issue. I've tried two different speed sensors, and have adjusted the position of the magnets multiple times, including getting them so close they're almost touching.

Is there something I need to do in the config menu to "enable" speed sensing? Or is this a defective motor? I've played with every setting I can think of.

Issue 2: Exceeding max battery amperage

Yesterday I enabled field weakening to try it out. My battery is a 10s2p rated for 20A continuous discharge, so I have limited the battery current to 20A in the settings. I set up the graph to show battery amperage over time, and saw spikes as high as 26A!

Does the battery amperage limit get overridden during field weakening? Is this intentional or a bug?
 
casainho 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.
Ok, good idea.

About boost feature, I lost the track of what is wrong.
I just did the pull request. I hope I did not made mistake in the code, it's the first time I work on that kind of project.
I did not fix the trip distance calculation, no time to test the fix I did. But I did not encounter any issue since the last 2 weeks where I use my bike every day of the week. (tested only on 860C display)
 
jeff.page.rides said:
Hey All,
I am now using an 860C with version 1.0.0 on my handcycle.

I'm having trouble getting the 860C V1.0.0 dialed in, and I need some help with 4 different settings. I adjusted these a little bit one at a time and didn't notice a noticeable difference.
I want to make the torque sensor as sensitive as possible!

(1) Maximum Battery Current,
No matter how many times I turn it up past 16 amps and no matter what I've tried, once I turn off the system when it turns back on its back at 16 amps.
What do I need to do to keep it at a higher amp setting?

(2) Minimum current value (in ACD steps),
What does a higher number setting do compared to a lower number setting?
I want to make the torque sensor as sensitive as possible!

(3) Torque ACD threshold value,
What does a higher number setting do compared to a lower number setting?
I want to make the torque sensor as sensitive as possible!

(4) Coaster Brake ACD steps,
What does a higher number setting do compared to a lower number setting?
Does a higher or lower number make it easier to pull back?
You should set up as follows:

Motor current calculation: torque mode
Current ramp: 10a
Assist w/o pedal: enabled
Startup boost: disabled
Startup boost fade: default
Startup boost duration : default

And calibrate the torque sensor, this is super important.

With those settings you should have power from the moment you apply pressure to the pedals/hand cranks, and the assistance will start irrespective of whether you are below the cadence sensor sensing threshold. This is really important to help people get moving and assistance from a start and with a low cadence.
 
Back
Top