P20 (the robot we built for PiWars 2020) had loads of improvements over P19 (the machine we entered for PiWars 2019). But most of the improvements were kind of… “incremental”: none of them resulted in a big performance increase. For PiWars@Home we decided there was opportunity for fundamental change.
So, we present P21; our machine for the 2021 games.

I know, it looks just like P20. But P21 has one big upgrade: it uses new motors. The motors have encoders, which, when combined with PID enabled motor drivers, allow much finer control. And since we’re expecting better control, we’ve gone for a 50% faster output shaft RPM so that the robot is faster too.
This change has taken a long time to complete since it has required some fundamental changes.
- Our designs employ an Arduino based peripheral control board which perform the low level, timing-constrained, jobs on behalf of the Raspberry Pi. We have replaced this board with a new one since each motor now requires a couple of digital signals from its encoder.
- The peripheral controller software has also been re-written. The motors are now interfaced via PID algorithms; this means that when the Raspberry Pi requests a motor speed (expressed as a percentage of full speed), that is what it gets. With the previous (pulse width modulated) control scheme, you get a vague approximation. At low speeds control is particularly poor with PWM systems where no motor speed feedback is employed (because of the friction that is inherent with gearboxes).
- The chassis has also been redesigned and re-printed since the motors are a different size.
There is one other difference between P20 and P21: the implement interface has been changed. P20 provided a bunch of servo outputs for implements; so, it is simple to connect servos with no further electronics. P21’s implement interface provides all the internal voltages (5.2v, 6v and the battery voltage) plus a two-way serial interface. This change was largely imposed by the toy box lift that uses motor pulses to measure the position of the jaws above the ground; the distance of travel is too much for a conventional servo. The new interface is far more flexible than the old system, but it requires every implement to have a dedicated control board. There’s no such thing as a free lunch.
P21’s hardware and low-level software is now largely complete. We now need to work back through the higher-level code in the Raspberry Pi to take advantage of P21’s increased performance. We’re hoping to see some big improvements soon!