dinsdag 26 april 2011

find empty catch blocks with eclipse

The Eclipse Java compiler can be configured to produce warnings (or error message) for empty statements:

Java > Compiler > Errors/Warnings > Empty statement.

donderdag 21 april 2011

C-20 PRO 2050Kv Micro Park Jet Motor

Some test data for this nice micro park jet motor. If you want a bigger parkjet motor I would suggest the 2212-06 from this post.

available from HK: http://www.hobbyking.com/hobbyking/store/uh_viewItem.asp?idproduct=6634&aff=268919

Dimension: 23mm x 24mm
Weight: 25.5g 0.89oz (kv2050) (not including connectors)
Diameter of shaft: 3.0mm(EDF/EDP)
Length of front shaft: 8mm

Max performance:
Voltage: 10.5v
Current: 11.0A
Prop: 7035 (GWS)
Thrust: 552g
Power: 129W

Test data:
thread on rcgroups: http://www.rcgroups.com/forums/showthread.php?t=813808#post9088385

woensdag 20 april 2011

Making Windows find JARs like it finds EXEs and CMDs

via Java.net door mkarg op 29-12-10

After more than a decade in the Java universe, today I had just enough of remembering where my executable JARs are located and typing all the lengthy path names, so I finally taught Windows to deal with Java archives just the same way as it deals with it's native executables EXE and CMD.

After more than a decade in the Java universe, today I had just enough of remembering where my executable JARs are located and typing all the lengthy path names, so I finally taught Windows to deal with Java archives just the same way as it deals with it's native executables EXE and CMD. The trick is so simple that I actually do not understand why the JRE installer isn't applying it automatically to prevent everybody from reinventing the wheel.

Nobody wants to type so much

Two ofmy most needed programs when coding on Windows, even in the Eclipse era,are the Command Line Interface (CLI) and the Text Editor. As programmers always are in a hurry, and as I am faster in typing than in clicking, I typically start those by entering their respective binary image names at the start line (thanks Microsoft for not completely dropping it even in Windows 7). After decades of Windows, I meanwhile know that those images are%WINDIR%\System32\cmd.exe and %WINDIR%\System32\notepad.exe. In fact, this was not always the case. I can remember that before Windows NT it was not cmd.exe but COMMAND.COM (which actually still is existing even on Windows 7). But actually, I never typed the complete path, and I typically do not type the extension.Actually I don't care where to find the program, and I don't care whether the image is an EXE, COM, CMD or whatever. Windows knows where to find them, even if I am in a different current working directory, even if I omit the file extension. So now I want that magic for JARs, too. I want that my Java applications is found and started, without giving the absolute path, without giving the .jar file extension.

Getting rid of the file extension

For this to work, the first step is to tell Windows to consider a particular file extension as searchable. This is as easy as adding the extension .jar to the list of searchable extensions, which is stored in the PATHEXTenvironment variable. At the command line, this can be done temporarily (i. e. for just the current CLI session) using SET PATHEXT=%PATHEXT%;.JAR, but to make it persistent for future uses, it makes sense to instead set this in the Windows registry (e. g. using the Extended Systems Settings GUI). This was half the rent already. Now Windows knows that you will omit this extension from now on.

Getting rid of the path

The second step is to tell Windows to consider a particular path as searchable. This is as easy as appending the location to the PATH environment variable, which can be done in several ways, e. g. by using the command line for a temporary change using SET PATH=%PATH%;C:\WhereMyJarIsLocated or using the mentioned GUI. That's it. Now Windows will search that place(s) for my JARs. Great.

No magic included, unfortunately

As I wrote, it's just two little tweaks. No tricks. No Magic. All the rest is done by the operating system's intrinsic fmunctionality, plus a trick applied by the JRE installer: The installer already was kind enough to register the javaw.exe program as the executor for JAR files. So Windows knows what to do with our JAR once it was found. In the very early ages of Java, one had to do that manually, which was not complicated, but just another more GUI click to do.

But the world is not perfect yet. When running our executable JAR, what Windows actually is executing is not our JAR but the Java VM Launcher (i. e. %WINDIR%\System32\javaw.exe). That launcher is interpreting (or compiling and then executing) the content of our JAR (for those who forgot). So, the operating system's list of processes does not contain our JAR. It just contains javaw.exe, once for each started executable JAR. This is rather annoying, as one cannot easily find out which PID in fact is executing which JAR. You certainly canconfigure Task Manager to display the complete (and rather lengthy) command line invoked to run this process, but it is just not as smart as real EXEs, which are directly named as the process name. Sad but true, there is no simple help for this. Using a hard or soft link is not enough to rename the process (it still will show the target's name, not the source's name). In fact, to solve that, one would have to write a wrapper (or copy javaw.exe, or use one of those fancy wrappers available on the web). It would just be nice if javaw would create such a copy the fly and hand over execution to the newly created copy, but in fact I doubt that Oracle will do that any soon...

Regards, Markus.

An overview of all my different publications and products can be found on my personal web site Head CrashingInformatics (http://www.headcrashing.eu).

donderdag 14 april 2011

Program Pro Mini using another Arduino

Why would we want to do this?

I recently mentioned the Arduino for the MultiWiiCopter project. Although the cheaper Arduino Pro Mini (15 USD) is very well suited for this project I did had some issues with the programmability. You need a separate USB to serial adapter costing around 15 USD. Adding the cost of that doesn't make the Pro Mini an affordable option anymore.

You could go for another Arduino format. Like the Arduino Nano that comes with a mini USB connection or the Arduino Uno having a proper USB connection. The last generation Arduino's don't even require a driver for the USB chipset anymore.

My suggestion? Get an Arduino Pro Mini for this project and spend the money of the USB to serial adapter on another Arduino Uno. You can use these to program the Pro Mini and you then have a spare Arduino platform.

How to program a Pro Mini with another Arduino

Here is a simple way to program an Arduino Pro Mini without the use of a USB/FTDI programmer. All you need is another Arduino! Simply pull the cpu out of the board, and wire the following pins between the Arduino and Arduino Mini

RX -> RX
TX -> TX
+5v (or +3.3v) -> VCC
Reset -> GRN (Reset/DTR)

That's it! Plug it in an program Smiley You could also use this method to add serial/usb communications to your Pro Mini for debugging purposes (just don't wire up VCC if it's being powered from another source).

I used an Arduino Serial, but you could use a USB Arduino too.

It's pretty straightforward, but here are pictures anyways:

Common 450 Heli spare parts

Some spare parts you rather have in stock. Ordering from HK is super cheap but it takes a while so you'd better be prepared. This is what I would order as spare parts directly with the heli kit of your choice.

HK-450 CCPM 3D Helicopter Barebone kit (Align T-rex Compat.) 
This is the easiest solution. Just get another kit and you'll have most of the spare parts ready, except for blades and canopy. The problem with this option is that it's very popular and therefore out of stock for a while now. You can't even backorder this item :s.

Don't wait for it to come in stock either. Just get on with the spares that are available. Like you read on this blog before I have the HK450 V2 kit. Most of it parts are great! Some aren't. The few parts I would replace anyway are the plastic tail unit and the landing skids. The spares are simply stronger.

A list of the most common hk heli spare parts:

woensdag 13 april 2011

Cheap & Easy swash plate leveling tool

A must know for any RC heli addict out there. Check this movie on how to level your swash plate using no more than a simple zip tie:

donderdag 7 april 2011

GWT Presentation

This is a GWT introduction I presented at a community event of my employer Ausy/DataFlow Consultancy. Many thanks for the opportunity and I'm looking forward to the next session.

Download the presentation (PDF/4MB).

The next presentation will be about Android.

HobbyKing YAK 54 Build Log

This was my first order from the German warehouse and wow delivery really is quick. Got my package within 3 days! So unreal for a HobbyKing order :D.

Was very well packed like you can see on the pictures. The box was in another box together with some air pockets and the plane parts themselves were wrapped in bubble plastic. All wel fitted, not moving around, in the box.

It even comes with a manual. I wouldn't expect too much of that though. Even wingspan in specs is not correct...

Assembly didn't take long. The tail can be attached with a metal screw. The rudder needs to be clicked in the hinges. The wing just slides in and is secured in place with nylon screws. The landing gear just pops in the bottom where a plastic case keeps it in place. The tail wheel wasn't glued on properly so I fixed that.

The propeller can be attached using the wrench that comes with the kit. Put the white plastics in front and peel them off when the prop is mounted. You then can stick the foam prop on it. The kit comes with a spare prop and spinner.

Next center the servo's and adjust the length of the control rods before attaching to control horns. The plastics of these aren't very rigid. I'll just see how much they can take.

Then finishing the electronics I had some minor issues. For some reason the JST male connector of my 1000mAh 2s pack didn't go smoothly in the connector already installed on the ESC. Later on, while I was checking movement of the controls it just burned up! I guess it wasn't installed correctly. Luckily no damage to ESC or lipo. I just installed a new JST connector to both.

Another issue I had was fitting all the electronics in the fuselage. The canopy flips open but it has a bottom so you don't have much space. You can slip the battery in the front completely so that is out of the way (remember to attach a slip to get it back out without touching the leads). But my receiver was too large to fit. So I cut out a piece of the bottom of the canopy to make it all fit. I now also can see the led on my receiver when the canopy is closed.

Something else here I had to glue back on was the metal part on the fuselage where the magnet of the canopy sticks to. Check it before maiden so you don't loose the canopy in flight!

That's it, I'm ready for the maiden. Not today though but I'll keep you informed. Not sure how I will balance this plane without any notes on CG location in the instructions... well just put it at 25% of wing chord and adjust after maiden.

dinsdag 5 april 2011

E-Flite P-40 Warhawk Flight Report

After some windy days I went flying in the evening at still 10kmh. No good idea for getting to know this plane but I couldn't wait no longer. Flew it straight into the ground after 1min air time. Stood up in the mud when I arrived at the crash zone. Only minor damage. Broken prop and some scratches. This wind is doable though.

Another day I tried at 15kmh. It just drifted away and I couldn't get it back. Could be a lack of skills on my side since this is my first aileron plane. Anyway got out of sight so I cut power and went looking. found it with a crack on one side of the fuselage just above wing. Easy fix.

Yesterday finally proper weather with less than 5kmh of wind. Flew 2 lipos (still the small 360 mah so only 3 min flights). so much fun I forgot to land when timer on last one kicked in. So lost power and had to land it somewhere in the field. Lost spare prop on that landing. Still no real damage.

Great flyer. Turns need power and if you bank too much you loose a lot of altitude. Didn't miss that rudder. Hard to see on a distance. Another colourscheme could help. Elevator is sensitive like hell. I added some expo there. Rolls aren't extremely snappy but thats just fine for my second plane. I think on 2s you can fly up to 10kmh and with some more power and skilss maybe 15kmh. on 2s I throttled down untill just above 50 perc with that smaller lipo. On straight fly only. for turns at least 75, 100 is better. Climbs out niceley after turn though. I launch straight on 75 perc throttle. On full throttle it banked and needed correction right away. The finger holes under the wing are so easy.

After some hard crashes I only had to glue one crack in the side of the fuselage and in the back the tail a foam segment that came off. The motor also got wobbly but I couldn't fasten it with the screws only. Thanks to rcgroups I found out (without even opening it up :)) that the plate and not the motor is coming off. So some glue to fix the firewall was all this needed. 

The controls are well made, no binding that I noticed. I did have some issues once in the air but that was due to the servo wire of the aileron getting in the way of the aileron controls.

vrijdag 1 april 2011

HobbyKing YAK 54 Brushless EPO Plug-n-Fly

I just ordered one of these cheap YAK 54 aerobatic foam platforms. I'm not looking for 3D cause then I would better buy myself a profile foamie. I rather have some scale like plane with scale like aerobatic capabilities. And I think this could just be a great affordable option:


Wing Span: 750mm (29.5in)
Length: 675mm (26.5in)
Weight: 355g (without battery and receiver)
Battery compartment size: 99x39x16mm (Important)
Center of gravity : 52-60 mm behind the wing leading edge
Not supplied : Your TX & RX
I used this 7.4V 2S 1000mah lipo battery.
For the advanced pilots - 11.1V 3S 760mha Lipo battery 


Wiki information: http://en.wikipedia.org/wiki/Yakovlev_Yak-54
More wiki information: http://en.wikipedia.org/wiki/Yakovlev_Yak-55
Review/Build Log: http://www.rcuniverse.com/forum/m_9983046/anchors_9983046/mpage_1/key_/anchor/tm.htm#9983046

Build Log and Flight Report

I'll get back to this post as soon as it arrived. Shouldn't take that long this time since I ordered from the europe warehouse with fast shipping option. Will be back soon!

E-Flite P-40 Warhawk 300 ARF

This is a small (650mm WS/200g) affordable P40 warbird that comes completely assembled with motor, spinner, prop and control link hardware. You only need to add the electronics (servo's, esc, receiver and battery) and you're ready to go. It even comes with a stand to show off on your desk :).


You could go with the e-flite recommended electronics. This is what I used directly from hobbyking:

It's important to check the specs of the recommended battery. The motor will handle a 3s setup so if you find a battery that fits with 3s that's great. The amp draw will be just below 10A so you might want to use an ESC rated for higher draw. A 3s would probably be a bit heavier than the recommended 30g also so you would have to give up some slow speed capabilities. These are the specs of the recommended battery:

Weight:1.1 oz (31.2g)
Length:2.15 in (54.6mm)
Width:1.20 in (30.5mm)
Height:0.35 in (8.9mm)
Maximum Continuous Discharge :20C
Maximum Continuous Current :8.6A

For 2s a 10A esc (channel 3) is more than enough. This plush is a good programmable esc, if you realy want it cheaper you can go for the fixed wing 10A esc. The connectors on the motor wires are already soldered. The connectors for the esc are provided but you need to solder them on. Same for battery connector.

Another close fit are the servo's. You need 2 of them. One for aileron (channel 1) and one for elevator (channel 2). I tried the HXT500 servo's but these were just too big. You might be able to force them in and they will stay in without glue. For the HXT900 servo's you definitely need to cut out some foam. These are a bit too heavy also compared to the recommended servo's. But it would work giving up some slow speed capabilities due to the higher weight (same with a 3s battery). The HXT500 are closest to the specs of the recommended servo's. I used even smaller servo's that fitted without any modification. They are also lighter than the recommended setup. You really don't need a lot of throw or power on this small fighter so they do just fine. Secure them with a drop of glue on the servo's mounting tabs. Some specs of the recommended servo's:

Torque:12.5 oz-in (0.9 kg-cm) @ 4.8V
Speed:.10 sec/60 deg @ 4.8V
Length:0.93 in (23mm)
Width:0.39 in (10mm)
Height:0.74 in (19mm)
Weight:0.21 oz (6.0g)

And finally you'll need a receiver. I have a Turnigy 9X 9 Channel transmitter but the receiver that came with it is way too big. So I used this smaller compatible 3 channel receiver from hobbyking. You only need 3 channels anyway and the space for these electronics is very limited.

Final Assembly

On this last picture of the mini P40 warhawk warbird from e-flite you can see all my electronics installed in the fuselage. I don't have a proper battery yet so I just moved it where it fitted without influencing the CG location. The actual battery compartiment is on top of where you see this battery now. It can be accessed by removing the canopy.

The rubber ring you can see on the aft of the wing is pulled through the fuselage to hook it up on top, underneath the canopy. For this a small tool is included in the package. You also get a spare prop and spinner.

The only adjustments I had to make before flight was adjusting the black aileron control horns and rods you see on this picture. By turning the clevises around you can extend or retract the length. This is needed to level the ailerons with the wings trailing edge.

Maiden flight

Has yet to come. This is a small lightweight flyer so it can 't handle that much wind. Especially for the maiden I'll just wait for better flying conditions. Video and experience will follow...