The project is an open-source and low-cost kit to get started with underactuated robotics.

Overview

Torque Limited Simple Pendulum

Introduction

The project is an open-source and low-cost kit to get started with underactuated robotics. The kit targets lowering the entry barrier for studying underactuation in real systems which is often overlooked in conventional robotics courses. It implements a torque-limited simple pendulum built using a quasi-direct drive motor which allows for a low friction, torque limited setup. This project describes the offline and online control methods which can be studied using the kit, lists its components, discusses best practices for implementation, presents results from experiments with the simulator and the real system. This repository describes the hardware (CAD, Bill Of Materials (BOM) etc.) required to build the physical system and provides the software (URDF models, simulation and controller) to control it.

See a video the simple pendulum in action:

IMAGE ALT TEXT HERE

Documentation

The hardware setup and the motor configuration are described in their respective readme files. The dynamics of the pendulum are explained here.

In order to work with this repository you can get started here and read the usage instructions here for a description of how to use this repository on a real system. The instructions for testing the code can be found here.

Overview of Methods

Trajectory Optimization tries to find a trajectory of control inputs and states that is feasible for the system while minimizing a cost function. The cost function can for example include terms which drive the system to a desired goal state and penalize the usage of high torques. The following trajectory optimization algorithms are implemented:

Trajectory Following controllers act on a precomputed trajectory and ensure that the system follows the trajectory properly. As the PID and the tvLQR controller react to the actual state of the pendulum they can also be understood as closed loop controllers. The trajectory following controllers implemented in this project are:

Closed Loop or feedback controllers take the state of the system as input and ouput a control signal. Because they are able to react to the current state, they can cope with perturbations during the execution. The following feedback controllers are implemented:

  • Gravity Compensation: A controller compensating the gravitational force acting on the pendulum. The pendulum can be moved as if it was in zero-g.
  • Energy Shaping: A controller regulating the energy of the pendulum. Drives the pendulum towards a desired energy level.
  • Linear Quadratic Regulator (LQR): Linearizes the dynamics around a fixed point and drives the pendulum towards the fixpoint with a quadratic cost function. Only useable in a state space region around the fixpoint.
  • Model predictive control with iLQR: A controller which performs an iLQR optimization at every timestep and executes the first control signal of the computed optimal trajectory.

Reinforcement Learning (RL) can be used to learn a policy on the state space of the robot. The policy, which has to be trained beforehand, receives a state and outputs a control signal like a feedback controller. The simple pendulum is can be formulated as a RL problem with two continuous inputs and one continuous output. Similar to the cost function in trajectory optimization, the policy is trained with a reward function. The controllers acting on the policies are closed loop controllers. The following RL algorithms are implemented:

The implementations of direct collocation and TVLQR make use of drake, iLQR only makes use of the symbolic library of drake, FDDP makes use of Crocoddyl, SAC uses the stable-baselines3 implementation and DDPG is implemented in tensorflow. The other methods use only standard libraries.

The controllers can be benchmarked in simulation with a set of predefined criteria.

Authors

Feel free to contact us if you have questions about the test bench. Enjoy!

Contributing

  1. Fork it (https://github.com/yourname/yourproject/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

See Contributing for more details.

Safety Notes

When working with a real system be careful and mind the following safety measures:

  • Brushless motors can be very powerful, moving with tremendous force and speed. Always limit the range of motion, power, force and speed using configurable parameters, current limited supplies, and mechanical design.

  • Stay away from the plane in which pendulum is swinging. It is recommended to have a safety net surrounding the pendulum in case the pendulum flies away.

  • Make sure you have access to emergency stop while doing experiments. Be extra careful while operating in pure torque control loop.

Acknowledgements

This work has been performed in the VeryHuman project funded by the German Aerospace Center (DLR) with federal funds (Grant Number: FKZ 01IW20004) from the Federal Ministry of Education and Research (BMBF) and is additionally supported with project funds from the federal state of Bremen for setting up the Underactuated Robotics Lab (Grant Number: 201-001-10-3/2021-3-2).

License

This work has been released under the BSD 3-Clause License. Details and terms of use are specified in the LICENSE file within this repository. Note that we do not publish third-party software, hence software packages from other developers are released under their very own terms and conditions, e.g. Stable baselines (MIT License) and Tensorflow (Apache License v2.0). If you install third-party software packages along with this repo ensure that you follow each individual license agreement.


Comments
  • not loading pydrake.symbolic

    not loading pydrake.symbolic

    https://github.com/dfki-ric-underactuated-lab/torque_limited_simple_pendulum/blob/222c610b6ce8e684f7141c1eeddbeb8f85f45b65/software/python/simple_pendulum/trajectory_optimization/ilqr/ilqr.py#L4

    I have installed Drake, and I can import the main module with

    python -c 'import pydrake; print(pydrake.__file__)'
    

    However, when I run the benchmark_controller.py I get

    ModuleNotFoundError: No module named 'pydrake.symbolic'
    

    from the line referenced above. Was this usage deprecated or something?

    If there's an easier way to run some simulation tests, please advise.

    opened by ricopicone 4
  • Is ROS being used in the project?

    Is ROS being used in the project?

    I saw the mention of URDF files but couldnt find a trace of ROS anywhere. If ROS is not used where for example in the project are these URDF files used? I wanted to implment this project but only in simulation. Is this possible without having a physical setup?

    opened by Robotgir 3
  • "J" and "m*cx" are inaccurate in system_identification.py

    https://github.com/dfki-ric-underactuated-lab/torque_limited_simple_pendulum/blob/222c610b6ce8e684f7141c1eeddbeb8f85f45b65/software/python/simple_pendulum/model/system_identification.py#L87-L88

    Hi, J and m*cx may not be accurate in dynamics. It would be better to change to I (Interia) and m respectively.

    opened by Jarvis861 2
  • missing packages encountered when running pytest

    missing packages encountered when running pytest

    https://github.com/dfki-ric-underactuated-lab/torque_limited_simple_pendulum/blob/222c610b6ce8e684f7141c1eeddbeb8f85f45b65/docs/code_testing.md?plain=1#L12

    With a fresh installation, I get

    ModuleNotFoundError: No module named 'eigenpy'
    

    and

    ModuleNotFoundError: No module named 'pydrake'
    

    I didn't install Drake, so the latter may be expected. It looks like EigenPy can't be installed with pip either.

    After installing EigenPy, I'm also getting

    ModuleNotFoundError: No module named 'crocoddyl'
    

    I tried to pip which their site says should work, but no packages were found.

    opened by ricopicone 2
  • setup github actions workflow for continuous integration

    setup github actions workflow for continuous integration

    We should setup a CI/CD pipeline via github so that we can ensure that the software package is always installable on a clean system and the unit testing works.

    You need to include a yml file in order to do this. An example to set this up on github was pointed to me via Alexander Fabisch here: https://github.com/rock-learning/pytransform3d/blob/master/.github/workflows/python-package.yml

    Some further help on this can be found here:

    1. Building and testing with python: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
    2. Supported runners and hardware resources: https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
    3. Getting started with actions: https://docs.github.com/en/actions
    4. Installing dependency software on Ubuntu runners: https://docs.github.com/en/actions/using-github-hosted-runners/customizing-github-hosted-runners#installing-software-on-ubuntu-runners
    opened by shivesh1210 1
  • Title cases in paper.bib

    Title cases in paper.bib

    For your entries in paper.bib, please for this guideline: https://pandoc.org/MANUAL.html#citations.

    In particular, the titles should be capitalized in title case.

    opened by jingnanshi 1
  • paper comments

    paper comments

    Thank you for open sourcing this library. Here are my comments regarding the submitted version of the paper:

    p2: It will be aesthetically more pleasing for the fonts of the variables to be consistent with the equation below. Also mention that the symbols are defined in the equation will be helpful.

    p3: Number the equation and reference it in Figure 1.

    p2: CubeMars_AK_V1.1: is this the actual model number of the controller board? If so, provide the reference to the manual if possible.

    p7: Figure 5: While the criteria have been defined on the previous page, the definitions of how percentages are calculated are not entirely clear. Maybe provide some explanations.

    Let me know if you have more questions. Thank you.

    opened by jingnanshi 1
  • length to CoM 0.045 is wrong

    length to CoM 0.045 is wrong

    https://github.com/dfki-ric-underactuated-lab/torque_limited_simple_pendulum/blob/222c610b6ce8e684f7141c1eeddbeb8f85f45b65/hardware/testbench_description.md?plain=1#L20

    Hi, the length to CoM here is 0.45m instead of 0.045m.

    opened by Jarvis861 1
  • wrong

    wrong "B" matrix in lqr_controller.py

    https://github.com/dfki-ric-underactuated-lab/torque_limited_simple_pendulum/blob/222c610b6ce8e684f7141c1eeddbeb8f85f45b65/software/python/simple_pendulum/controllers/lqr/lqr_controller.py#L39

    Hi, "B" matrix is probably wrong. It should be self.B = np.array([[0, 1/self.m/self.len**2.0]]).T. But this small issue does not affect the final result too much as shown below.

    • True 3 1 lqr_true

    • False 3 2 lqr_false

    Finally, thanks for your sharing! This project does greatly enhance my understanding of control methods.

    opened by Jarvis861 1
  • cannot be run as root

    cannot be run as root

    https://github.com/dfki-ric-underactuated-lab/torque_limited_simple_pendulum/blob/222c610b6ce8e684f7141c1eeddbeb8f85f45b65/docs/installation_guide.md?plain=1#L243

    The script returns an error that it can't be run as root. Remove sudo from this line.

    opened by ricopicone 1
  • encoder

    encoder

    https://github.com/dfki-ric-underactuated-lab/torque_limited_simple_pendulum/blob/222c610b6ce8e684f7141c1eeddbeb8f85f45b65/hardware/testbench_description.md?plain=1#L25

    Include at least a mention that there's an encoder in this for feedback

    opened by ricopicone 1
  • Fixed Control law error in LQRController

    Fixed Control law error in LQRController

    Bugs:

    • The control law used was $u = -K y$, while instead it should've been $u = - K \Delta y$.

    Changes Made:

    • __init__ takes moment_of_inertia as a parameter for added functionality
    • The function set_goal previously had no functionality, now it sets the goal of the controller and recomputes $A$, $K$, and $S$ matrices
    • The control law is changed to $u = -K (y - y_\text{goal})$

    Testing:

    • I tested these changes in our TMotors setup, and they are functional
    opened by Haricharan1212 3
Releases(v1.0.0)
Like htop (CPU and memory usage), but for your case LEDs. 😄

Like htop (CPU and memory usage), but for your case LEDs. 😄

Derek Anderson 3 Dec 08, 2021
Tools and documentation to aid in modifying the ADI ADALM Pluto firmware

Pluto firmware modifications This repository contains tools and documentation to aid in modifying the ADI ADALM Pluto firmware. Extraction of the Plut

Daniel Estévez 28 Dec 21, 2022
This is a collection of python modules that interact with the Ryze Tello drone.

This is a collection of python modules that interact with the Ryze Tello drone.

DJI-SDK 1.2k Jan 03, 2023
Python application, displaying currently played track from Spotify on OLED display connected via I2C

RaspberryPi Spotify OLED Display This application will display currently played track on SSD1306 OLED display connected to RaspberryPi. Displayed stuf

Wojciech Olech 2 Dec 30, 2021
Lenovo Legion 5 Pro 2021 Linux RGB Keyboard Light Controller

Lenovo Legion 5 Pro 2021 Linux RGB Keyboard Light Controller This util allows to drive RGB keyboard light on Lenovo Legion 5 Pro 2021 Laptop Requireme

36 Dec 16, 2022
This repository hosts the code for Stanford Pupper and Stanford Woofer, Raspberry Pi-based quadruped robots that can trot, walk, and jump.

This repository hosts the code for Stanford Pupper and Stanford Woofer, Raspberry Pi-based quadruped robots that can trot, walk, and jump.

Stanford Student Robotics 1.2k Dec 25, 2022
Python library to manipulate Ingenico mobile payment device like iCT220 or iWL220 equipped with Telium Manager. RS232/USB.

Python library to manipulate Ingenico mobile payment device like iCT220 or iWL220 equipped with Telium Manager. RS232/USB.

TAHRI Ahmed R. 72 Dec 24, 2022
The goal of this project is for anyone with an old printer to be able to double-sided printing.

Welcome to PDF-double-side! Hi! I'm 15. I have a old printer so I can't print double-sided outs. The goal of this project is for anyone with an old pr

DejaVu 4 Dec 28, 2021
NYCT-GTFS - Real-time NYC subway data parsing for humans

NYCT-GTFS - Real-time NYC subway data parsing for humans This python library provides a human-friendly, native python interface for dealing with the N

Andrew Dickinson 37 Dec 27, 2022
Pure micropython ESP32 SPI driver for sdcard and screen at the same SPI bus

micropython-esp32-spi-sdcard-and-screen-driver Proof of concept of Pure micropython espidf SPI driver for sdcard with screen at the same SPI bus (exam

Thomas Favennec 7 Mar 14, 2022
Repo for the esp32s2 version of the Wi-Fi Nugget

Repo for the esp32s2 version of the Wi-Fi Nugget

HakCat 30 Nov 05, 2022
Event-based hardware simulation framework

An event-based multi-device simulation framework providing configuration and orchestration of complex multi-device simulations.

Diamond Light Source Controls Group 3 Feb 01, 2022
Simple python3 implementation of microKanren with lots of type annotations for clarity

MicroKanren-py This is (yet another) python implementation of microKanren. It's a reasonably 1:1 translation of the code provided in the paper, but ev

Erik Derohanian 3 Dec 10, 2022
Python script for printing to the Hanshow price-tag

This repository contains Python code for talking to the ATC_TLSR_Paper open-source firmware for the Hanshow e-paper pricetag. Installation # Clone the

12 Oct 06, 2022
LedFx is a network based LED effect controller with support for advanced real-time audio effects

Welcome to LedFx ✨ -Making music come alive! LedFx website: https://ledfx.app/ What is LedFx? What LedFx offers is the ability to take audio input, an

786 Jan 02, 2023
Python information display framework aimed at e-ink devices

My display, using a Raspberry Pi Zero W and Waveshare 6" e-paper hat infodisplay Modular information display framework aimed at e-ink devices. Built u

Niek Blankers 3 Apr 08, 2022
Monitor an EnvisaLink alarm module running Honeywell firmware, and set a Nest device to Home/Away depending on whether the alarm is Disarmed/Away.

Nestalarm Monitor an EnvisaLink alarm module running Honeywell firmware, and set a Nest device to Home/Away depending on whether the alarm is Disarmed

1 Dec 30, 2021
Adafruit IO connected smart thermostat based on CircuitPython.

Adafruit IO Thermostat Adafruit IO connected smart thermostat based on CircuitPython. Background and Motivation I have a 24 V Heat-only system with a

Shubham Chaudhary 1 Jan 18, 2022
A module for cross-platform control of the mouse and keyboard in python that is simple to install and use.

PyUserInput PyUserInput is a group project so we've moved the project over to a group organization: https://github.com/PyUserInput/PyUserInput . That

Paul Barton 1k Dec 27, 2022
hardware design of the 250mm drone

hardware design of the 250mm drone

ZJU FAST Lab 645 Dec 25, 2022