Sorry for the late update folks. Been down with a stomach bug. But hey , its been 5 years so whats another week. Anyway, before running any real power through the inverter I decided to scope the gate-source waveforms just in case. High sides looked fie but all THREE lowsides showed this sort of a weird ground bounce effect of the other 2 low sides switching. Did dome probing around and narrowed into the "56Ohm" source resistors. Hmmm. Guess what? They are not 56 Ohms on the OEM board.... rather 0.56Ohms!!!
Got the right ones ordered but still feeling very happy about progress on this 1st prototype.
Re: Tesla Model 3 Rear Drive Unit Hacking
Posted: Mon May 26, 2025 10:44 am
by johu
Nicely caught in time!
Re: Tesla Model 3 Rear Drive Unit Hacking
Posted: Wed May 28, 2025 1:18 pm
by Jack Bauer
Just a model 3 inverter with an OI board running a model 3 motor.... nothing interesting:)
Re: Tesla Model 3 Rear Drive Unit Hacking
Posted: Wed May 28, 2025 5:17 pm
by Jack Bauer
For those interested current V2 board schematic. Not finalised yet but has corrections from V1 and now all component values and types populated. Basically the current board minus the bodges:)
Re: Tesla Model 3 Rear Drive Unit Hacking
Posted: Thu May 29, 2025 4:58 pm
by Jack Bauer
Re: Tesla Model 3 Rear Drive Unit Hacking
Posted: Fri Jun 06, 2025 3:50 pm
by Beatbuzzer
Do you have any thoughts about the sort of pyrofuse, placed in the newer rear inverters? Would you transfer it to your design or remove it? I mean, it simply goes away by removing the pcb Only attached with two screws in the frame of the hall sensor.
Seems its not only placed in plaid, but also in Model 3 long range and standard range from 2022. My rear inverter is a 3D5 from 2022 and has it.
I'm in a little research at the moment. There is an additional circuit on the right side of the pcb. Connection of the squib is wired in parallel to the two bigger 499R resistors.
Re: Tesla Model 3 Rear Drive Unit Hacking
Posted: Mon Jun 23, 2025 12:11 pm
by davefiddes
Managed to get my JTAG connection working again so I can make some improvements to the Tesla M3 gate driver support:
So far I've included the various fixes from above and a new version of the gate driver class. This has a correctness fix in the initialisation verification process. It also pipelines SPI requests when polling the status which makes it substantially more efficient. Both changes more accurately reflect the behaviour of the original Tesla firmware.
I'm planning on parsing out the gate driver failures and reporting them as spot values shortly.
Re: Tesla Model 3 Rear Drive Unit Hacking
Posted: Tue Jun 24, 2025 6:26 am
by Jack Bauer
Thats excellent Dave. Thanks. I've been cleaning up the board and getting ready to order V2. By the time it arrives I'll have the Volvo V50 test mule in the barn and ready for full up tests.
Re: Tesla Model 3 Rear Drive Unit Hacking
Posted: Sun Jun 29, 2025 2:34 pm
by davefiddes
Meanwhile in Open Source development... I have finished making the updates to the Tesla M3 gate driver support code to pull out the detailed fault information:
@crasbe was absolutely correct in their analysis as to the order in which replies are received from the gate driver SPI chain. My new code now pulls out the details of any fault on a chip by chip basis. If you are having a good day it looks like this:
It's probably bolting the door after the horse has departed but hopefully it'll be helpful should anything go wrong. Some of the errors it can report I don't think will ever be reported (ASC and SENSE) but better to have the decoding in there than be left in the dark if something weird happens.
Thanks Dave. I'll get this in the board. Should have the V50 ready for tests this week. So far I once accidently (and once on purpose) shorted two phases with a screwdriver during low voltage bench tests. Trips off the inverter and restarts no problem.
Re: Tesla Model 3 Rear Drive Unit Hacking
Posted: Wed Jul 02, 2025 6:39 pm
by Jack Bauer
V50 is in the barn at last. Will setup for a closed loop spin in the next few days.
Re: Tesla Model 3 Rear Drive Unit Hacking
Posted: Wed Jul 16, 2025 2:49 pm
by Jack Bauer
Little sneak peek. VCU is now reasonably emulating the V50 ECM and keeping the car side happy. Forwards mode control to the M3 inverter via can. Throttle comes next.
Re: Tesla Model 3 Rear Drive Unit Hacking
Posted: Thu Jul 17, 2025 12:41 pm
by Jack Bauer
So moving into FOC firmware now to commence tuning. The new gate driver error routine from Dave works well. A 100ms delay is required on startup between starting up the gate driver isolated side psu and running the init routine.
Re: Tesla Model 3 Rear Drive Unit Hacking
Posted: Thu Jul 17, 2025 12:58 pm
by davefiddes
I wished I had built the error reporting from the beginning. It makes debugging so much easier. Good to see it behaving similar on your board to the Tesla board.
Re: Tesla Model 3 Rear Drive Unit Hacking
Posted: Thu Jul 17, 2025 1:22 pm
by Jack Bauer
Yeah its super handy thanks Dave. I increased the delay between psu enable and gate driver init to 200ms as the od time one driver would give an init fault. Resolver feedback is now working on the board.
Re: Tesla Model 3 Rear Drive Unit Hacking
Posted: Thu Jul 17, 2025 1:44 pm
by Jack Bauer
So one things that needs addressing is the resolver vs pwm frequency. As we dont know what pwm frequency Tesla use (perhaps the chap with the board running vai can could measure?) I've been running with 8.8khz. Problem is this creates by default a 4.4khz exciter which is too low. Tesla use 10khz. Johannes gave me a workaround hack that fixes the software to 8.8khz pwm and resolver but this will need to be implementd properly if this crazy board project actually works.
Re: Tesla Model 3 Rear Drive Unit Hacking
Posted: Fri Jul 18, 2025 5:08 pm
by Jack Bauer
Does anyone have a part number or source for the coolant quick connectors on the M3 Drive unit?
Re: Tesla Model 3 Rear Drive Unit Hacking
Posted: Fri Jul 18, 2025 6:24 pm
by Davidk
Jack Bauer wrote: ↑Fri Jul 18, 2025 5:08 pm
Does anyone have a part number or source for the coolant quick connectors on the M3 Drive unit?
Generally we have 4 connectors on drive unit, 2 on heat exchanger and 2 on inverter manifold.
Heat exchanger - Aluminium, internal diameter 18mm no any marks
Inverter manifold - plastic, internal diameter 18mm, Tesla part numbers 1102191-00-b (straight) and 1102194-00-0 (45 degree angle).
Connectors are "VDA NW18", I dont have cooling hoses so can not check manufacturer of female connector(s) used by Tesla.
From Internet i was able to find few companies making these connectors:
From what i can find these connectors should be used also by BMW, Honda na VW So there needs to be suppliers and after market for these for sure i am maybe just using google wrongly (
Edit:
I was able to find identification of connector on internet, FIP NW18-90 PA66. This is not bringing any details at all. From part number we can be sure that it is not tesla part as it doesnt follow tesla usual part numbers. After some googling i suspect that FIP means FRÄNKISCHE Industrial Pipes (https://www.fraenkische-ip.com/en/produ ... automotive) but there is minimal info on their page and also no supplier (
Re: Tesla Model 3 Rear Drive Unit Hacking
Posted: Sat Jul 19, 2025 5:59 pm
by davefiddes
Jack Bauer wrote: ↑Thu Jul 17, 2025 1:44 pm
So one things that needs addressing is the resolver vs pwm frequency.
It has been my understanding that Tesla run 10kHz PWM and that this is synchronous with the resolver. A quick sanity check with some YouTube videos of people running M3 drive units on the bench seems to show a clear peak at 10kHz when analysed in Audacity. Somebody will no doubt prove me wrong at this point...
The C2000 really wants to have all it's PWM and ADC slaved off a single PWM module. I'm sure I've not done things the way that Tesla have but things work quite nicely for me with the following clock-synchronisation chains:
EPWM1 -> EPWM4 -> EPWM5 -> EPWM6
EPWM1 -> EPWM4 -> EPWM7
EPWM1 is the master clock in this case. To keep the fixed-point maths from stm32-sine working I have to run at 12.207 kHz. The resolver works fine at this frequency but it has a lower response than at 10kHz. 8.8kHz is similarly reduced response but it tails off very quickly as you have discovered.
EPWM4 inserts a phase delay to pick the optimum sample time for the resolver which is affected by the analogue filtering Tesla use. This is also when the phase currents are sampled at theoretically the optimum time (the centre point of the PWM cycle). The main PWM outputs are EPWM5, 6 and 7 which are all high-resolution units.
FWIW.
Re: Tesla Model 3 Rear Drive Unit Hacking
Posted: Sun Jul 20, 2025 8:44 am
by Jack Bauer
Thanks Dave. 10KHz pwm makes sense. Hope to be turning wheels in the car in the next few days.