Files
pybricks-projects/sets/boost/creative-toolbox/auto-builder/index.md
T
2021-05-19 13:06:38 +02:00

1.6 KiB

title, maintainer, image, video, description, building_instructions, code
title maintainer image video description building_instructions code
Precision building with Auto Builder
user name
pybricks The Pybricks Team
local credit
auto-builder.jpg LEGO
youtube
TXvCEK1MNGQ
The Auto Builder builds LEGO figures autonomously. These Python scripts make it work smoothly and accurately.
external
https://www.lego.com/cdn/product-assets/product.bi.additional.main.pdf/17101_A_AutoBuilder.pdf
#coding-instructions

Coding instructions

This program resets the motors to known positions, and then constructs the LEGO figure brick-by-brick.

This works by repeatedly:

  • moving the belt motor to the given brick;
  • picking the brick up by moving the arm down and up;
  • moving the belt back to the base position;
  • putting the brick down.

The brick positions are given as the degrees the belt motor turns relative to the base position. You can tweak these values by a few degrees if needed.

{% include copy-code.html %}

{% include_relative main.py %}

Further exploration

The provided program is very basic, demonstrating only the core principles. Here's a few ideas and challenges for further exploration:

  • Change the order of the bricks in the for-loop to build something else.
  • Instead of pushing the element down for two seconds, you could stop sooner. Try experimenting with the run_until_stalled method. This can speed up the build process.
  • Speaking of increasing speed, how fast can you make it? Optimize this robot and set a new world record!