software:firmware
MakAir Firmware
|
Controller for the CMV mode. More...
#include <pc_cmv_controller.h>
Public Member Functions | |
PC_CMV_Controller () | |
Default constructor. More... | |
void | setup () override |
Initialize controller. More... | |
void | initCycle () override |
Begin a new breathing cycle. More... | |
void | inhale () override |
Control the inhalation. More... | |
void | exhale () override |
Control the exhalation. More... | |
void | endCycle () override |
End the current breathing cycle. More... | |
struct Alarms | enabledAlarms () const override |
List of alarms that must be enabled for this mode. More... | |
Private Member Functions | |
void | calculateBlowerIncrement () |
Determine the blower speed to adopt for next cycle. More... | |
int32_t | PCinspiratoryPID (int32_t targetPressure, int32_t currentPressure, int32_t dt) |
PID to control the blower valve during some specific steps of the cycle. More... | |
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. More... | |
Private Attributes | |
uint16_t | m_plateauStartTime |
Number of ticks when plateau is reached for the first time. More... | |
bool | m_plateauPressureReached |
True if plateau pressure has been reached (but not necessarily converged) More... | |
uint16_t | m_blowerSpeed |
Current blower speed. More... | |
int32_t | m_blowerIncrement |
Current blower speed increment (to apply at the beginning of the next cycle) More... | |
int32_t | m_inspiratoryPidIntegral |
Error of the last computation of the blower PID. More... | |
bool | m_expiratoryPidFastMode |
Fast mode at start of expiration. More... | |
bool | m_inspiratoryPidFastMode |
Fast mode at start of inspiration. More... | |
int32_t | m_expiratoryPidIntegral |
Integral gain of the patient PID. More... | |
int32_t | m_inspiratoryValveLastAperture |
Last aperture of the blower valve. More... | |
int32_t | m_expiratoryValveLastAperture |
Last aperture of the blower valve. More... | |
int32_t | m_expiratoryPidLastError |
Error of the last computation of the expiratory PID. More... | |
int32_t | m_expiratoryPidLastErrors [PC_NUMBER_OF_SAMPLE_DERIVATIVE_MOVING_MEAN] |
Last errors in expiratory PID. More... | |
int32_t | m_expiratoryPidLastErrorsIndex |
Last error index in inspiratory PID. More... | |
int32_t | m_inspiratoryPidLastError |
Error of the last computation of the expiratory PID. More... | |
int32_t | m_inspiratoryPidLastErrors [PC_NUMBER_OF_SAMPLE_DERIVATIVE_MOVING_MEAN] |
Last errors in inspiratory PID. More... | |
int32_t | m_inspiratoryPidLastErrorsIndex |
Last error index in inspiratory PID. More... | |
Controller for the CMV mode.
Definition at line 14 of file pc_cmv_controller.h.
PC_CMV_Controller::PC_CMV_Controller | ( | ) |
Default constructor.
Definition at line 29 of file pc_cmv_controller.cpp.
|
private |
Determine the blower speed to adopt for next cycle.
Definition at line 121 of file pc_cmv_controller.cpp.
|
inlineoverridevirtual |
List of alarms that must be enabled for this mode.
Implements VentilationController.
Definition at line 32 of file pc_cmv_controller.h.
|
overridevirtual |
End the current breathing cycle.
Implements VentilationController.
Definition at line 119 of file pc_cmv_controller.cpp.
|
overridevirtual |
Control the exhalation.
Implements VentilationController.
Definition at line 110 of file pc_cmv_controller.cpp.
|
overridevirtual |
Control the inhalation.
Implements VentilationController.
Definition at line 94 of file pc_cmv_controller.cpp.
|
overridevirtual |
Begin a new breathing cycle.
Implements VentilationController.
Definition at line 54 of file pc_cmv_controller.cpp.
|
private |
PID to control the patient valve during some specific steps of the cycle.
targetPressure | The pressure we want (in mmH2O) |
currentPressure | The pressure measured by the sensor (in mmH2O) |
dt | Time since the last computation (in microsecond) |
Definition at line 262 of file pc_cmv_controller.cpp.
|
private |
PID to control the blower valve during some specific steps of the cycle.
targetPressure | The pressure we want (in mmH2O) |
currentPressure | The pressure measured by the sensor (in mmH2O) |
dt | Time since the last computation (in microsecond) |
Definition at line 163 of file pc_cmv_controller.cpp.
|
overridevirtual |
Initialize controller.
Implements VentilationController.
Definition at line 52 of file pc_cmv_controller.cpp.
|
private |
Current blower speed increment (to apply at the beginning of the next cycle)
Definition at line 76 of file pc_cmv_controller.h.
|
private |
Current blower speed.
Definition at line 73 of file pc_cmv_controller.h.
|
private |
Fast mode at start of expiration.
Definition at line 82 of file pc_cmv_controller.h.
|
private |
Integral gain of the patient PID.
Definition at line 88 of file pc_cmv_controller.h.
|
private |
Error of the last computation of the expiratory PID.
Definition at line 97 of file pc_cmv_controller.h.
|
private |
Last errors in expiratory PID.
Definition at line 99 of file pc_cmv_controller.h.
|
private |
Last error index in inspiratory PID.
Definition at line 101 of file pc_cmv_controller.h.
|
private |
Last aperture of the blower valve.
Definition at line 94 of file pc_cmv_controller.h.
|
private |
Fast mode at start of inspiration.
Definition at line 85 of file pc_cmv_controller.h.
|
private |
Error of the last computation of the blower PID.
Definition at line 79 of file pc_cmv_controller.h.
|
private |
Error of the last computation of the expiratory PID.
Definition at line 104 of file pc_cmv_controller.h.
|
private |
Last errors in inspiratory PID.
Definition at line 106 of file pc_cmv_controller.h.
|
private |
Last error index in inspiratory PID.
Definition at line 108 of file pc_cmv_controller.h.
|
private |
Last aperture of the blower valve.
Definition at line 91 of file pc_cmv_controller.h.
|
private |
True if plateau pressure has been reached (but not necessarily converged)
Definition at line 52 of file pc_cmv_controller.h.
|
private |
Number of ticks when plateau is reached for the first time.
Definition at line 49 of file pc_cmv_controller.h.