Presentation is loading. Please wait.

Presentation is loading. Please wait.

Interactive CARA Simulation Prof. Insup Lee. Hierarchical EFSM Specification for CARA.

Similar presentations


Presentation on theme: "Interactive CARA Simulation Prof. Insup Lee. Hierarchical EFSM Specification for CARA."— 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 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 Explanations (1)

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 GUIAfter click “start ok” buttonRunning 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 Swing Pressure Sensor Quanser MultiQ Luer Connector 1/8” PP Tubing Data Starting Condition

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

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

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

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

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

26

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


Download ppt "Interactive CARA Simulation Prof. Insup Lee. Hierarchical EFSM Specification for CARA."

Similar presentations


Ads by Google