Live data from Hacker News

PID Control Challenges

janismac.github.io

81–90 of 123 posts

Re: PID Control Challenges

#81
post #75
post #66

Earlier quoted context omitted.

Why is that cheating? But it is still very slow, I got it down to 0.42 seconds. function controlFunction(block) { const t = Math.round(block.T / 0.02); return (t Misses the target by 6.1E-16 at an velocity of 6.3E-15. But yes, this should probably randomize the initial conditions or parameters like friction and gravity a bit so that you actually have to control the system.

It's cheating because real world PID controllers only apply linear feedback, i.e. feedback expressed by a linear function. Ifs/elses etc. are not linear.

PID controller only appears in the Hacker News title, the URL just says control challenge. Also, why would you allow people to write arbitrary code if you just wanted a PID controller, then you should just allow them tuning the parameters and not write the complete thing themselves.

Re: PID Control Challenges

#83
post #81
post #75

Earlier quoted context omitted.

It's cheating because real world PID controllers only apply linear feedback, i.e. feedback expressed by a linear function. Ifs/elses etc. are not linear.

PID controller only appears in the Hacker News title, the URL just says control challenge. Also, why would you allow people to write arbitrary code if you just wanted a PID controller, then you should just allow them tuning the parameters and not write the complete thing themselves.

True. I'd still argue it's not realistic to use arbitrary code though, as most control problems need linear or at least invertible control laws, and the analysis techniques that provide you with control solutions usually assume so too.

Re: PID Control Challenges

#84
post #7

Earlier quoted context omitted.

It's a nice theoretical implementation but few practical examples would be found using floating-point math, running as they are on systems that don't support it.

Maybe that was true up until the 90's, but doing anything but floating point for a PID is just a waste of development time, even on an 8-bit AVR.

I assume you're referring to applications where it's not important to do proper floating/fixed point design in the first place? Or do you have some other way of avoiding numerical problems?

Re: PID Control Challenges

#85
post #83
post #81

Earlier quoted context omitted.

PID controller only appears in the Hacker News title, the URL just says control challenge. Also, why would you allow people to write arbitrary code if you just wanted a PID controller, then you should just allow them tuning the parameters and not write the complete thing themselves.

True. I'd still argue it's not realistic to use arbitrary code though, as most control problems need linear or at least invertible control laws, and the analysis techniques that provide you with control solutions usually assume so too.

I have no real clue about control theory, what is the advantage of linear or invertible laws?

My idea was to equip the control program with the equations of the system and some unknown parameters for friction and so on. Then estimate the parameters from the response to control inputs and drive the system through state space as hard as possible to get the fastest time, taking into account deviations from the expected state and reestimating parameters each time step. Would be really interested in knowing whether this could work or if this will just consistently slam into a wall. Response delay would probably make this a lot harder, but I did not look if any of the tasks simulates delays.

Re: PID Control Challenges

#86

Earlier quoted context omitted.

My inner child of Doc Brown and Wernher von Kerman says, it's time to develop non-newtonian fuel sponges, which would release fuel if squeezed gently and steadily, but behave like solid if things start shaking too much, preventing sloshing.

Or maybe giant syringes? There can't be sloshing if there is no free space because top of cylinder just moves to adjust volume.

This actually makes perfect sense, so I'm hoping some rocket scientist will come and explain what are the "devils in the details" that prevent rockets from being built like this.

Re: PID Control Challenges

#87
post #31

Earlier quoted context omitted.

An unstable rocket (almost all of the big ones) is an inverted pendulum of sorts. The combined center of thrust and aerodynamic forces is usually below the C.G, and the rocket tends to tip over if not actively stabilized. To add a little, a slight margin of tipping is allowed, but the rocket tends to break up if the angle of attack crosses certain limit at high speeds.

Liquid fuel rockets complicate matters: think "inverted pendulum with a couple of stacked, full wine glasses that you absolutely must not spill balanced on top. Oh, and there's a gremlin drinking from them so both CG and total mass are constantly moving."

In an inverted pendulum the support pushes up, in a rocket it pushes along the direction the rocket is pointed. You only need to steer the rocket, not balance it.

Re: PID Control Challenges

#88
post #76

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.

Could you elaborate please.

Sure!

So in many, if not most, contemporary Information Retrieval (IR) problems, there is a total document set larger than could be explored on an interactive basis and so the data structures get laid out in such a way that with some probability north of a coin, you’ll find “better” documents in the “front” half. This is hand-waving a lot of detail away, so if you’d like me to go into some detail about multi-stage ranking, and compact posting lists and stuff I’m happy to do that in subsequent comment.

But it’s a useful fiction as a model and the key part is that there’s still “good” stuff in the “back” half: you’d like to consider everything if you had time.

A PID controller (again oversimplifying a bit) is charged with one primary task: given some observed quantity (temperature in a room) and some controlled quantity (how hard to run the AC), maintain the observed quantity as close to a target as possible via manipulating the controlled quantity.

If you hook one of these things up to an IR/search system (web search, friend search, eligible ads, you name it) where the observer quantity is e.g. the p95 or p99.9 latency of the retrieval, and the controlled quantity is how “deep” to go into the candidate set something magical happens: you always do something close to your best even as the macro load on the system varies.

That’s again a pretty oversimplified (to the point of minor technical inaccuracies) TLDR, but I think it makes the important point.

If you’d like more depth feel free to indicate that in a comment and I’ll do my best.

Re: PID Control Challenges

#89
post #7
post #5

Possibly useful: A header-only proportional-integral-derivative (PID) controller. https://github.com/RhysU/helm

It's a nice theoretical implementation but few practical examples would be found using floating-point math, running as they are on systems that don't support it.

This isn't true at all. We use them in scientific firmware all the time. Arduinos, pis, cortexes, you name it.

Re: PID Control Challenges

#90
post #25

Earlier quoted context omitted.

If you're willing to expand on this, color me interested.

I'm not a gamedev myself but have played a few games (Stormworks, Garry's mod with Wiremod, From The Depths, at least one or two more which I can't think of the name right now) that allow PIDs to be used in player-designed contraptions. Quite useful for building stabilised gun platforms and things. I would be sure there's plenty of applications for PIDs in a game engine itself - a quick search turns up things like se…

GMod has built-in PIDs now??
Post reply on HN