Archive for August, 2010
Peugeot Speedfight 2
I have just bought a 2002 Peugeot Speedfight 2 air-cooled 50cc 2 stroke moped. It’s currently a non-runner and it was being sold for spares, so I got it for a very low price: £30. I plan to bring the bike back to a roadworthy standard and write about it as I go along. I will record all work that I do on it and all money that I spend on it. If it doesn’t go well for any reason, then perhaps it will dissuade others from trying this kind of thing.
The bike was easy to collect, because it was bought from a chap who only lives about 1 mile away from me, and because I’m looking after my dad’s trailer for now, which came in handy. I took ownership of the bike at about 8pm on Monday 23rd August 2010. It didn’t look too pretty, the transmission cover was off, most of the panels were off, the petrol tank was loose, the carb was hanging by it’s fuel and throttle lines, the steering creaked, the entire exhaust and mounting points for it were missing, etc. The rear brake cable had also been jammed between the transmission and the rear wheel, so it had to be carried onto the trailer. This bike has been off road for around 3 years, so there is a reasonable amount of rust on the single front fork and the underneath around the frame and centre stand. I think all of it is minor though, and it’s coming off quite readily just brushing it off by hand.
The bike had been owned by a young chap that presumably didn’t know a lot about looking after mechanical things, he’d tried taking this one to bits to fix something (who knows what?), presumably not been able to fix it and then left it disassembled. Although, I saw that he’d got himself a new moped that was almost the same, which is a good sign, apparently even if one goes wrong, it’s worth getting another one!
I managed to turn the engine over by hand, which shows that the engine wasn’t seized, and luckily there was reasonable compression for a 50cc bike. This is the main factor for me, I really don’t want to have to get barrels reworked, or buy new piston/bore kits if I don’t have to. The goal here is not for this to be a money sink, it’s to learn a bit more about the practical side of mechanics, and to get a broken bike recycled and made into a working bike as cheaply as possible. I paid £30 for this bike, and I have seen decent bikes of the same age sell for £500 or so.
I spent about 3/4 of a day on it yesterday (24th Aug 2010), and got the following done:
- Remove cable from between rear wheel and transmission, loosen back brake, find cable is seriously gummed or rusted up, but salvageable.
- Clean, re-grease and reassemble kickstart and electric start mechanisms
- Bang dust out of centrifugal clutch, while it was exposed
- Check battery electrolyte levels, clean terminals and charge (it had 1V of power to start with)
- Check operation of vacuum petrol tap, condition of vacuum hose (good)
- Quick clean of carburettor jets and reattach carb (pilot jet was blocked, float boal full of grit and grime)
- Drain fuel from tank and float bowl, and replace with fresh 95 RON unleaded (correct for this bike).
- Remove broken exhaust flange (noticed 1 stud missing, and a tiny part of the exhaust mounting surround is broken away, but it should still make a good seal with a new gasket and replacing the missing stud).
- Remove remaining rear end bodywork (cracked and scuffed and will need fibreglass repair)
- Pump up flat rear tyre (this will determine if there’s a puncture or not)
- Clean and set gap on spark plug
- Apply WD-40 to the lock mechanisms until they work
- Test operation of the starter motor circuit including starter button, ignition, starter relay (works)
- Test operation of the starter motor (doesn’t work -but it’s dismantleable, and there’s a kickstart for now, anyway).
- Tested operation of immobiliser aerial/unit
- Tested other electrical items all the following worked: starter switch and relay, ignition switch, immobiliser, immobiliser aerial, and warning LED, fuel level sender and gauge, horn + horn switch, turn signal relay, front turn signals, oil level LED
- Tested headlights (didn’t work, but they may only work when the engine is running).
- Check condition of reed valves (reeds didn’t lie flat, even when turned over, because the block facing isn’t flat, I’ve ordered a new one: £10.98 including delivery)
Luckily, I found a manual online showing the wiring diagram for the bike (I couldn’t get a spark to start with, which prompted the electrical testing), I’ve been cleaning connections and battery terminals as I look at them, and after doing this for a while, I managed to get a reliable, strong spark.
The importing testing went as follows:
- Tested compression (8.5 bar or 120 PSI roughly, no major problems there).
- Tested spark: Strong, reliable spark
- Tested starting: No luck. I couldn’t tell to begin with whether it was a mix of 2-stroke oil and fuel getting on the plug, but now I think it’s just oil. There are a few other reasons that the bike would be hard to start and run: No back pressure exists from exhaust, also not a great seal from the poor reed valve block. The main reason though is that there is probably no fuel coming through the carb.
Clearly next job is a proper clean of the carb. Also, I need to replace the exhaust and reed valve block. The exhaust is ordered now too: £33.99 including delivery, but it will be a week or more before I get it.
Here is a final list for this post, it shows current costs so far. I’m recording everything here apart from ordinary consumables (just fuel and oil so far). All prices include delivery.
- Bike £30
- Manual £7.49
- 2nd hand exhaust £33.99
- Reed valve block £10.98
Total spend: £82.46
Pics and more to follow in the next day or two.
Replace Font difficulties
The Replace Font extension was updated a few days ago. The main new feature is an improved interface. There are three tabs now, and whichever one is open determines the action to be performed, so I’m both using the notebook control a visual tool, and abusing it as a fake optiongroup. The three modes now offered are: Find and Replace font, Replace font and List all fonts. There is also now a dropdown option below offering to work on the entire drawing or just the selected items only. The code has been made much cleaner, and is now commented too.
Back to the difficulties I’m having though though; replacing fonts is a slightly more complicated task than I’d realised. The nesting of various text elements (e.g. text and tspan elements), and the two different ways of applying styles to these text-ish elements makes it difficult to know how many replacements are being made. Of course it’s easy to just count all replacements, but the number of text styles that needed to be replaced will be possibly more than twice the number of actual elements affected. Here’s a concrete example, because I don’t quite believe in the explanation I just wrote:
- Open inkscape 0.47 on Ubuntu 10.10 Alpha 3
- Click anywhere with the text tool and type in: Hello<press return>World.
- Press Ctrl-A, change the font to Bitstream Charter.
If you do this simple sequence of steps, you will probably (and understandably) think that you have made a single text element. If you are the skeptical kind (like me), you might even think that you had made two text elements. You’ve actually made three. There are two tspan elements nested inside a text element.
So, you may now thinking, well, just count the one parent element then and style the two inner elements. But all three are style-able. And all three are style-able in two different ways. I haven’t found any documentation to explain inheritance or precedence of styles between the different elements, or between the two (potentially) conflicting style attributes themselves, one of which is unique to inkscape, and doesn’t appear anywhere in the SVG spec. The two style attributes are ” font-family” and “-inkscape-font-specification”, and they can both apply to parents and children.
We now have potentially six font styles to replace for two lines of text from one click of the text tool. It just so happens (for me) that inkscape sets the font styles in the following ways: The text element has just a font-family, and the tspans have both the -inkscape-font-specification and the font-family. So there are five to deal with, but of course it’s the potential number that matters to my code. I believe that my tool does replace all five (or six) correctly, but you can see it’s quite difficult to usefully send a message to the user such as “Replaced that font in X places”, for now, users will have to live with “Replaced all instances of that font successfully” or similar.
Note: I realise 0.48 has just come out, and there are internal improvements to text handling, but I haven’t had a chance to look at these yet. Also – I know I could probably nag the inkscape-devel list and ask for some guidelines about the different style attributes, and rules about applying them to the elements, but again haven’t yet had a chance.
News about my my inkscape extensions
Both extensions I’m developing have been given their own google code page: Guillotine and Replace Font. I will use those as a place to keep the code and downloads organised, and I will continue to use this blog as a way of verbally introducing the new features/updates. The second big piece of news (big for me), is that the guillotine extension has been accepted into the inkscape trunk, so next time there’s an Inkscape release, you’ll be running a tiny bit of my code!
Replace Font inkscape extension
Here’s another simple inkscape extension quickly following the previous one. It was inspired by someone on #inkscape wanting a way to replace fonts drawing-wide without it affecting the other styling on the text elements, such as boldface and italics.
It’s probably very rough and ready at the moment, but it should be useful. I plan to change the way the actual font is replaced, because it’s conceivable that it could break as is, but I haven’t had it do so.
Leave me some feedback if you have any problems. Once it’s had a fair bit of testing, I might try to get this one entered into the inkscape repository too.
So – here’s how you use it:
- Download the latest replace_font version and unzip it into your inkscape extensions directory
- Open your drawing in inkscape, preferably one that has some text elements, of course.
- Select Text->Replace Font from the Extensions menu
- Enter the font name that you want to find, e.g. Calibri or Times New Roman
- Enter the font name that you’d like to replace it with, e.g. Sans or Helvetica
- Press Apply
Enjoy!
Edit:
There were a few bug in this extension, as pointed out by su-v from #inkscape:
- Not all fonts were being replaced, because sometimes the font styling was attached to a text element, not a tspan.
- tspan elements without style attributes were causing the extension to crash
- Some fonts (such as Arial Narrow) were being incorrectly (partially) replaced by searches such as “Arial”.
- Fonts in flowed text regions weren’t being replaced at all.
The link above in the original instructions has been updated to point to a new zip file including a fixed version of the extension, along with a couple of new features. Please let me know if you run into any other bugs!
Guillotine inkscape extension
Well – this is my first inkscape extension, it’s a direct copy of the GIMP extension of the same name (under Image->Transform). It is designed to take an image that has had some guides dragged onto it, then slice it up into the rectangles that are formed by those guides. It should ignore guides that lie outside the canvas area, and it should ignore angled guides.
I’m sure it will need more work if and when more people start testing it, but it should be usable as is. Please give it a try and feel free to leave any feedback.
It would be nice to one day see it as part of inkscape proper, but I don’t know the process involved (or if there’s even any demand for this extension – there are similar but slightly different extensions floating around).
So – here’s how you use it:
- Download the latest guillotine version, and unzip it into your inkscape extensions directory
- Open your drawing in inkscape.
- Drag some vertical and horizontal guides onto your drawing
- Select Export->Guillotine from the Inkscape menu
- Enter a directory name and image base name for output (e.g. output will become output1.png, output2.png, etc.)
- (optional) If you’ve previously exported the drawing, you can tick the box to use export hints as the output values.
- Press Apply
Enjoy!