Friday, 14 April 2017

Results Analysis

Curious as to how each category did in PiWars (Professional, Intermediate and Beginner), I've annotated the official results with the category of the team and their overall leaderboard position in that category. For example, "2 wheels or not 2 wheels" is "Pro 1", as the winning Professional. You'll note that "Beginners" top four out of the seven categories!

Obstacle Course
1 2 wheels or not 2 wheels (Brian Corteil) Pro 1
2 Maxeos (Alex Daily) Inter 4
3 PiSquared (Leo White) Pro 6
4 Team Steve (Jonathan Pallant) Inter 1
5 Team 3.14 Musketeers / Robot Bâtagnan (Mark Edwards) Beginner 4
6 Hitchin Hackspace (David Booth) Pro 5
7 Slice of Pi Club (Martin Eyre) Inter 6
8 SmartPi (David Plaquin) Beginner 11
9 CNM Hackerspace / Not Today Skynet (Kerry Bruce) Beginner 2
10 Little TREV (Matt Teague) Pro 7
11 Metabot3 (John Palombo / Lance Robson) Pro 3
12 Ipswich Makerspace / Robot Tractorbot (Keith Ellis) Pro 2
13 PiTastrophy (James Cohen) Pro 9
14 KEITH 3 – “Mostly Harmless” (Harry Merckel) Pro 4
15 Sunny Mk2 (Stevie Wray) Inter 5
16 Xero Chatterbot (Robin Blackstone) Beginner 7
17 Maidstone Hackspace (Ian Wilkinson) Inter 2
18 Team Heroes (David Searle) Beginner 9
19 Project BODSSK (Kayleigh Churchill) Beginner 10
20 ICRS (Tom Hartley) Inter 7
21 ZeroHero (Femi Owolade-Coombes) Beginner 13
22 Viridia (Tom Oinn) Pro 8
23 Gnasher – Revenge of the Fallen (Grahame Collins) Inter 9
24 Frankenrobot (Dulcie Turner) Beginner 6
25 Glitterator (Emma Norling) Beginner 5
26 The PiONEERS (Spencer Cummings) Beginner 3
27 Ely Makers (Arvind Shah) Inter 8
28 Radioactive Funky Chickens (Rob Westwick) Beginner 8
29 Seaford (Andrew Seaford) Inter 10
30 Mr Bit (Tom Broughton) Beginner 1
31 Team Cybercondriac / Robot sHazBot 2 (David Pride) Inter 3
32 Snapdragon (Ben Rogers) Beginner 14
33 Awesome Tech (Martin Evans) Beginner 12
34 Java Driven (Wesley Coffin-Jones) Beginner 15


The Minimal Maze
1 Mr Bit (Tom Broughton) Beginner 1
2 Glitterator (Emma Norling) Beginner 5
3 Metabot3 (John Palombo / Lance Robson) Pro 3
4 The PiONEERS (Spencer Cummings) Beginner 3
5 Frankenrobot (Dulcie Turner) Beginner 6


Slightly Deranged Golf
1 CNM Hackerspace / Not Today Skynet (Kerry Bruce) Beginner 2
2 Ipswich Makerspace / Robot Tractorbot (Keith Ellis) Pro 2
3 Team Steve (Jonathan Pallant) Inter 1
4 KEITH 3 – “Mostly Harmless” (Harry Merckel) Pro 4
5 Team Cybercondriac / Robot sHazBot 2 (David Pride) Inter 3
6 Sunny Mk2 (Stevie Wray) Inter 5
7 2 wheels or not 2 wheels (Brian Corteil) Pro 1
8 Slice of Pi Club (Martin Eyre) Inter 6
9 Maxeos (Alex Daily) Inter 4
10 Maidstone Hackspace (Ian Wilkinson) Inter 2
11 Team 3.14 Musketeers / Robot Bâtagnan (Mark Edwards) Beginner 4
12 Team Heroes (David Searle) Beginner 9
13 ICRS (Tom Hartley) Inter 7
14 Metabot3 (John Palombo / Lance Robson) Pro 3
15 SmartPi (David Plaquin) Beginner 11
16 Hitchin Hackspace (David Booth) Pro 5
17 Little TREV (Matt Teague) Pro 7
18 PiSquared (Leo White) Pro 6
19 Seaford (Andrew Seaford) Inter 10
20 Glitterator (Emma Norling) Beginner 5
21 Xero Chatterbot (Robin Blackstone) Beginner 7
22 Awesome Tech (Martin Evans) Beginner 12
23 Project BODSSK (Kayleigh Churchill) Beginner 10
24 PiTastrophy (James Cohen) Pro 9
25 Ely Makers (Arvind Shah) Inter 8
26 ZeroHero (Femi Owolade-Coombes) Beginner 13
27 Radioactive Funky Chickens (Rob Westwick) Beginner 8
28 Gnasher – Revenge of the Fallen (Grahame Collins) Inter 9
29 Mr Bit (Tom Broughton) Beginner 1
30 Frankenrobot (Dulcie Turner) Beginner 6
31 The PiONEERS (Spencer Cummings) Beginner 3


Skittles
1 Ely Makers (Arvind Shah) Inter 8
2 The PiONEERS (Spencer Cummings) Beginner 3
3 Metabot3 (John Palombo / Lance Robson) Pro 3
4 Hitchin Hackspace (David Booth) Pro 5
5 2 wheels or not 2 wheels (Brian Corteil) Pro 1
6 Ipswich Makerspace / Robot Tractorbot (Keith Ellis) Pro 2
7 Mr Bit (Tom Broughton) Beginner 1
8 Project BODSSK (Kayleigh Churchill) Beginner 10
9 Team 3.14 Musketeers / Robot Bâtagnan (Mark Edwards) Beginner 4
10 Maidstone Hackspace (Ian Wilkinson) Inter 2
11 KEITH 3 – “Mostly Harmless” (Harry Merckel) Pro 4
12 Little TREV (Matt Teague) Pro 7
13 CNM Hackerspace / Not Today Skynet (Kerry Bruce) Beginner 2
14 Glitterator (Emma Norling) Beginner 5
15 ICRS (Tom Hartley) Inter 7
16 Slice of Pi Club (Martin Eyre) Inter 6
17 Frankenrobot (Dulcie Turner) Beginner 6
18 Sunny Mk2 (Stevie Wray) Inter 5
19 Team Heroes (David Searle) Beginner 9
20 Gnasher – Revenge of the Fallen (Grahame Collins) Inter 9
21 SmartPi (David Plaquin) Beginner 11
22 Xero Chatterbot (Robin Blackstone) Beginner 7
23 PiSquared (Leo White) Pro 6
24 PiTastrophy (James Cohen) Pro 9
25 Viridia (Tom Oinn) Pro 8
26 Radioactive Funky Chickens (Rob Westwick) Beginner 8
27 Maxeos (Alex Daily) Inter 4


Straight-Line Speed Test
1 Mr Bit (Tom Broughton) Beginner 1
2 Maidstone Hackspace (Ian Wilkinson) Inter 2
3 KEITH 3 – “Mostly Harmless” (Harry Merckel) Pro 4
4 Team Cybercondriac / Robot sHazBot 2 (David Pride) Inter 3
5 Gnasher – Revenge of the Fallen (Grahame Collins) Inter 9
6 CNM Hackerspace / Not Today Skynet (Kerry Bruce) Beginner 2
7 Radioactive Funky Chickens (Rob Westwick) Beginner 8
8 Ipswich Makerspace / Robot Tractorbot (Keith Ellis) Pro 2
9 The PiONEERS (Spencer Cummings) Beginner 3
10 Metabot3 (John Palombo / Lance Robson) Pro 3
11 ICRS (Tom Hartley) Inter 7
12 Sunny Mk2 (Stevie Wray) Inter 5
13 Glitterator (Emma Norling) Beginner 5
14 Team Steve (Jonathan Pallant) Inter 1
15 Xero Chatterbot (Robin Blackstone) Beginner 7
16 Ely Makers (Arvind Shah) Inter 8
17 Little TREV (Matt Teague) Pro 7
18 Team Heroes (David Searle) Beginner 9
19 Team 3.14 Musketeers / Robot Bâtagnan (Mark Edwards) Beginner 4
20 2 wheels or not 2 wheels (Brian Corteil) Pro 1
21 Slice of Pi Club (Martin Eyre) Inter 6
22 SmartPi (David Plaquin) Beginner 11
23 ZeroHero (Femi Owolade-Coombes) Beginner 13
24 Maxeos (Alex Daily) Inter 4
25 Pithon (Nick Young) Inter 11
26 Hitchin Hackspace (David Booth) Pro 5
27 PiTastrophy (James Cohen) Pro 9
28 Project BODSSK (Kayleigh Churchill) Beginner 10
29 Seaford (Andrew Seaford) Inter 10
30 Frankenrobot (Dulcie Turner) Beginner 6
31 PiSquared (Leo White) Pro 6


The Line Follower
1 Team 3.14 Musketeers / Robot Bâtagnan (Mark Edwards) Beginner 4
2 Ipswich Makerspace / Robot Tractorbot (Keith Ellis) Pro 2
3 Team Cybercondriac / Robot sHazBot 2 (David Pride) Inter 3
4 Radioactive Funky Chickens (Rob Westwick) Beginner 8
5 ICRS (Tom Hartley) Inter 7
6 The PiONEERS (Spencer Cummings) Beginner 3
7 KEITH 3 – “Mostly Harmless” (Harry Merckel) Pro 4
8 Metabot3 (John Palombo / Lance Robson) Pro 3
9 Frankenrobot (Dulcie Turner) Beginner 6
10 Viridia (Tom Oinn) Pro 8
11 Team Steve (Jonathan Pallant) Inter 1
12 Seaford (Andrew Seaford) Inter 10
13 PiTastrophy (James Cohen) Pro 9


PiNoon
1 2 wheels or not 2 wheels (Brian Corteil) Pro 1
2 Xero Chatterbot (Robin Blackstone) Beginner 7
3 Sunny Mk2 (Stevie Wray) Inter 5
3 Frankenrobot (Dulcie Turner) Beginner 6

Monday, 3 April 2017

It's a win for Steve!

What a weekend. I'm exhausted! At this time we're still waiting on the full results breakdown, but in the Intermediate category, Team Steve managed a 3rd place, a 2nd place and a 1st place (for the Slightly Deranged Golf)! The three placings (plus, I guess, points elsewhere - I don't know yet) were enough to put Steve, the dog/robot at the top of the rankings for the Intermediate category. I wouldn't have believed it was possible looking at the pile of scrap parts I had on my desk at the middle of last week, so the moral is - never give up!

Here are some photos from the day:

Steve waiting to see the judges.

The one and only, Dr Lucy!
And a couple of videos, starting with Steve playing golf:







The prize bundle I received was pretty epic. Thank you so much to all the sponsors - it really is incredible how generous they've all been. I found (in not particular order):

Not forgetting of course, the fabulous trophies:

Om nom nom nom ... tasty trophy ...

What a day.


Saturday, 25 March 2017

Yay, driving!

Haven't done this in a while. It feels good!

A few brief notes on Steve 2.0:

Raspberry Pi Zero W
Arduino Pro Mini (4x PWM output/quadrature input/current sensing)
Dagu Rover 5 four-motor chassis
Dagu speed controller
5V USB 'phone charger' power for the electronics
6xNiMH AA power for the motors
CSR Bluetooth USB dongle (the Pi Zero W bluetooth is not reliable for me)
PlayStation 3 SIXAXIS remote control
Nokia 5110 LCD with speed/current status display and on-board menu function

To add - 3x Ultrasonic sensors and 2x IR line sensors.

 

Motor test

Humm. Wired up the Arduino but something's not right...

Saturday, 18 March 2017

Flashing an AVR from a Raspberry Pi

It seems things have changed a bit since I last worked with an Arduino on a Raspberry Pi - plus I've forgotten a load of stuff. This is a note to myself, more than anything.

  1. You can install avrdude with sudo apt install avrdude.
  2. On a Raspberry Pi 3 or a Pi Zero W, the /dev/ttyAMA0 UART is used for Bluetooth. The GPIO pins are instead mapped to /dev/ttyS0.
  3. The Arduino Pro Mini (5V/16MHz) has an AtMega328P and the bootloader runs at 57,600 bps.
  4. You can find the built .hex file in /tmp/build*.
  5. The avrdude flash command line is:
avrdude -p m328p -c arduino -P /dev/ttyS0 -U ./path/to/file.hex

Wednesday, 28 December 2016

Robot progress

Well, best not let perfect be the enemy of good. While the Freescale board is clearly better, it doesn't actually work. So here is my new Dagu controller board being run from an Arduino. The speed sensor seems to work too - much less jitter than before.

Also, top tip. Don't try to run your DCC railway with this board - it will catch fire. I don't think it like 10,000 direction changes a second.

Friday, 2 December 2016

Target practice

Now, as we know, the original Raspberry Pi uses an ARM11 core, which is based on the ARMv6 architecture. The Raspberry Pi 2 uses quad Cortex-A7 cores (although it's actually just been updated to have the same chip as the Pi 3 for volume reasons) which are based on the ARMv7-A architecture while the Pi 3 uses quad Cortex-A53s which are based on the ARMv8-A architecture.

So what do this have to do with Rust?

Well, in two ways really. One is that the compiler is downloaded as a binary, and it the instructions encoded into the machine code need to be ones that that processor core can understand and execute. Helpfully, the ARM architectures are backwards compatible, so the Pi 3 can run code compiled for an original Pi 2 and both can run code compiled for an original Pi.

The second is in the choice of instructions the compiler chooses to emit. Now, by default, you would expect this to be the same as the compiler itself was compiled to - after all, 9 times out of 10 you're going to run the code on the machine you're using to compile it. But that 1 time in 10, someone may well be cross-compiling. For example, I do a lot of embedded development and I will use my x86_64 laptop to emit binaries which will execute on the ARMv7E-M architecture of my favourite Cortex-M4F based embedded development board.

So, with that in mine, some advice.

When you run rustup on a Raspberry Pi (or any other Linux machine), it will detect the processor architecture and download the appropriate compiler. That compiler will then default to outputting binaries which target the same architecture. Here's the list of available architecture/OS/C-library combinations for I could install today (from https://static.rust-lang.org/dist/channel-rust-stable.toml):

rust-1.13.0-aarch64-unknown-linux-gnu.tar.gz
rust-1.13.0-arm-unknown-linux-gnueabi.tar.gz
rust-1.13.0-arm-unknown-linux-gnueabihf.tar.gz
rust-1.13.0-armv7-unknown-linux-gnueabihf.tar.gz
rust-1.13.0-i686-apple-darwin.tar.gz
rust-1.13.0-i686-pc-windows-gnu.tar.gz
rust-1.13.0-i686-pc-windows-msvc.tar.gz
rust-1.13.0-i686-unknown-linux-gnu.tar.gz
rust-1.13.0-x86_64-apple-darwin.tar.gz
rust-1.13.0-x86_64-pc-windows-gnu.tar.gz
rust-1.13.0-x86_64-pc-windows-msvc.tar.gz
rust-1.13.0-x86_64-unknown-freebsd.tar.gz
rust-1.13.0-x86_64-unknown-linux-gnu.tar.gz
rust-1.13.0-x86_64-unknown-netbsd.tar.gz


There's four ARM toolchains listed. What gives?

Well aarch64 is the 64-bit ARMv8-A toolchain. You'd use this if your Raspberry Pi 3 was running that new 64-bit release of OpenSUSE or some other 64-bit Linux distribution. It probably isn't.

The armv7 toolchain will run on a Pi 2 or Pi 3, but not a Pi 1 or Zero. This will be automatically selected if you run rustup on a Pi 2 or Pi 3 so be warned if you swap SD cards between various models - this will instantly crash on a Pi 1 or Pi Zero.

The two arm versions are for the two floating point ABIs (application binary interface) - basically, whether the code expects floating point arguments to functions to be placed in hardware floating point registers (gnueabihf) or in standard integer registers (gnueabi). Raspbian requires gnueabihf, while standard Debian for the ARMv6 I believe requires gnueabi. That's one of the reasons for the Raspbian recompile of Debian in the first place - gnueabihf is faster, but it does require your CPU to have hardware floating point registers (which the original Pi does).

Now if you've set yourself up on a Pi 3 but want to run code on a Pi Zero, you can keep you shiny fast compiler but tell it to emit code for a different 'target', like this:

pi@boron:~/livedemo $ rustup target add arm-unknown-linux-gnueabihf
info: downloading component 'rust-std' for 'arm-unknown-linux-gnueabihf'
 61.0 MiB /  61.0 MiB (100 %)   4.1 MiB/s ETA:   0 s              
info: installing component 'rust-std' for 'arm-unknown-linux-gnueabihf'
pi@boron:~/livedemo $ cargo build --target=arm-unknown-linux-gnueabihf
    Compiling livedemo v0.1.0 (file:///home/pi/livedemo)
    Finished debug [unoptimized + debuginfo] target(s) in 7.8 secs
pi@boron:~/livedemo $ ls -l target/
total 8
drwxr-xr-x 3 pi pi 4096 Dec  2 15:49 arm-unknown-linux-gnueabihf
drwxr-xr-x 7 pi pi 4096 Dec  2 16:36 debug
pi@boron:~/livedemo $

Now you have a Pi Zero compatible binary in target/arm-unknown-linux-gnueabihf/debug.

Your other option, if you want to share your SD card between a Pi 1 and a Pi 2/3 is to install the arm toolchain and remove the armv7 toolchain. You'd use a command like "rustup toolchain install beta-arm-unknown-linux-gnueabihf" to do that - I'll leave it as an exercise for the reader.