Wednesday 30 January 2013

Daisy, Daisy ... give me your answer do!

One of the problems concerning me was, I have many sensors and not enough connectors on the Gadgeteer Mainboard ... what am I do to?

I'd seen that the Gadgeteer board has I2C (pronounced "I Squared C") and oddly years and years (11 to be exact) I'd done some I2C development.  Basically it allows a master controller to talk up to 126 components.

Fantastic!!!  The question is how to connect I2C breakout boards to a Gadgeteer main board?  Thankfully the book Gadgeteer book I've been reading has all the information :)

Here's the plan, I'm doing to create my own Gadgeteer module.  Physically it will have three senors on it that are all connected via I2C.  I'll then write the module software so the Mainboard can connect to all three via the I2C.

Sounds hard however the module software is easy looking.  The tricky part will be the initial configuration of the sensors however once that is cracked it's happy days :)

Best of all, I can create my own modules that link to further modules.  Gadgeteer calls this "DaisyLink" which seems to be an implementation of I2C for talking to multiple devices thus removing some of the complication for me.  Great one Microsoft :)

First step, create my module ... I'll do something simple, not sure what yet :)

Sunday 27 January 2013

Reading Time!

It was a lovely family weekend, so no drone development.

However, I did have time to read a book, "Microsoft .NET Gadgeteer: Electronics Projects for Hobbyists and Inventors"

It's been about 3 years since I've coded, it's nice to have a quick refresher plus learn a few new tricks for Gadgeteer and the .NET Micro framework.

I'm half way through and definitely can recommend the book to anyone new to low powered processor programming :)

Saturday 26 January 2013

First Gadgeteer Program

I should have gone to bed, I was too excited to create my first Gadgeteer Program on the Argon R1 board ... here's the result :)

Thursday 24 January 2013

Yea, electronics arrive!!!

Woop woop, the electronics are here!!!  That Argon R1 is a thing of beauty :)




Time to start learning :)

Also, Love Electronics have been a top company.

Communications has been fantastic!!!  Answering questions, keeping me informed on the delivery and being genuinely nice all round.

A pleasure buying from them! 

Wednesday 23 January 2013

Time to lock down the design?

Time to take stock!!!

Lots of learning over the last 5 days.  There's a lot in my head right now, many thoughts about the pilot control of the drone ... must write that down.

The electronics coming which will be fun, there's more learning there!  Last part of the puzzle is connecting the Electronic Speed Control (ESC) to the Gadgeteer Mainboard.  Definitely do-able, so I'm not worried.

Once that is done, time to lock down the design.  I can't believe in 5 days this has gone from impossible to possible.

What's Needed in an Airframe?


Here's a few things I reckon I need ... will be fun to look back in a month and see how it has changed!

  • Lightweight ... I can't afford Carbon Fibre so Aluminium looks good
  • Strong ... one I don't want it to break on the first go!
  • Structural Integrity -  I want to minimise vibrations ... that will do the sensors no good.
  • Storage ... somewhere to hold the electronics, batteries and camera

Sounds a tall order ... time for more research!

I reckon the Motors and ESCs now not hard to decide on after yesterday!

The final electronics are tricky to decide.  I have a theoretical idea on how many sensors are needed however that all depends on how the real machine flies.  Let's just have some fun :)

Gyroscope Arrived

First package from Love Electronics has arrived.

I'm now the happy owner of a 3-Axis Gyroscope and super looking forward to Love Electronic's Argon R1 arriving sometime tomorrow!

Tuesday 22 January 2013

Mystery solved ... Airframe, Motors and Control!!

Oh how fantastic!!!!  I knew I was missing something!!!

I came across this top website where it lists components that other's use, excellent!

Also there's links to other hobbyists who on their webpages list the parts they use ... I am so lucky, I love the internet age!  FYI, here's one hobbyist and here's another :)

Where I was going wrong?


I had over specified the motors, then needed over specified Electronic Speed Controls (ESCs) and also looking down the wrong path for the ESCs.

It's so easy to go down the wrong path, I was so locked into checking robotic websites and component sites that I had neglected radio controlled hobbyists.  These guys need electric motors with ESCs and there's bucket loads of affordable offerings!!!
10 or 12A motors be fine! Then ESC cost only $12 each.  Even then a 30A ESC cost < $20 each.  Oh brilliant!

I'm so happy!!!  I can get an airframe (still need to decide), I know I have a solution for the motors and yes I can get affordable ESCs, what a result of a day!

One more question:  How to interface the ESC to the Gadgeteer Mainboard?

Monday 21 January 2013

PC setting up

Good news, I've placed the order with Love Electronics for the Argon R1, a bunch of sensors and some other tiddly bits to get myself going!  Happy days :)

Time for a bit of action, let's get the computer set up.

I've not coded for about 3 years.  I do miss it a bit so it'll be lovely to get back into the swing of it again.  

Time to install my sweet heart Visual Studio.  Simply the best development platform I've ever used!

It's just amazing Microsoft have a free version called "Express", well done! Yes a thank you to Microsoft is needed otherwise for this project I'd have to shell out £500 for Visual Studio and other (optional) £300 for the MSDN.  

FYI, (start playing the violin) back in 1999 I paid £80 for a student licence of Visual Studio version 6, that was a lot of money/pints for a student to give up :)

VS Express C# installed, tick.  What next?

Well as I discovered there's two further parts you need from Mircrosoft: the .Net MicroFrame SDK and the Gadgeteer Core.  Silly monkey forgot to install the Gadgeteer Core :)

Next is the SDKs from the manufacturers for their electronics.  I installed them from Love Electronics', GHI and Seeed, why not the others might be useful one day!

Easy evening!  Even had a bit of time for some fun Gadget layout :)


Arduino ... I've learned you could save me!

Ummmm, I think I'm mistaken about the Arduino system ... learning lots :)

More clicking about I see you can develop for it, excellent!

Arduino programs in C rather than an object orientated language so I'm still better going with the Gadgeteer board ... really a no-braining, C or C#!!!!

This complicated autopilot system will be much easier in C# however a few ideas are starting to hatch!

Perhaps, I can use the Arduino system for connecting all the sensors to?  Perhaps as a sensor pre-processing board?  Worth thinking about :)

Sunday 20 January 2013

Which Gadgeteer Board?

Time for a break from the motors and ESC research into something more comfortable :)


The Options


There's a few manufacturers I found doing Gadgeteer Mainboards, namely: GHI ElectronicsLove Electronics and Sytech Electronics.

What distinguishes the boards are three factors: Processing Power, Memory and Connectivity to other Gadgeteer modules (i.e. sensors, switches, etc).

There is of course the cost.  These boards are a bit of money but nothing prohibitively expensive, so I'll ignore the cost and buy the best one for me.

BTW, there are quite a few companies creating Gadgeteer modules and they are all meant to work with any mainboard.

So what are the best offerings from these companies:


They are all lovely boards.  For me, I'm going for the Love Electronics product.  Why?

Speed


The Spider and Nano runs at 200MHz where the Argon R1 is 120MHz, it's down on power yet that's not everything.

The drone will have an autopilot program that will be complex to write however I believe the number crunching won't be too heavy.

It is only basic simple Newton motion mathematics.  I'm not decompressing video or calculating molecule interactions.

120MHz will be great for my drone :)  Fingers crossed!

FYI, it's still so hard to understand how much "real" processing you'll get per MHz.  All the above buy their chips from NXP who implement the ARM processor version 7.  I dug around a bit, found out loads on each boards processor (won't bore you) however ultimately you never know ... will be run trying :)


Memory


This is where the Love Electronic's product wins.  FYI, there are two types of memory: RAM for your processor as a temporary storage and Flash for storage after power down.

  • Nano has 8MB of RAM and 8MB of Flash
  • Spider has 16MB of RAM and 4.5MB of Flash
  • Argon R1 has 32MB of RAM and 128MB of Flash

OK, with the Nano and Spider I could get an SD memory card and write data to that.  That's a pain, more coding and another connector taken for the SD card module.

Even if I could be bothered, the Argon R1 still has double the RAM.  I like the sound of that.

My program might not need mega data processing however I'm always surprised how much RAM one needs. Better safe than sorry. Thank you Love Electronics!

Connectors


In terms of connectors, the drone will need many for all the sensors.  As this is my fun time R&D project I don't know how many sensors I need.

At worst I'll need to put multiple sensors on each of the Quadcopter's arms ... that's 4x gyroscopes, 4x accelerometer and a GPS. Plus it will need wireless comms to get the beckon's GPS location.  That's a lot of sensors!

Also a kill button would be important for safely plus later the ultrasonics for landing.

Ummm, I need a lot of connectors and none of the boards have enough.  I will have to think of a clever way around however for now best to get as many connectors as possible.

What I found on connectors:

  • Nano is a little low on Gadgeteer connectors at 10 connectors
  • Both Love Electronics and GHI has 14 each and I believe with the same distribution of interfaces.


Summary


The race was between GHI's Spider and Love Electronics' Argon R1, sorry Nano.

The Spider probably has more processing grunt however the Argon R1 has double the RAM and over 28x more Flash memory.

The only extra on GHI is the "Premium" pack.  It allow you to do some low level programming however I really can't see myself wanting to do that :)

Yes for me with all that memory, Love Electronics has it with the Argon R1 ... sorry if I was RAMing the message home :)

Getting expensive ... Motors, ESC and interface boards

Ummmm ... still no further in solving this problem!

Brushless motors are efficient however they need expensive electronics to control them.

Do I go for brushed motors?  The control electronics are cheaper, is this a compromise I have to make?

I am missing something.  I've seen toy quadcopters sell for £300 and claim they have brushless motors  There must be cheaper control electronics.

To complicate the matter, I'm looking into interfacing the Gadgeteer computer into the motor control, doesn't look easy.  More research needed!!!

Autopilot Thoughts

The motor and controller thoughts are going around in circles, let's try something else.

Back to the Autopilot ...

This was a lovely thought exercise!  Super enjoyed this!  What does it need to do for itself?

Basic "Stuff"

Take off and then land itself.  Doesn't sound that hard: power up the motors, hoover a bit, lower the power a bit and gently glide to the ground.  Easy?

Ummm, the tricky bit is balance!!!  Forget the wind for a second, in the real world the motors will not be 100% the same, neither will the propellers (another thing I need to look into) and the drone won't be perfectly balanced.

I can't help, the drone is meant to be autonomous ... will need to balance itself.  I'll need cool sensors :)

Luckly me, the Gadgeteer platform has loads of sensors.  Gyroscopes, that's the ticket!

I'm wasn't too sure how many I'll need, perhaps four gyroscopes on each of the drone's arms?  Perhaps just one gyroscope in the centre is fine ... haha this is the real world :)

I don't really know but that is the fun of this project, I'll just have to experiment :)

Hovering


Will the GPS sensor be enough to maintain position?  Ummm, I hope so, to save my money, ... yet this is the real world!

We've all seen our phones and sat navs go crazy when the GPS signal isn't great.  Normally we cope ... so what sat nav goes crazy, I'm still driving the car.

My problem is that the drone is driving itself ... a old wise computer says, "Rubbish in, rubbish out".  How noisy is GPS data?

I need accelerometers!  Why?  The drone could be completely balanced yet falling.  If the GPS data is lost (or bad) then it's crash time!!!  Yes, accelerometers seem a good idea :)

How many, who knows?  I'm sure someone knows, but it's not me.  One in the centre is a good start but perhaps one on each drone's arm, that might help on complex flight ... ummmm more fun research!!!

Landing

My ideal super-do-per drone will have ultrasonic range finding tech on board and maybe pressure pads on the landing runners :)

I'm just concerned I'm over engineering this from the beginning.  When I build this machine, there will be a lot of testing.  The R&D phase will be in relatively ideal conditions and landing "should" be OK.

I need to limit the scope, controlled landings in non-ideal conditions is for later.  For now, GPS and accelerometers will do!  I hope I don't regret that :)

However, ultrasonics for landing is a cool idea :)  Loads of questions are firing in my mind ... I'm going to open another page on this blog just to document them ... please comment!!

Question of Motors ... ummm I need an ESC!!!

Motors, this completely new to me and I really don't have a clue.

Firstly, let's go electric ... everyone on the net is using electric motors.  I could go for a petrol engine yet that seems overkill, maybe one day :)
So electric motors, I know there's two types ... brushed and brushless.  I found a great little here, cool guide for topping up your knowledge!

What I did learn?  Brushless are more efficient than brushed.  Yep, need efficient motors for flying ... great lets go for that!!!  But which ones?

Well I saw on this site that these motors are recommended, are they good?  I don't know but it's a good start.


How much power do I need?  

I don't know!  I've learnt brushless motors are measured on Revolutions per Volt.  Then it all comes down to how much amps it can take.

I fancy powerful motors!!!  I am a guy after all :)  30 Amp current motors look kick ass, lets have them!


How to control them?

Ummm, no idea.  I've seen on the Gadgeteer site there are Motor Control boards however typically that is just for motors up to 3A.  I need something more.


Trouble Ahead

Oh dear, I've just wasted 4 or so hours!!!  Brushless Motors work by fancy electronics to reverse magnetic field to make the motor turn.   These seem to be called Electronic Speed Control, ESC, systems.

Here's the trade-off, efficient motors require expensive ESC electronics to control them!
The downside, a single motor controller that "just" does 10A costs $100 USD.  At least on this website, the next is a 60A controller and that is $275!!!

I'm new to this, $275 x 4 motors = $1100.  One of my aims was not to make this an expensive project, this is not the right direction.

Saturday 19 January 2013

First Day - Impossible to Possible

Wow, what an amazing day!!!

I really still don't know what I'm doing, however now it must be possible!!!

  • Who would have thought you can buy quadcopter airframes on the net?  
  • Who would have thought there's "plug-n-play" smart electronics & sensors you can buy?  
  • Motors and Propellers all easy to get.

All the key parts are available, how exciting!!

There's more research to do:


  • Which motors?
  • How do I power the motors?
  • How do I control the motor's speed?
  • Which airframe?
  • What sensors do I need?
  • What "things" do I need in the autopilot?
  • And probably many more ... that will do for now :)

Third Task - Control Electronics ... ummm not a clue!

Now this I thought would be hard, I need some clever electronics!!!

On a quick trawl of the net I wasn't much further.  Where to look?  Could this be the hurdle that makes this impossible?

I have no clue, I've check out what robot hobbyists do.  They have something called Ardurino, I'm not sure what that is all about.  It seems low level digital processing, I could be wrong.

I have a feeling I will need some good processing power, surely building an Autopilot system needs some fancy code?

Then after looking around, BREAK THROUGH!!!!



Microsoft has this great thing called Gadgeteer!!!! It's simple hardware system based around Micro .Net Framework.  Fantastic!!!

I'm totally in love with this!!! You buy a small battery powered motherboard then get whatever extras you need, e.g. sensors, motor controllers, wireless modules, etc. etc..

Plug it together, write your code and you have your system!!

Best of all you can do Object Orientated code ... my brain loves that, for this super complicated autopilot system being OO will save me so much heartache.

Yes, it's all C# too, haha my favourite of  favourite languages an in Visual Studio too, oh I'm such a lucky boy :)



Second Task - What else, Airframes and Motors!

Ummm what to choose?  Fixed wing or Helicopter?

Fixed wing won't be too good hovering.  Helicopter, that sounds expensive and probably difficult to control.

Google wins again, Quadcopter!!!  They look amazing and I do fancy something cool too :)

So can I buy the frames?  

It was a bit trickier, yet yes again!!! So there is a list of frames on this website.

Great one Google, the airframe site found you also sells motors.  Cool!  I still know nothing however potentially airframes and motors are sorted.

First Task - GPS - Can you even buy GPS "parts"?

Here's my lines of thinking:
  • The drone needs to follow me, therefore it needs to know where I am.
  • Then the drone needs to know where it is to follow.
  • Yep, it's all pointing to GPS!
A few minutes later on Google says YES!!!

Well I have no idea how it works but I know you can buy them, great :)

Time to Test Google

OK, I want to build a drone that can follow me ... decision made, that bit is sorted.  Time to put down my very simple aims, click here.  Now, where to start?

Time for a plan!!!
So what's needed?
  • All this stuff needs to know where it is, I need GPS!!!
  • No airframe, no drone :)
  • Motors to fly!
  • Crashing is bad! We need some smart electronics to control the flight.

Haha, so simple ... still no idea about any of it :)

The Idea Forms

I like crazy sports and a few months ago I bought a Sony Action Cam, it's fantastic!  Many things I love over the GoPro however that's for another blog.

I was thinking, as great as all the head/bike mounted shots are, I want shots from an observing perspective.  I want high beautiful landscapes shots with myself and friends below doing whatever crazy sport we are doing that day.

I can't afford a TV crew, time to think of an alternative!

Then the idea came, "Could I build a Personal Drone?"


I laughed as I thought surely not.  
  • Firstly, I'd need some sort of expensive GPS tracking system.  
  • Secondly, what do I know about aircraft?  
  • Thirdly, I know nothing about motors and controlling them ... let alone for flight.  
  • Fourthly ... well loads more "it's impossible" thoughts ...
I laughed more, funny idea but impossible!

Yet curiosity took me.  Is it truly impossible?

Now a few hours on Google and I reckon I might stand a chance!