Computerized Labyrinth Solver Gregory Schallert Chad Craw.

22
Computerized Labyrinth Solver Gregory Schallert Chad Craw
  • date post

    19-Dec-2015
  • Category

    Documents

  • view

    212
  • download

    0

Transcript of Computerized Labyrinth Solver Gregory Schallert Chad Craw.

Page 1: Computerized Labyrinth Solver Gregory Schallert Chad Craw.

Computerized Labyrinth Solver

Gregory SchallertChad Craw

Page 2: Computerized Labyrinth Solver Gregory Schallert Chad Craw.

System Overview

Motors Control Playing Platform by Video feedback.

Video processing is done by the PC

Motor control is done by the HC12

HC12Computer

Page 3: Computerized Labyrinth Solver Gregory Schallert Chad Craw.

User Interface

Minimal amount of buttons and LEDs

The interface shall report current operating status, and any encountered errors through LED codes

Page 4: Computerized Labyrinth Solver Gregory Schallert Chad Craw.

User Interface

Buttons

Analyze Start Stop

Status LEDs

Error LEDs

Page 5: Computerized Labyrinth Solver Gregory Schallert Chad Craw.

System Test on Startup The system will rotate the maze surface

a maximum deflection on both axes All status and Error LEDs will flash in

unison to make sure the are operational The system will analyze the current

maze structure, and output a binary stream representing the wall placements as well as values of the current X and Y axis rotation to the Serial interface.

Page 6: Computerized Labyrinth Solver Gregory Schallert Chad Craw.

Dynamic Maze Construction

Maze walls are placed in arbitrary positions to create a new maze each time.

Limited Start and End “Tags” are placed along the outer edge of the wall

Page 7: Computerized Labyrinth Solver Gregory Schallert Chad Craw.

Maze Construction Diagrams

.

.

.

.

.

.

.

.

.

Notches for the wall segments

Wall Segment

Notches for Start and End tabs

Maze Surface

Contact Nodes

Wall Slot

Wall Segment

Contact Nodes

Page 8: Computerized Labyrinth Solver Gregory Schallert Chad Craw.

Maze Scanning Phase An array of multiplexers are

attached to the contact nodes of each wall slot.

These connections are scanned synchronously by the HC12 board to determine positions of walls.

Once this scan is complete, the virtual maze is passed to the connected PC via the serial interface to start the maze solving algorithm.

001000011101010011110111101101011011110010101000010001000101111100101000101001111001011100

Ang X: 1.2 Ang Y: 5.5 X Pos:01 Y Pos:54

Page 9: Computerized Labyrinth Solver Gregory Schallert Chad Craw.

Lee Moore Algorithm Inputs: Walls, Start and End

Points. Output: Finds the a path from

start to finish. Each cell is given a value of -1. Starting Cell is given a value of 0 If we have not reached the end, set

the current cell to the highest value not yet used.

Each cell touching the current cell with a -1 has the value of this cell + 1

Check each cell to see if we are at the end

If not, continue

Page 10: Computerized Labyrinth Solver Gregory Schallert Chad Craw.

Video Capture

Use the CCD Camera to find ball location

Compare the current location to the desired path

Send the offset to the next goal to the serial interface

Page 11: Computerized Labyrinth Solver Gregory Schallert Chad Craw.

The Camera Logitech QuickCam® CCD

Camera 352x288 Maximum True

Resolution 30 Frames/sec 25cm/120 = 2mm grid 25cm/288 = < 1mm grid We want 4mm resolution

MEANS WE ARE GOOD TO GO

Page 12: Computerized Labyrinth Solver Gregory Schallert Chad Craw.

The Software OpenCV

Video Tracking algorithms DirectShow

Video Capture Filters Logitech SDK

Camera Calibration and Windows Drivers

All of the Software is Free and Documented

Page 13: Computerized Labyrinth Solver Gregory Schallert Chad Craw.

The Process DirectShow captures the video

input The OpenCV algorithms are applied

to track the object The information is sent to the HC12 Any additional text overlays are

added and rendered to the screen

Page 14: Computerized Labyrinth Solver Gregory Schallert Chad Craw.

A System Model Sum the masses

Sum the Torques

Solve for acceleration

This relates the acceleration to the angle of the platform

O

N

Fg

aMFM bsg cos

I

IrFs

r

a

ar

IFs 2

2

11

cos

mr

ga

Page 15: Computerized Labyrinth Solver Gregory Schallert Chad Craw.

A System Model (con’t) Take two snapshots

One at the zero position One after some time Note R and d stay

constant Use law of cosines to

solve for the angle

This relates the acceleration to the distance the control axle at r has turned

rz

Z

R

l

L

zl

ZL

R

Rd d

Can also solve for vertical displacement

Rd

dR

Rd

L

22)cos(

222

2

11

cos

mr

ga

)cos(Rz

Page 16: Computerized Labyrinth Solver Gregory Schallert Chad Craw.

Control System The algorithms for the control system shall operate on

the HC12 board. The system will collect feedback data from the Video

tracking algorithm on the PC via the Serial Interface of the HC12 board

This data shall be sent as a 3-byte packet at every sample interval of the tracking system

It shall contain a signal start byte (to maintain alignment), followed by 2 data bytes for the current X and Y offsets

The position of the ball while traversing the maze shall be maintained with a Fuzzy Logic Control system.

The only data that needs to be collected from the PC Video tracking system is the ball’s current offset from its target position

Page 17: Computerized Labyrinth Solver Gregory Schallert Chad Craw.

Control System The FLC will use a rule set based on 5 states of

the system: The ball is far to the left(top) of its target position The ball is near to the left(top) of its target position The ball is at its target position The ball is near to the right(bottom) of its target position The ball is far to the right(bottom) of its target position

These rules shall be applied symmetrically to both the X and Y axes of the ball’s position.

Using this rule-set, the control system shall derive the angular rotation necessary to move the ball in the desired direction at the desired speed.

Page 18: Computerized Labyrinth Solver Gregory Schallert Chad Craw.

Control System (Pathfinder)

Start

X

Y

Y offset = 20

X offset = 0

Y offset = 10

X offset = 0

Y offset = 0

X offset = 10

End

Y offset = 0

X offset = 0

Page 19: Computerized Labyrinth Solver Gregory Schallert Chad Craw.

Motor Control

Each motor shall be attached to the actuators of each axis, and shall operate independently of one another.

The operation of each motor is identical due to the symmetrical nature of the maze surface.

Page 20: Computerized Labyrinth Solver Gregory Schallert Chad Craw.

Motor Specs SL561 Standard, BB

Size: Length 1.51” Width 0.73” Height 1.37”

Torque 46.1 oz Speed 0.18 sec/60° Weight 1.50 oz Voltage 4.8V – 6V

Page 21: Computerized Labyrinth Solver Gregory Schallert Chad Craw.

Possible Errors

Nonlinear elements of the system Fuzzy Logic Control Keep speed Down

Video Resolution/timing Damp the system Keep speed Down

Page 22: Computerized Labyrinth Solver Gregory Schallert Chad Craw.

Conclusion