# 3-Axis Robot Solves 'Towers of Hanoi' © MIT

If you do not struggle solving 'Towers of Hanoi' just build your own Arduino-powered 3-axis-robot.

• 10,147 views
• 1 comment
• 48 respects

## Components and supplies

 Arduino Mega 2560
×1
 DC motor (generic)
×3

## Necessary tools and machines

 3D Printer (generic)

## Apps and online services

 Arduino IDE

## About this project

"Towers of Hanoi" is a well-known mathmatical puzzle. The aim of this puzzle is to move a tower, which consists of different disk, from the left to the right stack. At any time, you must only pick a single disk. You must beware that there mustn't be a bigger disk above a smaller disk. Finally, there is a third support stack.

### 3-Axis Robot

From my point of view, the solution algorithm is not challenging enough. Consequently, I decided to build a 3-axis robotic arm that simulates the calculations of the algorithm. Check out the video below, it demonstrates the machine's kinematics and shows how the puzzle is solved.

The robot predominantely consist of fischertechnik parts. There is a rotary axis and there are two linear axis; hence the end-effector can reach any point in a three-dimensional cartesian coordinate system. All axes are driven by fischertechnik DC motors. Thanks to a pneumatic gripper, the machine can pick up the yellow disk. All motions are processed by an Arduino microcontroller.

### Algorithm

Desite the fact that the robot makes many moves, the key-algorithm is pretty simple as it can be recursively implemented. Thus, there has to be only one method which makes the robotic arm move an element

``````void solve(int start, int goal, int support, int n)
{
if (n > 0)
{
move(start, goal);  // move
solve(support, goal, start, n - 1);
}
}
``````

The left stack is called `start`, the stack in the middle is called `support`, and the very right stack is called `goal`. The method `solve()` is called recursively until the height `n` is zero.

### Microcontroller

The microcontroller could be a project on its own as it is a plug-and-play controller with integrated motor drivers. It focuses on controlling fischertechnik hardware, such as DC motors and a variety of different sensors.

## Comments

#### Author

##### David
• 4 projects
• 116 followers

April 30, 2018

#### Members who respect this project

and 40 others

See similar projects
you might like

• 526 views
• 0 comments
• 1 respect

#### Amazing 6WD Off-Road Robot | Arduino RC Robot

Project tutorial by Jithin Sanal

• 21,276 views
• 1 comment
• 82 respects

#### Scriba Robot - A Printing Robot

Project in progress by RobinB

• 7,292 views
• 1 comment
• 18 respects

#### SimAr The Humanoid Robot

Project showcase by TECHEONICS and Gaurav Kumar

• 2,809 views
• 4 comments
• 11 respects

#### Gesture Controlled Trainable Arduino Robot Arm via Bluetooth

Project tutorial by KureBas Robotics

• 40,985 views
• 59 comments
• 236 respects

#### Robot Arm Controlled Through Ethernet

Project tutorial by Balázs Simon

• 17,397 views
• 5 comments
• 66 respects