Commit Graph

390 Commits

Author SHA1 Message Date
814e714477 Use MANIFEST.in 2024-06-28 12:59:53 +08:00
60b81e7142 Move examples into folder 2024-06-28 12:59:53 +08:00
8021faa00d Move gui components into folder 2024-06-28 12:59:53 +08:00
82fb0b0ec6 pyproject.toml fixes 2024-06-28 12:59:53 +08:00
691269cbdc README: Proofread 2024-06-28 12:59:53 +08:00
bdbb7f9b78 Use qtextras 2024-06-28 12:59:53 +08:00
872b7e02f3 Make interrupted connection handling more elegant
* Show a disconnected info box informing the user that the device was
  forcefully disconnected and requires user intervention.

* Don't print exception info to console on connection failure to avoid
  cluttering it up with programmer info.
2024-06-28 12:59:53 +08:00
c978a0dda6 thermostat_data_model -> thermostat 2024-06-28 12:59:53 +08:00
1d2497d734 Class names should be CamelCase 2024-06-28 12:59:53 +08:00
b6692b55a4 Add tooltips in parameter tree 2024-06-28 12:59:53 +08:00
1340057449 flake: sha256 -> hash 2024-06-28 12:59:53 +08:00
b353916188 Put comments in right place 2024-06-28 12:59:53 +08:00
726f1a3657 Restructure GUI Code, Improve and Fix Bugs
- Bugs fix:
1. Params Tree user input will not get overwritten
    by incoming report thermostat_data_model.
2. PID Autotune Sampling Period is now set according to Thermostat sampling interval
3. PID Autotune won't get stuck in Fail State
4. Various types disconnection related Bugs
5. Number of Samples stored in the plot cannot be set
6. Limit the max settable output current to be 2000mA

- Improvement:
1. Params Tree settings can be changed with external json
2. Use a Tab system to show a single channel of config instead of two
3. Expose PID Autotune lookback params
4. Icon is changed to Artiq logo

- Restructure:
1. Restructure the code to follow Model-View-Delegate Design Pattern
2024-06-28 12:59:53 +08:00
8445d3cf3d Finish GUI 2024-06-28 12:59:53 +08:00
c338fbde98 Remove unused as clause 2024-06-28 12:59:53 +08:00
0cc3d8e979 Add paramtree view, without updates
Signed-off-by: Egor Savkin <es@m-labs.hk>

Fix signal blocker argument -atse
2024-06-28 12:59:53 +08:00
1672c72a5f Fix bugs, grammar, text, and refactor into class 2024-06-28 12:59:53 +08:00
81e3c12b1c Change title 2024-06-28 12:59:53 +08:00
dd807cfddc Stop polling drift
Just waiting for the update_s doesn't take into account the time to
execute update_params, and causes time drift.
2024-06-28 12:59:53 +08:00
7868d58569 Remove unused 'as' clause 2024-06-28 12:59:53 +08:00
542bf15e77 Update docs 2024-06-28 12:59:53 +08:00
aeb3c9324d Finish moving over to qasync
Also:

* Add aioclient

The old client is synchronous and blocking, and the only way to achieve
true asynchronous IO is to create a new client that interfaces with
asyncio.

* Finish Nix Flake description and make the GUI available for `nix run`
2024-06-28 12:59:53 +08:00
0244dec5be Try move from Qthreads to qasync
Signed-off-by: Egor Savkin <es@m-labs.hk>
2024-06-28 12:59:53 +08:00
bfb696c1ce Create client watcher, that would poll Thermostat for config
Signed-off-by: Egor Savkin <es@m-labs.hk>
2024-06-28 12:59:53 +08:00
3a72ddc899 Create basic GUI, that would connect and control thermostat's fan
Signed-off-by: Egor Savkin <es@m-labs.hk>
2024-06-28 12:59:53 +08:00
6fe2cfba38 add autotune 2024-06-28 12:59:53 +08:00
44e9130010 Use oxalica's rust-overlay
Follow ARTIQ, and in this project lets us include the version number
directly in flake.nix instead of linking to the toml file of a specific
release date, as we use stable Rust.

Also, from nixpkgs manual:
    both oxalica's overlay and fenix better integrate with nix and cache
    optimizations. Because of this and ergonomics, either of those
    community projects should be preferred to the Mozilla's Rust overlay
    (nixpkgs-mozilla).
2024-06-27 12:42:00 +08:00
5b0c6f7018 Save i_set into ChannelConfig 2024-05-18 10:50:54 +08:00
1007982b48 clamp TEC settings to a valid & design specs range
- Not respecting the design specs can cause hardware to get stuck in unrecoverable state
2024-05-10 15:17:46 +08:00
925601f4f5 rm pid setpoint change kick 2024-05-10 10:29:08 +08:00
8c1cb3117c README: Add notes on i_tec & tec_ireadouts 2024-05-02 17:48:47 +08:00
1fcfe41a63 Add averaging filter on the pin_adc readings
- Adapted from Kirdy Firmware
- Can reduce the i_tec readings noise dispersion
2024-05-02 16:49:55 +08:00
9fce19a418 Revert "Disable feedback current readout on flawed HW Revs"
This reverts commit ae3d8b51d4.
2024-05-02 14:38:40 +08:00
00d5feaa8d Limit i_set within range of MAX1968 chip 2024-04-24 18:05:20 +08:00
09be55e12a Don't load REF pin of MAX1968 chip on HWRevs < 3.0
The REF pin of the MAX1968 on hardware revisions v2.x is missing a
buffer, loading the pin on every CPU ADC read. Avoid reading from it and
leave the pin floating on affected hardware revisions, and return the
nominal 1.5V instead.
2024-04-03 16:32:57 +08:00
76547be90a i_tec -> i_set
i_tec is reserved for the voltage signal coming out of the MAX1968 chip
for now.
2024-02-14 17:27:12 +08:00
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
ae3d8b51d4 Disable feedback current readout on flawed HW Revs
Thermostats v2.2 and below have a noisy and offset feedback current
`tec_i` caused by missing hardware on 2 MAX1968 TEC driver pins:

1. A missing RC filter on the ITEC pin that would have isolated CPU
sampling pulses from the signal; and
2. Some missing buffering on the VREF pin that would have avoided
loading the VREF signal, preventing voltage drops from the nominal 1.5V.

Since the resulting signal `tec_i` derived from these two signals can
have an error of around +/- 100mA, and readback may affect the stability
performance of the Thermostat, disable current readback entirely on
affected hardware revisions for now.

See https://github.com/sinara-hw/Thermostat/issues/117 and
https://github.com/sinara-hw/Thermostat/issues/120.

On hardware revisions v3.x and above, this would be fixed.
2024-01-31 12:12:22 +08:00
17edae44fb README: Proofread fan control documentation 2024-01-30 12:43:19 +08:00
03b4561142 Refactor current_abs_max_tec_i to use uom 2024-01-30 11:41:52 +08:00
631a10938d README: Remove VREF 2024-01-26 17:00:27 +08:00
6cd6a6a2c2 Fix warning '...not permit being left uninit..d'
Put SocketState initialisation logic in new. This avoids using an unsafe
and unnerving MaybeUninit::uninit().assume_init() to initialise an
array, which the compiler yells at since it causes undefined behavior.
2024-01-17 15:29:56 +08:00
b93e2fbb7b Update rust edition 2024-01-17 15:29:56 +08:00
76b95f66e0 Use latest working stable rust 2024-01-17 15:29:41 +08:00
8008870bc1 Switch panic_handler to panic_halt
Move away from panic_abort as it uses intrinsics, which is nightly only.
2024-01-17 15:29:15 +08:00
7646ff9037 README: Avoid deprecated OpenOCD ST-Link config
The config file interface/stlink-v2-1.cfg is deprecated, and the warning
message encourages the switch to interface/stlink.cfg. Do accordingly.
2024-01-04 12:44:52 +08:00
6f81a63d12 Remove unused LED parameters 2023-09-20 15:51:37 +08:00
78012f6fdd flake: Use rust from manifest, not from pkgs
Fix the rustPlatform deprecation warnings properly.
2023-09-20 11:29:38 +08:00
bb4f43fe1c Remove stale reference to channel_state vref 2023-08-22 17:16:25 +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