aversive_10-03-12/modules/devices/control_system/filters/pid/pid.h File Reference

#include <aversive.h>
#include <stdlib.h>
#include <pid_config.h>

Go to the source code of this file.

Data Structures

struct  pid_filter

Functions

void pid_init (struct pid_filter *p)
void pid_reset (struct pid_filter *p)
void pid_set_gains (struct pid_filter *p, int16_t gp, int16_t gi, int16_t gd)
void pid_set_maximums (struct pid_filter *p, int32_t max_in, int32_t max_I, int32_t max_out)
void pid_set_out_shift (struct pid_filter *p, uint8_t out_shift)
int8_t pid_set_derivate_filter (struct pid_filter *p, uint8_t nb_samples)
int16_t pid_get_gain_P (struct pid_filter *p)
int16_t pid_get_gain_I (struct pid_filter *p)
int16_t pid_get_gain_D (struct pid_filter *p)
int32_t pid_get_max_in (struct pid_filter *p)
int32_t pid_get_max_I (struct pid_filter *p)
int32_t pid_get_max_out (struct pid_filter *p)
uint8_t pid_get_out_shift (struct pid_filter *p)
uint8_t pid_get_derivate_filter (struct pid_filter *p)
int32_t pid_get_value_I (struct pid_filter *p)
int32_t pid_get_value_in (struct pid_filter *p)
int32_t pid_get_value_D (struct pid_filter *p)
int32_t pid_get_value_out (struct pid_filter *p)
int32_t pid_do_filter (void *p, int32_t in)


Function Documentation

int32_t pid_do_filter ( void *  p,
int32_t  in 
)

uint8_t pid_get_derivate_filter ( struct pid_filter p  ) 

Definition at line 131 of file pid.c.

References pid_filter::derivate_nb_samples.

int16_t pid_get_gain_D ( struct pid_filter p  ) 

Definition at line 104 of file pid.c.

References pid_filter::gain_D.

int16_t pid_get_gain_I ( struct pid_filter p  ) 

Definition at line 99 of file pid.c.

References pid_filter::gain_I.

int16_t pid_get_gain_P ( struct pid_filter p  ) 

Definition at line 94 of file pid.c.

References pid_filter::gain_P.

int32_t pid_get_max_I ( struct pid_filter p  ) 

Definition at line 115 of file pid.c.

References pid_filter::max_I.

int32_t pid_get_max_in ( struct pid_filter p  ) 

Definition at line 110 of file pid.c.

References pid_filter::max_in.

int32_t pid_get_max_out ( struct pid_filter p  ) 

Definition at line 120 of file pid.c.

References pid_filter::max_out.

uint8_t pid_get_out_shift ( struct pid_filter p  ) 

Definition at line 126 of file pid.c.

References pid_filter::out_shift.

int32_t pid_get_value_D ( struct pid_filter p  ) 

get previous derivate value (without gain)

Definition at line 156 of file pid.c.

References IRQ_LOCK, IRQ_UNLOCK, and pid_filter::prev_D.

int32_t pid_get_value_I ( struct pid_filter p  ) 

get the sum of all nput samples since the filter initialisation

Definition at line 136 of file pid.c.

References pid_filter::integral, IRQ_LOCK, and IRQ_UNLOCK.

int32_t pid_get_value_in ( struct pid_filter p  ) 

get previous input value

Definition at line 146 of file pid.c.

References pid_filter::index, IRQ_LOCK, IRQ_UNLOCK, and pid_filter::prev_samples.

int32_t pid_get_value_out ( struct pid_filter p  ) 

get previous output value

Definition at line 166 of file pid.c.

References IRQ_LOCK, IRQ_UNLOCK, and pid_filter::prev_out.

void pid_init ( struct pid_filter p  ) 

init pid

this function will initialize all fieds of pid structure to 0

Definition at line 27 of file pid.c.

References pid_filter::derivate_nb_samples, pid_filter::gain_P, IRQ_LOCK, and IRQ_UNLOCK.

void pid_reset ( struct pid_filter p  ) 

reset state (derivate and intergral state)

this function will initialize all fieds of pid structure to 0, except configuration

Definition at line 39 of file pid.c.

References pid_filter::integral, IRQ_LOCK, IRQ_UNLOCK, pid_filter::prev_D, pid_filter::prev_out, and pid_filter::prev_samples.

int8_t pid_set_derivate_filter ( struct pid_filter p,
uint8_t  nb_samples 
)

Definition at line 78 of file pid.c.

References pid_filter::derivate_nb_samples, IRQ_LOCK, and IRQ_UNLOCK.

void pid_set_gains ( struct pid_filter p,
int16_t  gp,
int16_t  gi,
int16_t  gd 
)

Definition at line 50 of file pid.c.

References pid_filter::gain_D, pid_filter::gain_I, pid_filter::gain_P, IRQ_LOCK, and IRQ_UNLOCK.

void pid_set_maximums ( struct pid_filter p,
int32_t  max_in,
int32_t  max_I,
int32_t  max_out 
)

Definition at line 60 of file pid.c.

References IRQ_LOCK, IRQ_UNLOCK, pid_filter::max_I, pid_filter::max_in, and pid_filter::max_out.

void pid_set_out_shift ( struct pid_filter p,
uint8_t  out_shift 
)

Definition at line 70 of file pid.c.

References IRQ_LOCK, IRQ_UNLOCK, and pid_filter::out_shift.


Generated on Fri Mar 12 06:32:06 2010 for AVR by  doxygen 1.5.6