Class a.pid

proportional integral derivative controller

Tables

a.pid proportional integral derivative controller

Methods

a.pid:new () constructor for PID controller
a.pid:init () initialize for PID controller
a.pid:set_kpid (kp, ki, kd) set proportional integral derivative constant for PID controller
a.pid:run (set, fdb) calculate for PID controller
a.pid:pos (set, fdb) calculate for positional PID controller
a.pid:inc (set, fdb) calculate for incremental PID controller
a.pid:zero () zeroing for PID controller


Tables

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

Methods

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
generated by LDoc 1.5.0 Last updated 2024-09-30 14:51:04