Shop OBEX P1 Docs P2 Docs Learn Events
Mouse Sensor Module in Development -- Draft documentation posted (8 Mar 2010) - Page 2 — Parallax Forums

Mouse Sensor Module in Development -- Draft documentation posted (8 Mar 2010)

2»

Comments

  • Ray0665Ray0665 Posts: 231
    edited 2010-03-10 17:26
    I'm thinking Rain Gage,
    A little drop here a drop or two there and BAM we're all wet.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Never force anything - Always get a bigger hammer.
  • dwaltondwalton Posts: 11
    edited 2010-03-10 17:53
    This is a great idea for a new product! I have been wanting to use an optical mouse to track movement of a robot and I have wondering if there was some way I could increase the distance between the mouse sensor and the floor. I am hoping to have the sensor high enough that it will clear obstacles and the carpet as the robot's wheels sink into carpet a small amount. I tried holding an optical mouse a quarter of an inch from the floor and it would not detect movement, but I was thinking there might be a way to focus the lens for the camera the mouse sensor uses to allow me to hold the mouse off the floor. Do you think that is possible with this sensor?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-03-10 18:15
    The optics used with this sensor are the same as those used with an optical mouse so would have to be modified to accommodate longer focal distances. But the sensor chip itself, like all mouse sensor chips, is designed with a tiny aperture that virtually requires it to be in near contact with a very short focal length lens. Otherwise, severe vignetting can occur, reducing the efficacy of the motion detection. Of course, corrective optics could be applied to extend the focal length of the lens that's already there, and you'd have to illuminate the field of view just as brightly as the small spot is lit now. But including such a feature up front would involve optics that are not mass produced for the application, and the cost would skyrocket.

    -Phil
  • Roy ElthamRoy Eltham Posts: 2,996
    edited 2010-03-10 22:51
    Sorry if I missed it in the doc, but what is the maximum clockrate for reading out the registers via the serial interface?
    In other words, how many times per second can I read out the 3/4 registers of data?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Check out the Propeller Wiki·and contribute if you can.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-03-11 00:02
    Maximum serial clock rate is 2 MHz. (I guess I should put that in the doc.)

    -Phil
  • Chad GeorgeChad George Posts: 138
    edited 2010-03-16 13:40
    Nice work Phil.

    I put the same (or very similar) mouse sensor in my Propeller based mini sumo robot 3 years ago. There wasn't much interest in it then, but maybe I just didn't pursue and market the idea as well as you have.

    Here's what I found out w.r.t. using this sensor in robots.

    1. sensor has to be very very precisely positioned off the ground. In mass marketed mice applications this is easy because its molded into the design of the mouse body and the weight of the users hand keeps everything very nicely in a very predictable place.

    I found that even .010 - .020 in off the spec and it has difficulty picking up movement on plain (non-textured) surfaces (which I was doing mini sumo so needed it to work on black which is worse case)

    2. the sensor isn't absolute or really even all that linear. I really underestimated how much "correction" the human operator does without even realizing it in the normal use for this sensor. The relationship between motion and change in X/Y is very dependent on the surface, distance from surface, how fast you're moving and other factors.

    3. you're sensor might be different but I was able to pull image data directly from the mouse sensor's camera. Its such a ridiculously small area that unless you're try to read some kind of spy transcript in micro print ... I didn't find much that could be done with it. The average pixel data was very nice as a line following sensor though.

    4. I had problems with getting spurious X/Y delta values. At first I thought it might be noise issues, but after some investigation it seemed to be the chip would just go crazy if I didn't reset it every once in a while. Never really got to the cause of it, but it really limited any remaining usefulness towards odometery (whatever small amount was left after #2)

    Bottom Line:
    - requires very precise alignment with ground to be useful and a pretty smooth surface. Wood textured desks are best, glass is impossible, plain black can be difficult (but white isn't too bad)
    - for robot odometery the sensor wasn't very good in any kind of "absolute" position tracking applications.
    - for relative tracking, like "am I going straight" it was more useful
    - for sumo it was really most useful in detecting when you were being pushed, however, issue #1 quickly comes into play because a sumo bot hardly ever stays perfectly flat when being pushed around, and the sensor immediately becomes useless once you tilt a little


    Its definitely a different chip (avago I believe it was) because I needed a crystal/resonator, but if there's interest I could pull my source code for the sensor driver out and post it.

    And I'm sure you don't need the parts, but I still have enough supplies for about 20 sensors worth (lenses, chips, LEDs, light pipes, PCBs) Had to buy some of this is more bulk than I wanted... so if anyone's interested.

    -chad
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-03-16 16:31
    Chad,

    'Sounds like ou put some major effort into your project. Regarding your bullet points:

    1. I was able to get close with the Delrin base pieces, but I'm still making adjustments to the spacer thickness. The sensor works fine on textured surfaces, but white paper is a challenge.

    2. Correct. I've pointed that out in the doc.

    3. There's no image data available from the Unity Opto chip, as far as I know. (I still don't have a datasheet for it that describes the registers.)

    4. I haven't experienced any problems with the chip going bonkers like that. Once it's set up correctly, it runs without any problems.

    -Phil
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-05-19 03:45
    I received 1000 PCBs yesterday. I'm now at step 5, after a long hiatus due to S2 development duties. Here's a photo of the bases being cut in my laser cutter:

    attachment.php?attachmentid=70462

    -Phil
    855 x 642 - 157K
  • Ken GraceyKen Gracey Posts: 7,387
    edited 2010-05-31 23:28
    Hey there,

    This afternoon I had an opportunity to build Phil's Mouse Sensor Module. I've been looking forward to doing this for quite some time, counting the days for the past two weeks until my block of two hours arrived this afternoon.

    The assembly process went really well. The PCB is designed precisely around the components and everything fits together perfectly. What impressed me a whole bunch was the micro-mechanical assembly of the Delrin base sets, plastic snap rivets, and spacers to put this together. The end result is that this is a mouse you can use, without being stuffed in a plastic case. The package size and mounting holes make the sensor accessible, so customers will be able to use it for a variety of projects we didn't envision.

    Phil's documentation and supporting software is excellent. I didn't have any questions of significance along the way.

    I used it with a BS2 and SPI in the sensor's "coarse" mode. The kit includes transistors for inverting and speeding the SPI signals, but I wanted to see the most limiting situation.

    The components, laid out on my work area:

    attachment.php?attachmentid=70760

    The most difficult part of assembly is installing the mouse sensor chip. This is done from the top of the PCB, so you'll need a sharp soldering tip and some fine diameter solder (1/32", or 0/5 mm). The assembled mouse:

    attachment.php?attachmentid=70761

    This product is a professional design with complete documentation. If we're going to make a mouse sensor, we're going to do it once and do it correctly. The documentation is often as much work as the hardware and software, or at least it feels like it. The docs include detailed drawings, schematics and explanation. It's difficult not to succeed when the documentation is very clear. This particular document has the right mix of instructions and diagrams to show the user what to do.

    attachment.php?attachmentid=70762

    Here's the mechanical part. The laser cut parts and spacers provided the right amount of spacing. We ordered a new Epilog 36EXT laser cutter so we can make these parts at Parallax. Of course, it's now impossible for us to make a $5 mouse. . . just to warn you ahead of time. But, what better way to learn how one of these works than to build it yourself? That's worth the $25 cost (or whatever Lauren determines).

    attachment.php?attachmentid=70763

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Ken Gracey
    Parallax Inc.

    Follow me at http://twitter.com/ParallaxKen for some insider news.

    Post Edited (Ken Gracey (Parallax)) : 5/31/2010 11:50:03 PM GMT
    800 x 600 - 285K
    800 x 600 - 232K
    800 x 600 - 223K
    800 x 600 - 265K
  • Ken GraceyKen Gracey Posts: 7,387
    edited 2010-05-31 23:39
    First I ran the BS2 code:

    attachment.php?attachmentid=70765

    I decided to conduct a small test to check out the repeatability, so I ran the mouse along a set of calipers for a 3.000" distance. Each time I recorded the data, and here is what I observed:

    1526
    1534
    1536
    1521
    1525

    Very repeatable. I'm not sure how the units equate to distance at this time, but I can verify that the Mouse Monitor program shows a single square as 250 pixels or 0.5".

    attachment.php?attachmentid=70764

    Then I commented out the DEBUG statement and increased the baud rate to 38400 to run it with Mouse Monitor.

    attachment.php?attachmentid=70766

    And the software makes it all so easy. I've still got a lot left to do with this kit: run it with the Propeller; wire up the external components for high-speed, etc.

    We have a single mouse, well-done. We'll be kitting these up in the next week, pending arrival of one of the parts (either the spacers or rivets, not sure).

    The entire product and software will also be released as open-source without restrictions.

    Thanks Phil!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Ken Gracey
    Parallax Inc.

    Follow me at http://twitter.com/ParallaxKen for some insider news.

    Post Edited (Ken Gracey (Parallax)) : 5/31/2010 11:50:55 PM GMT
    800 x 600 - 112K
    1168 x 805 - 45K
    819 x 558 - 20K
  • kf4ixmkf4ixm Posts: 529
    edited 2010-06-01 00:15
    Yes, Thanks Phil, and thanks to Ken for a very good write-up on your testing!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I'm just 7*1027 atoms floating through time and space in close formation. -KF4IXM
  • Martin_HMartin_H Posts: 4,051
    edited 2011-03-01 18:56
    This sensor looks pretty neat. How far away from a surface can it be and still get reliable readings?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-03-01 19:31
    The lens has a very narrow depth of field. It's really designed to operate with the feet in contact with the surface whose features it's tracking.

    -Phil
Sign In or Register to comment.