Friday, 25 May 2012

And now for something completly different....

I should apologise for the lack of posts over the last few weeks, I am in the middle of my fourth year exams and the last few weeks before the semester finished I was run off my feet with a never ending list of coursework and reports. One of the modules had me doing some interesting programming of the vortex sheet produced by a wing to investigate the wing tip vortices's to see if the wake interfered with the tailplane. So while I have a few days between exams thought I'd write up a bit on this because having researched this topic, I know how tricky it was to model. The code is written in Matlab and a link to the scripts will be given at the bottom of the page. The mathematics behind computation of the vortical wake produced by a wing is too long for me to delve into for this mid-exam blog post, if there is enough interest I am more than happy to cover this in a future blog, but for now I will just gloss over the details and show the pretty pictures. After the last few weeks of non-stop revision digging out my notes and writing what would amount to another small report is the last thing on my mind. Besides, the UK is in the grip of a heatwave at the moment, it is nearly 28`C outside which reduces my desire to write up my derivations even more! For those of you who are reading this from sunnier climates it might sound like an average day for you, but for us it is almost unheard of on this rain drenched island.


Here is the classic NASA video of an experiment to show the vortex produced by the wing of an aircraft. These wing vortices's can interact with the empannage of the aircraft producing unpleasant effects as well as interfering with the behaviour of other aircraft. This is a well known phenomenon among large aircraft and most people know there are separation limits that govern take off and landings for commercial aircraft, but this video shows that the vortex sheet produced by an microlight aircraft is enough to interfere with a second microlight.


Here are a couple of screen shots from the my wake code that predicts the wake produced by a small aerobatic trainer type, aircraft which myself and several of my classmates designed for one of our uni modules. After finding the wake, the Matlab code will also plot the wing, fin and tailplane geometries to see if the wake produced any undesirable effects on the tail surfaces. 


The two files at the end of this post are the script 'wingwake.m' and function file 'vortex.m' for the wing vortex model. You'll need to download both into the same destination folder but only the 'wingwake.m' file needs to be run, and you will also of course, need a copy of Matlab. I will one day modify the code to add in the effects of flap deployment and tidy it up with a GUI, but I don't have the time yet. I never have the time for anything these days least of all the interesting projects. I haven't touched my gas turbine dashboard for a while and I'm itching to get back to it. 
Talking of interesting projects, fingers crossed I will start a PhD in a few weeks looking at CFD of ships with a view to improving the design process with respect to the handling qualities of a helicopter during deck operations.. I can't wait!

WingWake.m
Vortex.m

Wild goose chase.

It is Tuesday night, three days ago, the night before an exam... This happens, true story..
My four year old niece decides she wants to play with the quails. I had bought my mother a pair as part of her suburban dream of starting some kind of farm in her garden. Anyway my niece inadvertently releases a quail into the garden which then takes an instant dislike to any efforts to catch it, and hops the eight foot high wall into the neighbours garden. My brother, father of the now crying child jumps the over the wall, meanwhile the quail finds his new garden is not suitable for its taste, probably a lack of storage and decides to fly, magnificently for a quail, the twenty feet over the alleyway into another garden which is perfect quail habitat. Four foot high weeds, brambles, nettles, grass, bricks and an outdoor toilet that would look good in trainspotting. Que an hour later after much careful poking, swearing, scratching, shaking twigs and false alarms, where I stalked and caught a dried up plant that looked suspiciously like a quail. Dammit.
All hope had faded until my brother poked the quail up its bum and it took off again, clearing another eight foot high brick wall and into another garden. I started to sense a pattern developing here that quails can fly and they can fly better than I can climb walls in my bare feet. Within seconds we are perched on top of the wall trying to see where it went, at which point the neighbours two dogs appear. They are mental, they are angry. So angry that my bottom hole relaxes slightly. Oh fiddlesticks, that's going to be one tasty quail sized snack for a dog.. Then a woman appeared and visions of having to explain myself to the police flashed through my mind. Surprisingly the woman who lived there didn't appear to be alarmed by one guy stood on her wall brandishing a children's rock pool net and another waving a broom and gibbering nonsensically with what only can be described as a gingery-brown afro, (I had washed my hair earlier that day, but didn't condition it, and now I'm paying for that with a beautiful, but inexplicable hairstyle, but I digress)... Two minutes later and the quail found himself in the back of the net and back in the run, the niece was suitably shouted at and I'm left with an arm full of scratches, an afro full of twigs and one pissed off quail...

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.







Wednesday, 25 April 2012

Update on Millivolt Signal Amplification

I have been run off my feet with uni work since coming back after the Easter break, along with sorting out my PhD applications but I have managed to squeeze some time into building the amplifier circuit for the five thermocouples. Here it is in all it's vero board glory along with the data bus, neatly labelled up as despite the colour co-ordinating I know I will end up connecting the wrong signal wire to the wrong DAQ channel.

I have noticed that the outputs in my Labview vi appeared to have some noise that would cause the gauges to 'bounce' slightly. Looking at the number string of the load cell channel coming out of DAQ in Labview it appeared to fluctuate randomly between 70 and 100 when no load was applied and rising to nearly 4000 with two 1 gallon water bottles hanging off it, again with a random noise of around 10 units either side of the steady state value . At first this meant nothing to me and I had to firstly find out what the DAQ actually outputs, in case I had  made a mistake with Labview and was reading some other signal. A quick skim read of the pdf manual provided by Starting Point Systems told me the DAQ gives an integer output between 0 and 4095 which corresponds to a 0 to 5v analogue signal. Ok, that seemed to fit with my measurements, but was the noise a problem with the Labview vi? Well a quick play with the µChameleon controller software showed the same noisy signal, so until I get my new oscilloscope there isn't much I can do except put up with it. Although I have said 'random noise' I don't think it is random but some sort of interference as putting a square wave through any one input channel on the DAQ will have a small effect on the outputs of the others. This effect seems to disappear once I have signals connected to those channels but I don't think it is. I have no idea if this means I need to shield all the signal lines or provide some better grounding for the DAQ.

I've also got my eyes on some Wren turbine parts on EBay, the seller has a spare outer engine case in the lot and that means I can take a drill to the engine for the temperature and pressure measurements without the potential of ruining an engine. I'm keeping my feelers crossed it doesn't go for a fortune!

Friday, 13 April 2012

Amplifying Millivolt Signals.

Thought I'd write piece on a simple circuit I have built to amplify the output from a thermocouple. I am using two types of type K thermocouple for my temperature measurements, I don't know the technical names for each type off the top of my head, and it is past 4:30 am so I can't be bothered to find out. I call the type in the first picture 'probe' and the inset picture 'bulb'. These thermocouples come in several 'Types' depending on the requirements and are in essence a bi-metal strip that produces a voltage change proportional to the change in temperature, and this voltage is generally in the millivolts scale. The Type K probes are found in all commercial micro-gas turbine engines to measure the exhaust gas temperatures and I will be using the same but I have limited space within the engine and will therefore use the bulb type. They also have a faster response time which will give better results when the engine is throttling away from steady state operation.



The circuit diagram shows the final layout circuit I will be using, it is based around the LM358N op-amp which I sourced on EBay as they were very cheap. I originally omitted the small ceramic capacitor but since I will be using several amplification circuits and thermocouples in parallel there may be some noise which this should help to minimise. At this point you should know I am relying on the electronics I have learned at uni, since my course is triple accredited, (or cursed depending on your viewpoint), we have to cover a certain number of mandatory electronic engineering modules. But I digress, anyway these circuits are pretty simple and if you have any suggestions for improvements please let me know...



I couldn't help but transfer the circuit onto a bread board for testing and it worked  flawlessly, I even hooked it up to a DAQ and used WINDAQ in oscilloscope mode to see how stable the output was and it was surprisingly well behaved. I can't wait till my oscilloscope arrives as it will save me a lot of time messing about with a DAQ everytime I need to see how a circuit behaves. Dunking the bulb thermocouple into hot water then into cold showed a good response time, (something I need to further investigate to see how accurate temperature measuring will be when the engine accelerates or decelerates). Swapping over to a probe and holding a flame underneath it gave similar results.




Just need to make up five of these circuits on some vero board and then I can carry on with the Labview dashboard program. The pressure transducers have also arrived so more fun things to come as I can't really do much with the RPM frequency to voltage converter yet as I really need the oscilloscope. I have also been thinking about buying one of the DIY PCB kits from Maplins and making my own PCB's. This would be a more elegant method than vero board. Hmm...

Thursday, 12 April 2012

I Kissed a Girl, Didn't Like It... (She Tasted Like Bloody Lemsips)

My lovely Aerospace Girlfriend has been laid up in bed all week suffering from an acute case of the manflu, and no she didn't catch it from me. But while she wasn't well and nothing was on TV we have been living the life of an old couple by playing Scrabble. I have to say that winning two games out of at least twelve didn't do much for my confidence. She then went on to smash her way through the Sudoku and both the normal and cryptic crosswords in the Guardian. When she was really stuck, she'd ask for help. I'd assume a look of thoughtfully gazing into the air, but in reality I was stumped everytime.

I learned an important lesson the other day... I was making dinner while Aerospace Girlfriend was lay on the sofa and managed to convince her that it was foolish to let me cook a very complicated meal and talked her into letting me cook one I was familiar with. All was going well, cooking nicely, looking good...... Then she woke up and asked if I had used any vegetable stock, I laughed and retorted that I was a damn fine cook, this recipe had come down through the family and wait until you eat it. In fact so confident I was in how nice it would be, I laid a bet that if she didn't like it I'd buy her a vintage bangle that she had been lusting after. Out came the dinner from the oven, steaming and smelling delicious... My moneys safe..

While I was clearing up and dishing out my dinner, Aerospace Girlfriend was eating hers and pulling faces. I kept asking what was wrong, and she say it was fine and how lovely it was, nom nom ect... Strange. I sat down and began to eat my dinner, now I know that reading this you are imagining that I am going to say how horrible it was, and you'd be right. It was, more or less, just slices of potato and onion in hot water and she had beat me again.

Score Woman 1000
Score Man      0002

Bugger.