When growing old with age, mobility and safety becomes a constant worry. Declining agility and unsteadiness can result in dangerous falls which would be harmful for the older generation
This project introduces the concepts of advanced robotics to prevent falls and help people get back up in case of a fall.
This project will be demonstrated using a humanoid robot. However, the final product will be in from of a back pack sort of an attachment made from carbon fiber with retractable robot arms.
HOW IT WAS DONEThis project makes use of a Gyroscope sensor to detect if the robot or eventually the person who’s wearing the robot arm attachment is going to fall.
In here the MPU6050 Gyroscope was used.
For this project, two micro-controllers were used which were namely Arduino Nano and STM32. Arduino Nano was used to interface the MPU6050 and take the readings and STM32 was used to control the servo motors.
Configuring the GyroscopeThe MPU6050 IMU has both 3-Axis accelerometer and 3-Axis gyroscope integrated on a single chip.
The gyroscope measures rotational velocity or rate of change of the angular position over time, along the X, Y and Z axis. It uses MEMS technology and the Coriolis Effect for measuring. The outputs of the gyroscope are in degrees per second, so in order to get the angular position we just need to integrate the angular velocity.
Gyroscope was interfaced with the Arduino Nano as follows,
Coding was done to initialize and calibrate the Gyroscope
#include <Wire.h>
#include <I2Cdev.h>
#include <MPU6050.h>
void gyroInit() {
//MPU6050 configure
Wire.begin();
accelgyro.initialize();
accelgyro.setFullScaleGyroRange(3); //Set angular velocity range
accelgyro.setFullScaleAccelRange(1); //Set acceleration range
delay(200);
accelgyro.getMotion6(&ax, &ay, &az, &gx, &gy, &gz); //Get current axis data to calibrate
ax_offset = ax; //X-axis acceleration calibration data
ay_offset = ay; //Y-axis acceleration calibration data
az_offset = az - 8192; //Z-axis acceleration calibration data
gx_offset = gx; //X-axis angular velocity calibration data
gy_offset = gy; //Y-axis angular velocity calibration data
gz_offset = gz; //Z-axis angular velocity calibration data
}
Here the I2C communication was used together with the MPU6050 Arduino Library. Initially the gyroscope was calibrated at the standing position since the values received are relative and it needs to benchmark readings for steady position.
Anticipating InclinationsOnce the calibration was done, the gyroscope was continuously operated to detect variations in rotational velocity in order to detect if a fall would happen.
void update_mpu6050(){
static uint32_t timer = 0;
static uint8_t index = 0;
if (timer > millis())
return;
accelgyro.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);
//timer = millis() + 10;
ax0 = ((float)(ax)) * 0.3 + ax0 * 0.7; //Filter the read data
ay0 = ((float)(ay)) * 0.3 + ay0 * 0.7;
az0 = ((float)(az)) * 0.3 + az0 * 0.7;
ax1 = (ax0 - ax_offset) / 8192.0; // Correct and convert to multiples of gravity acceleration
ay1 = (ay0 - ay_offset) / 8192.0;
az1 = (az0 - az_offset) / 8192.0;
gx0 = ((float)(gx)) * 0.3 + gx0 * 0.7; //Filter the read angle
gy0 = ((float)(gy)) * 0.3 + gy0 * 0.7;
gz0 = ((float)(gz)) * 0.3 + gz0 * 0.7;
gx1 = (gx0 - gx_offset); //Corrected angular velocity
gy1 = (gy0 - gy_offset);
gz1 = (gz0 - gz_offset);
/////Average processing
aax2[index] = ax1;//replace value
aay2[index] = ay1;
aaz2[index] = az1;
ggx2[index] = gx1;
ggy2[index] = gy1;
ggz2[index] = gz1;
index++;//Multiple sets of indices move down to easily replace the oldest value,
if (index > 4)
index = 0;
for (int i = 0; i < 5; i++) { //Sum
ax1 += aax2[i];
ay1 += aay2[i];
az1 += aaz2[i];
gx1 += ggx2[i];
gy1 += ggy2[i];
gz1 += ggz2[i];
}
ax1 = ax1 / 5.0; //Average
ay1 = ay1 / 5.0;
az1 = az1 / 5.0;
gx1 = gx1 / 5.0;
gx1 = gy1 / 5.0;
gx1 = gz1 / 5.0;
// Serial.print("aax2[]:"); Serial.println(aax2[i]);
// delay(500);
//Complementary calculation of x-axis inclination
radianX = atan2(ay1, az1);
radianX = radianX * 180.0 / 3.1415926;
float radian_temp = (float)(gx1) / 16.4 * 0.02;
radianX_last = 0.8 * (radianX_last + radian_temp) + (-radianX) * 0.2;
//Complementary calculation of Y-axis inclination
radianY = atan2(ax1, az1);
radianY = radianY * 180.0 / 3.1415926;
radian_temp = (float)(gy1) / 16.4 * 0.01;
radianY_last = 0.8 * (radianY_last + radian_temp) + (-radianY) * 0.2;
}
This will take readings in a specified sample interval using Arduino internal timers. Initially the readings taken will be filtered and corrections would be done based on the calibrations. Then average will be taken in order to eliminate noise and anomalous readings. Then the final readings will be used for complementary inclination calculations to detect if there will be a fall.
Detection and Communication of fallsIn this use case the robot motor controlling was done using a STM32 Microcontroller. Hence, when a fall was detected through the Arduino, it would communicate with STM32 MCU to move the motors to prevent the fall and help it stand up again.
void tumble(void){
switch (stept){
case 0:
if (radianX_last > 15){
//Send commands to STM32 to prevent falling forward
stept = 1;
Time = millis() + 2000;
}else if (radianX_last < -15){
// Send commands to STM32 to prevent falling backward
stept = 1;
Time = millis() + 2000;
}
break;
case 1:
if (radianX_last > 55 || radianX_last < -55){ //Fallen Down
// Send commands to STM32 to Bring arms to help stand up
stept = 2;
}else if (radianX_last < 15 && radianX_last > -15) {
stept = 3;
}
break;
case 2:
if (radianX_last > 55) { //In case of forward fall
//Send commands for STM32 to help robot stand up
}else if (radianX_last < -55){ //In case of backward fall
//Send commands for STM32 to help robot stand up
}else if (radianX_last < 15 && radianX_last > -15) {
stept = 0;
}
break;
case 3:
//Retract arms once the robot is back in standing position
stept = 0;
break;
default:
stept = 0;
break;
}
}
}
Using this logic falls to both forward and backward directions can be identified and prevented.
DEMONSTRATIONIMPLEMENTATION
Even though the project here is demonstrated using a humanoid robot kit, implementation of this project will be done in form of a robotic arm backpack.
The most common mechanism of injury in the elderly population is falling. About 30%-50% of falls in the elderly result in minor injuries, including bruises, abrasions, and lacerations, but an estimated 10% of all falls in seniors cause major injuries, including intracranial injuries (ICIs) and fractures.
In the verge of Industrial Revolution 4.0, this project will introduce advance robotics to increase the quality of living by preventing falls for older generation as well as little kids and eliminate the injuries due to falls.
Comments