Skip to main content

Posts

Showing posts from 2013

The Autopilot board is now GPS-enabled!

I finally managed to get my hands on the em-408 GPS receiver. After making provision on the autopilot board for the sensor and making sure that the OpenLog board could save the data, it was time to put this baby to its paces. It was no small feat I must add although the "old faithful" internet  was right there besides me to give me along. I found that there aren't many scripts that give an modular solution to allocating GPS data to variables in Arduino for further processing. So I made my own :). My approach was not to disrupt the internal timers of chip due to servo control. So the GPS board communicated with the rest of the system through the hardware Serial channels. This also enabled the processing of the data coming in prior to it being used in the rest of the system. So the aim of the board is to give heading coordinates to heading tracker function which in turn controls the roll and pitch controller. My plan is to use the haversine formula to calculate th

HILS Part Two - Functional Testing

The second part of the HILS was a functional test mainly to observe the functioning of the OpenLog board while the IMU and the servos were running. The logging was set at 38400 bps. The aircraft was moved in pitch, roll and yaw to simulate actual flight. The motor was turned on (without propeller attached) to Success Criteria - The logging should not have a loss of data and all IMU and servo variables should be recorded at a rate is for approximately 50hz. Results:  The figures below show that logging was capable at an approximate rate of 50hz. This will be tested in the field prior to the first logged flight.

HILS Part One - Connectivity test

As mentioned before, the aim of this test was to show that the autopilot board could relay power to the Receiver for servos to work. The InPins of the board connected all Rx signal lines (motor, elevator, rudder, switch (explained later)). The OutPins of the board had the ESC signal line and the corresponding servo signals (elevator and rudder). This configuration could be changed in the future in the event that ailerons are used (different test aircraft). Success Criteria - Displaying transmitter signal pulses coming into the InPins showing on the Serial Monitor.   Results: - The connection test worked albeit for a lengthy debugging exercise. The switch pin on the transmitter was able to enable or disable servo control.The figures of the results are shown below:

Frustation - Microprocessor Interrupt Issues - FIXED

As my eyes began to light up thinking that the circuit board that I had built and script that goes along with it, will fast-track the logged flight, I was brought back to earth. Every time the OpenLog board was activated for logging, excessive jitter was experienced by the servos making a successful flight (and landing) impossible. So although the logging was successful (all data was recorded as expected), the jitter in the servos was not. After trying to debug for a few days, I read on the internet above the possible conflict of interrupts of the Arduino when the SoftwareSerial library (for the OpenLog) and the Servo library (Receiver, Transmitter and Servos). One way to solve the problem is to not use the Servo library for servo control and transmit the transmitter signal via digitalWrite command and wait for the next turn to do repeat the process. The problem with this approach though is that if the loop takes too long to come around, the servo will loose holding power and can

HILS Preparation Test

So having concluded the first few flight tests and achieved a aircraft platform that will be suitable to test the first version of the autopilot, the time came to start the HILS (hardware-in-the-loop simulation) phase. The first step was to make sure that the ESC (electronic speed controller) will be able to supply current and the motor could still be controlled by the transmitter.  The next step was to connect the Rx and Tx to the autopilot board and have the display of signals coming to the board via the Serial Monitor. These inputs will in turn be converted to servo object angle inputs. The reason this is required is two fold: The Arduino IDE already has a servo library. So converting the pulses coming from the input channels to servo angles will be transmitted to the servo). The simplicity of this route will enable easy debugging in the event improper relaying of signals does not occur. The end goal of the HILS test is to establish a level of confidence that the boa

New Autopilot with logging capabilties: designed, built and tested!

Over the last few days I took the bold step of putting my entire autopilot concept on a single board . Leaving the convenient use of Arduino shields behind and heading towards developing a full blown flight controller comprising of: - 3.3V additional regulator for sensor power supply. - 6DOF IMU - accelerometer and gyroscope - Magnetometer board - Logging capabilities (with OpenLog board) - 4 servo inputs (can be extended to 5 in the future) - Female headers for quick sketch modification and upload - LED light for testing purposes - Provision for a barometric altimeter and GPS sensor - Total board weight: 30g (as compared to the previous board or 90g) I've tested the logging of IMU and servo inputs and the board is ready for it's first Test bench logging test. I would have taken this straight up in the air but having learned that everything is in moderation, I realised that 'baby' steps is your ONLY friend . Complete Autopilot board bar Altimeter and

Add strength to foamies planes

The coolest thing happened last night. Many posts I've seen tell you that if you want to add shear strength to your foamie aircraft, you need to pray adhesive prior to covering it with packaging tape. I'm afraid to say... that's half the truth!!! You see, eventhough the tape will stick for a while any sharp flexing of the wing during flight will cause the rape to start stretching because it detached from the foam surface. This caused the stretched tape to wrinkle up and no longer add structural strength to the foam. So how do you prevent this from happening? Add heat. You see, with heat the glue of the adhesive tape is activated and the foam surface slightly softens to give you a strong bond. So what temperature should one use? Well I did this part by trial and error. I found that a temperature of 80 degrees was sufficient to activate the adhesive and foam sticking to each other. I still feel that using a spray adhesive over the foam area gives a better chance

New Chapter: Barebone Arduino

With this new Autopilot Concept Change I decided to move on from Shields build my own Barebone arduino. A bold move but necessary for the future of this project. The major problems with is their size. Now it you don't have a problem with size and weight and Shields is for you. But the most annoying thing about them is the fact that honing on your electronic and soldering skills is no longer expected which I feel is the biggest short change any inventor can do. Hence came the Atmel328 microprocessor. That's right! Every Arduino Uno processing is done by one. So you might just as well get to know it. There's plenty of others but the simple interface of the Arduino IDE, makes this a breeze to program. I need to upload the bootloader (quite easy). A quick trick to change programmer to "Arduino as ISP" and change the board type. It's a no brainer: one Arduino Uno costs R300. Total cost of putting a working Barebone is less than

Autopilot Concept Change

After a bad case of stomach bug, I stayed at home today and got working on he UAV both hardware and software. The goal was simple yet daunting: Transfer 3 shields worth of hardware to one protoshield. Due to the high turnaround of making a custom-made PCB (which I have a fair experience on). I decided to go the perfboard route and make the conceptual design straight on the board. It became quite obvious that a few things could be done to reduce the size of the hardware: Instead of having the 5V regulator (although it will be added as a bakcup option) power supply could be taken straight from the ESC. I measured a voltage of 5.05V The need of transistors on each servo channel can be replaced with the switching done in the controller. This can be managed more efficiently. The sensors are attached on the board using right-angled header pins allowing the sensor boards to stacked upright leaving space for more sensors such as a barometer, and the prize sensor: the GPS. Having mad

OpenLog Testing

So I managed to wire the OpenLog sensor and ran some few read/write code to make sure the wiring works as expected. And it works!!! This device will enable me to log any data that will be used for the flight controller design. This is prior to mounting a GPS sensor for waypoint tracking. The SoftwareSerial library has been used instead of the serial pins 0 and 1 so that only selective streams will be logged while leaving the option for bebug logging. On the custom board, I'll have to accommodate for quick removal of the OpenLog board in the event Logging us required somewhere else.

My new logger finally arrived: OpenLog

My new logger sensor finally arrived!!! Since my MicroSD shield died on me, I realised that I needed to serial logger to be able to collect data for flight controller design. I also realised that getting the OpenLog board will expand the capability of the autopilot. The best thing about this board is its size. Being only a few grams and just over 1cm across each side one thing left to do: wire it up! I'm in the process to finishing the 'LOGGING_MODE' of the 'autopilot'. This should be able to still maintain control of the glider and capture of the necessary inputs to begin flight controller design. I'll keep you posted!

New Portable Device: DIY Hot Foam Cutter/Shaper

So After making my hot wire cutter , I realised that I still needed a portable devices to make grooves, channels and enclosures in the fuselage body. So came a brilliant idea. Replace the tip of a soldering iron with a solid 2mm diameter copper wire. The wire is ductile so it can be shaped in any form desired. I found out though that the length of wire is important as that determines cutting temperature. Too long and the wire is too cold to melt foam. Too short and the wire "over-melt" the foam instead. With this device, foam has become the next best thing when it comes to airplane design and build. The complexity of the design is only left up to the imagination of the designer! Below are some examples of what this awesome tool can do.

Pre-flight Testing - Weight and Balance

So I've finally arrived at a time all aircraft engineers hope to get... Maiden flight. But I've had too many experiences where the maiden flight is all but over in a matter of seconds becauseI was too eager to "free the bird". The end result... A disgruntled soul wishing it had been more patient. I've learnt my lesson (with my wife's mentoring) to be more methodical and pragmatic about my approach to the maiden flight. Since I don't have the luxury of wind tunnel testing of the wing and the airframe, the only reliable weapon in my arsenal was... Calculations. To be more specific, weight and balance calculations and measurements. After using AutoCAD, a weight balance spreadsheet to calculate the estimated (emphasis on "estimated") center of gravity in relation to the wing mac (mean aerodynamic chord), measuring the actual cg will all electronics included was the next (and hopefully) final step. It must be said that prior to this step I reali

My MicroSD shield quit on me! Alternative: SparkFun OpenLog

It's really frustrating when you buy a piece of hardware without thoroughly reading the feedback comments from different users. Well this was the case when I got myself a MicroSD shield from SparkFun . At first it worked very nice with the different libraries giving you quite an array of choices in terms of what you can do with the field. But the major drawback was that it took FIVE digital pins out the the Arduino to work namely: MOSI - pin 11 MISO - pin 12 CLK - pin 13 CS - pin 4 ChipSelect - pin 8 - Pin 10 also needed to remain as an OUTPUT for the shield to remain operational. This was in direct conflict with servo controller board. So it was quite clear that given the number of inputs (i.e servos, sensors etc...), this was going to cripple the development of the flight controller and perhaps prevent the continuation of this project. So a broken MicroSD shield forced me to look at alternative for a data logger and there came the OpenLog device , with simply connects t

And now I can cut foam shapes

Like most engineering processes, the ability to perform concurrent processes always lead to a more efficient and flexible product. Having said that, It is often prudent to not "eat more than you can chew" referring to developing electronics and an UAV airframe concurrently. Throwing caution out the wind and the fact that building 'foamies' is one of the easiest and quickest way to get an airplane concept in the air, the objective was clear... Build my own hot wire cutter. This little piece of magic hardware, will save you hours of foam sanding and cutting ( Or countless hours of balsa cutting and gluing). So after some research (quite a bit actually) a came across this piece of document that helped spec my power supply, and wire. I added a motor speed controller (which I had to assemble/solder myself - nerve-wrecking!) to easily regulate the temperature of the hot wire in between cuts. I know it's popular to use light dimmers but the motor controller seemed

Finally made by first PCB board

Like all electronics projects, the skill of "PCB making" is of paramount consequence. After doing my research, I finally assembled the ingredients to develop a servo control PCB. The Goal: I wanted the UAV to have be capability of Manual or Autopilot Mode while in flight as a safety option. This was to be controlled by the Control Station (RC transmitter for now) using a switch. The Parts: Single sided PCB board PCB toner transfer paper (I tried using HP Photosmart paper - DIDN'T WORK) Clothing Iron - Temperature set on "Medium" Wooden cutting board (Just beg the wife!) Ferric Chloride Solution (Here in SA try Mantech or RS Online Drill Machine Drill bits (0.6mm or 0.8mm). I used 0.8mm.  Plastic gloves (Please wife!) Plastic Container (Any container will do as long as it's plastic). So as the point 2 say, I tried using HP Photosmart paper  but it failed dismally. The glossy side of the paper melted and got stuck to the copper clad and it

RC Transmitter switching logic using a transistor

It took me a while to figure out how transistors  work. Although the theory is quite simple, the application was  something else. The goal was simple: To use the RC transmitter Channel 5 switch to "switch" ON or OFF "Manual Mode" in the micro-controller. This will enable the ground station to override control of the UAV in any time of the mission flight. Again goal simple enough. The application in many respect was simple enough. what was needed was to understand the signal range of the the transmitter switch in order to raise or lower the base current of the transistor for signal input. The objective is to be able to switch between AutoPilot and Manual mode using a switch on the RC transmitter. Hope I get there!

9DOF IMU on an Arduino MicroSD shield

The SDA and SCL bus lines for the three sensors (magnetometer HMC 5883L, accelerometer and gyro) were joined with not issues checked through the serial communication. (picture below). Biasing was completed with the following pseudo code. It makes use of a  running summation and computes an average once a number of measurements have been collected. /* This is a script to remove signal bias from filtered signal. Author: Paulin Kantue Date: June 2013 */ #define COUNT 50 //Number of values to be counted for biasing boolean computeBias(int raw_vec[], int bias_vec[], int8_t size_count, int8_t *bias_count){   int8_t counter = *bias_count;    boolean flag; // flag to compute sensor bias;   if (counter < COUNT){     for (int i = 0; i < size_count; i++){       bias_vec[i] += raw_vec[i];     }     *bias_count+=1;     flag = true;   }   else {     for (int i = 0; i < size_count; i++){       bias_vec[i] /= COUNT;       raw_vec[i] -= bias_vec[i];     }     flag