My control systems prof said every engineer has done an inverted pendulum problem in school and nobody in their career has ever been asked to balance an inverted pendulum. So our final was a thermostat instead.
Possibly useful: A header-only proportional-integral-derivative (PID) controller.

The "Ball on Platform: Edge Balance" one seems super interesting to me.

Is the sample solution just hardcoded or is there some maths behind it to make it work from any location/initial speed?

I'm still on the first level playing with various 'P's and 'D's (no 'I's yet), but I think I have a novel scheme!

    function controlFunction(block)
      let L = Math.floor;
      let x = block.x;

      // Use Collatz. L(x+½) is the closest integer. 
        -(L(x+0.5) % 2 === 0
                        ? x/2     // Even, we chop it
                        : 3*x + 1 // Odd, we triple-plus-one it. 
It's not very good, but it does beat or tie some of my earnest attempts to get below 8 seconds.
Some sort of 'high score' would be nice so I can understand how close my solution is to the ideal.

Pretty neat website overall. Seems like I'll be wasting some time on it.

Ugh, nerd sniped on a Sunday. Great.
This is brilliant, what a good idea.

On the "Cruise Control Intro" challenge it's not made clear what the output of the controlFunction is. Am I returning a throttle position? A delta to the throttle position? Something else?

I didn't have any trouble until I got to "Ball on Platform: Balance" which seems to be multiple steps more difficult than the previous ones.

If the author is here: I would really enjoy leaderboards!
Related: Sabine Hossenfelder made a video back in December on use of AI/ML in Chaos Control which is pretty interesting. TLDR: scientists have known it’s possible to control or steer chaotic systems since the 1990s at least, but AI/ML have recently given them new tools for doing so. One interesting use case example is using ML to control in real-time the plasma in a tokomak reactor. More:

After a course on balancing PID controllers in university, our professor said that something like 90% of PIDs would be on out of the box factory settings..
This is very cool, I like the increasing complexity levels.

I actually made a similar thing based on writing your own autopilot for a Lunar Lander [1]. It's hard to make the difficulty increase linearly though. I like the use of different scenarios in this one.


Can't get better than 0.88sec?

  function controlFunction(block)
  const max_force=1000000000;
  const margin=0.01;
  const friction_comp=0.2;

   return max_force*(1+friction_comp);
  else if(block.x<-1.15*margin)
   return -max_force;
   return -block.x;
Shouldn't this have some thrust limits? I'm not sure if they are added later(I've only seen the first example), but it would make the problems more realistic, interesting and related to control theory.
What's people's record on the first puzzle? My current is 0.42 seconds. (I haven't bothered even loading any of the other puzzles yet)
An “obvious in hindsight” (I missed it) application of control theory in general and PID controllers in particular is exploring more of a corpus when the fleet is less loaded in an IR setting.

@ajtulloch might be the world’s leading expert in making 100 billion bucks in 2 months with a device that can be built out of mechanical parts.

Terry Davis did a nice introduction to PID controllers in his own physics engine SimStructure:
I cheated on level one and entered:

function controlFunction(block) { let x = 5; if (block.dx > 0) { x = block.dx; } if (block.T > 1.75) { return 0; } return 2 * x; }

Yay, a new elevator saga!
I put in large constant forces, but the acceleration doesn't seem to depend on the force (on the inclined car level)
Wish using C was an option, I don't know enough about javascript to start approaching these problems :/
This is really nice! Does anybody know if the source is available? Or something similar with source?
Tutorial #3 0.72s

function controlFunction(block) { return -500 * block.x -60 * block.dx; }

I put in large constant forces, but the acceleration doesn't seem to depend on the force.
This is great!
very cool!