Skip to content

A Python package implementing a hybrid Model Predictive Control (MPC) and Real-Time Control (RTC) strategy for intelligent energy management in highly electrified buildings, optimizing consumption while respecting grid limits.

License

hq-opensource/predictive-control

Repository files navigation

Predictive Control

License Contributing

This repository contains the predictive_control Python package, which implements a robust and flexible hybrid control strategy combining Model Predictive Control (MPC) and Real-Time Control (RTC). Designed for intelligent energy management in highly electrified residential homes, this package optimizes energy consumption while ensuring strict adherence to grid limits and user preferences.

System Architecture

This package is a key component within a larger Building Intelligence ecosystem, as illustrated in the architecture diagram below. It is designed to run as a service that consumes data from the central Core API of the Building Intelligence platform.

Building Intelligence Diagram

The diagram shows three primary layers:

  1. Smart Devices: The source of data from various building assets (e.g., HVAC, EV chargers) using protocols like Modbus and Bacnet.
  2. Building Intelligence Platform: The core infrastructure (a separate software repository) that gathers, stores, and processes data, making it available via a Core API.
  3. Grid Services: A set of applications that consume the API data to provide value-added services.

The predictive_control package provides the implementation for the grid services highlighted in red: CLPU - Predictive (MPC+RTC) and Dynamic Tariffs (MPC). If you want more information about the main platform, you can visit its Documentation or GitHub Repository.


Key Features

  • Hybrid Control Strategy (MPC + RTC): Proactively plans energy usage with MPC and provides immediate, reactive adjustments with RTC to handle unforeseen consumption spikes.
  • Flexible Device Integration: Offers a standardized DeviceMPC interface for seamless integration of various controllable devices (e.g., HVAC, water heaters, electric vehicles, batteries).
  • User-Centric Optimization: Balances energy cost minimization with occupant comfort by incorporating dynamic pricing and thermal models.

Getting Started

Prerequisites

Installation

  1. Clone the repository:

    git clone https://github.com/hq-opensource/predictive-control.git
    cd predictive-control
  2. Install dependencies using Poetry: This command will create a virtual environment and install all the necessary packages defined in pyproject.toml.

    poetry install

Usage

Running with Docker

The easiest way to run the application is by using the provided Docker container.

  1. Build the Docker image:

    docker build -t predictive-control .
  2. Run the Docker container:

    docker run predictive-control

Running with Poetry

You can also run the application directly using the virtual environment managed by Poetry.

  1. Activate the virtual environment:

    poetry shell
  2. Run the application:

    python -m src.cold_pickup_mpc.app

Contributing

See how to contribute to this project here.

License

See the license for this project here.

About

A Python package implementing a hybrid Model Predictive Control (MPC) and Real-Time Control (RTC) strategy for intelligent energy management in highly electrified buildings, optimizing consumption while respecting grid limits.

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published