Skip to main content

Python Toolbox to draw Control Block Diagrams

Project description

Control Block Diagram

Overview | Quickstart | Examples | Installation

Overview

The control-block-diagram package is a Python Toolbox for drawing block diagrams. It is build upon Pylatex, and therefore, can generate Latex files and also PDF files. It allows you to construct typical control block diagrams with the usual building blocks, i.e., PI-Controllers, Adders, Multiplier. It is also possible to define own blocks.

Getting Started

The easiest way to get started with the ControlBlockDiagram Toolbox is to play around with the Hands On Jupyter Notebook. There the most important functions are explained and demonstrated with simple examples.

Hands On Jupyter Notebook

A basic routine is as simple as:

from control_block_diagram import ControllerDiagram
from control_block_diagram import Point, Box, Connection


if __name__ == '__main__':
    doc = ControllerDiagram()
    
    box_control = Box(Point(0, 0), text='Control')
    box_block = Box(box_control.position.add_x(3), text='Block')
    box_diagram = Box(box_block.position.add_x(3), text='Diagram')

    Connection.connect(box_control.output, box_block.input)
    Connection.connect(box_block.output, box_diagram.input)
    
    doc.save('pdf')
    doc.show()

The output of this code is:

Examples

There are some examples in the examples folder:

Installation

  • Install from GitHub source:
git clone git@github.com:upb-lea/control-block-diagram.git 
cd control-block-diagram
# Then either
python setup.py install
# or alternatively
pip install -e .

# or alternatively
pip install git+https://github.com/upb-lea/control-block-diagram

You also need a latex compiler such as pdfLaTex to create a PDF file. For example, you can get this from the latex distribution MiKTeX.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

control-block-diagram-0.0.1.tar.gz (26.4 kB view hashes)

Uploaded Source

Built Distribution

control_block_diagram-0.0.1-py3-none-any.whl (54.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page