10 #include "../includes/parameters.h"
11 #include "../includes/ventilation_controller.h"
20 void setup()
override;
54 int32_t
PCexpiratoryPID(int32_t targetPressure, int32_t currentPressure, int32_t dt);
Controller for the Volume Controled mode.
uint16_t m_blowerSpeed
Current blower speed.
struct Alarms enabledAlarms() const override
List of alarms that must be enabled for this mode.
int32_t m_blowerTicks
Blower ticks.
void endCycle() override
End the current breathing cycle.
int32_t m_inspiratoryFlowLastValuesIndex
Last flow index.
void calculateBlower()
Determine the blower speed to adopt for next cycle.
int32_t PCexpiratoryPID(int32_t targetPressure, int32_t currentPressure, int32_t dt)
PID to control the patient valve during some specific steps of the cycle.
VC_CMV_Controller()
Default constructor.
void exhale() override
Control the exhalation.
int32_t m_inspiratoryPidIntegral
Integral gain of the inspiratory PID.
int32_t m_expiratoryPidLastErrorsIndex
Last error index in expiratory PID.
void initCycle() override
Begin a new breathing cycle.
int32_t m_maxInspiratoryFlow
Max flow during inspiration.
int32_t m_expiratoryPidLastErrors[PC_NUMBER_OF_SAMPLE_DERIVATIVE_MOVING_MEAN]
Last errors in expiratory PID.
int32_t m_expiratoryPidIntegral
Integral gain of the expiratory PID.
void setup() override
Initialize controller.
bool m_expiratoryPidFastMode
Fast mode at start of expiration.
int32_t m_inspiratoryFlowLastValues[NUMBER_OF_SAMPLE_LAST_VALUES]
Last flow values.
int32_t m_expiratoryPidLastError
Error of the last computation of the PID.
int32_t m_expiratoryValveLastAperture
Last aperture of the blower valve.
int32_t m_targetFlowMultiplyBy1000
int32_t m_inspiratoryValveLastAperture
Last aperture of the inspiratory valve.
void inhale() override
Control the inhalation.
Abstract class for ventilation controllers.
#define NUMBER_OF_SAMPLE_LAST_VALUES
#define PC_NUMBER_OF_SAMPLE_DERIVATIVE_MOVING_MEAN
List of alarms (named by their code)
VC_CMV_Controller vcCmvController