[HN Gopher] Control theory for fun and profit
       ___________________________________________________________________
        
       Control theory for fun and profit
        
       Author : evanweaver
       Score  : 111 points
       Date   : 2020-06-19 16:51 UTC (6 hours ago)
        
 (HTM) web link (fauna.com)
 (TXT) w3m dump (fauna.com)
        
       | Scarbutt wrote:
       | What's the catch with this database? skimming the website, it
       | seems to promise too much. Impressive if all those features work
       | well together as advertised.
        
       | thelittlenag wrote:
       | At work we have a problem in a different domain that I had
       | planned to use an approach like this on. The extra resources that
       | folks have linked to or provided are quite helpful. Thank you!
        
       | carapace wrote:
       | I can recommend "Feedback Control for Computer Systems,
       | Introducing Control Theory to Enterprise Programmers" by Philipp
       | Janert
        
       | rland wrote:
       | For a deeper dive, I can recommend the Astrom and Murray book.
       | It's free:
       | 
       | http://www.cds.caltech.edu/~murray/amwiki/index.php?title=Se...
       | 
       | This subject is tightly coupled with system modeling, and can
       | touch many different domains:                   Cruise Control
       | Bicycle Dynamics         Operational Amplifier Circuits
       | Computing Systems and Networks         Atomic Force Microscopy
       | Drug Administration         Population Dynamics
       | 
       | Cheap computers are making it easy to make controllers that can
       | reliably control systems with hundreds or thousands of variables
       | and unknown dynamics.
        
       | ithkuil wrote:
       | Another trick for reducing tail latency with minimal utilization
       | increase is to fire the second call earlier but send a
       | cancellation signal when the first response arrives (e.g. a udp
       | packet is usually good enough).
       | 
       | This works when the cost of managing the request queue is low
       | relative to the coat of serving the requests themselves (usually
       | true whenever there is some IO involved).
        
       | occamrazor wrote:
       | They say they use a PID controller, but don't write about the
       | next step: how to choose the parameters for the controller?
        
         | orbital-decay wrote:
         | Fair warning: this is a rabbit hole reaching the Earth's core.
        
         | lmilcin wrote:
         | I like me the most popular answer which is: Have a little fun.
         | 
         | I had the same idea (ie PID loop to control system behaviour)
         | some time ago to control traffic to external system so that it
         | is just at the limit of throughput of that external system. The
         | external system is really badly implemented and we had to put
         | much effort into maximizing throughput.
         | 
         | In the end we are replacing HTTP requests with Kafka topics
         | which let's the other system process as fast as possible
         | without destabilizing. On our end we continuously monitor
         | latency and have flow control based on consumer behaviour.
        
         | russh wrote:
         | Play around with this a bit to get a feel for it:
         | http://codinglab.blogspot.com/2016/04/online-pdi-trainer.htm...
        
         | wenc wrote:
         | There are at least 6 classes of approaches [1] for controller
         | tuning. But they all involve the following: (1) starting with
         | some initial guesses for tuning parameters (2) fine-tuning them
         | in real-life.
         | 
         | If you have a (rough) model of the system e.g. a transfer
         | function, you can invert the model to get some initial
         | parameters, and then fine-tune by hand.
         | 
         | If you don't have a model but are able to run tests [0] to
         | collect data, you can apply any number of heuristic methods to
         | _systematically_ perturb the system to collect data to aid in
         | tuning. Then fine-tune by hand.
         | 
         | Difficult loops e.g. MIMO (multiple input multiple output)
         | loops that are larger than 2x2 where there's interaction
         | between the variables (i.e. you move one variable, others move
         | as well) require more analysis with loop-pairing techniques
         | like RGA (relative gain analysis).[3]
         | 
         | For really difficult loops (or loops that have degraded over
         | time), you can use software like Loop Pro [2]. This only makes
         | sense if you're controlling something valuable and where loop
         | degradation could lead to safety or performance issues. You
         | probably don't need software to tune the PID in your espresso
         | maker.
         | 
         | --
         | 
         | [0] Some systems are "open-loop unstable", which means they can
         | go haywire if you perturb too much in the wrong direction.
         | Simply blindly perturbing these types of systems is
         | inadvisable. Process understanding/analysis is needed to avoid
         | unstable situations.
         | 
         | [1]
         | https://sites.chemengr.ucsb.edu/~ceweb/faculty/seborg/teachi...
         | 
         | [2] https://controlstation.com/pid-tuning/
         | 
         | [3] For really large MIMO systems, PID is no longer the right
         | control mechanism. Advanced control techniques like MPC are
         | used, where a computer repeatedly solves an numerical
         | optimization problem at some frequency to calculate the next
         | control moves. MPC is usually used to control chemical plants
         | with hundreds/thousands of control variables. PID is used in
         | local loops, whereas MPC sits on top as an optimizing layer.
        
         | fauna-ben wrote:
         | That's fair! We didn't use any fancy process for loop tuning. I
         | basically played around with it until we were getting decent
         | convergence.
        
           | jcims wrote:
           | Brian Douglas is the one delivering that MatLab video linked
           | at the bottom of the article. He's got a ton of deep control
           | theory lectures on his own channel, too -
           | https://www.youtube.com/user/ControlLectures/videos
        
             | vladTheInhaler wrote:
             | Steve Brunton also has a wealth of incredibly well-produced
             | content on controls. Here is his control bootcamp series:
             | https://www.youtube.com/playlist?list=PLMrJAkhIeNNR20Mz-
             | Vpzg...
        
               | jcims wrote:
               | Wow that looks like a great series, thanks for the heads
               | up. I'm just starting to dip my toes into basic PID
               | control and am astounded by how deep (and predictive) the
               | math can get in this domain.
               | 
               | Edit: Also, I learned a lesson about closed-loop systems
               | with the launch (well, EDL) of the Curiosity rover on
               | MARS. It's mentioned in this article [1] but the trigger
               | to start lowering the rover on the crane wasn't some
               | process monitoring distance from the ground...it actually
               | had no direct notion of that. It just watched the
               | throttle setting on the retro-rockets and started
               | unwinding the winch when the throttles reached a reduced
               | steady state setting...something expected once the
               | descent stage had reached its hover altitude.
               | 
               | [1] (search for throttle) -
               | https://www.planetary.org/blogs/emily-
               | lakdawalla/2012/070607...
        
               | activatedgeek wrote:
               | I have seen these videos and highly recommend them
               | especially for people like me who want to get a sense of
               | the traditional control theory literature, have seen
               | similar concepts elsewhere and are trying to map the
               | motivations and notations.
        
         | fmakunbound wrote:
         | Guess and "suck it and see" as old professor of mine in control
         | theory would tell the class.
        
           | wenc wrote:
           | That would not be the way to tune the control loops on a
           | nuclear reactor.
        
       | solumos wrote:
       | I'm always curious about delving deeper into the history of
       | control theory. Specifically, the work pertaining to Cybernetics
       | in the late 40s/50s. Has anyone gone down that rabbit hole and
       | found anything interesting?
        
       | rozgo wrote:
       | Control theory for fun can be really fun. Using control systems
       | for solving problems you are familiar with can help develop an
       | intuition, that you can then map to other problem domains. Years
       | ago a peer at LucasArts taught me how to use PIDs for game
       | cameras, and I've used them everywhere since.
       | 
       | Very simple rules can create lifelike emergent behavior. This is
       | an example of 2 simple motors using PID to try to target a red
       | dot, in 3D, with gravity on:
       | https://www.youtube.com/watch?v=8hfKs02QHR4&list=PLpDgOnZpfh...
       | 
       | I can watch control systems all day.
        
         | quickthrower2 wrote:
         | That video reminds me of a puppy or dog when you hold food
         | above it's mouth.
        
       | in9 wrote:
       | are took longer
        
       ___________________________________________________________________
       (page generated 2020-06-19 23:00 UTC)