NHacker Next
  • new
  • past
  • show
  • ask
  • show
  • jobs
  • submit
Proportional-Integral-Derivative Controllers (en.wikipedia.org)
somat 2 hours ago [-]
My personal exposure to the PID algorithm was my GPU fan. There is supposed to be some sort of internal fan curve to control it's speed but mine was not working, crashes everywhere. I Could still set the speed by hand. and while I was putting together a sort of hacky user space fan curve I had an epiphany. I Don't actually want a fan curve. I want to set an ideal temperature and have the computer figure out what fan speed is needed to maintain it. So I learned more about control logic than I was really prepared for and my user space fan speed script has a cute little PID controller to do just that. (technically for fan thermals you really only need a PD controller. No anticipatory preload needed. but who's counting)

I do sort of suspect a fan thermal control curve is a PID response curve written out in long hand but don't really have the math to prove it.

sz4kerto 13 minutes ago [-]
> I do sort of suspect a fan thermal control curve is a PID response curve written out in long hand but don't really have the math to prove it.

No, a fan response curve is kinda-sorta a P controller. It does not take into account 1) how quickly the temperature is rising or dropping (D) 2) the time passed since the system has drifted from the target temp (I).

chrisb 2 hours ago [-]
For a robotic BLDC motor velocity control application, I moved to using a linear ADRC (Active Disturbance Rejection Control) [0] controller. It is not much more complex to implement that a PID, but at least in my context it handles changing real-world environmental conditions with a correctness which I could not achieve with a PID however much I tried to tune it.

Still uses a PID for BLDC motor coil current control, as this control loop is much more predictable.

Currently using the proportional part only from a PID for position control, but this may change in the future.

[0] https://en.wikipedia.org/wiki/Active_disturbance_rejection_c... (although this isn't a very useful reference if you want the implementation maths!)

_kulang 10 hours ago [-]
The fascination of programmer types with classical control and estimation topics is endlessly interesting as someone who studied control and estimation and hangs out here for interest in the programming. For me it was surprising to see that JEPA is a model predictive control algorithm it an almost literal sense; I guess I’m happy to have studied what I chose when I was 18.
fcatalan 10 hours ago [-]
I signed up for one of the first MOOCs ever, about self driving cars by Sebastian Thrun, and of course PID was part of the curriculum.

I think that PID hits a certain sweet spot between cleverness, ease of implementation and practical utility that makes it catnip for the typical programmer's mind.

I liked it so much that when we had to implement it, I downloaded an open source driving simulator to see it work there instead of the simpler python environment we were using.

_kulang 9 hours ago [-]
It’s very intuitively appealing. We like it at my university for teaching first years how to build a line following robot. It’s one of the first times you can get students to really get that “ah” moment when they realise what they can do with code—it can affect the real world!
brcmthrowaway 5 hours ago [-]
Whatever happened to this guy?

Sounds like he made a bag with the first AI craze and retired.

jrflo 10 hours ago [-]
Yeah, kind of hilarious to me that this was posted here. I suppose if you’ve never encountered control systems at all before they are quite simple, elegant, and cool, but I’m surprised any technical person hasn’t come across them at some point.
_kulang 9 hours ago [-]
I think CS degrees are a bit light on classical theory in the modern day. In Australia CS degrees are what they say on the tin, but in America it seems almost as if CS degrees are anywhere from cybernetics to pure software development
stldev 4 hours ago [-]
Interesting generalization; that’s almost the opposite of my experience.

A common hiring anecdote we share with people outside tech is literally: “A CS degree doesn’t teach you how to code.”

For me, ~25 years ago in the UC system, it was all math/science/theory-oriented. Some C++/Java that was introduced to get you through all that theory. Learning how to code/actual software engineering comes with practical experience.

marcellus23 3 hours ago [-]
That hasn’t been my experience in the US, either personally or from talking to others who took CS degrees.

Keep in mind that plenty of people on HN and in the industry did not take CS degrees in college. We did learn about PIDs, if briefly.

fragmede 8 hours ago [-]
nemoniac 6 hours ago [-]
This classic programming text book discusses computational analogs of the "signals" in signal-processing systems.

https://mitp-content-server.mit.edu/books/content/sectbyfn/b...

glitchc 4 hours ago [-]
PIDs are great but notoriously hard to tune. They require deep insight into the underlying physical phenomena to get right. They are also rather rigid and cannot adjust well to a changing environment (temperature and humidity can fluctuate dramatically between summer and winter in some climates).

Of course, no one tunes them by hand anymore for these reasons, relying instead on optimization techniques like particle swarm to find the best set of coefficients for a given steady state condition. Eventually, I suspect we will replace most PIDs with a small neural network for almost all industrial applications (a handful of nodes is sufficient). The neural network is also easier to adapt to changing conditions.

pinkmuffinere 1 hours ago [-]
This isn’t meant to be an attack, but almost everything you say here is false.

> PIDs are great but notoriously hard to tune. They require deep insight into the underlying physical phenomena to get right. They are also rather rigid and cannot adjust well to a changing environment (temperature and humidity can fluctuate dramatically between summer and winter in some climates).

This is not true. PID controllers are often the least dependent on the physical characteristics. They can be tuned with heuristic methods like Ziegler-nichols, often with no knowledge of the actual system.

> Of course, no one tunes them by hand anymore for these reasons, relying instead on optimization techniques like particle swarm to find the best set of coefficients for a given steady state condition.

This is also not true. In the Amazon consumer robotics group we still tuned pid by hand. I’ve _never_ heard of tuning pid with particle swarm, that seems very silly, difficult, and overkill. If you’re going to use an optimization technique, you might as well move to a better controller structure like LQR. I have seen particle swarm used as an estimator, as an alternative to a kalman filter, but never seen it used for tuning.

> Eventually, I suspect we will replace most PIDs with a small neural network for almost all industrial applications (a handful of nodes is sufficient). The neural network is also easier to adapt to changing conditions.

This sounds unlikely to me. Classic control techniques give guarantees that a neural net just can’t. For example, things are provably stable under some assumptions. With a neural net you get no such guarantee. Also, it would be harder to debug and understand, and it would take more memory and compute. I can’t imagine a world where we replace pid with neural nets, they’re fit for very different purposes.

Source: have a masters in controls, worked in robotics in controls team, still love it all.

srean 39 minutes ago [-]
> Eventually, I suspect we will replace most PIDs with a small neural network for almost all industrial applications

With or without bitcoins and that other one weird trick ?

jletroui 3 hours ago [-]
> Of course, no one tunes them by hand anymore

in the industry, maybe. Otherwise, FRC competitions are seeing a LOT of manually tuned PIDs

laxisOp 3 hours ago [-]
I wanna know more about particle swarm . Btw i tuned my line follower with a customgui/pypidtune+mujoco
dvh 9 hours ago [-]
I used it in metal detector (direct frequency measurement kind). It works really well. I (and you probably too) half assed pid controllers before you even know what it is. But it makes perfect sense. Proportional part reacts to the acute difference, derivative adjusts it when your controller is already going right direction to limit overshoot, and integral part improves cases when the difference is small but persist for long time. Learn them and use them, they're good tool.
londons_explore 5 hours ago [-]
Almost always a good analysis will find a control strategy which performs better than PID...

But the benefit of PID is it is fairly easy to tune and works in a really wide range of situations.

laxisOp 3 hours ago [-]
And it is most of the time not overkill
ahartmetz 3 hours ago [-]
I did a lab exercise (part of physics curriculum) with a PID controller once. It controlled a small electric motor with a small flywheel (i.e. not much inertia). We hand-tuned the parameters with potentiometers. The effect was quite impressive: the flywheel kept spinning at the same speed when we touched it, even with moderate force. It felt like there was a huge motor driving it because the RPM just wouldn't budge. It was still not hard to stop it completely (small motor after all), but it felt very stiff before that point.
zbentley 3 hours ago [-]
Thanks to the advice of a colleague who had studied control theory, I once used PID controllers to manage autoscaling compute resources downstream of a lot of message queues. We used plenty of more typical autoscaling systems too, but for some workloads, PID controllers were ideal—when we had thousands of compute clusters across many queues, they minimized the state that needed to be stored between scaling system polls while effectively smoothing out the scale up/down rate to minimize resource waste and pointless whipsawing.
boguscoder 10 hours ago [-]
Honest question: are wiki links to any technical topic post worthy now?
nairboon 3 hours ago [-]
At least for me, it's not about the wiki link. I'm here for the comments, the stories, anecdotes, related deep Diving links and general chit chat. If you view the link as "this is the control systems thread for today", all the upvoter make a lot more sense.
srean 5 hours ago [-]
Why the hell not ?

I still learn a lot from wikipedia. Maybe it's not useful for those who are experts in every thing. I am not one of them.

emil-lp 5 hours ago [-]
I think you can post more or less whatever you want.

Whether it gets upvoted depends on a lot of things.

For example, I will upvote this submission, but not your comment.

RossBencina 10 hours ago [-]
kamranjon 7 hours ago [-]
thank you!
Geee 3 hours ago [-]
Terry Davis implements a PID controller for a rocket in SimStructure: https://youtu.be/25hLohVZdME?t=207
tmule 10 hours ago [-]
[dead]
Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact
Rendered at 16:21:04 GMT+0000 (Coordinated Universal Time) with Vercel.