Model 3 High Voltage Controller

Topics concerning the Tesla front and rear drive unit drop-in board
bielec
Posts: 37
Joined: Tue Apr 19, 2022 12:17 pm
Location: Aberdeenshire
Has thanked: 1 time
Been thanked: 12 times

Re: Model 3 High Voltage Controller

Post by bielec »

EDIT *** I later found that the 0x2D1 made no difference and that the Regen power decayed back to zero ***
*** it looks like the extra 0x221 does cause increased discharge current capacity though ! ***

I have managed to get HV_UP_FOR_DRIVE together with Regen power of 85Kw
I did this by sending two additional messages compared with my original sketch above. These were....
0x2D1 FF 00
0x221 61 15 01 00 00 00 20 BA

Note that these were in addition to my original 0x221 message, so three messages in all.

The HV_UP_FOR_DRIVE state seemed to latch permanently on so the contactors remained closed even with no data being sent. I removed 12v power to disconnect.

If the 0x2D1 message is omitted then the Regen power drops.
Similarly, if the two new messages are sent alone then it doesn't work either.
The frame transmission rate is important. It needs to be fairly fast.
This is all by trial and error and I have no idea of why but this is what I observe. Hopefully useful to others. I did this on the "send" option of Savvycan and have yet to include it in my own code. That will be the next step and I expect some timing issues when I do.
Nam
Posts: 4
Joined: Sat Nov 05, 2022 7:53 pm

Re: Model 3 High Voltage Controller

Post by Nam »

This is really interesting. I enjoy reading your message over several pages.
I have different application where I try to connect the complete car including all ECU and PCB. Trying to manipulate the CAN message. For frame transmittion rate, I used Savvycann with 0x221 30ms update rate and notice the update rate of Tesla every 10ms. I tune the Savvycann to 10ms and manage to clear the charge stage fault to green.

But Savvycan shutdown after a while due to over flow. Do you know if Arduino MCP2515 can bus survive the message with 10ms?
image.png
image.png
I have issue with SOC 0% even if I measured the voltage 340VDC. That is probably due to the brick voltage per cell is below the low level because I use SR battery for the LR car.

BR; Nam
PE22
Posts: 6
Joined: Tue Nov 29, 2022 3:51 pm
Has thanked: 6 times

Re: Model 3 High Voltage Controller

Post by PE22 »

parallaxengineering wrote: Fri Oct 28, 2022 12:40 am Hey guys, thanks to everyone in this thread with the useful information. I was able to get my model3 battery to close contactors with all the information in this thread. My question now is, what are the current limits of "HV_UP"? Presumably this state is only used to recharge the 12V battery via the DCDC and maybe also for heating the cabin, so it must be current limited. Has anyone had success in getting the battery into "HV_UP_FOR_DRIVE"? There we will have the full power potential.
I am trying to close the contactors of the TESLA Model 3 Version 2019 with a single motor. I tried the suggestions in this thread, but I was not able to close the contactors.
Could you please let me know what exactly you did to close the contactors?
parallaxengineering
Posts: 8
Joined: Tue Oct 25, 2022 4:18 pm
Been thanked: 2 times

Re: Model 3 High Voltage Controller

Post by parallaxengineering »

PE22 wrote: Tue Nov 29, 2022 3:58 pm I am trying to close the contactors of the TESLA Model 3 Version 2019 with a single motor. I tried the suggestions in this thread, but I was not able to close the contactors.
Could you please let me know what exactly you did to close the contactors?
You might be having trouble with the 2019 version as I believe that requires a different CAN message to close contactors. THe main thing to clos contactors are:
1) Have 12V on the necessary pins
2) Have VCFRONT messages firing on the CAN bus
3) Ensure that HVIL loop is fulfilled both in the logic connector as well as all the HV connectors under the pack.
4) Ensure that you have capacitance on HV bus if you are not connected to a drive unit
parallaxengineering
Posts: 8
Joined: Tue Oct 25, 2022 4:18 pm
Been thanked: 2 times

Re: Model 3 High Voltage Controller

Post by parallaxengineering »

bielec wrote: Sun Nov 13, 2022 5:27 pm Curiosity got the better of me and I tried sending 0x2D1 with FF 02 alongside the message 0x221 to close the contactors. It made no difference. The contactors closed but I still got HV_UP and the regen power stayed at zero. So there is a little more to this.
Bummer... Yes I have tried charging my pack at 25A in the "HV_UP" state and actually causing the contactors to open. I haven't yet got a log of what is going on but I believe the pack is not happy with "high" charge current in this state. I can charge at 16A just fine but when I bump up to 25A after a minute or two the contactors open.
parallaxengineering
Posts: 8
Joined: Tue Oct 25, 2022 4:18 pm
Been thanked: 2 times

Re: Model 3 High Voltage Controller

Post by parallaxengineering »

bielec wrote: Mon Nov 14, 2022 1:33 pm I have managed to get HV_UP_FOR_DRIVE together with Regen power of 85Kw
I did this by sending two additional messages compared with my original sketch above. These were....
0x2D1 FF 00
0x221 61 15 01 00 00 00 20 BA

Note that these were in addition to my original 0x221 message, so three messages in all.

The HV_UP_FOR_DRIVE state seemed to latch permanently on so the contactors remained closed even with no data being sent. I removed 12v power to disconnect.

If the 0x2D1 message is omitted then the Regen power drops.
Similarly, if the two new messages are sent alone then it doesn't work either.
The frame transmission rate is important. It needs to be fairly fast.
This is all by trial and error and I have no idea of why but this is what I observe. Hopefully useful to others. I did this on the "send" option of Savvycan and have yet to include it in my own code. That will be the next step and I expect some timing issues when I do.
Fantastic work! I will be trying this and testing the charge current above 25A and see if this solves my issue. Thanks for reporting!
parallaxengineering
Posts: 8
Joined: Tue Oct 25, 2022 4:18 pm
Been thanked: 2 times

Re: Model 3 High Voltage Controller

Post by parallaxengineering »

bielec wrote: Mon Nov 14, 2022 1:33 pm I have managed to get HV_UP_FOR_DRIVE together with Regen power of 85Kw
I did this by sending two additional messages compared with my original sketch above. These were....
0x2D1 FF 00
0x221 61 15 01 00 00 00 20 BA

Note that these were in addition to my original 0x221 message, so three messages in all.

The HV_UP_FOR_DRIVE state seemed to latch permanently on so the contactors remained closed even with no data being sent. I removed 12v power to disconnect.

If the 0x2D1 message is omitted then the Regen power drops.
Similarly, if the two new messages are sent alone then it doesn't work either.
The frame transmission rate is important. It needs to be fairly fast.
This is all by trial and error and I have no idea of why but this is what I observe. Hopefully useful to others. I did this on the "send" option of Savvycan and have yet to include it in my own code. That will be the next step and I expect some timing issues when I do.
Hey, i've tried this and cant seem to get the regen power to go up from 0kW. I can get the discharge power to stabilize at around 113kW but the regen power just goes to 0kW from 80kW. Any thoughts?
parallaxengineering
Posts: 8
Joined: Tue Oct 25, 2022 4:18 pm
Been thanked: 2 times

Re: Model 3 High Voltage Controller

Post by parallaxengineering »

bielec wrote: Mon Nov 14, 2022 1:33 pm I have managed to get HV_UP_FOR_DRIVE together with Regen power of 85Kw
I did this by sending two additional messages compared with my original sketch above. These were....
0x2D1 FF 00
0x221 61 15 01 00 00 00 20 BA

Note that these were in addition to my original 0x221 message, so three messages in all.

The HV_UP_FOR_DRIVE state seemed to latch permanently on so the contactors remained closed even with no data being sent. I removed 12v power to disconnect.

If the 0x2D1 message is omitted then the Regen power drops.
Similarly, if the two new messages are sent alone then it doesn't work either.
The frame transmission rate is important. It needs to be fairly fast.
This is all by trial and error and I have no idea of why but this is what I observe. Hopefully useful to others. I did this on the "send" option of Savvycan and have yet to include it in my own code. That will be the next step and I expect some timing issues when I do.
I cannot get any combination of this to achieve 85kW regen power, it always goes to zero. Could you share your SavvyCan grid file perhaps? What timing do you have? I tried many different timing and sequences and nothing I did worked to get the regen power to anything above 0kW.

Also, regarding one of your previous messages, the sequence to power down the contactors without removing 12V matters. You must first remove the HV_UP_FOR_DRIVE 0x221 message, than after a second or so remove the original 0x221 message, that allows the contactors to open without messing with the 12V.
bielec
Posts: 37
Joined: Tue Apr 19, 2022 12:17 pm
Location: Aberdeenshire
Has thanked: 1 time
Been thanked: 12 times

Re: Model 3 High Voltage Controller

Post by bielec »

I was premature in announcing that I had got 85Kw regen power. What I got was regen power of 85Kw which then decays down to Zero over a few seconds. The 0x2D1 message seems not to be significant . It only looked like it was under certain timing conditions. I have got HV_UP_FOR_DRIVE but no regen. I have been at this for several days and feel that it has to do with combinations of message 0x221 but I cant find the combinations. I am fairly sure that msg. 0x221 is vastly under documented and it certainly contains a lot of mysteries.
bielec
Posts: 37
Joined: Tue Apr 19, 2022 12:17 pm
Location: Aberdeenshire
Has thanked: 1 time
Been thanked: 12 times

Re: Model 3 High Voltage Controller

Post by bielec »

To elaborate on the 0x221 message. I looked at various model 3 log files from the web and notice that these messages are always sent in a series of 16 each one different but repeated. Further, the group of 16 sent before POWER_UP_FOR_DRIVE is different from the group sent after. I tried sending the first group alone, both groups and the second group alone. Only when I send the second group do I see the 85Kw Regen pop up briefly, then decay to zero. The groups of 0x221 messages are different on different log files from the web. This is possibly because the cars in question are in different states, eg. driving, mains charging or supercharging? There are a whole lot of bits in the 221 message which are not described in the DBC files I have seen and these bits are actively changing in the logs so there is more decoding to be done. There is a sequence of 16 messages too which matters. The two messages I sent are enough to cause HV_UP_FOR_DRIVE but that's all. I tried sending 2, 3, 4, 5,,,, etc. up to all 16 with no joy!
Until I find the key, I am stuck with charging at 16A. Interesting that you have the same.
parallaxengineering
Posts: 8
Joined: Tue Oct 25, 2022 4:18 pm
Been thanked: 2 times

Re: Model 3 High Voltage Controller

Post by parallaxengineering »

bielec wrote: Sun Dec 11, 2022 7:50 pm To elaborate on the 0x221 message. I looked at various model 3 log files from the web and notice that these messages are always sent in a series of 16 each one different but repeated. Further, the group of 16 sent before POWER_UP_FOR_DRIVE is different from the group sent after. I tried sending the first group alone, both groups and the second group alone. Only when I send the second group do I see the 85Kw Regen pop up briefly, then decay to zero. The groups of 0x221 messages are different on different log files from the web. This is possibly because the cars in question are in different states, eg. driving, mains charging or supercharging? There are a whole lot of bits in the 221 message which are not described in the DBC files I have seen and these bits are actively changing in the logs so there is more decoding to be done. There is a sequence of 16 messages too which matters. The two messages I sent are enough to cause HV_UP_FOR_DRIVE but that's all. I tried sending 2, 3, 4, 5,,,, etc. up to all 16 with no joy!
Until I find the key, I am stuck with charging at 16A. Interesting that you have the same.
Hi Bielec,

Actually I have gotten beyond the 16A mark, I have done successful test of 25A charge (even with Regen set to 0kW perhaps it a reported limit but maybe not an "audited" limit?) using the HV_UP_FOR_DRIVE commands. What happens to your pack when you go beyond 16A charge, does it report some fault somewhere? To be clear, Im not sure if the successful 25A charge was due to HV_UP_FOR_DRIVE or if I had other issues present when doing the 25A test previously in "HV_UP" state.
bielec
Posts: 37
Joined: Tue Apr 19, 2022 12:17 pm
Location: Aberdeenshire
Has thanked: 1 time
Been thanked: 12 times

Re: Model 3 High Voltage Controller

Post by bielec »

parallaxengineering wrote: Mon Dec 12, 2022 2:25 am I have done successful test of 25A charge (even with Regen set to 0kW perhaps it a reported limit but maybe not an "audited" limit?) using the HV_UP_FOR_DRIVE commands.
Hi parallaxengineering, That is very interesting and maybe we have improved the charge rate tolerance by using these two messages. I have not tried charging over 16A again because I am afraid of overvoltage when it trips out. It was perhaps a wrong assumption that the reported Regen actually limits the charge rate? It now seems that the HV_UP_FOR_DRIVE has improved the rate. I am in fact applying my charger to the motor connections at 400v DC. This is the same as Regen from the motor and is not at all like using the Chargeport.
parallaxengineering
Posts: 8
Joined: Tue Oct 25, 2022 4:18 pm
Been thanked: 2 times

Re: Model 3 High Voltage Controller

Post by parallaxengineering »

bielec wrote: Mon Dec 12, 2022 9:40 am Hi parallaxengineering, That is very interesting and maybe we have improved the charge rate tolerance by using these two messages. I have not tried charging over 16A again because I am afraid of overvoltage when it trips out. It was perhaps a wrong assumption that the reported Regen actually limits the charge rate? It now seems that the HV_UP_FOR_DRIVE has improved the rate. I am in fact applying my charger to the motor connections at 400v DC. This is the same as Regen from the motor and is not at all like using the Chargeport.
Yes I think perhaps with "UP FOR DRIVE" we may have higher charge/discharge limits. I did a continuous 25A and up to 28A charge on the Inverter DC bus (not the chargeport) and didn't have any faults. We will see if I run into issues at higher charge currents.
OOP
Posts: 20
Joined: Sun Dec 25, 2022 2:15 pm
Has thanked: 5 times

Re: Model 3 High Voltage Controller

Post by OOP »

If I figure it out correctly, I need:

2 resistors on the drive unit connectors on the battery
1 connector for the high volt connectors (goes to the inverter)
1 esp32 with can Interface - (what’s the correct can interface?) and flashed with the Programm from here
1 serial connection to a computer for close the switches in the battery with the c key via serial console
1 12v Powersource for power the battery bms electronic.
1 model 3 SR or LR battery (complete)


Did I miss something?

What’s the best CAN bus pins? (Inverter front/real, charge Port or vehicle can)

Best regards.
bielec
Posts: 37
Joined: Tue Apr 19, 2022 12:17 pm
Location: Aberdeenshire
Has thanked: 1 time
Been thanked: 12 times

Re: Model 3 High Voltage Controller

Post by bielec »

Use vehicle Can bus on pins 15,16
Fit a capacitor across the H.V.
I used an Arduino Due but it may work with an ESP32, I don't know. It does have a CAN interface.
OOP
Posts: 20
Joined: Sun Dec 25, 2022 2:15 pm
Has thanked: 5 times

Re: Model 3 High Voltage Controller

Post by OOP »

I need a board with rs485 and can bus - so I search for the correct one right now.
PE22
Posts: 6
Joined: Tue Nov 29, 2022 3:51 pm
Has thanked: 6 times

Re: Model 3 High Voltage Controller

Post by PE22 »

OOP wrote: Sun Dec 25, 2022 2:39 pm If I figure it out correctly, I need:

2 resistors on the drive unit connectors on the battery
1 connector for the high volt connectors (goes to the inverter)
1 esp32 with can Interface - (what’s the correct can interface?) and flashed with the Programm from here
1 serial connection to a computer for close the switches in the battery with the c key via serial console
1 12v Powersource for power the battery bms electronic.
1 model 3 SR or LR battery (complete)


Did I miss something?

What’s the best CAN bus pins? (Inverter front/real, charge Port or vehicle can)

Best regards.
Do you know what is the reason for "having 2 resistors on the drive unit connectors on the battery"? What value? and how do we connect them?
OOP
Posts: 20
Joined: Sun Dec 25, 2022 2:15 pm
Has thanked: 5 times

Re: Model 3 High Voltage Controller

Post by OOP »

It is to connect in the small parts in the connector, otherwise the bms thinks, that no engine is connected and don’t come up. I hope that’s the correct description.

I hope this is correct. I think I have read this anywhere. In my opinion it will be better to have his only on the connector that will be used and connected. But anyone write this is a issue if the battery is configured for a dual engine.
bielec
Posts: 37
Joined: Tue Apr 19, 2022 12:17 pm
Location: Aberdeenshire
Has thanked: 1 time
Been thanked: 12 times

Re: Model 3 High Voltage Controller

Post by bielec »

I have been asked to provide a diagram of my system which achieves contact closure and display of data on an Arduino Due. Here it is. And of course the can lines should be terminated with 120 ohms
Attachments
model3.jpg
OOP
Posts: 20
Joined: Sun Dec 25, 2022 2:15 pm
Has thanked: 5 times

Re: Model 3 High Voltage Controller

Post by OOP »

Did you know where i can find the msgID6F2.h ? i search at google and github, bit i dont find anything.
bielec
Posts: 37
Joined: Tue Apr 19, 2022 12:17 pm
Location: Aberdeenshire
Has thanked: 1 time
Been thanked: 12 times

Re: Model 3 High Voltage Controller

Post by bielec »

Here are the original attachments from EVTV
These are a remnant of the Model S parts of the program which are not used in Model3 mode. They are required however to make my hacked code compile. I hacked the code purely to demonstrate model3 functionality and the code would need tidying up for more serious use.
Attachments
msgID6F2.h
(900 Bytes) Downloaded 134 times
msgID6F2.cpp
(3.26 KiB) Downloaded 123 times
PE22
Posts: 6
Joined: Tue Nov 29, 2022 3:51 pm
Has thanked: 6 times

Re: Model 3 High Voltage Controller

Post by PE22 »

bielec wrote: Sat Dec 31, 2022 2:57 pm I have been asked to provide a diagram of my system which achieves contact closure and display of data on an Arduino Due. Here it is. And of course the can lines should be terminated with 120 ohms
Thanks for providing the picture. Could you please explain about "Links on HVIL pins"?
bielec
Posts: 37
Joined: Tue Apr 19, 2022 12:17 pm
Location: Aberdeenshire
Has thanked: 1 time
Been thanked: 12 times

Re: Model 3 High Voltage Controller

Post by bielec »

I was referring to the HVIL pins. High Voltage Interlock Loop. This is an electrical loop which must be intact to allow the battery to energise. The electrical circuit loops through each high voltage connector , the data connector and even one of the lid screws of the "penthouse" cover. On each HV connector there are two small extra contacts . These must be shorted out to complete the safety loop. This is usually done by fitting the relevant connector which contains a shorting link but us hobbyists don't always have all the connectors to fit. A resistor must also be fitted to the correct pins of the data connector as shown in the diagram.
PE22
Posts: 6
Joined: Tue Nov 29, 2022 3:51 pm
Has thanked: 6 times

Re: Model 3 High Voltage Controller

Post by PE22 »

bielec wrote: Wed Jan 04, 2023 11:49 pm I was referring to the HVIL pins. High Voltage Interlock Loop. This is an electrical loop which must be intact to allow the battery to energise. The electrical circuit loops through each high voltage connector , the data connector and even one of the lid screws of the "penthouse" cover. On each HV connector there are two small extra contacts . These must be shorted out to complete the safety loop. This is usually done by fitting the relevant connector which contains a shorting link but us hobbyists don't always have all the connectors to fit. A resistor must also be fitted to the correct pins of the data connector as shown in the diagram.
There is only one high-voltage connector for the single-engine tesla model's battery. There is also another connection under the penthouse, which is for the heater and/or compressor, that has small extra contacts; do we need to short them also? Also, there are small extra contacts for the charger port on top of the penthouse; do we need to short-circuit them?
bielec
Posts: 37
Joined: Tue Apr 19, 2022 12:17 pm
Location: Aberdeenshire
Has thanked: 1 time
Been thanked: 12 times

Re: Model 3 High Voltage Controller

Post by bielec »

PE22 wrote: Thu Jan 05, 2023 3:26 pm There is only one high-voltage connector for the single-engine tesla model's battery. There is also another connection under the penthouse, which is for the heater and/or compressor, that has small extra contacts; do we need to short them also? Also, there are small extra contacts for the charger port on top of the penthouse; do we need to short-circuit them?
I have a dual motor version and I have linked the HVIL on both front and rear motor connectors and the small pins on the "Anciliary"/heater connector.
I have nothing connected to the charger socket.

I have been asked about using an ESP32 instead of a Due so today I quickly modified and stripped the code to work on an ESP32.
This requires Collin Kidders esp32_can library and his can_common library to compile. It is sufficient to copy these two libraries into your arduino library folder. The program is operated from the Arduino serial monitor screen where you will see a continuous stream of battery SOC, cell Voltages, Temperatures etc. Sending a "C" toggles message 221 which turns the contactors on/off. The messages are sent at default 30mS but the rate may be varied by command eg. "i 60" for 60mS. Sending "?" displays a menu of these commands.
I used a Node ESP32 with a 3.3v compatible CAN driver shield Rx on GPIO16 Tx on GPIO17
This is quick and dirty but should allow novice users to get the contactors to close on a newer Wireless capable device.


(edit) there is an error which prevents this program from transmitting proper data and closing the contactors... to correct the error, remove the line "outframe.rtr = 1;"
Attachments
TeslaModel3esp32.ino
(13.07 KiB) Downloaded 96 times
Post Reply