Archive for October, 2010

Vorlons vs. Shadows

Philosophy of today: You remember Babylon 5 series and Vorlons “who are you?” and Shadows “what do you want?”? I have been thinking and actually the shadows are actually more right. It does not matter who you are but what you do and what you don’t do. Vorlons were advocating for maintaining the status quo, but what actually is needed is a continuos ever accelerating invention of new. That is not status quo or improving the status quo but that is what another article referred as “disruptive technology” – i.e. technology that comes from nowhere and does not fit to the market but totally disrupts the market, reinvents what people need and want and gives them what they did not know they want.

So how this applies to e.g. Microsoft article that was mentioned in my Facebook: Praising the importance of some old technology that has been around and everybody has used for long long time is the Vorlon thinking “status quo”. Has been like this and will be like this forever. However, this is not how it works out. It is instead “What do you want?”. So “Who are you?” “What do you want?”. The truth is out there.

Advertisements

First learning project with QML, the very basics – how to make a button

There has been a lots of discussion about the QML recently, so I decided to look at it myself as well. I think that QML is a very good new technology in the Qt and it makes it very much easier to implement out of the box UIs which are not bound to traditional UI logic, e.g. to what for example traditional desktop toolkits (like gtk+) tends to limit.

After one evening of doing things with varying success (in some places syntax is a bit weird and it required some patience to get over it) for one evening and I got a simple button and a dialpad with buttons implemented. Well it is not very usable dialpad, it even does not have 0 or any other buttons that might be necessary on it. Actually I was thinking of doing a calculator and that’s why I collected the buttons like this. I did not try it on N900 yet, but started trying it out on desktop because it is the fastest way to learn this new thing. After getting into it it started to feel pretty nice and many of the difficulties I immediately faced in the beginning were RTFM errors. Good idea is to read some documentation about it before swearing too many curse words – after all it is not bad at all. I got some help from Kate Alhola who is a guru with the QML already and it saved my time a little bit.

Here is what I did: I downloaded latest Qt SDK 4.7.0 to my Mac. I also installed it on my Linux laptop, but this example I created in the evening on Mac. I created empty QML project with Qt Creator. I added the following files to the project.

qmlwiz.qml (this is going to be my main, renders here a numeric keypad)
SimpleButton.qml (this contains the button code)

Unfortunately Blogger strips down all indents and the code looks a bit ugly, but I hope you can still read it somewhat. At least this is quite short reducing the chance of confusion.

SimpleButton.qml:

import Qt 4.7

Rectangle {
id: simpleButton
width: 60; height: 60;
radius: 10
border.color: "gray"
border.width: 2

gradient: Gradient {
GradientStop { position: 0.0; color: "gray" }
GradientStop { position: 0.33; color: "lightgray" }
GradientStop { position: 1.0; color: "darkgray" }
}

states: [
State {
name: "up"
PropertyChanges { target: down_anim; running: false }
PropertyChanges { target: up_anim; running: true }
},

State {
name: "down"
PropertyChanges { target: down_anim; running: true }
}

]
// transition is unfinished, possibly not needed at all, because states take care of it
transitions: [
Transition {
from: "up"; to: "down"
}
]

MouseArea {
anchors.fill: parent
onPressed: parent.state = "down"
onReleased: parent.state = "up"
}

SequentialAnimation {
id: down_anim
NumberAnimation {
target: simpleButton; properties: "scale"
from: 1.0; to: 0.8; duration: 100
easing.type: "OutExpo"

}
NumberAnimation {
target: simpleButton; properties: "opacity"
from: 1.0; to: 0.5; duration: 100
easing.type: "OutExpo"
}

running:false
}
SequentialAnimation {
id: up_anim

NumberAnimation {
target: simpleButton; properties: "opacity"
from: 0.5; to: 1.0; duration: 10
easing.type: "OutExpo"
}
NumberAnimation {
target: simpleButton; properties: "scale"
from: 0.8; to: 1.0; duration: 10
}

running:false
}

Text {
anchors.centerIn: parent
id: button_text
text: "0"
}
property alias label: button_text.text

}

qmlwiz.qml:

import Qt 4.7

Rectangle {
width: 800
height: 480

transform: Rotation { origin.x: 30; origin.y: 30; axis { x: 0; y: 1; z: 0 } angle: -10 }
Rectangle {
SimpleButton { x:100; y:100; label: "7" }
SimpleButton { x:100; y:100+64; label: "4" }
SimpleButton { x:100; y:100+64+64; label: "1" }
SimpleButton { x:100+64; y:100; label: "8" }
SimpleButton { x:100+64; y:100+64; label: "5" }
SimpleButton { x:100+64; y:100+64+64; label: "2" }
SimpleButton { x:100+64+64; y:100; label: "9" }
SimpleButton { x:100+64+64; y:100+64; label: "6" }
SimpleButton { x:100+64+64; y:100+64+64; label: "3" }

Text {
text: "Karoliina's Magic Keypad"
}
}
}

To run the application, there is a button with green triangle on near to the bottom of the left hand side toolbar on the Qt Creator. When the main program file is selected on the file list and this button is pressed, the program is run from Main.

I looked the documentation further and discovered that there is also a repeater functionality which can be used to build e.g. the dialpad or calcpad shown above without repeating the SimpleButton instantiations manually for each number.

There is plenty of room to make this nicer, actually I like a lot a such button that is composited from two layers: basic layer illustrates the button itself. Then a translucent highlight layer is composited on top of the button when press down occurs. When mouse button release occurs, the composited top layer is faded away with alpha channel ramp. I may try that next, but I did not have time to do the graphics for the highlight yet (as it looks the best when it is made with e.g. Inkscape and not attempted computationally). I may try that later. Now I wanted to finish something before going to sleep.

Bottom line is that QML is very nice and super easy. With short time it is possible to learn to do some quite nice things already. I rotated the scene a bit because I like how the menus on Colin McRae: Dirt are rotated. Actually with QML it is very easy to make similar dynamic animated rotation so that the scene slightly turns by itself on time back and forth. To do that, I was thinking using the NumberAnimation. I may try that after doing the composited button which I think is even cooler. Then I need to also hook these to C++ application to do the calculation logic on the C++ side. Kate has a nice AR-Drone control app doing this exactly already, so I need to look her code to see how to do it. Quick look reveals that it is very easy. I need to try maybe tomorrow if I have time.

Ar-drone flying

I referred to the AR-drone in previous article about flying car. We produced a short video about Ar-drone flying:
http://www.vimeo.com/16147472

iPad provides control input (which direction one wants to go) and the computer inside the AR-drone provides artificial stability (so it is very easy to fly unlike RC-helicopters).

The Future – How do we get there?

I remember when I was a child, I was thinking what the future might bring and that year 2010 we would have this and that. It was based on think that because it is 2010, we will have this and that. I was kind of naive thinking that it will be made for me, someone will invent it for me and I will just enjoy the ride – like television, you just watch what the broadcast networks broadcast to you.
But what kind of ride that would be if you weren’t in the controls? So start driving by yourself.

I have been thinking this a lot. So later I realized that it does not work like that. Future is not something that is given. It does not come by itself. What we predict for the future today will not happen if somebody does not do those things. You see we don’t have all the wonders of science fiction of the past predicted at hand now except for the very fancy telephones – in fact much nicer superphones than even Star Trek ever predicted. But that is only one thing. We can have so much more and we need to have much more than this.

So who is this somebody who will fabricate the future? Some special person that will do all the work for you? No. That special person don’t exist. You and me are responsible of fabricating the future.

So if you think that year 2020 we will have this and that, because it is already 2020, stop. Think again. It will only happen if you do it. We all are fabricators of the reality and the future. Every little thing matters. You might think “this has been always done like this and I am required to do it like this”. Stop this and think how you could do it better or how you could invent something that gets it done for you. Think out of the box and do not think that you can’t make it because it is impossible. Nothing is impossible. You can do it if you want. One step at a time and you will get results. Try to make a change.

Every little drop forms an ocean and this is the only way to make dreams come true. And what the dreams are? These form new drops in the ocean which grows on each cycle bigger and bigger. And this is how breakthroughs happen. And these are very important for the future of you and me and the human kind.

So on next Monday when you go to work. Think how you could improve things. Tell what you would like to be done better. And do it yourself. Continue one task at a time until it is done. You can do it. I can do it. We can all do it. And the revolution begins. The future will happen because you created it, we created it. It is not given, but achieved. We all are the instruments of the future, we fabricate it.

Thinking out of the box: The case for flying car

I have been thinking what would make “flying cars” feasible. I think the answer is pretty much that it needs to be VTOL. Anything that lands on runway will become very complex design mechanically. A real solution would be to land on the car anywhere, e.g. shop parking lot.

So what are the breakthroughs needed for this? I doubt that the internal combustion engines can do this ever very well and turbines are out of question as well because nobody can afford flying to shop with turbine power. So I think this will require electric motors and advanced battery technology. Hybrid design could possibly work too.

Large helicopter propeller blades will become a problem when landing on congested place and it would cause also safety issues. You could hit something with the rotating prop and newspapers would be full of horrific accidents very soon. Someone sliced somebody or sliced somebody’s house or whatever. The props should be shrouded for safety of general public. Then how many props? One prop and it will require tail and tail rotor. Not so nice. Coaxial rotors, that would be better but still will require one to be helicopter pilot. I think the case of how it would work is very simple, and the case example already exists in small scale as sort of “RC copter”:
http://ardrone.parrot.com/parrot-ar-drone/usa/

So computer controlled fly by wire and the user would be just selecting to go forward or backward or up or down or to rotate. Computer handles the rest. Each prop would have electric motors, big ones instead of the small ones found from the little thing. This plane could even have small wings, which could be optimized for cruise only (and not for landing at all) and could be possibly pivoting – when airspeed increases less vertical thrust would be needed. This could be “the flying car” that everybody can control. Not everybody can become a helicopter pilot or even airplane pilot – requirements are all the time becoming more and more and less and less will ever succeed to become pilots (from those who dared to start the training), but anybody that can drive a car, can select up, down, turn left, turn right, go forward, go backwards. This thing could be done so that all “flying cars” would have a data link to other “flying cars” nearby. The computer could automatically avoid collisions without the need of centralized air traffic control at all. Actually air traffic control is a system that can not scale to the level of cars are used on the roads, no matter what. The only way to manage the huge amount of traffic is to not have centralized control at all, but the control would need to be between the aircraft and it would need to be automatic data link, not this antiquated AM radio we are using to call ATC. I think it would be reasonable to make the system such that there could be as many flying cars in the air than there are cars on the ground now. Traffic congestions could be easily avoided because there is lots of space in the vertical plane in the air (when we forget about airspace altitudes and minimum altitudes etc.).

The four rotor configuration would also solve the problem of placing ballistic parachute. It could be directly at the CG and it could be even made automatic, if something fails, parachute would be pulled right away.

So what would be needed:
– lightweight electric motors with high power (already possible with today’s technology)
– fly by wire system (already possible with today’s technology)
– data link to other aircraft (would be already possible with today’s technology)
– combustion engine to charge batteries (already possible with today’s technology)
– high capacity light weight batteries (this might require next generation batteries to have good enough usefulness)

For these to be good for mass market, the following points must be considered:
– it must not require pilot’s license
– it must not require medical of any kind
– it must not be over-regulated, otherwise it will never gain any popularity
– it needs to be very much automatic and very easy
– there must not be super-restrictive regulation where one can land and take off, the usefulness of this concept depends on possibility take off and land from and to everywhere, it would make no sense to take off from airport and to land to airport
– it would not replace airplane, instead one could fly with this kind of machine to airport to get far away with the airplane, I don’t see that this kind of design could be made ultra long range and super fast.
– it is unavoidable that this design actually requires more space still than a car, quite large diameter props needs to be used for efficiency. However, each of them would be more reasonable size compared to one helicopter rotor and less expensive to manufacture. Also four rotors provide more thrust and lower disc loading than a single rotor.

Then how these could be manufactured?
– For mass market I think they should be pressed with 3d molds from aluminium with monococue type construction like cars are made of steel. This should be feasible with today’s technology because Piaggio P-180 Avanti is manufactured from this type of aluminium construction.
– There could be no rivets and there could be no hand layup in anywhere in the structure to make the price down
– The price of high capacity batteries must drop to get the price down
– the electric motors are inexpensive to manufacture in great volumes

So I don’t believe in Möller’s design as such (combustion engines driving ducted fans), but this slightly different version (with helicopter like but shrouded rotors) could possibly be feasible. And these could be made aesthetically to look very stylish unlike helicopters, and they could have bigger mass market appeal also because of that.

Hybrid aircraft ideas, continued from the previous article

The previous article received lots of very good comments, and since my reply to one comment became too long, I decided to post a new article about it.

One reader proposed either push-pull hybrid where one engine would be diesel and the other would be electric motor. There was another possibility also considered, with coaxial propellers the same thing. This is a valid point and would work. There are some challenges on it therefore here is some cons I considered and hereby listed for this setup:

I may post this as a separate article also because otherwise it possibly does not get read by that many:

This is reply to a commenter for the earlier article:
There is a little incompatibility here that I don’t see how to overcome:
– the diesel engine operates at medium rpm which requires reduction drive
– the electric motor can designed to be direct drive and low rpm without need for reduction unit

Having series hybrid there is weight penalty of two brushless DC motors and the engine and the battery, but no other systems. The engine runs the brushless DC motor without reduction gear and the motor that is used as generator can be designed to operate at the rpm the engine operates. The other motor which drives the prop can be made to operate at low rpm.
-> this sytem has NO:
– weight penalty of reduction gear unit
– reliability penalty of reduction gear unit
– need for propeller clutch and the associated reliability penalty and weight penalty
– need for drive shaft to achieve aerodynamic cowling shape

You already listed the most of the pros for the diesel direct drive. I list the cons:
The diesel direct drive cons:
– would not work without clutch, the power pulses would make the prop come off in flight if it did not fail on ground testing already
– does not get necessary power to weight ratio from the engine because of the need to run it at low rpm because of the prop requires low rpm
– weight penalty of the additional gear reduction unit
– reliability penalty of the additional gear reduction unit
– weight penalty of the clutch
– reliability penalty of the clutch (in Thielert engines they have failed now and then, especially in the original design, the latest engine models might have addressed this issue but I am not sure)
– added complexity
– aerodynamic cowling shape may require drive shaft, and reliable drive shaft has been proven to be hard to design and manufacture such way that it would be 100% reliable
– the diesel engine is harder for the prop than a electric motor because of power pulses (even with clutch) and more expensive propeller is needed than would be needed with the electric motor alone.

There is however a case what has not been talked about for your case:
– planetary gear system for driving the electric motor and the diesel engine at the same time – Toyota Prius hybrid synergy drive thing. That is about bullet proof and single point of failure will not stop the prop, one motor is enough to continue driving the prop.
– This of course has associated weight penalty. On Toyota Prius it does not matter, but on aircraft it does matter.

Case for push-pull:
– To avoid drive shaft, the diesel engine would need to be the front engine.
– case for achieving any kind of laminar flow to the fuselage would be pretty much lost
– inefficiency problems on the rear prop because of the front prop. I have not quantified this on the other hand, apparently nobody is able to answer how much is the penalty, it is not even exact in literature.