Sensor accelerometer mma7260 buatan Freescale Semiconductor ini mempunyai 6 buah fungsi yaitu untuk mengukur gerakan (movement), getaran (vibration), jatuh (fall), kemiringan (tilt), posisi (positioning) dan benturan (shock).
Berikut adalah schematic accelerometer mma7260.
Voffset adalah VDD/2 atau saat percepatan=0g atau 1,65 Volt
1. Measuring Tilt Using One Axis;
Ax=(Voutx-Voffset)/S;
Ax=percepatan sumbu X(gravitasi);
θ= arcsin (Ax); dimana θ=kemiringan (sudut)
2. Measuring Tilt Using Two Axis Solution;
menggunakan sumbu X dan Z.
Ax=(Voutx-Voffset)/S;
Az=(Voutz-Voffset)/S;
θ=arctan (Ax/Az); dimana θ=kemiringan (sudut)
Ax=(Voutx-Voffset)/S;
Az=(Voutz-Voffset)/S;
Ay=(Vouty-Voffset)/S;
ρ=arctan(Ax/√(Ay²+Az²)); →picth
Φ=arctan(Ay/√(Ax²+Az²)); →roll
ø=arctan(√(Ax²+Ay²)/Az); →yaw
Ax = percepatan sumbu X
Ay = percepatan sumbu Y
Az = percepatan sumbu Z
1. Manual 0g X, Y, Z Full Range Calibration
2. Simple 0g X, Y, Z Calibration
3. Freefall Calibration, dan
4. Simple 0g X, 0g Y, +1g Z Calibration
void kalibrasiZ()
{
if (PIND.0==0 && indeks==3) // kalibrasi Z
{
g0X = VoutX; // paralel to earth surface
g0Y = VoutY; //Z_axis is vertical with Z label UP
g1Z = VoutZ;
indeks=2;
lcd_clear();
lcd_putsf(“proses cal. Z”);
delay_ms(3000);
}
}
void kalibrasiX()
{
if (PIND.0==0 && indeks==2) // kalibrasi X
{ //X_axis is vertical with X label UP
g1X = VoutX;
g0Z = VoutZ;
indeks=1;
lcd_clear();
lcd_putsf(“proses cal. X”);
delay_ms(3000);
}
}
void kalibrasiY()
{
if (PIND.0==0 && indeks==1) //kalibrasi Y
{
g1Y = VoutY; //Y_axis is vertical with Y label UP
indeks=3;
lcd_clear();
lcd_putsf(“proses cal. Y”);
delay_ms(3000);
}
}
void baca_adc() //baca adc untuk sumbu X dan Z
{
VoutX = (float)read_adc(0); //0=sumbu X, 1=sumbu Y, 2=sumbu Z
VoutZ = (float)read_adc(2);
}
void hitung_accelerometer()
{
Ax = (float)(VoutX – g0X)/(g1X-g0X); //persamaan menghitung percepatan X
Az = (float)(VoutZ – g0Z)/(g1Z-g0Z);
sudut = atan2(Ax,Az); //persamaan menghitung sudut, masih dlm radian
sudut = (sudut*180)/3.14; //ubah ke dlm sudut
}
void tampilkan_lcd()
{
lcd_putsf(“sudut =”);
ftoa(sudut,1,temp); //nampilin nilai sudut
lcd_gotoxy(8,0);
lcd_puts(temp);
}
DOWNLOAD PROGRAM DAN SCHEMATIC .
AN1611 Impact Measurement Using Accelerometers.pdf
AN3107 Measuring Tilt with Low-g Accelerometers.pdf
AN3461 Tilt Sensing Using Linear Accelerometers.pdf
Solutions Based in Accelerometers AC317.pdf
AN3397 Implementing Positioning Algorithms Using Accelerometers.pdf
AN3109 Using the Multi-Axis g-Select Evaluation.pdf
AN3447 Implementing Auto-Zero Calibration Technique for Accelerometers.pdf
AN3151 Detecting Freefall with Low-G Accelerometers.pdf
AN3751 Frequency Analysis in the Industrial Market Using Accelerometer Sensors.pdf
AN3523 Advanced Applications for the Freescale USB_Lite by CMX.pdf
Sumber: https://elektro-kontrol.blogspot.co.id/2011/06/pengukuran-kemiringan-menggunakan.html