TSDZ2 EBike wireless standard (like Specialized Turbo Levo) - OpenSource

Hi

I didn’t mean my idea with the raspberry pi to be a part of the standard you guys are developing, but merely an idea that me myself could experiment on as a separate project, once the development of your wireless project goes ahead and I can source the parts to try it out myself.

Currently it looks like it getting closer to something that would be easy to follow and setup ourselves, but sitting a little bit on the fence to see how it all develops and mature a bit more:)
 
casainho said:
@rananna, today I tried to build the TSDZ2 wireless firmware from master but I got an error about the bootloader building... and since I had short time, I was not able to build it and so I did not test the firmware. Can you please test to see if it builds ok for you?
I just tried to do a pull request on the main repo in case my version was out of date, and it was completely up to date.

I just did a build on TSDz2 wireless which builds all three firmware, and there were no issues - all three built fine.
I also built from the bootloader repo without issues.
The last update to the booloader was the addition of a schematic on jan23
What issue are you seeing?
 
@rananna, I did commit to master the wireless remote 3D files for 3D printing - this is a early version that I 3D printed but did not install with the final wires.

Get the files and read the README here: https://github.com/OpenSourceEBike/TSDZ2_wireless/tree/master/EBike_wireless_remote/3d_design

You can view in 3D the STL files for 3D printing, directly on the browser, here: https://github.com/OpenSourceEBike/TSDZ2_wireless/blob/master/EBike_wireless_remote/3d_design/keypad.stl

 
casainho said:
@rananna, I did commit to master the wireless remote 3D files for 3D printing - this is a early version that I 3D printed but did not install with the final wires.

Get the files and read the README here: https://github.com/OpenSourceEBike/TSDZ2_wireless/tree/master/EBike_wireless_remote/3d_design

You can view in 3D the STL files for 3D printing, directly on the browser, here: https://github.com/OpenSourceEBike/TSDZ2_wireless/blob/master/EBike_wireless_remote/3d_design/keypad.stl

Looks really good!
I didn't realize that browsers natively support stl format. That makes for an interesting display.

You have certainly learned a lot about Freecad in a very short time!
I just downloaded the dev version.
I am a lot slower than you, it will take me some time to understand how to use such a complex software :)
 
rananna said:
You have certainly learned a lot about Freecad in a very short time!
I just downloaded the dev version.
I am a lot slower than you, it will take me some time to understand how to use such a complex software :)
No, I already learned basics of FreeCAD and used it to 3D Print, 8 years ago!! But I had to learn even more recently because it is needed to design this parts we need. 3D printing is nothing new to me, I did some collaboration on RepRap 12 years ago: https://reprap.org/wiki/RepRap and I had my own startup for developing and selling 3D printers.

You do not need to learn it unless you want to change or do any design. For printing the wireless remote, you just need a 3D Printer and that 2 STL files I put on our repo.
 
casainho said:
rananna said:
You have certainly learned a lot about Freecad in a very short time!
I just downloaded the dev version.
I am a lot slower than you, it will take me some time to understand how to use such a complex software :)
No, I already learned basics of FreeCAD and used it to 3D Print, 8 years ago!! But I had to learn even more recently because it is needed to design this parts we need. 3D printing is nothing new to me, I did some collaboration on RepRap 12 years ago: https://reprap.org/wiki/RepRap and I had my own startup for developing and selling 3D printers.

You do not need to learn it unless you want to change or do any design. For printing the wireless remote, you just need a 3D Printer and that 2 STL files I put on our repo.
I know that I don't need to learn it, but I just ordered a prusa 3d printer, and want to learn how to create 3d models.
So, I start on the journey to learn freecad.
Btw, for slicing software, I looked at simply3d, cura, slic3r and prusaslicer.
Simply3d offers nothing that the others don't have and it's $150!
Prusaslicer (an improved fork of slic3r) is quite nice, opensource and continuously updated.
Cura has the same advantages, but I have to say that the ui is better for me on prusaslicer, so I decided to use it.

Do you see any significant downsides to prusaslicer?
 
rananna said:
I know that I don't need to learn it, but I just ordered a prusa 3d printer, and want to learn how to create 3d models.
So, I start on the journey to learn freecad.
Btw, for slicing software, I looked at simply3d, cura, slic3r and prusaslicer.
Simply3d offers nothing that the others don't have and it's $150!
Prusaslicer (an improved fork of slic3r) is quite nice, opensource and continuously updated.
Cura has the same advantages, but I have to say that the ui is better for me on prusaslicer, so I decided to use it.

Do you see any significant downsides to prusaslicer?
I do not use much time around 3D printing. Currently I just bought a very popular and cheap 3D Printer from China (that is also cheap with shipping inside EU) https://www.creality.com/ (probably the TSDZ2/Bafang equivalent for EBike motors) and I use the Cura because it supports out of box my printer and I know Cura is OpenSource and probably one of the bests!! I also remember Slic3r and I talked personally one time with is founder. I did not tweak my printer or the Cura, I just use them with the standard settings. My time is almost all around TSDZ2 Ebike.
 
casainho said:
No, I already learned basics of FreeCAD and used it to 3D Print, 8 years ago!! But I had to learn even more recently because it is needed to design this parts we need. 3D printing is nothing new to me, I did some collaboration on RepRap 12 years ago: https://reprap.org/wiki/RepRap and I had my own startup for developing and selling 3D printers..
I am using the links suggested here to learn Freecad.
https://howtolearn.me/getting-started-with-freecad/
Do you have any other suggestions?
 
rananna said:
casainho said:
@rananna, today I tried to build the TSDZ2 wireless firmware from master but I got an error about the bootloader building... and since I had short time, I was not able to build it and so I did not test the firmware. Can you please test to see if it builds ok for you?
I just tried to do a pull request on the main repo in case my version was out of date, and it was completely up to date.

I just did a build on TSDz2 wireless which builds all three firmware, and there were no issues - all three built fine.
I also built from the bootloader repo without issues.
The last update to the booloader was the addition of a schematic on jan23
What issue are you seeing?
Did you fix your build issue?
 
rananna said:
casainho said:
No, I already learned basics of FreeCAD and used it to 3D Print, 8 years ago!! But I had to learn even more recently because it is needed to design this parts we need. 3D printing is nothing new to me, I did some collaboration on RepRap 12 years ago: https://reprap.org/wiki/RepRap and I had my own startup for developing and selling 3D printers..
I am using the links suggested here to learn Freecad.
https://howtolearn.me/getting-started-with-freecad/
Do you have any other suggestions?
I just use the tutorials on youtube, mainly the most recent updated as on last years the quality of tutorials did increase a lot - people now use very good technology and techniques to produce the video tutorials, like good image quality, good audio, etc!!

And about the firmware, I will just be able to test it in 6h.
 
Filippods said:
rananna said:
Filippods said:
rananna said:
ok, that's where we got to yesterday. let's wait for the new release before going further.
as a last test, you could power down and then power up again and see if anything shows up in the BT list.

I've completed the linux procedure, now all works fine, i can connect to TSDZ2.

Now i'm switching this nrf52 with the one soldered to ebike, in this way i can do other tests on windows OS if you need it.
Well isn't that good news!
It seems that there is still something wrong the the mass_erase function of openocd for windows.
We will have to investigate, but in the meantime you got there!

I've soldered the working nrf to the ebike and desoldered the naive one, tomorrow im going to test it.
Thank you.
The issue is that the soft device we are programming with the bootloader does not properly get installed if the openocd mass erase command fails.
This softdevice implements blue tooth and ant protocols.
Since you were using @beemac's openocd script that includes mass erase, it is curious why you were still seeing problems with windows.

I read on other forums that this failure can happen if you are using outdated stlink firmware.
Can you please update your firmware on the stlink and try again?
You can find update files and utility here:
https://www.st.com/en/development-tools/stsw-link007.html#
 
Frzoen said:
beemac said:
Frzoen said:
Yes, connectors are optional but the holes will stay 8)
If the TSDZ2_VIN is just signal pin then there is no need to use BTS4140N as power switch with current limiting. I would use something like SSM6K361NU from Toshiba with additional PTC fuse for safety. They can be directly controlled with STM32 so i suppose that NRF will handle them too (I will dig into datasheet of NRF).

What amperage You're interested in? :D I can manage to fit in there 1A or 2.5A dc-dc converter without huge bump in price (maybe even lowering it?). But for higher amperage i will have to do test board for myself. I've done few designs with dc-dc converter that I've used in here, so I'm confident about it.

For the leakage voltage I'm pretty sure that this is caused by not having pullup resistor on BTS4140N gate and also not limitng the zero gate current from BSP89. Problem should be solved by adding two resistors like this:

Mind that in this example I've reused the BTS4140N symbol for the BSP89 :oops:
And also that this circuit by adding pullup resistor to the gate of the BTS4140N will default into ON state.
I'll check datasheets deeper tomorrow :)

Morning! Ok great, thinking more unless anyone else shouts and wants greater amperage in the regulator probably makes sense to leave it small - as larger means less efficient unless the current is actually being used - and more heat!

Interesting information on the mosfet circuit thanks for your thoughts - Do you think the leakage voltage is going to cause a problem? The basic circuit works and switches the motor on/off ok. I think there will only be appetite to make any changes if we're solving a problem that definitely needs to be solved - anyone else have any thoughts?

Hi after delay :D

So basically I've came up with this. Minimal setup that from my calculations should work.
There are no parts on the back of the board :D
Power supply is only 100mA but for NRF-dongle and control of one mosfet it should be plenty.
There is hole to tie the cables to the board if You're not a connector type of a guy.

@beemac tell me if it seems to be ok for You. Then I will finish routing and put it into prototype production.



Hi, thanks - looks good from my point of view. I believe most of the button assemblies supplied with the displays have just 5 wires - using a shared gnd so you don't need so many gnd holes for the buttons - unless you plan to use individual buttons? Up to you if you want to keep a separate gnd for each as it will still work either way. Thanks for adding the wire holes and holes to secure the cables!

Is this using the published schematic for the circuit or have you made modifications?
 
My 3D printer came in last week. I'm learning Cura, Octoprint, free cad also. Some very good youtube tutorials 7 months old, helps a lot. Also HOVER over the mouse at bottom of screen in free cad and see what controls what.

I'm at the point of trying to calibrate the printer as it is off too much for precise prints, like, printed a esp32-cam stand and box which was slightly too small.

On the previous flashing problem, I was 4 pages behind, but wished I could have mentioned he has a BLUE dongle, mine is GREEN, but reckon it didn't matter in the end.
 
Tiger_one said:
My 3D printer came in last week. I'm learning Cura, Octoprint, free cad also. Some very good youtube tutorials 7 months old, helps a lot. Also click on the mouse at bottom of screen in free cad and see what controls what.

I'm at the point of trying to calibrate the printer as it is off too much for precise prints, like, printed a esp32-cam stand and box which was slightly too small.

On the previous flashing problem, I was 4 pages behind, but wished I could have mentioned he has a BLUE dongle, mine is GREEN, but reckon it didn't matter in the end.
Sorry, what is the green dongle?
I thought the nordic dongles came in only one color :)
Edit:
I just realized you are probably referring to the maker diary dongle.
Although this dongle will control the motor and function as a wireless remote, the gpio pinout is different and the latest firmware implements signalling that relies on the nordic rgb led. The 3d design is only for the nordic dongle also as the dimensions are different.
 
rananna said:
Sorry, what is the green dongle?
I thought the nordic dongles came in only one color :)
Edit:
I just realized you are probably referring to the maker diary dongle.
Although this dongle will control the motor and function as a wireless remote, the gpio pinout is different and the latest firmware implements signalling that relies on the nordic rgb led. The 3d design is only for the nordic dongle also as the dimensions are different.

Sorry, my bad, memory is going at 75, damn it. Mine is blue.
 
@rananna, I was able to build, everything is ok, that was a problem of my side because I changed computer and I was missing some tools.

My feedback:
1. walk assist works as expected and is nice that green LED flashing while it is active

2. at motor startup, if I look at the mobile app, seems that the remote is taking more time to stop LEDs, so, effectively extending the motor turn on time that is already to long!! Why not stop the LEDs as soon motor is on?
Here you blink red and green at the same time. Did you tested to alternate blink? like when one if on the other is off? I would expect more visual impact and I think that motor startup needs critical attention from the user, otherwise the torque sensor calibration will fail can make the ebike run without pedaling, so it is dangerous.

3. when decreasing the assist level, the red LED is enable while only should be the green (and no, there is no color mixing on the LEDs, I see spots for each color)

4. see battery state while clicking on on/off button is nice. I do not like to be forced to see battery state every time I turn off the motor, and even it seems to increase the motor turn off time

5. the brake LED signal is now a blinking red. Blinking and red should be used for future alerts / fatal errors because it caches even more our attention compared to solid red only. I think the brakes should be a solid red and maybe with max duration of 5 seconds, so if I keep brakes pressed for 2 minutes at a red light stop, only 5 seconds of power will be used from the battery

6. I like the amount of brightness for the LEDs, I tested during day and seems good.
 
casainho said:
@rananna, I was able to build, everything is ok, that was a problem of my side because I changed computer and I was missing some tools.
Did you actually go for a ride, or was this bench testing?
casainho said:
1. walk assist works as expected and is nice that green LED flashing while it is active
OK, that one is ready to go!
casainho said:
2. at motor startup, if I look at the mobile app, seems that the remote is taking more time to stop LEDs, so, effectively extending the motor turn on time that is already to long!! Why not stop the LEDs as soon motor is on?
Well, actually, that is not the case. Both @beemac's code, my code and the Android code are recognizing the turn on time at the same time.
What maybe is giving the sense that it is taking longer is we are using a short green, short green, long green sequence to indicate motor on. I have changed this to a double green flash. It now lines up well with the android app in time.
casainho said:
Here you blink red and green at the same time. Did you tested to alternate blink? like when one if on the other is off? I would expect more visual impact and I think that motor startup needs critical attention from the user, otherwise the torque sensor calibration will fail can make the ebike run without pedaling, so it is dangerous.
Good idea. I changed this to alternating red and blue LEDS to avoid confusion with thee green led when thee motor is on. I think this is better
casainho said:
When decreasing the assist level, the red LED is enable while only should be the green (and no, there is no color mixing on the LEDs, I see spots for each color)
I changed assist down to be the same as assist up. both now green.
casainho said:
4. see battery state while clicking on on/off button is nice. I do not like to be forced to see battery state every time I turn off the motor, and even it seems to increase the motor turn off time
now removed on power off
casainho said:
the brake LED signal is now a blinking red. Blinking and red should be used for future alerts / fatal errors because it caches even more our attention compared to solid red only. I think the brakes should be a solid red and maybe with max duration of 5 seconds, so if I keep brakes pressed for 2 minutes at a red light stop, only 5 seconds of power will be used from the battery
for now, I implemented a solid red when brake is on.
In another pr I will implement a timer to turn off after 5 seconds.
@beemac - I tried to do this with a led sequence, but a delay will always play out. please look at this PR, and LED_SEQUENCE_EXTRA_LONGRED . Any ideas on how we could do this for the brake?
casainho said:
6. I like the amount of brightness for the LEDs, I tested during day and seems good.

good. we are getting there.
I just gave you a PR with these changes
 
rananna said:
casainho said:
@rananna, I was able to build, everything is ok, that was a problem of my side because I changed computer and I was missing some tools.
Did you actually go for a ride, or was this bench testing?
casainho said:
1. walk assist works as expected and is nice that green LED flashing while it is active
OK, that one is ready to go!
casainho said:
2. at motor startup, if I look at the mobile app, seems that the remote is taking more time to stop LEDs, so, effectively extending the motor turn on time that is already to long!! Why not stop the LEDs as soon motor is on?
Well, actually, that is not the case. Both @beemac's code, my code and the Android code are recognizing the turn on time at the same time.
What maybe is giving the sense that it is taking longer is we are using a short green, short green, long green sequence to indicate motor on. I have changed this to a double green flash. It now lines up well with the android app in time.
casainho said:
Here you blink red and green at the same time. Did you tested to alternate blink? like when one if on the other is off? I would expect more visual impact and I think that motor startup needs critical attention from the user, otherwise the torque sensor calibration will fail can make the ebike run without pedaling, so it is dangerous.
Good idea. I changed this to alternating red and blue LEDS to avoid confusion with thee green led when thee motor is on. I think this is better
casainho said:
When decreasing the assist level, the red LED is enable while only should be the green (and no, there is no color mixing on the LEDs, I see spots for each color)
I changed assist down to be the same as assist up. both now green.
casainho said:
4. see battery state while clicking on on/off button is nice. I do not like to be forced to see battery state every time I turn off the motor, and even it seems to increase the motor turn off time
now removed on power off
casainho said:
the brake LED signal is now a blinking red. Blinking and red should be used for future alerts / fatal errors because it caches even more our attention compared to solid red only. I think the brakes should be a solid red and maybe with max duration of 5 seconds, so if I keep brakes pressed for 2 minutes at a red light stop, only 5 seconds of power will be used from the battery
for now, I implemented a solid red when brake is on.
In another pr I will implement a timer to turn off after 5 seconds.
@beemac - I tried to do this with a led sequence, but a delay will always play out. please look at this PR, and LED_SEQUENCE_EXTRA_LONGRED . Any ideas on how we could do this for the brake?
casainho said:
6. I like the amount of brightness for the LEDs, I tested during day and seems good.

good. we are getting there.
I just gave you a PR with these changes

@casainho, if you like these changes, let me know and I will modify the documentation to reflect the new signalling before we issue a release version
 
rananna said:
@casainho, if you like these changes, let me know and I will modify the documentation to reflect the new signalling before we issue a release version
Thanks. I hope to test today with a ride.
 
The original screws are M2 and I found locally some M2x16 screws for wood but the screw thread is not exactly the same as the original ones... is there anyone that know how can we know the reference for the original screw threads and where to buy online?

I put a small amount of translucent silicone on the hole for the LED and it seems will work well. And maybe I will use the same silicone to seal around the openings:

 
@rananna,

1. The brake red LED is ok now BUT is to strong. Can you make it with the same brightness as on the other moments the red LED turns on?

2. The motor turn on blue and red LED is good.

3. When I turn on the motor, I expect to see only the LED signal for turn on but I always see an extra blink at begin, like if there is a signal for button long press. The same happens for motor turn off with the long press. Can you remote this extra signal for long press?

I will make my ride but all seems good for now.
 
casainho said:
@rananna,

1. The brake red LED is ok now BUT is to strong. Can you make it with the same brightness as on the other moments the red LED turns on?

will do.
@beemac, I implement this by simply turning on the red led when the brake pin is active and turning it off when released.
I have a 5 second timer that will turn it off also.
I just used bsp_board_led_on(LED_R__PIN); to turn it on, which is why it is too bright.
I tried to use a pwm sequence without ant delay that simply turned on the led, but I could not get it to turn off.
It is probably user error on my part, but could you please tell me how to use the pwm sequencer to accomplish this?
Perhaps we need a couple of functions addedd like function pwm_led_on and pwm_led_off?
casainho said:
2. The motor turn on blue and red LED is good.
glad you like it.
casainho said:
3. When I turn on the motor, I expect to see only the LED signal for turn on but I always see an extra blink at begin, like if there is a signal for button long press. The same happens for motor turn off with the long press. Can you remote this extra signal for long press?
will do.
casainho said:
I will make my ride but all seems good for now.
I hope all goes well and the remaining changes will be minor - it will be nice to get a new release out!
 
rananna said:
@beemac, I implement this by simply turning on the red led when the brake pin is active and turning it off when released.
I have a 5 second timer that will turn it off also.
I just used bsp_board_led_on(LED_R__PIN); to turn it on, which is why it is too bright.
I tried to use a pwm sequence without ant delay that simply turned on the led, but I could not get it to turn off.
It is probably user error on my part, but could you please tell me how to use the pwm sequencer to accomplish this?
Perhaps we need a couple of functions addedd like function pwm_led_on and pwm_led_off?

Why is having the LED on solid red better than it blinking? If you really want a solid red - then just create a led sequence - LED_RED, WAIT(5000), LED_OFF, WAIT(0),END_SEQUENCE, END_SEQUENCE - then if you want to turn it off early - just call play_now with the LED_OFF sequence and 0 delay...

And I still think we should let people decide if the down assist yellow is mixed yellow (like i see) or separate red+green as it's useful to be able to see what you're pressing in the dark. @Casainho I think you have super vision if you see discrete leds not mixing! :)
 
casainho said:
The original screws are M2 and I found locally some M2x16 screws for wood but the screw thread is not exactly the same as the original ones... is there anyone that know how can we know the reference for the original screw threads and where to buy online?

@casainho
It is an M2 .79 pitch plastic thread forming screw pan head phillips. Still looking for purchase link. Most are 100 pieces.

Something like these, but you may need longer.https://www.ebay.com/itm/Black-Zinc-Phillips-Pan-Head-Thread-Cutting-Self-Tapping-Screw-M1-4-M1-7-M2-M2-3/153446637938
 
Back
Top