Hacker News new | past | comments | ask | show | jobs | submit login
The Fundamentals of Control Theory (engineeringmedia.com)
511 points by teleforce on Oct 3, 2022 | hide | past | favorite | 70 comments



If anyone's studying control theory, you're doing yourself a disservice if you don't use Brian Douglas's resources. His videos on YouTube are phenomenal at explaining not only the theory and techniques, but why you should care in the first place.

Also, why should anyone study control theory? It's the math behind making real-world systems perform what you want them to do. In particular, robotics and autonomous vehicles rely heavily on techniques from control theory.

If you watch Brian's videos, keep in mind that they bifurcated into two places: his original videos [1], and his more recent MATLAB tech talk videos [2].

[1]: https://www.youtube.com/controllectures

[2]: https://engineeringmedia.com/videos


> If anyone's studying control theory, you're doing yourself a disservice if you don't use Brian Douglas's resources.

The same is true for Steve Brunton. Control theory, systems theory, computational engineering and the interface of the latter to ML.

https://www.youtube.com/channel/UCm5mt-A4w61lknZ9lCsZtBw


Where’s the Christopher Lun plug? Great explanations by him on how to do LQR.


Lum with an M for anyone else who had trouble locating his channel.

https://www.youtube.com/c/ChristopherLum


Ah crap. Thanks. He is fantastic.


I have found https://www.collimator.ai/ as a very useful tool to learn and try out control theory concepts. I am a software systems engineer with limited understanding of control systems. But watching Brian Douglas's videos on youtube and then following along by building simple examples in Collimator and simulating them started to give me a better sense of the tutorials. Good luck! Brian's stuff is great :)


Who is Mr. Big in the field of Chaos Theory, and isn't Control Theory diametrically opposed to Chaos Theory?

https://www.youtube.com/watch?v=g1eUIK9CihA

James Gleick, Doyne Farmer, Jim Crutchfield, Ken Wilson, or Leo Kadanoff maybe?

https://petterhol.me/2022/08/11/the-golden-age-of-complexity...

>J Gleick, 1987. Chaos: Making a New Science. Viking Penguin, New York. The name aside, Gleick’s Chaos is the quintessential complex systems book, providing a prototype for the golden age. It does an excellent job of capturing the frenzied mid-80s dynamical-systems scene, culminating* in Jeff Goldblum’s chaos theorist character in Jurassic Park (allegedly inspired by Gleick himself). But Chaos spans adjacent fields too, namechecking future Santa Fe Institute luminaries like Doyne Farmer and Jim Crutchfield and statistical physicists like Ken Wilson and Leo Kadanoff. All-in-all still a worthwhile read, not only for the zeitgeist.


Another source for simple to digest, useful fundamentals: https://file.tavsys.net/control/controls-engineering-in-frc....

This was originally created as a guide for high schoolers for robotics but goes into relative depth (the subtitle is "Graduate-level Control Theory for High Schoolers). I personally found it quite useful for intuitive understanding of how control systems work.

Prerequisites: linear algebra


This one is better because it deals with state space representation rather than frequency domain representation with transfer functions. State space is more fundamental.


A huge +1 for this book: I spent a lot of time reading and re-reading this book while in university, both for classes and my time leading a robotics club.


I don't recall much about control theory from university, but the one thing that did stick was state-space representation.

The part that got me was that you could take this arbitrarily-complex LTI system and basically turn it into a matrix that encapsulates everything. Any given state the system could exist in becomes a simple vector. Lots of crazy compositional techniques exist once you get your problems into this kind of shape.


Similarly, I like how any LTI system is just poles and zeroes in the s-plane. Or, if your system is sampled (DSP, and actually most signals you'll deal with in a computer), in the z-plane.

But not just every LTI system, ever sampled signal is poles and zeroes in the z-plane.

I have used that fact for years, and it still blows me away from time to time. Laplace and z-transforms are pretty magical, more so than Fourier even (which is basically a special case).


I can highly recommend control theory to all software engineers designing high throughput systems.

It is sometimes super useful to think about large systems with high traffic of requests/messages as something that can be controlled.


My favorite was a DB project where the DB would accept DELETEs faster than the SSD could write them to disk. The eventual solution was to implement a proportional controller that looked at the "still to be persisted to disk" backlog and kept it at ~66% of the value at which the DB would stop accepting queries by selectively inserting sleeps into the DELETE-submitting process. We could have fixed it at some known-good but low value, but implementing a controller enabled us to speed up during the night (when there was low user traffic) and still not stress the db too much when a lot of users were online.


Yeah, I especially like to use CT for reducing configuration parameters or to replace meaningless configuration parameters (requests per second, batch sizes) with more meaningful ones (acceptable latency, acceptable failure rate).


That's a good qualification - if you aren't having to worry about these maths, you aren't doing high volume.


Digital computers are turning into analog ones.


It is always good to see control theory related posts on HN. (:

I've both BsC and MsC in control and heavily used video lectures of Brian, I am probably one of his first patrons. His lecturing skills are amazing. If you interested about the topic I also suggest to look at 'Steve Brunton' YouTube channel. He is also a legendary teacher.

If you want to talk anything about control theory, please feel free to contact me.


What do you mean by BsC and MsC in control? That you wrote your Bachelor and Master thesis at the control theory department? No front, i'm just curious, because that's what i did, but i always referred to my degree as having a M.Sc. in MechE, in my case.


Nope. (:

We have literally `Control and Automation Engineering` as a major in Istanbul Technical University (In BSc, MSc and PhD levels). It's not under any other depermant althogh it is under EE faculty.

https://kontrol.itu.edu.tr/en/home


Oh okay, cool.


I did an MS in EE but say it’s in robotics since that’s all I focused on in my coursework and thesis. I think being more specific is fine if you’re describing the content not the literal degree title.


I took control theory in my undergrad EE degree and did fun project of making a analog PID control from scratch using OpAmps, potentiometers for setting weights for P,I&D signals as well as input and output sensing, a motor for output which positioned a stick to point in the direction of the input dial. Was great to see how it responded when changing or disabling P,I or D.

I only have a basic understanding of machine learning however, but am I completely wrong in seeing a lot of overlap in control theory? Seems like a ML model is like a bunch of controllers (not necessarily PID, or even linear) in parallel with a weight and a bunch of outputs in parallel and the difference between your desired output and the input is your error signal.


Kinda-sorta. ML is a bit more about optimisation theory, not control, but there's a lot of overlap: you can consider controllers to be optimisers, and optimisers can be used in control (a sub-field called optimal control). One big constraint in control is it has to be causal, i.e. it only sees part of the function it is trying to optimise (the part that is in the past) and only has the ability to influence part of the input in the system it is optimising (the part in the future). Control also has a huge amount of overlap with signal processing, both analog and digital (most of the math is basically the same).


Both act as forms of constraint solving or constraint optimization. A lot of problems can be solved in terms of constraints filtering a large solution set; control theory happens to be an elegant way of describing certain kinds of solutions using analog feedback, and solvers that can divide and conquer and employ heuristical prioritization produce classic AI algorithms like A*, while more brute-force approaches tend to resemble ML in relying on "parallel number crunch".


Are you responding to the link? I didnt see ML being mentioned...


Sorry the ML is just a tangent.


Brian Douglas is certainly one of the great teacher of control. That said, this books is, to my knowledge, a incomplete and abandoned project.

I would recommend checking it's YouTube channel instead.


Yep, looks like you're right that the book is incomplete: https://www.patreon.com/posts/book-is-now-free-28313078

Sounds like he's still open to continue working on it in the future though:

> Perhaps something will re-motivate me in the future and I’ll get back to writing this book. In the meantime, I hope it’s of some use to you.


You know, the license is CC BY-NC-SA, not BY-NC-SA-ND. You have every legal right to finish it. (Did he publish the LaTeX source too, or do you have to reverse-engineer it?)


Katherine Kim’s videos (katkimshow on YouTube) are also really good and I would highly recommend them.

https://youtube.com/c/katkimshow https://engineeringspark.com/


My favorite topics from CT are controllability and observability. I apply the concept to every piece of software I build and I am surprised how little thought goes into this (if any) in general when it comes to software engineering.


Interesting thought. Do you have any example or a blog post how you do it? How do you write down a MIMO? Wouldn't it require too many global variables?


I believe that you are taking it a little bit too literaly.

What is observability? You can tell what is going on inside the system at any point in time. Metrics and logs are the bare minimum you need to observe the system at certain points in the code. After that you ask yourself: What else can I do to make this more observable? Usually this comes from how the code is structured and how the data flows through the system.

Same with controlability. Can I make my system do what I want it to do under any operating conditions? What are the knobs I can turn? The lowest form of controllability is static configuration. You can add more knows and even make them dynamic thinking about structure and data flow.


I've spent the last few years working on a soft realtime control system for doing system measurement, and it frustrates me to no end how little knowledge of controls there is in the SRE space. I regularly encounter teams who want to build a system that does a little bit sometimes, and a lot other times, and they need to build a way to make that happen, and I'm like "hey are you familiar with controls?" and I get nothing (or, worse, "that's too hard to understand").

Having working fundamentals in the space can be a huge competitive differentiator. Everyone working in tech should have that.


MechE here. Control Theory surprisingly is only mandatorily taught to MechE (at least in the US). It was also arguably the hardest class I took in my 3 semester of hell (junior year + first semester of senior year). Huge props to you if you can learn this on your own. A lot of the fundamental math (a ton of Laplace transforms) and block diagram analysis is hard to follow without some guidance.

Edit: Interesting, I went to a ABET accredited college and my EE counterparts did not take control systems. Where we were told that we had to take it because of our (MechE) ABET requirements.


I think it must vary by institution. For a second data point. EE here from an ABET accredited US University. Controls & Discrete Controls was mandatory for EE. No other engineering major at the school, including MechE, had this requirement.


Nearly the same for me. Continuous controls was a requirement for graduating with my BSEE. I don't believe that it was required for the MEs.


ChemEs take control too — it’s called “process control”. Covers Laplace transforms, PIDs, stability analysis etc. (MPC, LQG, Kalman filters at the graduate level). ChemE controls tend to deal with large multivariate nonlinear or locally linear systems with slow dynamics while MechE controls deals with smaller systems with very fast dynamics.

Chemical plants and oil refineries operate using optimal control (MPC) that control lower level PI loops. There are layers and layers of controls.

The controls in oil refineries are so optimization driven that some of the leading edge optimization solvers actually come from ChemE research groups. Oil was the old tech industry and they poured a lot of money into optimization and control R&D.


US ABET BME here.

we for sure took mandatory signals and controls, and we basically regarded ourselves as EEs whose circuits tended to be squishy and alive.

A disgustingly useful class, and damn hard.


Not exactly true. I have an electrical engineering degree from the US and took Systems and Controls. So, this is definitely not only taught to ME's..


Was it mandatory though? I took a Control Theory class for my Electrical and Computer Engineering undergrad degree in the US. But it was a senior/graduate-level elective and not required to graduate.

Minor aside, the class was the best of all my electives. I picked it based on advice from a friend who said "choose your electives based on the professor, not the material." One of those bits of advice I wish I'd absorbed (I'm sure I'd been told) earlier in my school career.


Controls was indeed a mandatory EE undergrad class at my University (also ABET accredited).


Also is a hard requirement for chemical engineers.

Additionally I find some of controls theory to be relevant context for machine learning models, in particular backpropagation.


As fare as I can tell, it's a pretty mixed bag; a lot of engg departments feel if you are going to get serious about control you are going to have to do it in graduate studies anyway which is probably fair.


My EE program had a control theory course as a senior year elective but it was not mandatory.


As someone who comes from a control background, I'm really happy to see this topic get coverage on Hacker News. Also, really glad to see ppl recognizing where control theory really shines (and where machine learning has its limitations)


What is your take on neural ODEs?


I think they have very very high potential for simple dynamical (i.e. continuous time) systems. I enjoyed the presentation given at NeurIPS (2018) and look forward to seeing them applied to more real-life scenarios.


One of my peeves with control theory, at last the way it's used by proponents I've met, is that it's designed to react to the smallest input. This makes intuitive sense when trying to optimise performance, but in a system with natural variations around the mean (noise), this can easily lead to amplifying variation and worsening performance.

The alternative is statistical process control. In practise, it performs about the same for basic tasks, but it gives you qualitative insights into many other things too: (registration-walled) https://www.qualitydigest.com/inside/operations-column/proce...


I think you just haven't dived deep enough into control theory. Your criticism should be addressed, for instance, by introducing an appropriate Kalman filter. Yes, much of the truly interesting and powerful aspects of control theory are in its interaction with statistics.


The Kalman filter also assumes every data point conveys a signal of change, however small. That approach inevitably leads to reading tea leaves (interpreting noise as signal).

It is more economical, in my experience, to start from the idea that unless there's been an actual consistent change in the process, any data you're getting reflects noise around the process mean. SPC is designed to tell those two cases apart.


I'm really struggling to follow along. Control theory is nothing but a set of math tools to derive controllers and filters. Just because most people stick to linear systems with gaussian noise doesn't mean you're limited to that. I'm not sure how a quality control methodology has anything to do with control theory in general.


Knowing absolutely nothing about either, and looking at the wiki articles [1] and [2], Statistical Process Control sounds like something specific to quality control rather than a general alternative to control theory. Is that the SPC you're talking about? Is control theory used in quality control? Does SPC have wider applications?

[1] https://en.m.wikipedia.org/wiki/Statistical_process_control

[2] https://en.m.wikipedia.org/wiki/Control_theory


Deadbands are used fairly often. I'll agree that they're suboptimal in practice though


Book looks well made. His youtube channel seems to be here:

https://www.youtube.com/controllectures

Control theory is a really fundamental topic that is useful in many disciplines. The field has some very pragmatic approaches.


I am glad to see that there is such an interest in Control Theory. :)

https://youtube.com/channel/UCV3CS_ygnzwGzjBXKjVdQIQ

The channel should be brought to life soon. :)


I'm worried the field will increasingly become a niche where ML takes over cases where accuracy guarantees are not very important, time-to-market is important or where complexity rules out mathematical modeling.


I don't think that will happen. ML is overhyped and accuracy is going to be more important as everything gets smaller, faster, better. Infact I hope for the opposite: I think with the increase in software domination, "brute forcing" it (or with a ML black-box) won't do, and a calculated system is going to be needed.

Time to market is always important, I think calculating mathematical models might work out quicker than trying to shove ML on it? Our tools for making math models will improve.

(all of this is speculation, no one can predict the future)


Why do you say that? I think each field has its strengths and weaknesses. For example, mission critical applications still tend to avoid using DL algorithms since stability can only be proven in the sense of Lyapunov. There is also RL, which borrows many fundamental concepts from control theory.


B Douglas, S Brunton, K Kim are all superb. But I'm longing for a YouTube series on more advanced control topics like robust synthesis, LMIs, switched/hybrid systems, etc. Any suggestions?


Control Theory a Superior Paradigm over AI for Plant Performance? model predictive control (MPC) framework as the dominant paradigm for the control and adaptation of asset-based facilities, and examine how specific AI techniques may be selectively used within this framework for performance improvement. Critical control functions, including observability and controllability, where AI/ML methods perform poorly in real-world applications.


Feedback Control for Computer Systems

Philipp K. Janert

https://janert.me/books/feedback-control-for-computer-system...


It seems like the author assumes that the page is accessed from his youtube channel, but as someone who just landed on the webpage with no awareness of his channel, some synopsis of the book would be nice.


The book cover has a very quick summary in the form of cartoons, but the table of contents (pp 3–4/160) has a list of what it covers, the preface (pp. 5–7/160) explains the motivations and has a little more color on what it colors, and the first chapter (pp. 9–42/160) has a really good overview of control theory including cartoons and a dialog with Ctesibios.


Anybody who draws a DBZ over 9000 meme into their lessons on control theory gets an A+ from me.


Terry Davis did a nice intro to PID controllers when he demoed his physics simulator


I assume it's this video ("Terry Davis Demos SimStructure (2016-08-25)"): https://www.youtube.com/watch?v=25hLohVZdME

He starts talking about PID controllers at around 3:40.


Reinforcement learning sounds better


We need to give copy of this to fed.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: