TSDZ2 48v 2020 new firmware

casainho said:
....No, pin 7 and pin 8 are not shorted. My current guess is that they assembled some MPC6021 batch units knowing they are instead MCP6022 -- I think this is possible, maybe the MPC6021 factory sold them this "special" units.
Everything is possible, but I can't imagine that the factory does this, because this would be problematic if you sell these.
It could be possible that another unknown single op-amp would fit there too.
 
I just finished the notes for the shunt resistor input value, I added to pins.h file:

 
casainho said:
So, if the opamp is really MCP6021, then pin 1 and pin 8 would be unconnected, but we see they are not... most probably the opamp is the MCP6022 and not the MPC6021, or am I missing something??

I was also puzzled by the name of this OPA. The circuit is clearly for a dual OPA (MCP6022). Perhaps they are mislabelled OPAs that could be bought cheaply.
 
abrainer said:
....The circuit is clearly for a dual OPA (MCP6022). Perhaps they are mislabelled OPAs that could be bought cheaply.
That could be possible indeed, if only used for a closed market, but mostly in that case the wrong text is sanded away.
 
So, there are 3 dual opamps. 2 of them are the MCP6022 and one of them is the LM258. This gives a total of 6 opamps available.

I just checked the MCP6022 near the shunt resistor and I found:
1. one opamp is in the no inverting configuration with the gain of 11, measuring the shunt resistor (can only measure positive current values, just like on the V1 hardware).
2. other opamp is in the inverting configuration with the gain of -10, measuring also the shunt resistor, but has also an offset of 2.5 volts, meaning it can measure both positive and negative values.

What is strange is that I can see the other MCP6022 with gain of -10 and 2.5V offset, for sure measuring the 2 of 3 phase current resistor voltage. BUT, I also see the LM256 with gain of -10 and 2.5V offset, measuring the other 1 of 3 phase current resistor voltage.

So, why would they use two MCP6022 and a LM256 to do the same function, while they could use instead the same MCP6022 or the same LM256??

Here a picture of the circuit:


Akita said:
Can't find your Paypal.
What's the name?
It is on my signature.
 
// LM258
// opamp pins 1, 2 and 3, is configured with as a unity gain buffer, providing at output a 2.5 volts signal (probably for the offset voltage used on the other opamps measuring the phase currents)

As we can see on this LM258, pin 1 and 2 are shorted.
Pin 3 has 2.5 volts, provided by the 2 near resistors, both with same resistance and dividing by half the 5 volts:
 
casainho said:
So, why would they use two MCP6022 and a LM256 to do the same function, while they could use instead the same MCP6022 or the same LM256??
Well, because I was wrong. LM256 as one opamp working as unity gain buffer, providing at output a 2.5 volts signal for the other opamps with a voltage offset of 2.5 volts.
The other opamp of LM256 is for amplification of the signal related to the torque sensor.

The MCP6022 seems to have like 10x more frequency bandwidth then the LM256, so yes, makes sense that MCP6022 is used for the phase currents and LM256 for the more slow signal like the torque sensor.
 
@abrainer, on your notes about the pins, you refer that there are inputs for measurements of shunt resistor and also to the 3 motor phases resistor, although I just find measurements to only 2 motor phase resistor:
- LM258:
1. opamp working as unity gain buffer, providing at output a 2.5 volts signal for the other opamps using a voltage offset of 2.5 volts.
2. amplification of the signal related to the torque sensor.

- MCP6022 1 (near shunt resistor):
1. shunt resistor measurement, amplification factor 10, 2.5 volts offset
2. shunt resistor measurement, amplification factor -11

- MCP6022 2:
1. yellow phase resistor measurement, amplification factor 10, 2.5 volts offset
2. blue phase resistor measurement, amplification factor 10, 2.5 volts offset

Could be a mistake of you? because if so, how could you make the motor working with such big mistake in terms of FOC currents calculation??

 
casainho said:
@abrainer, on your notes about the pins, you refer that there are inputs for measurements of shunt resistor and also to the 3 motor phases resistor, although I just find measurements to only 2 motor phase resistor:

I am pretty sure that the pinout is correct, otherwise the Infineon FOC control would not work. On the top side there are 3 shunts directly at the source pins of the lower fets for the phase current measurement. The shunt for the total current measurement is on the bottom.
I remember that the trace routing for the current measurement for the green phase was difficult to find.
The FOC control runs cleanly even with the setting "Direct FOC Startup", only from the start the motor has little power, which is normal. Hall sensors are not connected. The Hall sensors are necessary for a powerful start.
The only problem with the Infineon Lib is the unsafe state at motor stop. Otherwise I would have already made tests with the bike. But this way it is too dangerous because the controller will probably not survive this state with the battery.
As I said, I know very little about motor control, but I'm trying to learn more.
I am glad that you have started the project with the new controller and try to be helpful whenever I have a little time.
 
abrainer said:
casainho said:
@abrainer, on your notes about the pins, you refer that there are inputs for measurements of shunt resistor and also to the 3 motor phases resistor, although I just find measurements to only 2 motor phase resistor:

I am pretty sure that the pinout is correct, otherwise the Infineon FOC control would not work. On the top side there are 3 shunts directly at the source pins of the lower fets for the phase current measurement. The shunt for the total current measurement is on the bottom.
I remember that the trace routing for the current measurement for the green phase was difficult to find.
The FOC control runs cleanly even with the setting "Direct FOC Startup", only from the start the motor has little power, which is normal. Hall sensors are not connected. The Hall sensors are necessary for a powerful start.
The only problem with the Infineon Lib is the unsafe state at motor stop. Otherwise I would have already made tests with the bike. But this way it is too dangerous because the controller will probably not survive this state with the battery.
As I said, I know very little about motor control, but I'm trying to learn more.
I am glad that you have started the project with the new controller and try to be helpful whenever I have a little time.
Yes, you are correct, my mistake to follow the track. The thing is that FOC can also be implemented with only 2 phase current sensors so I was not sure about what I was thinking.
 
casainho said:
So, there are 3 dual opamps. 2 of them are the MCP6022 and one of them is the LM258. This gives a total of 6 opamps available.

I just checked the MCP6022 near the shunt resistor and I found:
1. one opamp is in the no inverting configuration with the gain of 11, measuring the shunt resistor (can only measure positive current values, just like on the V1 hardware).
2. other opamp is in the inverting configuration with the gain of -10, measuring also the shunt resistor, but has also an offset of 2.5 volts, meaning it can measure both positive and negative values.

What is strange is that I can see the other MCP6022 with gain of -10 and 2.5V offset, for sure measuring the 2 of 3 phase current resistor voltage. BUT, I also see the LM256 with gain of -10 and 2.5V offset, measuring the other 1 of 3 phase current resistor voltage.

So, why would they use two MCP6022 and a LM256 to do the same function, while they could use instead the same MCP6022 or the same LM256??

Here a picture of the circuit:


Akita said:
Can't find your Paypal.
What's the name?
It is on my signature.
I have tried these names and get the answer.
We can not find paypal.me/jorgecasa. Try entering his or her mobile number or email address.
We can not find paypal.me. Try entering his or her mobile number or email address.
We can not find jorgecasa. Try entering his or her mobile number or email address.
 
Akita said:
I have tried these names and get the answer.
We can not find paypal.me/jorgecasa. Try entering his or her mobile number or email address.
We can not find paypal.me. Try entering his or her mobile number or email address.
We can not find jorgecasa. Try entering his or her mobile number or email address.
Just write paypal.me/jorgecasa in the address line of your browser and klick the button "send". That works. :wink:
 
abrainer said:
Akita said:
I have tried these names and get the answer.
We can not find paypal.me/jorgecasa. Try entering his or her mobile number or email address.
We can not find paypal.me. Try entering his or her mobile number or email address.
We can not find jorgecasa. Try entering his or her mobile number or email address.
Just write paypal.me/jorgecasa in the address line of your browser and klick the button "send". That works. :wink:
No matter how hard I try, I will not succeed.
May ask for help from a knowledgeable Paypal user.
 
First I would like to thank you to @abrainer for the help to get https://enerprof.de/ sending me a TSDZ2 motor that does not work but I will be able to use for development. I just got a Fedex notification, I should receive it next week.

I found SimpleFOC code and Arduino shield, that is a C++ code and is easy to understand. Seems to have a big community thanks for it be an Arduino shield and C++ firmware, and easier to understand than other complex FOC firmwares like VESC. This firmware runs on slow Arduinos (from AVR to ARM) as also on the popular STM32F103, which makes the chinese boards like hoverboards or some ebikes controllers (if not STM32F103, very similar ones).

I must say that if there is an easy to use / understand and popular OpenSource FOC library, maybe it can be better than the original Infineon library... I am still looking at it and see what I can learn :)

https://simplefoc.com/
 
casainho said:
First I would like to thank you to @abrainer for the help to get https://enerprof.de/ sending me a TSDZ2 motor that does not work but I will be able to use for development. I just got a Fedex notification, I should receive it next week.

I found SimpleFOC code and Arduino shield, that is a C++ code and is easy to understand. Seems to have a big community thanks for it be an Arduino shield and C++ firmware, and easier to understand than other complex FOC firmwares like VESC. This firmware runs on slow Arduinos (from AVR to ARM) as also on the popular STM32F103, which makes the chinese boards like hoverboards or some ebikes controllers (if not STM32F103, very similar ones).

I must say that if there is an easy to use / understand and popular OpenSource FOC library, maybe it can be better than the original Infineon library... I am still looking at it and see what I can learn :)

https://simplefoc.com/
Oh no, the Infineon has OpenSource support for the Arduino to their XMC microcontrollers!! So, maybe we can just use this motor controller as an Arduino and then just install and use the SimpleFOC library!!

https://github.com/Infineon/XMC-for-Arduino
 
This is not a good FOC implementation. It is not deterministic, has no concept of interrupt priority, and doesn't have a way to implement the break state.

It's also not really verified and tested for efficiency etc, whereas the infineon one is and results in excellent efficiency.

casainho said:
casainho said:
First I would like to thank you to @abrainer for the help to get https://enerprof.de/ sending me a TSDZ2 motor that does not work but I will be able to use for development. I just got a Fedex notification, I should receive it next week.

I found SimpleFOC code and Arduino shield, that is a C++ code and is easy to understand. Seems to have a big community thanks for it be an Arduino shield and C++ firmware, and easier to understand than other complex FOC firmwares like VESC. This firmware runs on slow Arduinos (from AVR to ARM) as also on the popular STM32F103, which makes the chinese boards like hoverboards or some ebikes controllers (if not STM32F103, very similar ones).

I must say that if there is an easy to use / understand and popular OpenSource FOC library, maybe it can be better than the original Infineon library... I am still looking at it and see what I can learn :)

https://simplefoc.com/
Oh no, the Infineon has OpenSource support for the Arduino to their XMC microcontrollers!! So, maybe we can just use this motor controller as an Arduino and then just install and use the SimpleFOC library!!

https://github.com/Infineon/XMC-for-Arduino
 
mxlemming said:
This is not a good FOC implementation. It is not deterministic, has no concept of interrupt priority, and doesn't have a way to implement the break state.

It's also not really verified and tested for efficiency etc, whereas the infineon one is and results in excellent efficiency.
Ok, I could understand that the code can works with hall sensors but only uses angle values of 360 / 6, there is not interpolation and not even any sensorless. But the code supports angle reading using encoders and magnetic sensors, which are not used on the ebike motors I know.
Anyway, I did learn somethings looking at the code. I am pretty sure they will keep improving the library but their focus seems more gimbals motors and not ebike motors.
 
@casainho
When do you think there may be a new firmware where I can set the maximum speed?
Now it is locked to a maximum of 25 km/h.
 
Akita said:
@casainho
When do you think there may be a new firmware where I can set the maximum speed?
Now it is locked to a maximum of 25 km/h.
Alone as I am now, I think at least more 3 months. I was father for the second time, 2 weeks ago.
 
Elinx said:
casainho said:
....No, pin 7 and pin 8 are not shorted. My current guess is that they assembled some MPC6021 batch units knowing they are instead MCP6022 -- I think this is possible, maybe the MPC6021 factory sold them this "special" units.
Everything is possible, but I can't imagine that the factory does this, because this would be problematic if you sell these.
It could be possible that another unknown single op-amp would fit there too.

These are MCP602I, "I" chips, not 1. https://ww1.microchip.com/downloads/en/DeviceDoc/21314g.pdf
 
Astroid said:
......

These are MCP602I, "I" chips, not 1.
Well noticed :) That explaines the confusion

image.png

MCP602.jpg
 
Back
Top