build your very own Lebowski controller !

Electric Motors and Controllers
User avatar
Lebowski
1 GW
1 GW
Posts: 3200
Joined: Jun 28, 2011 1:38 am
Location: beautiful Zurich, Switzerland

Re: build your very own Lebowski controller !

Post by Lebowski » Mar 04, 2018 2:46 pm

Braking current ?

Just curious, can you post the hex ?

User avatar
Arlo1
100 GW
100 GW
Posts: 8575
Joined: Apr 26, 2009 10:36 pm
Location: Nanaimo BC Canada
Contact:

Re: build your very own Lebowski controller !

Post by Arlo1 » Mar 05, 2018 12:44 am

Arlin "Sansmore" lmfao ';)

:lol:
My Leaf motor controller build. viewtopic.php?f=30&t=63982&p=963227#p963227
My YSR build http://www.youtube.com/watch?v=BRo8r5g4NBg
RC and most types of Lithium batteries you MUST know your individual cell voltages charging and discharging.
Don't keep them were you cant afford smoke or fire!
Never above 4.2v never below 2.7v EVER!!!
HI power controller design. Game Changer
http://www.undergroundelectrics.ca/

jackbauer
1 mW
1 mW
Posts: 19
Joined: May 04, 2017 2:42 pm

Re: build your very own Lebowski controller !

Post by jackbauer » Mar 05, 2018 2:51 am

Hex attached
Attachments
2a1_run1lv_hall_pga411.txt
(2.29 KiB) Downloaded 12 times

jackbauer
1 mW
1 mW
Posts: 19
Joined: May 04, 2017 2:42 pm

Re: build your very own Lebowski controller !

Post by jackbauer » Mar 05, 2018 2:52 am

Arlo sorry did I mess up your name? My apologies.

User avatar
Lebowski
1 GW
1 GW
Posts: 3200
Joined: Jun 28, 2011 1:38 am
Location: beautiful Zurich, Switzerland

Re: build your very own Lebowski controller !

Post by Lebowski » Mar 05, 2018 3:46 am

jackbauer wrote:
Mar 05, 2018 2:51 am
Hex attached
Some suggestions that should improve things:

In the PWM menu you have

Code: Select all

a) PWM frequency: 8kHz
b) deadtime: 1999ns
c) dutycycle testsignal: 1748%
d) toggle high side polarity, now active HIGH
e) toggle low side polarity, now active HIGH
f) test PWM signals

g) autocomplete

h) loop sample frequency: 10.67 kHz
The loop sample frequency (so the rate at which the controller IC measures current - calculates - generates new output) is extremely low at only 10 kHz. Best is to aim for a number around 25 kHz, by experimenting with the PWM frequency and autocompleting. A value of 6 or 7 kHz for the PWM frequency autocompletes to a much better loop sample rate in the mid 20 kHz range.

Changing the loop sample frequency means the rest of the menu's will need to be redone because all values depend on this parameter and will have changed (like erpms, motor inductance etc etc).

In the erpm menu:

Code: Select all

c) regen rampup start, end: 0, 39775 erpm
d) accept direction change below: 0 erpm
I would change c for a more reasonable range of 300, 800 or so. Also I would set d to about 100. Reason for this last one is that in hall mode, when the erpms are below the value of d AND throttle is closed, it will shut down the PWM in the output stage. Kind of a second use of this variable which is not so well documented.

I would re-autocomplete the filter menu when switching between sensorless and hall mode, as some autocompleted settings depend on running mode...

The hall menu looks good, you can see the 60 degree spacing between the hall signals

Code: Select all

 code: 0, angle: 358 deg, confidence: 0, used: no
 code: 1, angle: 154 deg, confidence: 6, used: yes
 code: 2, angle: 35 deg, confidence: 6, used: yes
 code: 3, angle: 95 deg, confidence: 6, used: yes
 code: 4, angle: 274 deg, confidence: 6, used: yes
 code: 5, angle: 213 deg, confidence: 6, used: yes
 code: 6, angle: 334 deg, confidence: 6, used: yes
 code: 7, angle: 358 deg, confidence: 0, used: no
It actually makes a binary code of the 3 hall signals, so it will take 8 combinations instead of the 6 that you get with commutation signals. You can for instance just wire the top 3 bits of a resolver and use all 8 codes. But you can run into trouble with noise on the lines, as commutation signals are Grey coded and just using the top 3 bits is not Grey coded...

jackbauer
1 mW
1 mW
Posts: 19
Joined: May 04, 2017 2:42 pm

Re: build your very own Lebowski controller !

Post by jackbauer » Mar 05, 2018 3:55 am

Great thanks. I'll do some more experiments. I'm keen to get a solution for using ev motor resolvers. Any plans for digitally interfacing a resolver to digital converter?

User avatar
Lebowski
1 GW
1 GW
Posts: 3200
Joined: Jun 28, 2011 1:38 am
Location: beautiful Zurich, Switzerland

Re: build your very own Lebowski controller !

Post by Lebowski » Mar 05, 2018 5:32 am

jackbauer wrote:
Mar 05, 2018 3:55 am
Great thanks. I'll do some more experiments. I'm keen to get a solution for using ev motor resolvers. Any plans for digitally interfacing a resolver to digital converter?
At the moment not... all pins on the chip are in use so there's just nowhere to connect to. I am thinking about switching over to 64 pin chip so it could be an option there, but the 40pin 30F is too small. But for the 64 pins I have plans to try to build something like TI has where it can sensorless standstill measure the rotor position using the inductor values.

User avatar
Arlo1
100 GW
100 GW
Posts: 8575
Joined: Apr 26, 2009 10:36 pm
Location: Nanaimo BC Canada
Contact:

Re: build your very own Lebowski controller !

Post by Arlo1 » Mar 05, 2018 1:25 pm

jackbauer wrote:
Mar 05, 2018 2:52 am
Arlo sorry did I mess up your name? My apologies.
Lol its ok. I think its funny.

Its pronounced "SAN SOME" Spelled Sansome :)

Great to see your progress.

How much does the I3 motor weigh?
My Leaf motor controller build. viewtopic.php?f=30&t=63982&p=963227#p963227
My YSR build http://www.youtube.com/watch?v=BRo8r5g4NBg
RC and most types of Lithium batteries you MUST know your individual cell voltages charging and discharging.
Don't keep them were you cant afford smoke or fire!
Never above 4.2v never below 2.7v EVER!!!
HI power controller design. Game Changer
http://www.undergroundelectrics.ca/

User avatar
Arlo1
100 GW
100 GW
Posts: 8575
Joined: Apr 26, 2009 10:36 pm
Location: Nanaimo BC Canada
Contact:

Re: build your very own Lebowski controller !

Post by Arlo1 » Mar 05, 2018 1:28 pm

Lebowski wrote:
Mar 05, 2018 5:32 am
jackbauer wrote:
Mar 05, 2018 3:55 am
Great thanks. I'll do some more experiments. I'm keen to get a solution for using ev motor resolvers. Any plans for digitally interfacing a resolver to digital converter?
At the moment not... all pins on the chip are in use so there's just nowhere to connect to. I am thinking about switching over to 64 pin chip so it could be an option there, but the 40pin 30F is too small. But for the 64 pins I have plans to try to build something like TI has where it can sensorless standstill measure the rotor position using the inductor values.
Isn't the TI method a Tone method (like you used to have) and that tone takes away from the available energy the controller can put into the motor for torque?
My Leaf motor controller build. viewtopic.php?f=30&t=63982&p=963227#p963227
My YSR build http://www.youtube.com/watch?v=BRo8r5g4NBg
RC and most types of Lithium batteries you MUST know your individual cell voltages charging and discharging.
Don't keep them were you cant afford smoke or fire!
Never above 4.2v never below 2.7v EVER!!!
HI power controller design. Game Changer
http://www.undergroundelectrics.ca/

jackbauer
1 mW
1 mW
Posts: 19
Joined: May 04, 2017 2:42 pm

Re: build your very own Lebowski controller !

Post by jackbauer » Mar 05, 2018 2:09 pm

The i3 motor weighs about 60kg. I had to carry it up to flights of stairs!

jackbauer
1 mW
1 mW
Posts: 19
Joined: May 04, 2017 2:42 pm

Re: build your very own Lebowski controller !

Post by jackbauer » Mar 05, 2018 2:11 pm

Another stupid question : Will this run an induction motor?

User avatar
Lebowski
1 GW
1 GW
Posts: 3200
Joined: Jun 28, 2011 1:38 am
Location: beautiful Zurich, Switzerland

Re: build your very own Lebowski controller !

Post by Lebowski » Mar 05, 2018 3:06 pm

Arlo1 wrote:
Mar 05, 2018 1:28 pm
Lebowski wrote:
Mar 05, 2018 5:32 am
jackbauer wrote:
Mar 05, 2018 3:55 am
Great thanks. I'll do some more experiments. I'm keen to get a solution for using ev motor resolvers. Any plans for digitally interfacing a resolver to digital converter?
At the moment not... all pins on the chip are in use so there's just nowhere to connect to. I am thinking about switching over to 64 pin chip so it could be an option there, but the 40pin 30F is too small. But for the 64 pins I have plans to try to build something like TI has where it can sensorless standstill measure the rotor position using the inductor values.
Isn't the TI method a Tone method (like you used to have) and that tone takes away from the available energy the controller can put into the motor for torque?
For my next try I will again try a tone method but want to use the PWM as a 'tone' . This is something I had in my head for a long time now but the 30F PWM building block cannot do this. The 33EV processor can, there you can have the 3 PWM signals running out of sinc in order to generate a tone.

User avatar
Lebowski
1 GW
1 GW
Posts: 3200
Joined: Jun 28, 2011 1:38 am
Location: beautiful Zurich, Switzerland

Re: build your very own Lebowski controller !

Post by Lebowski » Mar 05, 2018 3:09 pm

jackbauer wrote:
Mar 05, 2018 2:11 pm
Another stupid question : Will this run an induction motor?
Nope, it runs BLDC and IPM (my own private FOC algorithm I use actually runs the Switched Reluctance part of an IPM motor correctly (so at max efficiency)). It should also run an SR motor for as long as you don't remove the throttle current.

I never had access to an induction motor so never looked into those.

kiwifiat
10 W
10 W
Posts: 98
Joined: Mar 16, 2013 5:49 pm
Location: Vancouver, Canada

Re: build your very own Lebowski controller !

Post by kiwifiat » Mar 05, 2018 4:47 pm

Lebowski wrote:
Mar 05, 2018 3:09 pm
Nope, it runs BLDC and IPM (my own private FOC algorithm I use actually runs the Switched Reluctance part of an IPM motor correctly (so at max efficiency)). It should also run an SR motor for as long as you don't remove the throttle current.

I never had access to an induction motor so never looked into those.
Does that mean that for an IPM motor where you want Id ≠ 0 the chip will automatically calculate and apply Id so that torque per amp is maximized?
The only source of knowledge is experience.
Albert Einstein

User avatar
Lebowski
1 GW
1 GW
Posts: 3200
Joined: Jun 28, 2011 1:38 am
Location: beautiful Zurich, Switzerland

Re: build your very own Lebowski controller !

Post by Lebowski » Mar 05, 2018 5:34 pm

Also for an IPM you want Id (i had to look that one up because all throught my code I use different terms, i use real and imaginary like you have with complex number theory) to be 0. But it depends on motor design and phase difference between saliency and backemf....

The algo i use automatically goes for point of max torque per amp.

kiwifiat
10 W
10 W
Posts: 98
Joined: Mar 16, 2013 5:49 pm
Location: Vancouver, Canada

Re: build your very own Lebowski controller !

Post by kiwifiat » Mar 05, 2018 7:47 pm

Lebowski wrote:
Mar 05, 2018 5:34 pm
Also for an IPM you want Id (i had to look that one up because all throught my code I use different terms, i use real and imaginary like you have with complex number theory) to be 0. But it depends on motor design and phase difference between saliency and backemf....

The algo i use automatically goes for point of max torque per amp.
Interior magnet motors need Id to be negative to maximize torque per amp, from the Oak Ridge National Laboratory evaluation of the 2004 Prius drive train:
FOC_Torque_equation.PNG
FOC_Torque_equation.PNG (26.33 KiB) Viewed 437 times
Did you mean SPM you want Id=0, which as far as I know is true?
The only source of knowledge is experience.
Albert Einstein

User avatar
Arlo1
100 GW
100 GW
Posts: 8575
Joined: Apr 26, 2009 10:36 pm
Location: Nanaimo BC Canada
Contact:

Re: build your very own Lebowski controller !

Post by Arlo1 » Mar 05, 2018 11:16 pm

kiwifiat wrote:
Mar 05, 2018 7:47 pm
Lebowski wrote:
Mar 05, 2018 5:34 pm
Also for an IPM you want Id (i had to look that one up because all throught my code I use different terms, i use real and imaginary like you have with complex number theory) to be 0. But it depends on motor design and phase difference between saliency and backemf....

The algo i use automatically goes for point of max torque per amp.
Interior magnet motors need Id to be negative to maximize torque per amp, from the Oak Ridge National Laboratory evaluation of the 2004 Prius drive train:

FOC_Torque_equation.PNG

Did you mean SPM you want Id=0, which as far as I know is true?
The leaf motor in my car running daily for 1.5 years is a IPM rotor
My Leaf motor controller build. viewtopic.php?f=30&t=63982&p=963227#p963227
My YSR build http://www.youtube.com/watch?v=BRo8r5g4NBg
RC and most types of Lithium batteries you MUST know your individual cell voltages charging and discharging.
Don't keep them were you cant afford smoke or fire!
Never above 4.2v never below 2.7v EVER!!!
HI power controller design. Game Changer
http://www.undergroundelectrics.ca/

kiwifiat
10 W
10 W
Posts: 98
Joined: Mar 16, 2013 5:49 pm
Location: Vancouver, Canada

Re: build your very own Lebowski controller !

Post by kiwifiat » Mar 06, 2018 1:02 am

Arlo1 wrote:
Mar 05, 2018 11:16 pm
kiwifiat wrote:
Mar 05, 2018 7:47 pm
Lebowski wrote:
Mar 05, 2018 5:34 pm
Also for an IPM you want Id (i had to look that one up because all throught my code I use different terms, i use real and imaginary like you have with complex number theory) to be 0. But it depends on motor design and phase difference between saliency and backemf....

The algo i use automatically goes for point of max torque per amp.
Interior magnet motors need Id to be negative to maximize torque per amp, from the Oak Ridge National Laboratory evaluation of the 2004 Prius drive train:

FOC_Torque_equation.PNG

Did you mean SPM you want Id=0, which as far as I know is true?
The leaf motor in my car running daily for 1.5 years is a IPM rotor
Yes I know, I am trying to get my head around tuning the lebowski controller for Id current for maximum torque. For instance the Prius IPM motor from what I read runs best with Id = -0.3Iq So if the lebowski contoller works that out automatically then fantastic or should we set field weakening to 30% of phase current starting at zero erpm ??
The only source of knowledge is experience.
Albert Einstein

User avatar
Arlo1
100 GW
100 GW
Posts: 8575
Joined: Apr 26, 2009 10:36 pm
Location: Nanaimo BC Canada
Contact:

Re: build your very own Lebowski controller !

Post by Arlo1 » Mar 06, 2018 1:49 am

You don't get to decide what RPM the field-weakening starts at.

I run lots of fieldweakening its fine ;)
My Leaf motor controller build. viewtopic.php?f=30&t=63982&p=963227#p963227
My YSR build http://www.youtube.com/watch?v=BRo8r5g4NBg
RC and most types of Lithium batteries you MUST know your individual cell voltages charging and discharging.
Don't keep them were you cant afford smoke or fire!
Never above 4.2v never below 2.7v EVER!!!
HI power controller design. Game Changer
http://www.undergroundelectrics.ca/

User avatar
Lebowski
1 GW
1 GW
Posts: 3200
Joined: Jun 28, 2011 1:38 am
Location: beautiful Zurich, Switzerland

Re: build your very own Lebowski controller !

Post by Lebowski » Mar 07, 2018 3:47 am

Would there be interest in an explanaition of how I look at an IPM motor ? It will involve lots of vectors and some math (trigonometry) but on a rather basic highschool level (I am a simpel dude). But it explains the comment / questions from Kiwifiat and why some IPM's are better for fieldweakening... It also shows how my controller runs an IPM (only vector diagram though)... and why it is not always 100% perfect (but we're talking a few % away from perfect).

whereswally606
100 kW
100 kW
Posts: 1197
Joined: Jun 19, 2011 2:11 pm
Location: Cheshire, UK

Re: build your very own Lebowski controller !

Post by whereswally606 » Mar 07, 2018 5:37 am

I like simple explanations, I will try to follow if you post. I should be able to follow high school math as I used to teach it.
Distributing "Lebowski" FOC Controller PCB (Through hole) since 2016
Moped: Emax 110s 2009

jackbauer
1 mW
1 mW
Posts: 19
Joined: May 04, 2017 2:42 pm

Re: build your very own Lebowski controller !

Post by jackbauer » Mar 07, 2018 3:08 pm

Yes please that would be great. I'm not good with math but will try to follow along:)

kiwifiat
10 W
10 W
Posts: 98
Joined: Mar 16, 2013 5:49 pm
Location: Vancouver, Canada

Re: build your very own Lebowski controller !

Post by kiwifiat » Mar 07, 2018 3:51 pm

That is a yes please from me too.
The only source of knowledge is experience.
Albert Einstein

kywalda
10 mW
10 mW
Posts: 24
Joined: Apr 29, 2016 2:22 pm

Re: build your very own Lebowski controller !

Post by kywalda » Apr 14, 2018 4:51 am

Hi Bas, now I connected 2 temperature sensors to the controller. In setup m) c) "temperatur readings" I get quite high values about 120.0. Outside temperature is only 16 degC. Are the readings "raw" not degC (version v2p93) ? Or do I have any mistakes on my cables?

Thanks and have a nice weekend,
Arne

User avatar
Lebowski
1 GW
1 GW
Posts: 3200
Joined: Jun 28, 2011 1:38 am
Location: beautiful Zurich, Switzerland

Re: build your very own Lebowski controller !

Post by Lebowski » Apr 14, 2018 5:55 am

Did the chip correctly find two temp sensors ? Does it display the two identification codes ?

P.s. and its recommended to update the firmware to 2.A1

Post Reply