Tesla Model 3

Topics concerning the Tesla front and rear drive unit drop-in board
User avatar
Kevin Sharpe
Posts: 1345
Joined: Fri Dec 14, 2018 9:24 pm
Location: Ireland and US
Been thanked: 8 times

Tesla Model 3

Post by Kevin Sharpe »

Several people who use the Open Source inverter are bidding on Model 3 parts and it's only a matter of time before we need to repeat the Tesla inverter magic once again :D

I thought it would be helpful to start a place holder for useful information. I'll start with a link to a 30 page thread on the Model 3 Owners Club which has lots useful information including a DBC file for the car :)

Diagnostic Port and Data Access
This is a personal post and I disclaim all responsibility for any loss or damage which any person may suffer from reliance on the information and material in this post or any opinion, conclusion or recommendation in the information and material.
User avatar
Jack Bauer
Posts: 3638
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 9 times
Been thanked: 272 times
Contact:

Re: Tesla Model 3

Post by Jack Bauer »

I was never any good at keeping a secret. Probably why I like opensource so much :)

To date I have refused two offers of Model 3 drive units as the parties involved wanted me to keep everything under wraps with no sunset clause. I have no problem doing non open work but something like the M3 needs to be made available to people if we are to have any hope of making any impact on the transition to clean transport.

Now the interesting challenge of the 3 is the inverter is a single pcb. This video shows it in quite clear detail :


So no logic board? I guess we'll just have to use CAN messages right. Nope:) As Jack Rickard recently found out Tesla can just shutoff CAN messages at will as soon as someone cracks their content. This is the excuse most of the closed people use for keeping their work under wraps. So anyway what are we going to do? Design a logic board of course but not in the way you will have seen in the past. This baby is 100% Hübner:) Here is a little teaser pic. But Damien how can you hack the drive unit if you don't have a drive unit? The answer is in the question. Expect the V1 board in a few weeks.
Attachments
2019-03-17 14.11.41.jpg
I'm going to need a hacksaw
User avatar
johu
Site Admin
Posts: 6618
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 342 times
Been thanked: 1485 times
Contact:

Re: Tesla Model 3

Post by johu »

Wow. I mean double wow. One for your open source commitment, another one for this inverter layout. Had somebody suggested to me they will build a 200kW inverter in that package I would have smiled at them. And now Tesla did it. Is the bus cap really just 68µF? Even 2x68µ would be an order of magnitude less than whats usual.
Maybe for SiC fets the current max of 17.6kHz is a bit too low. It's quite easy to double it without loading the cpu anymore. The timer as the ability to fire every other PWM period instead of every period.

I'm really excited to see what you're gonna do to it :D
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
tom91
Posts: 2295
Joined: Fri Mar 01, 2019 9:15 pm
Location: Bristol
Has thanked: 199 times
Been thanked: 524 times

Re: Tesla Model 3

Post by tom91 »

Are you going to try and just replace the main IC with an adaptor board?

Just like Wolf Tronix? https://www.youtube.com/watch?v=P1QZ0an4qf0
Creator of SimpBMS
Founder Volt Influx https://www.voltinflux.com/
Webstore: https://citini.com/
User avatar
Jack Bauer
Posts: 3638
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 9 times
Been thanked: 272 times
Contact:

Re: Tesla Model 3

Post by Jack Bauer »

Thanks Johannes :)

Tom wins the prize:) Won't be quite as straightforward but Elon made the approach possible on the 3 as they no longer use a separate FPGA for reading the sigma delta current sensors and hardware shutdowns. The TI C2000 device also has the very same pitch as the STM32F103 just in a larger 177pin package. We can even use the built in JTAG header 8-)
I'm going to need a hacksaw
User avatar
Jack Bauer
Posts: 3638
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 9 times
Been thanked: 272 times
Contact:

Re: Tesla Model 3

Post by Jack Bauer »

oh yeah one other thing Johannes, this is a reluctance motor so will be a new challenge:)
I'm going to need a hacksaw
nailgg
Posts: 119
Joined: Sat Dec 22, 2018 8:40 pm

Re: Tesla Model 3

Post by nailgg »

That looks exciting :)

But I really wonder how efficient a switched reluctance motor can be controlled using Huebner's current software. I'm no expert in SRM drives but as far as I know the biggest challenge in those drives is the huge torque ripple due to the constantly changing air-gap, and the resulting audible noise. Advanced techniques are being developed to overcome those and phase current detection is very important. Also, SRM drives are mainly not constructed in the conventional full bridge inverter structure, but instead, asymmetric bridge. Before going into too much work, have you checked these points @Jack Bauer? :)
User avatar
tom91
Posts: 2295
Joined: Fri Mar 01, 2019 9:15 pm
Location: Bristol
Has thanked: 199 times
Been thanked: 524 times

Re: Tesla Model 3

Post by tom91 »

Sweet, Do you have a quick visual to show how much area is between the two chips? BTW 177 is wierd number of pins, do you not mean 176?

Wonder how many layers you will need to route this puppy.

On the motor subject, are they not some sort of hybrid? Interior permanent magnet utilising some form of reluctance too?
Creator of SimpBMS
Founder Volt Influx https://www.voltinflux.com/
Webstore: https://citini.com/
User avatar
johu
Site Admin
Posts: 6618
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 342 times
Been thanked: 1485 times
Contact:

Re: Tesla Model 3

Post by johu »

Where does the switched reluctance info come from?
In a recent German magazine "elektro auto mobil" they stated that the rumors about a switched reluctance motor in Model 3 were false and that it uses a regular IPM motor. Like Leaf, Golf and all the others. That also has a reluctance component in its torque equation.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
nailgg
Posts: 119
Joined: Sat Dec 22, 2018 8:40 pm

Re: Tesla Model 3

Post by nailgg »

johu wrote: Sun Mar 17, 2019 11:05 pm Where does the switched reluctance info come from?
In a recent German magazine "elektro auto mobil" they stated that the rumors about a switched reluctance motor in Model 3 were false and that it uses a regular IPM motor. Like Leaf, Golf and all the others. That also has a reluctance component in its torque equation.
I’m on mobile and can’t post links but Wikipedia says that they are using PM assisted switched reluctance motors. Adding PMs to the rotor increases the torque capability and the power factor since there’s no current excitation in the rotors of the regular SRMs. My guess is that thanks to the PM assistance the motor control (and overcoming the issues with torque ripple) becomes easier.
User avatar
johu
Site Admin
Posts: 6618
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 342 times
Been thanked: 1485 times
Contact:

Re: Tesla Model 3

Post by johu »

Thanks, found it. On German wiki it says "PMSM with increased reluctance component" and in English its "permanent magnet switched reluctance". A bit of a difference.
Elon says: https://twitter.com/elonmusk/status/998 ... 08448?s=19

I think it still means 3-phase sine excitation and the challenge is to find the right offset angle.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
nailgg
Posts: 119
Joined: Sat Dec 22, 2018 8:40 pm

Re: Tesla Model 3

Post by nailgg »

While it might be possible, it’s probably not the best way to drive an SRM. Without a current feedback in the controller at least.

Here’s a nice paper: https://opencommons.uconn.edu/cgi/viewc ... ors_theses

Is says:
The control of the SRM is extremely important. The coil must be turned off right before the teeth are aligned to avoid the holding perpendicular torque. Not only is the position monitored for smooth operation, but the current within the winding must also be controlled. The current within the winding must be completely drained in order for the torque to go to zero. The time constant for the coil is measured and fed back into the controls to ensure the current is dissipated before the tooth is aligned.

Here’s another thesis: http://vbn.aau.dk/files/58639437/PhD_Th ... kobsen.pdf

And it says
Torque in a switched reluctance motor is produced by pulses of phase current synchronized with the rotor position[23]. A pulse of the phase current is sometimes also called a stroke. Torque is controlled by controlling the current shape and timing of these phase current pulses. At low speed the torque can be controlled by chopping, at higher speeds torque is controlled by changing the timing for when to turn on and turn off phase current. Ideally the torque would be controlled with a simple linear relationship between torque and current. This may not always be the case for the switched reluctance motor, where the torque may also be influenced by rotor speed, and a non-linear relationship exist between torque and current.

So instead of a sine wave, current pulses need to be sent to the windings, timings are extremely important, is’s also vital to detect the phase currents. Without caring these too much, one might still spin the SRM, but the motor would probably be too noisy and spin jerky.
User avatar
Jack Bauer
Posts: 3638
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 9 times
Been thanked: 272 times
Contact:

Re: Tesla Model 3

Post by Jack Bauer »

I'll leave the motor magic to Johannes. What I do know from experience however is that Tesla tends to do things the easy way. I recall being told how utterly impossible it would be to get the Gen 2 charger to run :twisted:

Should only need a 4 layer board with a little trick from season 1 of Halt and catch fire :)
I'm going to need a hacksaw
nailgg
Posts: 119
Joined: Sat Dec 22, 2018 8:40 pm

Re: Tesla Model 3

Post by nailgg »

I'm pretty sure with enough work Johannes can easily do the motor magic. However, windings in an SRM are not terminated at a common neutral point, thus measuring two currents doesn't give you the third phase current. If Johannes realizes the SRM controller with current feedback approach, you might need to add a third phase ADC input to the controller you are currently designing.

TI's C2000 devices have the one of the best ADC modules out there. Their ADCs are extremely fast and the main control loop interrupt is tied to the ADC sampling interrupt instead of PWM interrupt. Johannes might still execute the control loop on the PWM interrupt but he might add a third current ADC input.

I think it would be best if we can learn more about the Tesla 3 motor. If Tesla drives this motor just like an IPM, we might be overthinking these stuff :)
User avatar
johu
Site Admin
Posts: 6618
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 342 times
Been thanked: 1485 times
Contact:

Re: Tesla Model 3

Post by johu »

Yes according to the wording on the German wiki (and the magazine I read) it IS an IPM just with a higher reluctance component. Maybe they put dents in the rotor, I don't know. So I don't think it qualifies as an actual switched reluctance motor with all its weirdness :D
I believe increasing the reluctance component makes the IPM more efficient at high speeds. I have no sources for that currently.

Oh did you realize that the front motor of Model 3 is still induction?

EDIT: the Tesla inverter in the video Damien posted only has 2 current sensors
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
nailgg
Posts: 119
Joined: Sat Dec 22, 2018 8:40 pm

Re: Tesla Model 3

Post by nailgg »

Nice point, so two current sensors probably means it can be driven just like the Leaf :) Only need to find the correct angle offset.

I really wonder what the front drive inverter for the induction motor of the Model 3 looks like, whether it's also based on SiC components and a slim case like this one, or just regular IGBTs like they used before.
User avatar
Jack Bauer
Posts: 3638
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 9 times
Been thanked: 272 times
Contact:

Re: Tesla Model 3

Post by Jack Bauer »

Tom, the 177th pin is the big ground/cooling pad in the middle. They are using hall current sensors not sigma delta so that makes life a little easier. Good news is I have just enough info to make a stab at the design and it's more of a challenge reverse engineering something without it being in front of me :)
I'm going to need a hacksaw
User avatar
tom91
Posts: 2295
Joined: Fri Mar 01, 2019 9:15 pm
Location: Bristol
Has thanked: 199 times
Been thanked: 524 times

Re: Tesla Model 3

Post by tom91 »

Are you working of very detailed pictures?

i hope they did not hide any important things on the back side.

4 layer should be cool, does the STM chip come with software pin definition?
Creator of SimpBMS
Founder Volt Influx https://www.voltinflux.com/
Webstore: https://citini.com/
User avatar
Jack Bauer
Posts: 3638
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 9 times
Been thanked: 272 times
Contact:

Re: Tesla Model 3

Post by Jack Bauer »

No such luck Tom would need an FPGA for that:)

So started laying out a simple pcb today for what I call my Model 3 simulator. Just a little 4 inch square board with the C2000 footprint with power and grounds and some leds and switches to simulate I/O. I'll get this pro built by my board builder to as closely simulate the drive unit pcb. Lead free solder, conformal coating (aka Musk Goo) the works. Then we'll see how I get on removing the C2000 and fitting the V1 logic board. Might take a few goes to find the best way but better to mess up a few 5 euro boards than a M3 drive unit:)
I'm going to need a hacksaw
User avatar
tom91
Posts: 2295
Joined: Fri Mar 01, 2019 9:15 pm
Location: Bristol
Has thanked: 199 times
Been thanked: 524 times

Re: Tesla Model 3

Post by tom91 »

Smart thing to do. I messed up a pcb myself yesterday, a charger board that had been coated.

Once any pcb is coated best not to try and modify it. But where is the fun in that.

Having used the Model 3 wiring diagram shared on this forum, I have quickly compiled a drive unit pinout for the connector.

They use a Resolver on the motor now.
Attachments
Model 3 inverter connector.ods
(3.53 KiB) Downloaded 467 times
Creator of SimpBMS
Founder Volt Influx https://www.voltinflux.com/
Webstore: https://citini.com/
nailgg
Posts: 119
Joined: Sat Dec 22, 2018 8:40 pm

Re: Tesla Model 3

Post by nailgg »

Jack Bauer wrote: Thu Mar 21, 2019 7:17 pm So started laying out a simple pcb today for what I call my Model 3 simulator. Just a little 4 inch square board with the C2000 footprint with power and grounds and some leds and switches to simulate I/O. I'll get this pro built by my board builder to as closely simulate the drive unit pcb. Lead free solder, conformal coating (aka Musk Goo) the works. Then we'll see how I get on removing the C2000 and fitting the V1 logic board. Might take a few goes to find the best way but better to mess up a few 5 euro boards than a M3 drive unit:)

C2000 series have so many ePWM pins muxed with other peripherals. I have worked with a TMS320F28377S before which had 12 complementary ePWM outputs (24 pins in total). Only 3 of them are used for controlling the motor, though. So you're saying you don't have the original board in front of you, how can you make sure which ePWM pins are routed to the gate drivers? :)
User avatar
Jack Bauer
Posts: 3638
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 9 times
Been thanked: 272 times
Contact:

Re: Tesla Model 3

Post by Jack Bauer »

I'm afraid that's classified:)
I'm going to need a hacksaw
nailgg
Posts: 119
Joined: Sat Dec 22, 2018 8:40 pm

Re: Tesla Model 3

Post by nailgg »

Jack Bauer wrote: Thu Mar 21, 2019 8:38 pm I'm afraid that's classified:)

Wow :) Ok then, let me guess: The guys who offered you to reverse engineer the Model 3 inverter X-rayed the PCB :P
User avatar
Jack Bauer
Posts: 3638
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 9 times
Been thanked: 272 times
Contact:

Re: Tesla Model 3

Post by Jack Bauer »

Making progress.
Attachments
2019-03-22 13.51.06.jpg
I'm going to need a hacksaw
User avatar
Jack Bauer
Posts: 3638
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 9 times
Been thanked: 272 times
Contact:

Re: Tesla Model 3

Post by Jack Bauer »

Boards ordered:)
I'm going to need a hacksaw
Post Reply