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

Benoit said:
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)
You found and fixed the bug in the boost logic?
 
HughF said:
You found and fixed the bug in the boost logic?

I read the code but I don't understand what could be wrong for now. I don't have enough time currently, maybe next two weeks I'll can investigate more as I'll be in holiday (but without testing as I won't have my bike with me).
 
Benoit said:
HughF said:
You found and fixed the bug in the boost logic?

I read the code but I don't understand what could be wrong for now. I don't have enough time currently, maybe next two weeks I'll can investigate more as I'll be in holiday (but without testing as I won't have my bike with me).

From ebike_app.c file
is the first line correct?

m_config_vars.ui8_startup_motor_power_boost_feature_enabled = ui8_rx_buffer[8] & 1;

Code:
      m_config_vars.ui8_startup_motor_power_boost_feature_enabled = ui8_rx_buffer[8] & 1;
      m_config_vars.ui8_startup_motor_power_boost_always = (ui8_rx_buffer[8] & 2) >> 1;
      m_config_vars.ui8_startup_motor_power_boost_limit_to_max_power = (ui8_rx_buffer[8] & 4) >> 2;
      m_config_vars.ui8_torque_sensor_calibration_feature_enabled = (ui8_rx_buffer[8] & 8) >> 3;
      m_config_vars.ui8_torque_sensor_calibration_pedal_ground = (ui8_rx_buffer[8] & 16) >> 4;
      m_config_vars.ui8_motor_assistance_startup_without_pedal_rotation = (ui8_rx_buffer[8] & 32) >> 5;
      m_config_vars.ui8_motor_type = (ui8_rx_buffer[8] >> 6) & 1;
 
So I finally updated from v0.4.0 to v1 and WOW what a difference! Huge improvements in performance and functionality. And thank you so much for breaking the configuration menu down into sub-categories! It was always a huge pain scrolling through that entire menu. @casainho contribution made!

A couple issues I found:

  • My throttle trigger doesn't work at all now even though I have it enabled in the configuration.

  • I notice a slight delay (like 2-3 seconds) for the motor to kick in after I start pedaling. It didn't behave this way with 0.4.0. Is this by design? Do I just need to calibrate the torque sensor?
 
CatfishMan said:
So I finally updated from v0.4.0 to v1 and WOW what a difference! Huge improvements in performance and functionality. And thank you so much for breaking the configuration menu down into sub-categories! It was always a huge pain scrolling through that entire menu. @casainho contribution made!

A couple issues I found:

  • My throttle trigger doesn't work at all now even though I have it enabled in the configuration.

  • I notice a slight delay (like 2-3 seconds) for the motor to kick in after I start pedaling. It didn't behave this way with 0.4.0. Is this by design? Do I just need to calibrate the torque sensor?
Set up with my configuration settings I posted a few pages back. That will give you the best performance and response. Some say it's nearly as good as a brose 👍

Although I can't help with the throttle issue, I'm pas only
 
HughF said:
James Broadhurst said:
HughF said:
I also think the problems came from the anti-rotation plate/system. By default it comes supplied with an m8 socket button for fixing the clamp plate down. Socket buttons are total junk for getting any sort of decent torque on, without them rounding out. I've changed this now for a high tensile socket cap and I think I've done a better job of tightening the anti-rotation system up.
Same here. When I first read your original post I thought that it was about time I did what I’ve been threatening to for some time - buy a Bafang side bracket as Wayne describes it so I did. I think it will hold better than Wayne’s pot marks but otherwise his instructions are very, very good. I might be lucky and get one of the M5 bolts to hold .....!

Agreed, the M8 are very difficult; the seat tube obstructs you getting a clear shot at tightening it and I’ve shortened a few Allen keys to fit it in but it’s a little hit and miss.

Yes, seat tube access certainly makes tightening this fastener difficult.

I went with an M8 13mm standard hex head bolt from a hardware store and it works great. It's easy to tighten it up with an open-ended 13mm wrench.
 
Nfer said:
From ebike_app.c file
is the first line correct?
m_config_vars.ui8_startup_motor_power_boost_feature_enabled = ui8_rx_buffer[8] & 1;

Code:
      m_config_vars.ui8_startup_motor_power_boost_feature_enabled = ui8_rx_buffer[8] & 1;
      m_config_vars.ui8_startup_motor_power_boost_always = (ui8_rx_buffer[8] & 2) >> 1;
      m_config_vars.ui8_startup_motor_power_boost_limit_to_max_power = (ui8_rx_buffer[8] & 4) >> 2;
      m_config_vars.ui8_torque_sensor_calibration_feature_enabled = (ui8_rx_buffer[8] & 8) >> 3;
      m_config_vars.ui8_torque_sensor_calibration_pedal_ground = (ui8_rx_buffer[8] & 16) >> 4;
      m_config_vars.ui8_motor_assistance_startup_without_pedal_rotation = (ui8_rx_buffer[8] & 32) >> 5;
      m_config_vars.ui8_motor_type = (ui8_rx_buffer[8] >> 6) & 1;
This is the code on the display side:

On the configurations menu, value 0 for disable and 1 for enable:
Code:
FIELD_EDITABLE_ENUM("Feature", &ui_vars.ui8_startup_motor_power_boost_feature_enabled, "disable", "enable"),

On the UART tx, first bit:
Code:
      ui8_usart1_tx_buffer[8] = rt_vars.ui8_startup_motor_power_boost_feature_enabled |
          (rt_vars.ui8_startup_motor_power_boost_always << 1) |
          (rt_vars.ui8_startup_motor_power_boost_limit_power << 2) |
          (rt_vars.ui8_torque_sensor_calibration_feature_enabled << 3) |
          (rt_vars.ui8_torque_sensor_calibration_pedal_ground << 4) |
          (rt_vars.ui8_motor_assistance_startup_without_pedal_rotation << 5) |
          ((rt_vars.ui8_motor_type & 1) << 6);

So yes, I think it is correct. Thanks for looking at it.
 
Nfer said:
does the boost problem affects all the screens or just SW102?
I have SW102
I just can tell that the firmware on the display side, for boost and other configurations, as also UART communications, is common to both displays.
 
jeff.page.rides said:
HughF said:
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.

Hugh thanks for the reply,
I'm not doing this just for myself I'm trying to get all the default setup for anyone that has a handcycle. Most of us don't have the time or the ability to calibrate the torque sensor without recruiting someone else to do it for us. So I need to get all the settings working the best they can without the torque sensor calibration and then if they want to get it calibrated they can go from there.

I need these questions answered by you, Casaino, or anyone!

(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?
 
https://github.com/OpenSource-EBike-firmware/TSDZ2-Smart-EBike/blob/master/src/motor.c#L482

Is this why battery max current isn't being respected during field weakening?
 
jeff.page.rides said:
Hugh thanks for the reply,
I'm not doing this just for myself I'm trying to get all the default setup for anyone that has a handcycle. Most of us don't have the time or the ability to calibrate the torque sensor without recruiting someone else to do it for us. So I need to get all the settings working the best they can without the torque sensor calibration and then if they want to get it calibrated they can go from there.

I need these questions answered by you, Casaino, or anyone!

(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 Jeff, with regard to the torque sensor calibration, what I have found to work well for me is not performing complete calibration, but merely setting the max ADC values and weights for your actual weight. I weighed myself on the scales, I'm about 75kg's so I set the maximum weight for left and right hand pedal to that weight. I then stand on each pedal and make a note of the ADC value - then put that in for the maximum weight adc value field.

By default I think the maximum weight value is 110kg's for left and right, if you don't weigh that much, or cannot push/pull that much on the hand cranks then you'll never see maximum performance from the motor.

I am running 1.0.0.alpha, not the latest 1.0.0.beta code, this does NOT reset the max battery current on power down, it stays at 20a. I'm afraid I cannot answer you about points 2,3,4 because I don't know what they do either. I know that I have not adjusted them from default and I am very impressed with the performance of this motor now.

I think with Casainho now working full time at the university and his free time being spent on the TSDZ2 ANT+ wireless project, it will be up to us users to work out these final bugs on 1.0.0.beta
 
Battery max current default to 16A: a developer found the issue and did a pull request.

Higher max current on Field Wakening: I solved this issue.

All this changes are on the main branch and will be included on a next release.
 
Sorry didn't see this thread as I had orginally posted this in the tsdz2 thread. I have looked through the instructions and it doesn't seem to mention this error(picture attached) as anyone had this it know of a fix
 

Attachments

  • Screenshot_20200718-164541.jpg
    Screenshot_20200718-164541.jpg
    43.2 KB · Views: 1,553
casainho said:
Battery max current default to 16A: a developer found the issue and did a pull request.

Higher max current on Field Wakening: I solved this issue.

All this changes are on the main branch and will be included on a next release.

Hi Casaino,
It's always good to see fixes for the bugs that are there!
Will you please answer the questions below?
It will really help me out knowing what these settings do and which direction to go.
Thanks,
Jeff

(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?
Looks like you fixed this above?

(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?
 
jeff.page.rides said:
casainho said:
Battery max current default to 16A: a developer found the issue and did a pull request.

Higher max current on Field Wakening: I solved this issue.

All this changes are on the main branch and will be included on a next release.

Hi Casaino,
It's always good to see fixes for the bugs that are there!
Will you please answer the questions below?
It will really help me out knowing what these settings do and which direction to go.
Thanks,
Jeff

(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?
Looks like you fixed this above?

(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?

Jeff, regarding your reposted laundry list above. Casainho answered your (1) by telling you that the max battery current bug is being fixed by another developer and will be in a future release.

If I understand correctly, Hughf answered your number (2) question by showing you that torque sensitivity is impacted much more by max weight and corresponding ADC value than the min weight and ADC value that you asked about.

I would guess that (3) Torque ADC threshold is the amount of torque applied to the pedal before the motor starts when in torque only mode (instead of power mode)

As for (4) Coaster Brake ADC steps. This is a bit of a mystery to me. We found that setting it as high as 80 reduced the forward jerk when you go to apply the coaster brake. I assume that is what you mean by "easier to pull back". Casainho does not have a coaster brake motor and very few other people on this forum do, so it may be up to us that do to figure that out. It would be nice if a developer could help with that as in my testing power does not cut quick enough when you apply the coaster brake. Setting that value very high does help though.
 
M4ttgreen said:
Sorry didn't see this thread as I had orginally posted this in the tsdz2 thread. I have looked through the instructions and it doesn't seem to mention this error(picture attached) as anyone had this it know of a fix
Wait, is that a screenshot, of a photo, of a screen? #recursiveexplode
 
HughF said:
M4ttgreen said:
Sorry didn't see this thread as I had orginally posted this in the tsdz2 thread. I have looked through the instructions and it doesn't seem to mention this error(picture attached) as anyone had this it know of a fix
Wait, is that a screenshot, of a photo, of a screen? #recursiveexplode

It seems to be of this fancy modern technology though, as no image is printed in the process!
 
jeff.page.rides said:
(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!

From the 0.20.0 configuration:

(0) Disabled
(X) Enabled with torque sensitivity X %

If you wish to enable startup assist without pedal rotation it is done by appropriately configuring this variable. If set to (0), startup assist without pedal rotation will be disabled. But any value above (0) will enable assist without pedal rotation. The percentage value will determine the sensitivity of torque applied. 100 % sensitivity will assist from the slightest of torque applied. It is advised to use e-brakes if startup assist without pedal rotation is enabled.

When configuring it is good to incrementally increase the sensitivity until you are satisfied. Do not start with too high values. The sensitivity is different for each and every bike and should be configured after personal preference with the main riding mode you intend to use.

Recommended values range between 10-15 %.
 
Has anyone experienced issues with the SW-102 display when setting the number of assist levels?

If I reet to defaults it has 20 levels and they are all available to select when riding but then if I set it to have 10 levels I only get 6 available to use, i cannot select 7?

Interestingly if I switch it back to 20 I then only get 12?
 
Hello

Eco-bikes have a great step-by-step on programming the 850C: https://www.eco-ebike.com/blogs/eco-cycles-instructionals/850c-tsdz2-open-source-firmware-bootloader-update-tutorial

My question is... can I use the same tutorial to program the 860C? Are there any differences I need to be aware of?
 
Davo said:
Hello

Eco-bikes have a great step-by-step on programming the 850C: https://www.eco-ebike.com/blogs/eco-cycles-instructionals/850c-tsdz2-open-source-firmware-bootloader-update-tutorial

My question is... can I use the same tutorial to program the 860C? Are there any differences I need to be aware of?

Your found instructions also work with the 860C. Flashed successfully with this guide!
Below is the link to the wiki: This will also refer to the page you found: https://github.com/OpenSource-EBike-firmware/TSDZ2_wiki/wiki/Flash-the-firmware-on-860C-850C-using-bootloader
 
mallesepp said:
Davo said:
Hello

Eco-bikes have a great step-by-step on programming the 850C: https://www.eco-ebike.com/blogs/eco-cycles-instructionals/850c-tsdz2-open-source-firmware-bootloader-update-tutorial

My question is... can I use the same tutorial to program the 860C? Are there any differences I need to be aware of?

Your found instructions also work with the 860C. Flashed successfully with this guide!
Below is the link to the wiki: This will also refer to the page you found: https://github.com/OpenSource-EBike-firmware/TSDZ2_wiki/wiki/Flash-the-firmware-on-860C-850C-using-bootloader
Brill! Many thanks mallesepp

I also noted the Eco-Bikes have lots of different cables (1T1, 1T2, etc https://www.eco-ebike.com/search?q=1T1). Would I need one of these cables to programme the 860C or the TSDZ2? If not, what are these cables for?
 
Davo said:
I also noted the Eco-Bikes have lots of different cables (1T1, 1T2, etc https://www.eco-ebike.com/search?q=1T1). Would I need one of these cables to programme the 860C or the TSDZ2? If not, what are these cables for?

1T1 is if you only have a display. 1T2 adds throttle. 1T3 and 1T4 add one or two brake cutoff sensors. Alternately, you can do what most do, just cut the ones you don't use off of a 1T4 or ziptie them out of the way.
 
Back
Top