# DIY BMW i3 Controller



## jackbauer (Jan 12, 2008)

Oh and this will be the ReX version .....


----------



## aeroscott (Jan 5, 2008)

OH JESUS, good one


----------



## jhuebner (Apr 30, 2010)

Of course TriPhase needs TriCore 
Thanks to Arber I'll have a small sync motor on my desk soon. And some say a Nissan Leave drivetrain is coming my way. Let the fun begin


----------



## Kevin Sharpe (Jul 4, 2011)

huge thanks to Damien and Johannes for both the BMW and Leaf open source projects


----------



## muellersc (Dec 4, 2017)

Hi, I am interestet in your i3 project, because I maybe warnt to use an i3 motor unit for my project as well.
Is the Hybrid-Synchronmotor more difficult to control ?
Can you say when your i3 project will start probably.


----------



## arber333 (Dec 13, 2010)

Weber transaxle dissassembly
https://www.youtube.com/watch?v=dqM3YXEf1js

Well since nobody is saying this...
If you got inverter and you got transaxle, batteries aside... you could use motor B to drive the wheels and just connect a Briggs&Stratton lawnmower engine to motor/generator A. Of course you would use flex coupling to dampen vibration. You simply leave clutch B off and only operate clutch A. Or weld it for that matter.... 

So when you run out of battery you start B&S motor and apply clutch A to bring say 8 - 10kW to inverter. 
Inverter could be run off of two Lebowski brains. One only in regen mode. 
Second driving motor B up to 70mph. TomDB sucessfuly operates BLDC motor using one Lebowski brain board.
http://www.diyelectriccar.com/forums/showthread.php/chevy-volt-opel-ampera-inverter-179922.html

No CAN bus needed that way and only You in control of operating B&S stinker .

5c dropping...


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Of course TriPhase needs TriCore
> Thanks to Arber I'll have a small sync motor on my desk soon. And some say a Nissan Leave drivetrain is coming my way. Let the fun begin


I have the motor... small gimbal Brushless Motor GBM5206-150T
http://www.himodel.com/electric/iPower_Gimbal_Brushless_Motor_GBM5206-150T.html

We made a shaft for polarized encoder magnet in center. On the other end you mount ABZ encoder chip and use it to control motor.
https://www.rls.si/en/products/rota.../rmf44-rotary-magnetic-module-on-metal-flange

On the shaft you can mount a pulley like this to small ACIM motor.
Even better would be to use another small BLDC motor and put its phase wires to 3phase bridge and a load. That way you control the load without additional complex electronics.

https://www.ebay.co.uk/itm/GT2-10mm...var=511364911881&_trksid=p2057872.m2749.l2649

I will bring motor, encoder, axle and pulley(kit) to you on my visit. You can decide on how to mount them yourself...

A


----------



## jackbauer (Jan 12, 2008)

Dug a little deeper into the i3 inverter. Not one but two tricore processors on the logic board

Seems they use the same igbt driver as Tesla :
https://www.infineon.com/dgdl/Datas...c11e2&fileId=db3a304330f68606013122ce5f3649cb

700A current sensor on each phase :
http://www.lem.com/docs/products/hc5f700-s.pdf

...and I found a really cool resolver to digital converter chip :
https://www.mouser.ie/productdetail/595-pga411qpaprq1

Mrs.Bauer says I need to do something called "Resting" for the afternoon. Not sure what that is. Probably another word for work on ev stuff.


----------



## Kevin Sharpe (Jul 4, 2011)

jackbauer said:


> Mrs.Bauer says I need to do something called "Resting" for the afternoon. Not sure what that is. Probably another word for work on ev stuff.


Don't forget Mrs Bauer knows best


----------



## gunnarhs (Apr 24, 2012)

jackbauer said:


> Dug a little deeper into the i3 inverter. Not one but two tricore processors on the logic board
> 
> Seems they use the same igbt driver as Tesla :
> https://www.infineon.com/dgdl/Datas...c11e2&fileId=db3a304330f68606013122ce5f3649cb
> ...


Seems to me that this controller is based on same Open Source kit as I have been using, the Infineon Hybrid kit Pack 
https://www.infineon.com/dgdl/Infin...n.pdf?fileId=db3a30432239cccd01225a7cfb166c8a

The only difference is the version (they have been using the Pack2) , while I have used the basic kit. I knew they were using it for development, funny to see this in the final product. At least it is completely open source, both the board and most of the code.


----------



## jackbauer (Jan 12, 2008)

Decided I wanted to do some reverse engineering today. Jeez what a bad idea. The Tesla inverter igbt drivers took an hour or two to work out. Nice and simple and intuitive. Not so my favorite auto maker. Looks like the kids were let off to play with no adult supervision. We got SPI ADCs , high speed digital isolators , different grounds , 32v dc supply requirement and a real fun HVDC derived power supply using a Viper16.

Oh yeah and the idc connectors used in this thing are all unobtanium from a company called ERNI. Good news is I have woken up the gate drivers and their power supplys so some more pain and we should be switching the big igbt. Remember kids, try this at home so I don't have to!


----------



## jackbauer (Jan 12, 2008)

Annnd we have lift off. All 6 igbts firing and current sensors reading. Needs ground, +5v (one for igbt logic and one for current sense) , +32v for igbt drive , one +5v enable signal for the dc dc power supply and then 6 3v3 or 5v signals to turn on each igbt. Fault lines tbd. Current sensors are analog out.


----------



## jhuebner (Apr 30, 2010)

Congratulations!

Wow 32V is such a common voltage in any car  So you win a boost converter should you wan to design a board for this.


----------



## gunnarhs (Apr 24, 2012)

jhuebner said:


> Congratulations!
> 
> Wow 32V is such a common voltage in any car  So you win a boost converter should you wan to design a board for this.


Hmmm this sounds suspicious.....
Just one question: Does it work with 24V instead of the 32V?


----------



## jackbauer (Jan 12, 2008)

gunnarhs said:


> Hmmm this sounds suspicious.....
> Just one question: Does it work with 24V instead of the 32V?


Nope. And the secondary outputs are proportional to the input. 32v in gives +15v and -8v. 31v in gives 14v and -7v.


----------



## gunnarhs (Apr 24, 2012)

jackbauer said:


> Nope. And the secondary outputs are proportional to the input. 32v in gives +15v and -8v. 31v in gives 14v and -7v.


Ok for the Infineon driver modules I know and I am quite sure BMW is using the normal Drive voltage Level at the output is -8 -> +15V. In my case it is realised with a supply voltage about 12V (can be 8-18V according to specs but is really 10-16V)

The only reason using a higher Voltage as I see it would be if there is a massive cooling unit (fan or pump) in the 32V circuit. I would expect this Unit to take 16V and leave 16V for the drive unit. The 32V could come from a DC/DC -converter.
But BMW might have other thoughts...


----------



## jackbauer (Jan 12, 2008)

i3 drive motor resolver connected to a TI PGA411 eval board.


----------



## jackbauer (Jan 12, 2008)

Finally found a connector that will at least fit the pins of the unobtanium BMW i3 igbt driver board ribbon cable plug. Time to go design a logic board. 

At this time I will not be making the design open source. This may change in the future but in light of recent events and the actions of a small number of individuals I have taken this decision. I hope people will understand.


----------



## jhuebner (Apr 30, 2010)

I fully support that.

Let me enlighten you a bit. A certain individual contacted me and wanted to talk me into some sort of cooperation with vague promises. He then tried to persuade me to persuade Damien to lower the price for the Tesla boards (because of the awesome cooperation).
He threatened that he had alternative sources (oh really?! the project is open source, what a surprise you have alternative sources!) and would make use of them.

Next thing he was convinced that the price included Damien de-soldering the current sensors on the small drive unit and fitting the new board. "I've seen it on the video, it only takes 20 minutes!". So again he used Damiens freely shared information to pit it against us. And he kept me on the phone for hours with his bullshit.

This experience (and a few others) also make me consider to stop sharing freely and only give access to a selected crowd with proven moral integrity.

On to the good sides I have been donated a complete Nissan Leaf Drive Train. One of the clear upsides of sharing freely!


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> I fully support that.
> 
> On to the good sides I have been donated a complete Nissan Leaf Drive Train. One of the clear upsides of sharing freely!


Heh Johannes that the best news this year!!!
I think i will get my Leaf drive moving after all . I also have one Leaf motor with gearbox and driveshafts. It should go into my Volvo...
I didnt choose Leaf inverter however. Rather i bought Opel Ampera inverter and removed its logic board. Driver board operates with 5V inverted signals so could be used with your inverter core. 

Would you like to include my system as a second test bed? 
I found a great deal of ampera inverters on used market and for a price much lower than I can make a power section for. And that inverter should be able to make 1000A at 400Vdc!

A


----------



## jackbauer (Jan 12, 2008)

Where did you get the Ampera inverter Arber?


----------



## arber333 (Dec 13, 2010)

jackbauer said:


> Where did you get the Ampera inverter Arber?


From Niederland. They get supply of broken cars... Maybe you find some in Norway also, but it is not EU.
TomDB helped with advice, but basically i entered "Opel Ampera inverter 1264381"in google and browsed for results. I must admit i looked for Volt inverter and checked for P/N similarities. 

A


----------



## Tomdb (Jan 28, 2013)

Looking for partnumbers is the best way to go, as these parts are from GM (Opel/Vauxhall/Chevy)

On topic, Damien how many days till you get it spinning that motor?


----------



## rmay635703 (Oct 23, 2008)

Since you like BMW someone should donate an entire 2014 + Smart ED to you so you guys can open source the motor/inverter, bms and charger.
Smarts are the 2nd cheapest parts EV over here.

All kidding aside, You guys do amazing work!


----------



## arber333 (Dec 13, 2010)

Hahaha!

I just saw Paul Holmes made dual logic board for Ampera/Volt inverter! Great minds do think alike. I may try his design if it is complete package. Probably it would be the quickest way to run the motor. 
However it sould be a drop in part, so i could still make my own logic board someday and put it in... or test Johanness board.
https://www.youtube.com/watch?v=wol8Uck_C1A

A


----------



## CKidder (Dec 12, 2009)

jhuebner said:


> On to the good sides I have been donated a complete Nissan Leaf Drive Train. One of the clear upsides of sharing freely!


Do note that the Nissan Leaf drive train has been fully reverse engineered already so people are able to use them as-is; no need to create any other control board for it. I know that's not as much fun as figuring it out yourself and building something. I'm just mentioning it because a whole lot of people would probably rather use the OEM parts so I think interest in custom control for the Leaf might be more limited. However, the OEM solution does top out at something like 80kw which I think is extremely conservative for that motor. A custom solution could push the motor a bit harder. Also, the OEM inverter is completely CAN controlled and maybe some people would rather a solution that can take a throttle signal more directly. It's up to you but I wouldn't call the Leaf drive train a super lucrative target.


----------



## jhuebner (Apr 30, 2010)

Hey Collin, lets move that discussion over: http://www.diyelectriccar.com/forums/showthread.php?p=960658#post960658


----------



## jackbauer (Jan 12, 2008)

Decided to build a new brain as mine is getting tired


----------



## Tomdb (Jan 28, 2013)

Also a Lebowski user, nice.

Quite good sensorless control.


----------



## jackbauer (Jan 12, 2008)

i3 motor spinning with the i3 inverter

https://youtu.be/LJtIS4KhvYM


----------



## muellersc (Dec 4, 2017)

Great news, your project is very interesting for me.

Do you plan to integrate a REX control unit into your new i3 logic board as well ? I would appreciate 

I think one main advantage of the BMW i3 nowadays is the optional REX for large distances and as backup. I would like to use the REX in my planend project to get more independent / flexible.
(Maybe in 10 years the charging infrastructure and batteries are much better, so I can go without REX and disassemble. But now I like it)

By the way, I think not all information must be Open Source for everyone.


----------



## jackbauer (Jan 12, 2008)

Just copying in a comment from Youtube :

The BMW i3 eMachine is an Interior Permanent Magnet (IPM) machine with a heavily skewed rotor, and as such it has low saliency, meaning a low cogging torque. However it has a high ratio between the d and q rotor axis inductance, meaning it can generate a high reluctance torque, and hence produces a high torque per amp output (but sacrifices maximum power capability to do so. At just about 2.5kW/kg, it's around 4x lower specific power output than the latest high speed eMachines. As an IPM, you'll have to optimise the d/q axis current to find the angle at which the machine produces the highest torque/amp, unlike a Surface Permanent Magnet (SPM) machine that produces peak torque/Amp entirely within the q axis (when below it's base speed, ie not field weakened). Some reverse engineering may be possible to pull that mapping from within the OEM controller.....﻿


----------



## jackbauer (Jan 12, 2008)

My Lebowski Brain is insane :
https://youtu.be/iXtxKEMw0uI


----------



## arber333 (Dec 13, 2010)

jackbauer said:


> My Lebowski Brain is insane :
> https://youtu.be/iXtxKEMw0uI


Hm... i think its having trouble finding motor offset position so magnetic vector would actually work to turn the shaft. I think what you are doing now its feeding it 90° vector. You should setup offset option in software.
It is a good experiment though... now you know what it will sound like .


----------



## jackbauer (Jan 12, 2008)

Just got it spinning. New video on the way


----------



## jackbauer (Jan 12, 2008)

We have ignition : https://youtu.be/k1_OjpYzYFg


----------



## tylerwatts (Feb 9, 2012)

Well done. Interesting motor that, bit of an odd ball with that phase control you need. Hope you get it figured out.


----------



## jackbauer (Jan 12, 2008)

Running in full sensored mode :
https://www.youtube.com/watch?v=TH14ry6TOy8


----------



## jhuebner (Apr 30, 2010)

Wow, thats real smooth!

This large resolver board gets me thinking whether we can't interface resolvers directly. 
https://de.wikipedia.org/wiki/Resolver (only the german version has the formular on it).

angle = arctan (a/b) 

All thats missing is a ~10kHz sine generator with about 10V peak-to-peak amplitude. Shouldn't be too hard to do either.

I think I'll give it a shot


----------



## kiwifiat (Feb 3, 2009)

jhuebner said:


> Wow, thats real smooth!
> 
> This large resolver board gets me thinking whether we can't interface resolvers directly.
> https://de.wikipedia.org/wiki/Resolver (only the german version has the formular on it).
> ...


Take a look at this:

http://wiki.linuxcnc.org/cgi-bin/wiki.pl?ResolverToQuadratureConverter

I have ordered the parts and hope to get it working as the dedicated resolver to digital chips seem pretty expensive. A cheap functional solution would open up all those oem transaxles with perfectly good resolvers to conversions without the hassle of having to retrofit Hall sensors or ABZ type sensors. The arduino system above has an interupt driven loop to produce a sin wave and a second interupt driven loop to measure the sin and cos voltages on the two output coils and perform the arctan calculation and spit out rotor absolute position.


----------



## jackbauer (Jan 12, 2008)

If anyone can simplify complex motor control stuff it's Johannes


----------



## arber333 (Dec 13, 2010)

I ordered another encoder RMB28Ux, this time with UVW output. Like a simulation of hall sensors. It has to be choosen according to motor pole pairs. I will also try leaf motor with Lebowski brain. 

https://www.rls.si/en/rmb28-rotary-magnetic-module

EDIT: I had to order again, since correct P/N is RMF44UD12BA12 since RMB28 becomes RMF44 when mounted on alu plate.


----------



## jackbauer (Jan 12, 2008)

Sooo....now that we can run the i3 motor. Next question is can we run the i3 rex generator to crank over the engine?


----------



## jhuebner (Apr 30, 2010)

jackbauer said:


> If anyone can simplify complex motor control stuff it's Johannes


Thanks dude (should be an appropriate salutation now) 

That Arduino code is perfect.

On the STM32 I can use "injected conversions". I.e. the ADC does it's usual conversions (throttle, temps etc.) and when told to do the high-priority ones it will do them and then continue normally. "Only" have to get the timing right, you have to sample at sine peak. The high sample rate should allow quasi-simultaneous sampling of sin and cos.


----------



## Thaniel (May 25, 2008)

Very interesting project. I've been eyeing an i3 Motor for a project. Will be watching.


----------



## jackbauer (Jan 12, 2008)

More updates on the way soon Not enough hours in the day.


----------



## w802kx (Nov 20, 2018)

Hi, which Tesla inverter is using this drive IC?


----------



## Jack-Lee (Mar 29, 2019)

Hello,


Is there an estimate of when or whether a DIY controller will be purchasable by you?


----------



## Kevin Sharpe (Jul 4, 2011)

Jack-Lee said:


> Is there an estimate of when or whether a DIY controller will be purchasable by you?


We've all moved to the Open Inverter forum... come and join us 

https://openinverter.org/forum/


----------



## Jack-Lee (Mar 29, 2019)

Thx for the Link.


----------



## Jack-Lee (Mar 29, 2019)

Cant find anything from this Thread in the open inverter forum... Dead?


----------



## Heikki J. (Dec 30, 2020)

I'm curious also. Been trying to find if there was any follow-up. I have an access to a fairly cheap i3 motor, inverter etc. and it would be perfect for my conversion if I only could control the motor.


----------

