Develop K230 Puzzle Robot
来源与用途
Use this skill as the consolidated operating guide for the K230 puzzle robot. It was summarized from:
- the user's corrections and one-question-at-a-time answers;
- the official E-task requirements already inspected in the project;
- measured SolidWorks assemblies and printable camera-gantry checks;
- the user-supplied, checksum-verified K230 stable backup;
- failures encountered while identifying hardware, coordinate frames, firmware APIs, and editable CAD.
Use it to continue the project without repeating corrected mistakes, overwriting stable artifacts, inventing missing measurements, or confusing image, paper, and robot coordinate systems.
Required workflow
- Read project-spec.md before using project facts or choosing hardware behavior.
- Read lessons-and-corrections.md before modifying an existing program/model or claiming that an output matches the reference.
- Read only the relevant section of implementation-methods.md for vision, UART/STM32, CAD, testing, or report work.
- Confirm the active task. Stop and do not resume an earlier task after the user terminates it.
- Inspect existing artifacts before asking questions. Reuse data already present in the problem statement, code, calibration files, CAD, BOM, or test outputs.
- If a material fact is still missing, ask exactly one short question. Do not bundle unrelated questions.
- Preserve verified baselines. Create a separately named derivative for new functionality and record what changed.
- Validate each layer independently before integrating: vision, geometry, coordinate conversion, UART, motion, electromagnet, collision/printability, then full-cycle operation.
- Report confirmed results separately from assumptions, configurable placeholders, and unresolved decisions.
Core guardrails
- Treat the supplied
42.capture_and_solve_from_32_1cm_gap.pyas a stable four-piece fixed-template baseline, not as a generic 2-4 piece solver. - Never replace the baseline in place. Verify archive hashes before use.
- Treat pixel-to-A4 homography and A4-to-robot calibration as two separate transforms.
- Keep K230 and STM32 programs in separate files and responsibilities.
- Do not call TB6612 a STEP/DIR driver; drive the four-wire bipolar stepper through two H-bridges with a phase sequence.
- Do not count the base stepper as a servo. The corrected system has one stepper, four servos, and one independently switched electromagnet.
- Do not hard-code unconfirmed motor steps, reduction ratio, servo zero angles, link lengths, UART pins, logic voltage, or power rails.
- Do not fabricate test times, accuracy, or completion status.
- For CAD reconstruction, compare geometry visually and dimensionally before saying it is the same.
- For 3D-print-only parts, split components to fit the actual print bed and verify tolerances, assembly access, stiffness, and collisions.
Deliverable conventions
- Use descriptive versioned filenames such as
k230_puzzle_uart_v1.py; keep original stable files untouched. - Include a short configuration block at the top of firmware for every unconfirmed parameter.
- Document coordinate origin, axes, units, and positive rotation in every transmitted motion record.
- Add a test mode that prints or displays results without moving the robot.
- For reports, distinguish design values, CAD measurements, and physical test results.