IMU Programming

Hi guys,

I am trying to use an IMU (specifically the MPU 6050) to stop a motor once a degree of motion has been set i.e if the IMU is rotated 10 degrees from it's origin, the motor will stop. I am also trying to incorporate the accelerometer into this calculation, so that if the IMU is rotated slowly the motor won't stop but if it is a quick motion it will.

How hard would this be to program? I have limited experience programming and that was a fair few years ago, I have looked for some other sketches using a IMU but have to admit I am at a loss.

RCarter:
I am trying to use an IMU (specifically the MPU 6050) to stop a motor once a degree of motion has been set i.e if the IMU is rotated 10 degrees from it's origin, the motor will stop.

What is the orientation of the motor? The MPU6050 could sense an angular position if it were attached to something like the wheel of a car. If the MPU6050 were attached to something like a phonograph record on a turntable then the angular position would be much more difficult to sense.

If you need to sense a rotation level with the ground, then you'd want to add a magnetometer so you could use the Earth's magnetic field as an additional input.

Is this the same project as the one described in your other thread?

DuaneDegn:
Is this the same project as the one described in your other thread?

Yes, i have been looking for example code but cant find anything that i could modify. I am hoping this project is not without my ability as it is a 3rd year major design project :o

The gyros in the MPU6050 are pretty damn sensitive to rotation speed. However they don't measure position at all. The accelerometer is useful for sensing the direction of gravity, so it's actually useable for the "slow" case.

Buy one and check it out. I think it will be easy to program.