News for hackers. Stuff that matters.
Re:Tune Your PID Controller by pidtuner on Wednesday May 26, 2021 @10:28AM (#27290902)
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.

Re:Tune Your PID Controller by londons_explore on Wednesday May 26, 2021 @11:58AM (#27292192)
While you're here... It would be nice to have examples of common systems with little diagrams.

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.

Re:Tune Your PID Controller by pidtuner on Wednesday May 26, 2021 @12:43PM (#27292790)
Maybe the youtube videos help with this? https://www.youtube.com/channel/UCkRD7FztiFOdX50BUsOkcSQ
Re:Tune Your PID Controller by DoingIsLearning on Wednesday May 26, 2021 @12:38PM (#27292699)
Great work!

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?

Re:Tune Your PID Controller by pidtuner on Wednesday May 26, 2021 @12:41PM (#27292756)
Thanks. It is C++ code using Armadillo for linear algebra and BLAS/LAPACK subroutines. Source code is a bit messy, but will try to clean it up and put it on a different repo when I find the time.

The most complex part is the identification algorithm, which uses this algorithm: https://math.stackexchange.com/questions/1428566/fit-sum-of-...

Re:Tune Your PID Controller by elcritch on Wednesday May 26, 2021 @02:46PM (#27294491)
Oh, awesome! I’ve got to do some pid tuning this week. I’ll definitely be interested in the raw C code.

I wonder if it could be portable to a microcontroller Are the blas routines expensive or large matrices?

Re:Tune Your PID Controller by pidtuner on Thursday May 27, 2021 @04:25AM (#27300597)
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.