Two IMU to measure angular change under vibration

Hello everybody,

I am working on a project which are based on two imu sensor to measure angle of a moving part. One imu fixed on machine body and second imu fixed on part which makes rotational movement to open and close unloading gate. also machine moves with wheel. We measure the fixed imu angular change and also second imu has same angular change. When we want to open the unloading gate with a desired angle, we make movement according to difference of angular change. Our problem is gate has vibration while machine working. the output of fixed one was stationary but gate output starts to change from 0 to 4-5 degree in a few seconds.

How can we make measurements? any suggestion or idea will be helpful.
thanks

can you give details of the imu sensors? e.g. power requirements, interface, etc
any idea how you wish to report results? e.g. over serial to a laptop, WiFi to a PC, Bluetooth to a smartphone?

We are using a ready to use sensor from china which is HWT605. It has 3 axis acc and 3 axis gyro and give output of acc,gyro and angles for 3 axis( roll pitch yaw). We are using arduino uno to control gate opening. We get values of yaw angle from sensor and compare it according to difference, try to control gate opening.
Thanks

if you have a program reading yaw angles can you post it (using code tags </>)?
also a printout of any output you get on the serial monitor
post a schematic of the circuit?

the HWT605 output aoppears to be TTL serial, e.g.
i. Data output : Time, Acceleration, Angular velocity, Angle,Magnetic field, Quaternion
j. Serial port (TTL protocol, Baud rate support 2400,4800,9600,19200,38400,57600,115200,230400,460800,921600)

using an UNO to read serial data using SoftwareSerial from two devices concurrently will probably not work - I would recommend switching to a Arduino with multiple hardware serial ports such as a Mega

HWT605 is a 6 axis sensor, It doen't have any magnetometer on it. It only has gyro and acc. We used the mega on test as you said it has 3 serial port one is connected to pc and other two is for connecting the sensors.







void setup() {
  Serial.begin(115200);
  Serial1.begin(115200);
  Serial2.begin(115200);
}

void loop() {



getser11();
getser22();


 
  Serial.print(sensor1);
  Serial.print("*****");
  Serial.print(sensor2);
  Serial.print("*****");
  SensorResult= sensor2-Sensor1;
  Serial.print("*****");
  Serial.println(SensorResult);
  if (Serial.available())
  {
    c = Serial.read();
    if (c == 'a')
    {
      ClearS1();
      ClearS2();
    }
  }
  delay(10);
}


byte checksumcalc( byte c_data[])
{
  byte sum = 0;
  for (int i = 0; i < 31; i++)
  {
    sum = sum + c_data[i];

  }
  return sum;
}

void ClearS1()
{
  Serial1.write(Clearing[0]);
  Serial1.write(Clearing[1]);
  Serial1.write(Clearing[2]);
  Serial1.write(Clearing[3]);
  Serial1.write(Clearing[4]);

}
void ClearS2()
{
  Serial2.write(Clearing[0]);
  Serial2.write(Clearing[1]);
  Serial2.write(Clearing[2]);
  Serial2.write(Clearing[3]);
  Serial2.write(Clearing[4]);
}


void getser11()
{
  if (Serial1.available() > 0)
  {
    inChar1 = Serial1.read();

    inChar11 = Serial1.read();
    if (inChar1 == 0x68 && inChar11 == 0x1F) // start of frame
    {
      msg1[0] = inChar11;

      for (int inCharno = 1; inCharno < 31; inCharno++)
      {
        inChar1 = Serial1.read();
        //Serial.print(inChar1,HEX);
        msg1[inCharno] = inChar1;
      }

      //Serial.println();


    }

  }
  Sumcrc1 = checksumcalc(msg1);
  if (msg1[30] == Sumcrc1)
  {
    sensor1 = convertingvalue(msg1[9], msg1[10], msg1[11]);
  }
  else
  {

    Serial.println("sumcrc error1");

  }
}


void getser22()
{
  if (Serial2.available() > 0)
  {
    inChar2 = Serial2.read();

    inChar22 = Serial2.read();
    if (inChar2 == 0x68 && inChar22 == 0x1F) // start of frame
    {
      msg2[0] = inChar22;

      for (int inCharno1 = 1; inCharno1 < 31; inCharno1++)
      {
        inChar2 = Serial2.read();
        //Serial.print(inChar2,HEX);
        msg2[inCharno1] = inChar2;
      }

      //Serial.println();


    }

  }
  Sumcrc2 = checksumcalc(msg2);
  if (msg2[30] == Sumcrc2)
  {
    sensor2 = convertingvalue(msg2[9], msg2[10], msg2[11]);
  }
  else
  {

    Serial.println("sumcrc error2");

  }
}

The output is

0.00 ***** 0.00 ***** 0.00
0.00 ***** 0.00 ***** 0.00
0.00 ***** 0.00 ***** 0.00
0.00 ***** 0.00 ***** 0.00

after moving the gate when machine is not moved after zero the sensor

0.00 ***** 10.00 ***** 10.00
0.00 ***** 10.00 ***** 10.00
0.00 ***** 10.00 ***** 10.00
0.00 ***** 10.00 ***** 10.00
0.00 ***** 10.00 ***** 10.00
0.00 ***** 10.00 ***** 10.00

after moving machine with out chaning the gate

22.38 ***** 33.60 ***** 11.22
22.38 ***** 33.60 ***** 11.22
22.38 ***** 33.60 ***** 11.22
22.38 ***** 33.60 ***** 11.22
22.38 ***** 33.60 ***** 11.22
22.38 ***** 33.60 ***** 11.22

Also with out moving machine, it has some motors on it which creates vibration on gate opening
after zero sensor, if we start the motors output gets some values

0.00 ***** 0.67 ***** 0.00
0.00 ***** 1.35 ***** 0.00
0.00 ***** 1.98 ***** 0.00
0.00 ***** 2.35 ***** 0.00

it goes from zero to 4-5 degree in a few moments.

Thanks

good to hear you are getting results!
is it giving you the information you require?

interesting to see the HWT605 gives the Quaternion - in the past I had to calculate it

Yes, It gives the output as I required but with noise or drift. I check the internet and made some research, it says that I need to make kalman filtering.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.