1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
/***
fuzzy proportional integral derivative controller
@classmod a.pid_fuzzy
*/
#ifndef LUA_LIBA_PID_FUZZY_H
#define LUA_LIBA_PID_FUZZY_H
#include "a.h"
/***
fuzzy proportional integral derivative controller
@field kp proportional constant
@field ki integral constant
@field kd derivative constant
@field summax maximum integral output
@field summin minimum integral output
@field sum controller integral output
@field outmax maximum final output
@field outmin minimum final output
@field out controller final output
@field fdb cache feedback
@field err cache error
@field nrule number of order in the square matrix
@field nfuzz maximum number triggered by the rule
@table a.pid_fuzzy
*/
#if defined(__cplusplus)
extern "C" {
#endif /* __cplusplus */
/***
destructor for fuzzy PID controller
@function die
*/
int liba_pid_fuzzy_die(lua_State *L);
/***
constructor for fuzzy PID controller
@treturn a.pid_fuzzy fuzzy PID controller userdata
@function new
*/
int liba_pid_fuzzy_new(lua_State *L);
/***
initialize for fuzzy PID controller
@treturn a.pid_fuzzy fuzzy PID controller userdata
@function init
*/
int liba_pid_fuzzy_init(lua_State *L);
/***
set fuzzy relational operator for fuzzy PID controller
@tparam int opr enumeration for fuzzy PID controller operator
@treturn a.pid_fuzzy fuzzy PID controller userdata
@function set_opr
*/
int liba_pid_fuzzy_set_opr(lua_State *L);
/***
set memory block for fuzzy PID controller
@tparam int num maximum number triggered by the rule
@treturn a.pid_fuzzy fuzzy PID controller userdata
@function set_nfuzz
*/
int liba_pid_fuzzy_set_nfuzz(lua_State *L);
/***
set rule base for fuzzy PID controller
@tparam table me points to membership function parameter table, terminated by 0
@tparam table mec points to membership function parameter table, terminated by 0
@tparam table mkp points to Kp's rule base table which must be a square matrix
@tparam table mki points to Ki's rule base table which must be a square matrix
@tparam table mkd points to Kd's rule base table which must be a square matrix
@treturn a.pid_fuzzy fuzzy PID controller userdata
@function set_rule
*/
int liba_pid_fuzzy_set_rule(lua_State *L);
/***
set proportional integral derivative constant for fuzzy PID controller
@tparam number kp proportional constant
@tparam number ki integral constant
@tparam number kd derivative constant
@treturn a.pid_fuzzy fuzzy PID controller userdata
@function set_kpid
*/
int liba_pid_fuzzy_set_kpid(lua_State *L);
/***
calculate for fuzzy PID controller
@tparam number set setpoint value
@tparam number fdb feedback value
@treturn number setpoint value
@function run
*/
int liba_pid_fuzzy_run(lua_State *L);
/***
calculate for positional fuzzy PID controller
@tparam number set setpoint value
@tparam number fdb feedback value
@treturn number output value
@function pos
*/
int liba_pid_fuzzy_pos(lua_State *L);
/***
calculate for incremental fuzzy PID controller
@tparam number set setpoint value
@tparam number fdb feedback value
@treturn number output value
@function inc
*/
int liba_pid_fuzzy_inc(lua_State *L);
/***
zeroing for fuzzy PID controller
@treturn a.pid_fuzzy fuzzy PID controller userdata
@function zero
*/
int liba_pid_fuzzy_zero(lua_State *L);
#if defined(__cplusplus)
} /* extern "C" */
#endif /* __cplusplus */
#endif /* pid/fuzzy.h */