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 simple portable USB MIDI controller based on Raspberry-PI Pico and a 16-button keypad, written in Circuit Python

RPI-Pico-16-BTn-MIDI-Controller-using-CircuitPython A simple portable USB MIDI controller based on Raspberry-PI Pico, written in Circuit Python. Link

Rounak Dutta 3 Dec 04, 2022
An open source two key macro-pad modeled to look like a cartoony melting popsicle

macropopsicle An open source two key macro-pad modeled to look like a cartoony melting popsicle. Build instructions Parts List -1x Top case half (3D p

17 Aug 18, 2022
Home Assistant custom component to help ev-chargers stay below peak hourly energy levels.

Peaqev ev-charging Peaqev ev-charging is an attempt of charging an ev without breaching a preset monthly max-peak energy level. In order for this inte

Magnus Eldén 35 Dec 24, 2022
Python implementation of ZMP Preview Control approach for biped robot control.

ZMP Preview Control This is the Python implementation of ZMP Preview Control app

Chaobin 24 Dec 19, 2022
A simple program to make MSI Modern 15 speaker and microphone mute led work.

MSI Modern 15 sound led fixup for linux A simple program to fix the MSI Modern 15 speaker and microphone mute LEDs. Installation Requirements pulsectl

Seyed Danial Movahed 4 Oct 18, 2022
GUI wrapper designed for convenient service work with TI CC1352/CC2538/CC2652 based Zigbee sticks or gateways. Packed into single executable file

ZigStar GW Multi tool is GUI wrapper firtsly designed for convenient service work with Zig Star LAN GW, but now supports any TI CC1352/CC2538/CC2652 b

133 Jan 01, 2023
Vvim - Keyboardless Vim interactions

This is done via a hardware glove that the user wears. The glove detects the finger's positions and translates them into key presses. It's currently a work in progress.

Boyd Kane 8 Nov 17, 2022
Sleep As Android integration for Home Assistant

Sleep As Android custom integration This integration will allow you to get events from your SleepAsAndroid application in a form of the sensor states

Igor 84 Dec 30, 2022
A battery pack simulation tool that uses the PyBaMM framework

Overview of liionpack liionpack takes a 1D PyBaMM model and makes it into a pack. You can either specify the configuration e.g. 16 cells in parallel a

PyBaMM Team 40 Jan 05, 2023
Monitor Live USB Plug In & Plug Out Events

I/O - Live USB Monitoring Author: Jonathan Scott @jonathandata1 Date: 3/13/2021 CURRENT VERSION 1.0 This is just a simple bash script that calls a pyt

Jonathan Scott 17 Dec 03, 2022
Home Assistant custom integration for Yi cameras: yi-hack-MStar, yi-hack-Allwinner and yi-hack-Allwinner-v2

yi-hack Home Assistant integration Overview yi-hack Home Assistant is a custom integration for Yi cameras (or Sonoff camera) with one of the following

roleo 131 Jan 03, 2023
Home-Assistant MQTT bridge for Panasonic Comfort Cloud

Panasonic Comfort Cloud MQTT Bridge Home-Assistant MQTT bridge for Panasonic Comfort Cloud. Note: Currently this brige is a one evening prototype proj

Santtu Järvi 2 Jan 04, 2023
A custom mechanical keyboard inspired by the CFTKB Mysterium

Env-KB A custom mechanical keyboard inspired by the CFTKB Mysterium Build Guide and Parts List What is to do? Right now for the first 5 PCBs I have, i

EnviousData 203 Jan 04, 2023
Turn your Raspberry Pi Pico into a USB Rubber Ducky

pico-ducky Turn your Raspberry Pi Pico into a USB Rubber Ducky Install Requirements CircuitPython for the Raspberry Pi Pico adafruit-circuitpython-bun

Konstantinos 5 Nov 08, 2022
ModbusTCP2MQTT - Sungrow & SMA Solar Inverter addon for Home Assistant

ModbusTCP2MQTT Sungrow & SMA Solar Inverter addon for Home Assistant This addon will connect directly to your Inverter using Modbus TCP. Support model

Teny Smart 40 Dec 21, 2022
Yet another automation project because a smart light is more than just on or off.

Automate home Yet another home automation project because a smart light is more than just on or off. Overview When talking about home automation there

Maja Massarini 62 Oct 10, 2022
CircuitPython library for the CH559 USB to Serial chip

CH559 (USB to Serial) CircuitPython Library Why? Because you might want to get keyboard/mouse/gamepad/HID input into your CircuitPython projects witho

Guy Dupont 3 Nov 19, 2022
An emulated LED scoreboard for Major League Baseball ⚾

An LED scoreboard for Major League Baseball. Displays a live scoreboard for your team's game on that day.

Tyler Porter 8 Apr 08, 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
Alternative firmware for ESP8266 with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at

Alternative firmware for ESP8266/ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability

Theo Arends 59 Dec 26, 2022