28 lines
642 B
C
28 lines
642 B
C
#include "pid.h"
|
|
#include <math.h>
|
|
|
|
// 构造函数将接口绑定
|
|
void pid_constructor(pid_t *self)
|
|
{
|
|
switch (self->type)
|
|
{
|
|
case PID_TYPE_COMMON:
|
|
/* code */
|
|
break;
|
|
case PID_TYPE_NEURAL:
|
|
pid_neural_constructor(&self->pid_u.neural);
|
|
break;
|
|
case PID_TYPE_FUZZY:
|
|
DBG_ASSERT(self->sub_type != 0 __DBG_LINE);
|
|
self->pid_u.fuzzy.sub_type = self->sub_type;
|
|
pid_fuzzy_constructor(&self->pid_u.fuzzy);
|
|
break;
|
|
case PID_TYPE_AUTO_TUNE:
|
|
pid_auto_tune_constructor(&self->auto_tune);
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
self->is_init = TRUE;
|
|
}
|