Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
HEV - High Energy Ventilator
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
5
Issues
5
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
HEV - High Energy Ventilator
Commits
923e3a9a
Commit
923e3a9a
authored
Jun 29, 2020
by
Karol Hennessy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setting some alarm limits
parent
bcceb3af
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
53 additions
and
42 deletions
+53
-42
AlarmLoop.cpp
arduino/hev_prototype_v1/src/AlarmLoop.cpp
+12
-1
AlarmLoop.h
arduino/hev_prototype_v1/src/AlarmLoop.h
+1
-1
BreathingLoop.cpp
arduino/hev_prototype_v1/src/BreathingLoop.cpp
+2
-2
UILoop.cpp
arduino/hev_prototype_v1/src/UILoop.cpp
+1
-1
common.cpp
arduino/hev_prototype_v1/src/common.cpp
+1
-1
common.h
arduino/hev_prototype_v1/src/common.h
+35
-35
main.cpp
arduino/hev_prototype_v1/src/main.cpp
+1
-1
No files found.
arduino/hev_prototype_v1/src/AlarmLoop.cpp
View file @
923e3a9a
...
...
@@ -46,8 +46,19 @@ void AlarmLoop::fireAlarms() {
_av_controller
.
update
();
}
void
AlarmLoop
::
updateValues
(
readings
<
float
>
fast_data
)
{
void
AlarmLoop
::
updateValues
(
readings
<
float
>
fast_data
,
cycle_readings
cr
)
{
_alarms
.
values
[
ALARM_CODES
::
CHECK_P_PATIENT
]
=
static_cast
<
float
>
(
fast_data
.
pressure_patient
);
_alarms
.
values
[
ALARM_CODES
::
LOW_FIO2
]
=
static_cast
<
float
>
(
cr
.
fiO2_percent
);
_alarms
.
values
[
ALARM_CODES
::
HIGH_FIO2
]
=
static_cast
<
float
>
(
cr
.
fiO2_percent
);
_alarms
.
values
[
ALARM_CODES
::
APNEA
]
=
static_cast
<
float
>
(
cr
.
apnea_index
);
_alarms
.
values
[
ALARM_CODES
::
HIGH_PRESSURE
]
=
static_cast
<
float
>
(
fast_data
.
pressure_patient
);
_alarms
.
values
[
ALARM_CODES
::
HIGH_RR
]
=
static_cast
<
float
>
(
cr
.
respiratory_rate
);
_alarms
.
values
[
ALARM_CODES
::
HIGH_VTE
]
=
static_cast
<
float
>
(
cr
.
exhaled_tidal_volume
);
_alarms
.
values
[
ALARM_CODES
::
HIGH_VTI
]
=
static_cast
<
float
>
(
cr
.
inhaled_tidal_volume
);
_alarms
.
values
[
ALARM_CODES
::
LOW_VTE
]
=
static_cast
<
float
>
(
cr
.
exhaled_tidal_volume
);
_alarms
.
values
[
ALARM_CODES
::
LOW_VTI
]
=
static_cast
<
float
>
(
cr
.
inhaled_tidal_volume
);
_alarms
.
values
[
ALARM_CODES
::
AIR_FAIL
]
=
static_cast
<
float
>
(
fast_data
.
pressure_air_regulated
);
_alarms
.
values
[
ALARM_CODES
::
O2_FAIL
]
=
static_cast
<
float
>
(
fast_data
.
pressure_o2_regulated
);
}
void
AlarmLoop
::
setBatteryThresholds
()
...
...
arduino/hev_prototype_v1/src/AlarmLoop.h
View file @
923e3a9a
...
...
@@ -13,7 +13,7 @@ public:
~
AlarmLoop
();
void
fireAlarms
();
void
updateValues
(
readings
<
float
>
fast_data
);
void
updateValues
(
readings
<
float
>
fast_data
,
cycle_readings
cr
);
float
*
getValues
()
{
return
_alarms
.
values
;
}
float
*
getThresholdsMin
()
{
return
_alarms
.
thresholds_min
;
}
...
...
arduino/hev_prototype_v1/src/BreathingLoop.cpp
View file @
923e3a9a
...
...
@@ -13,7 +13,7 @@ BreathingLoop::BreathingLoop()
_tsig_time
=
tnow
;
_tsig_timeout
=
100
;
_ventilation_mode
=
VENTILATION_MODE
::
TEST
;
_ventilation_mode
=
VENTILATION_MODE
::
PC_AC
;
_bl_state
=
BL_STATES
::
IDLE
;
_bl_laststate
=
BL_STATES
::
IDLE
;
_running
=
false
;
...
...
@@ -251,7 +251,7 @@ void BreathingLoop::updateCycleReadings()
_cycle_index
=
(
_cycle_index
==
CYCLE_AVG_READINGS
-
1
)
?
0
:
_cycle_index
+
1
;
_cycle_readings
.
timestamp
=
tnow
;
_cycle_readings
.
fiO2_percent
=
_readings_avgs
.
o2_percent
;
//
21;
_cycle_readings
.
fiO2_percent
=
_readings_avgs
.
o2_percent
;
//
FIXME
_running_inhale_minute_volume
[
_cycle_index
]
=
_volume_inhale
;
_running_exhale_minute_volume
[
_cycle_index
]
=
_volume_exhale
;
//logMsg(" I, E "+String(_volume_inhale)+ " "+String(_volume_exhale));
...
...
arduino/hev_prototype_v1/src/UILoop.cpp
View file @
923e3a9a
...
...
@@ -193,7 +193,7 @@ void UILoop::reportCycleReadings()
_cycle_data
.
peak_inspiratory_pressure
=
cr
.
peak_inspiratory_pressure
;
_cycle_data
.
plateau_pressure
=
cr
.
plateau_pressure
;
_cycle_data
.
mean_airway_pressure
=
cr
.
mean_airway_pressure
;
_cycle_data
.
fiO2_percent
=
21.0
;
//
cr.fiO2_percent;
_cycle_data
.
fiO2_percent
=
cr
.
fiO2_percent
;
_cycle_data
.
apnea_index
=
cr
.
apnea_index
;
_cycle_data
.
apnea_time
=
cr
.
apnea_time
;
_cycle_data
.
mandatory_breath
=
cr
.
mandatory_breath
;
...
...
arduino/hev_prototype_v1/src/common.cpp
View file @
923e3a9a
...
...
@@ -224,7 +224,7 @@ float adcToO2PercentFloat(float adc, float offset)
float
o2pc
=
100.0
*
PCB_Gain
*
Sensor_Gain
*
ADC_to_Voltage_Gain
*
(
adc
-
offset
);
return
o2pc
;
return
21
;
// FIXME
}
void
logMsg
(
String
s
)
...
...
arduino/hev_prototype_v1/src/common.h
View file @
923e3a9a
...
...
@@ -544,57 +544,57 @@ struct alarms {
};
float
thresholds_min
[
ALARM_CODES
::
ALARMS_COUNT
]
=
{
std
::
numeric_limits
<
float
>::
lowest
(),
// TEMPORARY VALUE DUE TO START FROM 1
std
::
numeric_limits
<
float
>::
lowest
()
,
// APNEA
-
1
,
// APNEA
std
::
numeric_limits
<
float
>::
lowest
(),
// CHECK_VALVE_EXHALE
std
::
numeric_limits
<
float
>::
lowest
(),
// CHECK_P_PATIENT
std
::
numeric_limits
<
float
>::
lowest
(),
// EXPIRATION_SENSE_FAULT_OR_LEAK
std
::
numeric_limits
<
float
>::
lowest
(),
// EXPIRATION_VALVE_Leak
std
::
numeric_limits
<
float
>::
lowest
()
,
// HIGH_FIO2
std
::
numeric_limits
<
float
>::
lowest
()
,
// HIGH_PRESSURE
std
::
numeric_limits
<
float
>::
lowest
()
,
// HIGH_RR
std
::
numeric_limits
<
float
>::
lowest
()
,
// HIGH_VTE
std
::
numeric_limits
<
float
>::
lowest
()
,
// LOW_VTE
std
::
numeric_limits
<
float
>::
lowest
()
,
// HIGH_VTI
std
::
numeric_limits
<
float
>::
lowest
()
,
// LOW_VTI
0
,
// HIGH_FIO2
0
,
// HIGH_PRESSURE
0
,
// HIGH_RR
0
,
// HIGH_VTE
300
,
// LOW_VTE
0
,
// HIGH_VTI
300
,
// LOW_VTI
std
::
numeric_limits
<
float
>::
lowest
(),
// INTENTIONAL_STOP
std
::
numeric_limits
<
float
>::
lowest
()
,
// LOW_BATTERY
std
::
numeric_limits
<
float
>::
lowest
(),
// LOW_FIO2
-
1
.
0
,
// LOW_BATTERY
19
.
5
,
// LOW_FIO2 // 19.5 %
std
::
numeric_limits
<
float
>::
lowest
(),
// OCCLUSION
std
::
numeric_limits
<
float
>::
lowest
()
,
// HIGH_PEEP
std
::
numeric_limits
<
float
>::
lowest
()
,
// LOW_PEEP
std
::
numeric_limits
<
float
>::
lowest
()
,
// AC_POWER_DISCONNECTION
std
::
numeric_limits
<
float
>::
lowest
()
,
// BATTERY_FAULT_SRVC
std
::
numeric_limits
<
float
>::
lowest
()
,
// BATTERY_CHARGE
std
::
numeric_limits
<
float
>::
lowest
()
,
// AIR_FAIL
std
::
numeric_limits
<
float
>::
lowest
()
,
// O2_FAIL
std
::
numeric_limits
<
float
>::
lowest
()
,
// PRESSURE_SENSOR_FAULT
0
,
// HIGH_PEEP
0
,
// LOW_PEEP
-
1
.
0
,
// AC_POWER_DISCONNECTION
-
1
.
0
,
// BATTERY_FAULT_SRVC
-
1
.
0
,
// BATTERY_CHARGE
400
,
// AIR_FAIL
400
,
// O2_FAIL
-
0
.
5
,
// PRESSURE_SENSOR_FAULT
std
::
numeric_limits
<
float
>::
lowest
()
// ARDUINO_FAIL
};
float
thresholds_max
[
ALARM_CODES
::
ALARMS_COUNT
]
=
{
std
::
numeric_limits
<
float
>::
max
()
,
// TEMPORARY VALUE DUE TO START FROM 1
std
::
numeric_limits
<
float
>::
max
()
,
// APNEA
3
,
// APNEA
std
::
numeric_limits
<
float
>::
max
()
,
// CHECK_VALVE_EXHALE
std
::
numeric_limits
<
float
>::
max
()
,
// CHECK_P_PATIENT
std
::
numeric_limits
<
float
>::
max
()
,
// EXPIRATION_SENSE_FAULT_OR_LEAK
std
::
numeric_limits
<
float
>::
max
()
,
// EXPIRATION_VALVE_Leak
std
::
numeric_limits
<
float
>::
max
()
,
// HIGH_FIO2
std
::
numeric_limits
<
float
>::
max
()
,
// HIGH_PRESSURE
std
::
numeric_limits
<
float
>::
max
()
,
// HIGH_RR
std
::
numeric_limits
<
float
>::
max
()
,
// HIGH_VTE
std
::
numeric_limits
<
float
>::
max
()
,
// LOW_VTE
std
::
numeric_limits
<
float
>::
max
()
,
// HIGH_VTI
std
::
numeric_limits
<
float
>::
max
()
,
// LOW_VTI
90
.
0
,
// HIGH_FIO2 // 90%
45
,
// HIGH_PRESSURE
30
,
// HIGH_RR
700
,
// HIGH_VTE
0
,
// LOW_VTE
700
,
// HIGH_VTI
0
,
// LOW_VTI
std
::
numeric_limits
<
float
>::
max
()
,
// INTENTIONAL_STOP
std
::
numeric_limits
<
float
>::
max
()
,
// LOW_BATTERY
std
::
numeric_limits
<
float
>::
max
()
,
// LOW_FIO2
0
.
5
,
// LOW_BATTERY
100
,
// LOW_FIO2
std
::
numeric_limits
<
float
>::
max
()
,
// OCCLUSION
std
::
numeric_limits
<
float
>::
max
()
,
// HIGH_PEEP
std
::
numeric_limits
<
float
>::
max
()
,
// LOW_PEEP
std
::
numeric_limits
<
float
>::
max
()
,
// AC_POWER_DISCONNECTION
std
::
numeric_limits
<
float
>::
max
()
,
// BATTERY_FAULT_SRVC
std
::
numeric_limits
<
float
>::
max
()
,
// BATTERY_CHARGE
std
::
numeric_limits
<
float
>::
max
()
,
// AIR_FAIL
std
::
numeric_limits
<
float
>::
max
()
,
// O2_FAIL
15
,
// HIGH_PEEP
0
,
// LOW_PEEP
0
.
5
,
// AC_POWER_DISCONNECTION
0
.
5
,
// BATTERY_FAULT_SRVC
0
.
5
,
// BATTERY_CHARGE
550
,
// AIR_FAIL
550
,
// O2_FAIL
std
::
numeric_limits
<
float
>::
max
()
,
// PRESSURE_SENSOR_FAULT
std
::
numeric_limits
<
float
>::
max
()
// ARDUINO_FAIL
};
...
...
arduino/hev_prototype_v1/src/main.cpp
View file @
923e3a9a
...
...
@@ -140,7 +140,7 @@ void loop()
breathing_loop
.
updateCycleReadings
();
// update alarm values
// TODO assign more values
alarm_loop
.
updateValues
(
breathing_loop
.
getReadingAverages
());
alarm_loop
.
updateValues
(
breathing_loop
.
getReadingAverages
()
,
breathing_loop
.
getCycleReadings
()
);
// check uC performance of past N cycles
uint32_t
duration
=
micros
()
-
loop_start
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment