220 likes | 373 Views
Efficient Path Determining Robot. Jamie Greenberg Jason Torre. General Description. Maze is set up as shown PC Analyzes maze through webcam PC Determines best path for robot to get from start position to end using Dijkstra's Least Cost Path Algorithm. General Description (continued).
E N D
Efficient Path Determining Robot Jamie Greenberg Jason Torre
General Description • Maze is set up as shown • PC Analyzes maze through webcam • PC Determines best path for robot to get from start position to end using Dijkstra's Least Cost Path Algorithm
General Description (continued) • PC translates path into a set of commands and sends them to the HCS12 through the serial port • Robot follows commands to travel the best path to the finish
Image Processing • Laptec Webcam connected to PC through USB port • Image is captured through Java Media Framework • Pixel information is pulled from the image using Java PixelGrabber class • Pixel data for areas of interest is analyzed to determine if color best represents a wall (white) or a blank space (black) • Use this data to determine what grid positions have a blank space (no wall) and designate them as “nodes”
Dijkstra’s Algorithm • Start with a “cost” of zero for the start node and infinity at every other node. • Iterate through every node and determine it’s distance from the start node (if directly connected) • Mark the node with the least cost and determine the costs of all unmarked nodes to this node • Repeat for every node until least cost node is the finishing node. • Once this is determined, the shortest path is the reverse order of the nodes previously marked
Getting the data to the robot • Once the best path is found, the path is converted on the PC to a set of binary commands • This data is sent to the Motorola 68HCS12 through the serial port on the PC and the SCI port on the HCS12. • When a “FINISHED” command has been received by the robot a command will be sent back to the PC that will notify the user to remove the serial cable and press the Go button on the robot. When GO is pressed, the robot should begin it’s path towards the finish.
Commands • The following commands will be used to guide the robot through the maze:
Communications Test • At the beginning of the program (before web capture), the serial connection will be tested • A binary “test” sequence will be sent to the robot and it will be echoed back to the PC. • If the echo is not received in 5 seconds an error message will be displayed
PC User Interface • The PC will be used to guide the user through the process • Instruct the user to attach the serial cable and reset the robot • Notify user if communications test was successful • Notify user that image analysis is in progress • Notify user if path does not exist • Notify user that commands are being sent to the HCS12 • Ask user to remove serial connection and press the GO button
Robot Design • Tamiya Robot kit • The DC motor is FA-130 by Tamiya • The whole kit measured 6.5” X 4.25” X 3.75” height, available surface area after the bottom deck is covered is 4.5” X 2.5”
Chassis and Actuators Robot Tank by Budget Robotics Two gear ratio to choose from: 58:1 , 203:1
Hardware Utilized • Proximity Sensors • Opto-reflectors • Chasis and DC motors • H bridges • Batteries
Proximity sensors Sharp GP2D15 IR Proximity Sensor Range between 0 cm and 80 cm Beam width of 45-50° This model can be adjusted to yield a digital output when the robot comes to close to the wall (~ 2 cm) No external circuitry is needed
Opto-reflector Optek OPB745 opto reflector Responsible for informing that the vehicle has arrived reached a mrker The sensor will yield a digital input value when the robot crosses a piece of reflective tape, and modifications are done on the signal handling circuit that was completed previously (IDE).
Battery and power • 4 AA sized battery for the vehicle (in the kit) • Additional D Cell battery cells used to drive all the sensors and HCS12 board
Block Diagram HCS12 DC Motor PWM 0-2 H bridges PT 0-5 DC Motor Opto-reflectors Proxy Sensors
Overhead view Hole for wires Top Level Bottom Level Proxy sensor Sensor Circuitry Opto-reflector and circuitry H Bridges, DC Motors and voltage regulator Batteries HCS12 User Interface Proxy sensor
User interface GO On/Off Finished Moving Error Download Complete complete
Difficulties • The camera must be nearly perfectly calibrated so that the rectangular arrays of pixels sampled are always the correct ones • Calibrating the opto reflector correctly because it has been known to be unreliable • Calibrating the proxy sensors so as not to give too large a range
Webcam Alignment Utility • A small utility will be created to assist in positioning of the webcam • The utility will display a snapshot of the grid with boxes around the areas that should contain the edges of each grid position (either a wall or an opening) • If the camera needs to be moved, the user can retry the calibration until it is satisfactorily lined up