Class a.pid
proportional integral derivative controller
a.pid |
proportional integral derivative controller |
-
a.pid
-
proportional integral derivative controller
Fields:
- kp
proportional constant
- ki
integral constant
- kd
derivative constant
- summax
maximum integral output
- summin
minimum integral output
- sum
controller integral output
- outmax
maximum final output
- outmin
minimum final output
- out
controller final output
- fdb
cache feedback
- err
cache error
-
a.pid:new ()
-
constructor for PID controller
Returns:
a.pid
PID controller userdata
-
a.pid:init ()
-
initialize for PID controller
Returns:
a.pid
PID controller userdata
-
a.pid:set_kpid (kp, ki, kd)
-
set proportional integral derivative constant for PID controller
Parameters:
- kp
number
proportional constant
- ki
number
integral constant
- kd
number
derivative constant
Returns:
a.pid
PID controller userdata
-
a.pid:run (set, fdb)
-
calculate for PID controller
Parameters:
- set
number
setpoint value
- fdb
number
feedback value
Returns:
number
setpoint value
-
a.pid:pos (set, fdb)
-
calculate for positional PID controller
Parameters:
- set
number
setpoint value
- fdb
number
feedback value
Returns:
number
output value
-
a.pid:inc (set, fdb)
-
calculate for incremental PID controller
Parameters:
- set
number
setpoint value
- fdb
number
feedback value
Returns:
number
output value
-
a.pid:zero ()
-
zeroing for PID controller
Returns:
a.pid
PID controller userdata