Shop OBEX P1 Docs P2 Docs Learn Events
DIY motor feedback from mouse parts. - Page 2 — Parallax Forums

DIY motor feedback from mouse parts.

2»

Comments

  • agfaagfa Posts: 295
    edited 2012-10-21 06:15
    I don't know if the labels I used are correct. It may be the collector instead of the emitter. I looked through some of my other projects. I did try it with a mouse wheel in interupter mode and quadrature output with the resistor values in the schematic I posted at 3.3v and I could not get consistant results. I think you should be able to adjust the values to correct for that though. I tested the outputs first with a scope, but I think you could do it with a meter. Because I had to play with the alignment of the IR pair, the final testing was done with the microcontroller. I was using the propeller. You do not have to do the test in a dark room, but If I remember correctly sunlight will interfere.

    I've posted a pic of the project. You had mentioned having trouble drilling the mouse wheel. I found a mouse that had the encoder wheel pressed onto a metal shaft which made drilling out to the final size much easier. Someone else mentioned instead of drilling it out, if it has a molded plastic shaft you could use some brass tubing and couple it.
    461 x 308 - 39K
  • agfaagfa Posts: 295
    edited 2012-10-21 06:24
    I found the schematic for the quadrature encoder that I described. Once again with the values I have it did not work consistantly at 3.3v.

    Edit: It might be more correct to say that I could not get it to work consistantly at 3.3v. I designed the circuit for 5v operation but had inadverdently connected the IR side to 3.3v by mistake. The schematic may work at 3.3v if the 556 was also driven at 3.3v. I also apologize if I caused any confusion by misslabeling the transistor. I labeled that way just so that I could wrap my head around the polarity needs of the circuit.
    1024 x 1320 - 108K
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-10-21 15:34
    well gull darn i just started scrapping dome newer optical mice for the flow sensor and they have these nice mechanical rotary encoders connected to th scroll wheel. the encoders even have a hole in the center to stick a shaft in them. could something like this be used as a tach maybe theres some way to rig two on an axel for a quadrature encoder setup?
  • agfaagfa Posts: 295
    edited 2012-10-21 16:34
    They could be used as a tach or you could just use the quadrature output they're capable of. Another encoder/tach method you might consider is hall effect.
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-10-21 18:31
    oh wow they put out a full quadrature signal? if my motor doesnt spin so hard it breaks the encoder maybe ill just use the mechanical ones instead seems alot easier less pieces to fuss with. im assuming motors usually use optical encoder becuase they dont wear out or put as much load on the shaft. not a bad way to spend nine bucks you get an encoder and optical flow sensor.

    ive looked into hall sensors they also seem like alot less fuss but i dont want to screw the balace up woth a magnet. i just havent seen a system using a mechanical encoder im wondering what the reason is
  • agfaagfa Posts: 295
    edited 2012-10-21 18:44
    Might be easiest to buy a motor with an encoder. I was extremely pleased with a couple of Faulhaber motors I found at electronics goldmine. http://www.goldmine-elec-products.com/prodinfo.asp?number=G16279

    They run them for 8 or 9 bucks on a regular basis.

    Sounds like your looking for something bigger though. Take a look on eBay.

    Edit: I see you mentioned a mechanical encoder. I've actually tried to make tachs using switch contacts. It was a nightmare, switch bounce, contact ware, and constant adjustment. It was a bad idea.
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-10-21 21:56
    youve used these before? the ddescription says the extra slots may be for an encoder, id just like some verification on that. do you know if its a built in hall sensor wheel encoder or what. i think 4 of these would definately be awesome for a smaller medium sized bot. how much weight have you pit on them and gotten reasonable speed? im really intrested in using these

    also i think you may be getting what i said confused. the mice i got have a scroll wheel on a shaft. that shaft fits inside of some kind of mechanical rotary encoder, looks like a pot where someone removed the knob and left a hole through the center. would this make a good tak, is it quadrature? im not ripping these these mice boards up till ive fully studied them with a dmm and analyzer:). like the whole scroll wheel assembly could make a good caster wheel and has this mechanical contious rotaion encoder already fitted to the axel!
  • agfaagfa Posts: 295
    edited 2012-10-22 04:45
    I've used them. I didn't catch that detail about "may be for an encoder". Sorry. That is the same item # that I ordered, but at the time they advertised them as having encoders. The motors I have definetely have quadrature output encoders. So I don't know. I looked on eBay and saw lots of motors in the $20.00 range that had built on encoders. I used them on a small light weight bot. I ran the motors at 6 volts and they were not what I would call fast. I don't know what kind of technology the encoders used, wheather optical, hall effect, or what. I just know they output a nice clean square quadrature signal that was very usable. I will post a video of the bot in action and you can be the judge.

    I may be confused. Surely wouldn't be the first time. The mice (mouses) that I've broken down had scroll wheel encoders, just as you describe, that output quadrature. I may be wrong, but I always thought they were mechanical, as in switch contacts. I never thought of them as a viable option for motor encoders. Don't let my opinion keep you from trying an idea though.

    This is a link to the thread I started that has video links.

    http://forums.parallax.com/showthread.php?122480-Attempt-at-triangulation

    I called it woodbot because it had a wood frame as well as wood wheels. Keep in mind, as far as how fast the motors are running, that I never ran them more than 70% of their capable speed at 6v.
  • RobotWorkshopRobotWorkshop Posts: 2,307
    edited 2012-10-22 08:16
    Ok this is just ridculousness!! Although the concept of reading a light freakin flashing on and off is a very simple concept, loopy is right destroying a mouse and recyling its parts to make a quadrature encoder is not easy, electrically or mechanically, small plastic pieces and undocumented semiconductors is a PITA. So im going to scrap this whole idea of using a mouse. For now im going to DIY an encoder the idea is to use the brass hub I showed in the first post with two vishay slot interrupters. There are 8 holes in each hub, with two interrupters this should work for quadrature data correct? The reason I ask is because the wheels posted early showed and 8 posisiton wheel and said it wouldn't work for quadrature data.

    Using the mouse sensors shouldn't be that difficult. That being said, there are many different brands of mice and some may be easier than others. The microsoft mice should be ok as well as the logitech mice that were often branded under the Compaq label. Try to get all the same brand/version and a couple spares. You should be able to get them very cheap from Craigslist, or even computer recyclers.

    For quadrature encoders it is ideal to have equal spacing of the open/closed sections where the light will pass through. The wheel you showed with 8 holes looks close enough and should work ok. I believe we said it won't work with the sensor you showed with it since that sensor is setup for a different resolution (much finer) and won't give readings 90 degrees apart. You you use different sensors spaced 90 degrees apart then you can use that wheel.
    I have been looking at eventually upgrading too these and would like an opinion

    http://www.ebay.com/itm/Oak-Grigsby-900-400-Optical-Encoder-2-CH-Quadrature-Robotic-Hobby-CNC-Avail-Qty-/140868604833?pt=LH_DefaultDomain_0&hash=item20cc6c53a1

    t
    hey seem nice and are enclosed in steel so they aren gonna get dirt in them but im not sure if these are worth buying or not, most othere systems are in the 30-60 dollar range

    These are nice sensors and have picked up some of these on ebay. They are easy to use. Just make sure you test them if you buy them since many of those are pulls and I found some that were defective. The seller sent replacements so all was ok in the end. They are somewhat sealed and should keep most of the dust out. If you have them exposed to the elements in a very dusty environment then you may still get something in them. If your motors are primarily indoors it shouldn't be a problem. If it is exposed and outside in the desert then you may want to get extra's.
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2012-10-22 10:08
    Something also to keep in mind when reading pulses from an Encoder.... If you register every transition as a valid pulse you can effectively get twice the resolution from your encoder.


    Spin Code Example:
    CON
    
      _CLKMODE = XTAL1 + PLL16X
      _XINFREQ = 5_000_000
    
    OBJ
    
    PST :   "Parallax Serial Terminal"
    
    VAR
    
    long Stack1[100]
    
    long Acc1
    
    PUB MainDEMO
        PST.Start(19200)
        cognew(Tachometer(@Acc1),@stack1)
    
        repeat  
          PST.Dec(Acc1)
          PST.Char(13)
    
    '----------------------------------------------------------------------
    PUB Tachometer(Address)|Data,OldData
    
        dira[0]~                    'make sure P0 is an input
        dira[1]~~                   'make sure P1 is an output for DEBUG
        repeat
          Data := ina[0]
          !outa[1]                  'toggle P1 for DEBUG... loop runs at about 12.2kHz 
          if Data <> OldData
             LONG[Address] +=1
             OldData := Data
          else                      'This section mainly for DEBUG to add symmetry   
             LONG[Address] +=0
             OldData := OldData
    
    {{
    
    Note: Because the accumulator increments on every transition the resulting value will
          be twice the number of slots in the encoder wheel per revolution.
    
    }}
    
    
  • I have come across several references to people trying to use old mouse parts for their homebrew quadrature encoder projects, and it doesn't end up well. They said it's difficult to mechanically set it up, etc etc

    But I recently evaluated the Vex robotics shaft encoder. It works great and doesn't skip a single tick after thousands of rotations, jerk reversals and 30 min of high speed running time. Inside it's the same exact setup as a mechanical mouse, with the same type of fine slotted encoder wheel.

    There is the two pin photodiode and three pin receiver inside. Can anyone tell me where I can order these two parts? The old mechanical mice are no longer available. And the newer photodiode setup on the thumbwheel of newer mice uses a different pitch encoder wheel, so I worry the sensors might be different as well.

    I scanned this forum and saw other types of photoparts, but not the ones actually used in the mechanical mice that I have seen.
Sign In or Register to comment.