16-311 Introduction to Robotics Main         Schedule         Homework         Labs         Links

16-311 Lab 4: Controls

# Challenge Statement

Create a two-wheeled inverted pendulum capable of balancing itself using LEGO sensors.

# Lab Goals

1. Create a robot with a lesser-used configuration (inverted pendulum).
2. Use control principles to enable the vehicle to stay upright.
3. Gain experience tuning controller gains to create a robot that can stay upright in a very small area.

# Background

Principles

You may have to combat the following while developing your machines:

PID Control

PID control, which stands for Proportional-Integral-Derivative control, is an extremely flexible and powerful control method. An output signal $u$ can be generated by summing the three components:

$u\left(t\right)=K$pe(t)+Kiite(τ)dτ+Kdddte(t)

The constants $K$p, $K$i, and $K$d are referred to as the proportional, integral, and derivative constants, or sometimes the PID tuning constants. $e\left(t\right)$ is the error from the desired output at time t. While these exist in continuous space, more practical implementations can be considered below:

$e\left[t\right] = curr_position-goal_position;$

The derivative component can be implemented as the difference between the current and the previous errors, divided by the time between the two. However, in most practical applications the time sampling rate is constant, so we do not divide by a constant and instead modulate $Kd$.

$de\left[t\right] = e\left[t\right]-e\left[t-1\right];$

The integral component is somewhat straightforward, as we can simply sum all the elements in our array (this works especially well if uninitialized values are set to 0). However, for various reasons, we may not actually want an integral term in our system. Depending on the implementation of the integral error, it could dominate the controller over time, or add undesired effects near the beginning of the curve (before the error has had sufficient time to settle).

$sum_e = 0;$

$sum_e\left[t\right] = sum_e+e\left[t\right]$

# Lab Requirements

The specifications for Lab 4 are presented in the following documents. This will be the most up-to-date resource for lab requirements.

2020 Lab 4 Documents

# Extensions

 Last updated 02/07/2018 by Hannah Lyness (c) 1999-2018: Howie Choset, Carnegie Mellon