Spoke dynamo / speichendynamo. Farewell old friend.

December 19th, 2013

One of life’s reassuring constants has just quit on me: my bicycle dynamo. I bought it from a German website about 10 years ago after a German colleague told me such a thing existed. This was in the days before translation engines on the web, so I recall some trial and error just to get through the checkout. Desperate to source a replacement for it, I couldn’t remember even what it was called much less from which shop I bought it.

Speichendynamo (Spoke Dynamo) NEU FER 2002 kugelgelagert

Speichendynamo (Spoke Dynamo) NEU FER 2002 kugelgelagert

The Speichendynamo article on German Wikipedia tells me they’re not made any more and certainly I couldn’t find a shop selling a new one online. I’m gutted – this little device worked brilliantly for me. My front light and generator were fixed permanently to the bike (so couldn’t be lost / easily stolen) by virtue of being clamped on with the front wheel Allen key skewer. Front lights don’t go as easily into a pocket as rear lights, so this was a cheap and easy hub dynamo alternative.

Inside the spoke dynamo - belt-tastic

Inside the spoke dynamo – belt-tastic

I had hoped this evening’s problem would be easily fixed, but opening the casing revealed a sorry sight. It originally came with a set of replacement belts, but I’ve migrated twice across the world in the meantime and those are long gone. I’m going to keep it in my ‘lucky parts’ box, just in case.

Ex-belt

Ex-belt

I ride for transport, all year round, so the spoke dynamo was a revelation to me. I’d had several bottle dynamos before all of which would aquaplane in bad enough weather, causing the front light to go out in the worst possible circumstances. Ten years of faithful service – I probably only cleaned it / oiled it 2 or 3 times. A sad day.

I think I’m going to have to dig deep and get a hub dynamo.

Update

I dug not very deep (£42) about a month ago and paid for a new front wheel with a built-in hub dynamo + £50ish for an LED front light (the old halogen light was incompatible) with a built-in stand light function. The new combination is excellent – no noise, no discernible drag even when on. My one gripe is with the light, not the hub: the contrast between the well-defined square of light thrown ahead of the bike and the darkness directly ahead of the front wheel has caused me to slow down on some of my regular routes. There’s so much debris (pebbles, rocks, bits of branches) to avoid that I’ve had to point the light almost directly at the ground so I can see it as it passes under the front wheel! Perhaps I need a different lens?

China’s Lunar Lander – did it Crash?

December 17th, 2013

I first saw the video of the Chang’e 3 lunar landing at LiveLeak and have to say I thought it was beautiful: the smooth motion and clear images reminded me of looking out of the window of an aeroplane as it banks while lining up to land at a destination airport. The video is over 6 minutes long at almost 30fps (frames per second – 29.97fps according to mplayer).

The next video I saw was in an article at the Telegraph under the subtitle “Chinese state television releases video of the Chang’e-3 space probe crash landing on the moon”! This second video later made its appearance at Liveleak (“Deployment of China’s Rover on the Lunar Surface”), again at 29.97 fps (perhaps that’s LiveLeak’s preferred transcoding rate?). The ‘crash landing’ in the Telegraph title is repeated in the article text:

The footage shows the surface of the moon getting closer and closer to the probe before it crashes into the dust.

an odd thing to repeat in an article reporting a successful “soft landing”!

The first video’s 6+ minutes does make the landing look almost serene, but I can’t imagine a lander would have ‘hung around’ much – the Chinese Space Agency surely wouldn’t have launched much more fuel into space than absolutely necessary to reach the Moon’s surface? The faster video seems to start at about the same point as 03:47 in the slower video. Touchdown is at 00:22 in the faster video, 06:07 in the slower video, so 22 seconds (fast) versus 140 seconds (slow).

So was it a gentle glide or a terrifying crash? I can’t find a ‘reference’ version on the WWW, perhaps because it’s published in Chinese. If anybody knows how fast the landing was and which one (if either) of the videos portrays the landing correctly, I’d love to know. I’d also like to hear some audio from the Moon. I see a lot of people saying “there’s no sound in space”, but I bet there’s some terrific vibrations from the lander’s thrusters and some great crunching / whining going on in Yutu / Jade Rabbit (the rover)!

[More] A Channel 4 article says

fall from 15 kilometres above the moon’s surface to 2.9 metres above it at a speed of 1.7 kilometres per second

which makes 20 seconds sound about right – if it was a vertical drop (unlikely?) or ‘speed’ has been used in place of ‘descent’.

Rainwater toilet flush

December 11th, 2013

Among other efforts to reduce our South West Water bills, we employ

If it’s brown
flush it down.
If it’s yellow
Let it mellow.

- which saves a lot of money, but the bathroom always smells of wee. Fortunately for us, we live in rainy Devon and there’s a rainwater butt fed by the drainpipe outside the bathroom window. We leave the bathroom window permanently ajar due to our rented house’s endemic mould problem and now also the “If it’s yellow” odour. The lightbulb over my head told me I could pump the water from the butt through the window opening into the toilet flush cistern.

The Electric Rainwater Toilet Flush

The plan in brief is to put a submersible pump in the rainwater butt, run power and a water pipe through the bathroom window, switched with an electric float switch in the cistern and … ker-ching! Here’s my shopping list:

The pump and switch had short wire tails needing extension for which I used some insulated wire I had left over from other projects. Sizing the pump and battery depends on the power required to pump the water (how high and fast it’s lifted) and how often you flush the toilet. I used a 2-ish amp pump with a 2Ah battery which refills the cistern in between 1 and 2 minutes, so about 30 flushes will drain this battery flat from fully-charged.

In ecstatic optimism I dug out some old 5W and 8W solar panels from my ‘lucky bin’ to keep the battery charged via a solar charge controller. This just didn’t work – the only sky the panels could ‘see’ from near our bathroom window is in the North East and after a couple of cloudy days just didn’t contribute enough to make the flush reliable, so the solar panels went back in the lucky bin to be replaced by a 12V 1A ‘wall wart’ DC transformer to keep the battery charged.

The first step was to fix the ballcock in place to stop the cistern filling with mains water. Fitting the tubing to the pump was made much easier by dipping the end of the tubing in a cup of hot water to soften it. Switching the 2+ amps for the pump was beyond the float switch’s rated 0.5A, so I used a now out-of-production MOSFET transistor from my lucky bin. The transistor is kept non-conducting with a resistor between gate and battery -ve when the float switch is open.

The float switch is crudely tied in place around the cister’s siphon and floats *open* when the cistern is full. When the water level drops, the tiny float falls and closes the switch, causing the transistor to conduct and the pump to run, refilling the cistern. When the cistern fills to the level of the float switch, the tiny float rises, opening the switch causing the transistor to stop conducting and the pump stops running.

School of life

The first time I tried this I threw everything in place, connected the battery direct to the pump, satisfied myself everything was going to work and disconnected the battery. The pump switched off, but the cistern kept filling. The fill level of the rainwater butt was slightly above the fill level of the toilet cistern so I had primed a siphon! This would have meant that the rainwater butt would have overflowed through the toilet cistern inside, which seems like a bad idea. I placed the cistern end of the tubing above cistern water level so I can hear the cistern refilling, but note that ‘silencing’ the refill by placing the end of the tubing under the water in the cistern would create a cistern-draining siphon.

The easy fix to the siphon-into-cistern problem is to lower the rainwater butt, but I couldn’t do this as the house / rainwater butt is not mine. The butt is on a pedestal which I could have removed, but the rainwater downpipe is cut to meet the lid of the butt. Instead I drilled a new overflow hole in the rainwater butt below the fill level of the toilet cistern inside the bathroom. Don’t tell my landlord. When I leave I shall have to search the WWW for a butt plug.

The lowered rainwater butt overflow means the butt now holds less water. A full 200 litre rainwater butt holds only about 20 flushes. My family of 4 can easily exceed that on a carefree flushing day. I bought another rainwater butt from the town council office (good quality, good price) and joined the two butts tap-to-tap with a short length of garden hosepipe, again softened in a cup of hot water. The two butts together hold around 300 litres.

Then it got much colder with even daytime temperatures below freezing. The pipe connecting the two butts froze, so I built a low wall (if this was my house I would have made a housing) around the water butts and buried the connecting hose, which seems to keep it unfrozen for now but won’t make future maintenance any easier. The icy blasts coming through the window were an issue at shower time, so I took the tubing and wires out of the window opening and fed them (not easy!) back up through the toilet cistern overflow. We can now close the bathroom window if we want to and the piping / wiring is invisible except for the MOSFET in a prototyping board sitting on the bathroom window sill.

If water level in the butt falls below the intake of the pump, the cheap pump I bought will keep spinning. I bought but have yet to fit a float switch to detect when the butt runs dry, so at the moment I have to check daily during dry spells. If the rainwater butt level is too low, I unplug the transformer / charger, disconnect the battery and free the ballcock in the toilet cistern to go back to mains filling. There are more expensive pumps which incorporate a float switch which would give a neater layout. Wiring such a switch in series with the cistern level switch would mean longer wire runs, but would switch the pump off at the transistor.

Conclusion

It works excellently … until it stopped raining in the UK for 3 weeks recently. When the 5-day weather report says no rain, we go back to “If it’s yellow …” and we can flush sparingly for nearly a week. If it rains, we flush, flush away like billy-o.

I think we use something like £1 (South West Water price is ~£5.50/m³ or 0.55p/litre) of water per day to flush the toilet if we do it recklessly. We haven’t done that for some time, so the difference in consumption between “If it’s yellow …” and rainwater flushing is not as impressive – but it does show. Here’s a chart of water consumption with mains water and “If it’s yellow …” and here is a chart of water meter readings with the rainwater butt refilling the cistern.

The crude average displayed at firtl.com/log (1.39 cubic metres per week mains-filled versus 1.213 per week for rainwater) shows we use about £1 of water per week when flushing sparingly, so this little project still saves money compared to a stinky mellow toilet. There’s some fine balancing to be done with the cost of rainwater storage but with 200 litre tanks at £35, 2 or three tanks should amply provide for most houses, with the occasional use of mains water in prolonged dry spells.

Updates

2014 March 10: We forgot all about the flush – it just kept reliably working thanks to a wet winter. The sound of the pump outside was becoming easier to hear recently and then in the last few days the power transistor overheated so badly we could smell it. I suspect the pump is either partially blocked or worn out. A new higher-spec pump is in the post.

Muslims in niqab / burqa smile for the camera no eyes visible

July 10th, 2013

Someone forwarded me a photo of Muslims in burqa / niqab today by email with a comment about “incongruity”. Here it is:

saycheese

I wasn’t immediately convinced it couldn’t have been improved for comic effect using something like gimp. I searched for “Image Search”, thinking I could just find similar images and see if there was a slightly different original. TinEye came up near the top of the results and was the only one with an obviously useful user interface. I saved the image from my email to my local storage and used TinEye’s image upload feature to request similar images.

tineye

TinEye has a handy “Most Changed” feature that – I’m guessing – shows the image that’s least like the one you upload, but still considered a match. This link should take you to TinEye’s search results. I don’t know how long TinEye keeps search results for, so if that stops working feel free to try down/uploading the image yourself.

The top result for “Most changed” appears to have eyes, and links to a page at travel.sulekha.com on which there’s an image gallery with a link to the photo showing women in burqa / niqab with eyes visible.

saycheese0

There you go, a demo of TinEye in action!

It wasn’t until I read this ZDNet article that I could be sure Google also offers the same functionality. You need only click on the icon that looks like an SLR camera inside the text box, duh.

LeJOS PIDController not working, output is zero

June 5th, 2013

This problem had me baffled for more than a few minutes: I wrote a leJOS PIDController loop for a LEGO NXT project that used one motor’s rotation encoder as the input to control another motor’s set point. It didn’t work: the output from the PIDController’s doPID(int) was reliably zero. My loop seemed quite reasonable: read encoder from motor A, apply it to setpoint of motorB’s PIDController, read motorB’s encoder, apply it to motorB’s PIDController as the ‘process variable’, get controller output, apply it with motorB’s setPower() method. It didn’t work!

I found the answer in lejos.util.PIDController’s source, in setPIDParam(int paramID, float value):

case PIDController.PID_SETPOINT:
  this.setpoint = (int)value;
  this.cycleTime = 0;
  break;

and in doPID(int processVariable):

if (this.cycleTime==0) {
  this.cycleTime = System.currentTimeMillis();
  return 0;
}

Setting the setpoint resets the cycle time and the next invocation of doPID returns zero! I don’t understand why it’s necessary to reset cycleTime on change of setpoint, but that’s what the leJOS code does. I kludged around it in my code by only invoking setPIDParam if the setpoint has changed and doPID works as expected.