Skip to content

Lid sensor reading is wrong

Created by: mikvaana

Hey, we installed the lid sensor on the TEC card 1 and currently, tessie sees the lid as closed at all times. I had a look in the checkLid() function and the sensor values range from -273 to -90, but the limits for lid open/closed are above and below 4100:

void  driveHardware::checkLid() {
  // -- keep reading from CAN bus in readAllParamsFromCANPublic() to minimize CAN errors
  double reading = fTECData[1].reg["Temp_W"].value;
  if (reading < 4100.) {
    // -- lid is locked
    fLidStatus = 1;
  } else if (reading > 4100.) {
    // -- lid is open
    fLidStatus = -1;
  } else {
    // -- lid is closed, but not locked
    // -- unreachable, should not impact program logic above
    fLidStatus = 0;
  }
}

I changed the limits to -170 and then it seems to work for us, since the reading seems to be temperature-like. Should the limits be changed?