An update from this weekend.
I had originally ordered this rotary encoder
https://www.robotshop.com/en/6mm-rotary-encoder-1024-p-r.htmlFor some reason the order failed to go through so I ended up ordering this one from Amazon. It's half the resolution but I just needed it for testing.
https://www.amazon.com/Signswise-Incremental-Encoder-Dc5-24v-Voltage/dp/B00UTIFCVA/ref=sr_1_1?s=hi&ie=UTF8&qid=1535373946&sr=8-1&keywords=Signswise+600&dpID=41%252BwuyVZcKL&preST=_SX300_QL70_&dpSrc=srchI tried to use this IO board assuming it would work with the encoder
https://numato.com/product/8-channel-usb-gpio-module-with-analog-inputsThe Numato GPIO isn't nearly fast enough to keep up with the encoder and it was skipping ticks (readings or whatever).
I had a Arduino Uno that I ordered for another project but never used. I've never used Arduino and just assumed it would be super slow. I mean how fast can a $11 microcontroller be? Well, a heck of a lot faster than the Numato GPIO it turns out.
I used a couple of 10k resistors used the digitalWriteFast library found at
https://code.google.com/archive/p/digitalwritefast/downloads and I was able to read every tick of the encoder without issue no matter how fast I turned it. I should have started off using the Arduino to begin with.
[/img][/img]
My next problem was trying to get a gear that matched my rack (20 pitch, 20 pressure angle) with a 6mm bore. I know nothing about gears and assumed this would be easy, it wasn't. Even finding a gear that fit the rack was ridiculously hard. There's way more options to how a gear fits to another gear or rack than I imagined. The only one I could find was on Amazon and it was out of stock. So I tried to order a gear from Grainger with a 20 pitch but a 14.5 pressure angle with an 8mm bore and hoped I could rig it up. Well, they sent the right box but the gear was wrong. I guess someone switch them or something so I was stuck.
I thought I have a CNC why not just make one? Well, this turned out to be REALLY hard because its not straight forward. I ended up finding the site
https://geargenerator.com/#200,200,100,6,1,0,0,4,1,8,2,4,27,-90,0,0,16,4,4,27,-60,1,1,12,1,12,20,-60,2,0,60,5,12,20,0,0,0,2,-563I paid the $2, downloaded the svg. Converted it to EPS and imported it into ArtCam and cut it out of 1/2" polycarbonate. This turned out perfect, I get 0.005" resolution with it. I should have done this begin with. It would have saved me $25 from Grainger and numerous hours of research. Hind-sight is 20/20 though.
So that's all I was able to do this weekend. I'm going to try and find time next weekend. I'm pretty busy at work these days.
Encoder Gear:
https://drive.google.com/open?id=1FmpiZ8SHy31yYGcKkz6RTFFB5bpI9Ockhttps://drive.google.com/open?id=1hm1z2rrhRfzgw8T3IWZb5HrzzyN9TS00