software:firmware
MakAir Firmware
|
Controller for the Volume Controled mode. More...
#include <vc_cmv_controller.h>
Public Member Functions | |
VC_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 | calculateBlower () |
Determine the blower speed to adopt for next 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 | |
bool | m_duringPlateau = true |
uint16_t | m_blowerSpeed |
Current blower speed. More... | |
int32_t | m_targetFlowMultiplyBy1000 |
bool | m_expiratoryPidFastMode |
Fast mode at start of expiration. More... | |
int32_t | m_expiratoryPidIntegral |
Integral gain of the expiratory PID. More... | |
int32_t | m_inspiratoryPidIntegral |
Integral gain of the inspiratory PID. More... | |
int32_t | m_inspiratoryValveLastAperture |
Last aperture of the inspiratory 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_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_inspiratoryFlowLastValues [NUMBER_OF_SAMPLE_LAST_VALUES] |
Last flow values. More... | |
int32_t | m_inspiratoryFlowLastValuesIndex |
Last flow index. More... | |
int32_t | m_maxInspiratoryFlow |
Max flow during inspiration. More... | |
int32_t | m_blowerTicks |
Blower ticks. More... | |
Controller for the Volume Controled mode.
Definition at line 14 of file vc_cmv_controller.h.
VC_CMV_Controller::VC_CMV_Controller | ( | ) |
Default constructor.
Definition at line 28 of file vc_cmv_controller.cpp.
|
private |
Determine the blower speed to adopt for next cycle.
Definition at line 164 of file vc_cmv_controller.cpp.
|
inlineoverridevirtual |
List of alarms that must be enabled for this mode.
Implements VentilationController.
Definition at line 32 of file vc_cmv_controller.h.
|
overridevirtual |
End the current breathing cycle.
Implements VentilationController.
Definition at line 162 of file vc_cmv_controller.cpp.
|
overridevirtual |
Control the exhalation.
Implements VentilationController.
Definition at line 151 of file vc_cmv_controller.cpp.
|
overridevirtual |
Control the inhalation.
Implements VentilationController.
Definition at line 81 of file vc_cmv_controller.cpp.
|
overridevirtual |
Begin a new breathing cycle.
Implements VentilationController.
Definition at line 55 of file vc_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 179 of file vc_cmv_controller.cpp.
|
overridevirtual |
Initialize controller.
Implements VentilationController.
Definition at line 51 of file vc_cmv_controller.cpp.
|
private |
Current blower speed.
Definition at line 59 of file vc_cmv_controller.h.
|
private |
Blower ticks.
Definition at line 97 of file vc_cmv_controller.h.
|
private |
Definition at line 56 of file vc_cmv_controller.h.
|
private |
Fast mode at start of expiration.
Definition at line 64 of file vc_cmv_controller.h.
|
private |
Integral gain of the expiratory PID.
Definition at line 67 of file vc_cmv_controller.h.
|
private |
Error of the last computation of the PID.
Definition at line 79 of file vc_cmv_controller.h.
|
private |
Last errors in expiratory PID.
Definition at line 82 of file vc_cmv_controller.h.
|
private |
Last error index in expiratory PID.
Definition at line 85 of file vc_cmv_controller.h.
|
private |
Last aperture of the blower valve.
Definition at line 76 of file vc_cmv_controller.h.
|
private |
Last flow values.
Definition at line 88 of file vc_cmv_controller.h.
|
private |
Last flow index.
Definition at line 91 of file vc_cmv_controller.h.
|
private |
Integral gain of the inspiratory PID.
Definition at line 70 of file vc_cmv_controller.h.
|
private |
Last aperture of the inspiratory valve.
Definition at line 73 of file vc_cmv_controller.h.
|
private |
Max flow during inspiration.
Definition at line 94 of file vc_cmv_controller.h.
|
private |
Definition at line 61 of file vc_cmv_controller.h.