Assignment 7 -- Input Devices -- Drawing A Box!

(Or, my attempts at building a laser scanner, )

Introduction:

    This week, I thought it would be fun to try to implement an idea I had for a laser scanner, using some parts I picked up here an there.    Neil's lecture extolled the virtues of the tiny45, so I got geeked about that.    I was less geeked about ordering a FDTI cable, so I thought I would look at using software USB support.   How hard could it be?

The board and reference design:

   I did a quick scan of USB on the tiny45 and analog I/O.    I came across this project for a 5 pound oscilloscope.   Looked like a good place to start.   I relaid out the board to use surface mount components, and to incorporate the connector.    The board can be seen here:
board layout
   Too bad it is all about windows software.   I thought, I'll just rewrite it!    How hard can it be to get some USB drivers running.   How long could it take?    (Ans: 4 days, ugh...)

USB on a little processor that wasn't meant to run it:


    Has multiple modes and endpoints.   The protocol tends to be complex.    You typically need software on both ends of the link to make it work.
    The USB code I used is based on the V-USB project.
    I looked at:
Notes:

The Scanner:

scan boxscan toy
  Overview:
       A small industrial laser scanner sits to the side of a rotary table.    The object is placed in the middle of the table.    With each read command from the host PC, the tiny45 reads the laser range information, and increments the motor -- placing the packets on a usb port.     After about 16000 readings, the perimeter of the object is digitized (hopefully).   The host PC then translated the polar coordinate data to X-Y coordinate data.
 measuring
   Was built out of a flea-market industrial laser scanner for measureinike bottle caps being mis-seated, or too thick of paper going into a printing press.    It appears to shoot a HeNe spot on the object and has an active range of about 2-6 inches.    The output I used was a 4-20mA current loop output, which I hung a 240 ohm resistor across and hooked to the ADC pins.    The maximum observed output was about 300-2500 counts on the ADC,  when the target is out of range the reading drops to below 200.   

   The rotary table is out of a piece of semiconductor test equipment, and is driven by a stepper motor.    The motor is driven by an Intelligent Motion Systems IB463 stepper driver.    The tiny45 toggles the step_clock input and the motor moves one step.    With the gearbox and belt, the table has quite a bit of power, and operates smoothly.    About 16000 steps appear to make a revolution.

tiny45 running the show!

Results:  

   Since nothing was calibrated, I think it is quite impressive that the plot basically has four sides.   Knowing the number of steps per revolution, and knowing how the sensor output corresponds to the physical range would probably improve the output.
box_picture

Other: