Commit Graph

21 Commits

Author SHA1 Message Date
8b975e656e Stop i_set from fluctuating in every report
i_set is a user-provided value that shouldn't fluctuate with every VREF
measurement. Storing i_set as channel state is the simplest way to avoid
that.
2024-02-14 17:21:39 +08:00
9df0fe406f Remove VREF in reports
Since VREF is an implementation detail, there shouldn't be a need to
include it in reports.

The ChannelState vref is removed along with it as its only use was to
save VREF measurements for later reporting.
2023-08-22 11:40:42 +08:00
26ad2f0119 rewrite PID
Rewrite of PID according to https://hackmd.io/IACbwcOTSt6Adj3_F9bKuw PID implementation.

To migrate:
- TEC+/- pin polarity has to be reversed.
- Some saved settings might be wiped upon flashing of new firmware, back up settings before upgrade
- Min / Max integral parameters no longer exist
- kp, ki, kd will likely need to be retuned

The software has been tested on hardware with good temperature control stability.

Reviewed-on: M-Labs/thermostat#68
Co-authored-by: topquark12 <aw@m-labs.hk>
Co-committed-by: topquark12 <aw@m-labs.hk>
2022-02-24 20:16:47 +08:00
3433881d0f remove dead code 2021-01-11 14:10:50 +08:00
193d54a0a6 pid: anti-windup when compliance voltage reached 2021-01-11 14:00:52 +08:00
e9e46b29cf pid: integrate time_delta to free gain parameters from sampling period
Fixes Gitea issue #22
2020-12-18 15:40:05 +01:00
a2caac0fe5 channels: power_down TEC when thermistor is not connected to ADC 2020-09-25 00:01:08 +02:00
20059aff5c channel_state: recognize unplugged thermistor 2020-09-24 23:34:09 +02:00
a84242fb1f implement setting i_set centerpoint 2020-09-23 22:30:04 +02:00
ba84295ec5 reconnect the pid controller 2020-09-18 00:09:30 +02:00
f76ee9a607 separate adc and max vref 2020-09-16 23:31:49 +02:00
7d45d5ad32 adc: complete temperature calculation 2020-09-16 20:50:23 +02:00
dda1f2f0b4 use ThermodynamicTemperature 2020-09-16 18:40:07 +02:00
b80fcc430b channel_state: move adc_calibration into ChannelState 2020-09-13 23:15:48 +02:00
bb26490153 unit: replace with uom 2020-09-13 23:13:51 +02:00
ba860e52ac control i_set dac in volts 2020-05-17 01:27:47 +02:00
c0079007f2 do not overwrite dac value when pid is disengaged 2020-05-13 22:11:25 +02:00
3d1740b23b refactor into Channels::poll_adc() 2020-05-13 00:04:55 +02:00
723901b341 adc: read u32 for unipolar coding 2020-03-19 23:39:06 +01:00
bec7019f3a delint 2020-03-19 22:21:17 +01:00
c00c1bb081 main: connect adc/sh/pid/dac, split out into mod channel_state 2020-03-19 22:11:36 +01:00