Hyundai Santa Fe 2021 PHEV battery

Post Reply
maciek16c
Posts: 19
Joined: Mon May 01, 2023 7:40 pm
Location: Poland
Been thanked: 9 times

Hyundai Santa Fe 2021 PHEV battery

Post by maciek16c »

Hello,
i recently bought temporary battery (37501-CL500) for my ev conversion and i'm trying to close contactors. EB 12 connector has similiar pinout to other models and i managed to read some data via OBD II. PIDs are the same as in other models, for example: https://docs.google.com/spreadsheets/d/ ... 1176199607.
When i play can log from Hyundai Kona, UDS ReadById 101 byte 53 which is ignition state, and probably HCU ready, MCU ready, etc changes to correct value but contactors remain open. Additionaly 0.5 s after turning ignition on BMS fault appears which means CAN bus is innactive. According to service manual HCU has to send command to close contactors on H-CAN. Unfortunately i can't find on the internet any log from this bus, even from other models, or from KIA, only from P-CAN and others.
Has anyone tried using this battery, has can logs, or is able to record them?
You can find my logs and SavvyCan script to read diagnostic information here:
https://github.com/maciek16c/hyundai-sa ... ev-battery
User avatar
EV_Builder
Posts: 1199
Joined: Tue Apr 28, 2020 3:50 pm
Location: The Netherlands
Has thanked: 16 times
Been thanked: 33 times
Contact:

Re: Hyundai Santa Fe 2021 PHEV battery

Post by EV_Builder »

Are you aware that there are BMS's on the market?
Not trying to sell but more over maybe saves you time to focus on the conversion it self and maybe if you stick to Hyundai can be used later too.
Converting an Porsche Panamera
see http://www.wdrautomatisering.nl for bespoke BMS modules.
maciek16c
Posts: 19
Joined: Mon May 01, 2023 7:40 pm
Location: Poland
Been thanked: 9 times

Re: Hyundai Santa Fe 2021 PHEV battery

Post by maciek16c »

I know there are BMS's available such as SimpBms, orion bms or fox bms, but they are either as expensive as my whole battery or have to be modified. I think it shouldn't be difficult to use current bms, there is only few can frames missing and that's why i need h-can log
maciek16c
Posts: 19
Joined: Mon May 01, 2023 7:40 pm
Location: Poland
Been thanked: 9 times

Re: Hyundai Santa Fe 2021 PHEV battery

Post by maciek16c »

I got it working. There are probably still few warnings but i can charge and discharge it.
There are 4 frames needed:
  • 0x523 - ignition and inverter status
  • 0x2F0
  • 0x2A1 - inverter voltage
  • 0x200
You can find SavvyCan script to run battery, script to read diagnostic information and DBC file at: https://github.com/maciek16c/hyundai-sa ... ev-battery
BMU closes contactors automatically with request in frame 0x200 or 0x2F0. If you want to run battery using this script don't connect anything with high capacity (inverter) to battery output because it doesn't measure voltage after contactors, only uses CAN messages to get this voltage, and could close main contactor with very short precharge.
I have also added support for this battery to zombieverter VCU: https://github.com/maciek16c/Stm32-vcu
For easier use i connected both CAN buses together
powercontrol
Posts: 7
Joined: Sun Oct 10, 2021 11:08 am
Has thanked: 3 times
Been thanked: 3 times

Re: Hyundai Santa Fe 2021 PHEV battery

Post by powercontrol »

Hello Maciek16c,

I tried to replicate what you did on your SanteFe PHEV battery on my eniro EV battery. My contactors do not close. :?
I read your cansavvy file and did recreate the sequence of frames - but no luck. Also, I understand only PID 200 is required to get the contactors to close.
On mine, the trigger of the PID 200 message - actually, byte(5) with a value of 20 or 30 - will creates answers from the BMU with PIDs 4DE and 4E2.
None of the other frames (PIDs 2F0, 2A1, 523) trigger any changes in the BMU's PCAN messages.

So, with the 200 frame, I get this:

Code: Select all

PID 00 01 02 03 04 05 06 07
4DE -- -- -- -- -- 55 18 --
4E2 -- -- -- -- -- -- 51 98
These are the same values you can find in the Kona's logs projectgus shared.
I am now looking into the frame sequence from these logs to see If I can generate anything from my battery.

I can find the first sequence from the BMU with PIDs 4DE, 4E2, 594, 596, 597, 5D6 after begin triggered by (at least) a 200 with byte(5) = FB
I will look into replaying the sequence of PIDs just prior to that.
  • Can you confirm you are connecting straight to the BMU (no other devices on the PCAN bus) and by only sending a 200 frame, you get your contactors to close?
  • Would you mind sharing your CAN logs? It may help me finding out why it works on yours but not on mine.
  • proably a dumb question - you do mention H-CAN. How is HCAN connected to EB12?
thank you
maciek16c
Posts: 19
Joined: Mon May 01, 2023 7:40 pm
Location: Poland
Been thanked: 9 times

Re: Hyundai Santa Fe 2021 PHEV battery

Post by maciek16c »

I only had BMU connected. All 4 frames (200, 2F0, 2A1, 523) are needed. When trying to close contactors i didn't look much into messages coming from BMU, i used uds.js script to see diagnostic information. You should see ignition state changed from 0 to 00000100 when 0x523 (0x60, 0x00, 0x60, 0x00, 0x00 , 0x00, 0x00, 0x00) is sent. Plausible inverter voltage has to also be sent, it should try to do something (precharge) even if it's 0V. If it's incorrect BMU shows 403V. To run battery using my script (bateria.js) you have to set kl15 and enable_send to 1, set voltage and set contactor1 to 1.
I added 2 can logs:
  • ładowanie-krotkie.csv - charging battery using outlander charger - i sent fake inverter voltage using savvycan because precharge isn't needed in this case
  • Uruchomiony falownik.csv - Battery controlled by zombieverter, sending true inverter voltage to battery
H-CAN is connected to pins 15,16
image.png
powercontrol
Posts: 7
Joined: Sun Oct 10, 2021 11:08 am
Has thanked: 3 times
Been thanked: 3 times

Re: Hyundai Santa Fe 2021 PHEV battery

Post by powercontrol »

Thanks! So, there are indeed some differences with your PHEV battery and a kona/eniro EV one. The HCAN on EB12 (pin 15,16) (for me EB11) is not used on the cable connecting the battery to the rest of the car, but the wiring exists internally to the BMU. Unfortunately, there are no CAN messages on that bus I was able to get or receive.

Nevertheless, it means in a eNiro, the BMU must be queried only using the PCAN - as no other bus are available outside the battery.

Clearly, as I get no reply when sending a 7E4 "UDS" frame (either on the PCAN or by connecting directly to the BMU on the HCAN) it means the battery considers itself "off", even after a 523. (and a 200, 2F0 and a 2A1)

- so - I need more time to experience and understand.
maciek16c
Posts: 19
Joined: Mon May 01, 2023 7:40 pm
Location: Poland
Been thanked: 9 times

Re: Hyundai Santa Fe 2021 PHEV battery

Post by maciek16c »

How do you send diagnostic requests (UDS)? Do you use my script or some obd2 scanner? Have you tried UDS Scanner in SavvyCAN? If battery sends any can frames it should also respond to diagnostics. In my case just powering BMU through "Memory power" and IG3 is enough to respond to these requests and even after disconnecting IG3 it stops sending normal can frames but still responds to diagnostic requests.
bigmotherwhale
Posts: 107
Joined: Tue Sep 22, 2020 6:48 pm
Has thanked: 15 times
Been thanked: 22 times

Re: Hyundai Santa Fe 2021 PHEV battery

Post by bigmotherwhale »

Hello
I got a battery from the Ioniq PHEV and have managed to get it to communicate over CAN, I tried using your scripts but it seems its different, only the current and voltage seem to share the same messages. I tried to see if any of the messages were the same only on different ID's but i didnt have any luck, Could you have a look for me?
any advice to try and find the correct messages for the contactors? how did you manage to find the right ones for your battery?
Thankyou.
Attachments
Log.csv
(25.44 KiB) Downloaded 57 times
bigmotherwhale
Posts: 107
Joined: Tue Sep 22, 2020 6:48 pm
Has thanked: 15 times
Been thanked: 22 times

Re: Hyundai Santa Fe 2021 PHEV battery

Post by bigmotherwhale »

I have two of these batteries one PHEV and one HEV, one uses CMU the other is stand alone, I have connected the HEV bms to a Kia inverter and the two look like they are trying to communicate.
Pulling the start signal up on the inverter seems to change the contactor messages although i am unable to get the contactors to trigger, it may be im missing an interlock somewhere or the inverter an battery are not from the same car. I am also able to poll the bms with OBD though ELM327 and torque and get battery data, I tried using your script in savvycan but i dont really know what im doing.
These logs might be helpful for someone with a similar BMS trying to get it to work.
Im also having trouble finding the pinout of the loom connector on the battery pack and im having to trace it back from the BMU connector to determine what goes where, if anyone has this information that might help. I have not looked at the SRS signal yet, its possible this is needed to get the contactors to pull in as well.
Here are the logs.
Attachments
p can log.csv
(736.36 KiB) Downloaded 43 times
H can log.csv
(821.83 KiB) Downloaded 51 times
battery + inverter H+P can.csv
(1.32 MiB) Downloaded 50 times
kia niro hev 1.5kwh battery.csv
(211.5 KiB) Downloaded 47 times
maciek16c
Posts: 19
Joined: Mon May 01, 2023 7:40 pm
Location: Poland
Been thanked: 9 times

Re: Hyundai Santa Fe 2021 PHEV battery

Post by maciek16c »

I recorded can communication from Santa Fe HEV. There were many differences in frames between HEV and PHEV but fortunately all 4 required frames were present, just with different data.
Can you read inverter voltage reported by BMS? Can you change this value by manually sending can frame with different data?
All interlocks have to be shorted (battery output, charging input ...) Does your battery have service disconnect? If not you could try finding interlock in EB12 connector by finding pin with 3.3V and connecting it to gnd via resistor (1 - 10 kohm). If voltage drops it should be input and can be kept shorted.
bigmotherwhale
Posts: 107
Joined: Tue Sep 22, 2020 6:48 pm
Has thanked: 15 times
Been thanked: 22 times

Re: Hyundai Santa Fe 2021 PHEV battery

Post by bigmotherwhale »

I have actually managed to get what i presume is the precharge relay to pull in for just a few seconds, but it only seems to happen on start-up using message 0x200 and it wont go any further that that at the moment.
I think all the interlocks are shorted, I can find only one on the battery on the service disconnect.
The frame for inverter voltage is present from the inverter and I have tried setting it to 0v or the battery voltage.
I have also tried editing your script to include the extra messages.
It could be that the HPCU will not pull the contactors in because it does not receive the codes from the immobilizer, its showing a DTC which seems to be something like this.
Im not really all that great with programming or working with CAN there may be something im missing.
maciek16c
Posts: 19
Joined: Mon May 01, 2023 7:40 pm
Location: Poland
Been thanked: 9 times

Re: Hyundai Santa Fe 2021 PHEV battery

Post by maciek16c »

Precharge relay working is a really good sign. Contactors are controlled by bms, not by HCPU. HCPU only sends signal to turn on HV. BMS doesn't close main contactor and opens precharge after 0x200 because inverter voltage doesn't rise fast enough. Try manually sending inverter voltage high enough for example 0x2A1 0,0,0,0,0,0,0xFF,0. Remember to not connect bettery output to inverter when you try it.
Since you can view diagnostic information using elm327 send this frome using savvycan with 10ms trigger and change data to see how reported voltage changes. You don't have to send other frames while you try it.
When precharge fails you have to disconnect ignition and try again
bigmotherwhale
Posts: 107
Joined: Tue Sep 22, 2020 6:48 pm
Has thanked: 15 times
Been thanked: 22 times

Re: Hyundai Santa Fe 2021 PHEV battery

Post by bigmotherwhale »

It was actually the 12v battery relay that was engaging not the precharge unfortunately.
I am getting IGN_FAULT 1 in the 0x200, is this normal?
maciek16c
Posts: 19
Joined: Mon May 01, 2023 7:40 pm
Location: Poland
Been thanked: 9 times

Re: Hyundai Santa Fe 2021 PHEV battery

Post by maciek16c »

I don't know. I created this dbc and named this bit this way because when it's set contactors open and some (error?) flag is set in diagnostic information.
Post Reply