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)
BoneIO is a compact IO controller for home automation.

Project description BoneIO is a compact IO controller for home automation. Main features of this controller are Compact size (27x11x6)cm - 15 DIN modu

Maciej Krasuski 120 Nov 30, 2022
Bucatini: a soft PIPE PHY for FPGA SerDes

Bucatini: a soft PIPE PHY for FPGA SerDes Bucatini is a noodly gateware layer capable of transforming an FPGA SerDes into a PIPE PHY, allowing you to

Great Scott Gadgets 28 Dec 02, 2022
Testing out some (stolen) DMA code for RP2040 Micropython

RP2040_micropython_dma testing out some (stolen) DMA code for RP2040 Micropython. Heavy inspiration and some code from https://iosoft.blog/2021/10/26/

2 Dec 29, 2022
hardware design of the 250mm drone

hardware design of the 250mm drone

ZJU FAST Lab 645 Dec 25, 2022
A script that publishes power usage data of iDrac enabled servers to an MQTT broker for integration into automation and power monitoring systems

iDracPowerMonitorMQTT This script publishes iDrac power draw data for iDrac 6 enabled servers to an MQTT broker. This can be used to integrate the pow

Lucas Zanchetta 10 Oct 06, 2022
Simple Weather Check base on Hefeng api, Work on raspberry Pi

Simple Weather Check base on Hefeng api, Work on raspberry Pi

Retr0mous 28 Sep 17, 2022
Trajectory optimization package for Mini-Pupper robot

Trajectory optimization package for Mini-Pupper robot Purpose of this repository is to provide low-torque and low-impact trajectory for Mini-Pupper qu

Sotaro Katayama 38 Aug 17, 2022
A LiteX project which builds a SoC with DRAM / HDIM output via the GPDI SYZYGY addon.

ButterStick GPDI LiteX demo A LiteX project which builds a SoC with DRAM / HDIM output via the GPDI SYZYGY addon. Getting started Connect GPDI board t

4 Nov 21, 2021
Home Assistant custom integration to fetch data from Powerpal

Powerpal custom component for Home Assistant Component to integrate with powerpal. This repository and integration is not affiliated with Powerpal. Th

Lawrence 32 Jan 07, 2023
Count the number of people around you 👨‍👨‍👦 by monitoring wifi signals 📡 .

howmanypeoplearearound Count the number of people around you 👨‍👨‍👦 by monitoring wifi signals 📡 . howmanypeoplearearound calculates the number of

Zack 6.7k Jan 07, 2023
LED effects plugin for klipper

This plugin allows Klipper to run effects and animations on addressable LEDs, such as Neopixels, WS2812 or SK6812.

Julian Schill 238 Jan 04, 2023
I made this so I can control my Tapo L510 light bulb and Govee H6159 light strip using the PyP100 module and the Govee public API

TAPO-And-Govee-Controller I made this so I can control my Tapo L510 light bulb and Govee H6159 light strip using the PyP100 module and the Govee publi

James Westhead 0 Nov 23, 2021
This repository contains all the code and files needed to simulate the notspot quadrupedal robot using Gazebo and ROS.

Notspot robot simulation - Python version This repository contains all the files and code needed to simulate the notspot quadrupedal robot using Gazeb

50 Sep 26, 2022
An IoT Trivia app that shows you how to take a JSON web API such as the opentdb.com API and stream and display it on a FeatherS2 in an OLED display.

CircuitPython IoT Trivia ESP32-S2 OLED Version An IoT Trivia app that shows you how to take a JSON web API such as the opentdb.com API and stream and

Kevin Thomas 1 Nov 27, 2021
Modeling and Simulation of Satellite Servicing Manipulators

Modeling and Simulation of Satellite Servicing Manipulators Final Project for the course ENPM662: Introduction to Robot Modeling (Fall 2021). This pro

Adarsh M 1 Jan 24, 2022
Parametric open source reconstructions of Voron printed parts

The Parametric Voron This repository contains Fusion 360 reconstructions of various printed parts from the Voron printers

Matthew Lloyd 26 Dec 19, 2022
Home Assistant component to handle key atom

KeyAtome Home Assistant component to handle key atom, a Linky-compatible device made by Total/Direct-Energie. Installation Either use HACS (default),

18 Dec 21, 2022
a weather application for the raspberry pi and the Pimorioni Inky pHAT.

raspi-weather a weather application for the raspberry pi and the Inky pHAT

Derek Caelin 59 Oct 24, 2022
A simple Python script for toggling Philips Hue Lights by clapping

LightsClap A simple Python script for toggling Philips Hue Lights by clapping Usage pip3 install -r requirements.txt python3 main.py and press the Ent

Flux Industries 2 Nov 16, 2021
Example code and projects for FeatherS2 and FeatherS2 Neo

FeatherS2 & FeatherS2 Neo This repo is a collection of code, firmware, and files

Unexpected Maker 5 Jan 01, 2023