My inverter PCB arrived today! Waiting for a new 980 inverter that I'm using as the donor board. Hoping to have it mostly assembled tomorrow.
If I have time, I'll try to get the thermistor and current sense blocks 3D prints designed.
Re: Tesla Model 3 Rear Drive Unit Hacking
Posted: Tue Nov 11, 2025 4:01 pm
by Jack Bauer
Volvo with the M3 moved for the first time today. Seized rear brakes were no match for throtcur 10. Initial impression is very smooth. Dave , I#m too dumb for my own good but could you remind me again of the oic command to save params to flash.
Re: Tesla Model 3 Rear Drive Unit Hacking
Posted: Tue Nov 11, 2025 4:30 pm
by davefiddes
Congratulations on getting things running.
"oic cmd save" or bonk the "Save to Flash" button on the "Device Control" page of oic-gui.
Re: Tesla Model 3 Rear Drive Unit Hacking
Posted: Thu Nov 13, 2025 11:29 am
by Jack Bauer
Sooo, I don't have any experience with driving a car with OI FOC firmware but what I can say is the V50 / M3 test vehicle that I call the T3RD is now the smoothest car I own to date. And thats just with my ham fisted attempt at tuning params that I do not understand. Sadly it's monsoon season in Ireland so not much traction just mud and burnouts in gravel.
I can make it trip desat by either A)maxing out all the kp params or B)slamming it into reverse at over 6k rpm.
Driveshafts are holding out so far.
Re: Tesla Model 3 Rear Drive Unit Hacking
Posted: Thu Nov 13, 2025 12:41 pm
by Jack Bauer
Ok, first real world data. This was captured while pulling uphill with the handbrake locking the rear wheels and foot to the floor. Front tyres were periodically breaking loose on the gravel and spinning up to roughly 3600rpm. No feild weakening used.
Re: Tesla Model 3 Rear Drive Unit Hacking
Posted: Thu Nov 13, 2025 1:10 pm
by Jack Bauer
Scratch that. I had fmax set too low. Actual base speed around 4500rpm at 350v.
Re: Tesla Model 3 Rear Drive Unit Hacking
Posted: Thu Nov 13, 2025 1:44 pm
by Jack Bauer
Current parameter load. Still no field weakening.
Re: Tesla Model 3 Rear Drive Unit Hacking
Posted: Thu Nov 13, 2025 6:40 pm
by davefiddes
A parts order arrived. I've fitted my STGAP1BS gate drivers (not the STGAP1AS Tesla fit). They seem to be working fine so far and report no faults. I've not put HV on them yet though.
I've also got a set of hall-effect current sensors but haven't fitted them just yet either.
Re: Tesla Model 3 Rear Drive Unit Hacking
Posted: Fri Nov 14, 2025 9:32 am
by Jack Bauer
I think someone is looking at 3d printing the current sensor block so if we can find the same or similar ferrite ring would be one less thing to remove. Last unobtanium is the 30 way pin header.
Re: Tesla Model 3 Rear Drive Unit Hacking
Posted: Fri Nov 14, 2025 6:31 pm
by outlandnish
Just waiting on some temperature sensors, but it has passed all the power up tests so far!
When I pulled out the 30 pin header, I used spare aluminum bus bars to block of the rest of the PCB from damage from the blow torch. A bit overkill, but it worked. I saw another technique on YouTube where someone used a bit of copper wire as a bus bar between the pins to distribute the heat without damaging a plastic housing. Worth trying if someone wants to experiment!
I also inquired with Molex about designing a custom 30 pin header an am waiting to hear back. If anyone wants the measurements, the length of the headers are 45mm and the pitch is 2.54mm. they have a 7mm mating face (to the outer face of the black plastic), 35mm from black plastic to black plastic outer faces, and 3mm for the other mating face.
I'll get the current sensor block modeled this weekend. I pulled out one of them temp sensors from the original board and think it's pretty doable to make a 3D print. Damien, do you want a setup that matches the OEMs as close as possible or something we can adapt to the currently selected temp sensors?
Re: Tesla Model 3 Rear Drive Unit Hacking
Posted: Sat Nov 15, 2025 9:26 am
by Jack Bauer
I'd say make whatever is easy for the new sensors.
Re: Tesla Model 3 Rear Drive Unit Hacking
Posted: Sun Nov 16, 2025 12:52 pm
by Jack Bauer
Re: Tesla Model 3 Rear Drive Unit Hacking
Posted: Sun Nov 16, 2025 1:53 pm
by Jack Bauer
So as usual it turns out i'm a class 2 moron. Johannes spotted that my rotor direction and selected direction were not the same. Adding 32768 to syncofs fixed that. Then I could add the correct lqminusld and flux linkage values for the rear motor and its burnout time again but this time pegging out the V50's tach at 8krpm. Attached is a parameter set and a snapshot of params during a burnout.
I've just pushed support for the motor temp sensor. Managed to temperature cycle it between 0 degrees and 100 degrees and got a nice fit to get the Steinhart-Hart coefficients.
To use it just set snsm to "TeslaM3" (ditto snshs):
Note: The option is TelsaM3 for both sensors but they are different types of sensors. The inverter picks the correct device for the heatsink or motor as required.
Re: Tesla Model 3 Rear Drive Unit Hacking
Posted: Sun Nov 16, 2025 8:52 pm
by nathaniel
My inverter is now neatly assembled, with working temperature sensors. but I really can't find the Tesla wiring harness anywhere anymore so I had to order a new one, which is on its way so in the meantime I've been doing something else.
maybe a bit late but since the holes don't align everywhere and I have a 3D scanner I might be able to contribute to the project. So I made a scan and based on that created a step and dxf file, maybe it's useful. I will also add the 3D scan mesh (if possible with the file size) for those who are interested.
Hopefully the wiring harness will arrive soon and I can get my motor running too
FYI, this scan is of a 3D3 front motor PCB with IGBT drivers. This PCB has the pyro for the motor phases on the side screen to be able to break. So, the current sensor is the same as the "older" model, but the middle screw is simply missing because that's where the pyro is.
Re: Tesla Model 3 Rear Drive Unit Hacking
Posted: Mon Nov 17, 2025 6:41 am
by Jack Bauer
Thank you Dave and nathaniel. It's funny how this simple board made possible by the kindness of (mostly) strangers and stuffed into a 500 euro car in a cow shed in the south of Ireland has caused so many to become animated. Relax please. I'm a threat to nobody.
Re: Tesla Model 3 Rear Drive Unit Hacking
Posted: Mon Nov 17, 2025 12:08 pm
by Jack Bauer
Dave, some drive units don't have a motor temp sensor at all. Could there be an option to use the oil temp from the pump?
Re: Tesla Model 3 Rear Drive Unit Hacking
Posted: Mon Nov 17, 2025 1:02 pm
by davefiddes
I could add an OilTemp option to snsm that would copy the tmpoil value into tmpm. This would be passed on to others va the default CAN map on ID 0x190.
Internally the only thing we use tmpm for is derating the throttle (in association with tmpmmax). We probably also need to add a tmpoilmax param and derate the throttle with that for all drive units.
Relatedly, one of the last bits of work I can see is coming up with a better control strategy for the oil pump than a fixed speed. It seems to me it needs to be a function of the motor speed and oil and motor temperatures. Perhaps we need to get units into vehicles and get some data logs to see how it behaves.
Edit: Quick tip for grabbing a log of what is happening when testing:
Look at the results in LibreOffice Calc, Excel, etc
Re: Tesla Model 3 Rear Drive Unit Hacking
Posted: Tue Nov 18, 2025 12:01 am
by outlandnish
Here's the OEM to OpenInverter pin mapping if anyone needs it:
Pin 1 is the lower right from the outside of the inverter and the lower left of the housing facing towards the PCB.
Pins are ascending in each column - the bottoms pins are Pin 1 / Pin 11 / Pin 21
Got everything setup but unfortunately I'm getting two errors on my Phase C Hi Gate Driver: REGERRR | REGERRL that I'm currently investigating
Re: Tesla Model 3 Rear Drive Unit Hacking
Posted: Tue Nov 18, 2025 9:48 am
by Jack Bauer
That's a brilliant diagram. I have added it to the Github repo. The Reg errors are likely caused by a short dropping the Phase C hi isolated power rail. it wont cause any harm as each supply has its own current limiter.
Re: Tesla Model 3 Rear Drive Unit Hacking
Posted: Tue Nov 18, 2025 4:04 pm
by outlandnish
Jack Bauer wrote: ↑Tue Nov 18, 2025 9:48 am
That's a brilliant diagram. I have added it to the Github repo. The Reg errors are likely caused by a short dropping the Phase C hi isolated power rail. it wont cause any harm as each supply has its own current limiter.
Thanks! I've updated the diagram in that post to account for a couple more OEM pin mappings.
As for the reg errors, I've removed the board again and desoldered the MOSFETs for Phase C entirely and then lifted the Phase C hi gate driver and and re-soldered it on. I'm still getting those errors. Any chance it might just be a faulty gate driver? Or should I be looking at other parts of the circuit for Phase C Hi?
Re: Tesla Model 3 Rear Drive Unit Hacking
Posted: Tue Nov 18, 2025 6:06 pm
by davefiddes
Did you check the board was working before soldering it to the inverter chassis & mosfets? I would recommend bench testing with just 12V and CAN. The inverter should come up and report that the gate drivers are all OK. It doesn't need the big mosfets to function. You shouldn't need to dismount to debug though.
The REGERRR and REGERRL errors are the sort of thing I have seen when the gate drive PSU is turned off. It would be worth double checking the gate drive PSU for each phase in turn. You do this with TP6/TP7/TP8 for phase A, TP9/TP10/TP11 for phase C and TP12/TP13/TP14 for phase B. I measured 12.7V for the positive supply and -5.1V for the negative supply for each phase. This matches Damien's video I think.
If the phase C PSU is not working it may have current limited as Damien explained. You might have to desolder the relevant STGAP1AS to see if it is a PSU problem or a gate driver chip problem. I found access around the "hot" side of the gate drivers to be quite fiddly. I can imagine it being really easy to end up with a short or nudging one of the many passives.
Re: Tesla Model 3 Rear Drive Unit Hacking
Posted: Tue Nov 18, 2025 6:23 pm
by Jack Bauer
Running the latest build in the V50 now from Dave's github. All temps reporting correctly.
In general, do please follow the procedure in the video. I know it's tempting to skip parts when you want to see a result , I know that all too well but it almost never works out to be quicker.