Saturday, January 29, 2011

Sensor installed in frame, R2 is seeing data!

This afternoon I relented a bit and made the changes on the original frame for this bracket to work on.  I really, really want to see this sensor working!

In order for it to work, I had to bore out the hole in the top frame ring.  The newer frame already has a properly sized hole to accommodate the slip ring electrical connector.  In the old frame, we aren't going to mount the slip ring to it, but we need that hole there so that the bottom piece of it.  This way the all the wiring can pass thru.

I had to drill the hole with the frame ring mounted in place.  First, it wouldn't fit under the drill press.  Second, to remove it would require removing the skins, which would require a lot more things to be removed, such as the legs and so on.  What I did do was use some old t-shirts I have to cover everything below.  We do not want aluminum debris showering down on all the electronics.


 After carefully wiping the aluminum debris off, I wrapped up that t-shirt and tossed it in the trash, then replaced it with another.  

Next up was taking the aluminum bracket piece, marking, center punching and drilling out the holes.  Since the frame piece it is going onto is so thick, I am drill with a 3/32 drill bit then tapping a 4-40 thread into it.








Next up was the lexan piece that the Softpot sensor would adhere to.  I did some initial measurements and it became clear to me that I would want to add a second piece of lexan in there.  With two identical pieces, the height would be just right for the stylus piece to make contact.

I clamped the lexan pieces together and drilled a hole on each side and into the aluminum bracket.  The lexan pieces were drilled again with a 1/8th inch bit and the top piece countersunk for a flush mounting.  The holes made in the bracket were threaded to 4-40.  Once tapped, the lexan mount was secured into place.




The next step was sticking the Softpot onto the Lexan.  
Using the slip ring as a guide, I removed the paper backing and slowing lined up front to the center front of the frame.  It needs to be centered well for the stylus to track around it, much like a stylus does on a record player!







Now a real fun challenge!
The stylus for the Softpot is METRIC.  I do not have ANY metric drill bits or taps.  The best I could do was approximate the 6mm threaded stylus into Imperial.  I checked a few references online and found 15/64 is very, very close.  However, the closest I had was 7/32 and 1/4.  7/32 was a tad too small and 1/4 was a smidge too large.  So, we went with 1/4!




As luck would have it, I could not find anything thinner for a 6mm nut.  I did find a piece that would allow it to thread thru for additional support under the dome ring.  Set up the way it is, I can adjust the height the stylus is set to by holding the nut and turning it with a (blade) screwdriver.  Again, like with most things in the project, it isn't perfect and I am sure it will be refined again and again!


The stylus has a spring loaded plastic nub to make contact with the poteniometer.  As the stylus goes around the piece, the voltage value changes.  The ServoCenter card receives this analog data in 8-bit and 10-bit streams.  



The big moment!  Plugging R2-D2 into the computer and seeing the data come in...


And it works....in the red rectangle, the values change for ADC0 as the dome is rotated around.  Several things will have to be adjusted for in the software as the values are reading in reverse.  I also need to trim the values some so that a zero value can be dead center.  These aren't hard to fix, it will just take some trial and error to get right.




So another hurdle leaped!  Next up....writing the software code to establish the position of the dome and moving it around under computer control.