3D Magnetometer mouse in processing

FFB4SV5G0SD7J7G_MEDIUM

[etgalim] works in Solidworks extensively and wanted a more intuitive way of rotating objects onscreen. To do this, he created a mouse that responds to rotation. He put a 3D compass module inside an old mouse and wired it up to an Arduino. The Arduino then relays the I2C sensor data to the computer. So far, he has a Processing script that uses the mouse to rotate a cube, but eventually he wants to write a Solidworks plugin. It’s a bit shaky, and we think it would be a bit smoother (and cheaper) if he used gyros like the jedipad. Video after the jump.

Comments

  1. Jim says:

    It looks like it would be easier to use if the cube kept rotating while the mouse was tilted.

  2. Andy1988 says:

    >It’s a bit shaky, and we think it would be a bit
    >smoother (and cheaper) if he used gyros like the
    >jedipad. Video after the jump.

    How about an RC-Filter (in software possible, too) or some other data filters?
    Those are normally used to remove the jitter of several sensors.

  3. reboots says:

    Can we assume the first of the redundant Sparkfun product links was meant to be the guy’s page? Google translated version:

    http://translate.google.com/translate?js=y&prev=_t&hl=en&ie=UTF-8&u=http%3A%2F%2Fcm.bezalel.ac.il%2Fcourses%2Fmat09%2F%3Fp%3D424&sl=iw&tl=en&history_state0=

    Arduino Duemilanove: $30
    Sparkfun compass module: $150 (wow!)
    Replicating the functionality of the $53 SpaceNavigator PE, supported by SolidWorks:

    http://www.newegg.com/Product/Product.aspx?Item=N82E16826154009

    Let’s be charitable and call it priceless.

    At least it’s a hack. I’m curious how the compass is affected by localized variation in the Earth’s magnetic field and/or nearby electromagnetic disturbance.

  4. cowboywasteland says:

    If you’re really looking for an intuitive way to rotate/pan/zoom CAD models, not an electronics project, there are any number of devices – we call them ‘space-balls’ – available, such as this one, from Newegg, for $50 http://www.newegg.com/Product/Product.aspx?Item=N82E16826154009.

    I’ll never go back to CAD without one. The purchase price pays for itself with increased productivity inside of a week, easy.

  5. sneakypoo says:

    I guess this is as good a place to ask as any. I gave SW a try a while ago as a step up from SketchUp (don’t laugh) however there was one thing that just bugged me to the point of quitting. In SketchUp when you “orbit” a model the model will stay upright so to speak. In SW when I “orbit” a model around it will spin around itself and I spent more time trying to get things into position than I did actually learning the program. No matter how many keys I held down or how many menus I went through I couldn’t make it behave like SketchUp. Was it just me being retarded or is there no way to make it behave similarly to SU?

  6. jproach says:

    That spacepilot and a mouse seems like a great combo. Much easier than lifting the mouse, rotating, placing mouse back down, etc.

    Still a cool hack though.

  7. napalm says:

    This looks almost identical to a post a few days ago.

  8. uldics says:

    Compass? Gyros? Nice work, but thats what I would call overkill. Why not just take two optical sensors inline. So if the sensors are lined up on Y axis, then mouse is rotated and not moved A sensors X movement would be direct opposite of B sensors movement. If their signal/value sum is positive, mouse is moved to one side, negative, other side. If their values are identical, no rotation is present, only movement to one side.

  9. mifau says:

    I’t a poor impementation.
    I made a headtracker with 3d magnetometer (which was much cheaper than that in sparfun) , and it’s work like a charm: http://www.youtube.com/watch?v=aXjfY05ZicE

  10. therian says:

    Sparkfun compass module: $150 Why it so expensive ? I remember blousing Mourse couple moth ago, compass chips was something like 30$

  11. grovenstien says:

    Yep i have to agree its a good hack but very expensive, also this sort of object navigation is really limited, compaired to the Space Navigator.

    Also it could be easily achieved with an Xbox controller, Iphone, PS3 controller, Wii remote with much better results.

    Cool though craming all that additional tech inside a standard mouse

  12. ryantheleach says:

    @sneakypoo

    im not sure what you mean, but i spent 6 months on solidworks at uni and hated it, but if you make assemblys and use “mates” you can normally get things to align nicely.

  13. Shy Shalom says:

    looks painful.

  14. markii says:

    very expensive…

  15. crnobs says:

    @uldics: Exactly. It is probably doable even without hardware amendments to the mouse on your desk. Optical mice have low-res monochrome cameras inside (there was a hack some time ago to use optical mouse as crude handy scanner) and calculate the movement per x and y axes between two consecutive frames. In other words, they could as well calculate angle of rotation between the two frames, if they had it implemented and if their MCU processing power suffices. That would be a neat hack…

  16. EdZ says:

    My guess is he wanted something with an ABSOLUTE 1:1 mapping, rather than the relative mapping you’d get with a SpaceNavigator or similar. Looks like he’s using the compass along with accelerometer data in order to get an absolute orientation (with just the accelerometer, like the many wiimote projects, you have no way of accurately measuring rotation in the horizontal plane, so things get out of alignment rather quickly).

  17. sneakypoo says:

    @ryantheleach: My explanation was more than a little fussy so I’m not surprised. The operation I was talking about is when you hold down the middle mousebutton to rotate the view of the object. In sketchup the y-axis is kept perfectly straight while orbiting the object, think coffee cup on the rotating plate in a microwave. You can hold down the button and spin the mouse round and round and you’ll still be right side up.
    Now, with SW if you do the same there it is more like watching space-debris spinning out of control.

  18. ryantheleach says:

    @sneakypoo

    Ah I see what you mean, probably because it gives you too much control by mapping the y axis of the mouse to a pitch change.

    You should mail the developers, I’m sure they would at least take it into consideration to make it an option. Alternatively its been a while since I’ve used it but there might be a right click option to only rotate in 1 plane but that would get tedious having to right click all the time and use the context menu.

  19. swgeek says:

    In solidworks, to rotate about a plane (or cylinder or really anything that only varies in two dimensions, like the outline of a hole or an arc…) do the following, assuming you have a clickable scroll wheel (which you do, if you’re doing the normal pan/rotate thing)
    1) find the plane you wish to rotate about
    2) click on the plane withe the click button in the wheel and let go without moving the mouse. The plane will turn purple
    3) click again on the plane and hold. now drag. Your view will spin about the plane.

    Normally, you’d just do step 3. Steps 1 and 2 are what lock you into a plane.

    If you’re looking to do engineering for a living, knowing SW or PRO/E or inventor(ick) is pretty much a requirement. don’t bother with things like sketch-up, you’ll only waste your time.

  20. will says:

    @swgeek

    I second that motion. I’ve used sketchup. It’s nicest feature is that it’s free, intuitive and makes decently pretty pictures of models. It’s not useful for much more. I’ve spent about equal time (multiple thousands of hours) on SW, Autocad, and ProE…plus less on a few others.

  21. sneakypoo says:

    @swgeek: Sweeet, thanks man I’ll have to give that a try. I’m not using these programs for anything but my own amusement. I find SketchUp absolutely brilliant for quickly making mockups of things I want to build, to give a quick idea if it’s going to work at all (is that circuit going to fit in that box? things of that nature).

    Most recently I designed a new desk in it and it turned out pretty nice in real life as well. I’ve also designed a CNC machine in it but I have yet to build that one. It’s for things like the latter a more capable program such as SW would come in handy but the issue I mentioned was driving me crazy.
    Oh and one last thing @will, give Kerkythea a try if you want to produce stunning looking renders of your SketchUp work.

  22. ETgalim says:

    All you need to know (aside from the meaning of life), and in English :)

    http://www.instructables.com/id/3D-AIR-mouse-Arduino-Processing/

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 93,778 other followers