Under Construction...

Right, It's done!!!

The whole PHM (Prognosis and Health Management) system for the avionic EMA (Electro-Magnetic Actuator) works steadily. I've been working day and night on this project for the past three months! No time for play indeed. But now the simulink data matches perfectly with the actuator data and the particle filter algorithm works! Next mission is to finish my master's degree thesis and wait, just wait...

Take a glance of the sensor signal acquisition board (Click it to see the full image). You may see the EMA on the topleft, and the acclerometer sensor (it's on the left of the picture, in the middle). Acclerometer sensor is temporarily not functional so I have to detach it from the actuator.

Below is the fault diagnosis and prognosis result (The turn-to-turn winding fault is detected and the actuator's remaining useful life--RUL is calculated and shown).

phmexp1

There is still a slight problem: I calculated the PDFs (Probability Density Function) according to the particles in PF algorithm, and tried to show them in a TeeChart Winform control. However, the result seemed not good at all. Former PDFs are partially shadowed by newer PDFs. There must be a better way of showing them with something else.

My experiences with mobile devices

Both of my parents retired before I graduate from primary school. Facing a bad family economy, I decided to participate in various projects, both for a living and to challenge myself and find my own interest.

These all happened shortly after I won my first prize in an computer olympiad. Since then, I have been working on mobile devices from the oldest 8-bit MCU to the most modern one: iPhone4, and I have tried everything new on those different devices. Funny ideas also provides me an important way of relaxation, or even sources of innovation, while conducting serious researches. Also money earned from them covered some of my stipends.

You may find some of the projects I made in the "Mobile Development" section. Those past projects on WQX (An electronic dictionary with a 8-bit 6502 CPU inside) are collected specially in the "WQX Memorial" section because those memories are very precious to me.

A pretty fast simulator for airplane's infrared radiation

The simulator node is an important part of our lab's distributed simulation system. Three infrared radiation sources of the airplane are considered in the simulation:  fuselage,  hot spot and plume.

This simulator runs on my android phone (600MHz CPU), Radiation value are calculated on several discrete points according to Planc's law for black body radiations, and the final results are calculated via cardinal interpolations. I also added a trackball function: You can touch and slide the screen to rotate the plane!

Here is the final result:

Or the original version:)

redradio

Iava RTS game "Sandstorm" is out.

Now watch this. Can you imagine this Real Time Strategy game is running on an MTK feature phone with a CPU of only 100~150MHz and RAM of less than 300KB?

Yes I made it! This is a really exciting RTS which supports both campaign and VS mode. AI and path finding codes are highly optimized to make the game run smoothly on very limited hardware platforms.

Some more screen shots:

Lua version of Seumas-McNally's Particles is out.

The program uses SDL and Lua for Windows. Fading effect is implemented in C. Particle system and most animations are implemented in lua. Now the main scripts simulate the famous Seumas-McNally's screensaver lol:)

lua particles screenshot3

lua particles screenshot1

PS: Now my EMA-PHM project is finished, and I decided to wrote another script, aiming to illustrate the PF (Particle Filtering) algorithm, that means to render the probability of each particle, and to calculate and render the PDF (Probability Density Function) in real time. I must admit that this particle system is just for fun and I never thought of using it in my lab researches before, but now the system seems to be the perfect way of illustrating academical ideas, What a coincidence!

I hope the final work will help other students in the ATE lab, because many of them are using PF algorithm in their researches. Almost all other winform controls that I can find are way too ugly to do such a job.

Path finding codes

I always find it interesting to present an algorithm with graphical illustrations. Below are some path-finding algorithms in GIF format:

 

The typical A-Star algorithm is not very suitable on a feature phone, because you must do with the sorting in the open and close tables. When the CPU frequency is very low (about 100MHz), everything must be done in the fastest way. On the ARM platform, if you take other dependencies into account (limited memory, time for other codes and effiency of virtual machine), A-Star still seemed slow in game, even under optimization with binary heaps. The quickest way with an acceptable outcome which I found at last is similiar to the way of "go along the walls", however, key waypoints are integrated, and following optimization strategies are used:

1.Use memory pools to avoid too much malloc() and free(). Memory allocation needs a lot of time, especially on mobile devices. Programmers should be smart to use them in real time algorithms.

2.Limit path finding steps. For example, if the algorithm doesn't return any result in 32 rounds (that means the units cannot reach their destination in 32 steps), then just stop the present path-finding task to start the next one, and warn the player. This is to avoid those rare yet possible worst situations that may block the task queue.

3.Use a find-and-follow strategy. That means when player selects multiple units and orders them to move toward the same place, Only one unit's path finding will be done, and other units will follow his route.

A DAY TO REMEMBER - The iPhone game "Dudu Rush(嘟嘟向前冲)" rushes to 1st in iTunes Store!!!

That is REALLY AMAZING!!! I nearly cannot believe it when I heard the news. The game was developed by three people including me,  the other two are programmer Zhao and game artist Liu from Infiworks Inc.

I had been working in the company for an internship, and later we decided to made the "Dudu Rush". Mr.Zhao provided us with the game engine and I used Lua to adjust the game logic to make it enjoyable, while Mr.Liu did most of the game art. I thought it would be somehow successful because the idea is not too bad and Mr.Liu's drawings are REALLY perfect, but I have never expected the game to be so popular. Anyway, this is the first iPhone app I designed myself. Much thanks to Mr.Zhao and Mr.Liu, Cheers!

Think of what I learned from Infiworks: Some advanced UI design skill, Some code optimization techniques for Cocoa platform, and the most important thing: I got familiar with Lua. The language is really cool and I will use it in my lab projects:)

Lua Serialization

This is a Lua table serializer.

Types of key can only be number or string, however values can be a table. Self reference (Loops) is supported.

function serialize(t)
    local parents={}
    local newbies={}
    local function genstring(tbl,parent)
        parents[tbl]=parent
        local t_tmp={}
        for e_key,e_value in pairs(tbl) do
            local key= type(e_key)=="number" and "["..e_key.."]" or e_key
            if type(e_value)=="table" then
                local cckey= parent..(type(e_key)=="number" and key or "."..key)
                if parents[e_value] then
                    table.insert(newbies,cckey.."="..parents[e_value])
                else
                    table.insert(t_tmp, key.."="..ser_table(e_value,cckey))
                end
            else
                table.insert(t_tmp, key.."="..e_value)
            end
        end
        return "{"..table.concat(t_tmp,",").."}"
    end
    return "do local ret="..genstring(t,"ret")..table.concat(newbies," ").." return ret end"
end

累积

在新主楼呆了三年,最近才发现厕所的门居然是那个原理。强大。

其实我也不知道我这习惯是怎么养成的了,不过反正寝室晚上是回不去,真没法回去。且不说隔壁那几个到了晚上就鬼哭狼嚎的,屁g一回来怎么都觉得别扭。果然是有其父必有其子。

总之这寝室已不是我的寝室,北航也不是我的北航了。

最近居然发现屁g拿我的盆子泡他的臭袜子……做人怎么着也不能这样吧。联想其各方面行为,怪不得他暑假搞上的那个妞后来再也没见过了。会看上这种jp的女生,真是瞎了眼。

八点半了居然还是没人来。

写完这句话Z同学就来了。

突然想起来我有本书借了得有一个月没还了,还是新书……算下来也该有二十多块钱了吧。记得本科的时候H同学在图书馆欠过一次四十多块钱的书,然后向我哭诉。当时我感觉这就是天文数字么。现在怎么总也觉得这点钱好像不算啥。每天吃饭不小心就得吃个二十块钱呢。唉,变了变了……

又在校内发现一个八卦。某@尼哄的同学Z居然找了个@米国的高中学弟做bf。而且此学弟貌似是甩掉远在家乡的ex和这同学Z好上的。这这这,其中缘故谁能知晓啊……看看人家ex在校内上说自己被骗了,我一个旁观者都不忍心啊。虽说Z同学你也就我大两岁,找个学弟也不是不行,不过,何必要在这种异国+劈腿的狗血剧情里扮演个角色呢。我说这学弟你也是的,中国跟米国是异国,尼哄跟米国难道就不是?唉,记得当初刚知道的时候还以为又是一桩美事呢,现在看看,华袍下面果然总会有虱子的。

在校内上看了看这学弟的照片,颇猥琐。话说我在Z大这几个同学还真扯,谈的恋爱貌似到现在也没一个让人觉得有希望走到最后的。

算了,本来还想评论评论C同学跟S同学呢,突然发现自己连结婚年龄都不到,光顾着说人家干吗。

Iava game "Air Combat" is out.

Here I proudly announces my third commercial game: Air Combat!

With many thanks to LSL(RedPassion) from Iava Inc., Beijing, who collaborated with me in the game art design!

aircombat1

aircombat2

aircombat3

Dragon is powered by BlogCN.com - WordPress | BlogCN.com - WordPress Themes