Module liba.pid
proportional integral derivative controller
Functions
new () | constructor for PID controller |
init (ctx) | calculate for PID controller |
set_kpid (ctx, kp, ki, kd) | set proportional integral derivative constant for PID controller |
run (ctx, set, fdb) | calculate for PID controller |
pos (ctx, set, fdb) | calculate for positional PID controller |
inc (ctx, set, fdb) | calculate for incremental PID controller |
zero (ctx) | zeroing for PID controller |
Functions
- new ()
-
constructor for PID controller
Returns:
-
a.pid
PID controller userdata
- init (ctx)
-
calculate for PID controller
Parameters:
- ctx a.pid PID controller userdata
Returns:
-
a.pid
PID controller userdata
- set_kpid (ctx, kp, ki, kd)
-
set proportional integral derivative constant for PID controller
Parameters:
- ctx a.pid PID controller userdata
- kp number proportional constant
- ki number integral constant
- kd number derivative constant
Returns:
-
a.pid
PID controller userdata
- run (ctx, set, fdb)
-
calculate for PID controller
Parameters:
- ctx a.pid PID controller userdata
- set number setpoint value
- fdb number feedback value
Returns:
-
number
setpoint value
- pos (ctx, set, fdb)
-
calculate for positional PID controller
Parameters:
- ctx a.pid PID controller userdata
- set number setpoint value
- fdb number feedback value
Returns:
-
number
output value
- inc (ctx, set, fdb)
-
calculate for incremental PID controller
Parameters:
- ctx a.pid PID controller userdata
- set number setpoint value
- fdb number feedback value
Returns:
-
number
output value
- zero (ctx)
-
zeroing for PID controller
Parameters:
- ctx a.pid PID controller userdata
Returns:
-
a.pid
PID controller userdata