TSDZ2 48v 2020 new firmware

stancecoke said:
casainho said:
@stancecoke, are you planning to help developing the firmware? if so, are you using or planning to use TSDZ2?
I will not use a middrive motor, my highest priority is the absolute silence of the drive, therefore I use BionX direct drives in my bikes, as you know.

I can help with the basic FOC commutation, if help is needed. I strongly recomment to use the DAVE APP configuration tool, that is described in the pdf document (comes with the zip file of the FOC example), to generate the code for the hardware initialization (ADCx, Timerx, Interrupts....). This will save 4 weeks of reading the reference manual....
You can then edit the generated code further in Visual Studio Code.

regards
stancecoke

DAVE APP configurator.JPG
DAVE APP configurator_1.JPG
DAVE APP configurator_2.JPG
I did not yet read. For what I saw on the code from Infineon for FOC, the FOC code is closed source and distributed as a library. So yes, there must be way configure the library and maybe is that tool. Maybe a good idea is to use the original tool to have an initial configuration. I hope their FOC library give us all that is needed so we can avoid to implement all that / reuse your FOC code :)

I also value more and more the silence... But I do MTB and only mid drive motors are suitable.
 
ok that's great of course. I haven't seen that at all. is similar to the iwoc trio on my Rocky Mountain. you don't need more! I'll get that for the new controller!



MFG Michael
 
@casainho: see the edit of my post, you were faster with your answer than me with editing :)

regards
stancecoke
 
Hi all,

I've previously made an ESC using Infineon xmc4100, and the setup in the DAVE is identical for both that and the xmc1300.

I strongly advise using the Infineon FOC. It's a lot easier than the st library and the result is really really good.

I threw together the PCB in 2 evenings and got it spinning in another 1 with the Infineon IDE. You'd be mad not to use it.Screenshot_20210427-231329.png
 
The Infineon FOC code certainly used to be open source, or at least visible in their libraries.

If you download some of the libraries and projects for the kits from the pre app days you can easily find it.

The limitation of the app is that you have to plumb in the hall sensors yourself. The standard library only supports sensorless as of a few months ago.
 
That Dave Software is Windows only, is behind a wall and force me to give my personal data and accept to receive their marketing communications :-(

Also I did follow their process a few times and I simple can not download it :-(

Can someone please share with me the download link as I simple can not download it??

 
Ok, 20 minutes later I got an e-mail with the Dave download link :-( -- so slow for current times :)
 
casainho said:
I got an e-mail with the Dave download link

I played around a little, too. The hardware configuration via the HW Signal Connectivity view seems to be quite simple and self explanatory. :thumb:

regards
stancecoke

ceProject.jpg
 
stancecoke said:
casainho said:
I got an e-mail with the Dave download link
I played around a little, too. The hardware configuration via the HW Signal Connectivity view seems to be quite simple and self explanatory. :thumb:
I also tested to build their FOC sample code. After I also tested to create a new FOC project. There are many options that are important to understand. But I saw that DAVE software is a Eclipse with GCC compiler and there is a Makefile to build the firmware, so, I hope at sometime to build and configure the FOC code and then stop to use that DAVE software and add our specific code by hand.

Next steps will be probably to find most possible information about the hardware and the motor, to configure the FOC and make the motor working.

Something I do not understand is that I saw no option for the hall sensors, seems to me that their FOC option is only for sensorless although we see the motor controller to use the hall sensors and I would expect hall sensors to be used for startup and later switch to sensorless - stancecoke, can you give a look to the configurations to see what do you understand about this?
 
casainho said:
stancecoke, can you give a look to the configurations to see what do you understand about this?

You can add functions like Hall reading, UART, etc by the menu item "Add new App". There you can add "blocks" of functions, see the screenshot.
On the tab "HW Signal Connectiviy", you can right click on this blocks to assing the pins to the functions. Choose "Manual Pin Allocator". The pinout has been investigated by @abrainer already, thank you for this! :thumb:
With "generate code" the necessary libraries are copied to the project structure. But I have not tried to implement the rotorangle estimation by hallsensor so far. But the libraries offer many useful functions, so I guess, it is not too difficult to implement...

regards
stancecoke
 

Attachments

  • Functions in Hall library.JPG
    Functions in Hall library.JPG
    54.5 KB · Views: 1,027
  • Pin Assignment.JPG
    Pin Assignment.JPG
    96.6 KB · Views: 1,027
  • Manual pin allocator.JPG
    Manual pin allocator.JPG
    104.9 KB · Views: 1,027
  • Menu item Add new App.JPG
    Menu item Add new App.JPG
    38.5 KB · Views: 1,027
  • Add new App window UART.JPG
    Add new App window UART.JPG
    50.4 KB · Views: 1,026
  • Add new App window.JPG
    Add new App window.JPG
    52.3 KB · Views: 1,027
https://www.infineonforums.com/threads/5320-How-to-change-Dave4-PMSM-FOC-app-from-sensorless-to-Hall

There is no hall support as of 6 months ago at least.

Infineon don't support it ostensibly because the observer they have is way better... But it'll never work at stationary.

As in this, it's over ridable.

Edit... Stancecoke somewhat beat me to it...
 
stancecoke said:
casainho said:
stancecoke, can you give a look to the configurations to see what do you understand about this?
You can add functions like Hall reading, UART, etc by the menu item "Add new App". There you can add "blocks" of functions, see the screenshot.
On the tab "HW Signal Connectiviy", you can right click on this blocks to assing the pins to the functions. Choose "Manual Pin Allocator". The pinout has been investigated by @abrainer already, thank you for this! :thumb:
With "generate code" the necessary libraries are copied to the project structure. But I have not tried to implement the rotorangle estimation by hallsensor so far. But the libraries offer many useful functions, so I guess, it is not too difficult to implement...
Thanks I understand. But my main question is to know if their FOC library uses or not the hall sensors??
On your FOC code, do you use the hall sensors in any way? What do you think of possible not using the hall sensors at all? and if so, why do you think they did maintain the hall sensors (I mean the connections, should be expensive all that wires, connectors and testing of them)?

@abrainer yes!! and I received his development and with that I could very quickly make the flash and debug of firmware working!
Do you know if @abrainer put the TSDZ2 motor working?? there are a lot of details to know, like polarity of PWM lines, phase current sensors amplification, etc.
 
There is an enum in the pmsm_foc.h at least, that assumes that hall sensing is switchable somehow....

Code:
typedef enum PMSM_FOC_FEEDBACK
{
  PMSM_FOC_3_HALL,              /**< 3 hall sensors*/
  PMSM_FOC_SENSORLESS           /**< No sensored feedback. Position and angle estimation from flux */

}PMSM_FOC_FEEDBACK_t;

Perhaps we should upload the example to github, so we can use links to relevant code lines...

casainho said:
On your FOC code, do you use the hall sensors in any way?
Yes, the hall sensor signal can be used for angle extrapolation, like in your code, or it can feed a PLL that estimates the angle increment per PWM period, this runs the motor much smoother and more quiet.
The main advantage of hallsensors is the torque at startup, as you don't have to start open loop....

regards
stancecoke
 
stancecoke said:
There is an enum in the pmsm_foc.h at least, that assumes that hall sensing is switchable somehow....

Code:
typedef enum PMSM_FOC_FEEDBACK
{
  PMSM_FOC_3_HALL,              /**< 3 hall sensors*/
  PMSM_FOC_SENSORLESS           /**< No sensored feedback. Position and angle estimation from flux */

}PMSM_FOC_FEEDBACK_t;

Perhaps we should upload the example to github, so we can use links to relevant code lines...

casainho said:
On your FOC code, do you use the hall sensors in any way?
Yes, the hall sensor signal can be used for angle extrapolation, like in your code, or it can feed a PLL that estimates the angle increment per PWM period, this runs the motor much smoother and more quiet.
The main advantage of hallsensors is the torque at startup, as you don't have to start open loop....
Can you please add that folder to github? because I am not on Windows and their software only works on Windows.

So yes, hall sensors are still very important. So I need to make sure that FOC project includes the hall sensors and how to configure them on the project, just like the others parts of FOC that we can configure.
 
I had got the engine running. However, only in V/f open loop mode. The control of the output stage transistors is noted in the table with phase x high/low.
The circuit structure of the current measurement corresponds to the Infineon example circuits. I did not measure the gain of the current measurement.
I have drawn the circuit of the output stage (picture attached).
The problem is that I have no idea about motor control, it is not enough to make the Infineon example application work well.

21-04-28 18-41-42 1437.jpg
 
abrainer said:
I had got the engine running. However, only in V/f open loop mode. The control of the output stage transistors is noted in the table with phase x high/low.
The circuit structure of the current measurement corresponds to the Infineon example circuits. I did not measure the gain of the current measurement.
I have drawn the circuit of the output stage (picture attached).
The problem is that I have no idea about motor control, it is not enough to make the Infineon example application work well.

21-04-28 18-41-42 1437.jpg
Can you please share with us your project folder for DAVE that you used to make the motor working? That would help a lot. We can continue your work and as we see, we are now more then one :)
 
casainho said:
Can you please add that folder to github?

See here:
https://github.com/OpenSourceEBike/TSDZ2_motor_controller_v2/tree/master

But I struggle with obvious version conflicts. The example code compiles OK, but with adding UART, it throws errors. If I create a new project and add UART and PMSM_FOC, the UART works, but the PMSM throws errors :confused:

regards
stancecoke
 
stancecoke said:
casainho said:
Can you please add that folder to github?

See here:
https://github.com/OpenSourceEBike/TSDZ2_motor_controller_v2/tree/master

But I struggle with obvious version conflicts. The example code compiles OK, but with adding UART, it throws errors. If I create a new project and add UART and PMSM_FOC, the UART works, but the PMSM throws errors :confused:
So we can not rely on their DAVE software to fully develop our project. The most important is to have the motor working well with FOC and then we can add manually all other parts. UART communication for the display can not be that hard to implement manually as we did on all other projects.
 
I managed to compile with the latest FOC libraries now. You have to set the link to the FOC library manually in the Eclipse settings...
I have not done the right pin assignment so far.
https://github.com/OpenSourceEBike/TSDZ2_motor_controller_v2/tree/master

But now I can't help any more, as I have no hardware...

regards
stancecoke
 
stancecoke said:
I managed to compile with the latest FOC libraries now. You have to set the link to the FOC library manually in the Eclipse settings...
I have not done the right pin assignment so far.
https://github.com/OpenSourceEBike/TSDZ2_motor_controller_v2/tree/master

But now I can't help any more, as I have no hardware...
Thanks. What we miss now is the configurations that @abrainer used on his project...
 
I've adapted the manual pin assingment according to the list of @abrainer, you can see the changes in the last two commits:
https://github.com/OpenSourceEBike/TSDZ2_motor_controller_v2/commits/master

I have to write a gitignore file :)
Sadly, I was not able to install the egit plugin for eclipse in DAVE, so I have to use the Git GUI....

regards
stancecoke
 
Can you please share with us your project folder for DAVE that you used to make the motor working? That would help a lot. We can continue your work and as we see, we are now more then one

I did the tests 5 months ago. There are 5 different projects in the Dave IDE and I can't remember which one worked. I will connect the motor to the new controller at the weekend and test which version worked, after that i will try to push the archive to git.
Sorry, but i never used used git to save files or projects :wink:
 
abrainer said:
Can you please share with us your project folder for DAVE that you used to make the motor working? That would help a lot. We can continue your work and as we see, we are now more then one

I did the tests 5 months ago. There are 5 different projects in the Dave IDE and I can't remember which one worked. I will connect the motor to the new controller at the weekend and test which version worked, after that i will try to push the archive to git.
Sorry, but i never used used git to save files or projects :wink:
Thanks and do not worry with git. Please share the files or information in a way that is possible to you.
 
Here:
https://enerprof.de/motor-kits/display-ersatzteile/tongsheng/

MFG Michael
 
Back
Top