Wilsobotics

Which is more accurate - Pybricks or Lego's firmware?

by Evan Dave

FTC Team #27883

Here is a simple test to benchmark if Pybricks is more accurate than Lego’s firmware. Pybricks is an alternative coding interface for Lego hubs, here is its website: https://pybricks.com/

Using Pybricks, you can code your runs in Python for free, but you have to pay for the word block interface.

The test

In the test, we used the advanced drive base. Then, using both Pybricks and the default Lego interface, we programmed the robot to go forward 70cm, turn 180 degrees, then go forwards 70cm and turn 180 degrees again. It should have ended up in the same place.

We did this test on my immaculately clean mat.

On the side of the robot we have a blue L-beam, positioned on this black line at the start of the test, like this:

The more inaccurate the robot is, the further the blue beam will be from the black line.

To keep the test fair, we controlled these variables:

  • We used the advanced driving base robot only
  • Both tests were done at 100% battery
  • In both tests the robot was set to max speed.
  • We did this test with both Pybricks and the default Lego interface.

    Test with Pybricks

    The robot started here:

    …and ended here:

    It is very close to the original starting position, with the blue beam only slightly off the black line. You can see that Pybricks is very accurate indeed. Now time to compare it to the Lego interface:

    Test with Lego’s interface

    We programmed the robot to do the same thing but with the Lego interface instead of Pybricks. Here is where it started:

    …and here is where it ended:

    The robot isn’t even close to where it started. The Lego interface is incredibly inaccurate.

    What we can conclude

    The accuracy that Pybricks offers out of the box is far better than Lego’s own interface and it’s not even close.

    Maybe with a bit more tinkering, you could get the Lego interface to be more accurate, but this is just a comparison of the out-of-the-box accuracy that the 2 interfaces offer. And anyway, it would still be incredibly hard to get the Lego interface to be as accurate as Pybricks, for a few different reasons. For example, Pybricks also takes into account the distance between the robot wheels when making its calculations for movement, but Lego simply does not.