The A9

The A9 is an unusual road – it has it’s own website!

OK, to be fair, the website is actually for the A9 Road Safety Group (RSG) but their sole focus is on making the A9 safer :-) The site provides a lot of details and shows their suggestions (now implemented) to make the road safer together with the various documents they have used to make their decisions. Many of these are the usual documents provided by political bodies, such as the RSG, and are therefore of limited interest. One or two are useful and worth a read.

One fact that quickly comes to light is the reliance on the experiences of the A77 speed camera implementation for comparisons. The roads are very different in nature and usage, but it’s unclear how much allowance for these facts has been made.

The A9 can be a frustrating road. Large sections are single carriageway, with limited visibility through woodland. It’s a busy road with a large proportion of users unfamiliar with the road and travelling long distances. The unfamiliarity combined with the distances inevitably leads to frustration, which in turn leads to many instances of poor overtaking – usually at low speed! For regular A9 travellers the experience of rounding a corner and finding a car coming towards you on the same side of the carriageway isn’t unusual. Often the slow speeds involved are the saving grace, but the frustrations and dangers are only too apparent.

Over the past few months average speed cameras have been added to much of the A9 with the aim of reducing the number of accidents. As speed has rarely been a factor in the nearest misses I’ve experienced I find the decision a little strange.

By way of comparison, the A77 already has large sections “protected” by average speed cameras. As with many people I found myself spending too much time watching my speed rather than looking at the road when using the A77, which given the complexity of the road struck me as being a negative for safety.

One aspect shared by both the A9 and A77 is the confusing and overwhelming number and placement of signs. Approaching junctions it’s not uncommon to find 5 or more signs, all essentially giving the same information. The placement of the signs seems decreed by committee and often signs cover each other or are obscured by vegetation. Given the obsession that exists on the A77 (and in Perth and some parts of the A9) for limiting turn options for lanes, correct lane discipline is important but often awkward and a last minute decision unless familiar with the junction due to the sign issues. Couple this with obsessive watching the speed and it’s a wonder more accidents don’t happen.

Average speed cameras are “fairer” than the instant ones that used to be used, but are they really a good solution for the A9? Monitoring the speed of a vehicle provides a single data point, albeit one that can be objectively measured. Police patrols provide a more subjective measurement of a vehicles behaviour, but they require police officers with all the issues that they bring. It’s a shame that the cameras, with their continuous monitoring of traffic and ability to generate as many tickets as required, has made them the only solution now considered for many organisations.

Of course, alongside the speed cameras the A9 group have also lifted the speed limit for HGV vehicles in an effort to reduce tailbacks and the frustrations that accompany them. It’s an interesting approach, but the usual relationship between speed and energy applies to accidents involving HGVs, so any accidents that take place involving HGVs will be more likely to cause injury. Where the balance between reducing the number of accidents and the additional injuries caused cannot be known at present, but it will be interesting to reflect on.

Another aspect of the introduction that seems strange is the placement of some of the cameras. One of the average speed zones has it’s finish just before one of the most dangerous junctions I regularly pass. The addition of warning signs for turning traffic (that only rarely work and are dazzlingly bright when it’s dark) has been rendered irrelevant as cars now accelerate away from the average speed zone straight into the path of right turning traffic. Moving the zones by a small amount would have avoided this – so why was it not done? Such inattention to detail does not bode well for a multi million pound project that is meant to save lives.

As anyone who drives regularly will attest, the safest roads are those with a steady, predictable stream of traffic. Introducing anything that interrupts the predictability of traffic increases the risk of accidents. Sticking speed cameras at seemingly random locations on roads seems like a sure fire way of doing just that. The sudden braking and rapid acceleration that accompanies such sites is often the trigger for accidents. Following the installation of the cameras on the section of road I travel almost daily, changes in behaviour have been obvious and the near collision between a van and car that I witnessed a few days ago was the first – and closest – I’ve seen in months. Hopefully it’s just a transitional thing and people will adjust.

I’m certain that the reports published will support the decisions made by the RSG, after all that’s the beauty of statistics :-) It would be nice to think that they would publish the “raw” detailed information about incidents and accidents, but so far I’ve been unable to find any place online that has such data. If anyone knows of such data then I’d love to have a look at it and try and do something with it, though I suspect that this will be a pipe dream.

All these changes have been described as temporary, meant to provide additional safety while the plans for changing the entire A9 into a dual carriageway are developed and implemented. The fact that several of the average speed camera sites are on existing dual carriageway sections would tend to imply that they will be a permanent fixture. The continuing income from the cameras will no doubt be welcome, even if they don’t provide much improvement in safety.

Arizona Road Trip, Day 2

The Plan

From Phoenix, AZ we planned to head to the Petrified Forest National Park before continuing to Chinle, AZ.

The Route

Our route was to take the AZ-101 Loop East from north Scottsdale to E Shea Boulevard. We took E Shea Boulevard east until reaching AZ-87 North to the intersection with AZ-260 E. When we reached the intersection with AZ-277N we turned left and continued north for around 7 miles before turning onto AZ-377N to Holbrook. After lunch in Holbrook we then followed the signs to Petrified Forest entering via the southern gate.

From the Petrified Forest we were going to the I-40 E and then US 191 N to Chinle.

The Day

The weather was terrible when we left Phoenix. Much of the road from the hotel to the AZ-101 Loop was covered in brown water. The rain had started overnight and regular flash flood alerts from our mobiles seemed to suggest it wasn’t stopping soon. In fact as we drove the reports on the radio suggested it was very unusual and we would later hear it referred to as the “hundred year storm“.

Rain!Rain!

Our choice of car suddenly seemed like a good one as the 4 wheel drive and the additional ground clearance made the drive easier than it could have been.

Our transport

Throughout the drive to Holbrook we were dogged by rain and overcast skies, but as we approached Holbrook the sun appeared and the rain stopped. After a quick lunch in Holbrook we drove to the south gate of the Petrified Forest National Park with the idea of driving north through the park and exiting onto I-4o.

Pictures from our trip through the park are online here.Petrified Tree

The pictures we had seen before we travelled didn’t do full justice to the park. It’s a fantastic location with truly amazing scenery and seems surrounded by the phenomenal horizons that the area is famous for. Throughout our visit the sky was overcast with only occasional bursts of sunshine, so my pictures don’t really capture the colours or atmosphere.

The Tepees

The northern exit from the park is at the Painted Desert Visitor Centre and from there we took the I-40E to US-191N onwards to Chinle where we stayed at the Holiday Inn just outside the entrance to Canyon de Chelly.

Not long after we left I-40 our mobile phone service stopped, and this was the case until arriving in Page, several days later! Apparently if you have an international mobile this is the case in Navajo territory as the mobile provider does not have any international agreements. While we routinely had WiFi, the lack of easy mobile use did prove to be inconvenient on a few occasions.

 

Detective Story

A little while ago, someone who knows we are both interested in photography gave us a camera that had been in a lost property box for a while and asked if we could find it’s owners. I wasn’t present when the actual exchange took place, but it ended up at our house and sat on a shelf until the other day when things were explained to me.

So, this is what we were given.

Lost Camera

It’s a Sony TX-5. The battery was totally dead when I started looking at it, but we have, by chance, a Sony charger that fitted the battery and so have been able to charge it.

The SD card was 8Gb and contained a lot of pictures, starting in Dec 30th 2010 – was it a christmas present?

There is no name given for copyright in the EXIF data, so I started looking at the pictures to try and find the owner.

I found a car with a legible number plate, but as it looked like a holiday this was probably a rental car.

Discovering that there was a wedding and I could identify the venue, I started to get my hopes up. the venue is still going, had a web page and so I sent an email with some details in the hope they could help. Sadly they couldn’t as the venue has changed hands and no records are available for the date.

Next stop was to look at the recurring pictures of a street. I assume it’s where the owner lives and by looking at street signs and using Google I’ve been able to narrow down the house the pictures were taken from to 2 houses. As the house is in Orgeon and I have no way of getting more information, I sent an email to the local police department – who replied and are looking into what they can do!

Sat, 27th Sept 2014

The property that I identified was in Medford, OR – which is a long way from Scotland! As I wasn’t able to follow up myself I sent an email to the Medford Police Dept hoping that they may be able to assist. The enquiry was passed to Gena Criswell who responded in the best way possible – by offering to help! After a few emails and a few additional pictures being supplied she was able to contact someone from the pictures who confirmed the camera belonged to her brother! Yes, after all this time it’s owner has been identified.

I’m waiting for her brother to get in touch and will then arrange to send the camera to him.

I still can’t really believe that this has had such a good outcome, but a large portion of that is down to the amazing efforts of Gena and the Medford Police Department.

Mon, 6th October 2014

Since hearing from the Medford police, the owner has been in touch and supplied the address for returning the camera. I had intended to send it last week, but events overtook me and so today I am packaging up the camera to send back to it’s owner.

The outcome couldn’t have been any better.

Arizona Roadtrip

Following a summer that consisted of periods of high stress, extreme distractions and less time spent together than usual, the prospect of a holiday was very appealling. The dates were set before any of the adventures of the summer, which meant that as the dust settled there was a question mark over their availability. A few quick emails and a phone call resulted in the dates being confirmed but very little time to plan and book a holiday! So, in the 7 days we had, we planned and booked a roadtrip from and to Phoenix, AZ.

The Route

We had a total of 10 days, including travel to/from the UK, so our rough itinerary was planned thus

  1. Travel to Phoenix
  2. Phoenix to Chinle
  3. Chinle to Monument Valley
  4. Monument Valley to Page
  5. Page
  6. Page to the Grand Canyon
  7. Grand Canyon
  8. Grand Canyon to Phoenix
  9. Travel home
  10. Arrive home

Most days the drive was around 2.5 hours, so easily manageable. The first and last days had slightly more, but were still manageable. Given the areas we were heading to and the amount of time we would be spending in the car, we booked a standard SUV from Alamo, giving us plenty of room.

Preparation

We both enjoy taking pictures and both have DSLR cameras, so storage of the resulting images was going to be an issue while we travelled. I spent some time going through the laptops we were taking and removing as much as possible to give us some much needed space – which still wasn’t enough for Rosie!

Additionally we cleaned a couple of good size external drives, which together with a bag of cables covered us for the entire trip.

The cameras we took were

  1. Nikon D800
  2. Nikon D300
  3. GoPro HD Hero2
  4. GoPro Hero 3 (Black Edition)

For some of the locations we were planning to visit we’d need tripods, so we took along our tripods, further complicating the packing!

Roundcube Users

We’ve been using Roundcube for webmail for a while now without too many problems. It’s easy to install and simple enough to configure and our users seem to find it easy to use.

Recently one of our email accounts was comprimised, leading to a spammer sending a lot of spam through our server. While trying to trace which account was the culprit it became apparent that the source of the spam was the webmail interface, but reviewing the logs proved that there had been logins but no details were visible (these were after all just the apache logs).

What I needed was for Roundcube to log the users who were using the service. Some searches through Google revealed little of help, but then I came across the possibility of enabling the userlogins file. It’s listed in the default config file, but not many other places, so hopefully this post will help others.

To enable, simply add the following to your config.inc.php file.

$config[‘log_logins’] = true;

Once added, the file will be created with details of every login in the logs directory under the Roundcube installation. It confirmed that the user I suspected from a lot of other log reviewing was the culprit – potentially saving me several hours of effort!

Goodbye Zite

Of all the apps I have installed on my phone, the one I most frequently use is Zite. Following todays news that will be changing and the app will soon be uninstalled. It’s a shame, but doesn’t really come as a big surprise as Zite offered a useful, free service – something that is becoming rarer and rarer.

It was my wife who first introduced me to Zite on her iPad. It was an app that filled a void in the market for me and soon became one of the few apps I would look at every day. It’s ability to find stories of interest to me and display them in an easy to browse format was incredibly refreshing. When their android app went through a period of not working well I tried Flipboard.

As with most people my initial reaction to flipboard was “wow” but that faded within minutes. The odd page flipping that was initially “wow” soon became “ugh” and the limited content was annoying. Despite trying to tailor it to my interests the signal:noise ratio was too low – certainly far, far lower than Zite. I found the interface increasingly became an obstacle to the stories with Flipboard, so it was with some relief that updates to the Zite app made it usable again.

I have no idea what the business model was for Zite, but I suspect that being acquired by Fliboard will be viewed as a success by their investors. With the demise of their app I find my phone increasingly resembling and being used as just that – a phone. While the investors may celebrate, I think there will be a lot of users who will view it as a step backwards.

In fact I find myself wondering why I need a “smart phone” at all. I don’t play games. I don’t download music or movies to it. I do use the camera from time to time. The colour screen is nice, but is a camera and a nice screen ample compensation for battery life that is measured in hours compared with the days I enjoyed with a simpler phone 10 years ago?

Recent activity in the IT world has also shown that apps and services have very little user loyalty. The sudden rush of whatsapp users for alternative services following their acquisition by Facebook may be a recent example, but it’s hardly an isolated instance. Using an app and coming to rely on it for anything seems bound to lead to disappointment. Companies now view you as a commodity to be traded at the first opportunity to sell for massive rewards. How did we get here?

Self Disservice

This morning I had a request for a few purchases. As WHSmith had everything I wanted I popped in and started gathering the items. The store was organised in some random manner meaning it took a few minutes to find everything, but after the exercise I headed for the tills.

Anyone who has been in recently will know that WHSmith have invested in self service tills rather than staff for the last few years, so I was directed to one of these machines. Despite regularly using them in Tesco (preferable to a 15 minute wait for a manned till) the first glitch took only 3 items to appear. The dreaded “unexpected item in bagging area” message required a visit from one of the “floating” staff, but as she was busy with another machine I stood and waited for around a minute.

The next item refused to scan. I wanted to buy 5 of these, but as they wouldn’t scan and not wanting to wait for a member of staff I elected to leave them.

It strikes me as amazing just how poor my experience was this morning. Not only did I leave feeling that I had received poor service but I had spent far less than I was intending, primarily due to the self service experience. I can sympathise with the desire to cut costs, but where is the line between saving money and customer service drawn?

Where’s the mouse???

Another update window popped up in Ubuntu 13.10 a couple of days ago. Lots of packages to be updated (281 if memory serves) so as I wasn’t doing anything that required my laptop, I started the upgrade. After a while it finished and asked to restart. Nothing unusual so far. The restart went OK and the login screen popped up – but where was the mouse pointer? Hmm, that’s odd.

Another restart showed the mouse pointer was present right up to the login screen – when it vanished.

Logging in showed that the mouse was there, but the pointer wasn’t. Moving the mouse around and clicking showed it worked, but there was no pointer. A search of the web threw up a few options, but none have worked. Annoying!

This is the third or fourth time in the last 6 months that an Ubuntu upgrade has created some issue with this laptop. Every time (until now) the fix has been easy enough but has meant spending time hunting around on the web that could have been spent doing productive things. A few years ago this wasn’t an issue I had. The occasional distribution upgrade caused trouble, but generally things just worked. Upgrades and updates were seamless and could be approached without fear. Sadly this appears to no longer be the case which bring to the fore again a question I’ve asked before – is it time for a change?

Of the OS’s I’ve had regular contact with over the last 3 years I find it amazing that the system that has required the least amount of effort is Windows 7! While it has thrown a few issues my way, they’ve all been easy enough to fix. OSX has proved the most frustrating and has caused the most hair pulling incidents, but this may well reflect my lack of experience with it (though things haven’t gotten any easier the more time I have spent). Windows 8 seems like a huge change and may be a step too far, but at least I know it works well on this laptop.

As I’ve been toying with the idea of a new laptop the choice of OS will be a huge factor, so does anyone have any advice or recommendations for me? I need a light laptop as I travel a lot but beyond that I’m open to suggestions…

Update< \h3>
After much work in the terminal I have managed to get back to a desktop with a pointer.

Outlook Woes

Last month we decided to move from our older server to a newer, more powerful box. Moving the majority of services didn’t worry me, but knowing how fragile and potentially awkward the mail can be did give me pause. I spent some time and researched the settings and configuration, tested it as best I could and then made the move. All seemed fine for 75% of the users, but a small issue was troubling the rest, so I adjusted the configuration and watched the results.

As usual things were a mix of good and bad, but some spam did get sent. I quickly fixed the problem and moved on. Now 90% of the users were fine but the remaining 10% comprised the most vocal and so suddenly it felt as if 90% of the users were having troubles.

I tweaked a setting here and there over the next few days, but nothing seemed to work. The complaints grew and the language performed the usual subtle changes of tone that desperation seems to trigger. With hindsight the fact that the affected now numbered less than 5% should have signalled me to pause and take more time. Needless to say I adjusted another setting which opened the floodgates! Initially it didn’t seem like an issue as mail was being delivered and spam was being rejected.

Having removed a level of protection too far eventually a spammer found the issue and exploited it. As always this coincided with me being away from keyboard for 8 hours, so the server was subjected to a massive deluge of spam. As soon as I was back I stopped things and removed as many messages as I could before they were sent. Restoring the old configuration I reviewed my changes and found the problem, adjusting the configuration and eventually restarting deliveries. This time I watched and saw that the spam flood had been stopped. Even better the noisy 5% were now happy. Getting into bed at 3am felt good that night.

Of course that was just the start. Having been open for a short period several blacklists noticed and added the IP to their lists. Many hosts refused to talk to the server, so I started contacting the blacklist providers and attempting to restore the reputation of the server. Over the next few days most accepted the explanations and seeing no more spam originating they removed the IP. Things returned to normality – except for Outlook.

I thought that dealing with AOL was going to be the most problematic given their odd and highly aggressive anti-spam configurations, but actually following the steps on their website had the situation resolved in a matter of days. Outlook on the other hand was a whole different ball game.

The first problem is where do you go for help in getting the problem cured for Outlook domains and addresses? The error message in the logs looks like this…

Jan 6 13:43:04 xxx: xxx: to=, relay=xxx, delay=7.5, delays=2.2/0/0.28/5.1, dsn=5.7.1, status=bounced (host xxx.mail.protection.outlook.com[xxx] said: 550 5.7.1 Service unavailable; Client host [xxx] blocked using Blocklist 1; To request removal from this list please forward this message to delist@messaging.microsoft.com (in reply to RCPT TO command))

That’s fine, but of course I didn’t send the message. The person who did send the message wasn’t interested in forwarding it and simply deleted the returned message having noted that it wasn’t delivered. Not an unusual response from an email user I would suggest. As the person who tried to administer the server surely there is a webpage or some such that can be used to accomplish the same thing? Every other blacklist provider has one!

After searching around I find http://mail.live.com/mail/troubleshooting.aspx which offers lots of interesting advice and links. Following them I jump through the hoops and sign up for the various programs they highlight. Then I send them a message via https://support.live.com/eform.aspx?productKey=edfsmsbl3&ct=eformts with the information that they ask for.

Denied.

No explanation or further help is offered. When I reply the message is – yes you guessed it – bounced as the server is blacklisted! Oh, you couldn’t make it up. Trying again with a different email on a different service gives the same denied result and all attempts to find out why are met with a blank wall of copy and pasted text that gives no additional information.

I can sympathise that outlook.com is a huge target for spammers, but making it so hard for others to interact with the service simply means that people will increasingly not interact with it. Large corporations may be able to employ people to spend the time required to deal with the issues, but smaller companies can’t afford such luxuries.

As I typed this I forwarded on a bounced mail to the delist@messaging.microsoft.com email address and received 2 responses – one saying the message was being processed and another saying the message couldn’t be processed as they didn’t understand it! How can such a large organisation as Microsoft make things so difficult?

Quadcopter #2 is Alive

Following the arrival of the longer screws, all 4 motors were quickly attached and their directions checked. Only one was incorrect and needed the wires swapping. Despite the colours of the arms clearly showing direction I also went with green propellers at the front and black at the back (as per the first quad) to give additional indications.

After a quick tweak of the PI values and a zeroing of the receiver inputs it was time to see how it flew.

The answer was surprisingly well. Compared to the earlier design there was far less yaw evident when lifting off and the extra indicators of direction made figuring out corrections easier. The shorter legs means it sits closer to the ground which appears to make it slightly less stable just as it lifts, but that was easily corrected. The main issue I ran across was some of the receiver leads came loose and didn’t seem to be seated as well as I’d have liked, constantly becoming disconnected. As I have spare cables it’s an easy fix.

As it was hovering around freezing when I was trying, I didn’t stay out long. The early signs are positive. Now if the gale force winds can just abate to allow me to tune the PI settings…

Shapefiles

I recently had a request for a shapefile containing geographic informaton for some of the stations listed on Variable Pitch. I’d been meaning to create a simple export facility for a while, but had never really looked at shapefiles in any detail before. As it took me a few attempts to get them working correctly, the following may help others!

I’m using the pyshp python module.

import shapefile

Essentially I’m creating a shapefile with a list of points. Each point will have a series of data fields associated with it. At the present time I’ve not specified types or other details for the fields, but that may be something I do in the future.

writer = shapefile.Writer(shapefile.POINT)
writer.autoBalance = 1
writer.field('Station Name')
writer.field('Technology')
writer.field('Variable Pitch ID')

Now the writer object is prepared, I loop through the stations I need to add and write the data. This is done in two steps, the first adding the point and the second the data associated with it. As the station names are stored in Unicode and the shapefile expects ascii, I have forced a simple conversion to ascii (ignoring any characters that cannot be converted).

for s in stations:
writer.point(loc[0].lat, loc[0].lon)
writer.record(s.name.encode('ascii', 'ignore'), s.category.desc, "%d" % s.id, 'Point')

At this point I have all the data in the writer object, but now need to create the 3 or 4 files that comprise a shapefile. To keep things simple I elected to create a single zipefile containing all the generated files which can then be downloaded. All generation is done in memory.

s = cStringIO.StringIO()
zf = zipfile.ZipFile(s, "w")

fobj = cStringIO.StringIO()
writer.saveShp(fobj)
zf.writestr('%s/shapefile.shp' % filename, fobj.getvalue())
fobj.close()

fobj = cStringIO.StringIO()
writer.saveShx(fobj)
zf.writestr('%s/shapefile.shx' % filename, fobj.getvalue())
fobj.close()

fobj = cStringIO.StringIO()
writer.saveDbf(fobj)
zf.writestr('%s/shapefile.dbf' % filename, fobj.getvalue())
fobj.close()

# Must close zip for all contents to be written
zf.close()

Update

My initial code simply used the lat/lon co-ordinates I already had stored for the stations, but when the file was downloaded by the person requesting it they complained they had expected the points to be in UK Grid Easting/Northing format. This pointed me to look at the .prj files that are often included in a shapefile and give details of the co-ordinate system used. As the format is simple formatted text (WKT) I found the appropriate text for the formats I support and insert the appropriate text in shapefile.prj and include that with the download.

The .prj file for UK Grid Easting/Northing.

You can find the current version of this code being used on the Variable Pitch site.

QGIS on Ubuntu 13.10

I’ve been asked about producing shapefiles from the geo data on Variable Pitch. This seems like a good idea, but having no experience with such files I thought maybe I should have an app to test them with. I was pointed at QGis but it needed to be added to the sources list for Ubuntu 13.10. This is how I did it.

I created a file /etc/apt/sources.list.d/qgis.list with the contents

deb http://qgis.org/debian saucy main
deb-src http://qgis.org/debian saucy main

Then I imported the PGP key as the sources are signed.

~$ gpg –keyserver keyserver.ubuntu.com –recv 47765B75
gpg: requesting key 47765B75 from hkp server keyserver.ubuntu.com
gpg: key 47765B75: public key “Quantum GIS Archive Automatic Signing Key (2013) <qgis-developer@lists.osgeo.org>” imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
~$ gpg –export –armor 47765B75 | sudo apt-key add –
OK

This was all that was needed and so installation was then as simple as

~ sudo apt-get update
~ sudo apt-get install qgis python-qgis

There are a large number of required packages!

Quadcopter #2

Seemingly hitting the ground on a regular basis with legs that rotate leads to them not staying vertical – who knew? :-)

After spending a lot of time adjusting the rotors on my Talon 2.0 quadcopter frame to try and get them vertical, I decided it was time to look for an alternative frame to use while learning. The constant battle to stop spinning due to non-vertical motors really didn’t help figure everything else out.

When the Q450 frame came back into stock at Hobbyking I decided to get one and try it. Having had it for a while I finally had time today to start assembling it.

The frame arrives with no instructions, but is so simple that none are needed :-) The supplied screws were fine, though I had one that appeared to have skipped a step in manufacture and could not be used. At the end of construction there were a couple of spares, so the rogue screw wasn’t a problem.

Assembled Frame

The top plate has plenty of holes, but it doesn’t have the 4 holes for the power distribution board I’m using (recycled from version 1 of the Talon quad which came with the holes to attach the board pre-drilled). I stuck the board using the supplied tape and it’s pretty solid, but having the holes available would have been nice.

The other problem I had was attaching the motors. The screws that come with the accessory pack are M3 x 5mm which are too short to allow the motor to be secured to the frame. Longer bolts are required (M3 x 8mm will probably be fine)!

I also bought another KK2.0 flight control board and this has been fitted and flashed to version 1.6 already. Hopefully once I get a the longer bolts and mount the motors it’ll be taking to the skies.

Update

The M3 x 8mm screws arrived and are a perfect match for mounting the motors on the frame. I bought one pack of these, which had one screw with a twisted head, but the rest were fine and 16 are now attaching the motors to the frame.

Keyboard Layouts on Ubuntu 13.10

After upgrading to Ubuntu 13.10 I found that often my keyboard layout, which is selected as English(UK) as it had been since starting to use this laptop, would change to English (US). Annoying as this is, even worse was that it didn’t always happen and would sometimes be fine. The layout is always shown as English (UK) despite the US layout being used, which only adds to the strangeness.

Quite how this odd bug was introduced isn’t clear, but I have found a fix.

  1. Select US keyboard
  2. Select UK keyboard

Hopefully this will be fixed soon, but at least I’ve stopped having so many odd characters appearing in my source files.

Firmware Updated

I’ve been waiting to update the firmware on my KK2.0 board for a while as I needed a USBasp. The one I ordered turned out to have a 10 pin connector, so I then had to wait for the 10 to 6 pin adapter to arrive! Thankfully both parts are now here and so having time this morning it was time to upgrade from the old 1.2 firmware the board shipped with.

When I first looked at the KK Multicopter Flash Tool I missed the fact it’s a Java application and so, mistakenly believing it required Windows, I hunted down and installed the Windows 7 drivers the USBasp required. This took a few attempts as the drivers I found initially wouldn’t install, though why they wouldn’t install remains a mystery to me. Once everything was installed I connected the board, ran the application and flashed the new firmware in less than 5 minutes.

Once flashed to firmware version 1.6 I powered the board and configured/calibrated ready for a test flight, though with the high wind and heavy rain that wasn’t possible today.

Consistency?

Ofgem produce a lot of reports. They store a lot of data but when reviewing it I’m constantly astonished at how poor the consistency of that data is. Today I have been looking at a PDF they have available which contains a large number of addresses with countries.

This should be such basic data they can’t get them wrong? So why does it list several occurrences of ‘United Kingdon’ and one instance of ‘England’? Is ‘Ireland’ the same as ‘Republic of Ireland’?

If they can get something as basic as the country wrong, what confidence should I have in the rest of the data that I have no way of verifying independently?

It’s probably a silly assumption to make, but surely this report was generated automatically? If so then what does that say about the underlying data structures? This really isn’t good enough for a government department in 2013.

This is not the P value you want…

Having built the QuadCopter from scratch I always knew it would need tuning. The initial few flights proved it could fly and that it responded as expected, but I had expected it to be slightly more stable given the reputation of the KK2.0 board.

After those first few flights I started looking for advice on tuning via Google. While these produced lots of opinions and advice much of it was contradictory and mildly confusing. All of it agreed that I needed to adjust the P and I values. Exactly how to adjust them and what the effects of getting it wrong would be was less clear, but as the next step was tuning, I decided I would start changing the values. (However, as I outlined in Changes the timing wasn’t ideal and I probably shouldn’t have.)

The weather finally cooperated, allowing me to fly it for the first time with all the changes in place. The results were mixed. The new cleaner layout was an improvement and the new dome gave it a more robust feeling, but the handling was noticeably worse. Was this due to the new ESC or the changed P values?

Yesterday and today saw more flights and as my experience has grown things have gotten easier, but still I felt that things weren’t quite right and that set me to thinking back to all the advice I had read around tuning the P & I values.

Finding good guides to help with the tuning wasn’t easy and some of the videos weren’t as clear as they thought they were. Watching obviously experienced pilots perform fast manoeuvres over a large area and then declare what needs to be changed isn’t helpful :-( It would be great if someone could write one!

“The KK2.0 board requires flying.”

This was one statement I saw in many different places and led me to think that the amount of effort involved in getting the Quad airborne was normal. That said, when looking at videos of other people flying none seemed to have so much trouble so I suspected something was wrong.

Initial Values

So, what values to start with?

“For small quadcopters start with a P value of 30″

What’s a small quad? Is mine small? It’s certainly not as large as many, but is it small? As I didn’t know I decided to start assuming it was a small quad and so set the roll and pitch P value to 30, I value to 0 but left the limits at their factory defaults.

Higher Values == Better Stability?

30 was certainly too low to start and appears to have been the reason for the challenges I was experiencing.

After changing the P value to 70, the Quad lifted off smoothly and was suddenly far easier to fly! Increasing it to 80 seemed to help even more though a very small amount of oscillation started to creep in. With the I value still at 0 this was acceptable.

Next Steps

Next time I fly I’m going to try increasing the I value and also see if a higher P value gives me a little more stability.

In addition I have ordered a cable to allow me to upgrade the firmware in the KK2.0 board from the 1.2 it comes supplied with to 1.5 (or 1.6) which will hopefully also improve the stability.

Changes

After Flying the Quad, I did some more looking around the web and started thinking about tuning the KK2.0 board. This is done by adjusting the PI values, which initially seems like a form of dark art. It wasn’t abundantly clear what these values were until I cam across a piece that identified them as the values used for a PID Controller loop. After reading the page the values I was entering made more sense and some of the advice I had found also became more obvious.

The first step was to change the values and see how it flew. All went well and thanks to the easy menus the values were soon changed. The next few days brought wet and windy weather, so no flying was possible to see if the new values were an improvement or not.

It was at this point that the upgrade parts from HobbyKing finally arrived (have I said before how their shipping isn’t the fastest?). With the benefit of hindsight I should have resisted the temptation to upgrade the frame and flown it to check the new PI values, but I didn’t and so the new ESC was installed and the frame made ready.

In order to use the QBrain ESC, we needed to solder on an XT60 power connector, which was trickier than it looked given the nylon connectors tendency to melt. More than one attempt was required.

The numbering of the QBrain ESC outputs differs from what the KK2.0 board uses, so I had to experiment to get the correct orientation and connections. When ordering I also failed to appreciate how much larger the module was compared with the power distribution and KK boards, meaning the well aligned holes in the top plate were of no use requiring some alternative attachments to be used :-(

It was dark when the changes were finished but undaunted we went outside and powered it up. All seemed good and my calibrating of the ESC was successfully starting all 4 rotors at the same time. Edging the power brought a couple of surprises.

  1. There was a clear pulsing between the propellers
  2. The #2 rotor seemed to be producing noticeably less thrust than the others

After these discoveries I did some headscratching and had a look around the web. The QBrain ESC is still a new product and there wasn’t as much help available as I had found for the Plush models it replaced, but the instructions sheet that came with it showed the default timing was set to Medium, not High. Using the ESC Programming Card I changed the settings and then calibrated the ESC again which seemed to cure the pulsing.

When next flying the quad the #2 rotor seemed to be producing more power, but the addition of the GoPro on top meant the whole frame was unbalanced. I’ll try it again without the GoPro and hopefully that will be better balanced.

With hindsight I made too many changes at once. Given my current lack of experience and knowledge I should have changed one aspect and evaluated the results before changing another. It would have been slower, but that’s not always a bad thing.

Flying the Quad

Since finishing the construction we’ve had 4 opportunities to fly it. The first of these was largely wasted due to the ESC’s not being calibrated, but the next 3 have all seen the quad take to the air. Today marked the first time I’ve tried flying our older GoPro Hero2 on it.

quadcopter_gopro

The GoPro attachment proved to be inadequate and so more thought is needed to figure out a better way to attach it. I have a solution in mind just need to get some pieces and some time to try it.

I anticipated that the learning curve would be steep – and it has been! As with all such things every time it flies things get easier. The initial hesitations about increasing the throttle to get it airborne are reducing and I’m starting to be more gentle with the controls and overcontrol less. That said, after today’s session I have adjusted the PI values to try and improve the handling. Time will tell if these are better or not.

Liftoff occurs with around 45% throttle which I think seems a good point and means there’s plenty of power left. It’s certainly spritely when it starts moving :-)

quadcopter_001

quadcopter_002

The frame is proving to be more resiliant to damage than I had feared and despite a few minor and one larger crash it’s still in good shape. Ordering some replacement legs may be on the agenda soon, but it’s certainly not desperate :-)

Quadcopter Construction

Having finally decided to build a QuadCopter I ordered components from HobbyKing. Now that I have everything I needed and some time to build it – it is time.

Main Components

The list below is not exhaustive but provides the main components.

Ordering from HobbyKing was great for price, but the delivery was expensive and their stock situation highly frustrating. Additionally when ordering the pieces it often wasn’t clear whether pieces I wanted would work together as I envisaged, necessitating much use of Google.
Calibrating the ESC’s

NB You also need to order the accessory pack for each motor as this provides the shaft and attachments for a propeller!

In addition to the above I also needed to do some soldering for various cable connections and the screws are hex (2 and 2.5mm as best I can tell) so suitable tools were required. I didn’t use screw lock for the frame as I was sure I’d be replacing broken parts :-)

LiPO Charging?

The horror stories about charging LiPO batteries aren’t hard to find and certainly deserve being taken seriously, so I wanted to get a charger with some “smarts”. There are so many conflicting views about this that eventually I bought an Accucel-6 50W charger/balancer and a power supply (though the power supply is likely overkill). As an additional safety precaution I also got a charging bag for the battery.

Actually using the charger proved interesting and required me downloading the manual and reading the appropriate section. This would have been easier (and more obvious) had they included a link to the manual in the box, but they didn’t.

Construction

The first job we did was to solder all the connectors onto the ESC’s and heat shrink them. This took a while as there are 5 connectors per ESC.

Assembling the frame was easy enough. The motor attachment plates appeared to have the countersunk holes on the wrong side, so we put them on upside down without any problems. I had been hoping to run the wires inside the arms but without fabricating extension leads this wouldn’t have worked, so we just tied them to the side (we decided early on to change our ESC so this was temporary). One thing we didn’t do initially was spend a little time ensuring that all the legs were level prior to tightening the legs, which with hindsight we should have.

Attaching the KK2.0 board was straightforward and connecting the RC receiver was simple enough (though without the online pdf manual getting them in the correct order would have been much harder). Once the ESC’s were attached to the KK2.0 board it was time to power it up :-)

Layout

The layout is quadcopter-x and once selected it will show the correct numbering and directions. Again the pdf manual was very helpful for this. Once selected I checked the rotation direction and changed connections as required on the ESC’s to ensure they were all correct.

Calibrating the ESC’s

This turned out not to be as simple as it initially appeared. Reading the instructions for the KK2.0 board provided the basic procedure but as there are a lot of different ESC’s available knowing the beep sequences to wait for was the stumbling block. As I’m using Turnigy Plush ESC’s I eventually found this helpful video that explained where I was going wrong.

Essentially I was waiting too long and so the ESC’s went into programming mode (after playing their funky tune). Being quicker and moving the throttle from max to min after the 2 beeps was all that was required to correctly calibrate them.

Propellers

After a lot of searching I eventually decided to use 8×4.5 propellers and decided to follow convention and have different colours at the front and rear – green for the front and black for the rear in this case. As you need both left and right rotation propellers for each, this means I should have ordered 4 packs, but managed to misorder initially and only got left handed propellers! When ordering the right handed ones I also forgot I needed both colours and so it took a while to have everything I needed! Hopefully this will act as a warning to others :-)

One thing to note is that the propellers don’t have many markings on them, so it’s not always easy to quickly tell them apart :-( It would be better if they were clearer about what they were.

Receiver Test

Having read the various guides online I did a receiver test early on in the setup and zeroed the controller, but by the time we came to fly they had changed so needed doing again. Failing to do this caused an early accident when it flipped on the ground and smashed a propeller :-(

Upgrades

Between my initial ordering of components and the final assembly it has become possible to get 4 ESC’s on a single board, with integrated power distribution. To simplify the design and make things far neater we have ordered one of these boards which will allow the cables for the motors to be run inside the arms and removing the need for extra wiring for power distribution.

As I also plan on flying a GoPro I’m debating how to attach it and balance the frame.

Up, Up and Away…

Following some initial teething problems and after climbing the inevitable learning curve, today marked the first few flights :-) The next post will detail more about that though :-)