00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00036 #ifndef _CONTROL_SYSTEM_MANAGER_
00037 #define _CONTROL_SYSTEM_MANAGER_
00038
00039 #include <aversive.h>
00040
00042 struct cs {
00043
00044 int32_t (*consign_filter)(void *, int32_t);
00045 void* consign_filter_params;
00046
00047 int32_t (*correct_filter)(void*, int32_t);
00048 void* correct_filter_params;
00049
00050 int32_t (*feedback_filter)(void*, int32_t);
00051 void* feedback_filter_params;
00052
00053 int32_t (*process_out)(void*);
00054 void* process_out_params;
00055
00056 void (*process_in)(void*, int32_t);
00057 void* process_in_params;
00058
00059 int32_t consign_value;
00060 int32_t filtered_feedback_value;
00061 int32_t filtered_consign_value;
00062 int32_t error_value;
00063 int32_t out_value;
00064 };
00065
00066
00067
00069 void cs_init(struct cs* cs);
00070
00072 void cs_set_consign_filter(struct cs* cs,
00073 int32_t (*consign_filter)(void*, int32_t),
00074 void* consign_filter_params);
00075
00077 void cs_set_correct_filter(struct cs* cs,
00078 int32_t (*correct_filter)(void*, int32_t),
00079 void* correct_filer_params);
00080
00082 void cs_set_feedback_filter(struct cs* cs,
00083 int32_t (*feedback_filter)(void*, int32_t),
00084 void* feedback_filer_params);
00085
00087 void cs_set_process_in(struct cs* cs,
00088 void (*process_in)(void*, int32_t),
00089 void* process_in_params);
00090
00092 void cs_set_process_out(struct cs* cs,
00093 int32_t (*process_out)(void*),
00094 void* process_out_params);
00095
00096
00109 int32_t cs_do_process(struct cs* cs, int32_t consign);
00110
00114 void cs_manage(void * cs);
00115
00117 int32_t cs_get_out(struct cs* cs);
00118
00120 int32_t cs_get_error(struct cs* cs);
00121
00123 int32_t cs_get_consign(struct cs* cs);
00124
00126 int32_t cs_get_filtered_consign(struct cs* cs);
00127
00129 int32_t cs_get_filtered_feedback(struct cs* cs);
00130
00132 void cs_set_consign(struct cs* cs, int32_t v);
00133
00134
00135 #endif