Control System Packer is a lightweight, low-level program to transform energy equations into the compact libraries for control systems.

Overview

Control System Packer

alt text

Reliability Rating Version Licence

Control System Packer is a lightweight, low-level program to transform energy equations into the compact libraries for control systems. Packer supports Python 🐍 , C 💻 and C++ 💻 libraries.

Table of Contents

Features

  • Input the energy equations and get a compact library for the chosen language.
  • Parametrize the system for usage with different parameters
  • Get a control system out of robot's physical equations

Our goal is to make the lives of robotics developers easier, so you can just type in the energy equations and obtain ready-to-use libraries. You can import them straight away into the robot for the control!

Why is our project useful and better than the existing solutions?

  • Our system works with any mechanical model. Every model has it's own general positions and energy equations.
  • Most of the programmers used to code and transform these equations manually, there was no popular tool to solve this issue.
  • Complex control tasks are done in high-level PLs (such as Python), but low-level computers usually work this C or C++. We provide fast and easy transition from Python to C or C++.

Supported languages

Packer now supports 2 types of the language libraries:

  • Python - Python libraries
  • C++ - C++ libraries
  • C - C headers

Getting Started

Cloning a repository

  1. Open the command line interface
  2. Using the command line, access a folder in which you want your project to be saved
  3. Type in:
git clone https://github.com/mirnanoukari/Control-System-Packer.git

Installing the package

You can install the package from our branch symbolical-dynamics/lib/dir by running the command:

sudo python3 setup.py develop # for Linux
python3 setup.py develop # for Windows

Importing phase

Python

Then, you need to import Mechanicalsystem class from euler_lagrange to your mechanical system, use one of our examples in the example folder

from lib.symbolical_dynamics.euler_lagrange import MechanicalSystem

Intialization of your system

name_of_your_system = MechanicalSystem(q,K,P,R)
  • q (generalized coordinates)
  • K (kinetic energy)
  • P (potential energy)
  • R (rayleigh dissipative function)

Or you can assign values to your mechanical system using set functions:

name_of_your_system = MechanicalSystem(q)
name_of_your_system.set_kinetic_energy(K)
name_of_your_system.set_potential_energy(P)
name_of_your_system.set_rayleigh(R)

Getting lagrange equations

name_of_your_system.get_lagrange_equations(simp=True)

The model then produces an equation, and results a combined terms of potential energy and inertia matrix.

Great! Now, your system is initialized with values. You can use them both in Python, C and C++ Below we present the usage of both cases.

print(f'\nEquations of motion:\n{name_of_your_system.Q}')
print(f'\nInertia matrix:\n{name_of_your_system.D}')
print(f'\nGeneralized momenta:\n{name_of_your_system.p}')

C

First of all, we should generate headers from Python code:

name_of_your_system.get_headers()

Now you can simply import these headers, and use built-in functions to find exact value for any numerical arguments:

int main(void) { numerical_combined(2,3,4,5,6,7,8,9,0,12,21,result); // Example of usage of generated headers printf("%d", result[0]) return 0; } ">
#include "numerical_combined.h"
#include <stdio.h>
int main(void) {
   numerical_combined(2,3,4,5,6,7,8,9,0,12,21,result);  // Example of usage of generated headers
   printf("%d", result[0])
   return 0;
}

C++

In your python file, set create_cpp to True and generate an optional cpp class file (euler_lagrange.cpp) which will include all our headers in it:

numerical_combined.get_headers(create_cpp=True)

The file euler_lagrange.cpp will contain ready-to-use functions and you can import it in your code:

#include "euler_lagrange.cpp"

Development

Want to contribute? Check out our contribution policy

Technical stack

Glossary

Packer - a program that allows you to turn input (energy equations) into compact libraries for various programming languages.

Control system - a system, which provides the desired response by controlling the output.

Header - a file containing C language declarations and macro definitions to be shared between several source files.

Library - a collection of non-volatile resources used by computer programs for software development.

Energy equations - potential and kinetic energies equations in symbolic format.

Method of Lagrange multipliers - strategy for finding the local maxima and minima of a function subject to equality constraints.

Further Development

At the moment, the development of a reverse conversion to Python is underway, using cython and the PyBind library. It is planned to compare the execution speeds of methods in C ++ and in Python.

License

MIT

Free Software, Hell Yeah!

You might also like...
Using graph_nets for pion classification and energy regression. Contributions from LLNL and LBNL

nbdev template Use this template to more easily create your nbdev project. If you are using an older version of this template, and want to upgrade to

This code extracts line width of phonons from specular energy density (SED) calculated with LAMMPS.

This code extracts line width of phonons from specular energy density (SED) calculated with LAMMPS.

Openfe - Alchemical free energy calculations for the masses

The Open Free Energy library Alchemical free energy calculations for the masses.

banking system with python, beginner friendly, preadvanced level

banking-system-python banking system with python, beginner friendly, preadvanced level Used topics Functions else/if/elif dicts methods parameters hol

This program generates automatically new folders containing old version of program

Automated Folder Versions Generator by Sergiy Grimoldi - V.0.0.2 This program generates automatically new folders containing old version of something

Birthday program - A program that lookups a birthday txt file and compares to the current date to check for birthdays
Birthday program - A program that lookups a birthday txt file and compares to the current date to check for birthdays

Birthday Program This is a program that lookups a birthday txt file and compares

Time tracking program that will format output to be easily put into Gitlab

time_tracker Time tracking program that will format output to be easily put into Gitlab. Feel free to branch and use it yourself! Getting Started Clon

The program converts Swiss notes into American notes
The program converts Swiss notes into American notes

Informatik-Programmieren Einleitung: Das Programm rechnet Schweizer Noten in das Amerikanische Noten um. Der Benutzer kann seine Note eingeben und der

A program that takes Python classes and turns them into CSS classes.
A program that takes Python classes and turns them into CSS classes.

PyCSS What is it? PyCSS is a micro-framework to speed up the process of writing bulk CSS classes. How does it do it? With Python!!! First download the

Comments
Releases(v.1.0.0)
  • v.1.0.0(Sep 28, 2021)

    We are ready to announce our first release! Refer to the project description in the README.md file.
    Be free to leave the feedback on the current version to help us grow!

    Source code(tar.gz)
    Source code(zip)
Owner
mirnanoukari
mirnanoukari
Transform your boring distro into a hacking powerhouse.

Pentizer Transform your boring distro into a hacking powerhouse. Pentizer is a personal project that imports Kali and Parrot repositories in any Debia

Michail Tsimpliarakis 2 Nov 5, 2021
Table (Finnish Taulukko) glued together to transform into hands-free living.

taulukko Table (Finnish Taulukko) glued together to transform into hands-free living. Installation Preferred way to install is as usual (for testing o

Stefan Hagen 2 Dec 14, 2022
Transform a Google Drive server into a VFX pipeline ready server

Google Drive VFX Server VFX Pipeline About The Project Quick tutorial to setup a Google Drive Server for multiple machines access, and VFX Pipeline on

Valentin Beaumont 17 Jun 27, 2022
This is an online course where you can learn and master the skill of low-level performance analysis and tuning.

Performance Ninja Class This is an online course where you can learn to find and fix low-level performance issues, for example CPU cache misses and br

Denis Bakhvalov 1.2k Dec 30, 2022
Low-level Python CFFI Bindings for Argon2

Low-level Python CFFI Bindings for Argon2 argon2-cffi-bindings provides low-level CFFI bindings to the Argon2 password hashing algorithm including a v

Hynek Schlawack 4 Dec 15, 2022
A general purpose low level programming language written in Python.

A general purpose low level programming language written in Python. Basal is an easy mid level programming language compiling to C. It has an easy syntax, similar to Python, Rust etc.

Snm Logic 6 Mar 30, 2022
solsim is the Solana complex systems simulator. It simulates behavior of dynamical systems—DeFi protocols, DAO governance, cryptocurrencies, and more—built on the Solana blockchain

solsim is the Solana complex systems simulator. It simulates behavior of dynamical systems—DeFi protocols, DAO governance, cryptocurrencies, and more—built on the Solana blockchain

William Wolf 12 Jul 13, 2022
Solve various integral equations using numerical methods in Python

Solve Volterra and Fredholm integral equations This Python package estimates Volterra and Fredholm integral equations using known techniques. Installa

Matthew Wildrick Thomas 18 Nov 28, 2022
A web app for presenting my research in BEM(building energy model) simulation

BEM(building energy model)-SIM-APP The is a web app presenting my research in BEM(building energy model) calibration. You can play around with some pa

null 8 Sep 3, 2021
Absolute solvation free energy calculations with OpenFF and OpenMM

ABsolute SOLVantion Free Energy Calculations The absolv framework aims to offer a simple API for computing the change in free energy when transferring

null 7 Dec 7, 2022