SlideShare a Scribd company logo
eCompass API quick start
Alex.Hsieh
2016.11.10
V2.0.1
Outline
• eCompass API library
• PCB Sensor direction and coordinate system
• Sample code
• API Manual (chm)
• FAQ
eCompass API library & manual
• Check 5 files for eCompass API library
1) Sample code folder
2) Config.h
3) IST_LIB.h
4) IST_LIB.c
5) eCompass API.chm
eCompass API library
• Include 2 header file (.h) and 1 source file (.c) in
your project - Config.h / IST_LIB.h / IST_LIB.c
• Copy essential part from sample code - Main.c
PCB Sensor direction and coordinate system
• Change mag and acc sensor axis direction (x, y,
z) to fit coordinate system (N, E, U)
PCB Sensor direction
PCB Sensor direction and coordinate system
• Change sensor axis direction (x, y, z) to fit
coordinate system (N, E, U)
X
Y Z
X’
Y’Z’
X’ = -Y
Y’ = -X
Z’ = Z
X’
Y’Z’
X
Y Z
E
N
U
E
N
U
E
N
U
E
N
U
PCB Sensor direction and coordinate system
• Change mag sensor data (x, y, z) from LSB to
uT and axis direction • X’ = -Y * Mag_LSBtoUT
• Y’ = -X * Mag_LSBtoUT
• Z’ = Z * Mag_LSBtoUT
• Mag_LSBtoUT = 0.3
Sample code
• Steps
1) Copy sample code and enable the essential function
in your project
• Set_HeadingAngleEnable
• Set_MagAccuracyEnable
• Set_SingleCalibration / Set_DynamicCalibration
2) Input data need mag and acc data, if you don’t have
acc data, please input [0,0,9.8]
3) Check the input data axis direction to fit NEU
system
Sample code
• Include header file
Sample code
• Variable and compass API initialization (A and B
part.)
Sample code
• Variable and compass API initialization (A and B
part.)
Sample code
• Part B : isentek compass initialization stage
• ist8310_Init(); // init driver
• Set_HeadingAngleEnable(IST_TRUE);// if return Heading angle, it need acc
and mag sensor
• Set_MagAccuracyEnable(IST_TRUE);// if enable eCompass accuracy report -
return 0:unreliable 3:High 2:medum 1: low
• Set_SingleCalibration(IST_TRUE);// if enable single calibration right now
• Set_DynamicCalibration(IST_TRUE) ;// if enable continuous calibration
• Set_MagBias(Mag_IST8310_Bias);
// if you have last calibrated value and don't calibrate again, you can set by this
"Set_MagBias" function
// note : this setting dependent on your application, please check if you
applciation is suitable
Sample code
• Run process in while loop (C1-C6 part.)
Sample code
• Run process in while loop (C1-C6 part.)
Sample code
• Run process in while loop (C1 & C2 part.)
// C1. Get mag and acc data from driver and change the sensor value from LSB
to uT
ist8310_GetXYZ(MagXYZ);
for (int i = 0; i < 3; ++i) {
Mag_RawData[i] = (float)MagXYZ[i] * Mag_LSBtoUT;
}
// C2. Dependent on PCB layout, change the mag and acc direction to NEU (x =
east, y = west, z = up)
Mag_RawData[0] = Mag_RawData[0];
Mag_RawData[1] = -Mag_RawData[1];
Mag_RawData[2] = Mag_RawData[2];
AccData[0] = AccData[1];
AccData[1] = AccData[0];
AccData[2] = AccData[2]; PCB Sensor direction
Sample code
• Run process in while loop (C3-C4 part.)
// C3. Run Compass Process to get Calibrated Data
// Here, we use constant acc data input [0,0,9.8], also, acc data [0,0,1] is ok.
Process_RunCompass(Mag_RawData, AccData, Mag_CalibratedData);
// C4. Check Calibration Status
// Mag_CalibrationStatus : In calibration = 1, no = 0
// Get_MagBias : BiasX, BiasY, BiasZ, Radius
// Mag_GetIST8310_Bias element will have valid value after calibration,
// you can check the bias value to know process finish calibration.
Mag_CalibrationStatus = Get_CalibrationStatus();
Get_MagBias(Mag_GetIST8310_Bias);
Sample code
• Run process in while loop (C5-C6 part.)
// C5. Get Heading Angle
// Get_HeadingAngle return int type angle. 0 - 360 degree
// Get_HeadingAngle100 return int type angle . 0 - 36000 degree
// Therefore, we need to change angle type
Mag_HeadingAngle = (float)Get_HeadingAngle();
Mag_HeadingAngle_Int100 = 0.01f * ((float)Get_HeadingAngle100());
// C6. Get Mag Accuracy Status
// 0:unreliable 3:High 2:medum 1: low
Mag_Accurancy = Get_MagAccuracyStatus();
API Manual (chm)
• File list – inc – IST_LIB.h
API Manual (chm)
• Function list
API Manual (chm)
• Function detail
FAQ
• IST_A001 – What’s the LSB to uT?
• IST_A002 – Why do we change the axis of acc and mag sensor to
NEU system?
• IST_A003 – What’s the difference and priority between
Set_SingleCalibration and Set_DynamicCalibration API?
• IST_A004 – How to calibrate eCompass correctly?
• IST_A005 – What’s the definition for 0, 1, 2, 3 in accuracy report ?
• IST_A006 – What time do I use “Set_MagBias” function?

More Related Content

PDF
[Isentek] eCompass API FAQ
PPT
comparators
PPTX
Pid control for line follwoers
PPTX
Comparators ppt
PDF
Model2code mruby 2018
PPTX
Project Introduction
PDF
How to use api plug gage to measure api tubing casing and line pipe couplings
PPTX
Comparators
[Isentek] eCompass API FAQ
comparators
Pid control for line follwoers
Comparators ppt
Model2code mruby 2018
Project Introduction
How to use api plug gage to measure api tubing casing and line pipe couplings
Comparators

Viewers also liked (18)

PPTX
Act1.1.comercio electrónico.angélicadéfaz
DOC
capstone.doc 1a.4doc.doc final
DOC
Pongo, y la coma
PDF
Henrymena cloud
TXT
Website
PPTX
Los inicio de internet nos remontan a los
PPTX
#SpectraCares 2016 Photo Gallery
PDF
Programação e ementa
PPTX
A tether-less legged piezoelectric miniature robot for bidirectional motion
PPTX
docente- martha ivvon
PDF
Internal workshop es6_2015
PPTX
International Ataturk Alatoo University, International Relations 4-A, Turkey ...
PDF
Herdeiros de nelson rodrigues
PPTX
Խաշի պատմություն
PPTX
Account Based Marketing Software Product Demo: Winter Release, October 18th 2016
DOCX
Báo cáo thực tập - Nhơn Mỹ - Nguyễn Kỳ Thanh Thảo - 2016
PDF
Elizabeth verar how to use thrive themes to build landing pages
PDF
[Advantech] Modbus protocol training (ModbusTCP, ModbusRTU)
Act1.1.comercio electrónico.angélicadéfaz
capstone.doc 1a.4doc.doc final
Pongo, y la coma
Henrymena cloud
Website
Los inicio de internet nos remontan a los
#SpectraCares 2016 Photo Gallery
Programação e ementa
A tether-less legged piezoelectric miniature robot for bidirectional motion
docente- martha ivvon
Internal workshop es6_2015
International Ataturk Alatoo University, International Relations 4-A, Turkey ...
Herdeiros de nelson rodrigues
Խաշի պատմություն
Account Based Marketing Software Product Demo: Winter Release, October 18th 2016
Báo cáo thực tập - Nhơn Mỹ - Nguyễn Kỳ Thanh Thảo - 2016
Elizabeth verar how to use thrive themes to build landing pages
[Advantech] Modbus protocol training (ModbusTCP, ModbusRTU)
Ad

Similar to [Isentek] eCompass API Quick Start (20)

PPTX
KUKAROBOTPROGRAMING AND IN DEPTH KNOWLADE OF KUKA ROBOT.pptx
PPTX
Gulotta_Wright_Parisi_FinalProjectOverview1
PDF
Embedded Programming for Quadcopters
PPT
HPLC - Peak integration for chromatography
PPTX
Pid lfr
PDF
Integrating Adaptation Mechanisms Using Control Theory Centric Architecture M...
PPTX
Basic Tutorial for Robotic Arm
PPT
Modelling Simulation and Control of a Real System
PDF
21.MPMC-PPT1-fgcychgfcADC-K.Srinivas.pdf
PDF
Using matlab simulink
PDF
Using matlab simulink
PDF
426 Lecture5: AR Registration
PDF
PDF
Abhi monal
PDF
Approaches to formal verification of ams design
PPTX
Java Jit. Compilation and optimization by Andrey Kovalenko
PDF
Ge aviation spark application experience porting analytics into py spark ml p...
PDF
Overcoming challenges of_verifying complex mixed signal designs
PPT
Oracle EBS Cycle-Count-procedure and Tables
DOCX
ControlsLab1
KUKAROBOTPROGRAMING AND IN DEPTH KNOWLADE OF KUKA ROBOT.pptx
Gulotta_Wright_Parisi_FinalProjectOverview1
Embedded Programming for Quadcopters
HPLC - Peak integration for chromatography
Pid lfr
Integrating Adaptation Mechanisms Using Control Theory Centric Architecture M...
Basic Tutorial for Robotic Arm
Modelling Simulation and Control of a Real System
21.MPMC-PPT1-fgcychgfcADC-K.Srinivas.pdf
Using matlab simulink
Using matlab simulink
426 Lecture5: AR Registration
Abhi monal
Approaches to formal verification of ams design
Java Jit. Compilation and optimization by Andrey Kovalenko
Ge aviation spark application experience porting analytics into py spark ml p...
Overcoming challenges of_verifying complex mixed signal designs
Oracle EBS Cycle-Count-procedure and Tables
ControlsLab1
Ad

Recently uploaded (20)

PPTX
INFERTILITY (FEMALE FACTORS).pptxgvcghhfcg
PPTX
code of ethics.pptxdvhwbssssSAssscasascc
PPT
FABRICATION OF MOS FET BJT DEVICES IN NANOMETER
PPTX
quadraticequations-111211090004-phpapp02.pptx
PPTX
DEATH AUDIT MAY 2025.pptxurjrjejektjtjyjjy
PDF
Smarter Security: How Door Access Control Works with Alarms & CCTV
DOCX
A PROPOSAL ON IoT climate sensor 2.docx
PDF
Cableado de Controladores Logicos Programables
PPTX
KVL KCL ppt electrical electronics eee tiet
PPT
Hypersensitivity Namisha1111111111-WPS.ppt
PPTX
Embeded System for Artificial intelligence 2.pptx
PPT
Lines and angles cbse class 9 math chemistry
PDF
Layer23-Switch.com The Cisco Catalyst 9300 Series is Cisco’s flagship stackab...
PPTX
executive branch_no record.pptxsvvsgsggs
PPTX
udi-benefits-ggggggggfor-healthcare.pptx
PPTX
kvjhvhjvhjhjhjghjghjgjhgjhgjhgjhgjhgjhgjhgjh
PPTX
figurative-languagepowerpoint-150309132252-conversion-gate01.pptx
PPTX
title _yeOPC_Poisoning_Presentation.pptx
PPTX
making presentation that do no stick.pptx
PPTX
material for studying about lift elevators escalation
INFERTILITY (FEMALE FACTORS).pptxgvcghhfcg
code of ethics.pptxdvhwbssssSAssscasascc
FABRICATION OF MOS FET BJT DEVICES IN NANOMETER
quadraticequations-111211090004-phpapp02.pptx
DEATH AUDIT MAY 2025.pptxurjrjejektjtjyjjy
Smarter Security: How Door Access Control Works with Alarms & CCTV
A PROPOSAL ON IoT climate sensor 2.docx
Cableado de Controladores Logicos Programables
KVL KCL ppt electrical electronics eee tiet
Hypersensitivity Namisha1111111111-WPS.ppt
Embeded System for Artificial intelligence 2.pptx
Lines and angles cbse class 9 math chemistry
Layer23-Switch.com The Cisco Catalyst 9300 Series is Cisco’s flagship stackab...
executive branch_no record.pptxsvvsgsggs
udi-benefits-ggggggggfor-healthcare.pptx
kvjhvhjvhjhjhjghjghjgjhgjhgjhgjhgjhgjhgjhgjh
figurative-languagepowerpoint-150309132252-conversion-gate01.pptx
title _yeOPC_Poisoning_Presentation.pptx
making presentation that do no stick.pptx
material for studying about lift elevators escalation

[Isentek] eCompass API Quick Start

  • 1. eCompass API quick start Alex.Hsieh 2016.11.10 V2.0.1
  • 2. Outline • eCompass API library • PCB Sensor direction and coordinate system • Sample code • API Manual (chm) • FAQ
  • 3. eCompass API library & manual • Check 5 files for eCompass API library 1) Sample code folder 2) Config.h 3) IST_LIB.h 4) IST_LIB.c 5) eCompass API.chm
  • 4. eCompass API library • Include 2 header file (.h) and 1 source file (.c) in your project - Config.h / IST_LIB.h / IST_LIB.c • Copy essential part from sample code - Main.c
  • 5. PCB Sensor direction and coordinate system • Change mag and acc sensor axis direction (x, y, z) to fit coordinate system (N, E, U) PCB Sensor direction
  • 6. PCB Sensor direction and coordinate system • Change sensor axis direction (x, y, z) to fit coordinate system (N, E, U) X Y Z X’ Y’Z’ X’ = -Y Y’ = -X Z’ = Z X’ Y’Z’ X Y Z E N U E N U E N U E N U
  • 7. PCB Sensor direction and coordinate system • Change mag sensor data (x, y, z) from LSB to uT and axis direction • X’ = -Y * Mag_LSBtoUT • Y’ = -X * Mag_LSBtoUT • Z’ = Z * Mag_LSBtoUT • Mag_LSBtoUT = 0.3
  • 8. Sample code • Steps 1) Copy sample code and enable the essential function in your project • Set_HeadingAngleEnable • Set_MagAccuracyEnable • Set_SingleCalibration / Set_DynamicCalibration 2) Input data need mag and acc data, if you don’t have acc data, please input [0,0,9.8] 3) Check the input data axis direction to fit NEU system
  • 10. Sample code • Variable and compass API initialization (A and B part.)
  • 11. Sample code • Variable and compass API initialization (A and B part.)
  • 12. Sample code • Part B : isentek compass initialization stage • ist8310_Init(); // init driver • Set_HeadingAngleEnable(IST_TRUE);// if return Heading angle, it need acc and mag sensor • Set_MagAccuracyEnable(IST_TRUE);// if enable eCompass accuracy report - return 0:unreliable 3:High 2:medum 1: low • Set_SingleCalibration(IST_TRUE);// if enable single calibration right now • Set_DynamicCalibration(IST_TRUE) ;// if enable continuous calibration • Set_MagBias(Mag_IST8310_Bias); // if you have last calibrated value and don't calibrate again, you can set by this "Set_MagBias" function // note : this setting dependent on your application, please check if you applciation is suitable
  • 13. Sample code • Run process in while loop (C1-C6 part.)
  • 14. Sample code • Run process in while loop (C1-C6 part.)
  • 15. Sample code • Run process in while loop (C1 & C2 part.) // C1. Get mag and acc data from driver and change the sensor value from LSB to uT ist8310_GetXYZ(MagXYZ); for (int i = 0; i < 3; ++i) { Mag_RawData[i] = (float)MagXYZ[i] * Mag_LSBtoUT; } // C2. Dependent on PCB layout, change the mag and acc direction to NEU (x = east, y = west, z = up) Mag_RawData[0] = Mag_RawData[0]; Mag_RawData[1] = -Mag_RawData[1]; Mag_RawData[2] = Mag_RawData[2]; AccData[0] = AccData[1]; AccData[1] = AccData[0]; AccData[2] = AccData[2]; PCB Sensor direction
  • 16. Sample code • Run process in while loop (C3-C4 part.) // C3. Run Compass Process to get Calibrated Data // Here, we use constant acc data input [0,0,9.8], also, acc data [0,0,1] is ok. Process_RunCompass(Mag_RawData, AccData, Mag_CalibratedData); // C4. Check Calibration Status // Mag_CalibrationStatus : In calibration = 1, no = 0 // Get_MagBias : BiasX, BiasY, BiasZ, Radius // Mag_GetIST8310_Bias element will have valid value after calibration, // you can check the bias value to know process finish calibration. Mag_CalibrationStatus = Get_CalibrationStatus(); Get_MagBias(Mag_GetIST8310_Bias);
  • 17. Sample code • Run process in while loop (C5-C6 part.) // C5. Get Heading Angle // Get_HeadingAngle return int type angle. 0 - 360 degree // Get_HeadingAngle100 return int type angle . 0 - 36000 degree // Therefore, we need to change angle type Mag_HeadingAngle = (float)Get_HeadingAngle(); Mag_HeadingAngle_Int100 = 0.01f * ((float)Get_HeadingAngle100()); // C6. Get Mag Accuracy Status // 0:unreliable 3:High 2:medum 1: low Mag_Accurancy = Get_MagAccuracyStatus();
  • 18. API Manual (chm) • File list – inc – IST_LIB.h
  • 19. API Manual (chm) • Function list
  • 20. API Manual (chm) • Function detail
  • 21. FAQ • IST_A001 – What’s the LSB to uT? • IST_A002 – Why do we change the axis of acc and mag sensor to NEU system? • IST_A003 – What’s the difference and priority between Set_SingleCalibration and Set_DynamicCalibration API? • IST_A004 – How to calibrate eCompass correctly? • IST_A005 – What’s the definition for 0, 1, 2, 3 in accuracy report ? • IST_A006 – What time do I use “Set_MagBias” function?