dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Autotuning Module

Files

file  autotune.c
 State machine to run autotuning. Low level work done by Stabilization Module.
 

Data Structures

struct  at_flash_header
 
struct  at_measurement
 

Macros

#define AUTOTUNE_STATE_PERIOD_MS   100
 
#define AUTOTUNE_AVERAGING_DECIMATION   1
 
#define ATFLASH_MAGIC   0x656e755480008041 /* A...Tune */
 

Enumerations

enum  autotune_state { AT_INIT, AT_RUN }
 

Functions

static void autotune_step (const UAVObjEvent *ev, void *ctx, void *obj, int len)
 
int32_t AutotuneInitialize (void)
 
int32_t AutotuneStart (void)
 
static void at_new_actuators (const UAVObjEvent *ev, void *ctx, void *obj, int len)
 
static void UpdateSystemIdent (uint32_t predicts, float hover_throttle, bool new_tune)
 
static int autotune_save_averaging ()
 

Variables

static struct at_measurementat_averages
 
static bool module_enabled
 
static volatile uint32_t throttle_accumulator
 
static volatile uint32_t update_counter = 0
 
static volatile bool tune_running = false
 
uint16_t ident_wiggle_points
 
static enum autotune_state state = AT_INIT
 
static bool save_needed = false
 
static uint16_t decim_wiggle_points
 

Detailed Description

Macro Definition Documentation

#define ATFLASH_MAGIC   0x656e755480008041 /* A...Tune */

Definition at line 65 of file autotune.c.

#define AUTOTUNE_AVERAGING_DECIMATION   1

Definition at line 59 of file autotune.c.

#define AUTOTUNE_STATE_PERIOD_MS   100

Definition at line 56 of file autotune.c.

Enumeration Type Documentation

Enumerator
AT_INIT 
AT_RUN 

Definition at line 63 of file autotune.c.

Function Documentation

static void at_new_actuators ( const UAVObjEvent ev,
void *  ctx,
void *  obj,
int  len 
)
static

Definition at line 147 of file autotune.c.

static int autotune_save_averaging ( )
static

Definition at line 213 of file autotune.c.

static void autotune_step ( const UAVObjEvent ev,
void *  ctx,
void *  obj,
int  len 
)
static

Module periodic task.

Definition at line 262 of file autotune.c.

int32_t AutotuneInitialize ( void  )

Initialise the module, called on startup

Returns
0 on success or -1 if initialisation failed

Definition at line 103 of file autotune.c.

int32_t AutotuneStart ( void  )

Initialise the module, called on startup

Returns
0 on success or -1 if initialisation failed

Definition at line 129 of file autotune.c.

static void UpdateSystemIdent ( uint32_t  predicts,
float  hover_throttle,
bool  new_tune 
)
static

Definition at line 201 of file autotune.c.

Variable Documentation

struct at_measurement* at_averages
static

Definition at line 81 of file autotune.c.

uint16_t decim_wiggle_points
static

Definition at line 93 of file autotune.c.

uint16_t ident_wiggle_points

Definition at line 152 of file stabilization.c.

bool module_enabled
static

Definition at line 84 of file autotune.c.

bool save_needed = false
static

Definition at line 92 of file autotune.c.

enum autotune_state state = AT_INIT
static

Definition at line 91 of file autotune.c.

volatile uint32_t throttle_accumulator
static

Definition at line 86 of file autotune.c.

volatile bool tune_running = false
static

Definition at line 88 of file autotune.c.

volatile uint32_t update_counter = 0
static

Definition at line 87 of file autotune.c.