Tuesday, 25 July 2017

The definitive duo of motor and micro controllers

So if you're wondering how one actually gets from writing code to physically moving motors then you've come to the write post! The combination of motor controllers and micro-controllers allows us to do such things.  Our motor controller is called the DRV-8848 BOOST. It's a brushed DC motor that can take a peak current of 2A and is therefore compatible with our motor. Also, it's a booster pack to the MSP430 MCU(Micro-controller Unit) which ensures compatibility and easy connectivity. But why are we using a motor controller in the first place? The current from the MSP430 is too small to drive a motor. So the motor controller acts as a current amplifier, feeding the motor a high current signal thus allowing it to spin.

The integrated chip on the MSP430 has to be programmed by the user, so it can provide us with some electronic sorcery called PWM (pulse width modulation). What is PWM you wonder? As the name suggests, the width of a pulse (which in this case is a square wave) is varied ,allowing us to vary the voltage at the output. Therefore, to increase the output voltage we have to increase the width (on-time) of the pulse. This makes PWM perfect for controlling power supplied to our DC motor.



So, the PWM signal is sent from the micro-controller to the motor controller, which is then outputted to the motor as revolutions. These revolutions translate to speed (revs per minute), thus the PWM voltage is proportional to speed. Therefore, by attaching the power rails to the motor inputs and connecting the motor and micro-controller up, we have a fully controlled motor. And what does all of this look like in the shell of a Mini Cooper Scalextric car you may be wondering?


Well.... we call it the monster mini! But do not be scared as we can significantly reduce the size by putting all this onto a custom PCB. Only time will tell. But for now its onto testing our beast.

Thanks for reading and until next time!


Woohoo, not C code!


Took a break from more wireless communication work today to put together a 'mk. 0' track piece for the Blake Project Scalextric track.

Having dismantled a corner section waiting for an software install last week, I attempted to remount the power rails into a track section of my own devising. The idea here is that we can reform the track and underlay to suit our own requirements (like adding space for wires or solar panels), make it slipperier (to make our AI look more professional), and increase the wow factor (by making it transparent, although this was a side effect of the acrylic sheet available today).

So a quick morning creating a CAD model (urgh, real objects ...) followed by a lengthier  afternoon with the laser cutter up in the engineering workshop, and I had my track section.

I do think that there will be future evolutions. The rails taken from the original scalextric track, while nice, are a pain to work with - I will try to come up with an alternative. Additionally I must have got my geometry wrong because the trusty file made several appearances!

On the other hand the track piece looks amazing, and could be made to be quite slippery. It also has lots of room for wires.

As you can see, it was only a mini piece.
Anyway, until next time!

More RSSI adventures

Some updates on the wireless system.

Having run a number of more trials of RSSI for distance in different conditions it is now obvious that RSSI is unlikely to be helpful over long ranges. I have included two graphs of my results, the first is of the raw data, which includes all measurements made (I took multiple for the same distance for almost all tests). The graph shows the general mess of values I was getting with very little correlation between distance and RSSI, especially when comparing results between tests.

This is evident in the second graph, which colour codes the results for the trail they were taken in. The most likely reason for these bizarre plots is reflections of the transmitted signal off of surrounding objects. This would explain why  the shape of the plots can vary so wildly between setting that the experiment was taken in, but remain fairly consistent for the same setting.  


The raw data, an enormous mess!

Results sorted by trial (with data averaged to ensure that there is only one point for each distance per trial). Clearly the devices surrounding affect the RSSI readings to a huge extent.
This is no problem for the project, it simply means that the RSSI readings are only effective over a short range. This can be easily counteracted by simply adding more receivers!

I just have to work out how to not clog up the airwaves...

Until next time!

Friday, 21 July 2017

A project - with fellow engineering students

So, three weeks into an outreach project and I decide to post about it (sounds like my usual behavior!).

The University has given two fellow electronic engineers and myself the chance to work on an eight week project over the summer, which is pretty cool. The purpose of this project is to bolster the outreach displays of the electronic engineering department with an exhibition of as many aspects of the discipline as possible. More simply, a scalextric track with autonomous cars, solar panels and radar, WOOHOO.

To be fair the past three weeks would have looked fairly unproductive to the casual observer, very few physical objects have come together. This is because the teams efforts have been directed towards learning how to use our micro controllers of (the University's) choice, the MSP430 manufactured by Texas Instruments.

While simple arduino-like interfaces exist for the MSP430, our project leader insisted that we mirror industrial practice more faithfully and use the more complex Code Composer Studio. While much of the past fortnight has been apparently fruitless as we began to understand how the interaction on the micro controller happened at a hardware level, as a team we now have a good understanding of the micro controllers at a hardware level (funny that).

My own part of the project so far has been focused on ensuring the cars do not collide, and that has mainly meant ensuring that they can communicate wirelessly. The idea behind this is that we can reuse the communicated signals to triangulate the positions of the cars via RSSI.

Having pushed my way up from register level code, today I was finally able to produce a signal strength for distance graph today!

the graph! note that I have no idea of the vertical scaling, hence the simple label, 'not dB'
Sadly the graph indicates that my job is only going to get more interesting from here on out, as clearly when I invert the axis to solve car positions I am going to end up with multiple solutions!

The graph also raises the question of the problem of signals being reflected and so on (at least some of the odd results recorded were unrepeatable after moving various items of equipment around). Finally the graph also reveals very odd behavior around 20 and 70 centimeters. While this most likely an inconvenient reflecting object, the dips correspond (if you squint) to one and two times the wavelength of the RF signal of around 34 cm.

This is going to be a long project so I am hoping to get most of the anomalies solved by next week when perhaps I shall have more to share.
A parting action shot, testing in progress!






Saturday, 3 June 2017

On to the Back-burner with ye!!

So, turns out that manipulating many images, rescaling rotating and moving squillions of moon fragments all at once is rather RAM intensive. Or at least it was with GIMP. Several evenings of 100% memory usage for "this program is not responding" later and Operation Sandra Voi is not looking very healthy. That and the fact that I now have a new set of eyepieces with focal lengths greater than 10mm (which means I can see and image the whole moon at once), means that I shall suspend the project until I can image through the telescope slightly more reliably.

Astronomy has not ended for the moment, Saturn is coming up at the moment which is looking very nice, and I have started looking for some of the Messier objects. Of course they are all far too dim to be photographed, so no nice images.

Anyway, onward to the next crazy project!

Monday, 8 May 2017

The telescope continues...


Soooo - I may have built another telescope and not documented the process at all. Which is a bit of a problem as I now have a folder full of CAD files with really odd, but meaningful, names (like: "SlottyThings.ipt", why did my past self do this to me!). Luckily I have some nice work in progress photos, even if my in depth description may be a bit lacking.

The telescope is a 76mm Newtonian reflector with a potentially equatorial mount. The optical tube, and mount were built using the university laser cutter. Unfortunately I am not yet skilled enough to make the mirrors, mirror cell, tripod or eyepiece myself, so they had to be purchased/scrounged.

The optical tube with the two cheaty elements, the secondary holder and the primary cell. I like the fact that it looks like a big ray gun!

Tube clad in a sheet of black fabric to guard against light pollution, with two points of interest. One, the photo is from before the final mount was assembled so the telescope is attached straight onto the tripod. This was way too shakey and has not been done since. Additionally, you can see the £5 telescope in the bottom right corner! Safe to say the new telescope is incomparably better.

Drama shot, now with proper mount. There have been a couple of modifications since this photo to stiffen up the mount and tripod, but essentially the telescope still looks like this.



Of course no project would be complete without an even more ambitious project to follow it. Thus, "Operation Sandra Voi", the plan is to produce a mosaic image of the moon by stitching together lots of smaller images. My eyepiece's field of view is quite limited, so this is the only way I can produce a complete picture of the moon, and hopefully it will look really good when it is done: I can always go back and re-image sections that are either incomplete or of poor quality after a first pass.

"Sandra Voi" is named after one of the lighthuggers from Alastair Reynolds's Revelation Space series, only mentioned in passing a couple of times, it is an exploration ship just as hopefully the project will help me explore astronomy (ha ha, maybe I should have come up with a cool acronym instead). The naming scheme does leave me with a bit of a problem as I haven't thought of a cool enough project to call "Operation Nostalgia for Infinity" yet...


Photo, apologies for any confusion, due to the optics of the telescope the image is flipped, I also have no idea about the rotational orientation! I am fairly sure that it is the boundary between the Mare Serenitatis and Mare Imbrium, with a fairly faint Copernicus crater at the top of the image.

Preliminary mosaic with a nice template in the background kindly provided by good 'ol NASA.

Friday, 24 February 2017

the £5 telescope

Sooooo - haven't posted in a while, but I think this one will be the first of many in the near future.

The title is true (approximately), on the day I built the telescope I spent less than £3.50 - but I already had convenient tubing and tape lying around.

Long story short, I decided to have a rather strong coffee on Tuesday morning and that evening, having buzzed around all day, I had built myself a 75mm aperture refracting telescope. Why? Well I have always enjoyed looking through my dad's telescope back home, pointing it at Jupiter, Venus, Mars, the moon and whatever else happened to be along my line of sight. I have been having withdrawal symptoms ever since coming to uni, but my recently completed work for the ESA "fly a rocket program" (more on that in another post) tipped me over the edge.

How did I do it? Search up refracting telescope on google and you will get all sorts of lovely diagrams, adverts, pictures and links to educational websites. Trawling through this lot left me with two impressions: 1. Whatever I built wasn't going to produce pretty images - the colours would blur away from the centre of the image, the image would be flipped and shapes may end up distorted as well. 2. Magnification is done at the eyepiece (the place where your eye goes) - a good goal for the main telescope-y bit is to get it as large as possible, both in diameter (to get as much light), and length (as this counters 1.), but these are both limited by the lenses you use.
Off I went to find a nice big lens to put at the front of my telescope, the correct name for this lens is the 'objective'. Hundreds of years of gradual improvements to telescope design started pretty much immediately by getting rid of the standard convex lens as the objective, instead using all sorts of wonderful shapes to limit colour blurring.
HA HA HA. 
75p later I have myself the greatest abomination of an objective lens in the form of a wilco magnifying glass. At 75mm across it is not the biggest lens, but it is a lot bigger than my eye which is actually the important bit. Another ~£1.50 later and I have myself a pair of small binoculars from a charity store, ready to be killed and resurrected as my eyepiece. None of this is going to work fantastically, but all I want to do is not have only my eyes to look at the stars with.

So having spent the entire day polishing my new objective lens I rushed home to begin construction!! The key thing I was concerned about with the focal length of each of my lenses (including the ones from my binoculars). This simply involved pointing a lamp into the lens from a long way away, and then looking to see where the image came out clearly on the other side:


As you can see I had lots of fun with little pieces of tape, the first black piece after the big lens marks the focal length of that lens while the white pieces were used to measure the distance from the target to my eye.

One of the key mistakes I made at this point was to check for magnification. This being my first recent foray into optics, I really didn't want to manage to make an incredibly convoluted way of looking through a cardboard tube, with all benefits brought by the lenses cancelled in some way. As all I wanted to do was see some of my favourite nighttime targets a bit more precisely, I didn't really care how much magnification I got, simply that it was more than none. Thus I spent ages with the white bits of tape, checking angular sizes of things with and without the lenses, only to realise later that magnification comes primarily from the eyepiece, which usually like to sit very near the focus of the scope - which simplified the design immensely.

Construction was very simple:

  1. Take cardboard and cut section off with  a length corresponding to the focal length of your objective lens, I tried with a slightly longer tube to begin with but this did not work at all.
  2. Cut another much shorter section of cardboard to act as a light shield in front of your objective lens.
  3. I then added slightly smaller rings of cardboard inside the two sections at the ends where I was going to put my objective lens to help mount the objective lens and keep it still once the telescope was complete.
  4. Then tape the cardboard sections together with the objective lens between them.
  5. Now we need to have some sort of mounting for our eyepiece (s). Looking around the web you can see that most mountings allow for the eyepiece to move towards and away from the objective lens to help focus the output image. I took a ring of cardboard with a diameter such that a toilet paper roll could slide through it. I then took a convenient object matching the cross section of my main tube (the end of the tube for when it was a postage tube), cut a hole at its center with a diameter corresponding to my loo paper roll collar, then taped the collar into this hole.
  6. Bodge an eyepiece. I am still doing this. Actually looking at eyepiece layouts was a good start, I eventually opted for a Ramsden configuration as this was the best I could do with the lenses available...

My conclusions...

£5 for any telescope would be good, but building it has meant that instead of a rubbishy kids second hand novelty scope I have ended up with a passable scope with an alright aperture and plenty of potential. At the moment the telescope mainly just focuses images, without enhancing them too much, but with some more lenses (and a bit of practice) I think that new eyepieces would drastically improve the telescope's performance. The dodgy objective lens reduces the potential utility of the scope: colour bleed and image distortion are utterly pathetic, and this project is missing the crucial element of any true telescope - the mount.

I envision many happy evenings spent looking at random celestial objects with the telescope, but in reality I think my efforts in telescope building may have only just begun...



Monday, 7 November 2016

Lunar Rover progress update

Been a while but here we go!!

So progress on the lunar rover project has been reflective of the once a week meetings - as predicted the comms team merged with control (although there was a proposal to spin off power into its own team).

One of the problems we are facing is that we cannot easily define the boundaries of each team so early in the project. Ideally communications would build the talking bit of the robot, how we get information into and out of the robot including commands, sensor data and possibly images. Control will have to deal with how we use this information on board the rover, including making it move and deploy our sensors. Power will be given a big battery, a bunch of required outputs and told to go sit in a corner and design an interface between the two.

The problem arises when the functionality of one section impact on another. The best example here is the communications potentially impacting on the control system by restricting the amount of information we can feed to the rover.

How do we solve this? It will probably be done gradually, as things start to fall into place the required behaviours of each section will become better defined to the point where sub teams can split off to work on separate project areas.

What has actually happened so far? A bunch of rough proposal work, most teams (including the structural teams) have come up with a rough idea of what they are supposed to be doing and passed on the biggest requirements they can think of to everyone else (including the fact that the payload deployment and drive train will probably mean we have to deal with upwards of 6 motors :| ). Within the control/comms/power team we have come up with some basic control system ideas - and how each have to be supported by the communication and power teams. While Raspberry Pi came up as the immediately obvious solution (you can say it is a proven technology and therefore less risky, as well as being easy-ish to use), someone from the control team found a Commercial Off The Shelf (COTS) piloting and control system, a bit pricey but would certainly solve many of our problems at a stroke.

Our next meeting is tomorrow, so ideally there will soon be lots to write about.





Thursday, 27 October 2016

3DS Hardmod and Wii Controller Dissassembly

Hi, Andrey over here.
One of my flatmate's Wii Controllers were in quite bad condition after travelling across Asia for a while....
So I took them apart, desoldered the battery contacts and submerged everything but the PCB in soapy water (to remove gunk and alkaline corrotion). Soon I will reassemble them and hopefully there won't be explosions (hehehe).


Also, a couple of weeks ago, I modified my "New 3DS XL" by soldering four wires to the NAND chip test points. The mod allows to copy the firmware directly from the NAND chip by using an SD card reader. With the firmware backed up, many doors for homebrew open up   ͡° ͜ʖ ͡°)



Tuesday, 18 October 2016

Just One More Resistor Begins...

Here we go!

So, why the blog?
Well, to display some of the insanely cool projects I have managed to throw together (mainly with others) after only a year of studying Electrical and Electronic engineering (time period growing as we go on).

For example, after only 6 months of electronic goodness myself and three others attempted to make a radio telescope as an entry into a 24 hour hackathon. I actually wrote a post somewhere else (here). Surprisingly we did not do too badly, we were not able to get a high enough angular resolution and the weather on the day prevented us from taking it outside and pointing it at the largest object we could find (the sun).

Other projects included an antweight robot wars entry, and a model rocket accelerometer payload.

Coming in the near future are more robots (including fun with servos), and possibly an internet connected coffee machine...