Skip to content

SoulslikeEnjoyer/PID-Lua

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PID-Controller

Overview

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.

Usage

You can see full PID-Controller class interface in the PID.lua module in the LuaLS documentation block.

Examples

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.

Demostration

Step response

PonEFull PonEPartial PonMFull PonMPartial wobblyFull wobblyPartial bouncyFull bouncyPartial stepLikeFull stepLikePartial

Spiral movement

PonE PonM 50/50

Dependencies

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:

About

Simple PID controller, implemented in Lua.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages