build your very own Lebowski controller !

Electric Motors and Controllers
User avatar
Danny Mayes
1 kW
1 kW
Posts: 327
Joined: Feb 16, 2011 10:17 pm
Location: Perth, Australia

Re: build your very own Lebowski controller !

Post by Danny Mayes » Jul 02, 2015 9:30 am

+1

Me too :mrgreen:

purple_jeep
1 W
1 W
Posts: 53
Joined: Mar 21, 2014 11:52 am

Re: build your very own Lebowski controller !

Post by purple_jeep » Jul 08, 2015 2:47 pm

Hi Lebowski,

I am back at working on the IGBT version for my brother, I need a 24V supply for the drivers so what do you think of the following:
- From what I can tell from your PIC12F617 code you are comparing the signals from the 5V and 15V lines via external resistive dividers to 0.6V internally (my assembly is bad but your comments are good :))
- If I modify the divider network for the "15V" line to make it 0.6V from 24V and then add a 7815 3 pin reg from the modified 24V to make the supply for U12 do you think this would be ok?

Cheers

Chris

purple_jeep
1 W
1 W
Posts: 53
Joined: Mar 21, 2014 11:52 am

Re: build your very own Lebowski controller !

Post by purple_jeep » Jul 08, 2015 2:49 pm

EKOBA wrote:Hi ,

Where can I find some chips btw I am a UAV guy but still would like to try out...If some one can direct me to a complete board..

Regards
http://www.vimeo.com/xerofly
I have a few spare boards here and chips if you are still looking for one? You are just after the brain board correct and will build your own power stage?

Cheers

Chris

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

Re: build your very own Lebowski controller !

Post by Lebowski » Jul 09, 2015 12:52 am

purple_jeep wrote:Hi Lebowski,

I am back at working on the IGBT version for my brother, I need a 24V supply for the drivers so what do you think of the following:
- From what I can tell from your PIC12F617 code you are comparing the signals from the 5V and 15V lines via external resistive dividers to 0.6V internally (my assembly is bad but your comments are good :))
- If I modify the divider network for the "15V" line to make it 0.6V from 24V and then add a 7815 3 pin reg from the modified 24V to make the supply for U12 do you think this would be ok?

Cheers

Chris
Yeah I think this would work. Just make sure that also the FETs controlled by U12 (the gate driver IC of the power supply) only see this 15V.

User avatar
kd8cgo
100 W
100 W
Posts: 119
Joined: May 31, 2009 3:06 pm
Location: Northern Constitution-Free Border Zone, Homeland Security Region 5 - Corporate States of America

Re: build your very own Lebowski controller !

Post by kd8cgo » Jul 17, 2015 6:52 am

Wow, I have missed this DIY controller thing, and I find it is AMAZING! I have to get started on a few of these. I see it is closed source/proprietary but I am not totally familiar with this PIC programming. If I want to program the chip does the initial flash need to be done with a programmer like ICD2 or something, and then upgrades to your firmware can be loaded over rs232? Or does the programmer interface with a header on your board like a JTAG for this purpose? Do many software changes happen to be concerned with this, it seems like you are updating at times - hows the current users dealing with this type of stuff? I did not see the hex file or whatnot needed for the main PIC in the zip file. A Hex is compiled already right, so it can just be flashed by anyone without being able to open up the magic source code box? Is there a separate page or some shopping cart for the software download? Is there a fee for the downloading, since it's proprietary, or a new payment for every update - I have not seen how this part of it is working so far reading about it.

Good job on this, I'm totally excited now for building it!

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

Re: build your very own Lebowski controller !

Post by Lebowski » Jul 17, 2015 8:22 am

The code for the 12F617 (the one in the power supply is open source). The controller IC itself you can buy from me, there is no hex or anything available for this. In principle you can have an update by sending me the controller IC back, but it must be useful (i.e. if there is a serious mistake in the controller IC causing your motor not to run).

CoulombMotorsport
10 mW
10 mW
Posts: 31
Joined: Jan 19, 2016 7:19 pm
Location: Perth, Western Australia
Contact:

Re: build your very own Lebowski controller !

Post by CoulombMotorsport » Feb 23, 2016 7:05 am

Hi Lebowski,

Majorly impressed by your controller! Only wish I'd known about it a few months ago when I was in Switzerland (I'm live in Perth, Western Australia). Just wondering what components I would have to change in order for your controller to work at 30V min, 55V max as I see you are using it around 80V?

Additionally, do you have an efficiency figure for the controller? I plan on building one for use on my Electric efficiency vehicle and so am chasing efficiency gains wherever possible.

Look forward to hearing from you.

James
Building Electric Endurance and Efficiency Vehicles since 2009.
Like us on Facebook for regular updates: https://www.facebook.com/CoulombMotorsport/
Website: http://www.coulombmotorsport.com
Youtube: https://www.youtube.com/channel/UCsbnFx ... rPJnyKrN3A

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

Re: build your very own Lebowski controller !

Post by Lebowski » Feb 24, 2016 2:19 am

CoulombMotorsport wrote:Hi Lebowski,

Majorly impressed by your controller! Only wish I'd known about it a few months ago when I was in Switzerland (I'm live in Perth, Western Australia). Just wondering what components I would have to change in order for your controller to work at 30V min, 55V max as I see you are using it around 80V?

Additionally, do you have an efficiency figure for the controller? I plan on building one for use on my Electric efficiency vehicle and so am chasing efficiency gains wherever possible.

Look forward to hearing from you.

James
There's not really anything to change when moving to lower voltages. Of course you can use lower voltage caps and FETs (which may need a change in gate resistance based on different gate charge)
but other than that it should be OK.

I do not know the efficiency of the controller, I do not have a motor stand to measure that....

User avatar
Danny Mayes
1 kW
1 kW
Posts: 327
Joined: Feb 16, 2011 10:17 pm
Location: Perth, Australia

Re: build your very own Lebowski controller !

Post by Danny Mayes » Feb 24, 2016 2:56 am

Lebowski wrote: There's not really anything to change when moving to lower voltages. Of course you can use lower voltage caps and FETs (which may need a change in gate resistance based on different gate charge)
but other than that it should be OK.

I do not know the efficiency of the controller, I do not have a motor stand to measure that....
Hey Lebowski, just because we are on the subject, how low a voltage could you go? Could you run it on a single cell? This is not my strong area at all but I assume the chip would need at least 5volts so maybe 2 cell would be the minimum?

D

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

Re: build your very own Lebowski controller !

Post by Lebowski » Feb 24, 2016 4:38 am

Danny Mayes wrote:
Lebowski wrote: There's not really anything to change when moving to lower voltages. Of course you can use lower voltage caps and FETs (which may need a change in gate resistance based on different gate charge)
but other than that it should be OK.

I do not know the efficiency of the controller, I do not have a motor stand to measure that....
Hey Lebowski, just because we are on the subject, how low a voltage could you go? Could you run it on a single cell? This is not my strong area at all but I assume the chip would need at least 5volts so maybe 2 cell would be the minimum?

D
Depends on the output stage... you need 5V minimum for the chip and the current sensors. FETs like to be driven with a 15V gate signals... Maybe there are FETs out there for which 5V would be enough, but I can imagine you still need a high current gate driver. Don't know if there are 5V drivers like that available.

User avatar
Danny Mayes
1 kW
1 kW
Posts: 327
Joined: Feb 16, 2011 10:17 pm
Location: Perth, Australia

Re: build your very own Lebowski controller !

Post by Danny Mayes » Feb 24, 2016 6:20 am

Thanks Lebowski.

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

Re: build your very own Lebowski controller !

Post by Lebowski » Jun 01, 2016 11:23 am

Starting with v2.60 the controller IC uses the hall signals directly. From Izeman's MAC I have seen the hall sensors or their wiring pick up a lot of noise as the phase current increases, to the point where the hall sensor signals become complete garbage. Therefore I recommend to rplace the pull up resistors with the following analog filter in each hall signal:
hall filtering.jpg
hall filtering.jpg (60.32 KiB) Viewed 2145 times
As all analog filters have a delay, with the above components the delay is 10 degrees at 5 k-erpm.
In 2.60: the calibration speed is half the max speed set with options a and b in the erpm menu. Best to set these to around 10k-erpm, as not to have too big an error in the hall measurement due to the analog delay.
For existing PCB's: the capacitors can also be to 5V, so on the board you can replace the resistors to 5V with capacitors. The resistors can then be added in the hall wiring.

Errata from a few days later: i have the feeling this circuit brings too much delay and it is better to stick with just the original pull up resistors...
Last edited by Lebowski on Jun 04, 2016 8:49 am, edited 1 time in total.

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

Re: build your very own Lebowski controller !

Post by Arlo1 » Jun 01, 2016 2:21 pm

Lebowski wrote:Starting with v2.60 the controller IC uses the hall signals directly. From Izeman's MAC I have seen the hall sensors or their wiring pick up a lot of noise as the phase current increases, to the point where the hall sensor signals become complete garbage. Therefore I recommend to add the following analog filter in each hall signal:
hall filtering.jpg
As all analog filters have a delay, with the above components the delay is 10 degrees at 5 k-erpm.
In 2.60: the calibration speed is half the max speed set with options a and b in the erpm menu. Best to set these to around 10k-erpm, as not to have too big an error in the hall measurement due to the analog delay.
For existing PCB's: the capacitors can also be to 5V, so on the board you can replace the resistors to 5V with capacitors. The resistors can then be added in the hall wiring.
Didn't you have this in you sch at first then remove it over time? :lol:
My Leaf motor controller build. https://endless-sphere.com/forums/viewto ... 27#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

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

Re: build your very own Lebowski controller !

Post by Lebowski » Jun 02, 2016 1:51 am

ehm :oops: yes.

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

Re: build your very own Lebowski controller !

Post by Arlo1 » Jun 02, 2016 9:34 am

Lebowski wrote:ehm :oops: yes.
I was only following your advice. :)

I will clean this up. Maybe my problem is 2 things 1 I am going sensorless to low of rpm so when Im in sensorless I can not go full throttle.
and 2 the sensor noise is to high so I can not run in sensored mode very well.

So to solve my 2 problems I need to clean up my sensor signals and then simple raise the rpm for the transition.... fingers crossed. ;)
My Leaf motor controller build. https://endless-sphere.com/forums/viewto ... 27#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

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

Re: build your very own Lebowski controller !

Post by Lebowski » Jun 02, 2016 11:11 am

I've been playing in the mean time with v2.70 combined with Izemans MAC and it's been very interesting. In 2.70 I added a function in the main menu (option y):

Code: Select all

m) temperature sensors
n) miscellaneous
y) chip status at last drive_1
z) store parameters in ROM for motor use
It will now save the last 3 states for when it entered drive_1 (recovery mode), plus the state at button press.

Please, the following is just an example of a few things I saw, don't take these as general rules for your motor !

One common conk-out seems to be:

Code: Select all

 Last entry into drive_1:

error bits:                over_i_total or over_i_error 
drive LEDS:                ..23
time spent:                0.348 sec
throttle:                  7 %
wanted_i_torque:           3.8 A
wanted_i_fieldweak:        0.0 A
filter_i_torque:           13.1 A
filter_i_fieldweak:        2.0 A
filter_i_error, dr3:       0.7 A
filter_i_total, dr2, dr23: 14.2 A
filter_i_error, dr2, dr23: 0.7 A
Vout_real:                 21 %
Vout_imag:                 3 %
Vout_scaling:              0
speed_sensorless:          3.69 k-erpm
filter_speed:              11.75 k-erpm
accelleration:             -46 %
What it is telling you here is that during the last entry into drive_1 it went there coming from drive_23 (led 2 and 3 where on) which is the transition between 2 (hall mode) and 3 (sensorless).

The really out of range value here is the accelleration, 46% means it is at 46% of what the controller can max achieve with the settings from the menus. This is normally not achievable and points towards a control loop instability. it was fixed by changing the 2nd order coefficient to 24 (which gives it the 'perfect' theoretical ratios of 40 and 20 between b/c and c/d)

Code: Select all

  phase control loop, drive 3
b) 1st order: 480
c) 2nd order: 24.0000
d) 3rd order: 0.6000
Another common thing I saw:

Code: Select all

 Last but 1 entry into drive_1:

error bits:                over_i_total or over_i_error 
drive LEDS:                ..2.
time spent:                0.006 sec
throttle:                  6 %
wanted_i_torque:           3.1 A
wanted_i_fieldweak:        0.0 A
filter_i_torque:           19.8 A
filter_i_fieldweak:        0.0 A
filter_i_error, dr3:       -0.4 A
filter_i_total, dr2, dr23: 13.1 A
filter_i_error, dr2, dr23: -0.4 A
Vout_real:                 13 %
Vout_imag:                 0 %
Vout_scaling:              0
speed_sensorless:          0.00 k-erpm
filter_speed:              0.00 k-erpm
accelleration:             0 %
What you can see here is that throttle is almost closed, no wanted phase current but i_total in dr23 is very high. This happened while I was closing the throttle. The amplitude loop which is supposed to make the filtered (actual) current follow the wanted current is too slow. This was fixed with

Code: Select all

  amplitude control loop
h) 1st order: 240
i) 2nd order: 12.0000
Went to the perfect theoretical ratio of 20, but with the 2nd order coefficient much higher than I thought was necessary...

Learn something every day...

User avatar
izeman
10 GW
10 GW
Posts: 4502
Joined: Jun 21, 2011 8:25 am
Location: vienna, austria
Contact:

Re: build your very own Lebowski controller !

Post by izeman » Jun 03, 2016 10:29 am

Lebowski wrote:As all analog filters have a delay, with the above components the delay is 10 degrees at 5 k-erpm.
For existing PCB's: the capacitors can also be to 5V, so on the board you can replace the resistors to 5V with capacitors. The resistors can then be added in the hall wiring.
i built this circuit as a plug-between solution for my existing motor. unfortunately the local electronics shop hat only those big 63v caps with 6.8nF. so this could be a bit smaller. i will put all this in heat shrink and fill it with glue.
Foto 03.06.16, 17 22 28.jpg
Foto 03.06.16, 17 22 28.jpg (33.01 KiB) Viewed 2041 times
Foto 03.06.16, 17 22 36.jpg
Foto 03.06.16, 17 22 36.jpg (85.04 KiB) Viewed 2041 times

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

Re: build your very own Lebowski controller !

Post by Arlo1 » Jun 03, 2016 11:22 am

Good idea I think I will need to do the same!
My Leaf motor controller build. https://endless-sphere.com/forums/viewto ... 27#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

User avatar
izeman
10 GW
10 GW
Posts: 4502
Joined: Jun 21, 2011 8:25 am
Location: vienna, austria
Contact:

Re: build your very own Lebowski controller !

Post by izeman » Jun 03, 2016 11:50 am

Arlo1 wrote:Good idea I think I will need to do the same!
yes. but try to source smaller caps :)

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

Re: build your very own Lebowski controller !

Post by Arlo1 » Jun 03, 2016 12:00 pm

izeman wrote:
Arlo1 wrote:Good idea I think I will need to do the same!
yes. but try to source smaller caps :)
I have a great selection ;)
My Leaf motor controller build. https://endless-sphere.com/forums/viewto ... 27#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

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

Re: build your very own Lebowski controller !

Post by Lebowski » Jun 03, 2016 2:21 pm

I'm starting to wonder again about the effectiveness of this... am very curious about whether you guys notice the difference or not. I did measurements this afternoon and have the sneaky feeling the digital filtering I put inside the chip is more effective than the analog external.... for the same filtering bandwidth (read: phase shift penalty) I see better results with the digital filter. So please let me know your experiences !

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

Re: build your very own Lebowski controller !

Post by Arlo1 » Jun 03, 2016 2:38 pm

Im going to start by adding shielded cable.
My Leaf motor controller build. https://endless-sphere.com/forums/viewto ... 27#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

User avatar
izeman
10 GW
10 GW
Posts: 4502
Joined: Jun 21, 2011 8:25 am
Location: vienna, austria
Contact:

Re: build your very own Lebowski controller !

Post by izeman » Jun 03, 2016 2:47 pm

Lebowski wrote:I'm starting to wonder again about the effectiveness of this... am very curious about whether you guys notice the difference or not. I did measurements this afternoon and have the sneaky feeling the digital filtering I put inside the chip is more effective than the analog external.... for the same filtering bandwidth (read: phase shift penalty) I see better results with the digital filter. So please let me know your experiences !
you tell me NOW!! ;) only joking. i hope weather will be ok, and my dc/dc will work again, so i can do some tests in the morning.

User avatar
izeman
10 GW
10 GW
Posts: 4502
Joined: Jun 21, 2011 8:25 am
Location: vienna, austria
Contact:

Re: build your very own Lebowski controller !

Post by izeman » Jun 04, 2016 8:27 am

connected the circuit to my kelly controller and it refused to work. it just gave "hall error".

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

Re: build your very own Lebowski controller !

Post by Lebowski » Jun 04, 2016 8:47 am

izeman wrote:connected the circuit to my kelly controller and it refused to work. it just gave "hall error".
It probably has the pull up resistors inside.... you either have the circuit from a few posts ago, or the pull up resistors,but not both...

Post Reply