How misprit7/real-time-chess works
Main Components
• Hardware Platform:
• PCB/Board Design: Organize the “ecad” folder’s various subdirectories (e.g., “board”, “edge1”, “edge2”, etc.) to show that multiple board components exist. These represent the physical layout and custom PCB components (including the electromagnets and possibly LED indicators) that enforce piece cooldown.
• Electromagnets & Mechanical Assembly: Mention off-the-shelf components (insulating washers, plastic screws, spacers, etc.) that are externally referenced in the README.
• Power Distribution: Note the known issue with undersized traces and voltage drops, so include a block to represent power management.
• Firmware System:
• Microcontroller (Teensy): Represent the central MCU that runs the firmware.
• Firmware Application: Include main firmware source files (main.cpp, goertzel.cpp, etc.) which implement the chess board control logic.
• Real-Time Operating System: Highlight the integration of FreeRTOS (as seen in the “firmware/lib/freertos-teensy” folder) that manages task scheduling (e.g., piece cooldown timers, sensor readings, and control of actuators).
• Build & Configuration: Include components such as “platformio.ini” and build scripts (build.py) that are used to compile and deploy the firmware.
Relationships and Interactions
• How signals flow from physical sensors or user inputs through the embedded firmware’s control logic (including any digital signal processing like the goertzel algorithm) and then out to actuators (electromagnets that hold chess pieces).
Architectural Patterns and Design Principles
• Separation between the physical (hardware/ECAD) components and the embedded software. Create two high-level layers (Hardware Layer and Firmware Layer) with well-defined interfaces.
• Modular structure in the ECAD designs where different board segments (main board, edge boards, etc.) are designed separately but work cohesively.
• For the firmware, note that leveraging FreeRTOS (and by extension built-in C++ libraries) modularizes timing-critical tasks such as enforcing cooldowns per piece and managing sensor/actuator updates.
Relevant Technologies and Tools
• KiCad for PCB design (illustrated by file extensions like *.kicad_pcb, *.kicad_pro, and *.kicad_sch).
• Teensy Platform, likely chosen for its embedded capabilities.
• FreeRTOS for scheduling and task management.
• Use of PlatformIO (platformio.ini) for building and deploying firmware.