dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Vibration analysis module

Files

file  vibrationanalysis.c
 Gathers data on the accels to estimate vibration.
 

Data Structures

struct  VibrationAnalysis_data
 

Macros

#define MAX_QUEUE_SIZE   2
 
#define STACK_SIZE_BYTES   (200 + 448 + 16 + (2*3*window_size)*0)
 
#define TASK_PRIORITY   PIOS_THREAD_PRIO_LOW
 
#define SETTINGS_THROTTLING_MS   100
 
#define MAX_ACCEL_RANGE   16
 
#define FLOAT_TO_FIXED   (32768/(MAX_ACCEL_RANGE*2)-1)
 
#define VIBRATION_ELEMENTS_COUNT   16
 
#define MAX_WINDOW_SIZE   1024
 
#define USE_SINGLE_INSTANCE_BUFFERS   1
 

Functions

static void VibrationAnalysisTask (void *parameters)
 
static void VibrationAnalysisCleanup (void)
 
static int32_t VibrationAnalysisStart (void)
 
static int32_t VibrationAnalysisInitialize (void)
 

Variables

static struct pios_thread * taskHandle
 
static TaskInfoRunningElem task
 
static struct pios_queuequeue
 
static bool module_enabled = false
 
static struct
VibrationAnalysis_data
vtd
 

Detailed Description

Macro Definition Documentation

#define FLOAT_TO_FIXED   (32768/(MAX_ACCEL_RANGE*2)-1)

Definition at line 65 of file vibrationanalysis.c.

#define MAX_ACCEL_RANGE   16

Definition at line 64 of file vibrationanalysis.c.

#define MAX_QUEUE_SIZE   2

Input objects: Accels, VibrationAnalysisSettings Output object: VibrationAnalysisOutput

This module executes on a timer trigger. When the module is triggered it will update the data of VibrationAnalysiOutput, with the accumulated accelerometer samples.

Definition at line 52 of file vibrationanalysis.c.

#define MAX_WINDOW_SIZE   1024

Definition at line 68 of file vibrationanalysis.c.

#define SETTINGS_THROTTLING_MS   100

Definition at line 62 of file vibrationanalysis.c.

#define STACK_SIZE_BYTES   (200 + 448 + 16 + (2*3*window_size)*0)

Definition at line 54 of file vibrationanalysis.c.

#define TASK_PRIORITY   PIOS_THREAD_PRIO_LOW

Definition at line 61 of file vibrationanalysis.c.

#define USE_SINGLE_INSTANCE_BUFFERS   1

Definition at line 71 of file vibrationanalysis.c.

#define VIBRATION_ELEMENTS_COUNT   16

Definition at line 66 of file vibrationanalysis.c.

Function Documentation

static void VibrationAnalysisCleanup ( void  )
static

Definition at line 110 of file vibrationanalysis.c.

static int32_t VibrationAnalysisInitialize ( void  )
static

Initialise the module, called on startup

Definition at line 300 of file vibrationanalysis.c.

static int32_t VibrationAnalysisStart ( void  )
static

Start the module, called on startup

Definition at line 150 of file vibrationanalysis.c.

static void VibrationAnalysisTask ( void *  parameters)
static

Accumulate accelerometer data. This would be a great place to add a high-pass filter, in order to eliminate the DC bias from gravity. Until then, a DC bias subtraction has been added in the main loop.

Definition at line 337 of file vibrationanalysis.c.

Variable Documentation

bool module_enabled = false
static

Definition at line 80 of file vibrationanalysis.c.

struct pios_queue* queue
static

Definition at line 79 of file vibrationanalysis.c.

TaskInfoRunningElem task
static

Definition at line 78 of file vibrationanalysis.c.

struct pios_thread* taskHandle
static

Definition at line 77 of file vibrationanalysis.c.

struct VibrationAnalysis_data * vtd
static