Reverse polarity of current through the TEC

Matches the i_set polarity with the front panel of the Thermostat.
This commit is contained in:
atse 2023-08-10 13:26:14 +08:00
parent 6f0acc73b8
commit e154dbe681
2 changed files with 4 additions and 4 deletions

View File

@ -184,7 +184,7 @@ postfilter rate can be tuned with the `postfilter` command.
- Connect TEC module device 1 to TEC1- and TEC1+. - Connect TEC module device 1 to TEC1- and TEC1+.
- The GND pin is for shielding not for sinking TEC module currents. - The GND pin is for shielding not for sinking TEC module currents.
When using a TEC module with the Thermostat, the Thermostat expects the thermal load (where the thermistor is located) to heat up with a positive software current set point, and cool down with a negative current set point. When using a TEC module with the Thermostat, the Thermostat expects the thermal load (where the thermistor is located) to cool down with a positive software current set point, and heat up with a negative current set point.
Testing heat flow direction with a low set current is recommended before installation of the TEC module. Testing heat flow direction with a low set current is recommended before installation of the TEC module.

View File

@ -118,7 +118,7 @@ impl Channels {
let center_point = self.get_center(channel); let center_point = self.get_center(channel);
let r_sense = ElectricalResistance::new::<ohm>(R_SENSE); let r_sense = ElectricalResistance::new::<ohm>(R_SENSE);
let voltage = self.get_dac(channel); let voltage = self.get_dac(channel);
let i_tec = (voltage - center_point) / (10.0 * r_sense); let i_tec = (center_point - voltage) / (10.0 * r_sense);
i_tec i_tec
} }
@ -142,9 +142,9 @@ impl Channels {
}; };
let center_point = vref_meas; let center_point = vref_meas;
let r_sense = ElectricalResistance::new::<ohm>(R_SENSE); let r_sense = ElectricalResistance::new::<ohm>(R_SENSE);
let voltage = i_tec * 10.0 * r_sense + center_point; let voltage = -i_tec * 10.0 * r_sense + center_point;
let voltage = self.set_dac(channel, voltage); let voltage = self.set_dac(channel, voltage);
let i_tec = (voltage - center_point) / (10.0 * r_sense); let i_tec = (center_point - voltage) / (10.0 * r_sense);
i_tec i_tec
} }