name: attachment-cycle-optimizer description: design and code reliable attachment cycles for lego spike competition robots using pybricks. use when the user needs motorized arms, lifts, claws, sliders, homing, synchronization with drive motion, or safe reset positions between autonomous runs.
Attachment Cycle Optimizer
Overview
Design attachment logic that is reliable, easy to re-home, and safe to chain across multiple runs.
Workflow
- Describe the mechanism in plain language.
- motorized arm, lift, slider, claw, trigger, or passive latch.
- what counts as home, loaded, released, and reset.
- Split the cycle into named phases.
- prepare
- acquire
- transport hold if needed
- deliver
- reset
- Use
assets/attachment_cycle_template.pyas the starting structure. - For each phase, define.
- target angle or travel
- required speed
- whether the drive base must be stopped
- what to do if alignment is off
- Return the result in this order.
- mechanism assumptions.
- cycle table.
- code.
- tests for backlash, missed reset, and double-loading.
Rules
- Always make home and reset explicit.
- Separate mechanism control from navigation whenever possible.
- Prefer one reliable motor movement over a complicated chained motion.
- Call out backlash and beam flex if timing alone will not solve the problem.
Resources
- Use
references/attachment-patterns.mdfor cycle design. - Use
assets/attachment_cycle_template.pyas the code base.