Thursday 26 April 2012

That'll Learn Em... (Warning, contains extensive rantings)...

I've never been one to do things the easy way and I always get more enjoyment from finding my own solutions to problems than relying on what others have done. I once spent months trying to get somebody to machine parts for me with a lathe with no luck. So I made my own lathe. It wasn't the most accurate tool I have ever made, but it was more than adequate enough to build jet engine parts, after some practice. That's the trouble when something seems impossible, you only realise how hard it was when you have accomplished it. I still haven't had the sense of whats possible/impossible beaten out of me by the education system yet, I have known a few students who just give up or think something is too hard to do and never even make an attempt. There is a whole culture that has developed in academia where attempting something and failing is viewed as wrong especially with some of the tutors who will throw up their arms and roll their eyes should a student answer a question wrong in class. I can't count how many times I have tried a new approach and failed, but I'd pick up the bits and try again. When I say pick up the bits, a lot of the time this is literally what happens, usually accompanied with flames and some blood loss, but that's another story.

I may have said this before, but I was genuinely surprised when I started uni in that there seemed to be hardly anybody else who did any sort of engineering outside of the curriculum in their own time. I have naively thought that naturally everybody else would be like me and they were not. I have since found out over the next few years that I wasn't alone and there was a handful of other people, I never saw a degree as a simple stepping stone into a good career like a lot of students, I just wanted to learn and to use what I learned to improve my own projects, which in hindsight was also somewhat naive. How well you do in a degree in aerospace engineering seems to me to be how well you can remember vast chunks of information and jumping through the right hoops rather than any real understanding of the subjects.

As you may have noticed I have been messing about a lot with data acquisition devices, and for more years than I care to remember. Not just DAQ's but jet engines, rockets, model aircraft, pulsejets ect. I built my first large solid fuelled rocket motor when I was sixteen. A couple years later when I found out that I could measure thrust with a computer and not the Rube Goldberg type contraption I was using that consisted of a felt pen, a set of fishing scales, a Meccano motor and a few other things and I never looked back. So you can imagine more than ten years of using DAQ's later, how much I was looking forward to a module in year two of my degree called 'Instrumentation' which was to teach me about DAQ's, load cells, thermocouples, strain gauges, piezo-electric accelerometers and so on. That excitement soon faded due to a tutor who showed zero interest and would do nothing more than read from a book. His exam was based on a set of notes over 100 pages thick copied from an E book, with two pages of the book printed on each sheet, front and back. I scored 43% and almost failed the module. Others who have the capacity to remember vast chunks of information got higher marks, but not by much. Am I bitter, of course I am, it annoys me that I have feel as though I have an understanding of the subject but because I was unable to state a vague equation from one of the hundreds in the book or draw precisely one of the many DAQ logic circuits out of the many available, that I have to feel as though I have nearly failed.

I know I am moaning, but the education system in the UK is rubbish. The standardisation of the curriculum means that there is no capacity for children to show their full potential. Some will grasp subjects earlier than others but are then forced to carry on at the same boring pace. Others may not excel at academic subjects but might show flair for arts subjects, which are then usually ignored. How many arts teachers does the average high school have? How many music teachers? Mine had one of each, yet we had several French teachers, maths teachers, science teachers and three computer teachers, this was back in the day when we were still using BBC Microsoft computers with 5" floppy drives!. Why aren't we encouraging what children excel at, rather than making sure they all get the same education which just penalises the entire country. Churning out vast numbers of children who are either disillusioned with the system or have been ignored and do poorly in their exams, yet we wonder why there are many reports of school leavers having ever reducing standards of maths and literacy.

Every level of education from infant school, high school, A-level and degrees are treated in the same linear manner. Easy things are taught first and they progress in difficulty with each year. At first this seems a logical method of teaching, but looking at my experiences in maths and science education, then it starts to fall apart. I left school with a D in maths GCSE Now I have almost finished an aerospace engineering masters degree which is more or less a maths degree in disguise. Thinking back I was almost constantly bored, preferring to read anything I could get my hands on in the libraries to doing my homework on memorising Latin nouns. I could have easily handled more complex subjects but the copying of paragraphs from textbooks was what got you the marks not your knowledge on geology. So why can't you teach high school kids about calculus, why wait till they do A levels? Why at degree level do we still have to work through huge mathematical problems that give the same nice round answers as the tutors marking scheme in order to get the grades to go onto to potentially design aircraft? Real world problems never give nice round answers, nor would you be expected to work through a problem from first principles in the real world. If you truly understand a mathematical process then you should be able to write a program to solve it, computers do not remove an understanding of the theoretical methods despite what some people say. I think we are approaching a cross roads similar to what happened when calculators were introduced and those who held the slide rule and log tables as the only 'proper' methods also thought calculators took away the understanding. More and more kids are teaching themselves how to program, so hopefully the tide will turn and the long, tedious days of solving neat problems in the back of an exercise book will be over. Computers are great problem solving tools, let them do the hard work!

DAQ To Labview

I've noticed a lot of hits on my blog have been from a Google search trying to couple a DAQ with Labview. I have briefly alluded to how I did this a couple of weeks ago, so I thought I'd go over it again in a bit more depth. This vi should run for any DAQ that uses a serial port or runs through a virtual serial port, I'm not sure how many of the DAQ's out there that do it this way though. Of course the easy way to do this would be to buy a National Instruments DAQ, but this would require you to sell a kidney as they aren't cheap. There are several DAQ manufacturers who will provide Labview vi's for their equipment and it's always worth investigating prior to buying one.

I have actually downloaded a few beginners guides to programming in Python, I am quite proficient at Matlab scripts, so it wouldn't take long to learn the syntax. Depending on how I progress with Labview and whether it can actually do the things I want without dragging its heels, I may end up scrapping it all together and write a dashboard program from scratch in Python. Another student at uni is in the progress of building a flight simulator with several screens and a true to life aircraft cockpit, and has built several virtual aircraft gauges using C++, so that's another option. My first impressions of Labview were favourable, but the more I try to use it, the more 'clumsy' it seems. But we'll see, and I will persevre with it for now.

Anyway my vi for the µChameleon DAQ looks like this, it is very simple when compared to other DAQ vi's I have seen. I have no idea if that is a good thing or not. Since this particular DAQ has firmware which creates a virtual serial port, it is 'easy' work to get it to work with Labview. I'm sure there are much easier ways to do this, but I have had less than twenty hours time with Labview, so I will gradually improve things as I go. I have labelled the vi with as many comments as I can think of to help, rather than try to explain every last step because pictures really do say a thousand words! The vi is based on VISA, (virtual instrument software architecture), and will find any device connected to the serial port).

Within the vi you may notice a small block I have labelled as a sub vi. This was a small vi I 'borrowed' from somebody else's program, I forget who's because I have downloaded so many and picked each one apart to see how it worked, but whoever you were, thank you!! But I digress, here is what is contained within the sub vi. I will get around to putting up a download link for my vi when its done.