jsimonkeller
Well-known member
Hello all. I am new to the forum and have reviewed several posts and have not found exactly what I am looking for.
I have built an electric car out of an old Porsche 911 (1978) and I am implementing the Webasto HVH50 high voltage coolant heater into my build. I had been using an older PTC heater running off PWM, but that heater takes up too much space and stopped working and the Webasto fits nicely under the hood as an upgrade. Unfortunately, the Webasto HVH heaters are mostly run off LIN. Finding a PWM version has proven difficult, so I have given up on that route.
Additionally, there a wiki page on this heater with a lot of the same info:
https://openinverter.org/wiki/Webasto_HVH50
At the suggestion of the OpenInverter.Org moderator, I secured the Teensy 4.0 CAN FD And LIN Bus Breakout Board from SK Pang and have installed the Arduino IDE software, I am able to run the simple programming on my board, such as the LED blink speed and such, so I know everything is working as it should.
HERE IS MY ASK:
I would like to implement the LIN BUS programming into the TEENSY controller such that when I push the heater button in my car that turns on the 12V power to the WEBASTO and 5V power to the TEENSY, the heater will kick in and heat the coolant. I DO NOT NEED TO CONTROL THE TEMP. I just need it to kick on and it will heat to the maximum allowable heat until turned off. I also do NOT need any feedback for gauges or controls. This controller will NOT be a part of the overall CAN Network on the car that controls the gauges and Tesla inverter and Orion BMS. It will be standalone and solely function to TRANSMIT the frames to the heater to engage in heating the coolant. This heater is on a separate coolant loop from the rest of the car's cooling systems. It is truly standalone.
For the heater, we have determined the following:
- Byte 0 sets the power with a scaling factor of 40
- Byte 1 set the temperature setpoint in °C with an offset of 40
- Byte 2 is unused
- Byte 3 =8 heater on (i.e. bit 3 set)
- Baud Rate is 9600
The moderator of OI has implemented this programming into his stm32 software under the volvo branch on github.
The portion of the programming related to the heater command is as follows:
#include "linbus.h"
static LinBus* lin;
static void SendLin()
{
static bool read = true;
if (lin->HasReceived(22, 8))
{
uint8_t* data = lin->GetReceivedBytes();
Param::SetInt(Param::tmpheater, data[1] - 40);
Param::SetInt(Param::udcheater, data[4] | ((data[5] & 3) << 8));
Param::SetFlt(Param:owerheater, FP_FROMINT(((data[5] >> 2) | (data[6] << 8)) * 20) / 1000);
}
if (read)
{
lin->Request(22, 0, 0);
}
else
{
uint8_t lindata[4];
lindata[0] = Param::GetInt(Param::heatpowmax) / 40;
lindata[1] = Param::GetInt(Param::heatmax) + 40;
lindata[2] = 0;
lindata[3] = Param::GetInt(Param:pmode) == MOD_RUN ? 8 : 0;
lin->Request(21, lindata, sizeof(lindata));
}
read = !read;
}
Obviously, I cannot just paste this into a sketch on IDE, so I would like to figure out how to take the above and create a loop that sends this static data to the heater as long as the teensy is powered on. I would love any direction anyone can provide to help me implement this programming.
As it is kicking into cold winter weather for me, I would like to be able to use the car in the coming months when things get nasty outside.
Thank you in advance.
jsimonkeller
I have built an electric car out of an old Porsche 911 (1978) and I am implementing the Webasto HVH50 high voltage coolant heater into my build. I had been using an older PTC heater running off PWM, but that heater takes up too much space and stopped working and the Webasto fits nicely under the hood as an upgrade. Unfortunately, the Webasto HVH heaters are mostly run off LIN. Finding a PWM version has proven difficult, so I have given up on that route.
Additionally, there a wiki page on this heater with a lot of the same info:
https://openinverter.org/wiki/Webasto_HVH50
At the suggestion of the OpenInverter.Org moderator, I secured the Teensy 4.0 CAN FD And LIN Bus Breakout Board from SK Pang and have installed the Arduino IDE software, I am able to run the simple programming on my board, such as the LED blink speed and such, so I know everything is working as it should.
HERE IS MY ASK:
I would like to implement the LIN BUS programming into the TEENSY controller such that when I push the heater button in my car that turns on the 12V power to the WEBASTO and 5V power to the TEENSY, the heater will kick in and heat the coolant. I DO NOT NEED TO CONTROL THE TEMP. I just need it to kick on and it will heat to the maximum allowable heat until turned off. I also do NOT need any feedback for gauges or controls. This controller will NOT be a part of the overall CAN Network on the car that controls the gauges and Tesla inverter and Orion BMS. It will be standalone and solely function to TRANSMIT the frames to the heater to engage in heating the coolant. This heater is on a separate coolant loop from the rest of the car's cooling systems. It is truly standalone.
For the heater, we have determined the following:
- Byte 0 sets the power with a scaling factor of 40
- Byte 1 set the temperature setpoint in °C with an offset of 40
- Byte 2 is unused
- Byte 3 =8 heater on (i.e. bit 3 set)
- Baud Rate is 9600
The moderator of OI has implemented this programming into his stm32 software under the volvo branch on github.
stm32-car/src/stm32_car.cpp at Volvo · jsphuebner/stm32-car
Very hacky project that talks to the Nissan Leaf BMS (aka LBC) and to the VW CAN bus - jsphuebner/stm32-car
github.com
The portion of the programming related to the heater command is as follows:
#include "linbus.h"
static LinBus* lin;
static void SendLin()
{
static bool read = true;
if (lin->HasReceived(22, 8))
{
uint8_t* data = lin->GetReceivedBytes();
Param::SetInt(Param::tmpheater, data[1] - 40);
Param::SetInt(Param::udcheater, data[4] | ((data[5] & 3) << 8));
Param::SetFlt(Param:owerheater, FP_FROMINT(((data[5] >> 2) | (data[6] << 8)) * 20) / 1000);
}
if (read)
{
lin->Request(22, 0, 0);
}
else
{
uint8_t lindata[4];
lindata[0] = Param::GetInt(Param::heatpowmax) / 40;
lindata[1] = Param::GetInt(Param::heatmax) + 40;
lindata[2] = 0;
lindata[3] = Param::GetInt(Param:pmode) == MOD_RUN ? 8 : 0;
lin->Request(21, lindata, sizeof(lindata));
}
read = !read;
}
Obviously, I cannot just paste this into a sketch on IDE, so I would like to figure out how to take the above and create a loop that sends this static data to the heater as long as the teensy is powered on. I would love any direction anyone can provide to help me implement this programming.
As it is kicking into cold winter weather for me, I would like to be able to use the car in the coming months when things get nasty outside.
Thank you in advance.
jsimonkeller