Commit Graph

256 Commits

Author SHA1 Message Date
f6802635a4 add command to reboot into DFU
Co-Authored-By: topquark12 <aw@m-labs.hk>
Co-Committed-By: topquark12 <aw@m-labs.hk>
2021-01-13 11:59:06 +08:00
9e4d06fdbc clarify comment 2021-01-11 16:24:43 +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
3067b356c5 channels: add methods to retrieve actual voltage and current of TEC 2021-01-08 16:18:20 +08:00
3ba2cc9ddc channels: voltage measurement refalect actual voltage across TEC 2021-01-08 15:52:35 +08:00
1539b624bd pid: more sensible default parameters 2021-01-08 11:31:33 +08:00
5c84b7438b Integral rescaling 2021-01-08 11:25:01 +08:00
cc0126636c report save success
save does not hang, it just did not report save success. Closes #33

Reviewed-on: #44
Co-Authored-By: topquark12 <aw@m-labs.hk>
Co-Committed-By: topquark12 <aw@m-labs.hk>
2021-01-07 18:01:43 +08:00
e94601f54f pid: fix derivative calculation
Reviewed-on: #40
Co-Authored-By: topquark12 <aw@m-labs.hk>
Co-Committed-By: topquark12 <aw@m-labs.hk>
2020-12-29 17:09:03 +08:00
8c9e12587f fix simulation math, provided simulation control loop is stable and passes test, reaching simulation cycle limit before settling fails test 2020-12-28 17:38:10 +08:00
7c013ff4a4 PID fixes
Flipped error calculation method to correct behavior of kP and kI terms.

Added anti integral windup to integral handling.

Changed how the i and integral term is calculated, to prevent old kI settings from affecting the current i term calculation when kI is being tuned. Especially noticable when kI is set from a non-zero value to zero.
Co-Authored-By: topquark12 <aw@m-labs.hk>
Co-Committed-By: topquark12 <aw@m-labs.hk>
2020-12-26 11:47:21 +08:00
50a1b9f52d pid: partial -> proportional 2020-12-26 11:01:40 +08:00
9852b32646 command_parser, main: implement ShowCommand::Ipv4
Fixes Gitea issue #30
2020-12-20 20:44:10 +01:00
22b0c9fcad main: don't re- set_ipv4_config every tick 2020-12-20 20:43:20 +01:00
e13ed37271 pid: fix tests 2020-12-20 20:24:24 +01:00
b176fc2788 pid: doc parameters 2020-12-18 16:29:53 +01:00
b717ac5495 pid: update default gain parameters 2020-12-18 16:27:47 +01: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
b7e6cdbec2 pytec: measure interval 2020-12-16 22:14:21 +01:00
b2f455b2cf config: save/store pid_engaged
Fixes Gitea issue #17
2020-12-13 02:33:59 +01:00
ecc00a6aeb init_log: delint 2020-12-13 02:24:29 +01:00
97813f917d flash_store: get to a working state 2020-12-13 01:17:03 +01:00
880a887c40 new flash-based ipv4 config with additional mask_len, gateway 2020-12-12 23:44:16 +01:00
383ebcd8e4 rewrite config for sfkv-based flash_store 2020-12-12 01:25:07 +01:00
5c8bb47e11 command_parser: require the explicit i_set symbol 2020-12-09 01:07:08 +01:00
5ddd4d250e channels: swap adc inputs
Fixes Gitea issue #12
2020-12-07 00:22:00 +01:00
ffb70bde0a command_parser: fix input_remain match 2020-10-30 15:04:14 +01:00
d517dd75fe update dependencies 2020-10-30 15:03:57 +01:00
a943308203 pid: never reset 2020-10-13 23:55:22 +02:00
c005784df5 steinhart_hart: rm outdated doc 2020-10-11 23:20:56 +02:00
d574ccb5f4 pid: change signedness from heating to cooling 2020-10-11 23:12:18 +02:00
6ba1459a3c main: send error on invalid command 2020-10-11 23:11:27 +02:00
a332b5fcdc main: fix saving new_ipv4_address 2020-10-11 01:59:39 +02:00
83a266852a pid: move ki coefficient inside integration 2020-10-11 01:59:39 +02:00
175b88d0e6 s/tecpak/thermostat/g 2020-10-11 01:59:39 +02:00
6fd5328042 channels: rm debug output 2020-10-01 02:09:43 +02:00
59103cb2a1 add support for ipv4 address reconfiguration 2020-10-01 01:34:46 +02:00
12e713dc19 init_log: bump max level to Debug for USB 2020-10-01 00:34:28 +02:00
438da74721 main: remove all plain-text responses 2020-09-30 23:53:13 +02:00
026dd1ed9c main: close tx half of sockets with closed rx half
fixes Gitea issue #9
2020-09-30 23:39:31 +02:00
d4e7036fab session: rename SessionOutput to SessionInput 2020-09-30 23:35:11 +02:00
6e0cf26d6a export postfilter + s-h as json 2020-09-30 22:53:21 +02:00
d4901cbab1 channels: add dac_value to Report 2020-09-30 22:53:03 +02:00
62d89a68a1 pwm: export summary as json 2020-09-30 22:10:42 +02:00
5521563c91 pid: export summary as json 2020-09-30 20:06:47 +02:00
11f2ebe961 channels: DRY get_center(), update vref if used 2020-09-30 19:14:15 +02:00
4b75c6147d pytec plot: update legend, rm debug add pid_output 2020-09-30 19:13:50 +02:00
445cde6ae8 channels: add test report_to_json 2020-09-30 18:01:18 +02:00
6951489545 channels: add pid_output to Report 2020-09-30 18:00:16 +02:00
407c0998af ad7172: set output data rate to 10 Hz 2020-09-28 01:24:32 +02:00
9e5a58cafd main: switch reports to json serialization 2020-09-27 23:58:03 +02:00
aea306cf17 config: save postfilter setting 2020-09-26 01:40:01 +02:00
97a09e422b main: add support for disabling postfilters 2020-09-26 01:29:35 +02:00
61d2cd6ecf channels: init i_set at centerpoint 2020-09-25 22:56:23 +02:00
f3ec96f425 channels: fix doc 2020-09-25 22:55:48 +02:00
9f70ef2e0a main: power_down channels before sys_reset 2020-09-25 22:24:43 +02:00
83589610b5 implement reset command 2020-09-25 00:14:29 +02: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
f690599f9e config: update tests 2020-09-24 23:21:54 +02:00
b3e9a1b636 init_log: set USB_LOGGER max level 2020-09-24 23:11:23 +02:00
bfbf037006 config: add load/save code 2020-09-24 23:10:47 +02:00
a1ad9b2456 main: load config from eeprom on boot 2020-09-24 23:08:42 +02:00
8d70c03520 config: finalize load/save 2020-09-24 23:04:29 +02:00
3b050347d4 config: add test_encode_decode 2020-09-24 21:35:15 +02:00
254c1c3d73 remove now unneeded uom feature use_serde 2020-09-24 21:33:42 +02:00
5a293a0ada config: convert steinhart_hart::Parameters to SteinhartHartConfig for f32 storage 2020-09-24 21:32:56 +02:00
daa398cb5e config: add pwm limits 2020-09-24 21:10:27 +02:00
17e89b2041 config: add test_fit_eeprom 2020-09-24 20:59:04 +02:00
58e648b5e0 pid::Parameters, CenterPoint: demote f32 fields to save config space 2020-09-24 20:47:02 +02:00
c5c0ce5625 channels: rm debug output 2020-09-24 19:49:11 +02:00
d3606d25b6 fix imports 2020-09-24 15:49:13 +08:00
d40a038c2f config: switch to postcard encoding 2020-09-24 02:06:53 +02:00
5d0d75d395 config: encode with serde_cbor 2020-09-24 01:18:33 +02:00
93f14523d7 command_parser: parse load/save 2020-09-24 01:17:50 +02:00
201701ee8b implement mac address generation with reading eui48 from i2c eeprom 2020-09-24 00:19:07 +02:00
a84242fb1f implement setting i_set centerpoint 2020-09-23 22:30:04 +02:00
b394cfa3d4 main: remove special handling for PwmPin::ISet 2020-09-23 20:50:50 +02:00
b9902929a9 test: #[allow(unused)] 2020-09-18 01:22:41 +02:00
edc675f5af command_parser: rename a test 2020-09-18 01:16:19 +02:00
a4dde1b8ca delint 2020-09-18 00:55:53 +02:00
7361619a53 pid: update default parameters 2020-09-18 00:41:32 +02:00
34543c8660 pid: only reset after target change 2020-09-18 00:24:00 +02:00
83a209397e fix tests 2020-09-18 00:23:30 +02:00
ba84295ec5 reconnect the pid controller 2020-09-18 00:09:30 +02:00
fb81380955 fix tests
run with `cargo test --target=x86_64-unknown-linux-gnu`
2020-09-17 01:48:27 +02:00
94e0525002 tec_u_meas: subtract vref offset 2020-09-17 01:20:47 +02:00
1157b73f7f max_i_pos/max_i_neg: remove vref from calculation
full duty pwm is at vref already
2020-09-17 01:03:57 +02:00
dd06ae1075 main: improve output 2020-09-16 23:32:48 +02:00
f76ee9a607 separate adc and max vref 2020-09-16 23:31:49 +02:00
fc0ca8b581 calculate i_set current 2020-09-16 22:22:48 +02:00
8c80062da8 use proper units for pwm pins 2020-09-16 22:06:15 +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
b1b6d1ea94 fixes 2020-09-14 00:12:28 +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
4a1ce342a0 pins: enable pwm pins 2020-09-12 00:35:58 +02:00
10208e1ac0 main: bump WATCHDOG_INTERVAL to 1s
required for running Channels.calibrate_dac_value()
2020-09-10 23:28:00 +02:00