HN user

pidtuner

87 karma
Posts7
Comments44
View on HN

Not to control, but to compensate. This is what the I action in the PID does, compensate for un-modeled disturbances

The trick is that, even though the augmented state is uncontrollable, you still use it in the predictions, so the MPC algorithm can still compensate for it. Take a look at the before-last graph in the paper, see how that technique improves predictions after learning the real-time disturbances.

The code is C++ code, It could be ported to an MCU if there is a fairly recent C* compiler (C11+). But the algorithms are quite expensive, there are multiple matrix inversions, the size of the matrices been as large as the data you put in into the tool. typically between 500 and 10000 data points.

You are right, but the problem of a possible analogous "Machine Learning Theory" is that machine learning problems are highly nonlinear, and control theory has only been "solved" for linear problems. It we could solve nonlinear control that could immediately be applied to machine learning.

“Linear systems are important because we can solve them.” — Richard Feynman

The problem with many adaptive control techniques is that is very difficult to prove the closed loop stability and performance margins, because such systems are highly nonlinear and we do not have yet the mathematics to provide simple guarantees (for example, I would not get into an aircraft where the control systems have not been rigorously, mathematically, designed)

The integral problem of LQR and MPC is indeed not the first topic discussed on textbooks, but there has been a solution for that for year, called "disturbance model". You you can have an "adaptive MPC" following some design procedures. Check out this reference:

https://folk.ntnu.no/skoge/prost/proceedings/ifac2014/media/...

That is true, that is why there is a slider in the tool that allows you to trade-off performance for robustness. The bode plot is also an indication on how the closed loop performs in frequency domain, so you would normally choose different tunings according to specific use cases (e.g. some frequency response for tracking and a different one for just regulating)

Developer here, you are right. I have also considered such systems, but my free time is limited, so for the moment I just implemented the most basic case.

Simulating limits will be included in the next release.

Hysteresis is something more difficult, so will not handle any time soon.

Asymmetric systems can be handled by gain-scheduling the PID (make a model for each region and schedule the gains), this is approachable in the middle term.

I've ever understood these kind of questions. IMHO never learn a programming language just to learn it. Actually, I would go further and say don't even study for a CS degree. Programming has become more popular now a days, with designers, marketers, financial people and others learning to program in their domain languages. The barrier to programming is even getting thinner with the advent of low-code platforms.

Than being said, my advise is to study for a domain that interest you, for example I am a Control Engineer. Then learn the programming language of your domain.

In my domain the design language is Matlab/Simulink, then when I got into the job market I realized that my career would benefit by learning 61131 (PLC languages), C and C++. So I learnt that. Now I am very good with the Qt framework, for example, which allowed me to enter a broader market of industrial application development.

So stop looking for an language to learn and better look for a domain that will ensure that you will have a job in the future. Then learn the language of that domain.

Kalman Filter 5 years ago

For predictions, the Kalman Filter has it's drawbacks. They are clearly visible when you try to use it in conjunction with other algorithms based on state prediction such as Model Predictive Control. The main problem is that the KF does not have integral action.

One quick fix is to add a disturbance model to the KF, for example an integating disturbance. But then you have one more tuning parameter (the disturbance model). Which along the other KF tuning parameters increase complexity and becomes more difficult to implement and understand.

Personally, I have had more success with other types of filters, which have a similar structure as the KF, but include mechanisms for improved predictions, for example this one:

https://folk.ntnu.no/skoge/prost/proceedings/ifac2014/media/...

Yes! Thank you Sir! I can see you know what you are talking about. This is my point, NNs are very useful for some problems, for others they are not worth the complexity and black-box nature.