1 / 27

Interactive CARA Simulation

Interactive CARA Simulation. Prof. Insup Lee. Hierarchical EFSM Specification for CARA. Interactive Simulation. CHARON simulator CHARON is able to simulate state flows Each state machine can be simulated in an agent Agents can work concurrently Java-based GUI

soren
Télécharger la présentation

Interactive CARA Simulation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Interactive CARA Simulation Prof. Insup Lee

  2. Hierarchical EFSM Specification for CARA

  3. Interactive Simulation • CHARON simulator • CHARON is able to simulate state flows • Each state machine can be simulated in an agent • Agents can work concurrently • Java-based GUI • Allow user to change the CARA environment online • Display soft button • Display dialog windows • Display run-time pumping mode and pump status • Display the dynamic data and notation • How to fill the gap between CHARON Simulation and GUI • File sim.dat is written by CHARON simulation, and will be read by GUI during running • File gui.dat is written by GUI and will be read by Environment agent in CHARON simulation

  4. CARA Simulation in CHARON • CHARON Features • Architectural Hierarchy • simulate the hierarchical EFSM structure • Each state machine in the EFSM is corresponding to an agent in CHARON • Behavior Hierarchy • Allow to simulate the mode control and state transaction • Discrete & Continuous Variable Updates • Make it possible for time-triggered transaction in CARA

  5. CARA Implementation in CHARON • CARA System • Pump Monitor • Monitor Plug-In • Monitor Continuity • Monitor AirOk • Monitor OccOk • Monitor backEMF • Monitor Impedance • BP monitor • BP Detector • Cuff Detector • AL Detector • PW Detector • BP Handler • Initial Auto-control • Valid BP Handler • Cuff Handler in AC • AL Handler in AC • PW Handler in AC • BP Checker • Control Algorithm • Mode control algorithm • Polling algorithm • Additional simulation • Environment • To catch the changes and setting in GUI • Propaq Platform • To simulate the hardware propaq, buffering the BP values and detecting time • System Clock • To create a system-scale timer

  6. Explanations (1) • Cuff (AL, PW) Detector • Detect BP data stream from Propaq, update cuff (AL, PW) value if new arrival, and calculate the average cuff value every minute • Cuff (AL, PW) Handler in AC • In Auto-control, handle cuff (AL, PW) value to decide whether it is lost, whether it can be as the control BP source, whether it is required to be corroborated, and determine the driven voltage for pump to control the infusion speed

  7. Explanations (2) • Initial Auto-Control • Decide the initial control BP source and value during initial Auto-control stage • Valid BP Handler • keep trace whether the control BP source is valid during Auto-control mode • Mode Control Algorithm • Keep trace the pump mode: unknown, wait, manual, initial auto-control, and auto-control • Polling Algorithm • Keep trace of the back EMF and impedance value to decide the polling status, and get the current flow rate, accumulated infusion volume, and average flow rate every minute

  8. Java-Based GUI By clicking the “Change Conditions” button, users can change the environment setting for CARA (as following figure)

  9. Run-time Dialog Windows • Start Ok Window • When CHARON simulation satisfies the conditions to trigger initial Auto-control mode, it will send a signal to GUI. So, GUI will pop up the “Start Ok Window”. • Set Point Window • After the above ok button is clicked, GUI shows the “change set point” button, if it is pressed, a dialog window will be pop up.

  10. Override Window • During corroboration, CARA allows user to decide whether to override or not. At that time, GUI will pop up such dialog window. • Terminate Window • During Auto-Control mode, a “Terminate AC” button is visible. When it is clicked, another dialog window is available.

  11. Run-Time GUI • During simulation, GUI will display messages and show/hide some buttons corresponding to different mode Initial state of GUI After click “start ok” button Running in Auto-Control mode

  12. M100 Infusion Pump Experiment Design

  13. Motivation We have been modeling an abstract system Physical setup allows us to understand system better, test code against the real hardware.

  14. Hardware Simulation of CARA The Penn Team has developed a hardware platform to simulate the functions of the CARA system and assist in evaluating the simulation software.

  15. Hardware Simulation Components • The hardware consists of four components: • M100 Infusion Pump • 2 1000mL flasks • Pressure Sensor • A/D interface

  16. M100 Infusion Pump The M100 Infusion Pump interfaces with the controlling computer via the gold connector on the right. This allows computer control of the pump’s functions.

  17. Pressure Sensor We built a simple pressure sensor which detects 0 – 6 psi and outputs 0 – 5 volts. It is compatible with our d/a converter and the pressure ranges we wish to experiment with.

  18. Operation of the System • Normal operation consists of running the pump until the pressure in the top flask reaches the desired level. • ‘Since the flask is sealed, pumping fluid into it raises the pressure, and this is detected by the pressure sensor. • The system can also detect and react to faults.

  19. Starting Condition Luer Connector 1/8” PP Tubing Data Pressure Sensor Quanser MultiQ Swing

  20. Pump is Primed Luer Connector 1/8” PP Tubing Data Pressure Sensor Quanser MultiQ Swing

  21. Pumping Starts Luer Connector 1/8” PP Tubing Data Pressure Sensor Quanser MultiQ Swing

  22. Normal Operation Luer Connector 1/8” PP Tubing Data Pressure Sensor Quanser MultiQ Swing

  23. Bleeding Luer Connector 1/8” PP Tubing Data Pressure Sensor Quanser MultiQ Swing

  24. Hardware Prototype • We connected the Simulation and GUI to the hardware setup. • This allowed us to write a CHARON specification and quickly see it run on the actual hardware.

  25. Future Work • Perfect Charon / Gui / Hardware interaction • Build a general purpose prototyping platform based on Charon

More Related