pbl
pbl
Submitted By
2023-20 24
INTRODUCTION:-
An inertial navigation system (INS; also inertial guidance system, inertial instrument) is
a navigation device that uses motion sensors (accelerometers), rotation sensors (gyroscopes) and
a computer to continuously calculate by dead reckoning the position, the orientation, and
the velocity (direction and speed of movement) of a moving object without the need for external
references.[1] Often the inertial sensors are supplemented by a barometric altimeter and sometimes
by magnetic sensors (magnetometers) and/or speed measuring devices. INSs are used on mobile
robots[2][3] and on vehicles such as ships, aircraft, submarines, guided missiles,
and spacecraft.[4] Older INS systems generally used an inertial platform as their mounting point to
the vehicle and the terms are sometimes considered synonymous.
Integrals in the time domain implicitly demand a stable and accurate clock for the quantification
of elapsed time.
We tried to replicate same technology but completely electronics and on the microcontroller level
computing power with compect designe for beginner understanding.
LITERATURE SURVEY :-
➢ Microcontroller:-
In modern terminology, a microcontroller is similar to, but less sophisticated than, a system
on a chip (SoC). A SoC may include a microcontroller as one of its components, but usually
integrates it with advanced peripherals like a graphics processing unit (GPU), a Wi-Fi module, or
one or more coprocessors.
➢ ALDX345:-
The ADXL345 is a small, thin, ultralow power, 3-axis accelerometer with high resolution
(13-bit) measurement at up to ±16 g. Digital output data is formatted as 16-bit twos complement
and is accessible through either a SPI (3- or 4-wire) or I2C digital interface. The ADXL345 is well
suited for mobile device applications. It measures the static acceleration of gravity in tilt-sensing
applications, as well as dynamic acceleration resulting from motion or shock. Its high resolution
(3.9 mg/LSB) enables measurement of inclination changes less than 1.0°. Several special sensing
functions are provided. Activity and inactivity sensing detect the presence or lack of motion by
comparing the acceleration on any axis with user-set thresholds. Tap sensing detects single and
double taps in any direction. Free-fall sensing detects if the device is falling. These functions can be
mapped individually to either of two interrupt output pins. An integrated memory management
system with a 32-level first in, first out (FIFO) buffer can be used to store data to minimize host
processor activity and lower overall system power consumption.
FEATURES:
► Ultralow power: as low as 23 µA in measurement mode and 0.1 µA in standby mode at VS = 2.5
V (typical)
► Power consumption scales automatically with bandwidth
► User-selectable resolution
► Fixed 10-bit resolution
► Full resolution, where resolution increases with g range, up to 13-bit resolution at ±16 g
(maintaining 4 mg/LSB scale factor in all g ranges)
► Embedded memory management system with FIFO technology minimizes host processor
load
► Single tap/double tap detection
► Activity/inactivity monitoring
► Free-fall detection
► Supply voltage range: 2.0 V to 3.6 V
► I/O voltage range: 1.7 V to VS
► SPI (3- and 4-wire) and I2C digital interfaces
► Flexible interrupt modes mappable to either interrupt pin
► Measurement ranges selectable via serial command
► Bandwidth selectable via serial command
► Wide temperature range (−40°C to +85°C)
► 10,000 g shock survival
► Pb free/RoHS compliant
► Small and thin
➢ I2C COMMUNICATION:-
I2C combines the best features of SPI and UARTs. With I2C, you can connect multiple slaves to
a single master (like SPI) and you can have multiple masters controlling single, or multiple
slaves. This is really useful when you want to have more than one microcontroller logging data
to a single memory card or displaying text to a single LCD.
Like UART communication, I2C only uses two wires to transmit data between devices:
I2C is a serial communication protocol, so data is transferred bit by bit along a single wire (the
SDA line).
Like SPI, I2C is synchronous, so the output of bits is synchronized to the sampling of bits by a
clock signal shared between the master and the slave. The clock signal is always controlled by
the master.
METHODOLOGY:-
1.Collecting data from IMU:-
we can read the ADXL345 accelerometer data using the Arduino. This sensor uses the I2C
protocol for communication with the Arduino so we need only two wires for connecting it,
plus the two wires for powering it.
3.Callibrations:-
Nevertheless, once we read the data, we can simply print it on the serial monitor to check
whether the values are as expected. If not then we add or subtract the offset value back from
the data.
void setup() {
Serial.begin(9600);
Wire.begin();
Wire.beginTransmission(AXDL345);
Wire.write(0x2D);
Wire.write(8);
Wire.endTransmission();
delay(100);}
void loop() {
Wire.beginTransmission(AXDL345);
Wire.write(0x32);
Wire.endTransmission(false);
Wire.requestFrom(AXDL345, 6, true);
X_out =(Wire.read()|Wire.read() <<8);
X_out =X_out/256;
Y_out =(Wire.read()|Wire.read() <<8);
Y_out =Y_out/256;
Z_out =(Wire.read()|Wire.read() <<8);
Z_out =Z_out/256;
Serial.print("Xaxis=");
Serial.print(X_out);
Serial.print(" Yaxis=");
Serial.print(Y_out);
Serial.print(" Zaxis=");
Serial.println(Z_out);
delay(500);}
➢ Callibrations:-
// Calculate Roll and Pitch (rotation around X-axis, rotation around Y-axis)
roll = atan(Y_out / sqrt(pow(X_out, 2) + pow(Z_out, 2))) * 180 / PI;
pitch = atan(-1 * X_out / sqrt(pow(Y_out, 2) + pow(Z_out, 2))) * 180 / PI;
void draw() {
translate(width/2, height/2, 0);
background(33);
textSize(22);
text("Roll: " + int(roll) + " Pitch: " + int(pitch), -100, 265); // Rotate the object
rotateX(radians(roll));
rotateZ(radians(-pitch)); // 3D 0bject
textSize(30);
fill(0, 76, 153);
box (386, 40, 200); // Draw box
textSize(25);
fill(255, 255, 255);
text("www.HowToMechatronics.com", -183, 10, 101);
//delay(10);
//println("ypr:\t" + angleX + "\t" + angleY);
// Print the values to check whether we are getting proper values }
// Read data from the Serial Port
void serialEvent (Serial myPort) {
// reads the data from the Serial Port up to the character '.' and puts it into the String variable
"data".
data = myPort.readStringUntil('\n’); // if you got any bytes other than the linefeed:
if (data != null) { data = trim(data); // split the string at "/"
String items[] = split(data, '/’);
if (items.length > 1) {
//--- Roll,Pitch in degrees
roll = float(items[0]);
pitch = float(items[1]); }
}}
If we run the sketch, the 3D object will appear and it will track the orientation of the
accelerometer sensor. We can notice here that the object is actually a bit shaky and that’s because
the accelerometer captures not just the gravitational force, but also small forces generated by the
movements of our hand. In order to get smoother result, we can use a simple Low-pass filter.
Here I implemented such a filter in the Arduino code, which it takes 94% of the previous state
and adds 6% of the current state or angle.
// Low-pass filter
rollF = 0.94 * rollF + 0.06 * roll;
pitchF = 0.94 * pitchF + 0.06 * pitch;
RESULT AND DISCUSSION
➢ Connectins
➢ 3d visual
EXPENDITURE INCURRED
CONCLUSION
We created and understud technology and completely electronics and on the microcontroller level
computing power with compect designe of internal guidance system, which was created for beginner
uses
REFERENCES
• https://r.search.yahoo.com/_ylt=Awr1Sa4GijJmGQQAF1K7HAx.;_ylu=Y29sbwNzZzMEcG
9zAzEEdnRpZAMEc2VjA3Ny/RV=2/RE=1715797767/RO=10/RU=https%3a%2f%2fwww.c
ircuitbasics.com%2fbasics-of-the-spi-communication-
protocol%2f/RK=2/RS=VzzBg.4YumbivVWu10r5tM1XS9s-
• https://www.youtube.com/watch?v=KMhbV1p3MWk&t=466s
• https://howtomechatronics.com/tutorials/arduino/how-to-track-orientation-with-arduino-
and-adxl345-accelerometer/#How_to_Read_ADXL345_Accelerometer_Data_with_Arduino
• https://www.analog.com/media/en/technical-documentation/data-sheets/ADXL345.pdf
• https://www.renesas.com/us/en/products/microcontrollers-microprocessors/ra-cortex-m-
mcus/ra4m1-32-bit-microcontrollers-48mhz-arm-cortex-m4-and-lcd-controller-and-cap-
touch-hmi#overview
• https://en.wikipedia.org/wiki/Microcontroller
• https://www.youtube.com/watch?v=M9lZ5Qy5S2s&t=1402s
• https://www.youtube.com/watch?v=4BoIE8YQwM8&t=570s