Tech debt. Small victories.
This post is not about software engineering, though you’ll see the overlap.
One of my long-time hobbies is working on motorcycles. I love software engineering, but sometimes I just want to get out to clear my head and interact with the physical world. Motorcycles are great for both.
When I started taking my younger son to training I quickly realised that the big bike is way too big for city riding (we’re talking about London, UK) and the smaller bike is just not suitable for two up with all the training gear. I had a think and sold the small bike in exchange for a large(ish) scooter.
This was working fine for over a year but as the kid was growing, the scooter started to show its limitations. I made some changes to better handle our weight: different CVT springs and ramp plate for better acceleration and pick-up. Also, I figured I could fit a larger rear tire. The original 140/60-R13 is a tad small for the scooter. The load index of ~240kg and the height of the tire result in some unwanted behaviour: first, the tire pressure has to be relatively high for our combined weight; second, when cornering we scraped the fairing way too often. The solution is simple: get a larger tire. 150/70-R13 that I can fit. Clearances are perfect, load index is ~265kg, bike rides higher so less scraping of the fairing in corners. Good solution to my problem, but something else I didn’t think about came up.
As the circumference of the tire is about 8% larger than the original, the ABS started to behave badly. First, it is too sensitive and takes away the brake pressure more eagerly and for longer. Not dangerous, but not the best. Also, over 45 miles per hour, the ABS turns itself off. Again, not a tragedy but annoying when out of the city.
A few months back I sat down and had a think about the problem and the solution. Long story short: the rear wheel reads 8% lower speed/frequency compared to what is expected by the ABS controller. Basically, this system uses a metal ring with slots, which travels in front of a hall sensor. The slots are turned into pulses and the signals from the front and rear are used for a number of things:
- measure speed for us humans to read;
- measure frequency for the ABS to act upon;
- count rotations for the ABS to compare wheel speed between front and rear.
Once we understand this, the solution is relatively simple.
- Option 1: bigger front tire. This brings the wheel speed difference to about 4%, which is close, but I wanted to be closer. Also, larger tire raises the front, which changes the geometry that I didn’t want.
- Option 2: different ABS ring. The original rings have 50 slots so either I can “slow” down the front to match the rear or “speed up” the rear to match the front.
Option 1 is simple, but solves only half of the problem and introduces a few more in the bike’s handling. Option 2 is better, but involves manufacturing.
That said, I reasoned that if I slow down the front, I can return closer to the original setup and cure the bike’s condition where it reads higher speed than the actual by about 17%. It is in line with industry standards, but I don’t like having to mentally calculate the actual speed.
So, slowing down the front is the way to go. I made my calculations in multiple ways and the answer is to have an ABS ring with 46 slots instead of 50. This is exactly an 8% reduction in the wheel speed reading to match the change in the rear. As a planned side effect, this reduces the displayed speed by approximately 16%.
But how to go about this in practice? The ABS ring is a simple sheet of metal, but cutting out the slots is fiddly. I have a can-do attitude to life, but doing it takes ages and is not really precise. Ideally, you use a laser cutting service to send a drawing and get back the freshly cut disc to install on the bike. The problem is that I never created a CAD drawing like that. So I left this unresolved for a few months and used the bike as is.
Regardless, the whole thing bothered me and one weekend morning, I decided to remove the ABS ring. I took pictures and measurements and fed the whole thing to the LLM. First, we went through the calculations and the options to verify my thinking. As in: I know that I’m right, but I wanted the LLM to play along and come to the same conclusion. We also discussed how ABS units work to make sure I’m on the right track. The bigger issue was the drawing. Typically the shops that offer laser cutting service need a CAD drawing to work from. I’ve tried some with words along the lines of “Here is a picture, can you make the same but with 46 slots please?”. As expected, all came back with the answer of “We’re happy to make the piece for you for ££, but give us a drawing”. Fair enough, they are in the business of cutting, not in drawing. 
So I took my chances and asked the LLM to “create a drawing from the picture of the ABS ring, but do 46 slots instead of 50; the measurements are as follows …”. The LLM came back with the answer. I scrambled for a tool that can display the result; loaded the drawing and all is well(ish). It took the better part of 2-3 hours of rounds to have the simplest possible drawing without layers and unpleasant things, but then I had what I wanted. 
I sent the drawing to a shop, picked up my piece two days later, installed, tested, happy? Not.
As it turned out, material matters. I was aware of this, but not in detail, and details matter: if we’re talking about stainless steel, we have two big groups. Martensitic and non-martensitic. The second has really good resistance to corrosion, but it is not magnetic which makes it useless for this application. The former is not as resistant to corrosion, but is magnetic and can trigger the hall sensor. The LLM said not a word about these two options; the shop went for the best corrosion resistance material and I ended up with a useless piece.
Good thing is that once instructed, the LLM can spell out your options which I relayed to the shop and they did another piece. So this is what we ended up with: 
Installed, tested, living happily ever since.