PID-Controller implemented in Lua, supporting such features as:
- On fly modification of the controller terms' gains (Kp, Ki, Kd);
- Weighted Proportional term calculation (on Error and on Measurement approaches mixed);
- "Derivative Kick" prevention mechanism (Derivative on Measurement calculation approach);
- Multidimensional values regulation;
- etc.
You can see full PID-Controller class interface in the PID.lua module in the LuaLS documentation block.
For usage examples, please, see example folder, containing Trajectory.lua, Path.lua modules and StepResponse.lua, SpiralMovement.lua scripts, which implement movement of an inertial body along precalculated trajectory, using several differently tuned PID-Controllers.
To run example scripts, run following commands from the root of the project tree:
lua -l deps example/script/StepResonse.lua
or
lua -l deps example/script/SpiralMovement.lua
Resulting plots will appear in the "out" folder.
PID.lua module requires Penlight package installed and available and utilises pl.class and pl.tablex modules.
Example modules also rely on the same modules of the Penlight package. Example scripts utilise pl.dir module for the output directory creation.
Usage examples also require plotly package installed as a dependency and an internet connection to render the plots:
.png)
.png)
.png)
.png)
.png)
.png)
.png)
.png)
.png)
.png)
.png)
.png)
.png)