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)
A small Python app to converse between MQTT messages and 433MHz RF signals.

mqtt-rf-bridge A small Python app to converse between MQTT messages and 433MHz RF signals. This acts as a bridge between Paho MQTT and rpi-rf. Require

David Swarbrick 3 Jan 27, 2022
Ha-rpi gpio - Home Assistant Raspberry Pi GPIO Integration

Home Assistant Raspberry Pi GPIO custom integration This is a spin-off from the

Shay Levy 98 Dec 24, 2022
MPY tool - manage files on devices running MicroPython

mpytool MPY tool - manage files on devices running MicroPython It is an alternative to ampy Target of this project is to make more clean code, faster,

Pavel Revak 5 Aug 17, 2022
Robot Framework keyword library wrapper for atlassian-python-api

Robot Framework keyword library wrapper for atlassian-python-api

Marcin Koperski 3 Jul 29, 2022
🐱🖨Cat printer is a portable thermal printer sold on AliExpress for around $20.

Cat printer is a portable thermal printer sold on AliExpress for around $20. This repository contains Python code for talking to the cat printer over

671 Jan 05, 2023
A dashboard for Raspberry Pi to display environmental weather data, rain radar, weather forecast, etc. written in Python

Weather Clock for Raspberry PI This project is a dashboard for Raspberry Pi to display environmental weather data, rain radar, weather forecast, etc.

Markus Geiger 1 May 01, 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
Robo Arm :: Rigging is a rigging addon for Blender that helps animating industrial robotic arms.

Robo Arm :: Rigging Robo Arm :: Rigging is a rigging addon for Blender that helps animating industrial robotic arms. It construct serial links(a kind

2 Nov 18, 2021
Sensor of Temperature Feels Like for Home Assistant.

Please ⭐ this repo if you find it useful Sensor of Temperature Feels Like for Home Assistant Installation Install from HACS (recommended) Have HACS in

Andrey 60 Dec 25, 2022
Beam designs for infinite Z 3D printers

A 3D printed beam that is as stiff as steel A while ago Naomi Wu 机械妖姬 very kindly sent us one of Creality's infinite-Z belt printers. Lots of people h

RepRap Ltd 105 Oct 22, 2022
BMP180 sensor driver for Home Assistant used in Raspberry Pi

BMP180 sensor driver for Home Assistant used in Raspberry Pi Custom component BMP180 sensor for Home Assistant. Copy the content of this directory to

747Developments 1 Dec 17, 2021
Shotgrid Toolkit Engine for Gaffer

Shotgun toolkit engine for Gaffer Contact : Diego Garcia Huerta Overview Implementation of a shotgun engine for Gaffer. It supports the classic bootst

Diego Garcia Huerta 12 May 21, 2022
Playing diabolo with two robot arms in ROS + Gazebo

Playing diabolo with robots This repository holds the ROS packages for playing diabolo with two UR5e robot arms on ROS Melodic (Ubuntu 18.04). Read ou

23 Dec 18, 2022
A raspberrypi tools for python

raspberrypi-tools how to install: first clone this project: git clone https://github.com/Ardumine/rpi-tools.git then go to the folder cd rpi-tools and

1 Jan 04, 2022
This repo uses a stereo camera and gray-code-based structured light to realize dense 3D reconstruction.

Structured-light-stereo This repo uses a stereo camera and gray-code-based structured light to realize dense 3D reconstruction. . How to use: STEP 1:

FEI 20 Dec 31, 2022
A simple small scale electric car was build which can be driven by remote control and features a fully autonomous parking procedure.

personal-autonomous-parking-car-raspberry A simple electric car model was build using Raspbery pi. The car has remote control and autonomous operation

Kostas Ziovas 2 Jan 26, 2022
Cascade Drone Swarm Physical Demonstration Project

Cascade Drone Swarm Physical Demonstration Project Table of Contents About The Project Built With Getting Started Prerequisites Installation About The

3 Aug 24, 2022
uOTA - OTA updater for MicroPython

Update your device firmware written in MicroPython over the air. Suitable for private and/or larger projects with many files.

Martin Komon 25 Dec 19, 2022
🐱 Petkit feeder components for HomeAssistant

Petkit for HomeAssistant Installing Download and copy custom_components/xiaomi_miot folder to custom_components folder in your HomeAssistant config fo

62 Dec 29, 2022
Get input from OLED Joystick, Runs command, Displays output on OLED Screen (Great for P4wnP1)

p4wnsolo-joyterm Gets text input from OLED Joystick Runs the command you typed Displays output on OLED Screen (Great for P4wnP1 - even better on Raspb

PawnSolo 7 Dec 19, 2022