Saturday, December 29, 2012

How to Glue ABS?!


.. can be like trying to nail Jello to the wall.

While starting on a model boat project that involves an ABS hull, the question came up how to best glue things to plastic: Wooden bulkheads, deck, metal drive tube, other plastic parts, ...

This specific boat I'm about to build is a Graupner Bugsier 3. Its hull is made from ABS plastic. For what it's worth, the site http://www.kuederli.com/bugsier3/ has a very nice description of building this kit. It does mention re-enforcing and sealing the hull with epoxy and glass mats, but doesn't mention a specific type of epoxy. Based on what I learned, plain epoxy will not work at all. The kit's instructions recommend Stabilit Express. Stabilit Express is a very good 2-component glue:
  • Nicely bonds to ABS, wood, metal, anything
  • Gap-filling
  • Sets in a short time
  • Can be drilled, sanded
...but it's very hard to obtain outside of Europe. http://www.hobby-lobby.com/ used to sell it, but won't any longer. Ordering it from German companies like Conrad seems impacted by shipping restrictions.

So I tried various glues in a very unscientific way: Glue snippet of ABS plus piece of wood to ABS, see how it holds up to me trying to pull it apart.

Here's what didn't work:
  • Various Epoxies (Tower Hobby, DevCon 30 min, UHU Plus endfest 300, Loctite Heavy Duty 5min, ...) - Usually a good bet for any glue task, but doesn't stick at all to ABS.
  • JB Weld MarineWeld, PC-11 Marine Epoxy - May be more resiliant to UV and water, but don't help with ABS.
  • Alumilite casting resin - Seemed like a good idea for flowing into bottom of hull to make is watertight, closing every little pinhole, but peels right off the ABS when hard.
  • JB Weld - Won't stick.
  • Gorilla glue - The foaming polyurethane variety. Very messy, doesn't stick to ABS. 
  • Contact cement - Spread on, let dry, then press parts together. Seem to stick, but separate easily once the glue dries.
While most of the above would initially appear OK, the hardened glue will simply 'pop' off the ABS as soon as you slightly deform the ABS or pull a little stronger.
What works with ABS:
  • Stabilit Express - we knew that.
  • UHU Hart - Nice for bonding wood to ABS, but also hard to obtain in the USA.
  • Acetone - sneaks into smallest gap, melts the ABS, gives perfect bond, but needs perfect 'fit'. Not gap-filling at all, doesn't bond to anything else. 
  • ZAP Slo, gap-filling CA - May be even better if surface is wetted with acetone just before adding CA. Since the
  • DevCon Plastic Welder, 'cream' colored - Smells a lot like Stabilit Express, may be the closest to it.
  • Loctite Plastic Bonding System - A pen-type heptane activator plus a CA-type glue. 
  • Loctite Plastic 5min Epoxy - Not to confuse with regular epoxy, this one somewhat works on ABS, but not as well as DevCon Plastic Welder nor the CA-type Bonding System.

Sunday, September 2, 2012

Another Dead Mac Disk. Backup Woes

The disk in an iMac died. Disk replacement was a little easier than in the one earlier this year.

After the replacement, tried Time Machine with an external USB-3 Toshiba drive. Worked fine twice, then the next morning it showed backup errors. The system.log listed file type modification errors. After a Disk Repair, backup functioned OK. Maybe the external drive goes to sleep over night?

Being in backup mode, tried the Control Panel "Backup & Restore" on a Windows computer. Ended in backup errors

c:\windows\system32\config\systemprofile\syncup 0x80070002 The sytem cannot find the file specified

Fix mentioned on http://en.community.dell.com/support-forums/software-os/f/3526/p/19431232/20030578.aspx: Open the Windows navigator. In the left panel, it lists the Windows 7 "Libraries" for Documents, Music, Pictures, Videos. Each one contains a user specific folder like "My Documents", a shared folder and a "Sync Up" entry. Delete the Sync Up entry, and backup works fine.

Tuesday, July 17, 2012

Speedy Bee

Built from plans provided by KCRC member.

First flight around July 1, 2012.

Engine is OS FS-26.

Flies well, very not-speedy. Can fly inverted without dropping, loop in no space at all.

Is overall a bit flimsy because I decided to build it as suggested on plan with removable tail section, rubber-banded wing etc. Landing gear is very narrow, need to turn slowly on taxi to keep wingtips above ground.

Thursday, July 5, 2012

RIGblaster plug & play needs USB-2

Tried to communicate with a RIGblaster plug & play via Java RXTX.
The Rigblaster is essentially a USB-to-serial converter. All functioned fine on a new Windows 7 computer with 64 bit Java, until suddenly it didn't. The RXTX code hung somewhere in its CommPortIdentifier class that is used to open a port.

Reason turned out the type of USB port. This computer happens to have USB-2 as well as newer USB-3 ports. With USB-2 all is fine, with USB-3 the RXTX library hangs.

Wednesday, July 4, 2012

Eclipse E4 Selections, Events, Context Variables

Eclipse 4.2 includes the new "E4" APIs which offer different ways of communication between portions of your Eclipse application.
The Lars Vogel article http://www.vogella.com/articles/Eclipse4Services/article.html nicely lists these, and here are some comments from trying them out.

Selections

In Eclipse 3.x, you used the ISelectionProvider:

ISelectionProvider selections = null;
selections.setSelection(new StructuredSelection(selected_item));

Obtaining the selection provider could be circuitous, and the selection had to be published as an ISelection, typically a StructuredSelection.

On the receiving end, you needed to register a listener to the selection provider and unpack the ISelection.
In Eclipse E4, there is @Inject magic at play that can be difficult to debug, but the resulting code is sure nice:

// In a "GUI creation" routine invoked via @PostConstruct,
// arguments are injected because the @Inject is implied.
// To get an ESelectionService injected into other method,
// a specific @Inject would be required.
@PostConstruct
public void createControls(final Composite parent,
    final ESelectionService selections)
{
    // Create GUI...
    // ... monitor for example selection of list.
    MyModelObject my_selected_object = ...;
    // Publish any selectd model object or array of model objects "as is".
    // No need to wrap into StructuredSelection:
    selections.setSelection(my_selected_object);
});

To receive such a selection in another piece of E4 code:

// E4 will invoke this whenever the active selection changes.
// If the active selection is instanceof MyModelObject, it will be provided.
// Otherwise, null will be sent.
@Inject
public void handleChangedSelection(
    @Optional
    @Named(IServiceConstants.ACTIVE_SELECTION)
    final MyModelObject selected)
{
    // No need to unpack a StructuredSelection.
    // May only have to check for null
    System.out.println("Received changed selection " + selected);
}

If your selection listener happens to only receive null arguments, the reason is likely that the selected object does not match the type that you want to receive. To debug this, change the argument of your selection receiver from MyModelObject to just Object and check the type of the received object.
When porting existing code, you may by accident still publish a StructuredSelection that wraps your MyModelObject class. The E4 framework will not unwrap a StructuredSelection. Just publish and receive the exact class that you want to transfer!

Context Variables

There is only one global selection mechanism. If you want to pass updates on various model items between E4 components, you can use context variables.
Publishing anything into a context variable is as easy as publishing a selection, but note that you can now name the item that you put into the context. This allows you to publish different types of information under different names, effectively having access to multiple selection services.
You can either use a string or a class reference:

@Inject
public void methodThatPublishesContextVariable(final MWindow window)
{
    MyModelObject my_selected_object = ...;

    final IEclipseContext context = window.getContext();
    context.declareModifiable("my_item");
    context.set("my_item", my_selected_object);
}

Receiving the item updates is very similar to receiving the selection:

// E4 will invoke this whenever the named context variable changes.
@Inject
public void handleChangedItem(
    @Optional
    @Named("my_item")
    final MyModelObject item)
{
    // May have to check for null
    System.out.println("Received changed item " + item);
}

It is important to remember that the context is hierarchical!
In the publishing code it is tempting to directly ask E4 to inject the context like this instead of going via the MWindow as shown before:

@Inject
public void methodThatPublishesContextVariable(final IEclipseContext context)
{
    ...
    context.set("my_item", ...);
}

This will not work as expected! The context that your part gets injected will be the context of your part. You will then publish the context variable for "my_item" within that local context, and updates are not received by other parts. By instead asking for the window to be injected and publishing to the window's context, all parts within that window will receive updates:

@Inject
public void methodThatPublishesContextVariable(final MWindow window)
{
    final IEclipseContext context = window.getContext();
    ...
    context.set("my_item", my_selected_object);
}

If you want all windows of your application to receive updates, you can even use the application's context:

@Inject
public void methodThatPublishesContextVariable(final MApplication app)
{
    final IEclipseContext context = app.getContext();
    ...
    context.set("my_item", my_selected_object);
}

The scoped, hierarchical nature of the context variable mechanism therefore allows you to control who receives the updates: The same part, all parts in the window, or everything in the application.

Event Broker

Finally, the IEventBroker provides a lower level mechanism to post and receive events. When posting events, you can decide to simply post them in a fire-and-forget mode, or send them and wait for the receivers to handle them:

class MyClass
{
    // Receive event broker.
    // Could also fetch in code via
    // IEclipseContext.get(IEventBroker.class)
    @Inject
    private IEventBroker event_broker;
    
    void codeThatSendsEvents()
    {
        MyModelObject my_object = ...;
        event_broker.post("my_object", my_object);
    }

The 'post()' shown here is the fire-and-forget way. Use 'send()' to wait for receivers to handle the event.
To receive events for the topic "my_object" that carry data of type MyModelObject, use the following:

@Inject
public void receiveEvent(
    @Optional
    @UIEventTopic("my_object") final MyModelObject item)
{
    System.out.println("Received " + item);
}

When replacing @UIEventTopic with @EventTopic, events will be received on some event handling thread. The annotation @UIEventTopic asserts that events are received on the user interface thread, which is useful if your event receiver intends to make UI modifications, for example display the event in SWT widgets.




Friday, June 15, 2012

Eclipse Plugins with Native Code for Multiple Platforms

Eclipse plugins can contain native code. Since the native code is specific to a certain architecture, this should probably be put into a fragment that is then added to the 'main' plugin depending on the architecture.

Such fragments can support multiple platforms, for example Linux on both 32 and 64 bit CPUs, by adding something like this to the MANIFEST.MF:

Eclipse-PlatformFilter: (& (osgi.os=linux) (| (osgi.arch=x86)(osgi.arch=x86_64)))
Bundle-NativeCode
 lib/linux/x86/mylib.so;    osname=linux; processor=x86,
 lib/linux/x86_64/mylib.so; osname=linux; processor=x86_64

On Linux, the correct library for either CPU type will be now available.Excellent!

However, when combining such plugins into a feature-based product, a problem arises. Assume you have a fragment for windows, one for Linux, one for OS X. When you add the fragments to the product's feature, you must again specify their architecture:

   plugin
         id="org.mylib.linux"
         os="linux"
         arch="x86"
         ...
If you don't specify the os and arch in the feature, the build will fail: Eclipse will try to include your plugin on both Windows and Linux, but then complain that the "linux" plugin doesn't work on Windows and vice versa.

If you do specify the os and arch, however, you can only list one arch, even though our linux fragment would work on both x86 and x86_64.

The solution is to list the same fragment again in the fragment.xml with the other os and arch settings:

   plugin
         id="org.mylib.linux"
         os="linux"
         arch="x86_64"
         ...

Note that you may have to do this directly in the feature.xml. The feature editor's Plug-Ins tab doesn't support adding an already included plugin multiple times, but once you did add it in the feature.xml, you can view and edit it in there.

Sunday, May 13, 2012

Nook Simple Touch Hung on Update

Found my Nook Simple Touch hung this morning in an update. Unclear when this started, some time over night. The Nook was plugged into the charger all the time.

After about 10 minutes I decided that the "Please don't turn off your NOOK!" is nonsense, because nothing was happening. Note that the progress bar at the bottom was not animated and appeared somewhat mispainted.



After holding the power button at the back of the device pressed for at least 20 seconds, the device power cycled and went through a bootup cycle which almost immadiately entered the "Installing..." display again. But this time, the progress bar at the bottom was animated, slowly filling from the left. Then it switched to another startup screen, the progress too about 2 minutes.

Finally the usual screen saver appeared. I could unlock the device, and the main screen displayed a notification icon regarding a software update. The time of the update is the time of the power cycle.


Tuesday, April 3, 2012

Apple iMac Harddrive Replacement

Needed to replace the Harddrive on an Apple iMac. This is a white plastic Intel iMac. After removing all screws from the bottom (where the memory modules are also installed), the back of the case can be pulled off, starting at the bottom, with a 'crack'. There's a lot of aluminium-backed tape inside, and after removing the LCD panel the hard drive becomes accessible.

The original drive was 160GB. A 250GB replacement was found for around $60 (3.5", SATA).

Then it came to re-installing the operating system from DVDs, where I ran into two surprises:
  1. No disk found.
    With Linux, installing an OS from DVDs is fairly straight forward. You are guided through partitioning the hard drive etc. With OS X, I was expecting it to be even easier, but wrong: The installation asks you to select a hard drive for the installation without offering anything. Solution: Close the installer, select Tools/Disk Utility from the menu to format and partition the drive. When installing again, you can now select the drive.
  2. Can't eject the disk??
    When prompted to insert the second installation DVD, I could not figure out how to eject the first one. Nothing worked. Finally I learned that the drive was empty ... I had not fully re-assembled the case because I first wanted to check if everything "worked". When the iMac ejects a DVD, it's usually kept half-way in the drive because of the felt lining of the DVD slot. This time, the iMac had ejected the first OS installation DVD, it had rolled of the table and vanished under some cubboard. From the outside, I could not tell if there's a DVD in the drive or not. Since I didn't remember ejecting the DVD nor saw one in the usual half-out-of-the-drive position, I had assumed that it's still "in"....

Monday, March 12, 2012

Extra 3.25





First heard about the design as a Model Airplane News plan, designed by Rich Uravitch. Then found the Lanier kit version on EBay, got it for Christmas in 2010 together with a used OS FS 26. Unclear how old that engine is. It looks a bit more gummed up than my other 10-year old OS 26.

The Lanier kit has very nice laser-cut pieces which I wanted to preserve, since it's getting harder to find nice kits. So this plane was built by copying the pieces of the kit.
Everything came together quickly until it was time to assemble the middle section for which the kit provides a vacuum formed clear plastic part. Created a plaster mold, but failed to duplicate it because it was hard to get a suitably large sheet of clear plastic. Ordered a canopy from Tower for a 60-sized cup that appeared similar, but that piece arrived broken. So ended up creating the center section from scratch out of balsa.
The kit also includes a cowling which I didn't want to remove from the kit, either. Tried to copy it in fiberglass, which turned into a big mess. Then ordered a replacement fiberglass cowling from Fiberglass Specialities, but have not put it on because it's much easier to reach the engine without a cowling. The only part on this plane that came from the kit is the aluminum landing gear.

The kit suggests a weight of 3.5 to 4.5 lbs, but my plane came out just under 3 lbs! It appeared front-heavy, had to move the receiver battery into the back of the fuse to balance. Servos are 3 normal sized ones and a small one for throttle. One servo with bell-cranks for ailerons, no "flap" mixing option.

Wingspan 120 cm
Length 87 cm
Area 23.4 dm2
Weight 1330 g
Loading 56.8 g/dm2
Airfoil Semi-Symmetrical
Engine OS FS 26
Tank120 cc

First flight was on the 2012/03/12. Engine runs fine, solid put-put-put, no screamer. The plane has a tank that only uses a third of the front section, and I don't know how long it will run, but after 4 minutes it's still 3/4 full.The plane feels very light and can fly quite slow. very easy to fly, like a trainer except maybe a faster roll rate.

Wednesday, February 29, 2012

Eclipse JFace 'VIRTUAL' TreeViewer basically requires TreeColumnLayout?

When switching a TreeViewer from an ITreeContentProvider to a 'VIRTUAL' TreeViewer with ILazyTreeContentProvider, the tree display initially appeared blank. The items in the tree would only become visible after waiting a little, or by doing some window operations that result in a refresh of the tree. This happened especially on Mac OS X.

After looking closer, it became obvious that the one and only column of the tree had a nearly zero width. Note the arrow in the image that shows the column separator:




The issue seems to be that a non-VIRTUAL TreeViewer knows all its items right away and can size the tree columns appropriately. When swtiching to a VIRTUAL TreeViewer, the items are updated as needed, and the column refresh can lag.

Early "fixes" involved forcing a refresh after setting the TreeViewer input:

tree.setRedraw(false);
tree_viewer.setInput(config);
tree_viewer.refresh();
tree.setRedraw(true);

or

tree_viewer.expandAll();

But the best workaround seems to be to use a TreeColumnLayout that always auto-sizes the one and only column:


// Note that the TreeViewer needs to be the only widget
// under the parent widget. If necessary, add Composite
// to wrap the TreeViewer
final TreeColumnLayout layout = new TreeColumnLayout();
parent.setLayout(layout);
final TreeViewer v = new TreeViewer(shell, SWT.VIRTUAL | SWT.BORDER);
v.setLabelProvider(new LabelProvider());

Friday, February 3, 2012

Avoid Soft Links in Eclipse Headless build - or ant in general?

Ran into a really strange problem.
As a result of a headless Eclipse product build, I usually get an abc.app for Mac OS X.
But this time around I got an abc.app for Mac OS X that "worked", but the program icon was wrong. In addition, there was an Eclipse.app directory that's mostly empty.
Products for other architectures (Linux, Windows) looked OK.

Apparently, the build process had first put the Eclipse.app in place, tried to assign the icon etc., and then renamed it to the actual product name abc.app, but something failed in the process. The Eclipse.app partially remained in place, and there was no icon.

Solution: I had recently changed the build directory to /tmp. On Mac OS X, /tmp is a soft link (symbolic link) to /private/var. Either the Eclipse headless build or maybe ant in general has problems with soft links. After using a "real" directory path without any soft links as the build directory, things were fine again.