Skip to content

Commit

Permalink
"disabled second pinch valve; updates #1293"
Browse files Browse the repository at this point in the history
  • Loading branch information
martukas committed Jul 31, 2022
1 parent 58f8801 commit b2b79ef
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
21 changes: 11 additions & 10 deletions software/controller/lib/core/v03system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ SensorReadings V03Sensors::get_readings() const {

void V03Actuators::init(NVParams::Handler *nv_params) {
blower_pinch_.emplace("blower_valve_", " of the blower pinch valve", BlowerValveMotorIndex);
exhale_pinch_.emplace("exhale_valve_", " of the exhale pinch valve", ExhaleValveMotorIndex);
// exhale_pinch_.emplace("exhale_valve_", " of the exhale pinch valve", ExhaleValveMotorIndex);

// For now, the blower uses default calibration values, linearly spaced between 0 and 1
blower_.emplace(BlowerChannel, BlowerFreq, CPUFrequency, "blower_", " of the blower");
Expand All @@ -101,7 +101,7 @@ void V03Actuators::init(NVParams::Handler *nv_params) {

// In case init was called with nullptr, these fail silently
blower_pinch_->LinkCalibration(nv_params, offsetof(NVParams::Structure, blower_pinch_cal));
exhale_pinch_->LinkCalibration(nv_params, offsetof(NVParams::Structure, exhale_pinch_cal));
// exhale_pinch_->LinkCalibration(nv_params, offsetof(NVParams::Structure, exhale_pinch_cal));
blower_->LinkCalibration(nv_params, offsetof(NVParams::Structure, blower_cal));
psol_->LinkCalibration(nv_params, offsetof(NVParams::Structure, psol_cal));

Expand All @@ -117,9 +117,10 @@ void V03Actuators::init(NVParams::Handler *nv_params) {

// Return true if all actuators are enabled and ready for action
bool V03Actuators::ready() {
return blower_pinch_.has_value() && blower_pinch_->IsReady() && exhale_pinch_.has_value() &&
exhale_pinch_->IsReady() && blower_.has_value() && psol_.has_value() &&
led_red_.has_value() && led_yellow_.has_value() && led_green_.has_value();
return blower_pinch_.has_value() && blower_pinch_->IsReady() &&
// exhale_pinch_.has_value() && exhale_pinch_->IsReady() &&
blower_.has_value() && psol_.has_value() && led_red_.has_value() &&
led_yellow_.has_value() && led_green_.has_value();
// but not buzzer
}

Expand All @@ -137,11 +138,11 @@ void V03Actuators::execute(const ActuatorsState &desired_state) {
}

// Set the exhale pinch valve position
if (desired_state.exhale_valve.has_value()) {
exhale_pinch_->SetOutput(*desired_state.exhale_valve);
} else {
exhale_pinch_->Disable();
}
// if (desired_state.exhale_valve.has_value()) {
// exhale_pinch_->SetOutput(*desired_state.exhale_valve);
// } else {
// exhale_pinch_->Disable();
// }

psol_->set(desired_state.fio2_valve);

Expand Down
2 changes: 1 addition & 1 deletion software/controller/lib/core/v03system.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class V03Actuators : public AbstractActuators {

private:
std::optional<PinchValve> blower_pinch_{std::nullopt};
std::optional<PinchValve> exhale_pinch_{std::nullopt};
// std::optional<PinchValve> exhale_pinch_{std::nullopt};
// Blower, PSol and buzzer use pwm pins and need to be instantiated after HAL, therefore we use
// std::optional to delay the instantiation within init function.
std::optional<PwmActuator> blower_{std::nullopt};
Expand Down

0 comments on commit b2b79ef

Please sign in to comment.