MacFeegle Prime – Overview

This is definitely going to change with time but this is the current vague, but slowly solidifying, plan for MacFeegle Prime, my competitor for PiWars 2020!

Concept

This robot is heavily inspired by Johnny Five from Short Circuit. To that end, it’ll be tracked, have a pair of arms, a head, and shoulder mounted nerf cannon. There will have to be lasers and blinkenlights in there somehow too! The demeanour and style of the robot will be very heavily influenced by the Wee Free Men from Terry Pratchett’s Discworld series… No, I’m not sure what that’s going to look like either but I’m looking forward to finding out!

Cover of Wee Free Men, pretty sure this is fine under fair use…
Original Designer, Paul Kidby
By Rik Morgan (Rik1138, http://www.handheldmuseum.com) – http://props.handheldmuseum.com/AuctionPics/Johnny5_03.jpg  CC BY-SA 1.0, https://commons.wikimedia.org/w/index.php?curid=2693174

Hardware

Unsurprisingly this will primarily run on a Rasbperry Pi, this will take data from the controller, sensors, and cameras then send appropriate control signals to the motors, servos and lights.

As he has a head, I was planning on using a pair of cameras. The “simple” option is just to stream these over wifi to a phone and use a Google Cardboard headset to get a 3d live stream from the robots perspective. Longer term I’ll be using OpenCV or similar to generate a depth map to allow for autonomous navigation and object detection. I was thinking of using two Pi Zeros with cameras attached, they could be dedicated to rescaling and streaming at different qualities for streaming to a HMD (head mounted display) or lower quality stream to another Raspberry Pi that could use OpenCV on them. In the end, I went with the Stereo Pi as they are designed for this very task! To that end, I’ve the Delux Starter kit on order that includes a Raspberry Pi 3 Compute Module and a pair of cameras with wide angle lenses.

Motors are controlled via an Arduino with a motor shield, in this case an Adafruit Feather and motor wing, and they are connected to a pair of PiBorg monsterborg motors and these are beasts! I started off with motors from an RC car and they rapidly hit the limit of what they could move. The robot already weighs 1.6KG…

For the arms I’ll be using servos, a whole bunch of them! I’m aiming for 7DOF arms, which is the same as humans, with the shoulder servors being a more powerful than the others as they’ve more weight to move around. The head and nerf cannon will also have a pair of servos for moving them around, the torso will need to be actuated too but I’m probably going to use a motor for that as it’ll left the whole weight of the robot from the waist up. To control all of these I’ve an Adafruit 16 servo hat, I may need another…

For sensors I’ve a load of ultrasonic sensors, inertial measurement units and optical sensors. The ultrasonic sensors will be good mounted aroudn the robot to get a decent set of returns to create a map from, the IMUs will be good to check if the motor is level and where it’s moving, and the optical sensors should be handy for line following. These will almost certainly be fused together via an Arduino. This means that the real time bits can be done on dedicated hardware and we don’t have to worry about timing issues on the Pi as it isn’t real time.

Software

I’m expecting to use Python for the lions share of the code for this, the Pi, StereoPi, and the servo hat I’m using have excellent support for this and I’ve a bit of experience with it already. The Arduinos run C and if I need to write something for the phone to enable a head up display I’m going to use the Unity games engine which uses C#. It’s what I use at work and I know both Unity and C# very well.

Construction

I’m using an aluminium plate for the base of the chassis and 3d printing custom components to mount to it, currently all hot glued in place with rapid prototyping/laziness…

Timescale

I’m close to having the drive part of this done, at least the first iteration, and I’m expecting that to be sorted over the next few weeks. There will no doubt be improvements over time so it’ll not be a one shot thing. For the torso, arms and head I’m aiming to get the first iteration of those sorted by the end of November. This will give me plenty of time to improve things and get the software written for next March too.

That’s it for now, it’s mostly a brain dump while I work on things in more detail.

I’m going to (Pi)War!

It’s been a while since I’ve posted here, I’ve fallen in to the trap of just posting to my Facebook page, but I have big news.

I’m going to PiWars 2020!

I put together a design and application for the event and I was accepted in to the intermediate category with my robot MacFeegle Prime!

Have you ever wondered what would happen if Johnny Five, desperate for input, ended up in the mound of the NacMacFeegle? Well, stay tuned and you’ll find out!

I’ll put together a more detailed post soon but here are the design sketches and the latest photo of the chassis. Follow me over on my Facebook page for more up to date posts!

Blood Donation and Anxiety

This is mostly a note to my future self for next time I give blood but if you don’t already and are able to do so, please also give blood!  You know, to hospitals rather than in a jar as a gift…

It’s the day after and you are pretty damn anxious, also your legs are a bit wobbly.  You also forgot to take your meds yesterday you fool which could be a factor but it doesn’t normally bother you.  You were tired as hell last night and couldn’t sleep but that could just be normal background insomnia too.

Basically, next time you have given blood come back and read this so you can see if there is a pattern!

Yours, as always,
Past-Keegan

Docker, A Reverse Proxy, This Site and LetsEncrypt!

The site was migrated to SSDNodes last year as my previous host was becoming less reliable and I fancied something more versatile.  I’ve not covered it on here but here is how my site runs, now with added HTTPS thanks to LetsEncrypt!

A bit of history.  This is a WordPress site and has been since it was migrated from Windows Live Spaces which shows it’s age!  There is an official Docker container available so I thought I’d give that a go.  I may want to host more than one site on the same virtual server at some point so looked in to my options for a reverse proxy and jwilder had the perfect solution it turned out.  Building on an example I found I managed to get the site going behind the proxy but wanted to secure it.  Unsurprisingly this problem had already been solved too…

Follows are my Docker Compose files that work a treat, as much as examples for others as to help me in the future if I need to set up a new site or rebuild this one if something goes wrong.  When the container for the site is fired up for the first time it creates, and maintains, a Lets Encrypt certificate automatically.  Neat!

One thing for VaultPress users to be aware of is that you’ll need to follow the steps here under the reverse proxy section otherwise the service won’t be able to connect to your site to back it up.

If I need to host a new site, I just need to create a new site definition file and it should sort itself out.  Please note, the formatting may be screwy if you copy and paste these so you may need to manually tweak them.

neave-eng.yml

version: '2'

services:

neaveeng:
 depends_on:
 - mariadb
 image: wordpress
 links:
 - mariadb:mysql
 environment:
 WORDPRESS_DB_PASSWORD: [YOURDBPASSWORDHERE]
 WORDPRESS_DB_NAME: wp_neaveeng
 APACHE_RUN_USER: wp-neaveeng
 APACHE_RUN_GROUP: wp-neaveeng
 VIRTUAL_HOST: neave.engineering
 LETSENCRYPT_HOST: neave.engineering
 LETSENCRYPT_EMAIL: my.email@domain.com
 volumes:
 - ./neaveeng/code:/code
 - ./neaveeng/html:/var/www/html
 - /etc/passwd:/etc/passwd:ro
 - /etc/group:/etc/group:ro
 restart: always

mariadb:
 image: mariadb
 environment:
 MYSQL_ROOT_PASSWORD: [YOURDBPASSWORDHERE]
 MYSQL_DATABASE: wp_neaveeng
 volumes:
 - ./neaveeng/database:/var/lib/mysql
 restart: always

proxy.yml

version: '2'

services:
 nginx-proxy:
 image: jwilder/nginx-proxy
 ports:
 - "80:80"
 - "443:443"
 volumes:
 - /var/run/docker.sock:/tmp/docker.sock:ro
 - "/etc/nginx/vhost.d"
 - "/usr/share/nginx/html"
 - "/etc/nginx/certs"
 restart: always

letsencrypt-nginx-proxy-companion:
 image: jrcs/letsencrypt-nginx-proxy-companion
 volumes:
 - "/var/run/docker.sock:/var/run/docker.sock:ro"
 volumes_from:
 - "nginx-proxy"

whoami:
 image: jwilder/whoami
 environment:
 - VIRTUAL_HOST=whoami.local
 restart: always

Bass Guitar Rebuild

Just after Christmas I bought myself a new bass guitar, an Ibanez GSRM-20B in a walnut finish.  It was supposed to have a dark stain that allowed the woods grain to shine through but it didn’t work out that way and was almost black.  Now refinished using elbow grease and danish oil, I’m very happy with how it turned out!

 

Hictop 3DP-18: Marlin FW Example Configuration

I’ve been quiet on here for a while but anyone how follows me on Facebook will know I’ve not been idle, one of the things I’ve been working on is getting my Hictop 3DP-18 printer running stock Marlin Firmware.

The main reason for doing this is that despite the Open Source basis for the Hictop Prusa i3 the firmware for is isn’t readily available.  Some have had some success getting hold of a copy but I couldn’t be bothered with that for a few reasons, namely that the stock firmware seems to be based on an older version of Marlin and didn’t include any of the new hotness in v1.1 like Unified Bed Leveling!  UBL is a combination and culmination of a number of other bed leveling techniques and I thought it may help me get my printer more stable by making it more forgiving, so far it seems to work a treat!

The example configuration can be found on my GitHub repo here, I’ve submitted a pull request to the main repository for the project but not sure when what the time scale is for approval.  I’ve reviewed a pull request for a friends project before but this will be my first contribution to a major Open Source project!

One thing I haven’t enabled in my configuration is the filament runout sensor, this is because I noticed that it was creating a lot of drag on the filament which was starving, for lack of a better word, the extruder and the reasons why is explained in this video.

Example Config Link

Nerf Gun Shooting Gallery

This is a work in progress as it has turned out to be far more complicated than I thought it would be! I’ve learned a lot about how to design parts for my 3d printer and how to use the laser cutter at Reading Hackspace too though so already winning!

Over the passed few years my friends in the Reading Beer Festival Games Team have been talking about building a shooting gallery using Nerf guns to keep things nice and safe.  This year I offered to give it a go and the spec quickly escalated/became more fun!

As I’m building this more for the team than the players it needs to be easy for them to use while dealing with the festival punters who are typically moderately inebriated…  Resetting the board easily, keeping track of the score and setting up for the next game seems like the three things to concentrate on.

The game works, or will work, as follows:

  1. Press the start button, the counter should reset along with the targets
  2. Give the player a Nerf gun and a clip with 12 darts
  3. The player shoots the targets, which reset once hit, and the score is tallied

Having a bunch of clips that have 12 darts and a button that resets the game means resetting should be a lot easier than having to do it manually so that’s easy win, enter the Arduino!

I bought a bunch of hobby servos of eBay to use to reset the targets and designed a hinge with a magnet to hold up the target and a switch of some kind to track when a target is hit.

I’ve got a design working for the hinge but need to replicate it for all five targets.  More details once it’s complete but here’s an incredibly satisfying video of the mechanism in action!

Automated Broadband Monitoring on Linux

I’m trialing a 4G home broadband router at the minute to see if it can give me decent upload as apposed to the 1mbps I currently get so I thought I’d look into automatically running speedtests.  Here’s how and it turned out to be quite simple.  Caveat, this runs on Linux.

There is a really handy command line util for running Speedtest.net which is a Python script.  To install it run: “sudo pip install speedtest-cli”

If you don’t have pip or python installed run this: “sudo apt install python-pip”

This will install pip and the prerequisites, one of which is Python itself.  Next up, in your home directory, run “speedtest-cli –csv-header >> speedtest.csv”.  This will create an empty CSV with only the headers in it.

Next up, and finally, run “crontab -e” and enter “*/10 * * * * /usr/local/bin/speedtest-cli –csv >> ~/speedtest.csv”.  Thanks to this thread for giving me the answer as to why it wasn’t working to start with.

That’s it!  Every 10 minutes a speedtest will be run and the results appended to the csv file.  Load it up in a spreadsheet program and job done.

It isn’t a long term solution as that csv will get unweildy after a while but this is a two week trial so not an issue.  I’ve an aging Raspberry Pi B hooked up to the router and will check the results in a day or so to see what the connection is like without anything else on it.

3D Printer Built!

As long time readers of the blog may remember I tried to build a 3d printer many years ago without any success.  The problem was that at the time I didn’t really have a need for one, didn’t know what was involved or what parts I actually needed.  I also bought printed parts from one person on eBay, the metal bits from another seller, the electronics from another group again and so on.

Needless to say this did not make for an enjoyable experience.

Every time I got into building it I hit the point where I realised there was a part I didn’t know I needed and I’d put it aside for a few months.  Rinse and repeat.  It got to the point where the printer I started to build was obsolete so I’d have had to start again anyhow, so I donated what parts I had to the local RepRap usersgroup and they used it to build a printer for a local school.  I was happy with that.

Fast forward to now, or at least a few weeks ago, and I had need of a few random parts.  A case for a Pi, bits for the Roomba rebuild, bits for the Mini, the list is ever increasing this time around!  To that end I bought a Hictop Prusa i3 from Amazon which included everything which meant the whole project was instantly more streamlined!  One weekend of hacking, unhacking and rehacking later and I have a working printer!

I’ve printed out a few things now from Thingiverse but I’ve also started designing someone from scratch, more details on that soon, but this is proving a wonderful experience!