FINAL ACS TO BE USED FOR TESTING. COMMISSIONING, ACS MAIN, DATA ACQ ALL DONE.

Dependencies:   FreescaleIAP mbed-rtos mbed

Fork of ACS_FULL_Flowchart_BAE by Team Fox

ACS.h

Committer:
Bragadeesh153
Date:
2016-06-28
Revision:
19:403cb36e22ed
Parent:
18:21740620c65e

File content as of revision 19:403cb36e22ed:

#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 65
#define ACS_Z_FIXED_MOMENT 1.3

#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/2048 s

void FCTN_ACS_GENPWM_MAIN(float*);
void FCTN_ACS_CNTRLALGO(float*,float*,float*,uint8_t,uint8_t,uint8_t);
void controlmodes(float*,float*, float*, float*, uint8_t,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_T_OUT(); //timeout function to stop infinite loop
int FCTN_ATS_DATA_ACQ();