software:firmware
MakAir Firmware
|
Controller for the VSAI mode. More...
#include <pc_vsai_controller.h>
Public Member Functions | |
PC_VSAI_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_triggerWindow |
Number of ticks from which it is possible to trigger a new inspiration. More... | |
bool | m_plateauPressureReached |
True if plateau pressure has been reached (but not necessarily converged) More... | |
uint16_t | m_blowerSpeed |
Current blower speed. More... | |
bool | m_reOpenInspiratoryValve |
True if we want to reopen the inspiratory valve to create a circulation flow able to detect inspiratory flow trigger. More... | |
int32_t | m_inspiratorySlope |
Slope of the inspiration open loop (in mmH2O/s) 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... | |
int32_t | m_inspiratoryPidLastError |
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 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... | |
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 expiratory PID. More... | |
int32_t | m_maxInspiratoryFlow |
Max flow during inspiration. More... | |
Controller for the VSAI mode.
Definition at line 14 of file pc_vsai_controller.h.
PC_VSAI_Controller::PC_VSAI_Controller | ( | ) |
Default constructor.
Definition at line 28 of file pc_vsai_controller.cpp.
|
private |
Determine the blower speed to adopt for next cycle.
Definition at line 172 of file pc_vsai_controller.cpp.
|
inlineoverridevirtual |
List of alarms that must be enabled for this mode.
Implements VentilationController.
Definition at line 32 of file pc_vsai_controller.h.
|
overridevirtual |
End the current breathing cycle.
Implements VentilationController.
Definition at line 170 of file pc_vsai_controller.cpp.
|
overridevirtual |
Control the exhalation.
Implements VentilationController.
Definition at line 139 of file pc_vsai_controller.cpp.
|
overridevirtual |
Control the inhalation.
Implements VentilationController.
Definition at line 102 of file pc_vsai_controller.cpp.
|
overridevirtual |
Begin a new breathing cycle.
Implements VentilationController.
Definition at line 59 of file pc_vsai_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 328 of file pc_vsai_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 227 of file pc_vsai_controller.cpp.
|
overridevirtual |
Initialize controller.
Implements VentilationController.
Definition at line 57 of file pc_vsai_controller.cpp.
|
private |
Current blower speed increment (to apply at the beginning of the next cycle)
Definition at line 83 of file pc_vsai_controller.h.
|
private |
Current blower speed.
Definition at line 73 of file pc_vsai_controller.h.
|
private |
Fast mode at start of expiration.
Definition at line 92 of file pc_vsai_controller.h.
|
private |
Integral gain of the patient PID.
Definition at line 98 of file pc_vsai_controller.h.
|
private |
Error of the last computation of the PID.
Definition at line 107 of file pc_vsai_controller.h.
|
private |
Last errors in expiratory PID.
Definition at line 116 of file pc_vsai_controller.h.
|
private |
Last error index in expiratory PID.
Definition at line 119 of file pc_vsai_controller.h.
|
private |
Last aperture of the blower valve.
Definition at line 104 of file pc_vsai_controller.h.
|
private |
Fast mode at start of inspiration.
Definition at line 95 of file pc_vsai_controller.h.
|
private |
Error of the last computation of the blower PID.
Definition at line 86 of file pc_vsai_controller.h.
|
private |
Error of the last computation of the blower PID.
Definition at line 89 of file pc_vsai_controller.h.
|
private |
Last errors in inspiratory PID.
Definition at line 110 of file pc_vsai_controller.h.
|
private |
Last error index in inspiratory PID.
Definition at line 113 of file pc_vsai_controller.h.
|
private |
Slope of the inspiration open loop (in mmH2O/s)
Definition at line 80 of file pc_vsai_controller.h.
|
private |
Last aperture of the blower valve.
Definition at line 101 of file pc_vsai_controller.h.
|
private |
Max flow during inspiration.
Definition at line 122 of file pc_vsai_controller.h.
|
private |
True if plateau pressure has been reached (but not necessarily converged)
Definition at line 52 of file pc_vsai_controller.h.
|
private |
True if we want to reopen the inspiratory valve to create a circulation flow able to detect inspiratory flow trigger.
Definition at line 77 of file pc_vsai_controller.h.
|
private |
Number of ticks from which it is possible to trigger a new inspiration.
Definition at line 49 of file pc_vsai_controller.h.