Team Hassenplug's

 

Full Contact - A Connect Four Robot

on G4TechTV

 

 

 

About the Robot

 

 

This is a robot that was designed and built to play Connect-Four in a contest against other robots, which it was lucky enough to win.  During the event, it didn't lose any games (once I remembered to plug the AC into the RCXs)

The name comes from the method it uses for checking the board.  Six axles are pushed into the six vertical holes, contacting any chips which are in the board.  This process is repeated seven times (once for each column).

 

 

 

This is one of my favorite robots, because it's very easy to explain what the robot does.  Many of my robots are designed for a specific challenge, which really don't make sense to most people.  However Full Contact is easy to explain, easy to understand, but hard to beat.

 

 

I believe Connect-Four is about the most difficult game a LEGO robot (using no other processing power) could play, and reliabily win against a human.

 

 

 

 

 

Win Record

 

 

I've set-up Full Contact on several occasions, and let people play it.  During most days, where it will play for up to eight hours at a time (close to 100 games), I can usually count the number of times it lost on one hand.

 

 

Full Contact doesn't take very long to make moves.  Its average move time is around 10 seconds, and there is no visible time spent calculating its next move.

 

 

 

 

Pictures

 

 

 My  pictures from the event

Derek clearly had the next bestrobot at the Connect Four event.  I never saw it make a mistake, but it did take quite a while to make some of it's moves.  (up to 2.5 minutes)  Check out Derek's event Pictures. and some pictures of his robot Singer

More Pictures

Even More...  mostly marble sorting

 

 

 

Indylug posting about a display where I set it up and let people play it.

And some movie clips:

FullContact4
GravityBased1
GravityBased4

 

 

 

 

I like this picture, because it shows how Full Contact usually wins by having more than one possible play.  In this case the opponent (black) has just gone, and gotten three in a row, but the robot will win before the opponent has another turn.

 

 

 

 

Hardware:

 

 

2 RCXs v1.0, with AC adaptor

 

 

4 motors

 

 

2 rotation sensors

 

 

5 Mindstorms touch sensors

 

 

5 Cybermaster touch sensors (from a set sold in England in 1999)

 

 

1 light

 

 

5 Minifigs

 

 

1 US flag

 

 

Many other parts

 

 

 

 

How it works:

 

 

Sensor Array

 

 

This is really the key to Full Contact. Six touch sensors are connect in series.  Five are Cybermaster sensors and one is a normal Mindstorms sensor.  The Cybermaster sensors are the same as Mindstorms sensors, except they have a resistor across the connections, so when the switch is OPEN, there is still a reading.  There are three different sensors (different colors) which each have a different resistance, allowing them to be connected together, so you can distinguish which sensors are pressed at any time.

However, for this application, I didn't need to know WHICH sensors are pressed, only how many. (I know it starts at the bottom).

That allowed me to connect all six touch sensors in series, to a single input.

The sensors were Normally Closed (pressed, when the array is not in contact with the board), and the sensors are Opened when it comes in contact with the board.  This causes the resistance (reading on the RCX) to rise with the number of sensors pressed. 

When the top sensor (the Mindstorms sensor) is Open-ed the resistance goes to it's upper limit, and the robot knows the column is full.

 

 

 

 

 

 

Main Control

 

 

The robot is controlled by two RCXs.  The first RCX controls all the logic, chip detection, chip dropping, opponent messages and sending messages for robot navigation.

One motor controls the chip-dropper, and a light is connected to indicate when the robot is waiting for its opponent to move.

 

 

 

The sensor array is connected to the main RCX, along with the signal line from the opponent for signaling when they have completed their move.

 

 

The second RCX  controls major movement of the robot forward/backward and left/right.  Each axis is controlled by one motor and one rotation sensor.  The Forward/Backward axis also has an End-Of-Travel touch sensor, so the robot can home itself.

 

 

 

 

 

 

 

 

 

 

Other Features

 

 

Look-ahead of 4 moves

 

 

Opening book with 384 moves

 

 

Fast-Guess - If opponent has only one move to prevent win, check there first.  If opponent played there, continue as normal, otherwise, play in that column (and win)

 

 

Do not check columns known to be full.

 

 

If opponent plays more than one chip, or removes a chip, declare victory.  (no cheating)

 

 

Disabled - Calculate future moves while waiting on opponent

 

 

Runs on 16 mhz processor with 32k RAM

 

 

 

 

 

 

 

Common Questions

 

 

Q: "How does it know what color the chips are?"
A: It remembers.  It keeps track of where each person plays, and stores that in an array for later use.

 

 

 

Q: "Why does it keep going in the middle?"
A: Strategy.  On a normal Connect-Four board (7x6), there are 69 places to win.  51 of them  (about 75%) include at least one chip in the middle column.  Playing in the middle column is good strategy.

 

 

 

Q: "Can anyone beat it?"
A: Yes.  It doesn't play a perfect game.  Not even close.  With only 32k of RAM, and a 16mhz processor, there's only so much you can do.  But it also doesn't miss anything, like people often do.

 

 

 

Q: "What if I put in two chips (or take a chip out)?"
A: You lose.  That's against the rules.  The robot will check and if the number of chips has increased by more than one (in a single column), it will stop playing.

 

 

 

Q: "Can the robot go first?"
A: Yes.  I have it set so whoever's playing against the robot goes first.  That gives them the best chance to win.  But, if you want the robot to go first, it can.

 

 

 

Q: "How long did it take to build?"
A: About 3 months.  I usually have several things going on at once, but I put aside most other projects, while I worked on this one.

 

 

 

 

 

These are some of my random notes from when I was designing it.

 

 

 

 

 

 

 

 

Outputs

1)     right/left (RCX1)

2)     forward/back (RCX1)

3)     drop chip (RCX2)

4)     Signal Opponent [EOT] (RCX1)?

5)     Waiting for Opponent, light

Inputs

1)     Rotation1: Right/Left (RCX1)

2)     Rotation2: Forward/back (RCX1) + Touch for Home

3)     Local EOT check

4)     Touch: Detect Chip (chip array x6) (RCX2)

5)     EOT from opponent (RCX2)

Sensors

1)     Rotation – Forward/Back

2)     Touch – home (back)

3)     Rotation – Right/Left

4)     Touch – Local EOT Check

5)     Touch – EOT Button for remote robot

6)     Touch – Human EOT button

7)     6x Touch – Board scanner array

a.      1 Standard Mindstorms touch sensor

b.     5x Cybermaster touch sensors

 --------------------

Motor Ports

1)  Left/Right

2)  Drop Chip

3)  Signal EOT

Sensor Ports

1)  Board Scan Sensors (6 touch)

2)  Position/align Light Sensor

3)  Receive EOT

Possible EOT, mounted touch sensor

 

ELC-4

Input Player (RED/BLK) with view/prog buttons

Input Level (1 to X) with view/prog buttons

Allow turn entry with view/prog buttons

 ------------------------------------

Opening Book Data:

If Parent=X and Move = Y, New Move = Z

Where data =  (X(0-511) * 8 + Y(0-7)) * 8 + Z(0-7)

X (Parent move number)

Y Opponent Move

Z My Move

In order where Move Number = position in array

  

 

 

Programs

There are several programs required:

Master Controller:

1)     ELC-MasterWL.lx – Master Control Software

2)     FullContactMasterMovementTest.lx – Location Test

Control Robot:

1)     FullContactSpeedControl.lx – Position Software

2)     Backup Positions? (second program)

3)     SensorTestCode.lx – Display Rotation Positions

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

This page is not associated with The LEGO Group in any way.