Exercise: Dynamic Gesture on a Simulated Double Pendulum

For this exercise, students will work in pairs to choreograph a single ‘gesture’ in software using a simulation of a two-link arm.

The idealized double pendulum system is one of the simplest examples of a chaotic system. Frictionless and without actuation, it exhibits complex motions with a sensitive dependence to initial conditions.

The simulator adds friction and limited torque actuation at each joint to create a two-link serial chain robot arm which still retains much potential for rich natural dynamics.

The primary tool will be the Double Pendulum Simulator, a prototype for two-link arm control in Python 3 using PyQt5 for visualization and user interface. The sample top-level scripts contains just the control calculations needed to express the behaviors, with the simulator, graphics, and application code bundled in the rcp Python library.

Learning Objectives

  1. Formulating a gestural animation concept as concrete physical movement goals. The gesture should begin and end in a rest position.

  2. Formulating a physical goal as feedback control calculations.

  3. Formulating control calculations in Python as callback functions written as object methods.

  4. Tuning PID feedback control gains interactively on a simulation.

Deliverables

  1. In-class demonstration of simulated behavior.

  2. Short blog post outlining goals, outcomes, and final code.

Technical Approaches

The most straightforward approach is use keyframes to define a sequence of target poses over time, applyign PD servo control at all times to attempt to reach the targets. This will tend to create sudden movements, but depending on parameter choices still produce evocative or natural movements, as the natural dynamics will still constrain the nature of the motion.

However, the underlying mechanism and torque actuation have considerably more freedom than a rigidly-controlled device. A more nuanced solution could smooth interpolation curves or generative functions to define complete trajectories. The result will vary considerably depending upon the specific paths and parameters; with high-bandwith gains, the joints may achieve precise tracking, but in softer regimes still blend between the natural and forced physics.

These approaches still fit within typical animatronic and robotic control. More experimental approaches might use intermittent actuation or non-linear feedback to complement the natural dynamics by ‘pumping’ the system into oscillations. These control strategies can also be cascaded or switched to set up hybrid system with emergent dynamics. These methods are advanced and enter research territory.

Background

Most common definitions of robot include some element of sensing and responding to the world. In many actual robots, this sensing is purely internal in the form of control feedback which regulates movement to achieve a specified position goal, target velocity, or trajectory. This feedback uses proprioceptive sensors to measure joint positions, applies a control model to compute appropriate actuator commands for a known physical system, and then applies force via the actuators. If it works, the mechanism moves closer to the goal state and errors are reduced. If the disturbances are too great, the process can fail to achieve the target or become unstable.

The ideas behind feedback predate robotics: a classic example is the flyball governor, invented in 1788 to regulate steam engine speed. The ideas have been generalized broadly beyond mechanical systems in the study of cybernetics.

A controller ‘closes the loop’ by creating a cyclical energetic and informational pathway including both a process and a representation of that process in the controller. For this exercise, the process will involve a simulated mechanism with torque motors and the representation will involve the idealized system state.

In this view, cause and effect is not well-defined: if the mechanism encounters a disturbance, then the controller will respond with increased torque. Likewise, if the program chooses a new position target, the controller will respond with torque. In equilibrium, both disturbances and goals affect the balance of the system, with the intent of converging in a stable way toward an objective. But the resulting behavior is the composite of both ‘intent’ and ‘reaction’.

One outcome is that even simple feedback-controlled devices can be easily interpreted as ‘alive’ or having ‘purpose’ in the right context, and this effect is what this exercise is intended to explore.

Relevant terms: proportional control, PID control, degree of freedom (DOF), closed-loop control, position target, goal, disturbance, error signal, stability, bandwidth, lag, set point.