liba 0.1.15
An algorithm library based on C/C++
Loading...
Searching...
No Matches
fuzzy proportional integral derivative controller
Collaboration diagram for fuzzy proportional integral derivative controller:

Data Structures

struct  a_pid_fuzzy
 instance structure for fuzzy PID controller More...
 

Macros

#define a_pid_fuzzy_init(ctx)
 initialize for fuzzy PID controller
 
#define A_PID_FUZZY_BFUZZ(n)
 compute size of memory block for fuzzy PID controller
 

Typedefs

typedef struct a_pid_fuzzy a_pid_fuzzy
 

Enumerations

enum  {
  A_PID_FUZZY_EQU , A_PID_FUZZY_CAP , A_PID_FUZZY_CAP_ALGEBRA , A_PID_FUZZY_CAP_BOUNDED ,
  A_PID_FUZZY_CUP , A_PID_FUZZY_CUP_ALGEBRA , A_PID_FUZZY_CUP_BOUNDED
}
 enumeration for fuzzy PID controller operator More...
 

Functions

void a_pid_fuzzy_set_opr (a_pid_fuzzy *ctx, unsigned int opr)
 set fuzzy relational operator for fuzzy PID controller
 
void * a_pid_fuzzy_bfuzz (a_pid_fuzzy const *ctx)
 get memory block for fuzzy PID controller
 
void a_pid_fuzzy_set_bfuzz (a_pid_fuzzy *ctx, void *ptr, size_t num)
 set memory block for fuzzy PID controller
 
void a_pid_fuzzy_set_rule (a_pid_fuzzy *ctx, unsigned int nrule, double const *me, double const *mec, double const *mkp, double const *mki, double const *mkd)
 set rule base for fuzzy PID controller
 
void a_pid_fuzzy_set_kpid (a_pid_fuzzy *ctx, double kp, double ki, double kd)
 set proportional integral derivative constant for fuzzy PID controller
 
double a_pid_fuzzy_run (a_pid_fuzzy *ctx, double set, double fdb)
 calculate for fuzzy PID controller
 
double a_pid_fuzzy_pos (a_pid_fuzzy *ctx, double set, double fdb)
 calculate for positional fuzzy PID controller
 
double a_pid_fuzzy_inc (a_pid_fuzzy *ctx, double set, double fdb)
 calculate for incremental fuzzy PID controller
 
void a_pid_fuzzy_zero (a_pid_fuzzy *ctx)
 zeroing for fuzzy PID controller
 

Variables

double(*)(double, double) a_pid_fuzzy_opr (unsigned int opr)
 get fuzzy relational operator for fuzzy PID controller
 

Detailed Description

Macro Definition Documentation

◆ A_PID_FUZZY_BFUZZ

#define A_PID_FUZZY_BFUZZ ( n)
Value:
(sizeof(unsigned int) * (n) * 2 + sizeof(a_float) * (n) * (2 + (n)))
#define a_float
Definition a.h:785

compute size of memory block for fuzzy PID controller

Parameters
[in]nthe maximum number triggered by the rule

◆ a_pid_fuzzy_init

#define a_pid_fuzzy_init ( ctx)
Value:
void a_pid_fuzzy_zero(a_pid_fuzzy *ctx)
zeroing for fuzzy PID controller

initialize for fuzzy PID controller

Parameters
[in,out]ctxpoints to an instance of fuzzy PID controller

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

enumeration for fuzzy PID controller operator

Enumerator
A_PID_FUZZY_EQU 

sqrt(a,b)*sqrt(1-(1-a)*(1-b))

A_PID_FUZZY_CAP 

min(a,b)

A_PID_FUZZY_CAP_ALGEBRA 

a*b

A_PID_FUZZY_CAP_BOUNDED 

max(a+b-1,0)

A_PID_FUZZY_CUP 

max(a,b)

A_PID_FUZZY_CUP_ALGEBRA 

a+b-a*b

A_PID_FUZZY_CUP_BOUNDED 

min(a+b,1)

Function Documentation

◆ a_pid_fuzzy_bfuzz()

void * a_pid_fuzzy_bfuzz ( a_pid_fuzzy const * ctx)

get memory block for fuzzy PID controller

Parameters
[in,out]ctxpoints to an instance of fuzzy PID controller
Returns
memory block for fuzzy PID controller

◆ a_pid_fuzzy_inc()

double a_pid_fuzzy_inc ( a_pid_fuzzy * ctx,
double set,
double fdb )

calculate for incremental fuzzy PID controller

Parameters
[in,out]ctxpoints to an instance of fuzzy PID controller
[in]setsetpoint value
[in]fdbfeedback value
Returns
output value

◆ a_pid_fuzzy_pos()

double a_pid_fuzzy_pos ( a_pid_fuzzy * ctx,
double set,
double fdb )

calculate for positional fuzzy PID controller

Parameters
[in,out]ctxpoints to an instance of fuzzy PID controller
[in]setsetpoint value
[in]fdbfeedback value
Returns
output value

◆ a_pid_fuzzy_run()

double a_pid_fuzzy_run ( a_pid_fuzzy * ctx,
double set,
double fdb )

calculate for fuzzy PID controller

Parameters
[in,out]ctxpoints to an instance of fuzzy PID controller
[in]setsetpoint value
[in]fdbfeedback value
Returns
setpoint value

◆ a_pid_fuzzy_set_bfuzz()

void a_pid_fuzzy_set_bfuzz ( a_pid_fuzzy * ctx,
void * ptr,
size_t num )

set memory block for fuzzy PID controller

Parameters
[in,out]ctxpoints to an instance of fuzzy PID controller
[in]ptrpoints to a buffer at least A_PID_FUZZY_BFUZZ(num)
[in]numthe maximum number triggered by the rule

◆ a_pid_fuzzy_set_kpid()

void a_pid_fuzzy_set_kpid ( a_pid_fuzzy * ctx,
double kp,
double ki,
double kd )

set proportional integral derivative constant for fuzzy PID controller

Parameters
[in,out]ctxpoints to an instance of fuzzy PID controller
[in]kpproportional constant
[in]kiintegral constant
[in]kdderivative constant

◆ a_pid_fuzzy_set_opr()

void a_pid_fuzzy_set_opr ( a_pid_fuzzy * ctx,
unsigned int opr )

set fuzzy relational operator for fuzzy PID controller

Parameters
[in,out]ctxpoints to an instance of fuzzy PID controller
[in]oprenumeration for fuzzy PID controller operator

◆ a_pid_fuzzy_set_rule()

void a_pid_fuzzy_set_rule ( a_pid_fuzzy * ctx,
unsigned int nrule,
double const * me,
double const * mec,
double const * mkp,
double const * mki,
double const * mkd )

set rule base for fuzzy PID controller

Parameters
[in,out]ctxpoints to an instance of fuzzy PID controller
[in]nrulenumber of order in the square matrix
[in]mepoints to e's membership function parameter table
[in]mecpoints to ec's membership function parameter table
[in]mkppoints to Kp's rule base table which must be a square matrix
[in]mkipoints to Ki's rule base table which must be a square matrix
[in]mkdpoints to Kd's rule base table which must be a square matrix

◆ a_pid_fuzzy_zero()

void a_pid_fuzzy_zero ( a_pid_fuzzy * ctx)

zeroing for fuzzy PID controller

Parameters
[in,out]ctxpoints to an instance of fuzzy PID controller

Variable Documentation

◆ a_pid_fuzzy_opr

double(*)(double, double) a_pid_fuzzy_opr(unsigned int opr) ( unsigned int opr)

get fuzzy relational operator for fuzzy PID controller

Parameters
[in]oprenumeration for fuzzy PID controller operator
Returns
fuzzy relational operator for fuzzy PID controller