Bit scaling a puzzle

Any other software topic
Post Reply
User avatar
EV_Builder
Posts: 1009
Joined: Tue Apr 28, 2020 3:50 pm
Location: The Netherlands
Has thanked: 1 time
Contact:

Bit scaling a puzzle

Post by EV_Builder »

Ok while figuring out the dash of the 970 i gathered this info about the water temperature.
it's 7 bits.

None = -48 celcius;
Bit 0 = -47 celcius;
Bit 1 = -45 celcius;
Bit 2 = -43 celcius;
Bit 3 = -36 celcius;
Bit 4 = -24 celcius;
Bit 5 = -1 celcius;
Bit 6 = +56 celcius;

What i'm looking for is the inverse formula.
-48 looks like an offset.

Anyone wants to give it a shot?

8-)
Converting an Porsche Panamera
see http://www.wdrautomatisering.nl for bespoke modules.
User avatar
crasbe
Posts: 60
Joined: Mon Jul 08, 2019 5:18 pm
Location: Germany
Has thanked: 1 time
Been thanked: 10 times

Re: Bit scaling a puzzle

Post by crasbe »

Looks like a linear scale:
2022-07-12 20_10_57-Mappe1 - Excel.png
But I would recommend some more data points in the upper region to get better accuracy of the regression.
User avatar
EV_Builder
Posts: 1009
Joined: Tue Apr 28, 2020 3:50 pm
Location: The Netherlands
Has thanked: 1 time
Contact:

Re: Bit scaling a puzzle

Post by EV_Builder »

Wow!
Ty leaps!

I have them at home. Will post them later.

When implementation is there i definitely will come back to this testing/verification wise.
Converting an Porsche Panamera
see http://www.wdrautomatisering.nl for bespoke modules.
User avatar
EV_Builder
Posts: 1009
Joined: Tue Apr 28, 2020 3:50 pm
Location: The Netherlands
Has thanked: 1 time
Contact:

Re: Bit scaling a puzzle

Post by EV_Builder »

0x5C = 90degrees... or if that doesn't make sense 0xB8 (i kinda doubt if it was 7 or 8 bits).

0x4C =72 degrees or 0x98.

if this doesn't make sense i need to check later when i'm at software phase II so to speak ;) :D
Converting an Porsche Panamera
see http://www.wdrautomatisering.nl for bespoke modules.
Mitchy
Posts: 32
Joined: Sun Nov 14, 2021 12:16 pm

Re: Bit scaling a puzzle

Post by Mitchy »

What Can ID are you simulating?
Is this 0x640 (motor_07) for the temps?
From a few DBC files I have, seems to be 8 bits, -48* with 0.75 offset
SG_ MO_Kuehlmittel_Temp : 24|8@1+ (0.75,-48) [-48|141.75] "Unit_DegreCelsi"

Can confirm that this works on my 981 cluster. Been simulating a few values (15,20, 35*C) and seem to match. Haven't tried a high value to confirm it is actually 8 bits, but would make sense.

0xB8 = 90*C using the mapping above
0x98 = 66*C though ?

Maybe you're missing the LSB bit of the 8 bit set..
I get all the same numbers as you gave, but I'm a bit position Higher. (-36 is on Bit 4, not Bit 3) (-24 is on Bit 5, not Bit 4) etc.

For the cluster, Use PIWIS to enable Expert mode, makes it much easier to quickly run thru some of the values without damping.
User avatar
EV_Builder
Posts: 1009
Joined: Tue Apr 28, 2020 3:50 pm
Location: The Netherlands
Has thanked: 1 time
Contact:

Re: Bit scaling a puzzle

Post by EV_Builder »

0x10E but my notes where sketchy checked a log file and it's 8Bits.
So need to check the values above for correctness... :(

Will check your formula too.

0x640 is high Can ID normally not used for operational data...
Converting an Porsche Panamera
see http://www.wdrautomatisering.nl for bespoke modules.
Mitchy
Posts: 32
Joined: Sun Nov 14, 2021 12:16 pm

Re: Bit scaling a puzzle

Post by Mitchy »

I have 0x640 updating at 500ms,

Check my project page for my breakdown, would be interesting to see if they align with your findings.
(Yes I just copied by setup block 🙂 - For the Bit breakdown I left that to the Block Mapping)

Code: Select all

//-------------Motor_07---------------//
  uint8_t iMotor_07_Checksum = 0;
  uint8_t iMotor_07_Counter = 0;
  bool bMO_QBit_Intake_Air_Temp = 0; // Quality bit indicating that Intake Air Temp value is bad
  bool bMO_QBit_Oil_Temp = 0; // Quality bit indicating that Oil Temp value is bad
  bool bMO_QBit_Coolant_Temp = 0; // Quality bit indicating that Coolant Temp value is bad
  bool bMO_test_soundactuator = 0; // External Speaker Actuator Test
  bool bMO_HYB_Error_HV_Net = 0; // DC-DC converter fault for Hybrid (Set to 0)
  bool bMO_active_gearboxheating = 0; // Information for the gearbox as to whether a valve for gearbox heating must be activated
  uint8_t iMO_shutoff_valve_open = 0; // Air conditioning valve control status: not_available control_valve_permissible valve_open valve_close
  uint8_t iMO_Intake_Air_Temp = 0; // Intake Air Temp (sent to cluster for outside air temp if not equipped)
  uint8_t iMO_Oil_Temp = 0; // Oil Temp
  uint8_t iMO_Coolant_Temp = 0; // Coolant Temp
  uint8_t iMO_Elevation = 0; // Correction factor altitude (1 corresponds to 1013 mbar)
  bool bMO_map = 0; // KMTR map cooling equipped? = Set to 0
  uint8_t iMO_CANversioninfo = 0; // Either 0 or 1, likely 0 on first scan, then 1 to indicate Motor03@10ms
  bool bMO_Trans_Cooling = 0; // Transmission cooling valve activation
  uint8_t iMO_Mom_Inertia_02 = 0; // Mass inertia of the motor (J) in kgm²
  uint8_t iMO_heatingPumpCtrl = 0; // 0-100% heating pump control
  bool bMO_VoltageReq = 0; // Request for voltage increase
  uint8_t iMO_Runtime_heaterpump = 0; // Time to run Pump for Turbocharger cooldown

Code: Select all

void Motor7_Msg()
{
Motor7[0] = (bMO_QBit_Intake_Air_Temp & (0x01U)) | ((bMO_QBit_Oil_Temp & (0x01U)) << 1) | ((bMO_QBit_Coolant_Temp & (0x01U)) << 2) | ((bMO_HYB_Error_HV_Net & (0x01U)) << 4) | ((bMO_active_gearboxheating & (0x01U)) << 5) | ((iMO_shutoff_valve_open & (0x03U)) << 6);
Motor7[1] = (iMO_Intake_Air_Temp & (0xFFU));
Motor7[2] = (iMO_Oil_Temp & (0xFFU));
Motor7[3] = (iMO_Coolant_Temp & (0xFFU));
Motor7[4] = (iMO_Elevation & (0xFFU));
Motor7[5] = (bMO_map & (0x01U)) | ((iMO_CANversioninfo & (0x3FU)) << 1) | ((bMO_Trans_Cooling & (0x01U)) << 7);
Motor7[6] = (iMO_Mom_Inertia_02 & (0x1FU)) | ((iMO_heatingPumpCtrl & (0x07U)) << 5);
Motor7[7] = ((iMO_heatingPumpCtrl >> 3) & (0x01U)) | ((bMO_VoltageReq & (0x01U)) << 1) | ((iMO_Runtime_heaterpump & (0x3FU)) << 2);
}
Try to load this DBC file to see if it aligns with what you see, the 981 seems to be a cross between VAG MQB and MLB... Hoping the 970 follows the same CAN message version:
https://raw.githubusercontent.com/rusef ... C7_MLB.dbc
Mitchy
Posts: 32
Joined: Sun Nov 14, 2021 12:16 pm

Re: Bit scaling a puzzle

Post by Mitchy »

A bit offtopic,

You can also decompile the cluster binary with Ghidra
There are some differences between the 970 and 981 clusters. The VDO clusters are locked, but the 970 isn't. You can find the PBX file within PIWIS, Unzip and access the uncompressed/unencrypted binary. ID50 appear to be the main firmware.
Can open using MIPS Little Endian

Still digging into this myself, trying to enable the Hybrid screens. I have mine enabled but unable to simulate any data, I figure they've been stripped down in my firmware.
User avatar
EV_Builder
Posts: 1009
Joined: Tue Apr 28, 2020 3:50 pm
Location: The Netherlands
Has thanked: 1 time
Contact:

Re: Bit scaling a puzzle

Post by EV_Builder »

Ok I will look into it.
If you tell me your needed ID's I can run it through my generator for you.
Then you get usable classes for the messages and you can focus on implementation instead of typing these out.
Converting an Porsche Panamera
see http://www.wdrautomatisering.nl for bespoke modules.
Post Reply