dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
smoothcontrol.h
Go to the documentation of this file.
1 #ifndef SMOOTHCONTROL_H
2 #define SMOOTHCONTROL_H
3 
4 // Defines the predictor time-limit so it doesn't go haywire.
5 // Chosem PPM frame timing for now.
6 #define SMOOTHCONTROL_TIMEBOMB 20.0f
7 
8 // Defines ratio of inter-signal timing to run a prediction algorithm for.
9 #define SMOOTHCONTROL_DUTY_CYCLE 0.5f
10 
11 // Controls steepness of prediction slope.
12 #define SMOOTHCONTROL_PREDICTOR_SLOPE 0.8f
13 
14 // At which ratio to start the chamfer.
15 #define SMOOTHCONTROL_CHAMFER_START 0.75f
16 
17 enum {
18  // Bypass.
20 
21  // Chamfers the corners of the stairstepped control signal.
22  // icee's idea.
24 
25  // Linear interpolate control input.
27 };
28 
30 
31 
32 void smoothcontrol_initialize(smoothcontrol_state *state);
33 void smoothcontrol_update_dT(smoothcontrol_state state, float dT);
34 void smoothcontrol_next(smoothcontrol_state state);
35 void smoothcontrol_run(smoothcontrol_state state, uint8_t axis_num, float *new_signal);
36 void smoothcontrol_run_thrust(smoothcontrol_state state, float *new_signal);
37 void smoothcontrol_reinit(smoothcontrol_state state, uint8_t axis_num, float new_signal);
38 void smoothcontrol_reinit_thrust(smoothcontrol_state state, float new_signal);
39 void smoothcontrol_set_mode(smoothcontrol_state state, uint8_t axis_num, uint8_t mode, uint8_t duty_cycle);
40 bool* smoothcontrol_get_ringer(smoothcontrol_state state);
41 
42 #endif // SMOOTHCONTROL_H
bool * smoothcontrol_get_ringer(smoothcontrol_state state)
void smoothcontrol_run_thrust(smoothcontrol_state state, float *new_signal)
void smoothcontrol_initialize(smoothcontrol_state *state)
void smoothcontrol_run(smoothcontrol_state state, uint8_t axis_num, float *new_signal)
void smoothcontrol_set_mode(smoothcontrol_state state, uint8_t axis_num, uint8_t mode, uint8_t duty_cycle)
Definition: smoothcontrol.c:96
void smoothcontrol_update_dT(smoothcontrol_state state, float dT)
enum channel_mode mode
Definition: pios_servo.c:58
void smoothcontrol_reinit_thrust(smoothcontrol_state state, float new_signal)
Definition: smoothcontrol.c:90
void smoothcontrol_next(smoothcontrol_state state)
void smoothcontrol_reinit(smoothcontrol_state state, uint8_t axis_num, float new_signal)
Definition: smoothcontrol.c:79
struct smoothcontrol_state_internal * smoothcontrol_state
Definition: smoothcontrol.h:29
enum arena_state state