Monthly Archives: April 2013

Motor enclosure – part 1

For the motor & electronics, I’ve chosen to use an enclosure made from die cast aluminium. The Hammond 1590P1, which is approximately 5.5″ long x 2.5″ wide x 2″ high.


I wanted an aluminium rather than plastic enclosure for a couple of reasons, firstly to resist flexing under the cable tension, and secondly so that I could drill and tap the hole for the cable barrel adjuster. (I am expecting the use of a metal enclosure to become a headache if I move to a wireless handlebar controller, but will cross that bridge as & when I come to it).

One thing worth noting with this enclosure is that the walls are not quite perpendicular to the base, so the hole for the cable entry will need to be drilled at right angles to the wall, not parallel to the base. Not a problem in itself, just something to bear in mind when it comes to clamping it in the drill press.

I’ve also decided to to try a wheel / pulley on the motor instead of arm. There are pros and cons to this; On the positive side, it will simplify the code by not having to deal with variations in the angular to linear travel, and will keep the cable pull in a single direction (whereas it currently goes a bit off axis as the arm moves through it’s travel). On the negative side, it requires making the pulley itself (unless I find something off the shelf), and the standard cable is too thick (I believe) for the bend radius required for my ideal direct attachment.

My thinking is along the same lines as a motorcycle twist grip, with the cable nipple held captive, and the cable running in a channel around the outside of the pulley. See crude diagram below.


The bend radius will of course depend on the pulley size. To maximise the leverage against the cable tension, and to minimise the effect of any positioning inaccuracy in the servo, I’d ideally use the full range of servo rotation (say 180 degrees) for the 30mm of cable travel. This would mean a minimum diameter of approximately 20mm for the pulley (giving a 63mm circumference).

However, I think the standard cable will kink/deform if bent this tightly, which leaves me three options; (1) Increase the size of the pulley, with a trade-off against leverage/accuracy. (2) Add a flexible leader of some description to the cable. (3) Replace the standard cable with something more flexible.

Am a bit unsure about replacing the cable, will certainly be the tidiest and most compact option – but I’ll need to cut the original cable to get it off the resistance unit. It’s not that I’m likely to ever want to put the original handlebar controller back on, but nonetheless seems a bit permanent.

The other mechanical task will be to make up a motor bracket. Am planning to orient the motor on it’s side, so will probably just need a section of right angle aluminium, cut & drilled on one side for the servo mounting, and riveted to the base of the box on the other.

More updates soon…


Handlebar controller

The task this week has been to replace my original handlebar controller (which was bodged up from an old remote control) with something a bit tidier.


Being a one-off, any sort of custom housing was out of the question (except possibly 3D printing), so my first port of call was browsing through small plastic enclosures at Mouser & adding a couple to my last order. Here they are lined up with a Garmin 705 for scale.


enclosure2I decided to start with the enclosure next to the Garmin, (a Bud Industries HH-3641), which I drilled and fitted with some cheap & nasty panel mount push buttons from eBay. It has a bit of a stealth look at the moment, but luckily I know which buttons do what! In due course I’ll likely get a vinyl sticker printed up for the panel.

The keyfob on the left probably deserves a sidenote here; I’m not so keen on the extra wires hanging off the bars, so am planning to make a wireless version of the handlebar controller in due course. However, this feels like an unnecessary distraction and expense just now, so  will come later as an ‘optional upgrade’.

Anyway, one of the wireless chipset manufactures sells pre-built keyfobs that look identical to this (empty) enclosure, so I picked one up to check out the form factor. To be honest, although it’s probably the cheapest wireless option, I’m not convinced – I think the buttons are just a little too closely spaced for my purposes..

Bar mounting

With the enclosure finished, I turned my attention to fixing it to the bars. I toyed briefly with the idea of getting a replacement base 3D printed with an integral attachment point, but I felt this would have slowed things down too much at this point.

So instead I looked at hand forming a moulding to mate with the bars. I wanted it to be easily removable, so decided on a curved form to match the profile of the bar, held in place with an o-ring or elastic band.

While looking for some sugru (mouldable silicone), I came across some polymorph plastic on eBay, so went with a 250g bag for just over £5 delivered.


This plastic has the property of softening at around 60 degrees C, where it can be easily hand shaped, and then hardens to a nylon like finish as it cools.

poly2I put a handful of the plastic granules into a pan of hot water (at around 70 degrees) until they softened and turned transparent. They could then be fished out (they clump together naturally), and shaped into a block with a spatula. The plastic retains it’s flexibility for a good few minutes as it’s worked, but can just be re-warmed again and again until reaching the desired shape.

As a one-off, I hadn’t bothered making any sort of mould for the design, so I just shaped it by hand until I reached a result I was happy with.

Then another quick reheat and I placed it onto the enclosure, where it stuck like glue as it cooled. Not a straight line in sight, but am pretty happy with the results.


And finally, fitted to the bike. The plastic was quite slippery against the bar, so I used a strip of tape on the underside to stop it twisting with button presses.



With some working buttons once again, I was able to fix up some outstanding firmware bugs and test the new offline / manual mode that allows for resistance control from the bar controller when not being actively controlled from the PC..

Next week, it’s the turn of the motor and electronics to get moved into a new enclosure.


Not much progress to report this week. I’ve just built up the last circuit a little more permanently onto some stripboard, and added a heatsink to the linear regulator.


The eagle-eyed among you may notice the heatsink is attached with a nylon bolt – but don’t worry, was just to get it mounted for the photo!

Next post

Am hoping to get some enclosures ordered up in the next day or so, and start tidying up the build. Starting with the bit-too-budget handlebar controller… ;)