Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions projects/tms/src/temp_sensor/temp_sensor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,8 @@ float TempSensor::Update() {
float TempSensor::Read() {
float volt_at_stm = analog_input_.ReadVoltage();

/// Calculate the voltage at the temperature sensor from the voltage
/// at the STM. They are not equal because there is a non-unity gain
/// buffer between them. V_STM = 1.44 + 0.836 * V_TS / 2 So the
/// inverse is V_TS = 2 * (V_STM - 1.44) / 0.83
float volt_at_tempsensor = 2 * (volt_at_stm - 1.44) / 0.836;
float temperature =
macfe::LookupTable::Evaluate(volt_ts_to_degC, volt_at_tempsensor);
macfe::LookupTable::Evaluate(volt_ts_to_degC, volt_at_stm);

return temperature;
}
Loading