The Mechanical Turk: Difference between revisions

From Randomdata wiki
Jump to navigation Jump to search
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
= The Mechanical Turk (project) =
= The Mechanical Turk (project) =


== Overzicht ==
== Overview ==
''The Mechanical Turk'' is een technisch, ambachtelijk en experimenteel schaakbordproject ontwikkeld binnen [[Hackerspace RandomData]]. Het project combineert houtbewerking, 3D-printing, NFC-technologie, robotica en Python-programmering om een fysiek schaakbord te bouwen dat automatisch communiceert met het platform [[Chess.com]].  
''The Mechanical Turk'' is a technical and artisanal chessboard project developed within the Dutch hackerspace [[Hackerspace RandomData]]. It combines woodworking, 3D printing, NFC technology, robotics, and Python development to create a physical chessboard that synchronizes with digital chess games played on platforms like [[Chess.com]].


De zetten van een online tegenstander worden fysiek uitgevoerd op het bord, en wanneer de speler zelf een fysieke zet doet, wordt deze automatisch naar het online spel verzonden. Het bord maakt gebruik van een gridstructuur met een magnetische arm onder het bord, aangestuurd door een Raspberry Pi. Dit vormt een moderne interpretatie van het gelijknamige schaak-automaton uit 1770, dat destijds een illusie was, maar nu wél daadwerkelijk werkt.
Moves from an online opponent are physically executed on the board by a hidden robotic arm, while moves made on the physical board are detected and sent back to the online game. The name is a modern reference to the 18th-century chess automaton known as ''The Mechanical Turk'', which falsely appeared to play autonomously. This version is fully transparent and truly functional.


== Projectleiding ==
== Project Lead ==
Het project wordt geleid door '''0ffset_0x52''', beter bekend als '''UEV52'''. Wie wil bijdragen of deelnemen, kan contact opnemen via de SignalChat of via het Mattermost-kanaal van RandomData.
The project is led by '''0ffset_0x52''', also known as '''UEV52'''. Those interested in contributing can contact him via SignalChat or the Mattermost channel of Hackerspace RandomData.


== Doel van het project ==
== Goals ==
Het bouwen van een interactief, fysiek schaakbord dat:
* Build a working physical chessboard that mirrors and controls online games
* Zetten van een online tegenstander uitvoert via een mechanische arm
* Automate physical piece movement using a robotic magnetic arm
* Fysieke zetten automatisch doorstuurt naar het online schaakspel
* Enable real-world games against Chess.com opponents and AI bots
* Uitbreidbaar is met AI-functionaliteit, LED-feedback en geluidseffecten
* Create a platform that fuses old-world craftsmanship with modern automation
* Zowel technisch uitdagend als esthetisch verfijnd is


== Technische werking ==
== Technical Design ==
* Elk schaakstuk bevat een unieke NFC-sticker
* Each chess piece contains a unique NFC tag
* Een magnetische arm onder het bord beweegt via X/Y/Z-assen over een grid
* A magnetic robotic arm moves along X, Y, and Z axes beneath the board
* De arm koppelt magnetisch aan stukken om ze te verplaatsen
* Pieces are lifted magnetically and placed using scripted coordinates
* Positieherkenning gebeurt via NFC
* The system tracks each piece's position via NFC scans
* Het geheel wordt bestuurd met een Python-script op een Raspberry Pi
* All movement and logic are handled via a custom Python script
* Integratie met Chess.com vindt plaats via de officiële API
* Synchronization with Chess.com is achieved using their public API


== Hardwarecomponenten ==
== Required Components ==
Hieronder een overzicht van de technische randvoorwaarden en benodigde componenten:


{| class=\"wikitable sortable plainrowheaders\" style=\"text-align:left; width:100%;\"
{| class="wikitable" style=\"text-align:left; width:100%;\"
! Component !! Specificatie / versie !! Functie / toelichting
! Component !! Specification / Version !! Description
|-
|-
| Raspberry Pi || Model 4B (4GB RAM) || Besturing van het volledige systeem
| Raspberry Pi || Raspberry Pi 4 Model B (4GB RAM) || Controls motor logic, NFC reading, and API communication
|-
|-
| Besturingssysteem || Raspberry Pi OS 64-bit || Platform voor aansturing scripts
| Operating System || Raspberry Pi OS 64-bit || Platform for running scripts
|-
|-
| Programmeertaal || Python 3.11 || Voor motorcontrole, API-koppeling en NFC-detectie
| Programming Language || Python 3.11 || Controls logic and hardware
|-
|-
| NFC-lezer || PN532 (I2C-interface) || Detectie van unieke tags onder stukken
| NFC Reader || PN532 (I2C) || Detects pieces based on tag IDs
|-
|-
| NFC-tags || NTAG213 of NTAG215 || Voor unieke identificatie van elk stuk
| NFC Tags || NTAG213 / NTAG215 || Unique ID per chess piece
|-
|-
| X/Y-motoren || NEMA 17 stappenmotoren + A4988 drivers || Horizontale beweging van arm
| Stepper Motors || NEMA 17 + A4988 drivers || Moves the magnetic arm along X/Y grid
|-
|-
| Z-motor || SG90 of MG995 servo || Optillen van stukken
| Servo Motor || SG90 or MG995 || Controls vertical lifting (Z-axis)
|-
|-
| Grijpmagneet || Neodymium 6×3 mm || Voor het oppakken van schaakstukken
| Magnet || Neodymium (6×3 mm) || Picks up pieces magnetically
|-
|-
| Schaakstukken || PLA+ 3D-geprint || Handmatig geschuurd, geverfd en gepolijst
| Chess Pieces || 3D printed in PLA+ || Finished by hand: sanded, primed, painted, polished
|-
|-
| Schaakbord || Mahonie + walnoot + esdoornhout || Handgemaakt, gelakt, gegraveerd
| Board Material || Mahogany, walnut, maple || Layered and lacquered for appearance
|-
|-
| Gereedschap || Cirkelzaag, graveermachine, schuurmachine, klemmen || Voor houtbewerking
| Tools || Circular saw, sander, engraver, clamps || Used in board construction
|-
|-
| Afwerking || Filler primer, acrylverf, lak || Voor visuele en tactiele kwaliteit
| Finishing Materials || Acrylic paint, filler primer, lacquer || For visual quality and durability
|-
|-
| Connectiviteit || WiFi of Ethernet || Voor communicatie met Chess.com
| Connectivity || WiFi or Ethernet || For online integration with Chess.com
|}
|}


== Voorbeeldcode ==
== Example Code ==
Onderstaand fragment laat zien hoe een zet kan worden opgehaald via de Chess.com API en hoe deze wordt vertaald naar een fysieke actie:
Below is a simple Python example that retrieves the last move from a Chess.com game and prints it:


<syntaxhighlight lang=\"python\">
<syntaxhighlight lang=\"python\">
Line 70: Line 68:
     return moves[-1] if moves else None
     return moves[-1] if moves else None


move = get_last_move('voorbeeld-game-id')
move = get_last_move('example-game-id')


if move == 'a2a4':
if move == 'a2a4':
     print(\"Verplaats pion van A2 naar A4\")
     print(\"Move pawn from A2 to A4\")
     # hier komt motorsturing
     # Insert motor control logic here
</syntaxhighlight>
</syntaxhighlight>


== Bouwfasen en tijdlijn ==
== Construction Timeline ==


=== Fase 1 – Voorbereiding en ontwerp (week 1–2) ===
=== Phase 1: Planning and Design (Weeks 1–2) ===
* Ontwerpen van schaakstukken in CAD-software
* Create CAD designs for chess pieces
* Bepalen van gridlayout en mechaniek
* Define board layout and grid mechanics
* Selectie van houtsoorten en bevestigingsmethodes
* Choose wood types for contrast and durability


=== Fase 2 3D-printen en afwerking (week 3–4) ===
=== Phase 2: 3D Printing and Finishing (Weeks 3–4) ===
* Printen van alle stukken met PLA+
* Print pieces in PLA+ filament
* Schuren, primeren, verven en polijsten
* Sand, prime, paint, and polish each piece
* NFC-stickers aanbrengen
* Affix NFC tags to the bottom of each piece


=== Fase 3 – Bordbouw (week 5–6) ===
=== Phase 3: Board Construction (Weeks 5–6) ===
* Zagen, frezen en lijmen van houten bord
* Cut and shape wood components
* Graveren of inlay van speelvlak
* Route out internal space for grid and arm
* Aanbrengen van beschermlaag (lak)
* Inlay or engrave chess squares
* Assemble and lacquer the board


=== Fase 4 – Mechanische arm (week 7–8) ===
=== Phase 4: Mechanical Arm (Weeks 7–8) ===
* Montage van stappenmotoren en railsysteem
* Assemble X/Y movement system using stepper motors
* Ontwikkeling van Z-as-grijper met magneet
* Integrate vertical servo-lifting mechanism
* Testen van bereik en nauwkeurigheid
* Test magnetic pickup and alignment


=== Fase 5 Software (week 9–10) ===
=== Phase 5: Software Development (Weeks 9–10) ===
* Programmeren van sturing in Python
* Write motor control scripts in Python
* Integratie met NFC-lezer en motorcontroller
* Integrate NFC reader and calibrate tag detection
* API-koppeling met Chess.com
* Connect to Chess.com API and handle logic


=== Fase 6 – Eindintegratie en test (week 11–12) ===
=== Phase 6: Testing and Integration (Weeks 11–12) ===
* Kalibratie van bord en armbeweging
* Full system test with online games
* Testspellen tegen menselijke en AI-tegenstanders
* Refine movements and calibrate grid
* Bugfixes, logging, failsafes
* Add logging, error handling, and safety checks


== Toekomstige uitbreidingen ==
== Future Expansions ==
* Lokale AI-opponent via [[Stockfish (chess engine)|Stockfish]]
* Add local AI support via [[Stockfish (chess engine)]]
* LED-indicatoren voor zetnotificaties
* Use RGB LEDs for visual feedback
* Geluidseffecten (bijv. schaak, schaakmat)
* Add sound effects for capture, check, and checkmate
* OLED-display voor zettennotatie
* Integrate OLED display to show current notation
* Spraakbesturing en ondersteuning voor meerdere fysieke borden
* Enable voice control or multiplayer sync between boards


== Historische inspiratie ==
== Historical Context ==
Het originele concept van de ''Mechanical Turk'' werd in 1770 gebouwd door Wolfgang von Kempelen. Het leek een autonoom schaakspelende automaat, maar er zat in werkelijkheid een menselijke schaakmeester in verstopt. Het moderne project gebruikt deze mythe als inspiratie om juist wél een volledig functioneel autonoom bord te bouwen — transparant, open-source, en verbonden met de hedendaagse digitale wereld.
The original ''Mechanical Turk'' was a hoax automaton built by Wolfgang von Kempelen in 1770. Though it appeared to play chess autonomously, it concealed a hidden human operator. This project reimagines the same premise using modern technologies—robotics, NFC, and open-source software—to achieve the illusion in reality, transparently and without deception.


== Zie ook ==
== See Also ==
* [[Chess.com]]
* [[Chess.com]]
* [[Stockfish (chess engine)]]
* [[Stockfish (chess engine)]]
Line 126: Line 125:
* [[Wolfgang von Kempelen]]
* [[Wolfgang von Kempelen]]


== Externe links ==
== External Links ==
* [https://www.chess.com Chess.com]
* [https://www.chess.com Chess.com]
* [https://www.randomdata.nl Hackerspace RandomData]
* [https://www.randomdata.nl Hackerspace RandomData]

Latest revision as of 19:10, 3 July 2025

The Mechanical Turk (project)

Overview

The Mechanical Turk is a technical and artisanal chessboard project developed within the Dutch hackerspace Hackerspace RandomData. It combines woodworking, 3D printing, NFC technology, robotics, and Python development to create a physical chessboard that synchronizes with digital chess games played on platforms like Chess.com.

Moves from an online opponent are physically executed on the board by a hidden robotic arm, while moves made on the physical board are detected and sent back to the online game. The name is a modern reference to the 18th-century chess automaton known as The Mechanical Turk, which falsely appeared to play autonomously. This version is fully transparent and truly functional.

Project Lead

The project is led by 0ffset_0x52, also known as UEV52. Those interested in contributing can contact him via SignalChat or the Mattermost channel of Hackerspace RandomData.

Goals

  • Build a working physical chessboard that mirrors and controls online games
  • Automate physical piece movement using a robotic magnetic arm
  • Enable real-world games against Chess.com opponents and AI bots
  • Create a platform that fuses old-world craftsmanship with modern automation

Technical Design

  • Each chess piece contains a unique NFC tag
  • A magnetic robotic arm moves along X, Y, and Z axes beneath the board
  • Pieces are lifted magnetically and placed using scripted coordinates
  • The system tracks each piece's position via NFC scans
  • All movement and logic are handled via a custom Python script
  • Synchronization with Chess.com is achieved using their public API

Required Components

Component Specification / Version Description
Raspberry Pi Raspberry Pi 4 Model B (4GB RAM) Controls motor logic, NFC reading, and API communication
Operating System Raspberry Pi OS 64-bit Platform for running scripts
Programming Language Python 3.11 Controls logic and hardware
NFC Reader PN532 (I2C) Detects pieces based on tag IDs
NFC Tags NTAG213 / NTAG215 Unique ID per chess piece
Stepper Motors NEMA 17 + A4988 drivers Moves the magnetic arm along X/Y grid
Servo Motor SG90 or MG995 Controls vertical lifting (Z-axis)
Magnet Neodymium (6×3 mm) Picks up pieces magnetically
Chess Pieces 3D printed in PLA+ Finished by hand: sanded, primed, painted, polished
Board Material Mahogany, walnut, maple Layered and lacquered for appearance
Tools Circular saw, sander, engraver, clamps Used in board construction
Finishing Materials Acrylic paint, filler primer, lacquer For visual quality and durability
Connectivity WiFi or Ethernet For online integration with Chess.com

Example Code

Below is a simple Python example that retrieves the last move from a Chess.com game and prints it:

<syntaxhighlight lang=\"python\"> import requests

def get_last_move(game_id):

   url = f\"https://api.chess.com/pub/game/{game_id}\"
   response = requests.get(url)
   data = response.json()
   moves = data['moves'].split()
   return moves[-1] if moves else None

move = get_last_move('example-game-id')

if move == 'a2a4':

   print(\"Move pawn from A2 to A4\")
   # Insert motor control logic here

</syntaxhighlight>

Construction Timeline

Phase 1: Planning and Design (Weeks 1–2)

  • Create CAD designs for chess pieces
  • Define board layout and grid mechanics
  • Choose wood types for contrast and durability

Phase 2: 3D Printing and Finishing (Weeks 3–4)

  • Print pieces in PLA+ filament
  • Sand, prime, paint, and polish each piece
  • Affix NFC tags to the bottom of each piece

Phase 3: Board Construction (Weeks 5–6)

  • Cut and shape wood components
  • Route out internal space for grid and arm
  • Inlay or engrave chess squares
  • Assemble and lacquer the board

Phase 4: Mechanical Arm (Weeks 7–8)

  • Assemble X/Y movement system using stepper motors
  • Integrate vertical servo-lifting mechanism
  • Test magnetic pickup and alignment

Phase 5: Software Development (Weeks 9–10)

  • Write motor control scripts in Python
  • Integrate NFC reader and calibrate tag detection
  • Connect to Chess.com API and handle logic

Phase 6: Testing and Integration (Weeks 11–12)

  • Full system test with online games
  • Refine movements and calibrate grid
  • Add logging, error handling, and safety checks

Future Expansions

  • Add local AI support via Stockfish (chess engine)
  • Use RGB LEDs for visual feedback
  • Add sound effects for capture, check, and checkmate
  • Integrate OLED display to show current notation
  • Enable voice control or multiplayer sync between boards

Historical Context

The original Mechanical Turk was a hoax automaton built by Wolfgang von Kempelen in 1770. Though it appeared to play chess autonomously, it concealed a hidden human operator. This project reimagines the same premise using modern technologies—robotics, NFC, and open-source software—to achieve the illusion in reality, transparently and without deception.

See Also