Tuesday, February 24, 2009

[SW] GSL -- GNU Scientific Library

God, the open source community always make me surprised!

About 2 or 3 days ago, when I was searching for some open source code to add Gaussian random noise to my artificial data, I found the GSL (GNU Scientific Library). It's amazing. Although I am not very good at programming, but after some trials and with the help of examples, I produced Gaussian distributed random noise successfully! And there is pdf (probability distribution function) function for me to check the Gaussian distribution data.

Big thanks to all the people contributing to the open source world!

Here is the source code I used to generate Gaussian distributed random noise (first image), and also the pdf of the generated random noise (second image).

/*
* gcc -Wall rngGussian.c -o rngGussian -lgsl -lgslcblas -lm
*/

#include <stdio.h>
#include <time.h>
#include <gsl/gsl_rng.h>
#include <gsl/gsl_randist.h>

int main(void){
const gsl_rng_type * T;
gsl_rng * r;

double randomNum;
double randomPdf;
int i;

gsl_rng_env_setup();
T = gsl_rng_default;
r = gsl_rng_alloc (T);

gsl_rng_set (r, time(NULL)); /* use time() to generate the seed */
for(i=0; i<1000; i++){
randomNum = gsl_ran_gaussian(r, 1.0);
randomPdf = gsl_ran_gaussian_pdf(randomNum, 1.0);
printf("%lf %lf\n", randomNum, randomPdf);
}

gsl_rng_free (r);
return 0;
}

Monday, October 27, 2008

[UAV] Draganflyer X6

My friend sent me a link today, and it is the Draganfly UAV. There are two types of UAV they have, and the helicopter one (X6) is really amazing. After viewing some of its videos, I can only say ``Wow...''

The X6 has different configuration from the R/C type which has four arms and blades. The three sets of counter-rotating blades of X6 should improve its aerodynamic performance, and also saves the energy from wasting on anti-torque.

Here are some videos of Draganflyer X6. Hope you enjoy with it.

Sunday, May 18, 2008

[UAV] 080515 Flight Test

Okay, we had some successful tests that day.

Before the test, I asked CH and Shawn to exchange the OEM4 and OEM5 which were installed on SWAN and H-LING, respectively. Therefore, at the beginning of the test, SWAN was equipped with OEM5, and something wrong during the flight. We found the onboard PA gave abnormal information, and of course SWAN couldn't perform normal heading tracking flight. At first, we thought the problem was due to the complementary filter which had not been tested onboard before. However, after turning off the complementary part, the PA still exhibited strange results. Then, we put the OEM4 back instead of the OEM5, everthing was okay! Therefore, we concluded that something not right with the OEM5.

With the complementary PA, SWAN had performed several not bad heading tracking and turning. It has been about two years since the previously autonomous flight of SWAN. The successful flight test made SWAN ``reborn.'' At least I feel so. :-)

Another good result is the PA of H-LING calculated onboard. The PA calculated in realtime matched the one by post-processing. So, it's the time to test the PA in the hovering control.

God bless H-LING.

Friday, May 16, 2008

[UAV] 080513 Flight Test

Because Shawn has to realize the heading tracking of SWAN, and I also want to apply my method of attitude determination for the model-scaled helicopter, we decided to have another flight test.

On that day, only H-LING was tested. And the number of the testing group was the least one: only 3 people.

CH, Shawn, and me, we went to Saikang with the H-LING system in one car. That's really a simple team. I was the pilot, CH took the video, and Shawn was in charge of the GCS.

The PA of the H-LING seemed not good according to the report by Shawn in real time. After the flight test, I ran the code to check the PA and found they were totally unacceptable... We didn't know why then, but later, with another flight test, we have known that's due to the GPS receiver.

Monday, May 12, 2008

[UAV] 080509 Flight Test

Yes, we conducted 3 flight tests in a single week! My God, it really made us exhausted.

Some good results, however, was obtained.

We tested SWAN and H-LING that day. The attitude determination methodology of SWAN had been modified. When the pilot switched SWAN to auto-mode, I felt some tension as SWAN rolled too one side. But it turned back!

SWAN did ugly but stable autonomous ``straight'' flight. It ``meandered'' across the sky along the desired heading. Some modification of the attitude determination method seems necessary, and we have decide to accomplish it before the next flight test.

We found a problem of H-LING's fuzzy logic controller. The attitudinal inputs didn't fired the corresponding rules. This might be the cause of the poor resistance of H-LING to the side wind. H-LING cannot restore its own attitudes after deviating from the trim condition, and the unfired rules might be the reason.

[UAV] 080508 Flight Test

The test was not so successful. Only SP-X.6 did some tests for gathering data for system ID.

SWAN didn't show attitudes' information on the GCS (ground control station) and hence only flew to record some flight data. Unfortunately, these data showed no useful information. Some programming bugs caused the failure.

That day was not H-LING's day either. After the test of SWAN, the Xsens AHRS suddenly had no output. H-LING has shared the same AHRS with SWAN, because the other one was sent to Holland for repairing and has not been sent back yet. Therefore, we ended the test of H-LING even didn't start the engine.

Sunday, May 11, 2008

[UAV] 080505 Flight Test

Only SWAN had flown for test that day. The AHRS was still not usable under the vibration. The attitudes, especially the roll angle, were not reasonable. Therefore, SWAN didn't perform expected autonomous flight.

The weather became worse after SWAN's flight test. It rained, and we decided to terminate the tests before our gears got into the rain. We had too much stuff to load them back to the car in time. Fortunately, our pilot's car offered a good shelter for our aircraft. He even drove these things back to our lab. Thanks for his great help!

Okay, only one thing was worthy for me to record, that is, the inverted hovering of the RC helicopter which is shown in the photo. However, I found only 20% performance of what I have in the simulator can be realized in actual RC flight... Orz

Wednesday, May 07, 2008

[UAV] 080501 Flight Test


The flight tests were completed without too severe problem. Only the SP-X.6 had a hard landing due to the pilot's concern. Because the runway end located high bush, it has been a obstacle threatening the pilot as landing. The pilot wanted to slow down the aircraft while avoiding the bush in the same time, then the SP-X.6 went into stall just before flare. Fortunately, only the nose gear was bended and no more damage else.

SWAN did some fuzzy control to track given heading. Some results were good and some were unacceptable. After checking the onboard program, we found the cause. The definitions of the heading were not consistent. One was defined from 0 to 360 and another was from -180 to +180. Therefore, when the heading was given westward, then the SWAN went the wrong response.

H-LING also tested with the FLC and some results were not bad. The helicopter held itself in hovering for several seconds, and the longest one was about 12 or 13 seconds. However, we found the recorded data showed some unexpected results. The FLC controlled the helicopter toward the desired attitude and then drifted away sometimes. The reason has not been figured out yet.

More photos can be seen HERE.

Friday, May 02, 2008

[UAV] 080425 Flight Test



As usual, we had three groups for flight test. Actually, we are ``a'' group with three UAV systems for testing.

The SWAN UAV is the oldest system in use of our lab. It's a fixed-wing UAV made by fiberglass. It had completed beyond-the-vision cross sea flight in 2005. Here is a video about the SWAN.

The second fixed-wing UAV is the SPOONBILL, which has been designed by Chi-seng for longer range autonomous flight. The goal is to fly from Tai-lam (Tainan) to Phenn-ou (Penghu). We all hope this project can be successful. Many tests have been done with a 60% scaled prototype, the SP-X.6. It was also flew on that day. The yellow one in the photo is the SP-X.6.

H-LING is the third system which is an unmanned helicopter project launched in 2006. Since about 2007, I have been the test pilot of H-LING. This project is still under the phase of hovering control test. We have worked hard to try to realize the autonomous hovering, but it's really not an easy task. However, the relevant studies about the H-LING is interesting. At lease, it is true for me. :-)

On that day, unfortunately, we crashed the vehicle of H-LING. Something abnormal happened when the vehicle was flying in automatic rolling control. A sudden pitching down occurred when the pitching cyclic input is still under my control. I ignored the abnormal motion and kept to test the rolling control. Finally, the vehicle lost the control suddenly. I turned off the automatic control but still cannot save the vehicle. It was just totally out of control and crashed down. We all have no idea about the causes. Of course, this was not the first time we crashed vehicles in flight tests... :-p

The autonumous hovering in that day was not successful. Still lots of works to do.

[Heli] Inverted Flight: Very Slow Progress

My first inverted flight of the RC heli was done with T-rex 450 SE before more than 1 year ago. Now, I can invert the heli steadily in hovering at altitude lower than a man's height. Of course, I am still practicing for inverted flight in different orientations.

It's really very slow for my progress in the RC helis' flight. Perhaps that is because that I have no talent and no time as well as money to have enough practices. But it's okay, I have had lots of fun in learning to control the RC helis! :-)

Moreover, this hobby makes me able to help our lab to conduct the unmanned helicopter's flight test. In these 2 years, I have flown almost all the helis in flight tests of our lab. I am very glad to contribute to the team work.

Keep flying.

Tuesday, January 22, 2008

Data is/are?

When I am writing my dissertation, I have been bothered by the usage of ``data is'' and ``data are.'' After searching via Google, I have found some information and some of them give some interesting opinions.

Thursday, March 08, 2007

[SW] MathCast-- Equation Editor

MathCast is an open and protable software (green software) for equation edition. It saves me from MathType, because I have no money to purchase MathType... Orz

Of course, you can not expect that MathCast can replace all the excellent capabilities of MathType. It is still good enough, however, for usual applications.


[SW] Maxima-- test of matrix manipulation

Wow, what a big matix...

This is my first idea when I saw the results from Maxima. I typed the matrix in textfile, then open it with Maxima. Here are some results.





You can get this result by typing




If we use invert command to inverse the previous matrix, then here is the inverted matrix

Column 1



Column 2



Column 3




Wow...

I think maybe there are some tricks I have not known, or I have to do the manipulation with my hands and pencil. O__O

Saturday, March 03, 2007

[Heli] Inverted Flight Improvement

Yes, I did the really inverted flight with the T-rex 450SE!

Just in today's afternoon, I and Chih-sen went to the field for the flight. It is still quite challenging to me to inverted the T-rex. I can not pull the control stick precisely, so occasionally some kind of unexpected motion happens when the T-rex is pitched down to be inverted.

I did some ugly pitching-down manoeuvres, and it made me very tense. Suddenly, in one of the inverted flight, I can see the vehicle clearly. It became easier for me to control it, just like what I always do in the simulator!!

It is a encourage to me. Good job today!

[SW] Static local variables in Scilab

I rewrote my C code program into Scilab. When executation, however, I found there are some errors about variables undefined.

After some check, I figured out that might be the problem of "static local variables".

Here are 2 messages I found in Scilab newsgroup:
static local variables in Scilab

I don't want to use global variable declaration. It's not a good news for me that I can not declare static local variables in Scilab... :-(

Thursday, March 01, 2007

[SW] Maxima-- A Computer Algebra System

Maxima

Several days ago, I was trying to derive an inverse of a 3 by 3 matrix with its mathematical symbols. It's really a tedious work. What might be worse is aftering the horrible manipulation, one can not to be sure if the result is correct!

Now, the Maxima looks like the savior. I think I would like to try it and then write down the test result.

[SW] Scilab

Scilab Homepage

I downloaded it several months ago, but haven't spend time to understand it yet.

These days I encountered some problem in my Kalman Filter C code. For 2 by 2 matrix, everything is fine. When I rewrote the program for 3 by 3 case, however, it went overflow with causes I cannot figure out... Orz

Therefore, I think it is necessary to write the code in something like Matlab. Open and free software occurred to me, and it is the downloaded Scilab.

Hope I can get familiar with it as soon as possible, or my research progress will be delayed more. :-p


Here is a homepage including informations and tutorial materials about Scilab:
http://www.engineering.usu.edu/cee/faculty/gurro/Scilab.html


Another basic tutorial: (added at 2009/05/22)
Master Scilab! by Finn Haugen

Monday, January 29, 2007

[Heli] Canopy Painting for T-rex 450SE

The original plastic white was a little boring, so I decided to add some colour on our lab's T-rex 450SE. It's the metal blue, and looks not bad. If I have more time, I think I will apply another colour, maybe the metal gray, on the bottom of this canopy.

Monday, January 15, 2007

[Heli] My 1st Inverted Flight

Date: 2007/01/11
Location: In fornt of the IAA building
Heli: T-rex 450SE

Here is the video taken by my friend with his new mobile phone:

http://www.youtube.com/watch?v=vwVJJ8kBydk

After the 1st inverted flight, I was very excited and tense. During the 2nd trial, I pull down the collective pitch too slow and T-rex fell down... Orz

Although I crashed the helicopter, this is still a good beginning for me. I felt the true manuever with T-rex. I think I can do it better during the next flight! :-)

Wednesday, January 10, 2007

[Heli] T-rex 450SE is ready for 3D flying!


Our lab bought the T-rex 450XL last year and it has been hovered or flew in simple way by 4 members in our lab. Several weeks ago, I think it is time to upgrade our skill and of course as well as the helicopter. Based on the experience with the T-rex 450XL, the T-rex 450SE became the first (maybe the only one) choice. To purchase the T-rex 450SE, we can get information and help easily.

Because I had the assembage experience of the T-rex 450XL, I started to assemble the new coming T-rex 450SE by myself. However, I encountered some troubles in setting the servos up. The side plates are different from the T-rex 450XL. I didn't sure how to fix and trim the servos with thier arms. I had no idea about the position for the speed controller, the receiver, the battery, and so on.

Finally, I decided to ask someone who is expert in this. Siau-Chong is the one who can solve my problems. He assembled the rest parts and set everything ready.

I went to Beng-ka, a RC hobby shop, to take the T-rex 450SE back. Wow, it is really a good job! Everything was considered and settled. Even the heat-shrink tube was used to protect the cable line of servos. I never think about those details before!

Here are some pictures to show the work. For your reference if you also need some example to learn the arrangement of the 450 electrical helicopter.


Wednesday, December 27, 2006

[Chat] Why Did you Steal The Batteries?

2 batteries of our T-rex was stolen during I flew the T-rex. I was concentrated on practicing the side hovering and didn't know who took these 2 batteries away.

Why? I don't know who else also fly electric RC helicopter around here. Maybe someone regarded my as garbage... because I put them on the ground?

Maybe someone didn't like to see me fly helicopters on the grass. Okay!! I will fly!! I will fly our helicopters everyday!!

\__/

Tuesday, December 19, 2006

[Heli] ALIGN 2006 funfly in Kohiong

Date: 2006/12/09
Time: 10:00-15:00
Location: in front of the Kaohsiung Museum of Fine Arts




ALIGN held the activity for popularizing the RC helicopters and of course also their products. They invited 3 famous RC helicopter pilots, Alan Szabo Jr., Jason Krouse and Nigel Brown to make amazing 3D flying shows.

It is not easy for me to have the opportunity to meet these famous men face to face. Therefore, I invited some of my friends to attend the activity. They were very happy to see these RC pilots and thier stunting 3D flight.


However, I missed the most improtant show in that afternoon. I thirsted so much and then went to buy some iced drink. Unfortunately, I got into a traffic jam and couldn't get back to the field to enjoy the show!! Also, I missed the chance to take photos with all the people in the activity... Orz








After I was back to the field, all the shows was over!! What I could do was just to ask Alan, Jason and Nigel to autograph on the back of my visiting card. Finally, I took the photo with Alan and my friends. :-)

Tuesday, December 12, 2006

[Heli] T-rex flight at HIGH altitude (2280 m)

How high can the small electric helicopter fly at? Someone asked me about this when they saw me fly T-rex in front of our institute's building.

All I can say is only "Oh, very high, far beyond you can see it."

On December 1st, 2006, our lab went to the Southern Cross-island Highway for calibrating one of our altimeter. I took the T-rex with us because I just curious about the performance of T-rex at high altitude.

After the flight test, I can tell you "It still perform good for hovering at 2280 meters high." At that height, the air density is 80% of that at sea level.













[Heli] Unmanned Helicopter Project: H-LING

H-LING is one project of our lab. It is supported by National Science Council.

Our goal is to make the helicopter hover automatically. There were many flight tests to get data for system identification or some kind of analysis.

I am very lucky to involve in this project. For testing the vehicle, I have many opportunities to flight the helicopters. They are Raptor-90, 50, and even Hirobo Freya.

Here are some photos about our flight test on Novemver 24th, 2006.

Raptor-90 was ready to take off. I just checked it before our test pilot's coming.







I was talking to our test pilot (Tan Po-hu, the left one) to let he know what kind of flight data we want to get.






Our H-LING vehicle (Raptor-90) with the onboard computer and sensors.

Monday, October 30, 2006

[Heli] (?) PicooZ


Several weeks ago, I met this tiny guy in Meng-ka model shop. It is a very cute "helicopter" controlled by only 2 channels. Then, one our lab's member found it on the website. After watching the flight demo video, almost everyone got into crazy about this tiny heli-- PicooZ!!

Finally, we bought 13 PicooZs. 9 of them belong to our lab. Suddenly, our lab becomes the lab that keeps the most helicopters (around the world?)...

Monday, October 09, 2006

[Chat] Justin Chi-- Amazing child flying RC

This boy is really cool. Please check the following link to get more information and video of him:

3 Year Old - Justin Chi - 3D Flying Video Link


[Heli] T-Rex indoor hovering

After I can hover the KALT30, I still crashed the T-Rex twice when I tried to hover it. Till then, I realized that smaller helicopter is not easier to control.

Several days ago, one of my junior in our lab want to test his spy camera with the helicopter. We mounted this camera on the T-Rex and decided to test it indoors. I think it is my first time to hover T-Rex in such a small room. It is really tense! Fortunately, I hovered it without any accidents.

Here is the video: http://www.youtube.com/watch?v=CRnSMfQSPx4

Wednesday, September 27, 2006

[Heli] S-70C in NCKU

The video: http://www.youtube.com/watch?v=xvOwLPF2mes

I talked with my friends in our lab after the lunch. Suddenly, I glanced a REAL helicopter landing on our filed!! Wow, it is so seldom to see a real helicopter fly in the campus.

I went to the site with my digital camera and took some photos and video.

To see the real one in our campus is really interesting. I like it.


Realted link: http://www.taiwanairpower.org/af/s70c.html

Sunday, September 24, 2006

[Heli] Smaller is harder


Before I can hover the RC helicopters, I always think that small electrical helicopters are easier than the bigger one with engines.

I am WRONG!

R90 is really stable and I can hover it pretty good. Hovering the cute T-rex, however, is totally another story... The T-rex is always sensitive and drift around. I have to hover it with my fully concentration.

But, flying the small T-rex won't induce much mental pressure. The most important is... T-rex produces NO smoke... :-p

(The garbage on the field is really make me upset... I think I should pick them up...)

[Chat] Sorry... It's really too smoky... Orz


After checking this photo, I have to say: "Yes, it is really too smoky... Sorry!"

Wednesday, September 13, 2006

[Chat] Your Heli is too Noisy and Smoky!!

I flew R30 and R50 several times in fromt of our institute building. There is a fine hovering location with grass.

But... I have been complained tiwce for the heli's noise and smoke... Orz

I think I have to find some way to carry R50 to another more suitable place to fly it. How? I have no car!! Although I can carry it with my motorcycle, it is so inconvenient!

:-(

Sunday, September 10, 2006

[Heli] Head-in Hovering

I tried to hover the T-rex head-in one more month ago. I did it! but not good enough. T-rex even flied too far away so that I cannot handle it. Of course it dropt from about 3 or 4 meters height. Only minor damage ocuured, Lucky!

After self-training in the simulator, I think it is time to try again. I took the T-rex outdoor yesterday, and hovered it tail-in then head-in. This time, I held it in better situation and the T-rex landed with some minor accidents. So far, I have more confidence with the head-in hovering.


Today I and my junior, Weoileong, took R-50 Titan to do its maiden flight. In fact, it had been flew and tuned by Tan Bun-jin, who is the boss of Beng-ka R/C model shop. So, maybe I should say that today is our maiden flight with the new R-50.

Oh, it must be mentioned that today is Woeileong's first flight with the R/C helicopter. He did pretty well in the simulator, and I think he can do the real hovering.

I started the engine smoothly (new is good~~), and then tried to do the hovering. After some trim on the transmitter, R-50 performed better than my expectation. I hoered it tail-in, and then, again, I turned the R-50 with the tail rotor. I did the head-in hovering!

Today's flight is Woeileong's first hovering with real R/C heli, and is also my first head-in hovering with glow engine heli. Today is a memorable day! :-D

Saturday, August 05, 2006

[RC] Futaba connector


I am working on a project with R-90 as the vehicle. Today I want to connect the FF9 transmitter to an FM transceiver, but I find that the FF9's connector type is the "square" one. This type is so different from the original type.

From Google, I find some website describe the pins of the FF9's connector:
Of course, I check all the pins with the oscilloscope to make sure everything is OK. I also get a female 6-pin DIN plug from an old FF4 transmitter.

Finally, I make a new connector cable with 2 different plugs. It works. :-)

Sunday, July 09, 2006

[Heli] Great flight video

This was one of Japanese indoor heli competition on TV. 2 players completed all the items and won the prizes (900,000 Yen per person)

Video

And these were performed by Alan Szabo Jr... Really amazing!

Video 1
Video 2