Compare commits
No commits in common. "23d0c470e56c87af2fdf083d0ce058327b0922ac" and "ffcc3f661b10509603f4cf519422a42e827dca39" have entirely different histories.
23d0c470e5
...
ffcc3f661b
18
README.md
18
README.md
|
@ -72,20 +72,20 @@ The scope of this setting is per TCP session.
|
|||
| `report mode` | Show current report mode |
|
||||
| `report mode <off/on>` | Set report mode |
|
||||
| `pwm` | Show current PWM settings |
|
||||
| `pwm <0/1> max_i_pos <amp>` | Set PWM duty cycle for **max_i_pos** to *ampere* |
|
||||
| `pwm <0/1> max_i_neg <amp>` | Set PWM duty cycle for **max_i_neg** to *ampere* |
|
||||
| `pwm <0/1> max_v <volts>` | Set PWM duty cycle for **max_v** to *volt* |
|
||||
| `pwm <0/1> i_set <amp>` | Disengage PID, set **i_set** DAC to *ampere* |
|
||||
| `pwm <0/1> max_i_pos <ratio>` | Set PWM duty cycle for **max_i_pos** to *ampere* |
|
||||
| `pwm <0/1> max_i_neg <ratio>` | Set PWM duty cycle for **max_i_neg** to *ampere* |
|
||||
| `pwm <0/1> max_v <ratio>` | Set PWM duty cycle for **max_v** to *volt* |
|
||||
| `pwm <0/1> <volts>` | Disengage PID, set **i_set** DAC to *ampere* |
|
||||
| `pwm <0/1> pid` | Set PWM to be controlled by PID |
|
||||
| `center <0/1> <volts>` | Set the MAX1968 0A-centerpoint to *volts* |
|
||||
| `center <0/1> vref` | Set the MAX1968 0A-centerpoint to measure from VREF |
|
||||
| `pid` | Show PID configuration |
|
||||
| `pid <0/1> target <deg_celsius>` | Set the PID controller target temperature |
|
||||
| `pid <0/1> target <value>` | Set the PID controller target |
|
||||
| `pid <0/1> kp <value>` | Set proportional gain |
|
||||
| `pid <0/1> ki <value>` | Set integral gain (unit: 10 Hz) |
|
||||
| `pid <0/1> kd <value>` | Set differential gain (unit: 0.1 seconds) |
|
||||
| `pid <0/1> output_min <amp>` | Set mininum output |
|
||||
| `pid <0/1> output_max <amp>` | Set maximum output |
|
||||
| `pid <0/1> output_min <value>` | Set mininum output |
|
||||
| `pid <0/1> output_max <value>` | Set maximum output |
|
||||
| `pid <0/1> integral_min <value>` | Set integral lower bound |
|
||||
| `pid <0/1> integral_max <value>` | Set integral upper bound |
|
||||
| `s-h` | Show Steinhart-Hart equation parameters |
|
||||
|
@ -151,7 +151,7 @@ Use the `pwm` command to see current settings and maximum values.
|
|||
| `max_v` | Volts | Maximum voltage |
|
||||
| `max_i_pos` | Amperes | Maximum positive current |
|
||||
| `max_i_neg` | Amperes | Maximum negative current |
|
||||
| `i_set` | Amperes | (Not a limit; Open-loop mode) |
|
||||
| | Amperes | Output current control (Open-loop mode) |
|
||||
|
||||
Example: set the maximum voltage of channel 0 to 1.5 V.
|
||||
```
|
||||
|
@ -166,7 +166,7 @@ channel.
|
|||
|
||||
Example: set output current of channel 0 to 0 A.
|
||||
```
|
||||
pwm 0 i_set 0
|
||||
pwm 0 0
|
||||
```
|
||||
|
||||
## PID-stabilized temperature control
|
||||
|
|
17
shell.nix
17
shell.nix
|
@ -1,17 +0,0 @@
|
|||
{ mozillaOverlay ? builtins.fetchTarball "https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz"
|
||||
}:
|
||||
let
|
||||
pkgs = import <nixpkgs> {
|
||||
overlays = [ (import mozillaOverlay) ];
|
||||
};
|
||||
rust = pkgs.rustChannelOfTargets "nightly" null [ "thumbv7em-none-eabihf" ];
|
||||
in
|
||||
pkgs.mkShell {
|
||||
name = "thermostat-env";
|
||||
buildInputs = with pkgs; [
|
||||
rust gcc
|
||||
openocd
|
||||
] ++ (with python3Packages; [
|
||||
numpy matplotlib
|
||||
]);
|
||||
}
|
|
@ -249,16 +249,6 @@ fn pwm_setup(input: &[u8]) -> IResult<&[u8], Result<(PwmPin, f64), Error>> {
|
|||
result.map(|value| (pin, value));
|
||||
|
||||
alt((
|
||||
map(
|
||||
preceded(
|
||||
tag("i_set"),
|
||||
preceded(
|
||||
whitespace,
|
||||
float
|
||||
)
|
||||
),
|
||||
result_with_pin(PwmPin::ISet)
|
||||
),
|
||||
map(
|
||||
preceded(
|
||||
tag("max_i_pos"),
|
||||
|
@ -288,6 +278,8 @@ fn pwm_setup(input: &[u8]) -> IResult<&[u8], Result<(PwmPin, f64), Error>> {
|
|||
)
|
||||
),
|
||||
result_with_pin(PwmPin::MaxV)
|
||||
),
|
||||
map(float, result_with_pin(PwmPin::ISet)
|
||||
))
|
||||
)(input)
|
||||
}
|
||||
|
@ -536,8 +528,8 @@ mod test {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn parse_pwm_i_set() {
|
||||
let command = Command::parse(b"pwm 1 i_set 16383");
|
||||
fn parse_pwm_manual() {
|
||||
let command = Command::parse(b"pwm 1 16383");
|
||||
assert_eq!(command, Ok(Command::Pwm {
|
||||
channel: 1,
|
||||
pin: PwmPin::ISet,
|
||||
|
|
Loading…
Reference in New Issue