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

0 Members and 1 Guest are viewing this topic.

Offline Bullveyr

  • Posts: 386
  • Location: Austria
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #150 on: Sat, 24 August 2013, 08:26:20 »
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.

Iirc first 9800 were a bit laggy (not as direct) because there was quite some smoothing which was corrected with newer FWs.
Quote from: ripster;185750
Mechanical switches are mechanical.

Offline MrJohnK

  • Posts: 15
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #151 on: Sat, 24 August 2013, 10:05:22 »
In order to further the understanding of how to interact with this chip and solve the riddle of why it is 14 bits of data instead of 16.  When interacting with the chip over the SPI bus, the most significant bit ("MSB") is set to either 0 or 1 to indicate read or write respectively.  So, there are only 7 bits of real data that are sent in addition to the read/write indicator.  All transactions are pushing or pulling one byte of data over the SPI bus.  The data received from the chip (after requesting a read operation) also only has 7 bits since it comes as 2's complement formatted and the MSB is the sign bit.  Hope that helps.

-John

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 #152 on: Sat, 24 August 2013, 21:13:47 »
Alright, I have been looking into SPI a little more, and I think problem #3 is no longer an issue. It looks like Arduino and Teensy implement SPI differently. I was obviously looking at the Arduino pages, and because of that I thought there was a problem. In Arduino SPI controls the SS pin, while in Teensy you have to manually control the SS pin. Therefore there *shouldn't* be a problem reading 14 bytes in succession on a Teensy (or an Arduino Due with its SPI_CONTINUE).

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.

I'll look into this later when I have more time.

EDIT:

Ed,

your trackball project is fascinating. I have a related question about the 9800:
As you might have read in Bullveyrs post on page 3 in your thread, the 9800 has acceleration issues of about 5 % in the form of a sinus curve. See here for a graphic: http://www.teamliquid.net/forum/viewpost.php?post_id=18189604
Do you have any idea where this acceleration could come from? From the firmware running on the 9800 itself or from the firmware running on the Teensy 3.0?

Patrick

There is absolutely NO acceleration from the Teensy 3.0, any acceleration would be from the ADNS-9800 itself (if there truly is any, ESPECIALLY with the current A6 firmware).

EDIT2:

Las time I measured, there was acceleration. This wasn’t with the latest firmware, but as was posted by Bullveyr, this acceleration is likely unfixable.
I was thinking maybe one could use the computing power of the Teensy 3.0 to process the flawed data the sensor outputs. But that would be quite difficult, I’d guess.

You do realize that these graphs you linked show that there is NO acceleration right? It shows that there is an error margin in the sensing of distance moved, and the poster even points that out... Acceleration can be linear, a curve, exponential, or even stepped. None of those apply to the graphs because it is purely an error margin WITHOUT any acceleration.

To correct the error margin with math on the teensy would assume that every sensor's error margin at every speed was exactly the same. That is impossible, thus to correct the error margin you would have to get the graph of your specific sensor and calculate the math for it.

If you still don't like the ADNS-9800 sensor because of what you've read, then don't use it. But just realize that EVERY sensor has an error margin, which means that every mouse does too.

Show Image
Show Image


BTW, these questions belong in the thread and not my inbox.
« Last Edit: Sun, 25 August 2013, 04:10:26 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 Bullveyr

  • Posts: 386
  • Location: Austria
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #153 on: Sun, 25 August 2013, 05:26:04 »
It is correct that it's not really common acceleration but inconsistent CPI. The thing is that if you take slow movement as a base there is more inconsistency on the positive side if you more an A9500/9800 faster.
So in a gaming environment it results in positive acceleration in the sense that if you move the mouse faster your cursor moves a farther distance than if moved slowly.

This inconsistency isn't predictable enough to correct it on a MCU or software level without the movement "feeling wrong".

Anyone know what an ADNS-9818 model is?  My guess is it is the same as the ADNS-9800, but just a specific part number for a manufacturer as it seems to have the same specs as far as I can tell.

I think the "ADNS-9818"/"ADNS-S9818" are just typos that have been perpetuated throughout the internet... That happens quite often as people are too lazy to do research on what they are reporting on or reviewing. They just copy, paste, add some comments, annnd done.
S9818 is Razers special version of the ADNS-9800. Razer and Logitech usually have special versions of Avago (now PixArt) sensor.
Quote from: ripster;185750
Mechanical switches are mechanical.

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 #154 on: Sun, 25 August 2013, 10:27:16 »
The overall curve goes upward, the picture of the Xai shows this more clearly.

I don’t like the ADNS-9800 not only for what I read, but for what I measured, too: I measured an ADNS 3090 at 1 % maximum deviation/acceleration. I did the same for the ADNS 9500 of the Sensei and got 5-7 %.

Sorry for taking this to your inbox. I’ll stop now! ;)

BTW: If you were to math away the acceleration of the 9x00, they would name whole forums after you …

The curve does NOT go upward for either the XAI or the G9X. If you look at 0.75m/s-3m/s you'll see that it is perfectly flat for both of them. The line does NOT show any of the types of acceleration (linear/curve/exponential/stepped). Sensors are *usually* the most inaccurate/unpredictable when sensing at slow speeds, so the erratic error margin below 0.75m/s is normal. The error margin simply stabilizes its form after 0.75m/s and becomes quite predictable.

It sounds like the ADNS-3090 is the perfect sensor for your OCD then. But my thread is about the ADNS-9800 breakout boards and everything related to them, NOT about comparing the ADNS-9800 to other sensors on the market.

Start replying in my thread then...

Again, it's NOT acceleration! And as I have just said, you would have to get the data from your specific sensor for math to do any good as every sensor that has ever been manufactured will have its own unique error margin. If I did the math for my ADNS-9800 to get 0% error margin, you would still have an error margin with your ADNS-9800 using that same math.

Oh ****, I need to get going, why am I still on GH?

EDIT: Still PMing me... And that link is to teamliquid's definition of acceleration, which has absolutely no bearing on my trackball project... I don't understand his agenda...

Ed,

I define it as acceleration. I know it’s a dirty definition, but that’s how people call it. Do you know this thread? http://www.teamliquid.net/forum/viewmessage.php?topic_id=333648#i-iii
Maybe it helps you with your project. :)

Patrick
« Last Edit: Sun, 25 August 2013, 16:01: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
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #155 on: Mon, 26 August 2013, 07:48:25 »
Iirc first 9800 were a bit laggy (not as direct) because there was quite some smoothing which was corrected with newer FWs.

Would you mind sending them my way? I'd like to try all the options before going down the road of making my own absolute encoder with this thing, but I'm pretty convinced now that I'll need to in order to get the accuracy I want.

Thanks

Offline Bullveyr

  • Posts: 386
  • Location: Austria
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #156 on: Mon, 26 August 2013, 08:16:09 »
I would if I had the FWs.
Quote from: ripster;185750
Mechanical switches are mechanical.

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 #157 on: Mon, 26 August 2013, 19:04:59 »
I just found this, and it gives me hope.

Quote
1.3 Mousekey

KC_MS_U, KC_MS_D, KC_MS_L, KC_MS_R for mouse cursor
KC_WH_U, KC_WH_D, KC_WH_L, KC_WH_R for mouse wheel
KC_BTN1, KC_BTN2, KC_BTN3, KC_BTN4, KC_BTN5 for mouse buttons

1.4 System & Media key

KC_PWR, KC_SLEP, KC_WAKE for Power, Sleep, Wake
KC_MUTE, KC_VOLU, KC_VOLD for audio volume control
KC_MNXT, KC_MPRV, KC_MSTP, KC_MPLY, KC_MSEL for media control
KC_MAIL, KC_CALC, KC_MYCM for application launch
KC_WSCH, KC_WHOM, KC_WBAK, KC_WFWD, KC_WSTP, KC_WREF, KC_WFAV for web browser operation

So if I can figure out the labyrinth that is hasu's tmk and incorporate the code, then only problem #1 will remain. Thanks for the link alaricljs!

Iirc first 9800 were a bit laggy (not as direct) because there was quite some smoothing which was corrected with newer FWs.

Would you mind sending them my way? I'd like to try all the options before going down the road of making my own absolute encoder with this thing, but I'm pretty convinced now that I'll need to in order to get the accuracy I want.

Thanks

I could send you the package of files (including firmwares A4, A5 (89), and A6) that John sent me.
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
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #158 on: Mon, 26 August 2013, 19:10:23 »
I could send you the package of files (including firmwares A4, A5 (89), and A6) that John sent me.

That would be great. Can you put them on dropbox and email me the link or something? I was thinking of emailing John, but I wasn't sure if he even had the newer ones.

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 #159 on: Mon, 26 August 2013, 19:18:17 »
I could send you the package of files (including firmwares A4, A5 (89), and A6) that John sent me.

That would be great. Can you put them on dropbox and email me the link or something? I was thinking of emailing John, but I wasn't sure if he even had the newer ones.

Just send me your email.

EDIT: Alright I sent it to your email.
« Last Edit: Mon, 26 August 2013, 20:16:21 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 #160 on: Tue, 27 August 2013, 07:03:02 »
Does anyone have a drawing of it, mainly the diameter and cc distance of the mounting holes? Overall diameter and height would be useful as well.

Offline meowbots

  • Posts: 7
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #161 on: Tue, 27 August 2013, 12:43:24 »
Here is my drawing in inches.

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 #162 on: Tue, 27 August 2013, 14:20:45 »
There are eagle files on John's github if that helps.

Incorporating hasu's tmk code (if it's even possible) looks to be an incredibly daunting task as there is a mountain of files... It looks like everything but profiles should be able to be pulled from them (if I can figure out how). He already has 32 layers of keymaps, so it should be possible to have some more variables to have multiple profiles that each have 32 layers (who would need that many?). Profiles are logical groupings of layers for specific programs or games, and it would be much easier to toggle say 3 profiles down the list than 12 layers to get to the keymap you want.

I think I'm going to be pessimistic and say it'll be November at the earliest now... It'll take a long time to get all the code together. Who would've thought it would be this much work to make code for mice/trackballs? It seemed like it would be so much easier at the beginning. But the further down the rabbit hole I go, the harder and larger it seems...
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 #163 on: Tue, 27 August 2013, 21:11:03 »
Here is my drawing in inches.

Thanks. I suppose it is decided then. If I start to make mounts made specifically for this pcb and sensor I might as well go with it.

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 #164 on: Thu, 29 August 2013, 14:49:59 »
Hasu's tmk code is a nightmare to figure out... It looks like I'll need to rip out keyboard, mouse, system, and consumer, and then figure out how to send the info to them that is not in a scanned key matrix format. I'm not even gonna try to rip the layers support out at this point, especially since that was planned for 1.1 anyway. But I believe that ball scroll, horizontal scroll, and an FPS button will still make it into 1.0 at this time. Somebody please correct me if I'm wrong about the keyboard/mouse/system/consumer part. I'm not a master programmer, but neither am I an incompetent rookie. I have just never coded for hardware before this project, it's a totally new experience. And I only have a little time here and there where I can sit down to write some code, solder some stuff, or sift through existing code because I don't know how to do something. This is very much a learning experience.
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 #165 on: Fri, 30 August 2013, 21:41:09 »
OK, so I *think* I have to make a custom USB device descriptor for the teensy 3.0 that declares the proper endpoints. Then I have to pass the proper info to them in the proper format for stuff to work with windows' standard drivers. So now I have to learn how to make a USB device descriptor and it's endpoints from scratch so that I can understand how they work. After I learn how they work I should be able to either copy the code I actually need from Hasu's TMK, or write my own from scratch because his looks WAY more complicated than anyone else's.

It looks like there are 16 endpoints in the teensy 3.0, and the USB spec maxes out at 32, so that's actually quite a lot for such a little chip.
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 #166 on: Fri, 30 August 2013, 22:03:20 »
I've not taken my Teensy 3.0 out of the box yet, but if it is like the 2.0, all the USB HID descriptors for a keyboard & mouse composite device are already done through the Teensyduino add-on software.  You would just select keyboard & mouse in the Arduino software and the Teensy shows up as that in the USB hub.

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 #167 on: Fri, 30 August 2013, 22:25:47 »
Those only have 3 buttons and vertical scrolling for mice, and no media or system keys for keyboard (like browser forward/backward). That is why so many people have had to modify them. Or are you saying that teensyduino is different now and includes support for 5 mouse buttons, vertical and horizontal scrolling, and media and system keys?
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 #168 on: Fri, 30 August 2013, 22:34:40 »
AFAIK, it is just three mouse buttons and scroll up/down in Teensyduino.  Wonder if LUFA has the extra buttons...hmmm...or, if Paul would be willing to add those extras.  I think the horizontal scroll is copyright with Microsoft.  Not sure if that makes a difference in getting support for that or not.

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 #169 on: Fri, 30 August 2013, 22:41:46 »
Hasu's TMK, among others, have support for horizontal scrolling and the rest. So even if horizontal scrolling is copyrighted by microsoft, it is still possible to make it work. I'm not making and selling a commercial product, so microsoft can't sue me.
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 #170 on: Sat, 31 August 2013, 12:25:19 »
Could the functions you want to implement be done with keystrokes, like the F keys or something like that?  It isn't horizontal scrolling though.  Not exactly media keys, but certainly would avoid having to write your own USB stuff.  My trackball has 15 buttons that can do anything a Teensy can do, including any keystrokes or mouse functions.

The Teensyduino keymap is on this page (scroll down near bottom to see the chart):
http://www.pjrc.com/teensy/td_keyboard.html

Also, I see that Paul has the windows media keys on his ToDo list (see note right below the chart on the page).  Maybe some encouragement might help him to move this up on the priority list?

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 #171 on: Sat, 31 August 2013, 15:31:18 »
The mouse, media, and system keys I need are not in the standard arduino/teensyduino library files like I already said, which means I can't use them as is. That PJRC keymap is for just regular keyboard keys, and was one of the first things I looked at when I started this project. If Paul were to implement the keys I need he would still have the mouse and keyboard broken down into multiple functions instead of singular functions that I want and have seen examples of. In the future I will submit my altered files for Paul to integrate into the teensyduino library so that no-one else has to go through this nightmare again. (But right now I have to code them in the first place.)
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 #172 on: Mon, 02 September 2013, 10:43:29 »
Yay, avago sensor is back in stock. Thanks John

The_Ed, I am about to buy some parts. How certain is it that that you will use the teensy 3.0? I realize that you can never be certain, but by the looks of it your code will need it, correct?

Offline MrJohnK

  • Posts: 15
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #173 on: Mon, 02 September 2013, 12:27:21 »
I put only 4 sensors in the shop today, 2 sold already.  I have 62 more coming later this week.  My customer in Italy said that his order finally showed up this morning, so I could put the 4 I was hold for possible re-shipment up for sale.  Apparently, I had 13 people on the wait list since it went out of stock o.O

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 #174 on: Mon, 02 September 2013, 18:40:53 »
My code is for the teensy 3.0, it will NOT work with the 2.0 or ++ 2.0. It would have to be modified to work on anything other than the teensy 3.0, and I have no plans to do that at this time. But if a teensy++ 3.0 is released in the future I will probably support that.

Once the endpoint stuff is figured out and completed I will have 1.0 alpha to start debugging. Once alpha is refined I'll have beta (which I'll release to only a few people for testing). Once beta is refined I'll let the masses have access to RC (Release Candidate). When all the problems with RC have been resolved, the final 1.0 RTW (Release To Web) will be released. I have a feeling that 1.1 beta (which will be released to only a few people for testing) will come after 1.0 RC, but before 1.0 RTW. I have no plans for a 1.2 at this time.
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 ggaljoen

  • Posts: 1
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #175 on: Sat, 07 September 2013, 08:52:30 »
Found you 'Geeks'  :thumb: in the search for extra information.
Already got the specs for the sensor and lens, but did not found the mentioned STEP or EGIS files for the ADNS-6190-002, anyone?

My use would be for 3d printing filament tracking at the extruder. Received mine from Tindie.

Thank you MrJohnK for the sensor board and thank you The_Ed for feeding this thread!

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 #176 on: Sat, 07 September 2013, 15:11:27 »
Because of my harddrive issue and my car permanently dying I haven't had much time to look at code this past week. I have to go out used car shopping today...

I seem to be finding a lot of information on how to declare the endpoints in the USB device descriptor, but nothing really on how to actually send the data to them on an arduino... Can somebody point me in the right direction?
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 #177 on: Mon, 09 September 2013, 01:57:54 »
Ahhh ****... From what I think I understand from something I just read - The information I need for the teensy 3.0 endpoints and data transmission will be somewhere in a 1227 page datasheet from PJRC, and some code examples I have found will ONLY work on the teensy 2.0 because it does things differently apparently... But I need to use the teensy 3.0, so this ****in sucks...

This **** on endpoints is seriously hard to understand... If I can just get this endpoint stuff figured out I would finally be able to start testing and debugging, but information is just so damn elusive on the subject...

I have no idea how long it will take to complete my code at this point seeing as I'm pretty much on my own in figuring this stuff out. (How many hours have I spent trying to figure out endpoints?...) It would be awesome if someone could help me out with the teensy 3.0 endpoints and data transmission.
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 domoaligato

  • * Exquisite Elder
  • Posts: 1672
  • Location: USA
  • All your base are belong to us!
    • All your base are belong to us!
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #178 on: Wed, 11 September 2013, 16:29:55 »
have you tried asking on the pjrc forums? they are very helpful.
http://forum.pjrc.com/forums/2-Project-Guidance

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 #179 on: Wed, 11 September 2013, 16:36:33 »
The people that ask questions there usually already have their stuff completed, but just have some bugs somewhere. For them to be of help they would likely have to write out my endpoint stuff themselves... I don't know, maybe I'll ask for some references of how to do the endpoint stuff there when I have time to make an account and write down my situation.
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 #180 on: Thu, 12 September 2013, 12:52:27 »
It can't hurt. I'd ask myself, but I'm certainly not knowledgeable enough about such things to even do that.

Offline hanya

  • Posts: 132
  • Location: Japan
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #181 on: Fri, 13 September 2013, 13:02:22 »
I seem to be finding a lot of information on how to declare the endpoints in the USB device descriptor, but nothing really on how to actually send the data to them on an arduino... Can somebody point me in the right direction?
I have added forward/back buttons and horizontal wheel to arduino and mbed mouse libraries. I only needed to modify descriptor and data to be passed to the PC.
There is the documentation about how to define USB descriptor for the recent mouse by Microsoft[1].
"Device Class Definition HID" and "HID Usage Tables" are required to edit the descriptor[2].

I do not have teensy so I can not help to do it. But it seems "mouse_hid_report_desc" value  in arduino-version/hardware/teensy/cores/usb_hid/usb.c have to be hacked and also usb_mouse_class methods.

USBKeyboard class of mbed supports media control keys[3]. Its structure of the descriptor could be refered as an example.

[1] http://msdn.microsoft.com/en-us/windows/hardware/gg487477.aspx
[2] http://www.usb.org/developers/docs/hidpage/
[3] https://github.com/mbedmicro/mbed/blob/master/libraries/USBDevice/USBHID/USBKeyboard.cpp#L396
PFU HHKB JP, Sanwa MA-TB38 trackball

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 #182 on: Fri, 13 September 2013, 16:47:47 »
1 and 2 I have already found and been looking at. 3 I have not seen before, but it is just more descriptor data and not the sending of data from the teensy 3.0 to the computer. I appreciate that you took the time to make an account and post, but those links give me nothing that I need at this point.

I am currently going through chapter 40 of K20P64M50SF0RM.pdf, hopefully I'll find some useful info there. If the teensy 3.0 is anything like the 2.0, the endpoint data transmission will be controlled with registers.
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 hanya

  • Posts: 132
  • Location: Japan
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #183 on: Sat, 14 September 2013, 02:06:16 »
As an example to add five button support and horizontal scrolling, here is the patch for Arduino:
Code: [Select]
--- arduino-1.0.5 (2)/hardware/arduino/cores/arduino/USBAPI.h 2013-05-18 04:48:38.000000000 +0900
+++ arduino-1.0.5/hardware/arduino/cores/arduino/USBAPI.h 2013-09-05 18:02:41.530330129 +0900
@@ -52,6 +52,8 @@
 #define MOUSE_RIGHT 2
 #define MOUSE_MIDDLE 4
 #define MOUSE_ALL (MOUSE_LEFT | MOUSE_RIGHT | MOUSE_MIDDLE)
+#define MOUSE_BACK 8
+#define MOUSE_FORWARD 16
 
 class Mouse_
 {
@@ -63,7 +65,7 @@
  void begin(void);
  void end(void);
  void click(uint8_t b = MOUSE_LEFT);
- void move(signed char x, signed char y, signed char wheel = 0);
+ void move(signed char x, signed char y, signed char wheel = 0, signed char pan = 0);
  void press(uint8_t b = MOUSE_LEFT); // press LEFT by default
  void release(uint8_t b = MOUSE_LEFT); // release LEFT by default
  bool isPressed(uint8_t b = MOUSE_LEFT); // check LEFT by default

Code: [Select]
--- arduino-1.0.5 (2)/hardware/arduino/cores/arduino/HID.cpp 2013-05-18 04:48:38.000000000 +0900
+++ arduino-1.0.5/hardware/arduino/cores/arduino/HID.cpp 2013-09-05 20:20:40.945700558 +0900
@@ -55,14 +55,14 @@
     0x85, 0x01,                    //     REPORT_ID (1)
     0x05, 0x09,                    //     USAGE_PAGE (Button)
     0x19, 0x01,                    //     USAGE_MINIMUM (Button 1)
-    0x29, 0x03,                    //     USAGE_MAXIMUM (Button 3)
+    0x29, 0x05,                    //     USAGE_MAXIMUM (Button 5)
     0x15, 0x00,                    //     LOGICAL_MINIMUM (0)
     0x25, 0x01,                    //     LOGICAL_MAXIMUM (1)
-    0x95, 0x03,                    //     REPORT_COUNT (3)
+    0x95, 0x05,                    //     REPORT_COUNT (5)
     0x75, 0x01,                    //     REPORT_SIZE (1)
     0x81, 0x02,                    //     INPUT (Data,Var,Abs)
     0x95, 0x01,                    //     REPORT_COUNT (1)
-    0x75, 0x05,                    //     REPORT_SIZE (5)
+    0x75, 0x03,                    //     REPORT_SIZE (3)
     0x81, 0x03,                    //     INPUT (Cnst,Var,Abs)
     0x05, 0x01,                    //     USAGE_PAGE (Generic Desktop)
     0x09, 0x30,                    //     USAGE (X)
@@ -73,6 +73,15 @@
     0x75, 0x08,                    //     REPORT_SIZE (8)
     0x95, 0x03,                    //     REPORT_COUNT (3)
     0x81, 0x06,                    //     INPUT (Data,Var,Rel)
+   
+    0x05, 0x0c,                    //     USAGE_PAGE (Consumer Page)
+    0x0a, 0x38, 0x02,              //     USAGE (AC Pan)
+    0x15, 0x81,                    //     LOGICAL_MINIMUM (-127)
+    0x25, 0x7f,                    //     LOGICAL_MAXIMUM (127)
+    0x95, 0x01,                    //     REPORT_COUNT (1)
+    0x75, 0x08,                    //     REPORT_SIZE (8)
+    0x81, 0x06,                    //     INPUT (Data,Var,Rel)
+   
     0xc0,                          //   END_COLLECTION
     0xc0,                          // END_COLLECTION
 
@@ -221,14 +230,15 @@
  move(0,0,0);
 }
 
-void Mouse_::move(signed char x, signed char y, signed char wheel)
+void Mouse_::move(signed char x, signed char y, signed char wheel, signed char pan)
 {
- u8 m[4];
+ u8 m[5];
  m[0] = _buttons;
  m[1] = x;
  m[2] = y;
  m[3] = wheel;
- HID_SendReport(1,m,4);
+    m[4] = pan;
+ HID_SendReport(1,m,5);
 }
 
 void Mouse_::buttons(uint8_t b)
PFU HHKB JP, Sanwa MA-TB38 trackball

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 #184 on: Sat, 14 September 2013, 05:14:35 »
The teensy's aren't regular arduinos... (they use different files in \hardware\teensy\cores\teensy3\) And the teensy 3.0 is different than the teensy 2.0, which means I can't just use existing code examples. The teensy's seem to use registers and buffers to send the data to the endpoints that are described, so I have to figure out what does what to get my data into the proper buffers and what register magic has to be done for data transmission. So the components are: the endpoint descriptors, enabling the endpoints, the keycodes, the endpoint buffers, and the endpoint register stuff for data transmission. I can't really use the existing mouse and keyboard endpoints for various reasons, which is why I have to make my own from scratch. And that's why I need to figure out how to send data on the teensy 3.0, which is proving quite complicated and difficult (and this is what I need help on).

(I hope I'm being clear enough...)
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 metalliqaz

  • * Maker
  • Posts: 4951
  • Location: the Making Stuff subforum
  • Leopold fanboy
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #185 on: Mon, 16 September 2013, 12:12:56 »
Have these been integrated into any successful projects yet?  I bought one to have in my 'kit', but I would love to see some finished products.

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 #186 on: Mon, 16 September 2013, 15:21:58 »
Have these been integrated into any successful projects yet?  I bought one to have in my 'kit', but I would love to see some finished products.

I know mr. kicklighter has modified his own trackball. I am planning on modding some of mine, but haven't gotten 'round to it yet.

Offline metalliqaz

  • * Maker
  • Posts: 4951
  • Location: the Making Stuff subforum
  • Leopold fanboy
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #187 on: Mon, 16 September 2013, 15:34:38 »
I'd really like to make something special.  I need to try a good trackball for a while to see how I like it.  I wonder if there is anyone out there that is gaming with a trackball...

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 #188 on: Mon, 16 September 2013, 15:52:47 »
If I can figure out this endpoint stuff it will become MUCH easier for people to add their own, or modify the existing ones. I haven't had time to finish reading chapter 40 yet, but my quarter will be done in like 2 weeks so I'll have some time then. I think I will only need 3 endpoints now (down from 4) because of some other code I've seen. EVENTUALLY this project will get further, but time has to allow.

I used to game all the time with my Dad's Microsoft Trackball Optical, it's just that today's monitor resolutions are too big for it's old optical sensor.
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 #189 on: Mon, 16 September 2013, 16:48:24 »
I'd really like to make something special.  I need to try a good trackball for a while to see how I like it.  I wonder if there is anyone out there that is gaming with a trackball...
Well, I highly recommend getting a "good" trackball with actual ball bearings. there are some new penny&giles units on ebay that the seller will let you have for $25 shipped that are very nice with their ball bearings. You will need to make an enclosure for them, however. I have a few trackballs with "good' bearings (assimilation, kensington (turbo mouse, none of this lame new stuff), penny& giles, itac, etc.) and it's much more worthwhile converting one of these than a trackball with lesser quality bearings (CST, newer kensington, basically everything)

Keep in mind that us microproducts now owns the penny&giles trackball line, and they have been branded as saic, traxsys, and another oem that I'm forgetting, could be trackerball. These are all very nice.

danaher (dynapar) trackballs are hit& miss. Mine is probably the worst trackball I own, as it sits on "plastic dots".

Finally, the feel of the trackball is greatly impacted by the quality of the ball. I strongly recommend gettign a new ball if you can. Pool balls are cheap and easy to get if your trackball supports the size.

Offline metalliqaz

  • * Maker
  • Posts: 4951
  • Location: the Making Stuff subforum
  • Leopold fanboy
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #190 on: Mon, 16 September 2013, 17:15:03 »
Wow that would be a huge trackball!  I've never seen something that size except on an arcade cabinet.

The problem with using a trackball for gaming is the fact that fingers you would normally be using to press buttons are used for moving the ball.

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 #191 on: Mon, 16 September 2013, 17:28:18 »
That's why you use thumb operated trackballs for gaming (like the Microsoft Trackball Optical). Though I think having a pool ball sized thumb operated trackball would be too big.
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 #192 on: Mon, 16 September 2013, 22:54:29 »
Quote
Have these been integrated into any successful projects yet?  I bought one to have in my 'kit', but I would love to see some finished products.
Quote
I know mr. kicklighter has modified his own trackball. I am planning on modding some of mine, but haven't gotten 'round to it yet.

To be exact, I designed and 3D printed my trackball.  Some pictures:
http://www.flickr.com/photos/8465641@N07/sets/72157633258917941/

I'm really interested in seeing how a good trackball mod on an existing commercial trackball body comes out.  When I started looking at the clearances inside of my old Trackman, it didn't look like there would be enough room to fit the better sensor in there, which is why I just designed a whole new trackball body from scratch.  This 3D printed one is my daily use trackball now.  It does really well for CAD work and gaming (I'm a recovering WoW addict). 

Some ball bearing would be nice indeed.  I just have three small set screws holding the Delrin ball in mine up.  I used those so that I could exactly dial-in the distance between the ball and sensor as it has a pretty specific distance it works well at (2.4mm) and has tolerance of only +/- 0.2mm.  Outside of that tolerance, it has issues and does not work so well.  It is great when tuned right though.

-John

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 #193 on: Tue, 17 September 2013, 03:19:03 »
I *may* have made a breakthrough on the endpoint stuff! But I likely won't be able to write the code and test it until after the quarter is over in 2 more weeks... I really hope this stuff works as it would be cool if I was able to figure it out by myself. But there will most likely be a few errors here and there, so I still may have to ask for help at PJRC. But I would feel a lot better asking for help with wrong code in places than no code in places.

But I still have this feeling that the buffers and offsets are gonna cause me more trouble... Though I wont know until I try.

EDIT: Alright, I think I have an even better grasp of the buffers and offsets now (my head hurts...). Here's to hoping I'll have 1.0 alpha completed within a month (because of school).
« Last Edit: Wed, 18 September 2013, 00:05:41 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 *****!
Re: High Speed Laser Optical Sensor (Avago ADNS-9800) [$28 shipped - DONE]
« Reply #194 on: Mon, 23 September 2013, 17:37:22 »
Alright, so here's another small update: (Yes, I'm neglecting my homework during finals week...)

1. It *may* support smooth scrolling that's adjustable while powered on (at least down to 1/4 of a notch, but *maybe* down to 1/120 of a notch)
2. It *may* be possible to send both the upper and lower bytes of X and Y movement (if it isn't possible, then the excess over ±127 just has to be shaved off and added to the next report)
3. If either/both of these make it into the code, the mouse will likely not work in the BIOS. The culprits responsible for that will be the Report IDs required to send the feature report for smooth scrolling, and the 2-byte mouse movement (so you'll have to comment out/in parts if you need it to work in the BIOS)
4. Horizontal and smooth scrolling are supported by Vista and up, so If you're using XP or lower you'll also have to play the commenting game.
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 #195 on: Mon, 23 September 2013, 17:48:42 »
3. If either/both of these make it into the code, the mouse will likely not work in the BIOS. The culprits responsible for that will be the Report IDs required to send the feature report for smooth scrolling, and the 2-byte mouse movement (so you'll have to comment out/in parts if you need it to work in the BIOS)
I don't think any of my pointing devices work in any of my BIOS's, or will this affect EFT / UEFI compatibility?

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 #196 on: Mon, 23 September 2013, 18:08:56 »
3. If either/both of these make it into the code, the mouse will likely not work in the BIOS. The culprits responsible for that will be the Report IDs required to send the feature report for smooth scrolling, and the 2-byte mouse movement (so you'll have to comment out/in parts if you need it to work in the BIOS)
I don't think any of my pointing devices work in any of my BIOS's, or will this affect EFT / UEFI compatibility?


I don't know for sure, just that the document said it wouldn't work.
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 #197 on: Wed, 25 September 2013, 12:24:30 »
Just got the sensor. Is the lens supposed to be loose? I don't get how you mount it so that it stays in place. There are pins which roughly positions the lens in front of the sensor and LED but I would have assumed that positioning the lens requires some precision. Are you supposed to mount it so that the lens is held firmly against the PCB or glue the pins on the other side? If I only put the lens in place, it will fall down when I turn it upside down. This worries me a bit.

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 #198 on: Wed, 25 September 2013, 13:32:17 »
I *think* the lens is supposed to be held firmly against the laser sensor pcb, and then the resulting assembly needs to be held firmly against the ball socket/bottom of the mouse (with the proper liftoff distance set).
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 #199 on: Thu, 26 September 2013, 19:56:11 »
The lens is designed to be mounted on the inside of a mouse or under the socket of a trackball such that the super structure holds it in place.  If you need to have it dangling with no support, you can "stake" the plastic pins with a soldering iron once they are in place above the chip.  Essentially, making a sort of mushroom top shape out of the alignment pins so that the lens is no longer removable.

-John