This site is version 0.0.1. Most of the code on this site is drafted by an agent and needs review. I apologize for the AI-speak, we are working on rewriting it!
viv-lang.org

Robotics

Balancing

demoAIRoboticswritten with an agent#7c571971c3

A cart-pole, balanced by a PD controller

The pole starts 15 degrees from upright. A controller that pushes the cart in proportion to the pole's angle and rate, and a little toward the origin, catches it in under two seconds and holds it. At a fifth of the gains it falls.

Cart-pole, released at 15 degrees

 

0.0 / 6.0 s
✓ 3 tests passchecked when the site was built#control#dynamics
ReadOpen in the workbench

Look inside this program

  • Atlas

    The program’s map: every function and which calls which.

  • There’s no recorded run of this program yet.

demoAIRoboticswritten with an agent#f3c5ecc8ff

LQR computes the cart-pole's gains from the Riccati equation

The PD-controlled cart-pole has four gains that were tuned by hand. Linearize the same dynamics, choose how much each state error and each unit of push should cost, and the Riccati equation gives the gains instead. From 25 degrees they land the pole thirteen times closer to upright than the hand-tuned ones, for a third less cost and about the same peak push.

The pole's angle, from 25 degrees
LQR, gains computedPD, gains by hand
−100102000.51.01.52.02.53.0secondsdegrees from upright
✓ 5 tests passchecked when the site was built#control#robotics#lqr
ReadOpen in the workbench

Look inside this program

  • Atlas

    The program’s map: every function and which calls which.

  • There’s no recorded run of this program yet.

Swinging up

demoAIRoboticswritten with an agent#4571864710

A swing-up policy trained offline

An acrobot is two links with one motor, at the elbow; the shoulder turns freely. A linear controller can balance it only near upright, so from hanging down it first has to swing itself up. The swing-up controller here was not derived: it is nine weights found offline by a cross-entropy search over 1600 simulated swings, run as compiled native code, and the page contains only those nine numbers. In your browser the arm swings up in 1.188 seconds, hands over to a balancing controller, and settles to within 0.005 radians of upright.

The arm, driven by the nine trained weights
upright

 

0.0 / 6.8 s
From hanging to balanced
Both joints
shoulder, which has no motorelbow, which has one
−2000200degrees
Elbow torque and total energy
torque at the elbowtotal energy (right axis)
−2002040012345seconds−2002040joulesnewton meters
✓ 7 tests passchecked when the site was built#robotics#control#policy-search#lqr#acrobot
ReadOpen in the workbench

Look inside this program

  • Atlas

    The program’s map: every function and which calls which.

  • There’s no recorded run of this program yet.