Keyboard Shortcuts
Likes
Search
Controller Updates
In this Topic I will post updates about my code. It is stored at:
Today's Update: ? - Optimized LCD, now responds much faster ? - As consequence I removed dependency on LiquidCrystal_I2C library as the files were cloned for optimization. ? - Enabled Watchdog. If the Controller "gets lost" it should restart in 1 second. Cheers, MV |
OK¡ I guess I am done for today¡ here are the changes for today:
?
1- Timer are protected by roll-over after 50 days with no resets
2- Parameters are automatically stored in non-volatile memory
?
? ?Every time a parameter is changed by the operator it is saved in non-volatile memory after the operator stop making changes:
? ? ?- parameters values are stored into memory AFTER 30 seconds with no parameter change in the UI.
?
? ? Now if a watchdog reset happens the breather will keep going if the ?ventilation parameter was ON.
?
? ? Note: the cycle starts from its beginning¡ if the reset happens when the lung was fully inflated then the inflation will be done once again¡ I hope that there is a relieve pressure system or the ? ?handling for high pressure action works around this.
?
? ? ?Note however, that WDT reset will virtually never happen unless a strong magnetic disturbance hits the device or we have a catastrophic bug in our code.
?
Cheers,
MV
|
Is the latest on Github? Jack, W8TEE
On Sunday, March 29, 2020, 7:46:25 PM EDT, Marcelo Varanda via Groups.Io <mv_email@...> wrote:
OK¡ I guess I am done for today¡ here are the changes for today:
?
1- Timer are protected by roll-over after 50 days with no resets
2- Parameters are automatically stored in non-volatile memory
?
? ?Every time a parameter is changed by the operator it is saved in non-volatile memory after the operator stop making changes:
? ? ?- parameters values are stored into memory AFTER 30 seconds with no parameter change in the UI.
?
? ? Now if a watchdog reset happens the breather will keep going if the ?ventilation parameter was ON.
?
? ? Note: the cycle starts from its beginning¡ if the reset happens when the lung was fully inflated then the inflation will be done once again¡ I hope that there is a relieve pressure system or the ? ?handling for high pressure action works around this.
?
? ? ?Note however, that WDT reset will virtually never happen unless a strong magnetic disturbance hits the device or we have a catastrophic bug in our code.
?
Cheers,
MV
|
The latest code in GitHub should support the PCB. I tested with Arduino Nano and a Parallel LCD.
?
?
?
if your Display is 20x4 the code should just work fine.
Otherwise, set to 1 the desired configuration (and 0 the other option):
? ? #define LCD_CFG_20_COLS ?1
? ? #define LCD_CFG_16_COLS ?0
?
? ? #define LCD_CFG_2_ROWS ?0
? ? #define LCD_CFG_4_ROWS ?1
?
If the Valves control are inverted then just comment the line:
#define VALVE_ACTIVE_LOW
?
?
I/O¡¯s mapping matches the Schematics as following:
?
/**
?*?
?* ? ? ? ? Hardware prototype PCB rev 01
?* ? ? ? ? ? ? ? ? ?Arduino Nano
?* ? ? ? ? ? ? ? ? ?
?**
?*/
//------------ Input Keys ---------------
?
#define KEY_DECREMENT_PIN ? A0
#define KEY_INCREMENT_PIN ? A1
#define KEY_SET_PIN ? ? ? ? A3
?
//------------ Output Valves -----------
#define VALVE_ACTIVE_LOW
?
#define VALVE_IN_PIN ?A4
#define VALVE_OUT_PIN ?A5
?
#ifndef BLUETOOTH_ENABLE
? #define MONITOR_LED_PIN LED_BUILTIN
#else
? #define MONITOR_LED_PIN 13?
#endif
?
//--------- LCD Num Rows ----------
// Default
#define LCD_CFG_20_COLS ?1
#define LCD_CFG_16_COLS ?0
?
#define LCD_CFG_2_ROWS ?0
#define LCD_CFG_4_ROWS ?1
?
// Parallel LCD
#define LCD_CFG_D7 ? ? ?8 ? // Connector Pin 11 - Digital 8
#define LCD_CFG_D6 ? ? ?9 ? // Connector Pin 12 - Digital9
#define LCD_CFG_D5 ? ? ?10 ?// Connector Pin 13 - Digital10
#define LCD_CFG_D4 ? ? ?11 ?// Connector Pin 14 - Digital11
#define LCD_CFG_E ? ? ? 12 ?// Connector Pin 15 - Digital12
#define LCD_CFG_RS ? ? ?13 ?// Connector Pin 16 - Digital13
|
¿ªÔÆÌåÓýThat is really great, Marcelo! Thank you so much for doing all that and showing how to make the changes!!?On Mar 31, 2020, at 19:33, Marcelo Varanda via Groups.Io <mv_email@...> wrote:
|
Have assembled four pusbhbuttons that I'll use RJ45 plug modular connectgions to allow me to move them from device to device (I don't have very many of the push buttons) -- will allow me to see Marcelo's code in action.? ?(Busy working on other issues, PVC outgassing yada yada yada...and getting PC boards manufacturered)
Gordon |
Marcelo -- thanks SO MUCH for making that video and the above explanations.
1.? I have downloaded the github repository explained in post #132? (I still don't have github understood, although installed now, so I just download the entire thing....) 2.? It compiles fine, and I set the parameters in config.h for the only display that I have --- 16x2 3.? THAT IS RUNNING on both my breadboard Ashar 0.1 and real prototype hand-soldered board Ashar 0.1 -- both of which are very similar in display and pushbutton aspects to Ashar 1.0 that is being built in China and USA as we speak.?? 4.? On top line I see? ? ? ? st=idle 5.? Line below that is BLANK 6.? I haven't yet connected the pushbutton array that I constructed last night.? ?Will get that connected today and be better able to test. Thank you,? looking forward to more and more success on the airwayprssure measurement and the flow measurement and integration into the controller!!!!? (I've looked at some of that work you are doing but not tried it yet) gordon gibby |
SUCCESS!!??
I had mis-guessed the order or Marcello's buttons....they worked differently than I had expected, but I have them working now! I am able to step through different parameters and change them.? ? Have not tested the "effect" of each change as of yet. Thanks Marcello for the fix -- the 16x2 display (only one I have at the moment) works well now. THANKS! gordon |
K9HZ
¿ªÔÆÌåÓýFrom the results he sent me¡ it looks like the airway pressure sensor is now integrated and working!? It just needs to show up on the LCD! ? ? Dr. William J. Schmidt - K9HZ J68HZ 8P6HK ZF2HZ PJ4/K9HZ VP5/K9HZ PJ2/K9HZ ? Owner - Operator Big Signal Ranch ¨C K9ZC Staunton, Illinois ? Owner ¨C Operator Villa Grand Piton ¨C J68HZ Soufriere, St. Lucia W.I. Rent it: Like us on Facebook! ? Moderator ¨C North American QRO Group at Groups.IO. ? email:? bill@... ? ? From: [email protected] [mailto:[email protected]] On Behalf Of Gordon Gibby ? Marcelo -- thanks SO MUCH for making that video and the above explanations. |
K9HZ
¿ªÔÆÌåÓýNext ¡ to integrate the flow sensor¡ ? ? Dr. William J. Schmidt - K9HZ J68HZ 8P6HK ZF2HZ PJ4/K9HZ VP5/K9HZ PJ2/K9HZ ? Owner - Operator Big Signal Ranch ¨C K9ZC Staunton, Illinois ? Owner ¨C Operator Villa Grand Piton ¨C J68HZ Soufriere, St. Lucia W.I. Rent it: Like us on Facebook! ? Moderator ¨C North American QRO Group at Groups.IO. ? email:? bill@... ? ? From: [email protected] [mailto:[email protected]] On Behalf Of Marcelo Varanda via groups.io ? Pressure being displayed (but no Alarms yet): |
THANK YOU SO MUCH!!!!!??
This is? GREAT!? ? I appreciate your work, and the time spent explaining it as well. I will grab the code that you explained you have pushed out, and see if? can stick in the simple code that I have for reading the BMP280 and marry the two.?? When actual code gets written (as you are doing!) then the deficiencies of "specifications" come to light.? ?In an answer to Jack, I tried to lay out a more detailed view of what the alarms' actions might look like --- what you've built seems very reasaonable.? ?I have a few suggestions, but I'll bring these up to the design team at UF as well a)? generally with medical devices you can NEVER completely turn off an alarm (which you're allowing after three alarms) -- but nstead you can PAUSE the alarm for typically 60 seconds.? ? I don't know if that comes from a standard or not, but i can tell you I have hit the SILENCE ALARM tens of thousands of times in my career to get a bit to THINK before the alarm returned again.? ?So that might be a thought for changing your alarm-turn-off behavior;? and I apologize that I didn't think of that and document it when Jack asked his question. b)? I haven't studied your code at that point yet, but I suspect you probably called a subroutine to "measure the airway pressure" and likely I can just divert that to different subroutines based on which sensor the builder was able to acquire.? ? We have found hundreds of thousands of the BMP280....and only a thousand TOTAL of the analog output sensor like the NXP product....and work earlier today I have the BMP280 working extremely well even in the presence of strong RF interference.? We have also now managed to glue a nipple (barb) on it so that we can measure the pressure using thin plastic tubing over to the airway -- the normal way to do these things, so that water traps can be placed and protect the sensor from water (which damages it) c)? In the video I think you mentioned measurng the pressures at the middle of the inspiratory cycle.? ?I'll have to look at your code.? ?I think we're going to have measure more often than ONcE, and i'd suggest cutting the inspiration cycle into (configurable?) approximately five time slices and measuring your pressures in the middle of each time slice, or else into approximately 8 time slices and measure on the internal six points of time --- if the LOW limit is not exceeded at least ONCE, then you alarm the low pressure alarms if the HIGH limit is exceeded at ANY of the measursments, then you alarm the high pressure alarms? (and don't forget to close the inspiratory valve immediately upon initiating the high pressure alarm The presence of either of these alarms can continue to ALARM -- but you still proceed with the next breath anyway!? ? While the alarm is being sounded to the opertor, the patient still needs the next breath and the code continues to give them the next breath and also to sample during that next breath.? ? Hope that makes sense..... THANKS!!!!!? Your work is very very much appreciated.? ?I'll grab your code and hopefully have it running on my system in time for the morning phone conference.?? Gordon |