Wow, the last post for Project Hugo was two years ago! A lot of work has happened in the interim but not much actual progress. In part my anxiety diagnosis earlier this year, as discussed in my previous post, plays a part as I’ve been getting my head sorted before tackling the head gaskets but mostly it’s because I’ve been hitting my head against the wall with the sodding engine!
The master-plan for Project Hugo is to take a Mini and modernise the hell out of it without ruining what makes it a Mini. So far I’ve had a few tweaks to the engine, the suspension has been replaced with more modern kit designed by the original designer, the wiring loom has been completely replaced and an electronic ignition fitted.
Sounds Promising But…
Here’s the thing, I’ve always said I’m better with electronics and computers than engines so I’ll leave the latter to those in the know. The problem with that approach is how will I ever learn if I don’t try? To break the cycle I thought I’d have a go at tweaking the fuel mix as the exhaust and spark plugs were sooty as hell. Very quickly I learned how not to tune a carb…
While troubleshooting this issue I discovered that though my Mini is supposed to have a ballast ignition I had a coil that was for a non-ballast car. It turns out that the when I ran out of fuel on the original drive home and my mate had to replace the coil this was likely the same issue! I decided to order a new coil and electronic ignition to make sure I had a kit that matched and cracked on, this was about a year and a half ago. I swapped them out without issue but despite my best efforts I have never got the sod to fire though I’ve learned a hell of a lot about how the engine works by understanding why it isn’t.
A New Plan
I went to EMF earlier this year and it was an unbelievable experience! I could waffle for hours about how awesome it was, and I’ve been known to do so, but one of the last talks I saw got me thinking. Engines are a bit of a dark art but the dark arts I know are computers and electronics…
Classic car, check. Modernising the crap out of it, check. Back to the Future reference, check. Guess what happens next?
I’ve had a look into it and Specialist Components have been building kits for the Mini for a while now that give electronic fuel injection and apparently it makes the car a lot more reliable, smoother to drive, more power and better efficiency too. Oh, also an auto-choke and a CAN bus interface for my digital dashboard!
From the rest of what I’ve learned in the work I’ve done so far I’m confident of getting this fitted and working and it’ll give me a big bit of knowledge to keep Hugo running for years to come too. I’m trying not to think about the twin cam upgrade ST do either but pretty sure that may be added to the list for big upgrades in the future along with the five speed gear box. Expensive but pretty much the ultimate upgrades I can do while keeping the original engine block.
So far this week I’ve done a load of work in the garage to get it tidy enough to work in and I’m going to start work on this in earnest later this week. Alongside the engine mods I need to fit an MPI fuel tank as mine doesn’t have a fuel pump, to support that a pair of new fuel lines and wiring for the fuel pump. Times like this I realise how much I’ve learned that I’m happy to tackle this rather than running scared! Pride before a fall and all that but fingers crossed.
This post is the first non-technical one I’ve done in a while and will discuss my mental health issues, the problems therein and how I’m mitigating them. I talk about things like this on Facebook, Twitter and even all-staff emails at work and I thought I’d finally pen something here. This will also cover some of my favourite life hacks I’ve collected over the years, mostly via Lifehacker, which have helped me a great deal.
First off, I’m not a mental health professional and if you think you need help, please please please seek it. This post will cover some of my issues, how I’ve dealt with them and maybe give some tips on helping you deal too but this isn’t a substitute for getting professional help.
Anyone who knows me will know I’ve had problems with sleep for a long time, since I was 11 or so. I chalked this up to puberty kicking in and then that just being how life is. I’ve also had issues with crowds, confidence, imposter syndrome, stress and who knows what else and I always assumed they were lots of different things that weren’t related in any way. I would get angry at the drop of a hat for the most inane of things, I would feel physically overwhelmed when in noisy rooms and generally feel constantly on edge. These weren’t related though, clearly it was just that I’d had a bad week, bad nights sleep, I’d eaten something that hadn’t agreed with me and so on, always able to rationalise it away and though I was trying to deal with each of them it was in isolation.
One day last year I cam across a video from ProjectUROK in which Wil Wheaton talked about his struggles with anxiety and depression. Now a lot of people thought his character in Star Trek TNG was irritating but I was young when I watched it so he was the character I associated with, a geeky kid with lofty goals trying to find his feet, so him talking about these issues I thought I’d give it a watch.
It really did hit me like a ton of bricks, all the little things and everything else swam in to focus. It still took me a few months of reading up on it and talking with friends but I finally went to see a doctor about it in January this year. She asked me a bunch of questions to get a idea of the severity and the results were pretty high. High enough the question was raised, “how the hell have you dealt with this so long?” and I’ve no idea in retrospect. I just kinda got on with life and hoped for the best but things were just getting worse. She referred me for cognitive behavioural therapy and proscribed some medication to dampen the physical symptoms and I was finally on the right track.
The Early Days
What I learned about my condition was that my fight or flight response was almost permanently active, this explains why I couldn’t sleep, either hid from problems or got angry at them and more besides and the medication mitigates that until the therapy kicks in. I didn’t quite have the epiphany that Wil Wheaton mentioned but after a few weeks I woke up one morning feeling odd. I couldn’t quite place it, but something had changed and I couldn’t for the life of me figure out what. After a few hours of pondering it occurred to me that the ache in my chest that I’d had for years had gone. I’d always chalked it up to a symptom of asthma but apparently not!
At the same time as this was happening my work health care added mental health cover so rather than tying up NHS resources I thought I’d take advantage of our health plan. Over the six months or so of sessions we talked about all sorts of things but mostly it taught me coping mechanisms on how to get out of the vicious mental loops I find it so easy to get in to.
Over time, things improved a great deal but I was still finding it really hard to maintain momentum and even get up on time still.
I’ve spoken about The Chain on here in the past and last time it didn’t really work for me, no idea what it was but something knocked me off my stride and I gave up on it. I came across this article that says that before building up to big changes make little ones so I thought I’d combine the two. I set myself the first of my little rules;
Have breakfast and watch some TV before work.
The key thing with this one was the TV bit as it forced me to get up early enough to be able to spare 22 minutes to watch an episode of 3rd Rock From the Sun, I figured starting a day with comedy was a good call. It worked in the week and I was getting up more regularly for work and not really feeling like I was sleeping better. After a month or so I thought I’d have another look at this one rule and break it down a little;
Get up and shower straight away
Watch something or read the blogs I follow
I also combined this with the chain to track how well I was doing and thought I’d add some evening rules too to allow me to get more done in the evening rather than just slump on the sofa.
Tidy for 25 minutes
Cook a meal and prep lunch for work the next day
Make or learn something for 25 minutes
The biggest change was getting up and showering straight away, I’m waking up a lot earlier now and actually have a sleep pattern. When I mentioned this on Facebook a friend shared a link to info on something called sleep inertia and it seems that the shower really speeds up recovery from sleep. If you are wondering why 25 minutes then see my earlier post on the Pomodoro timer I made. It’s also a mental hack as “It’s only 25 minutes, not even half an hour” seems easier to swallow.
After 21 days of this regime my blackboard looks as follows;
I missed one evening of making meals early on and figured today I’d earned a lie in. My flat is much tidier, I’m sleeping much better, I’m now known at work for being optimistic rather than cynical and I’m generally happier. I still have bad days but the list helps, my therapist once told me “you don’t have to feel like doing something to do something” and it’s all too true.
The days where I don’t feel like tidying or tinkering I do so anyway and when I wake up the next morning or get home from work to a tidy flat it really helps break the cycle.
The Next Steps
I figured that if it takes 21 days to make or break a habit then reviewing the rules every 21 days would make sense too so today I’ve taken stock and tweaked them as follows;
Not much of a change but that’s the point I guess, using this as a base for bigger changes was always the plan so making another small change makes sense and hopefully will help get my weight back down and keep it down. I’ve been using Bullet Journal on and off for years too and it really does help keep track of random tasks so making me update it more often can only be a good thing. I’m also planning on taking notes of things I’d achieved each day too as a reminder I’m still getting shit done.
Oh, and last month I got to say thank you to Wil Wheaton in person. They say never meet your heroes but I thanked him for sharing his story and told him it was the reason I got help. He turned to me and said “You’re very welcome. Depression lies” and gave me a reassuring smile. It was brief but glad I had the chance and he really does seem a gent.
A massive thank you to all my friends, family and colleagues who’ve supported me through all this and put up with me on the bad days before I knew what was going on. The epiphany that was the video got me started but you all kept me going.
So, that’s the story so far and I expect I’ll post updates to my rules as and when they happen. Until then I hope you all stay well or get the help you need. Oh, and I know I ended up with seven rules but I’m a Computer Scientist so off-by-one errors are kinda my domain…
The next post should cover the multi-room audio system I’m building so normal service should resume shortly!
In my previous post I talked about some issues I hit when I upgraded from Ubuntu 14.04 to 16.04, it wasn’t all plain sailing and in this one I’ll cover the issues I’ve had with getting Greyhole back up and running.
At the end of the last post I had my “missing” disks mounted and I mentioned I was moving data around. Thankfully the two disks that were mounting fine we’re two of my largest, 4TB and 2TB worth, the two that weren’t mounting are 2TB and 3TB, after deleting a load of old files and reducing the redundancy level on the non-critical shares it looked like I’d have just enough space to make things easier.
One at a time I ran the command to remove a disk from the pool and waited for Greyhole to finish balancing;
You can see what the Greyhole service is doing by running “greyhole –L”, one it tells you it is sleeping you can crack on with the second disk.
This completed and I was able to see my files from a remote machine via Samba, huzzah! The problem was the install wasn’t tidy any more, I couldn’t control Greyhole using the service command and the landing zones were on a disk I was intending to reformat. I tried unsuccessfully to fix it but decided to follow the steps to reinstall it in the end. From the perspective of the documentation this would be the same as migrating to a new machine.
First off I ran “sudo apt remove greyhole –purge” which removes the service with extreme prejudice and I then followed the standard steps to install as per this page. I restarted Samba and Greyhole after running the fsck command and lo and behold I got most my shares back online! Two were showing up fine, full of files, one was showing up but empty. This was my backups share which was a little worrying but I’d already backed it up to another machine so wouldn’t be a big issue to rebuild it.
It turns out that when I was configuring the smb.conf and greyhole.conf files I called the backup share “Backups” rather than “Backup” and this meant that Greyhole couldn’t find the files to make them accessible again. I fixed this typo, ran fsck again and they are now showing up.
Regarding the other two drives, it looks like I’d initialised them as zfs_members at some point and with Ubuntu 16.04 and they can’t be mounted in the same way. It’s a vaguely educated guess so happy to be corrected! To get rid of them I used the wipefs tool which strips the drive bare of partition signatures. BE VERY CAREFUL WITH THIS!
I ran “wipefs –all /dev/sdc” and “wipefs –all /dev/sdd” which seemed to do the trick. After that I followed this guide to format my drives using parted. I’ve no idea why but blkid still doesn’t show the UUID for the partitions I’d created but I took note of them from the output of the mkfs.ext4 command. I put them into fstab along with creating a folder to mount against with the other two drives and ran “sudo mount /dev/sdc1” and the same for sdd1, they then showed up!
Finally I added the two drives to the Greyhole storage pool by following this guide and ran “greyhole –balance”.
So I logged in to my home server recently and found in the MOTD that an upgrade from 14.04 to 16.04 was available. Being a bit cautious about things I asked a colleague if he’d done the upgrade and he had, the only issue he’d come across was for hardware I don’t use so thought I’d crack on.
That night I got home, ran do-release-upgrade, answered a few questions and left it to it. It carried on tinkering with one of my programming projects on my desktop PC and several hours later, tired after a satisfying nights hacking, I shutdown my desktop. Completely forgetting I had an SSH session open…
I promptly logged back on and checked my server, in HTOP there was a process at the top of the list that looked upgrade related so I left it to it overnight. Turns out that as I didn’t have screen installed there was no way to reconnect to that upgrade session which was an arse to say the least! I didn’t have a choice, that I know of, but to reboot. I did so and it kernel panicked on boot, something to do with not being able to mount something.
I loaded in to maintenance mode by selecting the advanced option on reboot and looked at what was or wasn’t mounted. It turns out two of my four disks weren’t being mounted by fstab on boot, I ran blkid and they weren’t listed either. I managed to find the following command on Ask Ubuntu which showed that the disks we’re still being detected which was a good sign.
sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL
I managed to manually mount the disks as EXT4 and could access the data so I figure this is a quirk of 16.04 I need to figure out. So far so good! I commented the two drives out of fstab and attempted a reboot, I got a bit further but ended up in maintenance mode again.
This time around I did some more digging and found the “apt –configure –a” command which reconfigures all the packages installed, this was recommended for interrupted installations and for me it worked a treat. I could now boot normally!
As previously mentioned I use Greyhole for file duplication across my disks, for long-time readers of my blog or those familiar with it it’s very similar in concept to Drive Extender on Windows Home Server, Greyhole wasn’t happy. First off it complained about PHP and MySQL errors so one by one searched for the error line and installed the missing packages. After that I managed to get Greyhole running against the manually mounted disks and I’m now moving data around so I can reformat the two odd ones out that are listed as zfs_members so I can get them in line with the others. That’s in progress and I’ll cover it in another post as this one has rambled on long enough.
It has certain been a learning experience and I’ve got nerd points from my colleagues for actually managing to fix a borked upgrade, apparently most people would just reinstall but I figured I’d have a stab at it. For a certified Windows fanboy I’ve certainly come a long way!
I thought I’d write up the steps I’d take to set up the Raspberry Pi 3 I’m using on my Roomba, including wifi and the rest, then discovered PiBakery and frankly this post writes itself!PiBakery is a tool for Windows and Mac which makes configuring a new Pi a block based affair. It keeps up to date with the latest version of Raspbian too. Basically you select blocks from the left hand side, change the values and once you are happy you write to an SD card by clicking “write”. As I’m running headless on the Roomba being able to configure without the faff of plugging in to a keyboard and mouse is brilliant, it’s a little thing but they add up.
From the screenshot you’ll see on first boot I configured the wifi, SSH key, changed the hostname and set the Pi to boot to console to save resources. I was dubious but plugged in the SD card, gave it power and sure enough it appeared on the network a few minutes later. The only step I took afterwards was to install XRDP which is handy for debugging and if I want to deploy new code to the Arduino directly from the Pi. You can install packages as part of the setup process too and I’ll certainly be doing that next time as I know what I want.
I’ve also used the same method with the PiZero to turn it into a USB gadget which worked a treat.
The DeskCycle has developed a squeel at certain speeds so I though I’d throw a tweet towards the manufacturers to ask how to oil it and to quote my distance too, I used a simple powershell script to get a CSV of the total distance for each day then threw it into Excel.
As of about half an hour ago I’ve cycled a virtual 3159 miles at an average 9.46MPH. Damn I need to add an odometer to my display!
The powershell script is as follows for those interested, it gets a list of all CSVs, gets the last line from each and spits it out into a new file. Very handy!
While I was doing the initial tinkering with the Roomba to figure out what made it tick I made a load of video logs more for my reference than anything. I’ve put them up on YouTube and will have to remember to carry on doing them…
Before I can rebuild Bumblebee, my 1st generation Roomba, I need to figure out how he works. I’m going to split this into three sections; Power , motors and sensors. I’m going to cover how to interface with each of these in future posts.
This was simple enough, I charged the battery and put a multimeter across the terminals, the battery showed 16v across the terminals.
A quick count shows that there are five motors. One for each wheel, one for the brush motor, one for the side sweeper and one for the vacuum. From the fact they all seem to have a black and red wire going into them and from the age of the device I took an educated guess and assumed they are simple DC motors. In order to test this theory I took the probes from my voltmeter, plugged them into my bench supply and poked at the motor terminals with the voltage and current limit set low. With this simple setup I was able to give the motors different voltages and easily reverse the polarity, sure enough the speed changed with voltage and direction changed with polarity. The wheel motors will need to run in either direction but the other three only need to run in one direction.
There turned out to be a lot more sensors than I realised and it’s quite a packed little robot! The sensors fall into two categories; IR sensors and switches. The microswitches are on either wheel and the caster wheel at the front, it looks like all three are currently wired to the same header so the robot knows only that one wheel is up and not which. The rest of the sensors are a bit more convoluted.
The drive wheels have an encoder each with four wires going in, once I’d opened one up it turned out that they are comprised of an IR LED and a light dependent resistor. I checked to see if they were IR by giving them just over a volt and there was no light, I then got out my phone camera and saw the telltale purple glow. Shortly after this I realised the error of my ways as the LED went out, without a current limiting resistor I burnt it out! Thankfully the LDR worked with visible light so I ended up replacing the LEDs on both sides with red ones.
Along the underside of the bumper there appears to be four cliff sensors, again IR LED/LDR combos which in this configuration are known as IR distance sensors. I’ve used these long ago when I built a PIC16F84 based robot at college so these aren’t a mystery. The resistance of the LDR varies depending on how much light bounces back, you need to calibrate them in your code or circuit but they are simple enough.
This is an IR distance sensor on the right hand side of the bumper, it works the same as the distance sensor.
This one confused me for a while as I couldn’t see any switches on the end of the arms of the bumper, I ended up taking the bumper out which required removal of the logic board and the penny dropped. At either end of the logic board there is an IR/LDR pair and when the bumper is hit the light level changes. I wondered to start with why they didn’t just use a switch but the video linked at the top of this page explained it all. A switch would be hammered that often it would fail in no time, the design of the bumper mount also cleans the area between the LED/LDR too which is handy.
On the top of the bumper at the front is a 360 degree lens which directs light on to an IR sensor of some kind, I’ve not dug deeper in to this one yet. I believe it acts like an IR receiver for a remote in a TV as it is used with the Roomba’s virtual wall. If the robot detects the IR code that is being sent out by the virtual wall it acts as though it hit a solid object, this is useful for preventing your hoover from escaping.
I’ll cover how I use each of the above in upcoming articles for each part above.
I’ve just realised that the .engineering TLD exists so I’ve bought neave.engineering and I’ve pointed it towards this site. The old neave-eng.com and jedibowler.com links will carry on working but this is the new URL and I can’t imagine it changing in a hurry!
Bumblebee is my Roomba, so named as long ago he lost his voice. About a year ago his logic board started playing up and though he was still able to clean, at the end of each cleaning cycle he wouldn’t go into standby and his battery would drain in no time. At that point he stopped actively gathering dust and started doing it passively as he sat behind my sofa.
Since a kid I’ve always wanted to build a robot and figured I’d kill two birds with one stone and use Bumblebee as a chassis for a mobile robot, he already is one after all, but also have the aim of returning his base functionality of being a robot hoover.
Bumblebee is an original model Roomba from 2002, he was a gift from a friend who knew I loved to tinker and gave me him broken. If I could fix him I could keep him, thankfully an easy fix as the battery was dead. This model is very simple in it’s function and behaviour, it has no mapping capability, no dock or wireless control. It apparently can be controlled using IR but I’ve never had a remote. It also lacks the diagnostics port that the newer models have that make hacking a Roomba really easy now so this is going to be a bit trickier, a lot more education and most importantly more fun!
The parts I’ve used to partially resurrect him are a Arduino Leonardo and an Adafruit Motor Controller Shield. I’ve also a Raspberry Pi 3 to add into the mix, for Wifi control and more processor intensive tasks. The idea is to use the two to thier strengths; the Arduino will control the motors and read the sensors allowing for real time override in case of collision and the Pi will be able to sit back and give out the orders. It’s a classic split for mobile robots but thankfully very cheap to implement now.
As I said I’ve been working on this for a while, I’ve a load of notes to type up and a loads of “learning experiences” to share. Mostly when I made a rookie error and burnt out one of the motor controllers… I’ve now got the motors under control over serial, I’ve also a simple console application that lets me drive him around and toggling the sweeper/vacuum fans on, here’s a video of him in action:
My next item to look at is getting sensor data into the Arduino, first up the encoders. Encoders are devices that allow you to measure the movement of a wheel, you’ve likely used a rotary encoder on a hifi to control the volume, and the Roomba has one is each wheel. Right now I can control how much power goes to each wheel but because of differences in the state of the gearboxes, carpet and who knows what other factors, the wheels spin at different speeds. By measuring the speed from the encoders we can compensate for this, we can also use them to calculate the distance we’ve travelled.
After that is the rest of the sensors, those I’ve found so far are;
Cliff sensors – these are under the bumper and detect drops to prevent him falling down stairs, I think there are four of them and they appear to be IR distance sensors
Bumper sensors – these detect collisions, I think there is one at either end of the bumper so I’ll know if I’ve hit something to the left or right
Wall sensor – another IR distance sensor mounted on the right of the bumper, this allows for wall following behaviour
Wheel up/down switches – One on each of the drive wheels and one on the caster at the front. They detect if the wheels are up or down and can be handy for detecting when we’ve beached ourselves.
Wheel encoders – these were IR LEDs and a light dependant resistor. I blew one of the LEDs by accident so replaced them both with red LEDs.
Beacon IR Reicever – Not sure how this works yet, it’s a 360 lens on the top that receives a beam from the virtual wall, a device you place by your door to stop him escaping, I’m hoping to add more sensors to make this redundant.
Buttons – there are three buttons for room size to start different cleaning cycles. They could be useful though I may not bother with them.
Once I’ve all the sensors connected I’ll be able to hook up the Raspberry Pi to start working on reproducing his original behaviour. After that I’ll be able to build up his capabilities over time and add a load of new ones too. I’m not intending this just to be a hoover but a mobile robot platform that happens to be able to hoover.
If you’ve got this far, kudos! That’s it for now, more posts will trickle out as i write up my old notes. I’m going to carry on having fun building things and write posts in the order they happened. Hopefully I’ll catch up fairly quickly!