PID_improvements #45

Merged
sb10q merged 1 commits from PID_improvements into master 2024-08-17 17:37:18 +08:00
1 changed files with 2 additions and 2 deletions

View File

@ -364,12 +364,12 @@ impl Channels {
(duty * max, max) (duty * max, max)
} }
// Get actual current passing through TEC // Get current passing through TEC
Outdated
Review

Actual?

Actual?

There are quite a few variables describing currents, like current setpoint, dac voltage setpoint controlling output current, dac voltage readback for current control.

This returns the thermostat measured current that is passing through the TEC, hence "actual".

There are quite a few variables describing currents, like current setpoint, dac voltage setpoint controlling output current, dac voltage readback for current control. This returns the thermostat measured current that is passing through the TEC, hence "actual".

I'll rephrase the comment for clarity.

I'll rephrase the comment for clarity.
pub fn get_tec_i(&mut self, channel: usize) -> ElectricCurrent { pub fn get_tec_i(&mut self, channel: usize) -> ElectricCurrent {
(self.read_itec(channel) - self.read_vref(channel)) / ElectricalResistance::new::<ohm>(0.4) (self.read_itec(channel) - self.read_vref(channel)) / ElectricalResistance::new::<ohm>(0.4)
} }
// Get actual voltage across TEC // Get voltage across TEC
pub fn get_tec_v(&mut self, channel: usize) -> ElectricPotential { pub fn get_tec_v(&mut self, channel: usize) -> ElectricPotential {
(self.read_tec_u_meas(channel) - ElectricPotential::new::<volt>(1.5)) * 4.0 (self.read_tec_u_meas(channel) - ElectricPotential::new::<volt>(1.5)) * 4.0
} }