ACS completed fully. All cases to be tested

Dependencies:   FreescaleIAP mbed-rtos mbed

Fork of ACS_Flowchart_BAE by Team Fox

ACS.h

Committer:
Bragadeesh153
Date:
2016-06-13
Revision:
18:21740620c65e
Parent:
17:1e1955f3db75

File content as of revision 18:21740620c65e:

#include "mbed.h"
#include "math.h"
#include "pni.h" 

//...........................................
#define TIME_PERIOD  0.02
#define TR_CONSTANT  0.3
#define sampling_time 10
#define kdetumble 2000000
#define MmntMax 1.1  // Unit: Ampere*Meter^2
#define OmegaMax 1*3.1415/180.0 // Unit: Radians/Second
#define ACS_DEMAG_TIME_DELAY 20

#define senstivity_gyro 6.5536; //senstivity is obtained from 2^15/5000dps
#define senstivity_mag  32.768; //senstivity is obtained from 2^15/1000microtesla
#define senstivity_time 32; //senstivity is obtained from 2^16/2048dps

void FCTN_ACS_GENPWM_MAIN(float*);
void FCTN_ACS_CNTRLALGO(float*,float*,int);
void controlmodes(float*, float*, float*, uint8_t);
void inverse(float mat[3][3],float inv[3][3]);
extern void FLAG();

void FCTN_ATS_SWITCH(bool);
int FCTN_ACS_INIT(); //initialization of registers happens
//void FCTN_ATS_DATA_ACQ(float*,float*); // main function: checks errors, gets data, switches on/off the sensor
//void FCTN_GET_DATA(float*,float*); //data is obtained
void FCTN_T_OUT(); //timeout function to stop infinite loop
int FCTN_ATS_DATA_ACQ();