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.
Eg. "Heater output to get to desired temperature", "Motor PWM to get to specified position", etc. Perhaps each with a little diagram/animation showing the input, the output, and some example data.
Could you go into a bit more detail regarding the webassembly implementation in:
pidtuner.github.io/pid/v1.0.6/pid_tuner_wasm.wasm
Is it in C, C++, rust? Could you give a brief description of the internal logic?
The most complex part is the identification algorithm, which uses this algorithm: https://math.stackexchange.com/questions/1428566/fit-sum-of-...
I wonder if it could be portable to a microcontroller Are the blas routines expensive or large matrices?
The I in PID is the only adaptive part. You can think of it as an estimator of an additive term that arises from e.g. friction or forces due to gravity.
But what about estimating e.g. a multiplicative term? It seems we should be able to do much better than PID, but without needing to commit all the way to a model-based method or reinforcement learning.
I wish there were some materials for how to move just beyond PID, but textbook treatments of LQR or MPC cannot even handle the I in PID.
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/...
I've run into a conceptual problem when using this approach with [infinite-horizon] LQR to try to recover what looks like a PID controller, which IIRC is due to the control u not necessarily converging to 0. This is expected, to counteract a constant disturbance, but it means that the sum doesn't converge.
I only skimmed the reference, but I did not find a discussion of this issue.
(Another way is stopping integration when control output is at its physical limit, usually in addition to a numeric limit.)
As with all other PID parameters, this is something you'd have to figure out more-or-less empirically.
Testing with hardware would be checking that controller outputs stop increasing while the actuator is blocked away from its target value, usually running with much reduced speed/current etc limits. Ideally, of course, run unit tests and SIL, before trying it on actual hardware.
What saturates is the actuator. You could choose a single minimum/maximum value for the integrator, but it could be better ye to have a value that depends dynamically on how much room there is left in the actuator output.
For example, if the actuator is saturated, the integral term should not be increasing. That could happen at different values of the integral, so there is not a single min/max.
http://brettbeauregard.com/blog/2011/04/improving-the-beginn...
* Limits. Nearly all systems have a maximum and minimum input value. That should be modelled so behaviours when the limit is reached can be modelled. For example, a car has a top speed - and any further pressing of the accelerator will not make it go faster, but a PID loop will keep integrating any error, causing the system to not behave as expected.
* 'Slack/Hysterisis'
* Asymmetric systems - the force applied when pushing a system may not be the same as pulling.
I really want a system where data can be thrown in like this, and it fit a model to the data and suggest not only PID values, but other types of controller which would be a better fit.