learning
RepRap Open Motor Controller Completed
by Matt on Aug.12, 2012, under FOSS, learning, life, Open Hardware
I’ve finally finished the controller for the TVRRUG Open Motor Controller with a few really stupid mistakes.
The mistakes I made are all dumb, the simpler one to fix was that I misread a brown line on a resistor as a red line. Much swearing and de-soldering ensued and 3 resistors where taken off and replaced. The one that caused me the most headaches was the fact that I started soldering down the long IC socket without checking all the pins had passed through. Stupid! Taking the socket back out I managed to break the socket. After getting a second socket I managed to rip one of the pads off the board while clearing the old solder out.
Luckily the TVRRUG are quite handy at solving awkward problems and with all the boards being open source I discovered (with some help) that a simple jump wire could resolve this problem (Thanks Mike the Bee).
Once the fix was in place I ran the electrical tests and all was fine! Now I just need to think about how to mount all of these together and build the cabling for it.
Making a RepRap
by Matt on Aug.05, 2012, under learning, life, Open Hardware
A little over a month ago I decided that what would be really useful to have in the workshop would be a 3D printer. I’d been looking at these for a while and seen several more commercial variants, but I’ve been more and more taken with Open Hardware since I’ve been at the Hackspace and finally decided that a RepRap would be the best thing to build.
But why? Why build a 3d printer of all things? Well let me explain. Over the past couple of years I’ve been getting more and more into working with hardware, and specifically electronics. I seem to have gained an urge to make things that (to me) are awesome. My home sensor network project is one example of this, though from some time ago my bluetooth doorbell is another. Making things seems….. right in many ways. When I started programming I was always told that you needed to find your “itch” before you’d have a project that was successful, but all my itches seem to be in the physical world, not inside my computer.
Things that are functional but could be a little bit better are everywhere! A good example is the desk I’m sat writing this at. It’s really designed for a desktop PC, not a laptop, and is a bit small and… well… not great. Importantly it was free… however I think I can make this better (much much better) with a little thought and a little work. Back to 3d printers specifically, there are things that could be made a little better with some thought and a bit of printing. On the back of my workbench is a piece of board covered in little holes, what would be immensely useful would be to have some bulldog clips (or somesuch) that could be attached to that board to allow me to pin plans of what I’m building to it. Another useful thing it could do with is a few spools to hold my various reels of wire. on my desk in work, I could do with a few nice looking little things that keep my cables on top of the desk neat and out of the way. The brackets on my bookshelves could do with a little improvement too. These are all small things, and not massive in their own right, but if I could sit down, design the thing, and then print them when I needed more, how amazing would that be? The other driving force at the moment is the fact that I can’t for the life of me cut enclosure boxes correctly. I really suck at it. With a 3d printer I could design the enclosure and just hit print! Again another improvement.
Most of all though, at the moment I have a bit of a drive to make awesome things, and making something that can make more awesome things seems like a no brainer to me!
Making my life even easier, is the fact that there is a local group operating out of the Hackspace (amongst other places) that have designed all of the various reprap bits and assemblies already. The Thames Valley RepRap User Group (TVRRUG) have already done a group buy and build of a version 1 system and are now on the version 2 system. I’ve signed up to be a builder in round 2 and have now received my control electronics to piece together. After a morning at the Hackspace, I’d managed to assemble the first of the two motor controller boards, and a few hours at home got me the second. I just need to piece together the Motor Controller board on Tuesday evening at the Space and then it’s a waiting game for the frame assembly to arrive
All of the guys involved with the TVRRUG build should be congratulated. They’ve made building a RepRap not only easy, but fairly convenient too.
More updates to come as I finish building things.
Day 3: Printers and Development
by Matt on Jul.03, 2011, under learning, programming, ubuntu, windows
This is where I’ll slightly move away from “the average persons” tasks. Day to day I write or manage software projects, and for this experiment to continue I need to be able to do that on my laptop. Generally I work day to day using python in Eclipse with the pydev extension. This is relativley easy to get going on Windows, download a JDK, install eclipse, download/install python, install pydev. Job done. However I wanted to play with the Microsoft blessed languages, so I downloaded and installed Visual C# express as well. C# is a language I’ve had to use before, so I’m a bit rusty, but should be able to pick it up relativley quickly, and a big kudos to MS as the Visual Studio envornment is still probably the best IDE on the planet (I’m open to suggestions of others which do the job as well, but I’ve yet to play with one that does).
c# uses the .net framework to do all the heavy lifting. It’s a bit like Java in that it’s compiled into byte code and then interpreted so isn’t as fast as something like C++ but makes up for that by being easy and fast to develop in. Some of the widgets that come with the new .net framework (such as the graphing widget) are pretty fantastic and really do make life easy. In a couple of hours I’d refamiliarised myself with the language and written a short program that took in a CSV export from my Current Cost recording box and turned it into a nice graph. Doing the same using the GTK toolkit would probably take a bit longer with a little hacking around as there’s no dedicated graphing widget (that I’m aware of), so you’d have to generate the graph either on the fly by drawing it at a lower level or by creating a jpg and then displaying that in an image box.
One minor issue with the Visual Studio express suite is that there is no built in in subversioning system. At work, and most of the time at home, I tend to use the bzr suite of tools. A quick look on the bzr website and that’s also available for Windows. Download, install and it integrates very nicely into the My Computer interface, and can be called from the command prompt. Easy.
A lot of my dev work is for server stuff, so putty and winscp were downloaded and installed successfully on top of that as well.
Printers are another problem and a bit of a nightmare. I have an HP Photosmart C4180 All-in-One that I bought some time ago while I was at university. Having long since lost the driver disk for this, I nievley just plugged it in and hoped Windows would just find it as Ubuntu does. No such luck. It goes away and gives me a list of printers which mine isn’t in and then offers me the option to go to the Windows update site to find even more. I click that button and wait 5 minutes… then another 5 minutes… then it gives me a bigger list of printers. My printer is in this list (why it couldn’t just have said “We found your printer! Here is the driver.” rather than me spending 5 minutes scrolling through a badly sorted list I don’t know) and then installed it. The scanner wouldn’t work without the software from HP, but otherwise the thing worked as expected.
I have to admit, the boot time for Windows is now slowing down considerably. But my games work and it’s not overly getting in my way yet. So we’ll see.
Day 2: Music and pictures
by Matt on Jun.11, 2011, under learning, life, ubuntu, windows
All of my music and my images are backed up onto a small NAS I have at home. Simple! I thought daftly. Mount the NAS, copy the files into My Music and carry on. Again, so very wrong. Copying a single folder works, trying to copy all of them at the same time doesn’t! This is very annoying! How would I go about mending this in Linux? 3 lines of bash, or… rsync!
Googling around, I found that windows has a command in the command prompt called robocopy (I’m on windows and forced onto a command prompt, go figure) The command seems to be “robocopy z:\ c:\Users\Matt\Music /MIR”, and this seems to be working!
Windows Media Player seemed to pick up all of my MP3 files relativley quickly, and found/retrieved the album art where it was missing as well. However, all of my Ogg files where not found and not playable. A quick google around for an ogg codec for windows finds vorbis.com and a codec for “DirectShow based players”. It seems to imply WMP is one of these, so I grab it, install it, and can play my Ogg files! Although it doesn’t show the total running time in the playlist like it does MP3s for some reason. Never mind!
The only other music I tend to listen too is from Spotify. A quick trip to their website to grab the Windows client, and that wors straight away. Nice and easy
Photo’s are a completley different kettle of fish. I have a total of 56.7GB of photos on my network storage. When I’m in Ubuntu I tend to only keep a smallish selection of these on the laptop. So for the purposes of this experiment, I’ll just import the ones from this year. At a mere 6.67GB, this should take about an hour off the slow network storage. I left this to copy, came back and tried to find some photo management software. Windows 7 seems to come with the “Windows Live Photo Gallery”, so trying to use the default software I fired this up. It asked me to sign in with my Windows Live ID (which I have courtesy of my XBox 360) and the quite quickly shows me all the photos I’ve just imported.
Helpfully it also throws me a message saying it can’t open some file types (namely my Canon RAW files) and I need something called a “codec” to view them. It then takes me staright to the Canon download site for the raw codec. Quite handy. A 28MB download later and a reboot, all my pictures are now visable and viewable.
This seems to be just as usable as Shotwell, I can tag pictures, browse by dates, see the various metadata for each image, there is a small amount of editing possible. It feels a bit clunky though. Occasionally you can’t double click to preview a photo, you have to right click then go preview. Otherwise it seems more than capable for my mediocre photo managing tasks.
Tomorrow, I’ll attempt something a bit more taxing. I’ll try and get the printer working and have a look into application development in Windows.
From Linux to Windows for 30 days
by Matt on Jun.09, 2011, under learning, ubuntu, windows
Having recently read this article about a journalist trying to use Ubuntu for 30 days, and having seen similar articles in the past, I’ve decided on an experiment.
For the past …… many years I’ve used Linux (of various flavours) as my primary desktop OS. I’ve used Windows in the past for games and the like, but haven’t used it for anything else since Windows XP was new. Very ingrained in my mind these days is the “Linux way” of doing things. If something’s broken, try and fix it, help others fix issues they may not be able to resolve themselves and so on.
The experiment I propose is this, I intend to reverse the article quoted above. There are a few caveats on this however, I’m a slightly more advanced user than the chap writing that article, and have used Windows before (sometime in the past!). I’ll try and keep this more or less regularly updated with how things go with various productivity tasks and my day to day jobs. Hopefully the things I learn will be useful somewhere!
Banishing the Demons of Distraction Redux
by Matt on May.20, 2011, under learning, life, linux, programming, python, ubuntu
My fight against distractions has carried on further. This brief episode is brought to you by the theory of “scratching your own itch”.
There are a lot of things that annoy me with various tasks I perform every day. This past week I’ve been taking note of each one, and I count 78 in total. Each one of those 78 things could probably be fixed very easily, but because I’m generally running around like a headless chicken trying to get things done, I don’t even think about fixing them, I just put up with them and carry on. A fair few of these are things that take a while to fix, like the office being short of physical space because of all the orders coming in/out at the moment. Other issues are easy to fix, like the fact that it takes me 30 minutes to an hour to do a quick analysis of some testing data. This is a problem I can solve easily with a smattering of python and a little concentration. In fact, I’m intending to tackle this on Sunday by going into the office when it’s quiet, and just making this problem vanish.
A few other problems on that list of 78 can also be solved with code, some easily, some not so. Some can be solved by a few simple changes in my work routine, like the fact I constantly go to do a task, get pulled away by something else, and then forget what I was going to do. Keeping a simple log book of what I’m doing during the day would solve this easily. It would be better if this was digitized in some form, but for now a simple notebook will probably make a huge difference. This distraction on its own has probably caused me to lose my train of thought more times this week than any other on the list.
So how id my fight going? I’m much more aware of what causes me to be distracted after the past week or so. It’s taking me time to come to terms with each of those distractions and to deal with them, but ultimately, I am becoming more productive in a given period of time. The next big thing I’m going to have to tackle is project methodology. Since I don’t even have a passing familiarity with any of the standard methodologies, this is going to take some research, some thought and a lot of conversations in order to find the best one to suite the needs of my team at work. As always, any pertinant reading material suggestions are always welcome.
Banishing the demons of distraction
by Matt on May.08, 2011, under Fun, learning, life, linux, ubuntu
For a little while now I’ve been getting quite annoyed with myself for being very easily distracted (be it with llamas, badgers, narwhals or whatever). This has meant that my general level of productivity has been somewhat…… low. I have a list of running projects as long as my arm, none of which get enough attention because I flit form one to the other almost hourly. The situation as is obviously needs addressing.
From what little intelligence I can bring to bear on the problem, this should be able to be broken down into a few different variables:
- Environmental
- Physical
- Grey-mushial (?)
Environmental
Fixing environmental problems is relativley easy. If I want to concentrate on a task now I use my Mac Mini. Not because OSX is any more productive than Ubuntu I hasn’t to add, but because it is in a room on a desk with a comfortable chair in a comfortable working position. There is no television, no games consoles or anything else around to take my attention away from what I’m attempting to do.
In the office at work, I try and keep my desk clear of clutter. When there is a lot going on, or a lot of noise around, the twin help of Spotify and a decent pair of headphones can help keep me inside my own head and in my comfortable work zone. Anything I would sit and watch constantly for updates or results is now being reworked to email me or notify my some other way so that I can carry on concentrating on the more important tasks rather than waiting for something else to finish.
Physical
With this I refer to my general physical fitness and general wellbeing. I am quite aware that I don’t get enough exercise, but have yet to generate a plan to resolve this. Until recently I had no idea how well I ate. Throwing together a nasty hackey database in Django (code), I actually discovered I don’t eat too badly… but can binge on chocolate when things get a bit stressful! This is quite easy to rectify by stopping buying lunch and making it in advance. I still crave the chocolate quite a lot during the day, but hopefully this will fade away given some time!
Grey-mushial
This is what’s going on in my head and possibly the hardest part of the whole cycle to change. When I get frustrated with something I lose the will to carry on with something. This is normally the major factor in why I jump from project to project, task to task without completing things. I get frustrated and annoyed that I can’t do something so move onto something else I can do. This has a lot of negative impact as it means that sometimes I struggleto learn something new and overcome certain issues. This is quite hard to change, but I’m attempting to bring some positive re-inforcement to bear on the problem. Craving chocolate when being frustrated isn’t helping things, however, if I now manage to solve a problem that’s frustrating me then I can have some chocolate. This helps me motivate myself to push through the problems that keep me stumped, frustrated and annoyed.
Actually keeping my mind on task is another seperate problem. This, at the moment, I have no idea how to solve. I’ve started reading around this and started reading up on Zen as a lot of Zen practice seems to be based on either keeping your mind on a single thing or emptying your mind of all things completley. This may help, this may not help! Anything I struggle to concentrate on I make a note of what it is, hopefully some kind of pattern will emerge from the mess over time. For some reason, one thing I really can concentrate on without being distracted is painting my 40k models. I have no idea at all why this specifically is so easy to concentrate on, but an interesting observation none the less.
Why bring all this up on here? Well, for a start this place is one of my projects that gets overlooked quite frequently, and secondly so that if anyone does have any dealings with myself where I start something and don’t necessarily stick to it for a period of time….. let me know in case I haven’t noticed. There is a lot of Ubuntu stuff I’d love to do if I could just get over these daft concentration issues!
Training vs Teaching
by Matt on Dec.11, 2010, under learning, life, programming, ubuntu
Today I’ve been mostly teaching myself the oddities of C++. Now C++ is an object orientated language that’s an extension of C. This has led me to a revalation.
Recently at work I’ve been doing masses of OO stuff (as a change from the previous stuff I was writing which was largely linear) and as a result of that I’ve started seeing the world in terms of objects. Now in order to achieve what I needed at work, I ended up reading up on the theory of objects and what they actually are. In times past when I’ve been “taught” how to program (rather than teaching myself) , the content of the classes where more designed for a specific language on how to solve a specific problem. I think I only once sat in a computing based lecture that talked about the more abstract issues in programming. Whenever I start designing a program I always go back to that single lecture, and a few books that have a higher level stance on problems (such as Design Patterns) and then once I’m passed that do I go to the language specific things.
The reason I digress this far is that after learning all this meta-stuff, learning another language is actually relatively easy. Now everything is falling down to syntax rather than subject. Going back to the title, I think that those lectures that taught me to do this in this language because it does that has got things backwards. They were doing the training first in the hope it would teach you something. What they should be doing is teaching you the concepts (all the “meta”) and the train you in the language.
Teach and then train, not train and then teach. Something I shall have to try and follow more often in the future.
(Many thanks to Alan Bell for the inspiration in the title
)
Arduino powered lights and heating!
by Matt on Nov.07, 2010, under arduino, learning, ubuntu, Uncategorized
Over the past few weeks as it gets colder, I’ve really started to notice the significant bite in heating costs from our flat being largely electrically heated. The main issue with this system is that none of the heaters have thermostats, they are either on, or off. As each heater is 2kW or greater, and there are 4 of them in the flat, that means at any one time we could be using 8kWh of electricity. Which is a lot of money during the day!
The solution? Build a thermostat for them (and replace 2 with a gas convection heater). The circuit for this is quite simple thanks to the fantastic home easy set of sockets. I bought a pack of three sockets (with a remote) and a light bulb holder (we’ll come back to that later). On top of this I needed a temperature sensor (tmp36), a 433MHz transmitter , a 433MHz reciever and an arduino uno.
Thanks to the lovely folks at the Home Easy Hacking Wiki getting this lot to work together with an arduino is easy as anything! Here is the basic circuit:
This is only the transmitter/temperature sensor part. Initially you’ll need to build a receiver to get the ID of your remote. This can be found at this page in the arduino playground. Once you have your remotes ID, you just need a simple arduino sketch to turn the socket thats plugged into the heater on/off! Here it is….
HomeEasy homeEasy; boolean isOn; int incomingByte = 0; // for incoming serial data float timeOn=-900000; int myCode = 1595082; void setup() { Serial.begin(9600); homeEasy = HomeEasy(); homeEasy.init(); isOn = false; // 1 = On, 0 = Off } void loop() { float temp = getTemp(0); Serial.println(temp); if (Serial.available() > 0) { // read the incoming byte: incomingByte = Serial.read(); // say what you got: if (incomingByte == 111){ //turn on the group homeEasy.sendAdvancedProtocolMessage(myCode, 0, true, true ); homeEasy.sendAdvancedProtocolMessage(myCode, 0, true, true ); } else if (incomingByte == 102){ // turn off the group homeEasy.sendAdvancedProtocolMessage(myCode, 0, false, true ); homeEasy.sendAdvancedProtocolMessage(myCode, 0, false, true ); } } if (temp < 18.0 && isOn == false && millis()-timeOn > 300000 ) { //turn on the heaters homeEasy.sendAdvancedProtocolMessage(myCode, 0, true, false ); homeEasy.sendAdvancedProtocolMessage(myCode, 0, true, false ); isOn = true; timeOn = millis(); } else if (temp > 18.0 && isOn == true && millis()-timeOn > 300000 ) { homeEasy.sendAdvancedProtocolMessage(myCode, 0, false, false ); homeEasy.sendAdvancedProtocolMessage(myCode, 0, false, false ); isOn = false; timeOn = millis(); } } /* * getVoltage() – returns the voltage on the analog input defined by * pin */ float getTemp(int pin){ return (((analogRead(pin) * .004882814)-0.5)*100.0); //converting from a 0 to 1023 digital range // to 0 to 5 volts (each 1 reading equals ~ 5 millivolts } |
This code ensures that there is no change in status for at least 5 minutes, basically so the socket doesn’t go continuously on/off and damage something! There is also a hook for a serial input to turn on the “group” of the remote. This is to turn on the light in my bedroom. I’m in the process of writing two simple bits of python to turn a light on/of depending which is run. This means I can set up a cron to turn on a light at a given time! Simple alarm clock
To get this code to work you’ll need the homeeasy library from here. You may need to alter the pin allocation in homeeasy.cpp, but that shouldn’t be too hard to do!
Next thing to do on this project is to get my Revo setup as a little wireless server box to graph the temperature changes and run the alarm clock. Conveniently it’s being replaced with a mac mini this week so has become available to complete the project. This will be a simple ubuntu box, running ubuntu server and little else really. Thought it may gain an ldap database for another, slightly different project.
Chillis!
by Matt on Jan.31, 2010, under Fun, learning, life, ubuntu
Having seen other peoples success of growing chillis from seed (specifically theopensourcerer) I thought this year I’d have a go. So in what could possibly be said to be a familiar style…..
I’m only attempting three types of chillis this year, cayenne long hot, navaho and scotch bonnet. In the interest of science I’m trying theopensourcers method of germinating the seeds, and tomorrow evening will be attempting some in plain pots with compost in a heated propagator. This may mean I end up with an absolutley enormous glut of chillis, but I’ll burn that bridge when I come to it.
Here are the seeds ready for the airing cupboard.
I’m also in the process of building an automated watering system for these once they’re in the greenhouse using arduinos, and hopefully connecting to a server in the house using an easy radio link to report the conditions in the greenhouse
Many thanks to theopensourcerer for the information he’s posted on his blog.




