Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Technical Discussion (http://www.chiefdelphi.com/forums/forumdisplay.php?f=22)
-   -   optical mouse motion sensor thread (http://www.chiefdelphi.com/forums/showthread.php?t=71182)

groves 04-01-2009 16:40

optical mouse motion sensor thread
 
Throughout the years we have used a sensor to measure the distance that the robot moves. I have been playing with a couple of ideas to keep track of motion. My favorite idea is using an optical mouse I've found this information:

Cody's robot optical motion sensor

I have some general questions that we can all learn from:
  1. How do we connect to the CRio
  2. How do we program to utilize the information the motion sensor can give us.

Nibbles 04-01-2009 21:06

Re: optical mouse motion sensor thread
 
This is something I have considered too (with mice, webcams, OpenCV, then various vision algorithms), but soon realized it was impractical because of the limitation of speed. Especially for mouse cameras, the resolution and (fast compared to standard video) framerate is too low for anything more then a foot per second (if you are lucky). Going back a generation of mice and using a ball/wheel with optical encoders is your best bet, and probably for the next few years. This years floor also poses a problem, there may not be enough contrast of the texture to track.
<ins>Wait, the floor is textured, so a good camera would be able to keep a lock on the floor texture with proper lighting. If you had a camera that could do the job.</ins>

DonRotolo 04-01-2009 21:13

Re: optical mouse motion sensor thread
 
Quote:

Originally Posted by Nibbles (Post 791678)
framerate is too low for anything more then a foot per second (if you are lucky).

In a definitely unscientific experiment I wiggled my mouse about 6 inches at a rate of 'there-and-back' four times a second - about 4 FPS - and it seemed to track OK. Maybe it only tracked the ends (where I was moving slower as direction reversed). The link groves provided implied that it could be used - with modification - at fairly high (for a robot) speeds.

Nibbles 05-01-2009 00:31

Re: optical mouse motion sensor thread
 
Quote:

Originally Posted by Don Rotolo (Post 791688)
In a definitely unscientific experiment I wiggled my mouse about 6 inches at a rate of 'there-and-back' four times a second - about 4 FPS - and it seemed to track OK. Maybe it only tracked the ends (where I was moving slower as direction reversed). The link groves provided implied that it could be used - with modification - at fairly high (for a robot) speeds.

A better job then the mice I have access to (nothing fancy). My criteria was to have some tracking accuracy rate, report roughly the same velocity that is actually occurring , say, 99.9% of the time at max speed (20f/s). Anything less would mean that every few seconds it will report traveling in the wrong direction, enough to be problematic.

Looking at some of the more advanced mice (that I could find numbers for... seems like only marketing buzzwords like "LASER" and "OPTICAL" matter) can go up to 45in/s. Likely, since the playing surface grains (variance in contrast the mouse can lock onto) are larger then that on a mouse pad, you can pull back the mouse and shrink the size 4-6 times, so you could get up to 18 feet a second (or 35ft/s absolute best case if the tech specs are to be believed). But, you would have to find a USB to serial converter, and that mouse doesn't support PS/2 output (mice that do ship with a USB to PS/2 converter support the connection natively, the converter doesn't do any actual conversion of data). Take a really cheap computer with USB2.0 and serial, do some (quite a bit) of programming, and feed the results into the cRIO. And of course this is only theoretical, I haven't actually done any testing.

Alan Anderson 05-01-2009 08:08

Re: optical mouse motion sensor thread
 
We did some experiments a few years back with using an optical mouse to track motion on the FRC carpet. Wildstang's programmers determined the hardware hacking necessary to connect directly to the chip inside the mouse, and came up with the code to use an IFI controller to communicate with it. We did the optical design so it could handle the expected travel speeds and view the surface without having to drag on the floor, and made a pneumatically-activated test jig to determine repeatability.

The electrical, optical, and programmatical aspects all worked great. However, without an absolutely stable distance between the floor and the sensor, converting mouse counts to absolute motion was unreliable. The values changed significantly with a difference in height of a single millimeter. A typical FRC robot bounces a lot more than that in normal operation.

With the slippery surface this year, maybe bouncing would be less of an issue -- except during collisions.

Gdeaver 05-01-2009 08:18

Re: optical mouse motion sensor thread
 
I looked at this year's ago with led mice. Allot of mice use chip sets that you can't find any spec's on. Some logitech mice use Avago chip sets that have published interface data sheets. With out a USB port on the RC the interface is a problem. The communication protocol with the chip set is SPI. The faster mouse engines must have the code loaded into the mouse chip. It's complicated but do able. This is probably a case where a coprocessor would be good. The coprocessor could interface with the serial port or the SPI port and just send the cleaned up x and y data. In the end the problem is optical. The vertical height must stay with in a very close tolerance. Modifying the optics can be very difficult. It can be done but this is going to take allot of work. I got it working on a vex bot. How ever the chip set is now obsolete. Optically the laser mice are much more tolerant. A USB HID to serial converter might be a way to go.

edBringas 05-01-2009 09:26

Re: optical mouse motion sensor thread
 
I went to a training hosted by Team 340, one of the beta testers of the new control system and remember be told that the new Jaguar motor controllers have built in encoders. Though it takes the fun out of making encoders it should save us some time :)

-Ed

Daniel_LaFleur 05-01-2009 09:33

Re: optical mouse motion sensor thread
 
Quote:

Originally Posted by edBringas (Post 792221)
I went to a training hosted by Team 340, one of the beta testers of the new control system and remember be told that the new Jaguar motor controllers have built in encoders. Though it takes the fun out of making encoders it should save us some time :)

-Ed

Those encoders don't mean a thing if the wheels are spinning.

martin417 05-01-2009 09:35

Re: optical mouse motion sensor thread
 
Quote:

Originally Posted by edBringas (Post 792221)
I went to a training hosted by Team 340, one of the beta testers of the new control system and remember be told that the new Jaguar motor controllers have built in encoders. Though it takes the fun out of making encoders it should save us some time :)

-Ed

There are no encoders built into the Jaguars. There is a micro that can read an encoder through the CAN bus, but use of the CAN bus is against the rules this year.

edBringas 05-01-2009 09:48

Re: optical mouse motion sensor thread
 
Good point on the spinning of the wheels Dan.

StevenB 05-01-2009 09:51

Re: optical mouse motion sensor thread
 
Quote:

Originally Posted by Nibbles (Post 791974)
My criteria was to have some tracking accuracy rate, report roughly the same velocity that is actually occurring , say, 99.9% of the time at max speed (20f/s).

I don't think 20 ft/sec will be necessary. In general maximum acceleration on the regolith will be ~1.6 ft/sec^2, meaning you'll be lucky to get over ~8ft/sec. This vastly reduces the change in focal length that is required. Some high-end mice might even be able to do it without any modification. On the other hand, there is still a robustness advantage to having the mouse more than a couple millimeters from the ground.

Interfacing one of the Avago (previously Agilent) mouse chips isn't extremely hard - I've done it before with my VEX controller. It requires only a digital IO pin and a bit of software. An oscilloscope and the datasheet go a long way. ;)

Quote:

Originally Posted by edBringas (Post 792221)
I went to a training hosted by Team 340, one of the beta testers of the new control system and remember be told that the new Jaguar motor controllers have built in encoders. Though it takes the fun out of making encoders it should save us some time :)
-Ed

The Jaguars do not have built-in encoders. However, they do have support for a quadrature or analog encoder input. They have a microprocessor (more powerful than last year's controller) inside, which can run PID or other software. However, this is illegal this year per <R62>
Quote:

Originally Posted by Game Manual, Section 8, <R62>
Every speed controller, relay module, and servo shall be connected via PWM cable to the
Digital Sidecar, and be controlled by signals provided from the Mobile Device Controller via
the Digital Sidecar. They shall not be controlled by signals from any other source.
A. Support for the CAN bus port on the Jaguar speed controllers is prohibited for this
competition, and the port is not to be used. Nothing shall be connected to the CAN bus
port. It is recommended that the port be protected with a piece of tape to prevent debris
from entering the port.


nickec 21-01-2009 08:16

Re: optical mouse motion sensor thread
 
Quote:

Originally Posted by Alan Anderson (Post 792171)
We did some experiments a few years back with using an optical mouse to track motion on the FRC carpet. Wildstang's programmers determined the hardware hacking necessary to connect directly to the chip inside the mouse, and came up with the code to use an IFI controller to communicate with it. We did the optical design so it could handle the expected travel speeds and view the surface without having to drag on the floor, and made a pneumatically-activated test jig to determine repeatability.

The electrical, optical, and programmatical aspects all worked great. ...

I am hoping to use a laser mouse as a data acquisition sensor. A sub-revolution tachometer. Does this sound feasible? :)

Tristan Lall 21-01-2009 10:27

Re: optical mouse motion sensor thread
 
Quote:

Originally Posted by nickec (Post 805060)
I am hoping to use a laser mouse as a data acquisition sensor. A sub-revolution tachometer. Does this sound feasible? :)

No, at least not for FRC. Lasers are banned, without regard to the power output or the function.

nickec 21-01-2009 11:30

Re: optical mouse motion sensor thread
 
Quote:

Originally Posted by Tristan Lall (Post 805111)
No, at least not for FRC. Lasers are banned, without regard to the power output or the function.

I apologize for not making clear that I am not a robot competition team member. I am an amateur scientist. When I saw the post involving optical mice, which predate laser mice, I was hoping to ask some questions of anyone who has done the kind of hardware and software work necessary to use a laser mouse for data acquisition.

The poster seemed to be saying that this work had been done. Namely direct hardware interface with the mouse DSP.

EricVanWyk 21-01-2009 11:40

Re: optical mouse motion sensor thread
 
Quote:

Originally Posted by nickec (Post 805139)
I apologize for not making clear that I am not a robot competition team member yet. I am an amateur scientist.

Nick -

I fixed your post for you. I'm sure that after looking around here a bit you'll find yourself joining or starting a team. There are a lot of interesting people and interesting ideas on this forum, and we are glad that you are joining it.


All times are GMT -5. The time now is 14:30.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi