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)
Owner
null
A rubiks cube timer using a distance sensor and a raspberry pi 4, and possibly the pi pico to reduce size and cost.

distance sensor cube timer A rubiks cube timer using a distance sensor and a raspberry pi 4, and possibly the pi pico to reduce size and cost. How to

null 3 Feb 21, 2022
Samples for robotics, node, python, and bash

RaspberryPi Robot Project Technologies: Render: intent Currently designed to act as programmable sentry.

Martin George 1 May 31, 2022
Programming of Robotics Systems course at the University of Aveiro, Portugal, 2021-2022.

Programação de Sistemas Robóticos Miguel Riem Oliveira Universidade de Aveiro 2021-2022 Projeto AtlasCar Projecto RACE IROS 2014 AtlasCar2 ATOM IROS 2

Miguel Riem de Oliveira 22 Jul 13, 2022
Create a low powered, renewable generation forecast display with a Raspberry Pi Zero & Inky wHAT.

GB Renewable Forecast Display This Raspberry Pi powered eInk display aims to give you a quick way to time your home energy usage to help balance the g

Andy Brace 32 Jul 2, 2022
A low power 1U Raspberry Pi cluster server for inexpensive colocation.

Raspberry Pi 1U Server There are server colocation providers that allow hosting a 1U server for as low as $30/month, but there's a catch: There are re

Paul Brown 627 Dec 31, 2022
Mycodo is open source software for the Raspberry Pi that couples inputs and outputs in interesting ways to sense and manipulate the environment.

Mycodo Environmental Regulation System Latest version: 8.12.9 Mycodo is open source software for the Raspberry Pi that couples inputs and outputs in i

Kyle Gabriel 2.3k Dec 29, 2022
OpenStickFirmware is open source software designed to handle any and all tasks required in a custom Fight Stick

OpenStickFirmware is open source software designed to handle any and all tasks required in a custom Fight Stick. It can handle being the brains of your entire stick, or just handling the bells and whistles while your Brook board talks to your console.

Sleep Unit 23 Nov 24, 2022
Open source home automation that puts local control and privacy first.

Home Assistant Open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiast

Home Assistant 57k Jan 1, 2023
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
An open source operating system designed primarily for the Raspberry Pi Pico, written entirely in MicroPython

PycOS An open source operating system designed primarily for the Raspberry Pi Pico, written entirely in MicroPython. "PycOS" is an combination of the

null 8 Oct 6, 2022
Get the AltAz coordinates for a given object using astropy and output on a OLED screen.

Star Coordinates Get the AltAz coordinates for a given object using astropy and output on a OLED screen. As a very very newcomer to the astronomy scen

Craig Cmehil 1 Jan 31, 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
AERO 421: Spacecraft Attitude, Dynamics, and Control Final Project.

AERO - 421 Final Project Redevelopment Spacecraft Attitude, Dynamics, and Control: Simulation to determine and control a satellite's attitude in LEO.

Gagandeep Thapar 3 Dec 16, 2022
ArucoFollow - A script for Robot Operating System and it is a part of a project Robot

ArucoFollow ArucoFollow is a script for Robot Operating System and it is a part

null 5 Jan 25, 2022
DNP3 Stalker is a project to analyze and interact with DNP3 devices

DNP3 Stalker Purpose DNP3 Stalker is a project to analyze and interact with DNP3

Cutaway Security, LLC. 2 Feb 10, 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

null 3 Aug 24, 2022
A simple Picobot project implemented in Python

Python-Picobot A simple Picobot project implemented in Python About Explanation This is my first programming project. Picobot use rules.txt file which

Shayan Shiravani 0 Apr 3, 2022
The main aim of this project is to avoid the accidents in shredding ( Waste Recycling Industry )

shredder-Machine-Hand-Safety The main aim of this project is to avoid the accidents in shredding ( Waste Recycling Industry ) . The Basic function of

Shubham Chaudhari 1 Nov 15, 2021
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