What IMU to use for a 3D-mouse project?

Question: Is there a 6-dof IMU that is recommended to use now (in 2022) for it's precision and some decent libraries? I'm looking for an accelerometer + gyro, don't really care about much more for my needs for now.

Reason: I have decided to try a '3D mouse' project, and wanted to try the IMU approach.

Story: Completely new to Arduino, after doing some research, I have opted to get the MPU-6050 sensor for my purposes, as there seems to be a lot of code for it as well as tutorials. However, after getting it and tinkering for over 4 hours with why it's not working with the default examples, I have found out, that i have most likely a "fake" or a "factory reject". Given the WHO_AM_I returns an address 0x98 instead of 0x68. This has led me to various forums where people claim that the MPU 6050 is a bad sensor nowadays, no longer made, and should not be used anymore, hence market saturated with fakes now. This leads me here, to ask - what would be a good alternative to use nowadays, for such a project? I have the SparkFun Arduino Micro Pro as the main board, but can change given a good reason/suggestion.

The only suggestion i have seen here on these forums, is a LSM6DS33, which i cannot find anywhere where i am (Japan), and moreover, that seems to be the chip designation rather than the board, so aliexpress results give me the chip alone, and not the arduino-plug-and-play unit..

Would be grateful for any advice here, as I have no idea where to find this kind of information, and there doesn't seem to be much about that here...

Thank you!

The current generation of 6DOF and 9DOF sensors from various manufacturers are all pretty similar in their performance, and will be much better than the obsolete MPU-6050.

Anything available from Pololu, Sparkfun or Adafruit should be fine, however, these days most popular chips are hard to find. Pololu has the LSM6DS33 in stock.

I see, thank you very much. I didn't realize they ship worldwide, i might have to bite the bullet then.

Would it be correct to assume that using the official LSM6 library from Polulu would be enough?

I am looking to get relative position and rotation, given my project. I wonder how extensive that library is, if I'm gonna have to do a lot of the heavy lifting? (since i have little to no experience in that area, hah)

Enough for what? It will certainly give you the instantaneous measured acceleration and rotation rate values.

Pololu documents library code quite well, so look through the published docs.

I am looking to get relative position and rotation, given my project

Those are advanced topics. 3D orientation is relatively easy, using an AHRS algorithm. I prefer the Mahony filter. "Relative position" is extremely difficult, if not impossible, using just a consumer grade accelerometer/gyro.

as for library, got it, thank you!

as for the relative position... i see.. your comment made me search for position tracking in 3d space, and it indeed seems like a bit of a problematic situation...
I'm not sure what the best way to do this would be, except maybe to modify my hardware design in a way that would attach arms to the '3d mouse', to make the mouse movable in space, and then grab the rotation off of those, to determine, given some trigonometry, the position...

I will look into the position tracking concept, as it feels strange to me that a simple solution doesn't seem to exist, haha...

If no hardware arms, then i wonder if a couple of IR cameras and something that they can sense, can be used. Similarly to how motion capture with volume works..
Then again, there are motion capture suits that don't need a volume, and are strictly reliant on IMUs that i have to assume are sensing position, like the Xsens MoCap suit, so i would be interested to know how those work, or what IMUs are those using...

as a point of curiosity...
the reason why getting relative position would be difficult is because of the complexity of the math, or the precision of the sensor?
given an orientation of the sensor -> negate the default G -> compute distance from velocity, which we compute from acceleration.

hence the math doesn't 'seem' to be THAT hard, so i assume the precision is what's the problematic area here, im i correct?

Exactly. Described here in detail: Library | CH Robotics

Scroll down to "Using Accelerometers to Estimate Velocity and Position"

1 Like

I see. I had a bit of a read and yeah, this seems like it's not really a potential vector for me anymore then.

From prior research on the MPU6050, it would seem that at least rotation could be obtained drift-less, given a good sensor and an interrupt implementation (no clue how this works, too much material to sift through, haha).
But I'm wondering if for the hardware, to use something like this, would be a better idea, then use hall effect sensors on the supporting rods and insane level of math that i wouldn't even know how to implement, to get an accurate rotation/translation in 3d space..

I only need to be able to rotate maybe 20-30deg in either direction and in terms of position only around 3-5cm cube of volume...

Only for a short while, using a consumer grade gyro. The gyro offsets are very temperature sensitive. Drift can be countered over longer times by an accelerometer and magnetometer, but those (especially the magnetometer) are also temperature sensitive.

If you describe what you really want to do, you might get useful advice. I don't see how a "3D mouse" is related to the Stewart platform shown above.

Aha, i see.

What I'm trying to do? Yeah, that's a fair point, haha.

My whole project originated as a way to move inside a 3D space on the PC, think a game engine, and moving in there, as the camera. Hence needing a way to track translation as well as position.
The idea being to have a center position for my controller, hence somehow suspended in space (if even a little bit), and offsetting it in either direction would trigger a translation input on a curve, that wouldn't stop until the controller is centered again. Think something like a joystick, but a 6dof joystick.

That is basically what I am trying to do here. Let me know if i explained something poorly...

EDIT: I'm thinking of moving in the space intuitively, with the palm of the hand being parallel to the table (unlike an actual joystick where it's perpendicular to the table). Also, i'd like the hand to move in space to achieve the control over the 3D camera, so I am not interested in the likes of 3D connexion, that exist on the market.

Orientation is quite easy and stable, the angles are computed from the linear accelerations.

From old light pens on CRT it's known that moving an object in 3D is exhausting. Find out yourself how long you can hold a pencil still in free air, without your arm resting somewhere.

Such things are available already. The major difference to a 6dof mouse is the error correction of the coords by the user, and no physical force to the hand and arm when standing still.

In the 80s I already had a mechanical 4dof joystick with contacts for moves in X/Y/Z direction and turns around the Z axis. More would require tricky mechanics for the contacts. Nowadays an IMU could be added to determine the angles for a full 6dof joystick.

Agreed, hence it is a design i am working on, to figure out how to make it as easy for the user as possible. The user would only use this once in a while as well, and not hours in one sitting.

Are they? the only 6dof joystick i found is a vertical one from Sublight, who seem to have a really tough time delivering on their Kickstarter goal.
If you know of any others, that i could reference the design of, or straight up consider using, that would be very appreciated!

Would you be able mention more about how it was set up? Im intrigued here.
Or, how would one go about making one nowadays...

Originally, I was thinking something like the Stewart platform would be a nice bit of mechanical setup to hold the user controller in place, and then use an IMU to get both the rotation and the position. That was the original plan anyway.. but seeing as position might be difficult with IMUs, I wonder what else to use or how to modify my original idea.

EDIT: typos

I found many searching for "6 dof joystick". The Logitech page looks quite informative.

Like a lollipop stuck into the joystick shaft/base. You grab the lolly and push and twist it as you like. Pushes (linear) are detected in the base, turns (rotations) are detected within the lolly.

That one, as well as other commercially available joysticks, are not actually 6dof i think, albeit for whatever reason they are allowed to write it on their website as PR... The joystick itself is a typical 3dof, and has a thruster and a bunch of hats on there to i guess justify the '6dof' mark?
The idea behind a true 6DoF joystick, is to have all control over the 6 DoF in your palm, rather than having to micromanage with your fingers and your other hand.
The word here is intuitive, which using your hand for three rotational axes, and then using a thumb of your hand for another 2 axes this time translation, and left hand for surge, is most definitely not, albeit that being the current plateau of the industry.
Hence my want to try to build a true 6DoF controller.

Interesting, I was considering that design too, I might take it further and give it a proper 3D sketch to see it there's something there for my need.

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