Commit Graph

34 Commits

Author SHA1 Message Date
9848c65de5 Fix command parser failing test due to changes 2024-10-21 15:51:21 +08:00
069d791802 Rename all Steinhart-Hart references to B-param
The Steinhart-Hart equation was changed in code long ago to the
B-parameter equation. Rename references to it and the interface
accordingly. The `s-h` command is now `b-p`.

The reason the name "B-Parameter" equation was chosen over
"Beta-Parameter" was due to its easier searchability.
2024-10-21 15:44:46 +08:00
f68ae12c8d TCP command: Rename pwm to output
Current limit pins are driven by PWM inputs to the MAX1968 driver, but
this is an implementation detail, and should not be exposed in the form
of the command interface. Rename "pwm" to "output" in all instances.

See M-Labs/thermostat#62 (comment).
2024-10-21 10:09:24 +08:00
d8ec083dbc Apply clippy suggestions 2024-10-14 13:25:49 +08:00
1962135e79 Apply cargo fmt 2024-10-14 13:25:49 +08:00
fcb5cf1d4e Add command parser test for polarity command 2024-10-14 12:46:13 +08:00
32bd49b258 Add a command to reverse the output polarity
Effectively flips all values related to the directionality of current
through the TEC, including current maximums. The reversed status is
stored in the flash store and will be loaded on reset once saved.

The command is "pwm <ch> polarity <normal/reversed>", where the "normal"
polarity is indicated by the front panel markings.

This is needed for IDC cable connections to the Sinara 5432 DAC
"Zotino", since the TEC pins of the 10-pin connector on the Thermostat
and Zotino have opposite polarities.
2024-09-30 17:36:47 +08:00
b336c4f993 Remove report mode
As the report mode command breaks the send-receive architecture model of
the command interface, and is deemed an anti-feature, making clients
difficult to write, remove it from the firmware entirely.
2024-09-25 17:19:34 +08:00
570c0324b3 implement support for fan PWM
Co-authored-by: Egor Savkin <es@m-labs.hk>
Co-committed-by: Egor Savkin <es@m-labs.hk>
2023-03-22 17:15:49 +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
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
9852b32646 command_parser, main: implement ShowCommand::Ipv4
Fixes Gitea issue #30
2020-12-20 20:44:10 +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
ffb70bde0a command_parser: fix input_remain match 2020-10-30 15:04:14 +01:00
59103cb2a1 add support for ipv4 address reconfiguration 2020-10-01 01:34:46 +02:00
97a09e422b main: add support for disabling postfilters 2020-09-26 01:29:35 +02:00
83589610b5 implement reset command 2020-09-25 00:14:29 +02:00
58e648b5e0 pid::Parameters, CenterPoint: demote f32 fields to save config space 2020-09-24 20:47:02 +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
a84242fb1f implement setting i_set centerpoint 2020-09-23 22:30:04 +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
fb81380955 fix tests
run with `cargo test --target=x86_64-unknown-linux-gnu`
2020-09-17 01:48:27 +02:00
8c80062da8 use proper units for pwm pins 2020-09-16 22:06:15 +02:00
ba860e52ac control i_set dac in volts 2020-05-17 01:27:47 +02:00
2e72a03b93 steinhart_hart: fix equation 2020-03-19 22:56:14 +01:00
bec7019f3a delint 2020-03-19 22:21:17 +01:00
e5b4789304 replace dependency lexical-core with num-traits 2020-03-19 19:51:59 +01:00
da4aaf4ff6 implement all the tcp commands 2020-03-19 18:34:57 +01:00
0f4442b124 switch pid+steinhart_hart parameters from f32 to f64 2020-03-18 21:56:52 +01:00
69a4f5a5d2 merge the network code 2020-03-13 23:39:22 +01:00