Automated Colored Balls Sorter Presented By : Mihir Daftari Ka Fai Ng Woo Jin Park
Project Description Objective Applications Papers Textiles Metals How does it work?
System Connections
C JPEG Compression VGA Camera Module Camera Details: Low-cost ($47) & low- powered (3.3V) and very small in size RS-232 interface: A wide range of baud rates ranging from 9600 to 115.2K bps for transferring images Built-in color conversion circuits for 4 gray/16 gray/256 gray/12-bit RGB/16-bit RGB images. Auto detect baud rate and make connection to the host
Camera operations and features On-board EEPROM provides a command-based interface to external host via RS-232. A RS-232 transceiver set-up has to be used as communication interface. The MAX3232CUE chip is used.
The command set
Command protocol to take an uncompressed snapshot
Sample picture taken at 640X480 resolution
Sample picture from the camera The picture is displayed using the MATLAB ‘ imshow ’ function. Details: Resolution: 80 x 60 Color type: 12 bit color 4 bits for Red, 4 bits for Green and 4 bits for Blue Total Size: 7200 bytes
Sample picture.. This is a picture taken of a red ball on a black background (a black binder here) This is the type of image that is expected to be seen in the project. Color detection algorithm will be run on this type of images. It takes less than 6 seconds to transfer the entire image from the camera to the host.
Vector distance algorithm for color detection Lets say we are searching for “ green ” color. Pure green exists when the values of the pixels are R = 0, G = 255, B = 0. The pixel we took in is a vector Pixel = [R G B] The eculedian distance between those 2 vectors is D = sqrt((R-0)^2 + (G-255)^2 + (B-0)^2)
Code So the algorithm goes for each pixel { 1.compute the distance between that pixel and the reference color (D) 2.if D<Threshold then current pixel is accepted else current pixel is NOT accepted }
Threshold "Threshold" is a constant value and has to be set manually according on the "tolerance" desired for application (a high value of Threshold means that less "clear" green pixels will be considered as green, whereas a lower value of Threshold will make the algorithm quite "strict")
Actuator Stepper Motor Precise positioning High static torque for blocking the ball from moving toward the camera Rotate 90 º at 7.5 º per full step (12 steps) Half-stepping method (24 steps) to eliminate stiff movement of Full-stepping method
Stepper Motor Controller ULN2064 – Quad Darlington Switches
Commands and Step Sequence Commands RCW: Rotate counterclockwise 90 º Pause: Step motor stops Resume: Step motor resumes rotational movement When pause activates, motor will pause after the last RCW is finish executing Allow future expansion or additional commands Sample Step Sequence Step NumberCoil ACoil BCoil CCoil D
Ball Dispensing Mechanism Motor arm pushes one ball at the bottom of the tube Next ball falls after previous ball has been pushed out
User Interface: GUI & Commands Serial Communication RS-232 Javax.comm package Default Commands: Start System Stop System Override Commands: Pause System Resume System Clear
Proposed Bit Patterns Commands Bit Pattern (8 bits)Commands Start Stop Pause Resume Clear Balls Status Bit Pattern (8 bits)System Status Running Paused Stopped Error
Operating Conditions Uniform black background Single colored ball Brightly lit room Size of the ball
Potential Difficulties Jamming of balls “ Extreme ” shades of red, green or blue might not be detected Poor lighting conditions Motor controller overheats
Budget
DEMO
Questions?