3 ms·
Just curious, how did you replace PID with MHE? PID is a control algorithm, while MHE is a state estimation algorithm -- MHE is not a control algorithm and does
by wenc 5y ago
Just curious, how did you replace PID with MHE? PID is a control algorithm, while MHE is a state estimation algorithm -- MHE is not a control algorithm and does not perform control.
Did you mean MPC by any chance? (which MHE is often used in tandem with)
If so, MPC is indeed a superior algorithm, but it also requires a dynamic model (LTI, or state space). Such a model may or may not be easy to identify -- it would require the characterization of the dynamics of data center operations.
PID on the other hand, while less optimal, is "model-free" (technically it has a model, i.e. its tunings can be thought to derive from IMC or direct synthesis, even though in practice hand tuning is common) in that it can respond to a wide variety of circumstances without knowing much a priori about the underlying dynamics. PID tunings are also amenable to optimization (products like Loop Pro are used in industry)
Due to their simplicity, PIDs are capable of operating at much higher frequencies than more complex algorithms like MPC. PIDs operate in the order of miliseconds or faster, while MPC operates in the order of seconds to minutes because it has to solve an optimization problem at every iteration, which is too slow for fast loops. In the hierarchy of control, there's supervisory layers on top (RTOs), then MPCs then PIDs. It's usually not either-or, but all together, working at different layers.
Even in industries where MPC is dominant, PID control is still ubiquitous and used alongside it, especially for local regulatory control loops. I don't have enough insight into data center ops to know if PID control is good enough but in my experience PID can be good enough for many applications -- most control loops in the world are essentially still PID. Not because more advanced algorithms don't exist, but because PID has the advantage of being just good enough for most purposes. (cost is also an issue: PIDs are cheap, while licensing costs for industrial MPC software range from 10s to 100k$)
- plaguuuuuu 5y agoI had no idea this stuff existed. This sounds pretty exciting actually. Is it really that hard/complex to calculate MPC that it can't be stuck inside a loop that runs at 1hz or less? Talking on decent generic or dedicated hardware. Some tiny SOC is a different story.
- rland 5y agoThe difficulty with MPC is in the name -- Model predictive control. You need a model.
- wenc 5y agoMPC on chip was tried a decade ago [1]. It was based on the idea of parametric programming, where solutions of an optimization problem (a quadratic program, QP) were pre-computed and the control law essentially only involved doing lookups. Lookups were fast and avoided the computational cost of solving an optimization problem on-line. However, as you can imagine, pre-computing optimal solutions is of exponential complexity so scaling up this technique was difficult at the time. (I'm not sure what the state of the art is). Computation however has come a long way since, so today it might be possible to actually solve a decent sized quadratic program (QP) on chip at very frequencies in real-time. [1] https://www.sciencedirect.com/science/article/abs/pii/S0098135407000609 https://www.sciencedirect.com/science/article/abs/pii/S00981...
- lmilcin 5y agoIn my case I built a model of espresso machine consisting of various thermal masses with different properties and impedancies between them. (Boiler heater element, water in boiler, scale on the boiler walls, boiler walls, grouphead, water in pipe between boiler and grouphead, water in pipe and pump between reservoir and the boiler, water in reservoir tank). This model can estimate future temperature of brew water based on current and past temperature measurements in various points in the system as well as on amount of water being pumped through the system. There are four temperature measurements being made: - ambient temperature - water reservoir temperature (the thermometer touches the reservouir), though I am pretty sure this one could be estimated from past operation of the boiler. - boiler temperature (the thermometer glued to the outside of the boiler at a selected point below water line) - group head temperature (the thermometer glued to the outside of the group head at selected point). This one could also potentially be estimated from past operation but I tried it and it complicates my model too much. In particular the model is designed to be able to calculate a single parameter, what is going to be the water temperature if used for brewing coffee, at a point in future, if heating element keeps adding given amount of energy and pump pumps given amount of water. The way the model is being used depends on what the machine is waiting for. For example, when you want to brew coffee, it delays start of brewing until it can achieve stable temperature. To achieve this as fast as possible (ie power on from cold to stable temperature) the machine is heating water at maximum power and the model is being executed 50 times a second to estimate what will be maximum temperature attained by brew water if we shut the power now. The idea here is we want to run the heater at max power for as long as possible and shut it off at exact moment so that the heat that spreads will cause the brew water to achieve the exact desired temperature. Mind that brew water temperature is not measured directly. I can only measure it experimentally with a modified portafilter. The parameters of the system are being observed and I use other filters to correct the parameters as system changes. For example, the system can detect amount of boiler scale developing rather precisely, mainly due to how it affects impedance between water in the boiler and the temperature sensor. --- Now, I am pretty sure it is overkill for an espresso machine. I am doing this to teach myself some control theory. But the effects are real and the algorithm works like magic -- the machine starts and achieves optimal temperature in shortest possible time and then keeps it stable with no over or undershoots that could affect the brew. In todays world the chips that can run this model are being sold for pennies and the only real complication is rather precise, noise free temperature measurement that you need for this plus measurement of amount of water being pumped.