mit-drl / e-vent

MIT Project: A low cost emergency ventilator controller
39 stars 31 forks source link

Fix bug in writeBPM #67

Closed amadoantonini closed 4 years ago

amadoantonini commented 4 years ago

see #66

srinivasboppu commented 4 years ago

Hi,

I have one basic question regarding the way code was written. For instance, during the inhale phase let us assume that motor is drawing too much current or pressure is too much. Then, immediately alarm should be set and inhale cycle should break.

Is there any particular reason interrupts are not used? I was looking for your e-mail ID, but couldn't find it. Therefore, I am posting it here. Excuse me for the same.

teddyort commented 4 years ago

Hi,

I have one basic question regarding the way code was written. For instance, during the inhale phase let us assume that motor is drawing too much current or pressure is too much. Then, immediately alarm should be set and inhale cycle should break.

Is there any particular reason interrupts are not used? I was looking for your e-mail ID, but couldn't find it. Therefore, I am posting it here. Excuse me for the same.

Hi, Thank you for the question. Interrupts would not work to monitor the motor current because it is obtained by querying the serial connection from the Roboclaw and not directly measured.

On the other hand, the pressure threshold could be set via an interrupt. However, since our control loop runs very quickly relatively to changing pressures (>30Hz) we believe it is sufficient to trigger in the loop.