Author Topic: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]  (Read 76456 times)

0 Members and 1 Guest are viewing this topic.

Offline The_Ed

  • Thread Starter
  • Posts: 1350
  • Location: MN - USA
  • Asperger's... SQUIRREL! I'm Anal Retentive *****!
No... At the MAXIMUM OUTPUT of the sensor, which is 8200DPI at 150ips, it can move 1,230,000 pixels in a single second. That's 1230 pixels per poll of the sensor at 1000hz. If only the lower 8 bits of X and Y are used in the movement calculation, you can only move a maximum of 127 pixels per poll before it glitches and you move the opposite direction. Thus you need to use both the lower AND upper bits of X and Y if you are going to game on it, or just plain move it too fast.

A 38.1mm silicon nitride ball is $192.12 apiece (minimum order 2) + shipping... But it's so damn purdy... If I ever win the lottery I'll get some (fat chance on that though...).

I did however replace the bearings with 2mm Grade 5 silicon nitride as that is affordable.
« Last Edit: Tue, 23 July 2013, 11:04:47 by The_Ed »
Reaper "frelled" me... Twice... Did he "frell" you too?... *brohug*
I'm camping for a week, and moving twice in a month. I'll get back to you when I can (If I don't then just send me another PM).
R.I.P.ster

Offline The_Ed

  • Thread Starter
  • Posts: 1350
  • Location: MN - USA
  • Asperger's... SQUIRREL! I'm Anal Retentive *****!
Oh yeah and if anybody needs the parts to do a trackball mod I will end up with extras of almost everything. So instead of buying the parts from ~20 different sources around the world you could just buy my extras at cost. But I have to get both trackball mods done before I sell off those extras. I also don't use cheap parts, "good enough" is never good enough for me. I think when all's said and done each of the trackballs will be composed of over $200 in parts (that includes the original prices of the trackballs). Though that will probably dip below $200 if the extra parts are sold off at the end. You always have to buy more than you need as almost everything comes in packs.
Reaper "frelled" me... Twice... Did he "frell" you too?... *brohug*
I'm camping for a week, and moving twice in a month. I'll get back to you when I can (If I don't then just send me another PM).
R.I.P.ster

Offline damorgue

  • Posts: 1176
  • Location: Sweden
    • Personal portfolio
I may be interested in teensy+avago+code and put it in a mouse instead. I like the idea of a mouse where I could Control things like liftoff distance, angle snapping, acceleration and other anoying things. I made a mouse Shell myself earlier but ripped the guts from Another mouse and put in it. This would be far nicer. I will be monitoring your progress. Good luck

Offline The_Ed

  • Thread Starter
  • Posts: 1350
  • Location: MN - USA
  • Asperger's... SQUIRREL! I'm Anal Retentive *****!
Ah yes, Snap_Angle... I forgot about that one... Remind me if I have forgotten during the 1.0 code release as it should be a simple 1 line of code in setup().
Reaper "frelled" me... Twice... Did he "frell" you too?... *brohug*
I'm camping for a week, and moving twice in a month. I'll get back to you when I can (If I don't then just send me another PM).
R.I.P.ster

Offline damorgue

  • Posts: 1176
  • Location: Sweden
    • Personal portfolio
I still have that kickstarter page bookmarked intending to buy it later... never did. If anyone has an Avago to spare, please PM me.

Offline The_Ed

  • Thread Starter
  • Posts: 1350
  • Location: MN - USA
  • Asperger's... SQUIRREL! I'm Anal Retentive *****!
Reaper "frelled" me... Twice... Did he "frell" you too?... *brohug*
I'm camping for a week, and moving twice in a month. I'll get back to you when I can (If I don't then just send me another PM).
R.I.P.ster

Offline The_Ed

  • Thread Starter
  • Posts: 1350
  • Location: MN - USA
  • Asperger's... SQUIRREL! I'm Anal Retentive *****!
I'm too lazy to make a thread in "making stuff together!" today...

Me and my Dad received our ADNS-9800 sensors a few days ago. The parts list has been finalized upon, and will be ordered soon. If anyone else wants a drop-in Microsoft Trackball Optical controller, NOW would be the time to tell me so enough of certain parts can be ordered. I believe the parts are from 23 different sources (half of those being from ebay?) from countries all around the world.

Some interesting (and quite expensive...) headers will be used to make everything fit. I haven't been able to find them for cheaper than [$4.50 for 4]/[$5.60 for 8] for the 14 pin right angle SMT headers, and [$12.28 for 10]/[$19.95 for 20] for the dual insulator headers. Anyone else know where to get them for cheaper?



(These are used to access the pins on the back of the teensy 3.0. Which means that the pins on the sides of the teensy 3.0 will be coming out of the top.)



(These will be used to traverse the 2 PCB sandwich that houses all the components.)
« Last Edit: Mon, 29 July 2013, 17:40:30 by The_Ed »
Reaper "frelled" me... Twice... Did he "frell" you too?... *brohug*
I'm camping for a week, and moving twice in a month. I'll get back to you when I can (If I don't then just send me another PM).
R.I.P.ster

Offline wcass

  • Posts: 506
  • Location: Fort Lauderdale, FL, USA
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #107 on: Tue, 30 July 2013, 19:33:15 »
Some interesting (and quite expensive...) headers will be used to make everything fit. I haven't been able to find them for cheaper than [$4.50 for 4]/[$5.60 for 8] for the 14 pin right angle SMT headers, and [$12.28 for 10]/[$19.95 for 20] for the dual insulator headers. Anyone else know where to get them for cheaper?

i always get header pins that you can cut to size with a razor knife.

Offline The_Ed

  • Thread Starter
  • Posts: 1350
  • Location: MN - USA
  • Asperger's... SQUIRREL! I'm Anal Retentive *****!
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #108 on: Tue, 30 July 2013, 22:29:43 »
Yes I could probably save a few cents with the SMT headers by getting longer ones and cutting them to size. But the dual insulator headers are the ones I can't find for cheaper, period. The space between the PCBs has to be very small so that the dual PCB sandwich will fit inside. I don't want to have to go thicker than 0.75" for the hollowed out HDPE sheet attached to the bottom.
Reaper "frelled" me... Twice... Did he "frell" you too?... *brohug*
I'm camping for a week, and moving twice in a month. I'll get back to you when I can (If I don't then just send me another PM).
R.I.P.ster

Offline damorgue

  • Posts: 1176
  • Location: Sweden
    • Personal portfolio
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #109 on: Sun, 18 August 2013, 17:41:22 »
To make the scroll wheel work it looks like a TX-IR IC and 4MHz ceramic resonator need to be added...

I'm also gonna have to add a 32.768KHz crystal and a 10uf capacitor to the teensy... (I hope 10uf doesn't cause too much inrush current...)

How will you make and place the scroll wheel? As a ring-type scroll or as a separate wheel?

Offline The_Ed

  • Thread Starter
  • Posts: 1350
  • Location: MN - USA
  • Asperger's... SQUIRREL! I'm Anal Retentive *****!
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #110 on: Sun, 18 August 2013, 18:30:16 »
To make the scroll wheel work it looks like a TX-IR IC and 4MHz ceramic resonator need to be added...

I'm also gonna have to add a 32.768KHz crystal and a 10uf capacitor to the teensy... (I hope 10uf doesn't cause too much inrush current...)

How will you make and place the scroll wheel? As a ring-type scroll or as a separate wheel?


This info is old and incorrect. I will be using the new "IntervalTimer" function that has been added to Teensyduino which uses the 4 PIT timers in the teensy 3.0, and "supposedly" doesn't conflict with Tone() anymore. No TX-IR IC, 4MHz ceramic resonator, or 32.768KHz crystal needed. But I will still need the 10uf capacitor.

Because I am modding existing trackballs (Me and my Dad's Microsoft Trackball Opticals) the scroll wheel already has it's place. I will most likely post pictures of progress next weekend.
Reaper "frelled" me... Twice... Did he "frell" you too?... *brohug*
I'm camping for a week, and moving twice in a month. I'll get back to you when I can (If I don't then just send me another PM).
R.I.P.ster

Offline damorgue

  • Posts: 1176
  • Location: Sweden
    • Personal portfolio
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #111 on: Sun, 18 August 2013, 19:22:37 »
To make the scroll wheel work it looks like a TX-IR IC and 4MHz ceramic resonator need to be added...

I'm also gonna have to add a 32.768KHz crystal and a 10uf capacitor to the teensy... (I hope 10uf doesn't cause too much inrush current...)

How will you make and place the scroll wheel? As a ring-type scroll or as a separate wheel?


This info is old and incorrect. I will be using the new "IntervalTimer" function that has been added to Teensyduino which uses the 4 PIT timers in the teensy 3.0, and "supposedly" doesn't conflict with Tone() anymore. No TX-IR IC, 4MHz ceramic resonator, or 32.768KHz crystal needed. But I will still need the 10uf capacitor.

Because I am modding existing trackballs (Me and my Dad's Microsoft Trackball Opticals) the scroll wheel already has it's place. I will most likely post pictures of progress next weekend.

The scrolling mechanism in the trackball you are modifying, does it work the same way as in regular mice, with a lattice which moves in between a LED and an optical sensor to gives pulses? I think the direction is determined by this priciple or something similar. Is it the same in your trackball?
« Last Edit: Sun, 18 August 2013, 19:24:16 by damorgue »

Offline The_Ed

  • Thread Starter
  • Posts: 1350
  • Location: MN - USA
  • Asperger's... SQUIRREL! I'm Anal Retentive *****!
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #112 on: Sun, 18 August 2013, 19:43:10 »
It uses an IR LED and an IR sensor quadrature encoder (2-bit code -> 00, 01, 11, 10). But because the teensy 3.0 is 3.3v I have to use an Adafruit TXB0108 logic level converter (It's just easier to use a breakout board). That way the 3.3v teensy 3.0 and 5v scroll wheel components can communicate without killing each other.
Reaper "frelled" me... Twice... Did he "frell" you too?... *brohug*
I'm camping for a week, and moving twice in a month. I'll get back to you when I can (If I don't then just send me another PM).
R.I.P.ster

Offline dorkvader

  • Posts: 6288
  • Location: Boston area
  • all about the "hack" in "geekhack"
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #113 on: Sun, 18 August 2013, 23:11:52 »
The_ed: will your code support using the ball itself as a scrollwheel by (for example) pressing a button? I find this to be a good solution, especially if one plans to add buttons.

Offline The_Ed

  • Thread Starter
  • Posts: 1350
  • Location: MN - USA
  • Asperger's... SQUIRREL! I'm Anal Retentive *****!
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #114 on: Sun, 18 August 2013, 23:19:11 »
The_ed: will your code support using the ball itself as a scrollwheel by (for example) pressing a button? I find this to be a good solution, especially if one plans to add buttons.

I don't quite understand what you mean... Can you elaborate? If I do do code for extra things it will be after both trackballs are modded and working with the 1.0 code (that is likely to be done LATE next month at the EARLIEST). The 1.0 code should have almost every standard feature already.

EDIT: BTW I don't even have all the parts in yet. Some things come in only a few days from China, others take up to ~5 weeks, it's weird.
« Last Edit: Sun, 18 August 2013, 23:24:02 by The_Ed »
Reaper "frelled" me... Twice... Did he "frell" you too?... *brohug*
I'm camping for a week, and moving twice in a month. I'll get back to you when I can (If I don't then just send me another PM).
R.I.P.ster

Offline dorkvader

  • Posts: 6288
  • Location: Boston area
  • all about the "hack" in "geekhack"
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #115 on: Mon, 19 August 2013, 12:06:14 »
This is a feature that the CST trackballs implement (poorly). You press (and hold) a button, and (after three seconds) it switches to "scroll" mode, where the cursor is frozen, and moving the trackball acts to scroll the page. This is useful for reading long documents and PDF's, as well as lists.

What I'd like to see is allowing a button to be used to turn the mode on and off, so you don't have to repurpose a button for this (though having functionality for both is likely doable) so you press the "scroll" button, then the cursor is frozen and the trackball becomes a scrollwheel. You press it again to unlock the cursor and it is back to being a normal trackball.

I am sure I don't recall the CST's behaviour perfectly, but I hope I've made my idea more clear.

---
I'm also not even close to starting this project, so I'm not affected much by any delays you may have, though I'm sure it's frustrating for you to have to wait so long.

Offline The_Ed

  • Thread Starter
  • Posts: 1350
  • Location: MN - USA
  • Asperger's... SQUIRREL! I'm Anal Retentive *****!
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #116 on: Mon, 19 August 2013, 16:01:39 »
As long as there are free digital pins I can always add more buttons to the code (I need to count up how many are used already). You want a dedicated button, and also the ability to hold a specific button for 3 seconds, to change the trackball into a scroll wheel (without center click obviously). You would obviously have to un-comment out this feature and type the button ID into the function for holding a button for 3 seconds (that way you would get to choose which button it is instead of me) if you don't use the dedicated button. But this feature would likely be implemented in a future 1.1 release as it is not necessary for my trackball mods.

Remember that my code will only work on the teensy 3.0, and I don't plan on supporting the teensy 2.0/++ 2.0.
Reaper "frelled" me... Twice... Did he "frell" you too?... *brohug*
I'm camping for a week, and moving twice in a month. I'll get back to you when I can (If I don't then just send me another PM).
R.I.P.ster

Offline damorgue

  • Posts: 1176
  • Location: Sweden
    • Personal portfolio
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #117 on: Mon, 19 August 2013, 19:36:51 »
I will wait until you get yours working before I commit to buying parts for my project. Hopefully everything turns out perfectly on your first try but my experience tells me that problems always rise, no matter how thorough you are. I'll let you take the risks :)

In all seriousness, I hope it turns out great. I will follow your project so please let us know how it goes when you receive your parts.

Edit: Let me know if there is anything I can do to help. I am afraid I don't know much about electronics and signals processing, but perhaps there is something I can contribute.

Offline The_Ed

  • Thread Starter
  • Posts: 1350
  • Location: MN - USA
  • Asperger's... SQUIRREL! I'm Anal Retentive *****!
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #118 on: Mon, 19 August 2013, 19:53:48 »
I have most of the parts now, I'm just waiting on the stragglers.

I believe reading the "Motion Burst" data into variables and mounting the ADNS-9800 to the ball socket were what I was still trying to figure out. By using "Motion Burst" I'll be much more efficient with reading the motion data, and maybe be able to support more than 1000hz if people want that (but 1000hz will be what I set it to).
Reaper "frelled" me... Twice... Did he "frell" you too?... *brohug*
I'm camping for a week, and moving twice in a month. I'll get back to you when I can (If I don't then just send me another PM).
R.I.P.ster

Offline The_Ed

  • Thread Starter
  • Posts: 1350
  • Location: MN - USA
  • Asperger's... SQUIRREL! I'm Anal Retentive *****!
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #119 on: Tue, 20 August 2013, 01:17:31 »
Damnit dorkvader! Now you have me thinking about how to implement your scroll ball... It should technically be possible to go all 4 directions because tilt-wheel mice exist. A certain amount of "counts" would be converted into a scroll command. I have also re-thought how the LEDs will give info because in my current method you wouldn't be able to tell when you were in ball scroll mode. The ball socket LEDs have to be incorporated (I'm using 2 to evenly light up the ball socket, but the signal is the same to both), which means if you don't have a light-up ball socket you'll have to put the LED elsewhere.

I'm thinking that the scroll ball should NOT be dependent on the DPI (meaning that whatever DPI level you are on it will still scroll the same amount). With 8 levels of DPI (it's technically possible to have 41) and a scroll ball mode that's all 9 combinations of the 2 RGB LEDs (excluding OFFs). When you hold down the forward and backward buttons simultaneously (that's what I'll have it set to) you'll go into liftoff distance mode. The ball socket LEDs will turn off and the RGB LEDs will show the liftoff distance level instead of DPI. But because there are 11 levels (it's technically possible to have 31) I'll have to include OFFs.

I think you've just delayed the 1.0 release for everyone, but you'll likely have your scroll ball support in 1.0... Why you make more work for me bro?...
Reaper "frelled" me... Twice... Did he "frell" you too?... *brohug*
I'm camping for a week, and moving twice in a month. I'll get back to you when I can (If I don't then just send me another PM).
R.I.P.ster

Offline The_Ed

  • Thread Starter
  • Posts: 1350
  • Location: MN - USA
  • Asperger's... SQUIRREL! I'm Anal Retentive *****!
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #120 on: Tue, 20 August 2013, 14:03:23 »
Looks like to get horizontal scrolling I'll need to figure out "WM_MOUSEHWHEEL"... So ball scroll will likely be only vertical in 1.0. There are some other things in my list of additions after 1.0 as well now. I think there will be exactly 0 free digital pins on the teensy 3.0 if I implement the code for everything in the list (yes, all 34 would be used...). Do people really need that many inputs on a mouse? Probably not, but they'll be able to hook any combination of things up, unless they really want a ****in' massive mouse.

EDIT: Maybe "MOUSEEVENTF_HWHEEL" instead... I don't know...
« Last Edit: Tue, 20 August 2013, 14:15:28 by The_Ed »
Reaper "frelled" me... Twice... Did he "frell" you too?... *brohug*
I'm camping for a week, and moving twice in a month. I'll get back to you when I can (If I don't then just send me another PM).
R.I.P.ster

Offline damorgue

  • Posts: 1176
  • Location: Sweden
    • Personal portfolio
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #121 on: Tue, 20 August 2013, 15:13:48 »
I believe I missed that list. Could you summarize your firmware, or is this still valid?

Do you have a copy of the Avago C8051F347 Firmware that they supply to people who are going to make mice with their ADNS-9800 laser sensors? That way it should be much easier to change the code to my purposes since it already has code for:

the ADNS-9800 pointer movement
a scroll wheel
3 mouse buttons (I would add support for 2 more)
3 LEDs roughly indicating DPI (I would alter them to light up the socket when the mouse is being moved)
and 2 buttons to increment/decrement the DPI by 200 (they can also be used to increment/decrement the liftoff distance by 0.3mm) (I would alter it to change between 5-8 defined DPI levels)

(This is in the PDF sheet for Avago's C8051F347 Firmware Version 2.8 from 11JAN12)

Just trying to summarize it as it would be in a mouse. You mention scroll, 3 buttons+2 extra. Those would then be approximately this I suppose:
-Scrollwheel
-Middle mouse button (push scroll)
-Left mouse button
-Right mouse button
-Forward
-Backward

Then there are 2 more buttons who are not sent to the computer but just control the firmware internally (DPI and liftoff distance as you mentioned). Correct?

Offline The_Ed

  • Thread Starter
  • Posts: 1350
  • Location: MN - USA
  • Asperger's... SQUIRREL! I'm Anal Retentive *****!
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #122 on: Tue, 20 August 2013, 15:24:50 »
Again, you are quoting old and incorrect information... There has been a lot of progress and changes since then.

Here's a little checklist I have that might give a little more insight.

Quote
Trackball and Mouse movement
9 buttons (2 for DPI)
Toggle (DPI and liftoff)
Vertical scroll (2-bit and buttons)
2 RGB indicator LEDs
2 Ball socket movement LEDs
11 Liftoff distance levels
8 DPI levels
Snap_Angle
Rest 1, 2, 3
Motion_Burst
500ma
1000hz IntervalTimer

Future:
Ball scroll
Profiles/layers
Horizontal scroll (2-bit and buttons) and center button
FPS button

Digital:
9 buttons
2 scroll
3 toggle
8 LEDs
5 laser

Future:
1 ball scroll
1-2? profiles/layers
3 horizontal scroll
1 FPS button

EDIT: Actually I could free up 2 of those Digital pins by commenting out like I did for others, so they won't all be used like I thought a little bit ago.
« Last Edit: Tue, 20 August 2013, 15:29:24 by The_Ed »
Reaper "frelled" me... Twice... Did he "frell" you too?... *brohug*
I'm camping for a week, and moving twice in a month. I'll get back to you when I can (If I don't then just send me another PM).
R.I.P.ster

Offline dorkvader

  • Posts: 6288
  • Location: Boston area
  • all about the "hack" in "geekhack"
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #123 on: Tue, 20 August 2013, 17:58:13 »
Lots of activity here since my last post.

First of all, I did not want to recommend implementing CST's horrible scrolling interface (unless you really wanted to) but just having vertical scroll functionality via a switch would be perfect for me. Multi-axis scroll would be great, but I think saving it for a later version would be better.

If you can really implement all that in version one, it'll be a pretty excellent piece of software. When I bulk-order parts (and teensys) next paycheck, I'll make sure to get a 3.0 just in case.

Offline The_Ed

  • Thread Starter
  • Posts: 1350
  • Location: MN - USA
  • Asperger's... SQUIRREL! I'm Anal Retentive *****!
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #124 on: Tue, 20 August 2013, 21:50:31 »
There's gonna be a LOT in 1.0, with more after that. To use the code people will have to both un-comment out and comment out bits and pieces, and also set some things. Basically like a command line razer software if you get what I mean. It'll all be there for a simple setup, though I'll still probably have to make a guide for those that can't read the in-code comments...

But yeah it looks like only 2 digital pins will be left, which means I could change it to 11 buttons (2 for DPI) for those that like more buttons. And I could technically get a lot more if I make nothing dedicated, but all assignable.

...

Ah ****...

Why do I keep having ideas?... They just make more work for me...

OK, nothing dedicated it is. That will make it much more flexible, but increase the stuff the end user has to do to set it up.
Reaper "frelled" me... Twice... Did he "frell" you too?... *brohug*
I'm camping for a week, and moving twice in a month. I'll get back to you when I can (If I don't then just send me another PM).
R.I.P.ster

Offline damorgue

  • Posts: 1176
  • Location: Sweden
    • Personal portfolio
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #125 on: Tue, 20 August 2013, 21:53:16 »
Thanks The_Ed, that is exactly what I was looking for. I'll probably order some parts myself soon.
« Last Edit: Tue, 20 August 2013, 22:12:58 by damorgue »

Offline MrJohnK

  • Posts: 15
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #126 on: Tue, 20 August 2013, 21:56:53 »
If you need a sensor, be quick.  I'm almost sold out.  I'm working on ordering more supplies, but I'll probably be out before the new supplies arrive.  Only 4 left.

-John

Offline damorgue

  • Posts: 1176
  • Location: Sweden
    • Personal portfolio
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #127 on: Tue, 20 August 2013, 22:28:27 »
If you need a sensor, be quick.  I'm almost sold out.  I'm working on ordering more supplies, but I'll probably be out before the new supplies arrive.  Only 4 left.

-John

Thanks for notifying me. I am still contemplating getting a mouse and gutting it for parts instead though. I have a lot of Omron switches left over, but the cost of those are negligible. It will cost me $40 + $33 for Avago sensor and Teensy 3.0, it will require more effort and I will need a few more parts as well. It stands between that and  gutting a mouse which will give me a bit less versatility I guess.

Offline The_Ed

  • Thread Starter
  • Posts: 1350
  • Location: MN - USA
  • Asperger's... SQUIRREL! I'm Anal Retentive *****!
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #128 on: Wed, 21 August 2013, 05:21:00 »
If you need a sensor, be quick.  I'm almost sold out.  I'm working on ordering more supplies, but I'll probably be out before the new supplies arrive.  Only 4 left.

-John

But after you get more supplies they will be in-stock again right? I was thinking of getting 2 more sensors after I complete the first trackball. I would still be able to do that right? I thought I remembered you saying you were going to stock these for the long haul.

Also, why did the price increase?

If you need a sensor, be quick.  I'm almost sold out.  I'm working on ordering more supplies, but I'll probably be out before the new supplies arrive.  Only 4 left.

-John

Thanks for notifying me. I am still contemplating getting a mouse and gutting it for parts instead though. I have a lot of Omron switches left over, but the cost of those are negligible. It will cost me $40 + $33 for Avago sensor and Teensy 3.0, it will require more effort and I will need a few more parts as well. It stands between that and  gutting a mouse which will give me a bit less versatility I guess.

But if you gut a mouse how will you use the sensor?... They don't come on breakout boards, they're soldered directly to the main PCB. If the mouse sensor isn't an ADNS-9800 you're gonna have to find the firmware elsewhere. If you don't use a teensy 3.0 you can't use my code, and if you use a teensy 2.0 you'll have to modify John's code, and if you use neither you'll probably have to code from scratch for whatever controller you're using.
Reaper "frelled" me... Twice... Did he "frell" you too?... *brohug*
I'm camping for a week, and moving twice in a month. I'll get back to you when I can (If I don't then just send me another PM).
R.I.P.ster

Offline damorgue

  • Posts: 1176
  • Location: Sweden
    • Personal portfolio
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #129 on: Wed, 21 August 2013, 10:45:57 »
If you need a sensor, be quick.  I'm almost sold out.  I'm working on ordering more supplies, but I'll probably be out before the new supplies arrive.  Only 4 left.

-John

Thanks for notifying me. I am still contemplating getting a mouse and gutting it for parts instead though. I have a lot of Omron switches left over, but the cost of those are negligible. It will cost me $40 + $33 for Avago sensor and Teensy 3.0, it will require more effort and I will need a few more parts as well. It stands between that and  gutting a mouse which will give me a bit less versatility I guess.

But if you gut a mouse how will you use the sensor?... They don't come on breakout boards, they're soldered directly to the main PCB. If the mouse sensor isn't an ADNS-9800 you're gonna have to find the firmware elsewhere. If you don't use a teensy 3.0 you can't use my code, and if you use a teensy 2.0 you'll have to modify John's code, and if you use neither you'll probably have to code from scratch for whatever controller you're using.

i didn't make myself clear. I would use the entire internals then. I have done so in the past. That is what I meant by decreased versatility. I won't be able to adjust anything and would have to rely solely on their firmware, their hardware etc, which is why I would much prefer getting that Avago, Teensy and some sort of scroll mechaninic.

Edit: The scrolling mechanic is a bit of an issue for me as well and I'll have to figure it out. That issue won't be there if a butcher a mouse. I'll probably end up getting the avago+teensy+cheap mouse for scroll.
« Last Edit: Wed, 21 August 2013, 11:03:05 by damorgue »

Offline The_Ed

  • Thread Starter
  • Posts: 1350
  • Location: MN - USA
  • Asperger's... SQUIRREL! I'm Anal Retentive *****!
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #130 on: Wed, 21 August 2013, 14:06:21 »
Ah I see, but what would be the point of butchering a mouse when you couldn't customize anything? Making the shape of the mouse more ergonomic is all I can think of that you could do by purely butchering.

A cheap mouse will have a cheap scroll wheel, and you really want to get one that feels good. The way the scroll wheel is mounted and the parts used are also of concern. Older mice used 2 IR LEDs and 2 IR sensors mounted at different heights around the slotted wheel, and their signals had to be combined to make the quadrature code. Newer mice use a single IR LED and either a 3 or 4 lead IR sensor quadrature encoder around the slotted wheel. All 3 methods have to be hooked up to the microcontroller a different way. The way the scroll wheel is mounted can also be problematic as most mice have the scroll wheel mounted with plastic from the case. You would need to get a scroll wheel that mounts to the PCB (unless your modded mouse uses the case of the mouse you get the scroll wheel from).
Reaper "frelled" me... Twice... Did he "frell" you too?... *brohug*
I'm camping for a week, and moving twice in a month. I'll get back to you when I can (If I don't then just send me another PM).
R.I.P.ster

Offline The_Ed

  • Thread Starter
  • Posts: 1350
  • Location: MN - USA
  • Asperger's... SQUIRREL! I'm Anal Retentive *****!
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #131 on: Wed, 21 August 2013, 14:30:34 »
Ah I see, but what would be the point of butchering a mouse when you couldn't customize anything? Making the shape of the mouse more ergonomic is all I can think of that you could do by purely butchering.

Sort of what I am doing. I didn't want to clutter down your thread.

Don't worry about it, the more the merrier. I'll read through it later, but it looks like I was right on the ergonomics!

BTW if you need any parts proxied I have proxied for some of your fellow Swedes already.

Oh and remember you'll need a logic level converter (like an Adafruit TXB0108 breakout board) to interface the 5v scroll wheel with the 3.3v teensy 3.0, and a ULN2803 because 3.3v isn't enough to drive most LEDs properly.
Reaper "frelled" me... Twice... Did he "frell" you too?... *brohug*
I'm camping for a week, and moving twice in a month. I'll get back to you when I can (If I don't then just send me another PM).
R.I.P.ster

Offline damorgue

  • Posts: 1176
  • Location: Sweden
    • Personal portfolio
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #132 on: Wed, 21 August 2013, 16:17:50 »
If you need a sensor, be quick.  I'm almost sold out.  I'm working on ordering more supplies, but I'll probably be out before the new supplies arrive.  Only 4 left.

-John

Damn, they are sold out now. I didn't think they would sell out that fast. Any idea when new stocks may arrive?

Offline meowbots

  • Posts: 7
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #133 on: Wed, 21 August 2013, 19:16:07 »
Could someone please send me the latest firmware version they have for this sensor? I have A4, as posted here: https://github.com/mrjohnk/ADNS-9800. However, I'm going crazy trying to figure out what's wrong. I have successfully uploaded the firmware, activated the laser, and am able to correctly read registers such as product ID, revision ID, and SQUAL. The problem is that the motion pin never changes from high, and delta x and delta y are always zero (plus the motion bit of the motion register is always zero). I have two of these sensors, and get the same result with both, so it likely isn't hardware. Please help! Is there perhaps some other register I have to set up in order to begin to sense motion? So far I've set up the sensor as shown using the sample code, and then tried to read the motion, x_l, x_h, y_l, y_h registers.

Offline meowbots

  • Posts: 7
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #134 on: Wed, 21 August 2013, 20:01:55 »
Could someone please send me the latest firmware version they have for this sensor? I have A4, as posted here: https://github.com/mrjohnk/ADNS-9800. However, I'm going crazy trying to figure out what's wrong. I have successfully uploaded the firmware, activated the laser, and am able to correctly read registers such as product ID, revision ID, and SQUAL. The problem is that the motion pin never changes from high, and delta x and delta y are always zero (plus the motion bit of the motion register is always zero). I have two of these sensors, and get the same result with both, so it likely isn't hardware. Please help! Is there perhaps some other register I have to set up in order to begin to sense motion? So far I've set up the sensor as shown using the sample code, and then tried to read the motion, x_l, x_h, y_l, y_h registers.

Ahhh, the joys of wanting to use a PIC instead of Arduino... So apparently there was an ever so slight error in my code that was loading the SROM. My apologies for jumping the gun, I really thought I had wasted enough hours of my life trying to figure this out alone. Got me a working sensor now! :)

Offline damorgue

  • Posts: 1176
  • Location: Sweden
    • Personal portfolio
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #135 on: Wed, 21 August 2013, 20:04:33 »
I have two of these sensors,

Got me a working sensor now! :)

I might want the other if you don't need it. :)

Offline meowbots

  • Posts: 7
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #136 on: Wed, 21 August 2013, 20:11:08 »
Unfortunately I need them both, plus I'm not sure the shipping from Canada would be worth it anyway... I started off buying this mouse: http://www.amazon.ca/Perixx-MX-3000B-Programmable-Gaming-Laser/dp/B00BM7NXMW/ref=sr_1_2?ie=UTF8&qid=1377133751&sr=8-2&keywords=avago+9800, which has the same sensor, but just requires you to connect more pins. May be an option if you are stuck.

Offline MrJohnK

  • Posts: 15
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #137 on: Wed, 21 August 2013, 21:14:59 »
Those four sold out today.  I have two extra here I can list.  Past that, the only ones left might have to fill re-shipments to Israel and Italy.  I have those two customers that I shipped to about a month ago, but their package has not arrived.  They are both giving it a few more days since they know their post offices are slow.  Drop me a line if you decide you want one or two and I'll list them pronto.

As for restocking, that will probably be at least 3 weeks.  These sold out way faster than I anticipated, so I'm working with the vendors to source new stock.

-John
inet2xtreme{at}yahoo.com

Offline The_Ed

  • Thread Starter
  • Posts: 1350
  • Location: MN - USA
  • Asperger's... SQUIRREL! I'm Anal Retentive *****!
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #138 on: Wed, 21 August 2013, 23:22:31 »
Could someone please send me the latest firmware version they have for this sensor?

I got A4, A5 (89), and A6 from John. A6 is in my code that I will eventually try out, but A4 is known to work by at least 2 people (3 now including yourself).
Reaper "frelled" me... Twice... Did he "frell" you too?... *brohug*
I'm camping for a week, and moving twice in a month. I'll get back to you when I can (If I don't then just send me another PM).
R.I.P.ster

Offline damorgue

  • Posts: 1176
  • Location: Sweden
    • Personal portfolio
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #139 on: Thu, 22 August 2013, 01:12:05 »
The_Ed, will your firmware support calibration of X and Y axis? I was about to design a small rig which would allow me to adjust the rotation of the Avago PCB assembly on the bottom plate of my mouse, but it wouldn't be necessary if you could just set it in the firmware instead.

Offline The_Ed

  • Thread Starter
  • Posts: 1350
  • Location: MN - USA
  • Asperger's... SQUIRREL! I'm Anal Retentive *****!
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #140 on: Thu, 22 August 2013, 01:35:09 »
Of course, all you have to do is times by -1 where necessary if the axes are off. You just can't have it at a diagonal, any of the 4 directions are fine though.

It's mounting the ADNS-9800 to the ball socket that's the hard part at this point... The code will eventually get finished, the rest of the parts will arrive, and the trackballs will be modded. But I'll just be stuck with bupkis if I can't mount the ADNS-9800 to the ball socket...
Reaper "frelled" me... Twice... Did he "frell" you too?... *brohug*
I'm camping for a week, and moving twice in a month. I'll get back to you when I can (If I don't then just send me another PM).
R.I.P.ster

Offline damorgue

  • Posts: 1176
  • Location: Sweden
    • Personal portfolio
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #141 on: Thu, 22 August 2013, 01:50:31 »
I meant if it is off by a couple degrees. It would require some trigonometry to adjust it. Example:

Lets say you get a reading of 10 of whatever units positive X. If the sensor is rotated 5 degrees from the position you want it in, this will have to be converted to sin(85)*10 in X and cos(85)*10 in Y direction. Sort of tired atm, so that example might not be correct, but you should get the point I am getting at.

Is it possible to make these calculations on the large amount of data throughput without causing lag?
« Last Edit: Thu, 22 August 2013, 01:52:09 by damorgue »

Offline The_Ed

  • Thread Starter
  • Posts: 1350
  • Location: MN - USA
  • Asperger's... SQUIRREL! I'm Anal Retentive *****!
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #142 on: Thu, 22 August 2013, 02:05:45 »
The teensy 3.0 runs at 48MHz (and can be overclocked to 96MHz, but I would not recommend that). There shouldn't be any lag from the calculations, but I don't plan on adding that to my code as it should be easy enough to get the sensor within ±2 degrees, which you wouldn't even notice. The calculations would also likely introduce rounding errors, cursor lag (NOT calculation lag), and erratic movement (ESPECIALLY when changing direction). You can add those calculations if you want though, but I've already got too much on my plate as it is.
« Last Edit: Thu, 22 August 2013, 02:18:32 by The_Ed »
Reaper "frelled" me... Twice... Did he "frell" you too?... *brohug*
I'm camping for a week, and moving twice in a month. I'll get back to you when I can (If I don't then just send me another PM).
R.I.P.ster

Offline damorgue

  • Posts: 1176
  • Location: Sweden
    • Personal portfolio
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #143 on: Thu, 22 August 2013, 19:22:30 »
As for restocking, that will probably be at least 3 weeks.  These sold out way faster than I anticipated, so I'm working with the vendors to source new stock.

Three weeks ain't that bad. I am not in that big of a rush. Shipping would probably be another week as well. Thanks for providing us with them btw.

Offline The_Ed

  • Thread Starter
  • Posts: 1350
  • Location: MN - USA
  • Asperger's... SQUIRREL! I'm Anal Retentive *****!
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #144 on: Fri, 23 August 2013, 03:26:49 »
Alright, something I thought would be easy is proving quite difficult... Because there were "Virtual-Key Codes" I thought it would be quite easy to send them to the computer to get stuff like VK_BROWSER_BACK and VK_BROWSER_FORWARD since the teensy and arduino code libraries didn't seem to have those 2. But my searching is proving just as futile as horizontal scrolling... Am I just being stupid?

EDIT: It also looks like I may not be able to use Motion_Burst on the teensy 3.0 (though it looks like it'll work fine on an Arduino Due...).
« Last Edit: Fri, 23 August 2013, 04:02:04 by The_Ed »
Reaper "frelled" me... Twice... Did he "frell" you too?... *brohug*
I'm camping for a week, and moving twice in a month. I'll get back to you when I can (If I don't then just send me another PM).
R.I.P.ster

Offline meowbots

  • Posts: 7
The newest FW should also fix the smoothing/lag issue.

What is the lag issue that you speak of? I'm trying to find ways to make this sensor as accurate as possible, and wondering if I should concern myself with getting the latest firmware.

Offline The_Ed

  • Thread Starter
  • Posts: 1350
  • Location: MN - USA
  • Asperger's... SQUIRREL! I'm Anal Retentive *****!
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #146 on: Fri, 23 August 2013, 18:03:05 »
So it looks like there are 4 problems that need to be addressed so far:
#1 - Mounting the ADNS-9800's to the ball sockets of the Microsoft Trackball Opticals.
#2 - Forward and Backward buttons.
#3 - Receiving the multiple Motion_Burst response bytes.
#4 - Scrolling horizontally

In more depth:
#1 - I can't figure out how to attach them to each other... I think a part will have to be 3D printed, but I have no idea how to 3D model. I'll need help with this one, unless my Dad can pull off another hardware store miracle.
#2 - Because there were "Virtual-Key Codes" I thought it would be quite easy to send them to the computer to get stuff like VK_BROWSER_BACK and VK_BROWSER_FORWARD since the teensy and arduino code libraries didn't seem to have those 2, but so far I haven't been able to figure out how to send Virtual-Key Codes to the computer with arduinos. Being able to use anything defined in the Virtual-Key Codes would mean that volume and media keys would also be mappable.
#3 - SPI.transfer(val) sends and receives a single byte. The Motion_Burst of the ADNS-9800's sends back 14 bytes, and it looks like only the Arduino Due and its SPI_CONTINUE can read those subsequent 13 bytes. I need to be able to read the first 6 bytes of Motion_Burst for it to be used as a more efficient and precise method than John's. Otherwise I'll just have to use John's method of reading REG_Delta_X_L and REG_Delta_Y_L (which takes longer than Motion_Burst) and hope I don't move the ball faster than 127 counts/pixels per millisecond (the limit of precise movement without reading the upper 8 bits of X and Y).
#4 - Scrolling horizontally seems similar to #2 in that there are codes for it, but I can't figure out how to send them to the computer with arduinos. (It should be pointed out that both vertical and horizontal scrolling, and mouse movement are not defined in the "Virtual-Key Codes").

It seems like I may have to have a driver of sorts running on the computer for #2 and #4...
Reaper "frelled" me... Twice... Did he "frell" you too?... *brohug*
I'm camping for a week, and moving twice in a month. I'll get back to you when I can (If I don't then just send me another PM).
R.I.P.ster

Offline MrJohnK

  • Posts: 15
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #147 on: Fri, 23 August 2013, 23:36:12 »
I believe you can still use Motion Burst Read.  While it returns a variety of bytes, you would only read 1 byte per transaction if I'm understanding that right.  Motion burst mode saves time since you don't have to tell the chip what you want to read, then read it.  You just tell it you want this burst mode, then execute multiple reads, one right after the other without specifying what you want to read.  So, you read from the Motion_Burst register, then do multiple subsequent reads to obtain multiple bytes of data representing Motion, Observation, Delta_X_L, Delta_X_H, Delta_Y_L, Delta_Y_H, Pixel Statistic, Shutter and Frame period.  Of course, you can just pull NCS high after the first four reads to cancel the operation since you already have what you are looking for.

Also, for special key sequences that are not part of Teesyduino (http://www.pjrc.com/teensy/teensyduino.html), you might email Paul Stoffregen at PJRC and have him add it to the standard HID USB profile (http://www.pjrc.com/teensy/td_keyboard.html).  He is usually pretty accommodating, so I've found.

Not sure how to help, but I have a CAD system and a 3D printer.  Without the actual mouse being retrofitted, hard to say how I can help though.

-John


Offline MrJohnK

  • Posts: 15
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #148 on: Fri, 23 August 2013, 23:58:16 »
After re-evaluating what I said, and looking at the Motion_Burst data bytes, you would pull NCS high after six subsequent reads to get both high and low of the X & Y registries.  There are two other bytes presented before you get the motion data (Motion, Observation).

Alternatively, you could just read the high/low of each X and Y register, but of course, you would have to tell it what you want, then read the results for each byte of data that way.  So, that becomes eight seperate transactions verses seven using the Motion_Burst mode.

-John

Offline alaricljs

  • I be WOT'ing all day...
  • ** Moderator Emeritus
  • Posts: 3715
  • Location: NE US
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #149 on: Sat, 24 August 2013, 00:07:04 »
The interesting "Media" keys that are found on some keyboards and typically include mail, browser and a few other interesting things actually require an endpoint of their own.

Pretty sure this a chunk of that support out of hasu's tmk

Not sure if there's anything like that with pointing devices that have a ton of extra buttons and things.
Filco w/ Imsto thick PBT
Ducky 1087XM PCB+Plate, w/ Matias "Quiet Click" spring-swapped w/ XM Greens