I can't find a suitable place higher up, so added the same warning to the SW102 page.
TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)
Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)
Calibrated the torque sensor on my TSDZ2 today using a baggage scale and human weights.... jeeze does it make a difference to the ride! Power delivery is now awesome!
I'm curious, with the factory firmware and display, are the torque sensors calibrated at the factory?
I'm curious, with the factory firmware and display, are the torque sensors calibrated at the factory?
Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)
I didn't have the same experience with calibration and reverted back to original. Maybe calibration is better suitable for the torque mode but in my case I had unpleasant results. The linear curve instead of logarithmic make assist very weak at the low cadence and I have to press even harder on the pedals to make my bike moving after the stop. I also experienced an uneven assistance while rotating a pedal, like if I had a oval chain-ring. I think this comes from the fact that the assistance is not averaged through the chainring rotation. I saw that Casainho added a filter to rectify that but I didn't yet try the new 1.0.0 version.rcx194 wrote: ↑May 23 2020 8:33amCalibrated the torque sensor on my TSDZ2 today using a baggage scale and human weights.... jeeze does it make a difference to the ride! Power delivery is now awesome!
I'm curious, with the factory firmware and display, are the torque sensors calibrated at the factory?
The torque sensors are obviously not calibrated at the factory, they do not need to be calibrated as they have general logarithmic curve that fits most of the general use. I recently used my bike on the high hills and saw all the limitations of the motor control that people were complaining: delayed start after the gear change, low assistance at low cadence e.t.c. I usually didn't see this while using my bike in the city.
I'm going to try 1.0.0 version version and I'm going to tweak some parameters to slightly change the control to better fit my riding style
Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)
Hi,
I'm trying to update a TSDZ2 kit that came with a 850c display. Is there any problem opening the display and flashing using SWD STLINKV2. Will i end up with the same result result as if i used a bootloader box? I already have the stlink, but don't really have time to and money to order the bootloader box?
Thanks to anyone who can help with this maybe easy question.
I'm trying to update a TSDZ2 kit that came with a 850c display. Is there any problem opening the display and flashing using SWD STLINKV2. Will i end up with the same result result as if i used a bootloader box? I already have the stlink, but don't really have time to and money to order the bootloader box?
Thanks to anyone who can help with this maybe easy question.
-
- Posts: 115
- Joined: Nov 10 2016 3:29pm
- Location: Oxford, England
Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)
Best way of running 1.0 beta1 is with the calibration disabled. I had not appreciated why until I read this. Many thanks!vshitikov wrote: ↑May 23 2020 8:53amThe linear curve instead of logarithmic make assist very weak at the low cadence and I have to press even harder on the pedals to make my bike moving after the stop. I also experienced an uneven assistance while rotating a pedal, like if I had a oval chain-ring. I think this comes from the fact that the assistance is not averaged through the chainring rotation.
Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)
Is your display setup in metric units and the weights in kilograms?James Broadhurst wrote: ↑May 23 2020 4:54pmBest way of running 1.0 beta1 is with the calibration disabled. I had not appreciated why until I read this. Many thanks!vshitikov wrote: ↑May 23 2020 8:53amThe linear curve instead of logarithmic make assist very weak at the low cadence and I have to press even harder on the pedals to make my bike moving after the stop. I also experienced an uneven assistance while rotating a pedal, like if I had a oval chain-ring. I think this comes from the fact that the assistance is not averaged through the chainring rotation.
Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)
Well i can confirm this is probably is not a good idea. Flashed my screen and my motor and now the bike does not turn on with the power button and black display on 850C. Is is possible i was supposed to use a file that does not say bootloader on it. I tried to follow these instructions that say pick a file with *bootloader.binwpenner wrote: ↑May 23 2020 3:40pmHi,
I'm trying to update a TSDZ2 kit that came with a 850c display. Is there any problem opening the display and flashing using SWD STLINKV2. Will i end up with the same result result as if i used a bootloader box? I already have the stlink, but don't really have time to and money to order the bootloader box?
Thanks to anyone who can help with this maybe easy question.
https://github.com/OpenSource-EBike-fir ... -using-SWD
Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)
I'm fairly confident it is an error on the wiki page. I flashed one that did not say bootloader, and now it says "waiting for tsdz2" for a couple of seconds then the display shuts itself off(next problem to figure out)wpenner wrote: ↑May 23 2020 9:01pmWell i can confirm this is probably is not a good idea. Flashed my screen and my motor and now the bike does not turn on with the power button and black display on 850C. Is is possible i was supposed to use a file that does not say bootloader on it. I tried to follow these instructions that say pick a file with *bootloader.binwpenner wrote: ↑May 23 2020 3:40pmHi,
I'm trying to update a TSDZ2 kit that came with a 850c display. Is there any problem opening the display and flashing using SWD STLINKV2. Will i end up with the same result result as if i used a bootloader box? I already have the stlink, but don't really have time to and money to order the bootloader box?
Thanks to anyone who can help with this maybe easy question.
https://github.com/OpenSource-EBike-fir ... -using-SWD
Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)
I finished the toque sensor calibration but after 100 reboots I could not insert any ADC and weight value on the SW102. The display freezes every time I scroll down the torque sensor menu. The last thing I can see is "pedal grou left", I am able to change it to "right" but it freeze if I scroll down.
-
- Posts: 115
- Joined: Nov 10 2016 3:29pm
- Location: Oxford, England
Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)
Yes.
Setting up an 850C in imperial had some weird effects in earlier versions of the firmware but nearly all gone with the latest 1.0.0-beta.1
Last edited by James Broadhurst on May 24 2020 3:20am, edited 1 time in total.
Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)
Well I am still bigger fan of the previous implementation of eMTB (based on torque) where I could just set coefficient and make the logarithmic curve less or more exponential. It was simple and effective.James Broadhurst wrote: ↑May 23 2020 4:54pmBest way of running 1.0 beta1 is with the calibration disabled. I had not appreciated why until I read this.vshitikov wrote: ↑May 23 2020 8:53amThe linear curve instead of logarithmic make assist very weak at the low cadence and I have to press even harder on the pedals to make my bike moving after the stop. I also experienced an uneven assistance while rotating a pedal, like if I had a oval chain-ring. I think this comes from the fact that the assistance is not averaged through the chainring rotation.
Many thanks!
Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)
You say you don't have bootloader box. If you flash through 850C tabs you have to use .bin file not bootloader.bin file.wpenner wrote: ↑May 23 2020 9:01pmWell i can confirm this is probably is not a good idea. Flashed my screen and my motor and now the bike does not turn on with the power button and black display on 850C. Is is possible i was supposed to use a file that does not say bootloader on it. I tried to follow these instructions that say pick a file with *bootloader.binwpenner wrote: ↑May 23 2020 3:40pmHi,
I'm trying to update a TSDZ2 kit that came with a 850c display. Is there any problem opening the display and flashing using SWD STLINKV2. Will i end up with the same result result as if i used a bootloader box? I already have the stlink, but don't really have time to and money to order the bootloader box?
Thanks to anyone who can help with this maybe easy question.
https://github.com/OpenSource-EBike-fir ... -using-SWD
Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)
Those two projects are both interesting. But personnaly I think it's important to have an "official" display, directy connected to the motor. Having a wireless display is a very nice feature, but for me it's an accessory and we need a solid "main" display with all the base features any ebike users will expect. (but except points you mention above it's pretty good and maybe we do not need to add other features as essential is already done)casainho wrote: ↑May 23 2020 5:24am[...]Benoit wrote: ↑May 23 2020 2:48amMaybe I can start to work on the trip features. It's something I could easily test and verify. Is that ok for you ?casainho wrote: ↑May 22 2020 6:33pm
Are there are many others things to do that I think have higher priority:
- solve SW102 lock issues on configurations menu
- solve lights issue
- automatic shutdown does not work
- Trip (with quick reset): time, distance, Wh
- Short Trip: time, distance, Wh
- kms range estimation, based on Wh used of current short trip, last 5 or 10 minutes
- disable sensors: brake, cadence and torque
Well, should we invest time to develop all this little details?? I don't known... I would instead invest my time on the wireless new version as for long rides, that type of users will value more using a Garmin Edge device that already implements this features and they are implemented already in conjunction with other important trip data and fitness, and recorded on the cloud.
Well, is up to you to decide in which project you prefer to invest more.
Does the use of such Garmin Edge devices will be used by so much people than the SW102/850C/860C display ?
If it really the case, I will invest time (and money as I haven't any of that kind of device) to help.
ALso I saw on this forum you already talked about using a smartphone as a wireless display instead of the current SW102/850C/860C.
This is for me more usefull than a Garmin Edge like device as lot (all ?) bike users have allready a smartphone.
Is there already iOS/Android applications ? What would be the benefits of a Garmine device ? (ANT+ accessories, that's it)
Anyway, I tried to compile then flash firmware. For the 860C, no problem, I can successfully compile it and flash the display, everything is working well.
But for the motor, I did not have "stm8-size" and "stm8-objcopy" commands. I've search on the web and found some informations. I tried to install stm8-binutils (https://stm8-binutils-gdb.sourceforge.io/) but the last step "make install" report me some errors at the end ("*** [Makefile
So for now compilation give me a "main.elf" file. Is this enough ?
I'm using a Debian 10 command line environnement (which contains source code and is used for compiling) and VS code on Windows 10 for developping (remote SSH).
Thanks for the help !
Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)
you don't need them. I compile simply with this line in the makefile. But I compile on Windows.Benoit wrote: ↑May 24 2020 3:34am
Anyway, I tried to compile then flash firmware. For the 860C, no problem, I can successfully compile it and flash the display, everything is working well.
But for the motor, I did not have "stm8-size" and "stm8-objcopy" commands. I've search on the web and found some informations. I tried to install stm8-binutils (https://stm8-binutils-gdb.sourceforge.io/) but the last step "make install" report me some errors at the end ("*** [Makefileinstall-recursive] Error 1" and 3 more)
So for now compilation give me a "main.elf" file. Is this enough ?
I'm using a Debian 10 command line environnement (which contains source code and is used for compiling) and VS code on Windows 10 for developping (remote SSH).
Thanks for the help !
# How to build the overall program
$(PNAME): $(MAINSRC) $(RELS)
$(CC) $(INCLUDES) $(CFLAGS) $(ELF_FLAGS) $(LIBS) $(MAINSRC) $(RELS)
the other lines with objcopy and stm-size are commented. Then you can rename the file in .hex if necessary
-
- Posts: 35
- Joined: May 05 2020 7:16am
Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)
I was getting nowhere with the programming pads on the side of my new sw102, so i tried to open the keypad.
Mine isn't made like the one on the wiki. The whole body is sealed with two holes over the microswitched for the buttons, that rubber bungs on the back of the case button go through.
Still not getting anywhere, I may have melted one of the pads.
Mine isn't made like the one on the wiki. The whole body is sealed with two holes over the microswitched for the buttons, that rubber bungs on the back of the case button go through.
Still not getting anywhere, I may have melted one of the pads.
Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)
Thanks !vshitikov wrote: ↑May 24 2020 4:19amyou don't need them. I compile simply with this line in the makefile. But I compile on Windows.Benoit wrote: ↑May 24 2020 3:34am
Anyway, I tried to compile then flash firmware. For the 860C, no problem, I can successfully compile it and flash the display, everything is working well.
But for the motor, I did not have "stm8-size" and "stm8-objcopy" commands. I've search on the web and found some informations. I tried to install stm8-binutils (https://stm8-binutils-gdb.sourceforge.io/) but the last step "make install" report me some errors at the end ("*** [Makefileinstall-recursive] Error 1" and 3 more)
So for now compilation give me a "main.elf" file. Is this enough ?
I'm using a Debian 10 command line environnement (which contains source code and is used for compiling) and VS code on Windows 10 for developping (remote SSH).
Thanks for the help !
# How to build the overall program
$(PNAME): $(MAINSRC) $(RELS)
$(CC) $(INCLUDES) $(CFLAGS) $(ELF_FLAGS) $(LIBS) $(MAINSRC) $(RELS)
the other lines with objcopy and stm-size are commented. Then you can rename the file in .hex if necessary
I tried to compile it on Windows juste after posting my last message and it worked (I did not yet flash it however)
That's what I'll do so. I would prefer to compile both firmwares on Linux but the essential is I can compile .
Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)
are you sure your wiring is 100% ok? I was away from this thread for over a year now. I had left it when the 805C was still in a very early stage with jtag programming and i still had that display on the shelf. not being up to date really, i installed the bootloader file. this did not work, but also did not ruin anything. i then installed the correct file and got the waiting for tsdz2 message. I opened the display and found that one of the cables had come loose. after resoldering it correctly everything worked out fine immediately.wpenner wrote: ↑May 23 2020 9:24pmI'm fairly confident it is an error on the wiki page. I flashed one that did not say bootloader, and now it says "waiting for tsdz2" for a couple of seconds then the display shuts itself off(next problem to figure out)wpenner wrote: ↑May 23 2020 9:01pmWell i can confirm this is probably is not a good idea. Flashed my screen and my motor and now the bike does not turn on with the power button and black display on 850C. Is is possible i was supposed to use a file that does not say bootloader on it. I tried to follow these instructions that say pick a file with *bootloader.binwpenner wrote: ↑May 23 2020 3:40pmHi,
I'm trying to update a TSDZ2 kit that came with a 850c display. Is there any problem opening the display and flashing using SWD STLINKV2. Will i end up with the same result result as if i used a bootloader box? I already have the stlink, but don't really have time to and money to order the bootloader box?
Thanks to anyone who can help with this maybe easy question.
https://github.com/OpenSource-EBike-fir ... -using-SWD
so according to me there is absolutely no problem using the jtags if you do not make a mistake with the wires.
Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)
I finally succeeded to compile TSDZ2 firmware with Linux !Benoit wrote: ↑May 24 2020 9:46amThanks !vshitikov wrote: ↑May 24 2020 4:19amyou don't need them. I compile simply with this line in the makefile. But I compile on Windows.Benoit wrote: ↑May 24 2020 3:34am
Anyway, I tried to compile then flash firmware. For the 860C, no problem, I can successfully compile it and flash the display, everything is working well.
But for the motor, I did not have "stm8-size" and "stm8-objcopy" commands. I've search on the web and found some informations. I tried to install stm8-binutils (https://stm8-binutils-gdb.sourceforge.io/) but the last step "make install" report me some errors at the end ("*** [Makefileinstall-recursive] Error 1" and 3 more)
So for now compilation give me a "main.elf" file. Is this enough ?
I'm using a Debian 10 command line environnement (which contains source code and is used for compiling) and VS code on Windows 10 for developping (remote SSH).
Thanks for the help !
# How to build the overall program
$(PNAME): $(MAINSRC) $(RELS)
$(CC) $(INCLUDES) $(CFLAGS) $(ELF_FLAGS) $(LIBS) $(MAINSRC) $(RELS)
the other lines with objcopy and stm-size are commented. Then you can rename the file in .hex if necessary
I tried to compile it on Windows juste after posting my last message and it worked (I did not yet flash it however)
That's what I'll do so. I would prefer to compile both firmwares on Linux but the essential is I can compile .
What I did : in the "Makefile_linux" file : I changed ELF_FLAGS value from "--out-fmt-elf --debug" to "--out-fmt-ihx --debug".
It then generate a main.ihx file instead of a main.elf. The main.ixh file can then be converted in a main.hex file with this command : "packihx main.ihx > main.hex"
I flashed this file with ST Visual Programmer and it worked flawlessly !
So now I can develop and compile with VS code and its internal terminal (SSH on my Linux VM).
Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)
Thanks for the suggestion i have reflashed the motor and display multiple times, but have had problems every time. I am only programming the "current tab" as instructed (program > Current tab) do i need to go into the data tab to sort my strange problems?andyme wrote: ↑May 24 2020 3:11pmare you sure your wiring is 100% ok? I was away from this thread for over a year now. I had left it when the 805C was still in a very early stage with jtag programming and i still had that display on the shelf. not being up to date really, i installed the bootloader file. this did not work, but also did not ruin anything. i then installed the correct file and got the waiting for tsdz2 message. I opened the display and found that one of the cables had come loose. after resoldering it correctly everything worked out fine immediately.wpenner wrote: ↑May 23 2020 9:24pmI'm fairly confident it is an error on the wiki page. I flashed one that did not say bootloader, and now it says "waiting for tsdz2" for a couple of seconds then the display shuts itself off(next problem to figure out)wpenner wrote: ↑May 23 2020 9:01pmWell i can confirm this is probably is not a good idea. Flashed my screen and my motor and now the bike does not turn on with the power button and black display on 850C. Is is possible i was supposed to use a file that does not say bootloader on it. I tried to follow these instructions that say pick a file with *bootloader.binwpenner wrote: ↑May 23 2020 3:40pmHi,
I'm trying to update a TSDZ2 kit that came with a 850c display. Is there any problem opening the display and flashing using SWD STLINKV2. Will i end up with the same result result as if i used a bootloader box? I already have the stlink, but don't really have time to and money to order the bootloader box?
Thanks to anyone who can help with this maybe easy question.
https://github.com/OpenSource-EBike-fir ... -using-SWD
so according to me there is absolutely no problem using the jtags if you do not make a mistake with the wires.
Version 6.2 with .51motor - Works but up and down buttons for display are backwards, and i can not open config menu, when i hold down arrow walk assist turns on and motor moves.
Version 8.0 with .57 motor - Works and i can finally now get into config menu by holding all buttons, but when i press walk assist mode motor moves for .5 seconds and entire system restarts
version 1.00 beta1. Display boots and says waiting for TSDZ2.
Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)
Nevermind. Powered on and off controller about 20 times and re plugged all wired connections and it magically works on versoin 1.0 beta1wpenner wrote: ↑May 24 2020 5:52pmThanks for the suggestion i have reflashed the motor and display multiple times, but have had problems every time. I am only programming the "current tab" as instructed (program > Current tab) do i need to go into the data tab to sort my strange problems?andyme wrote: ↑May 24 2020 3:11pmare you sure your wiring is 100% ok? I was away from this thread for over a year now. I had left it when the 805C was still in a very early stage with jtag programming and i still had that display on the shelf. not being up to date really, i installed the bootloader file. this did not work, but also did not ruin anything. i then installed the correct file and got the waiting for tsdz2 message. I opened the display and found that one of the cables had come loose. after resoldering it correctly everything worked out fine immediately.wpenner wrote: ↑May 23 2020 9:24pmI'm fairly confident it is an error on the wiki page. I flashed one that did not say bootloader, and now it says "waiting for tsdz2" for a couple of seconds then the display shuts itself off(next problem to figure out)wpenner wrote: ↑May 23 2020 9:01pm
Well i can confirm this is probably is not a good idea. Flashed my screen and my motor and now the bike does not turn on with the power button and black display on 850C. Is is possible i was supposed to use a file that does not say bootloader on it. I tried to follow these instructions that say pick a file with *bootloader.bin
https://github.com/OpenSource-EBike-fir ... -using-SWD
so according to me there is absolutely no problem using the jtags if you do not make a mistake with the wires.
Version 6.2 with .51motor - Works but up and down buttons for display are backwards, and i can not open config menu, when i hold down arrow walk assist turns on and motor moves.
Version 8.0 with .57 motor - Works and i can finally now get into config menu by holding all buttons, but when i press walk assist mode motor moves for .5 seconds and entire system restarts
version 1.00 beta1. Display boots and says waiting for TSDZ2.
Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)
Hello
Your progress with the bluetooth displays looks great!
I have another two questions about the implementation:
(1) In the adc initialization (adc_init()) you initialize Pin 3,5,6,7
There is no analog Signal on Pin 3. However, the torque signal is on Pin 4 which
is not initialized here. Is there any reason for that or is it a mistake?
As the torque reading works fine, i did not change it so far.
(2) You explicitly prevent the motor from going over a certain max rotational speed (erps) (at least
in the implementation before you had field weakening).
Is it harmful for the motor to go over that speed? In my experience it just does not deliver any power anymore
if it reaches a certain speed.
By the way, i tried to derive the equations for the foc advance angle. According to my
calculations the angle should be twice as big as it is now.
I did some testing where i keept the motor speed constant and varied the foc angle.
At the optimum foc angle the power consumption is at a minimum.
My findings were that the 2x the current foc angle is usually quite close to the minimum for
all the operating conditions i tested.
Your progress with the bluetooth displays looks great!
I have another two questions about the implementation:
(1) In the adc initialization (adc_init()) you initialize Pin 3,5,6,7
Code: Select all
GPIO_Init(GPIOB,
(GPIO_PIN_7 | GPIO_PIN_6 | GPIO_PIN_5 | GPIO_PIN_3),
GPIO_MODE_IN_FL_NO_IT);
is not initialized here. Is there any reason for that or is it a mistake?
As the torque reading works fine, i did not change it so far.
(2) You explicitly prevent the motor from going over a certain max rotational speed (erps) (at least
in the implementation before you had field weakening).
Is it harmful for the motor to go over that speed? In my experience it just does not deliver any power anymore
if it reaches a certain speed.
By the way, i tried to derive the equations for the foc advance angle. According to my
calculations the angle should be twice as big as it is now.
I did some testing where i keept the motor speed constant and varied the foc angle.
At the optimum foc angle the power consumption is at a minimum.
My findings were that the 2x the current foc angle is usually quite close to the minimum for
all the operating conditions i tested.
Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)
See that maybe you did a mistake:benno wrote: ↑May 25 2020 5:05amHello
Your progress with the bluetooth displays looks great!
I have another two questions about the implementation:
(1) In the adc initialization (adc_init()) you initialize Pin 3,5,6,7There is no analog Signal on Pin 3. However, the torque signal is on Pin 4 whichCode: Select all
GPIO_Init(GPIOB, (GPIO_PIN_7 | GPIO_PIN_6 | GPIO_PIN_5 | GPIO_PIN_3), GPIO_MODE_IN_FL_NO_IT);
is not initialized here. Is there any reason for that or is it a mistake?
As the torque reading works fine, i did not change it so far.
#define TORQUE_SENSOR__PORT GPIOB
#define TORQUE_SENSOR__PIN GPIO_PIN_3
And I agree that defines should be used on ADC init.
See this comment on the code:benno wrote: ↑May 25 2020 5:05am(2) You explicitly prevent the motor from going over a certain max rotational speed (erps) (at least
in the implementation before you had field weakening).
Is it harmful for the motor to go over that speed? In my experience it just does not deliver any power anymore
if it reaches a certain speed.
// motor maximum rotation
#define MOTOR_OVER_SPEED_ERPS 700 // 675 is equal to 120 cadence, as TSDZ2 has a reduction ratio of 41.8
Max speed because there is a min limit of about 28 points to draw the SVM voltage signals. That was the reason why I increased the PWM frequency compared to original firmware.
Please share your notes about the derivation so we all can learn.benno wrote: ↑May 25 2020 5:05amBy the way, i tried to derive the equations for the foc advance angle. According to my
calculations the angle should be twice as big as it is now.
I did some testing where i keept the motor speed constant and varied the foc angle.
At the optimum foc angle the power consumption is at a minimum.
My findings were that the 2x the current foc angle is usually quite close to the minimum for
all the operating conditions i tested.
And how did you tested? I hope you also put the motor under different loads with at least pulling 10 amps.
- EBike wireless standard: wireless motor, wireless cycling GPS display Garmin Edge and wireless remote with wireless brake sensor
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware
Developer of OpenSource knowledge and technology for ebikes: Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.
Please consider a donation to help developments: paypal.me/jorgecasa
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware
Developer of OpenSource knowledge and technology for ebikes: Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.
Please consider a donation to help developments: paypal.me/jorgecasa
Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)
I think there is a problem in the source code of the last release, in the "mainscreen.c" file.
If I compile it myself, the main configuration screen is different from the firmware (860C_v1.0.0-beta.1-bootloader.bin
) in the Github release.
In the Github release firmware file :

In my firmware compiled by myself from last version "860C_850C_SW102_v1.0.0-beta.1" :

The "Battery SOC" is missing but there are strange things in the menus "Battery" et "Torque sensor".
In the "Battery" menu, I have a "SOC" item (which redirect to the same screen as "Battery SOC" of the already compiled firmware on the last Github release) :

Source code :
The "FIELD_SCROLLABLE..." line shouldn't be there but in the "topMenus[]" at the end of the file.
And the "Torque sensor" menu is strange ("Calibration" item appears and some letters are messing up) :

Source code :
The "FIELD_SCROLLABLE..." line shouldn't be there.
And the "torqueSensorMenus" is not available anymore in the compiled firmware of the release. I don't know if it's normal ?
And in the "topMenus[]", this line is missing in order to math the Github release firmware :
If I compile it myself, the main configuration screen is different from the firmware (860C_v1.0.0-beta.1-bootloader.bin
) in the Github release.
In the Github release firmware file :

In my firmware compiled by myself from last version "860C_850C_SW102_v1.0.0-beta.1" :

The "Battery SOC" is missing but there are strange things in the menus "Battery" et "Torque sensor".
In the "Battery" menu, I have a "SOC" item (which redirect to the same screen as "Battery SOC" of the already compiled firmware on the last Github release) :

Source code :
Code: Select all
static Field batteryMenus[] =
{
FIELD_EDITABLE_UINT(_S("Max current", "Max curren"), &ui_vars.ui8_battery_max_current, "amps", 1, 20),
FIELD_EDITABLE_UINT(_S("Low cut-off", "Lo cut-off"), &ui_vars.ui16_battery_low_voltage_cut_off_x10, "volts", 160, 630, .div_digits = 1),
FIELD_EDITABLE_UINT(_S("Resistance", "Resistance"), &ui_vars.ui16_battery_pack_resistance_x1000, "mohm", 0, 1000),
FIELD_SCROLLABLE("SOC", batterySOCMenus),
FIELD_READONLY_UINT(_S("Voltage est", "Voltag est"), &ui_vars.ui16_battery_voltage_soc_x10, "volts", false, .div_digits = 1),
FIELD_READONLY_UINT(_S("Resistance est", "Resist est"), &ui_vars.ui16_battery_pack_resistance_estimated_x1000, "mohm", 0, 1000),
FIELD_READONLY_UINT(_S("Power loss est", "Power loss"), &ui_vars.ui16_battery_power_loss, "watts", false, .div_digits = 0),
FIELD_END };
And the "Torque sensor" menu is strange ("Calibration" item appears and some letters are messing up) :

Source code :
Code: Select all
static Field torqueSensorMenus[] =
{
FIELD_EDITABLE_UINT(_S("Torque sensor ADC threshold", "Torq s thr"), &ui_vars.ui8_torque_sensor_adc_threshold, "", 5, 75),
FIELD_EDITABLE_ENUM(_S("Assist w/o pedal rot", "A w/o ped"), &ui_vars.ui8_motor_assistance_startup_without_pedal_rotation, "disable", "enable"), // FIXME, share one array of disable/enable strings
FIELD_EDITABLE_ENUM(_S("Coast brake", "Coast brak"), &ui_vars.ui8_coast_brake_enable, "disable", "enable"),
FIELD_EDITABLE_UINT(_S("Coast brake ADC", "Coa bk ADC"), &ui_vars.ui8_coast_brake_adc, "", 5, 255),
FIELD_SCROLLABLE("Calibration", torqueSensorCalibrationMenus),
FIELD_END };
And the "torqueSensorMenus" is not available anymore in the compiled firmware of the release. I don't know if it's normal ?
And in the "topMenus[]", this line is missing in order to math the Github release firmware :
Code: Select all
FIELD_SCROLLABLE("Battery", batterySOCMenus),
Last edited by Benoit on May 25 2020 2:30pm, edited 2 times in total.
Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)
I'm on version 1.0.0 and I've found that my motor power stays at 220watts. When I first move off, or re-apply pedal power, it will bust to 600+ watts but then settles down at 220w.
Street mode is disabled, and current limit is set to 16 amps. What else should I check.
Street mode is disabled, and current limit is set to 16 amps. What else should I check.
Re: TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)
Hi,
I've just updated my motor and SW102 to the latest version (v1.0.0-beta.1, previously I had the v0.8.0) and noticed a bug with the torque calibration.
The menu systematically locks when trying to go below the pedal start, so the calibration data can't be set. It happens if the calibration is activated or not.
I don't know if it's the same issue than the menu lock since it seems to be relatively random but I haven't done a lot of tests.
I've just updated my motor and SW102 to the latest version (v1.0.0-beta.1, previously I had the v0.8.0) and noticed a bug with the torque calibration.
The menu systematically locks when trying to go below the pedal start, so the calibration data can't be set. It happens if the calibration is activated or not.
I don't know if it's the same issue than the menu lock since it seems to be relatively random but I haven't done a lot of tests.