A Pacemaker system modelled in Simulink with a corresponding DCM application
First, clone the repository and navigate to the project directory:
git clone https://github.com/hsidd1/pacemaker-and-DCM
cd pacemaker-and-DCM
To run the Device Controller-Monitor application, you will need Python (3.10 or above) as well as the packages outlined in the requirements file:
python -m pip install -r DCM_group9/requirements.txt
Then the application can be started from the same directory:
python DCM_group9/app.py
Tests are run using pytest
automatically with Python 3.11 in an Ubuntu-latest environment via automated Github Actions CI/CD.
To run tests locally:
./DCM_group9/scripts/run_tests.sh
# Optionally, add flag to generate logs
./DCM_group9/scripts/run_tests.sh -html
MATLAB R2022b (or higher) with Simulink is required along with the following add-ons:
- Embedded Coder
- Fixed-Point Designer
- MATLAB Coder
- Simulink Check
- Simulink Coder
- Simulink Coverage
- Simulink Design Verifier
- Simulink Desktop Real-Time
- Simulink Test
- Stateflow
The Simulink Coder Support Package for NXP FRDM-K64F Board will also need to be installed.
Additionally, HeartView is also required along with the NXP FRDM-K64F board to act as the pacemaker, and Nucleo F446RE to act as the heart.
The Simulink model will need to be opened and the heart and pacemaker will need to be connected to your computer via USB.
Within the Simulink model, the desired pacing mode can be chosen along with other parameters in the default settings, and the result of the heart signal can be viewed in HeartView once the heart characteristics have been specified.
To use the DCM application for pacemaker control and egram data, select "Build, Deploy & Start" in Simulink to load the model to the FRDM-K64F board. The board can then be connected to the device that is running the DCM application, and the pacing mode and parameters can be chosen within the application. If desired, the heart signal data can also be viewed within the DCM application instead of using HeartView to do so.