<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://blog.tfd.co.uk/feed.xml" rel="self" type="application/atom+xml" /><link href="https://blog.tfd.co.uk/" rel="alternate" type="text/html" /><updated>2026-06-10T19:03:18+00:00</updated><id>https://blog.tfd.co.uk/feed.xml</id><title type="html">TFD Blog</title><subtitle>TFD Blog and pages.</subtitle><author><name>Ian</name></author><entry><title type="html">Why does everyone moan about Volvo Pentas overheating….</title><link href="https://blog.tfd.co.uk/core,/thought/2026/06/03/volvo-penta-overheat.html" rel="alternate" type="text/html" title="Why does everyone moan about Volvo Pentas overheating…." /><published>2026-06-03T07:27:39+00:00</published><updated>2026-06-03T07:27:39+00:00</updated><id>https://blog.tfd.co.uk/core,/thought/2026/06/03/volvo-penta-overheat</id><content type="html" xml:base="https://blog.tfd.co.uk/core,/thought/2026/06/03/volvo-penta-overheat.html"><![CDATA[<p>There are a lot of posts about Volvo Penta raw water pumps failing, causing engines to overheat, in forums. Seems to me far more than any other engine. I have a Volvo Penta D2-40, now about 9 years old, in perfect condition. Serviced regularly an inspected frequently. By myself, its my boat and if its not done right I suffer the consequences. Service mechanics don’t as I found out on the first service. Leaks everywhere after that first service.</p>

<p>In the past 9 years I have had one near overheat, and one overheat, last weekend. Both times due to an otherwise good impeller failing to self prime. Why, and why should it need to ? The boat sails at &gt; 10kn in moderate winds, its a Pogo1250, and at that speed, even the slightest air past the impeller will eventually suck the water out of the pump. It should self prime, but what no one tells you is if these rubber impellers, even the special MC97 impellers, run dry for more than a few seconds, they overheat and fail. Fair enough, don’t run them dry, but why are there so many posts about the small Volvo Penta engines having raw water failures. I suspect its by design and by instruction.</p>

<h1 id="installation-instructions">Installation instructions</h1>

<p>The installation instructions for the D2 series of engines explicitly state the water strainer must be 100 to 400mm above the water line. Other engine manufacturers, eg Yanmar, give no such guidance and have diagrams with the whole intake pipe and strainer to the pump being below the water line. Above the water line means the pump will start dry and run dry if any water has been pulled back due to pressure differences. Speed, waves, anything can act like a pump.</p>

<h1 id="impeller-installations">Impeller installations</h1>

<p>Ever official impeller comes with glycerine to lubricate the impeller. Use it, and do not use any oil (not even olive oil) or hydrocarbon lubricant. Neoprene (and probably MC97) is will be damaged by anything not water based. Why use it ? If you don’t the impeller will run dry and be damaged on first start, due to that water strainer installed by the boat manufacturer well above the water line.</p>

<h1 id="warnings">Warnings</h1>

<p>I would not mind if the engine warned me there was no water. If the exhaust is above the water line, with no water it sounds like a tractor, but by then its too late. Impeller has over heated, cracked, and is probably leaking air even if I stop, re-prime, and restart.</p>

<p>I could open the engine bay before starting every time to make sure water is present both sides of the pump through the clear hoses…. but I don’t.</p>

<p>Back to Yanmar… they have a raw water float sensor on the inlet to the heat exchange. If the flow drops for any reason, that triggers an alarm. Very sensible. Why not Volvo Penta. I asked Google and was told that “Volvo Penta believes that its better to warn owners using temperature sensors”. Well isn’t that nice, no one at VP ever looked at the temperature curve of an over heating engine. By the time the exhaust temperature triggers an alarm its too late the engine is already over 100C and also firing an alarm and the impeller is destroyed.</p>

<p>These 3 tell me this is by design. Designed to support the service network. Designed to fail using parts with a short service life and catastrophic failure modes.</p>

<h1 id="how-to-fix">How to fix</h1>

<p>Last overheat I had happened in one of the largest container ports in Europe. I had to sail to a safe anchorage, solo at the time, under jib only as I had already dropped the main. I draw 3m so can’t track over the shallows. The one before I had to sail into the Ramsgate Marina to berth on an outer pontoon through a narrow, shallow channel. With crew that time. Both times the impeller was inspected the weeks before.</p>

<h2 id="fix-1">Fix 1</h2>

<p>Lower the water strainer so that the strainer fills with water and floods the pump at all times. Yes, there is a risk of flooding the boat if the inlet pipe and strainer get damaged, but I have eyes and don’t let leaks drip for long. (almost no bilge on a Pogo1250).</p>

<p><strong>Update</strong>: This does not work, the F4B pump is above the waterline and so does not self prime. The loop of water in the pump provideds water to prime the pump and pull water in from the sea, however the pump seal must be perfect for this to work reliably.</p>

<p>Rasing the inlet of the water into the strainer does increase the volume of water available, but the anti siphon valve must also be raised to ensure that the it still works and water doesnt siphon into the exhaust system. Carefull alignment is required for this to work.</p>

<h2 id="fix-2">Fix 2</h2>

<p>Fit a capacitive water level sensor (XKC-Y25-V) on the outside of the air admittance valve to sense and turn off an alarm when there is water present at the highest point. I might also add one just above the pump so that it alarms if the pump is dry stopping the engine from being started, but Fix 1 should address that.</p>

<p><strong>Update</strong>: This does not work. The XKC-Y25-V is inconsistent sensing wet scum on the inside of the pipe, wire in the pipe and generally being an unrelable alarm mechanism.</p>

<p>Investigating a temperature diserpation sensor, see https://github.com/ieb/FlowSensor which simulations indicate can sense air, still water and flow rates with minimal flow restriction.</p>

<h2 id="fix-3">Fix 3</h2>

<p>Not sure I will do this, but who decided that a rubber impeller pump was a good idea. They don’t self prime reliably. They over heat and they fail silently when they do waiting to cause an overheat. Perhaps a centrifugal pump, with almost no wearing parts below the water line, self primed by the sea would be a better approach.</p>

<p><strong>Update</strong>: Cant self prime due to the pump being above the waterline. Centrfugal pumps are used on large vessles where the pump is guarenteed to be under water all the time, but not yachts.</p>

<p>The other posts I see a lot are “I never want to have another sailing boat with a Volvo Penta engine in it”. I’ve had 2 in 2 boats. Neither my choice. Marinisation on the MD21-B (Peugeot 504 core engine) was a joke. I changed the first one for a VW Marine engine which was wonderfully engineered, based on the super reliable 1.9D VW Golf core engine, with real engineering care on the marinisation. Almost no metal parts in contact with sea water. O-ring seals everywhere, including the impeller cover. Same capacity as the D2-40. Impeller never failed, was several sizes larger than the puny one in a D2-40 and pumped at 2x the rate.</p>

<p>Don’t get me wrong. The build quality on a Pogo1250 is fantastic and the engine installation is also good but this builders cant fix misguided engine installation instructions, and a arrogant attitude to predicting failures. Temperature sensors are too late.</p>]]></content><author><name>Ian</name></author><category term="Core," /><category term="Thought" /><summary type="html"><![CDATA[There are a lot of posts about Volvo Penta raw water pumps failing, causing engines to overheat, in forums. Seems to me far more than any other engine. I have a Volvo Penta D2-40, now about 9 years old, in perfect condition. Serviced regularly an inspected frequently. By myself, its my boat and if its not done right I suffer the consequences. Service mechanics don’t as I found out on the first service. Leaks everywhere after that first service.]]></summary></entry><entry><title type="html">SPF oops</title><link href="https://blog.tfd.co.uk/core,/thought/2024/03/23/spf.html" rel="alternate" type="text/html" title="SPF oops" /><published>2024-03-23T12:23:39+00:00</published><updated>2024-03-23T12:23:39+00:00</updated><id>https://blog.tfd.co.uk/core,/thought/2024/03/23/spf</id><content type="html" xml:base="https://blog.tfd.co.uk/core,/thought/2024/03/23/spf.html"><![CDATA[<p>Looks a lot like Google has started to enforce (https://blog.google/products/gmail/gmail-security-authentication-spam-protection/) This is a graph of forwarded vs rejected email for a small domain I use CLoudFlare to forward to gmail accounts. Normally rejection rates are very low. Last week they started to rise.</p>

<p>The rejected messages typically miss SPF or DKIM header. In the case of large senders both are required. Seems like its not only catching the spammers but a lot of email lists and shopping sites are now unable to get messages or confirmation of orders through.</p>

<p>Update: Seems that CloudFlare free email routing is may not be complying perfectly with the rules Google published for mail forwarders, and its possible that since CloufFlare email routing is free…. its IP sender addresses are getting a bad reputation. Much though I liked the CloudFlare service, I’ve switched my MX records back to Google, so that I get those order confirmations once more.</p>

<p><img src="https://ik.imagekit.io/htj4bin8p/emailrejections-20240323.png" alt="Screen Shot 2017-05-03 at 08.36.01" /></p>]]></content><author><name>Ian</name></author><category term="Core," /><category term="Thought" /><summary type="html"><![CDATA[Looks a lot like Google has started to enforce (https://blog.google/products/gmail/gmail-security-authentication-spam-protection/) This is a graph of forwarded vs rejected email for a small domain I use CLoudFlare to forward to gmail accounts. Normally rejection rates are very low. Last week they started to rise.]]></summary></entry><entry><title type="html">Noise</title><link href="https://blog.tfd.co.uk/core,/thought/2024/02/07/noise.html" rel="alternate" type="text/html" title="Noise" /><published>2024-02-07T07:14:39+00:00</published><updated>2024-02-07T07:14:39+00:00</updated><id>https://blog.tfd.co.uk/core,/thought/2024/02/07/noise</id><content type="html" xml:base="https://blog.tfd.co.uk/core,/thought/2024/02/07/noise.html"><![CDATA[<p>To simulate a real behavior requires some level of randomness or noise in the signal. In my case I want to simulate the behaviour of a helm at sea. They try to steer in to a bearing but environmental factors ensure  that they wont accurately. Waves, wind, distractions, lack of sleep all play a factor. To simulate this randomness is not enough. A random number between 0 and 1.0 is completely random jumping everywhere randomly in that range. Noise is required. Noise is a continuous waveform, not discrete steps. So how to achieve it ?</p>

<p>There are plenty of descriptions of noise, but for some reason even a simple noise algorithm seems so complicated to describe. So here goes. 1D. Find a line algorithm of your choice, polynomial, bezier even linear. Choose the required number of random control points. Draw the line with those control points. Each point on the line is the 1D noise signal. Before the line ends, throw away the first control point and add a new control point to the end.  Or in 1 sentence. Fit a smooth line to a random sequence. 2D, fit a smooth surface to a random sequence. 3D, a field etc.  Perhaps I am wrong, but that seems to be the essence of a continuous noise function.</p>

<p>Now to write the code.</p>]]></content><author><name>Ian</name></author><category term="Core," /><category term="Thought" /><summary type="html"><![CDATA[To simulate a real behavior requires some level of randomness or noise in the signal. In my case I want to simulate the behaviour of a helm at sea. They try to steer in to a bearing but environmental factors ensure that they wont accurately. Waves, wind, distractions, lack of sleep all play a factor. To simulate this randomness is not enough. A random number between 0 and 1.0 is completely random jumping everywhere randomly in that range. Noise is required. Noise is a continuous waveform, not discrete steps. So how to achieve it ?]]></summary></entry><entry><title type="html">Site Moved</title><link href="https://blog.tfd.co.uk/core,/thought/2023/12/30/blog-moved.html" rel="alternate" type="text/html" title="Site Moved" /><published>2023-12-30T10:19:39+00:00</published><updated>2023-12-30T10:19:39+00:00</updated><id>https://blog.tfd.co.uk/core,/thought/2023/12/30/blog-moved</id><content type="html" xml:base="https://blog.tfd.co.uk/core,/thought/2023/12/30/blog-moved.html"><![CDATA[<p>This blog has been moved from Wordpress to Github pages, source at https://github.com/ieb/ieb.github.io. If you have comments or want to correct something please open 
a PR and I will consider it.</p>

<p>All previous content was migrated using a dump of the wordpress database and a script, (sorry forget which one it was 9 months ago), the process was painless. Images 
are optimised using https://ik.imagekit.io free tier.</p>]]></content><author><name>Ian</name></author><category term="Core," /><category term="Thought" /><summary type="html"><![CDATA[This blog has been moved from Wordpress to Github pages, source at https://github.com/ieb/ieb.github.io. If you have comments or want to correct something please open a PR and I will consider it.]]></summary></entry><entry><title type="html">Why decentralised tracing is wrong.</title><link href="https://blog.tfd.co.uk/uncategorized/2020/05/14/why-decentralised-tracing-is-wrong.html" rel="alternate" type="text/html" title="Why decentralised tracing is wrong." /><published>2020-05-14T08:29:58+00:00</published><updated>2020-05-14T08:29:58+00:00</updated><id>https://blog.tfd.co.uk/uncategorized/2020/05/14/why-decentralised-tracing-is-wrong</id><content type="html" xml:base="https://blog.tfd.co.uk/uncategorized/2020/05/14/why-decentralised-tracing-is-wrong.html"><![CDATA[<p>Let me be clear, I am not associated or working on any tracing app. I am a user. Let’s also be clear. Covid-19 is a frightening virus which has a horrible impact on some. 30% of patients dont make it out of ICU. The impact on some ethnic minorities is disproportionate. If you have a BMI over 30 your 37% more likely not to survie.</p>

<p>Our aim as a society is to eliminate it. Every tool available needed in this fight, and technology is one of those tools. I an ideal world, every person would have the latest mobile device, with the latest OS. They would always have the device turned on and operating. When they became ill they would self diagnose with 100% accuracy and honestly report to the app which would dutifully report to all contacts. The world is not ideal, its messy and imperfect. Covid-19 jumped into humans. Most people even in 1st world countries don’t have a mobile device that will run the app. (evidence, Isle of White, 80% of vulnerable people (elderly) and poorer families have old iPhones pre iOS 10. I much smaller number have Android pre 6.0). The population are not clinicians and they are scared. They will over report, misdiagnose and even in rare cases maliciously report. In Germany, the decentralised app requires evidence of a positive Covid-19 test to combat this. In Germany that combats the incorrect reports, as Germany has a surplus of testing capacity. In other countries (eg UK, probably US) health care and social care workers struggle to get tested.</p>

<p>Technology for tracing is an assistive tool, but must augmented by other techniques. Without centralised anonymised data, it is impossible to perform any of the other standard epidemiological processes that eliminate the spread of infections. Most countries have done this for years on a small scale ensuring that sexually transmitted diseases have not become pandemic.</p>

<p>When a parent, who doesn’t drop their primary school child at school becomes ill and notifies the decentralised tracing app who will tell the school. Who will tell the parent of other children in the same class at the school. Who will tell the care homes where the parent of the other children in the same class at the school that look after the 85 year old loved grandparents, none of whom anywhere in that chain had a mobile device capable of running the app notified by some decentralised method that knows nothing about humans and the messy world we live in.</p>

<p>In the centralised tracing model, the team of human tracers have access to that information and will phone the school, get the list of parent, warn them to self isolate. The few Covid-19 tests that are available will be used by the social care workers and hopefully they won’t infect the 85 year old loved grandparents.</p>

<p>In addition because we said, this is different, this isn’t about a miniscule and irrelevant risk to privacy but about the lives of my loved ones, the health organisations we believe in and trust have the data they need to protect us all. We unknowingly give far more personal tracking data to internet giants in return for being recommended 2m videos of almost no relevance. Of course Apple and Google want to force us to use the decentralised model. They don’t want their credentials for protecting privacy to be questioned. The mechanisms in use drive their business models. And they don’t care if you don’t have a phone you can’t run it on, your not a customer. Decentralised tracing only protectects wealthy Apple customers. Google is better, a 10y old Google Nexus will run the UK NHS App.</p>

<p>It reminds me of when Apple or Google (can’t remember which) developed some AI for a health feature but couldn’t understand why it was reporting health conditions monthly for just over half the population between the ages of 14 and 50, until the one woman in the meeting asked if there were any females in the set of training data. Dumb mistake. Period. Not realising the world is real is a big mistake to be making again.</p>]]></content><author><name>Ian</name></author><category term="Uncategorized" /><summary type="html"><![CDATA[Let me be clear, I am not associated or working on any tracing app. I am a user. Let’s also be clear. Covid-19 is a frightening virus which has a horrible impact on some. 30% of patients dont make it out of ICU. The impact on some ethnic minorities is disproportionate. If you have a BMI over 30 your 37% more likely not to survie.]]></summary></entry><entry><title type="html">Contact Tracing with Privacy Built in.</title><link href="https://blog.tfd.co.uk/uncategorized/2020/04/19/contact-tracing-with-privacy-built-in.html" rel="alternate" type="text/html" title="Contact Tracing with Privacy Built in." /><published>2020-04-19T10:13:51+00:00</published><updated>2020-04-19T10:13:51+00:00</updated><id>https://blog.tfd.co.uk/uncategorized/2020/04/19/contact-tracing-with-privacy-built-in</id><content type="html" xml:base="https://blog.tfd.co.uk/uncategorized/2020/04/19/contact-tracing-with-privacy-built-in.html"><![CDATA[<p>Contact tracing is a n squared or more computationally intensive operation when done centrally. It is impossible to do at scale manually, with each operation taking days. For governments to perform it centrally requires citizens give up their rights to privacy, especially when a contract tracing app is being used. And yet, it seems, most central contract tracing apps appear to want to gather all the data centrally. Given the current urgency this will not work and will require months of negotiation. I am not a Politician or a Lawyer, I am an Engineer. As an Engineer this is how I would perform contact tracing.</p>

<p>BlueTooth LE (BLE) measures the signal strength of BLE transmitters and estimates the distance. Each transmitter has a unique ID. Some information, such as make of device, can be derived from the unique ID, but the ID anonymous to the receiver unless it tries to de-anonymise it with a centralised service.</p>

<p>On 20 Feb 2020 I was flying back from Basel to Luton on an EasyJet flight. I was curious about privacy on planes and BLE, so I ran a BLE scanner to who was around me. 100s of BLE transmitters were present. Phones, lots of Apple earpods, some VR headsets but I could see no-one wearing them. The scanner reported distance from me in real time, including when the drinks trolly with its credit card device went down the aisle. Just before the flight took off, 2 Chinese males came on-onboard (the writing on the laptop was Chinese). They both wore face-masks. The younger looked exhausted and slept all the way to London. They were clearly alert to coming into contact with anyone. They sat in their own row and asked someone to move a coat without touching it.</p>

<p>Provided a the BLE UIDs are not stored centrally or parsed they do not create privacy issues. An app for contract tracing would collect all UIDs it sees and record the time period spent under a certain distance and for how long. It would store this data on the phone and never allow it to leave the phone. It might also hash the UID internally before storing it. It would never send any of the data off the phone.</p>

<p>When someone becomes ill, they open the app and say they are ill. The app then asks for permission to send only their ID to a central server. Provided they agree, their BLE UID is sent to the server. The server stores that UID in a list and other apps on other phones download the list.</p>

<p>The phone then does contract tracing. It hashes the UID with its one key and compares the hashed value against the list of hashed values stored. If it finds a match it can inform the owner of the phone.</p>

<p>The central server has a list of UIDs identifying those claiming to be COVID-19 positive (globally 75K/day limited by testing, probably more like 300K/day, see <a href="https://www.arcgis.com/apps/opsdashboard/index.html#/bda7594740fd40299423467b48e9ecf6">CSSE</a> for data). It doesn’t have any information on who that person interacted with. It doesn’t have the number, distance time or anything. The database on the phone doesnt have UIDs, only hashed versions of the UIDS. It can only check if a UID that is has been given is in the database. It can’t tell anyone which UIDs are in the database.</p>

<p>The app does require that the person who claims to be COVID-19 positive is willing to let the central server know. And this does require that the contact tracing app is allowed to capture BLE UIDs in the background, which is is currently not allowed by Apple or Google.</p>

<p>The app relies a lot on trust. Trust that it wont send the UIDs or database to a central server without the explicit permission of the owner of the phone, and to allow that UID to be broadcast to the world. It does therefore have privacy concerns but only at the point of being confirmed as a carrier. Every phone must perform the checks against its database.</p>

<p>How would it be done centrally ?</p>

<p>Centrally, the UID database on the phone would have to be stored centrally. When a confirmed case came it, every contact in that database stored centrally would be notified. This is less computationally intensive. Privacy could be maintained by encrypting the database with a key known only to the phone and released only with the consent of the user. Less broadcasting, but the same requirement to build trust in the the app.</p>

<p>BTW, the are BLE Beacons in many public spaces (shops), so an outbreak location can also be tracked with relative ease, but unless it recorded all visitors, it would not be able to notify. (at least not in the centralised model).</p>

<p>However, technology is not everything. Many infections may happen with no person present as the virus lives on hard surfaces for upto 72h. Something will be better than nothing, but won’t be perfect.</p>]]></content><author><name>Ian</name></author><category term="Uncategorized" /><summary type="html"><![CDATA[Contact tracing is a n squared or more computationally intensive operation when done centrally. It is impossible to do at scale manually, with each operation taking days. For governments to perform it centrally requires citizens give up their rights to privacy, especially when a contract tracing app is being used. And yet, it seems, most central contract tracing apps appear to want to gather all the data centrally. Given the current urgency this will not work and will require months of negotiation. I am not a Politician or a Lawyer, I am an Engineer. As an Engineer this is how I would perform contact tracing.]]></summary></entry><entry><title type="html">Fouling</title><link href="https://blog.tfd.co.uk/uncategorized/2017/05/03/fouling.html" rel="alternate" type="text/html" title="Fouling" /><published>2017-05-03T09:14:18+00:00</published><updated>2017-05-03T09:14:18+00:00</updated><id>https://blog.tfd.co.uk/uncategorized/2017/05/03/fouling</id><content type="html" xml:base="https://blog.tfd.co.uk/uncategorized/2017/05/03/fouling.html"><![CDATA[<p><img src="https://ik.imagekit.io/htj4bin8p/2017-05-screen-shot-2017-05-03-at-08-36-01.png" alt="Screen Shot 2017-05-03 at 08.36.01" /></p>

<p>Fouling for any boat, large or small eats boatspeed, fuel and satisfaction. Most boats haul out every year, pressure wash off or scrape off the marine flora and fauna that have taken up residence. Owners then repaint the hull with a toxic antifouling paint. Toxic to marine life, and unpleasant to human. In small boats the toxicity has been greatly reduced over the years, some would argue so has the effectiveness. The problem is the paint erodes and the toxins leak. High concentrations of boats lead to high concentrations of toxins.</p>

<p>For larger ships the cost of antifouling is significant. Interruption to service and the cost of a period in dry dock. Antifouling on large ships is considerably more toxic than available for the pleasure boat industry to extend the periods between maintenance to several years.</p>

<p>About 10 years ago I coated my <a href="https://hallbergrassy38forsale.wordpress.com/">boat</a> with copper particles embedded in epoxy. The exposed copper surface of the particles reacts with sea water to create a non soluble copper compound. This doesn’t leach, but like clipper ships coated in solid copper sheets discourages marine fouling. I have not painted since. Until a few years ago I did need to scrub off. I would see a few barnacles and some marine growth, but no more than would be normal with toxic paint.</p>

<p>A few years ago I added 2 ultrasonic antifouling units. These send low power ultrasonic pulses into the hull and the water. According to research performed at Singapore University, barnacle larvae use antennae to feel the surface they are about to attach to. Once attached the antenna stick to the surface and convert into the shell. Once attached, they never fall off. Ultrasound at various frequencies excites the antenna which disrupts the sensing process. The larvae swim past to attach elsewhere. There is also some evidence that ultrasound reduces algae growth. The phenomena was first discovered testing submarine sonar over 50 years ago. My uncle did submarine research in various scottish locks during the war.</p>

<p>The ultrasonic antifouling I have fitted currently was a punt. 2 low cost units from Jaycar, first published in an Australian electronics magazine, that you put together yourself. Those are driven by a 8 pin PIC driving 2 MOSFETS. I think it’s made a difference. After a year in the water I have no barnacles and a bit of soft slime. There are expensive commercial units available at more cost, but the companies selling them seem to come and go. I am not convinced enough to spend that sort of money but I am curious and prepared to design and build a unit.</p>

<p>The new unit (board above), for the new boat is a bit more sophisticated. Its a 6 channel unit controlled by an Arduino Mega with custom code, controlling a MOSFET signal generator and 6 pairs of MOSFETS. It outputs 15-150Khz at up to 60W per channel. A prototype on the bench works and has my kids running out the house (they can hear the harmonics). My ears are a little older so can’t, but still ring a bit. I won’t run it at those levels as that will likely cavitate the water and kill things as well as eat power. It remains to be seen if the production board works, I have just ordered a batch of 5 from an offshore fabrication shop.</p>]]></content><author><name>Ian</name></author><category term="Uncategorized" /><summary type="html"><![CDATA[]]></summary></entry><entry><title type="html">Metrics off Grid</title><link href="https://blog.tfd.co.uk/uncategorized/2017/04/10/metrics-off-grid.html" rel="alternate" type="text/html" title="Metrics off Grid" /><published>2017-04-10T18:24:30+00:00</published><updated>2017-04-10T18:24:30+00:00</updated><id>https://blog.tfd.co.uk/uncategorized/2017/04/10/metrics-off-grid</id><content type="html" xml:base="https://blog.tfd.co.uk/uncategorized/2017/04/10/metrics-off-grid.html"><![CDATA[<p>I sail, as many of those who have met me know. I have had the same boat for the past 25 years and I am in the process of changing it. Seeing Isador eventually sold will be a sad day as she predates even my wife. The site of our first date. My kids have grown up on her, strapped into car seats when babies, laughing at their parents soaked and at times terrified (parents that is, not the kids). see <a href="https://hallbergrassy38forsale.wordpress.com/">https://hallbergrassy38forsale.wordpress.com/</a> for info.</p>

<p>The replacement will be a new boat, something completely different. A <a href="http://www.class40.com/fr/index/">Class 40</a> hull provisioned for cruising. A <a href="http://www.finot-conq.com/en/content/pogo-1250">Pogo 1250</a>. To get the most out of the new boat and to keep within budget (or to spend more on sails) I am installing the bulk of the electronics. In the spare moments I get away from work I have been building a system over the past few months. I want get get the same sort of detailed evidence that I get at work. At work, I would expect to record 1000s of metrics in real time from 1000s of systems. A sailing boat is just as real time, except it’s off grid. No significant internet, no cloud, only a limited bank of 12v batteries for power, and a finite supply of diesel to generate electricity, in reality no 240v, but plenty of wind and solar at times. That focuses the mind and forces implementation to be efficient. The budget is measured in Amps or mA as it was for <a href="https://en.wikipedia.org/wiki/Apollo_13">Apollo 13</a>, but hopefully without the consequences.</p>

<p>Modern marine instruments communicate using a variant (NMEA2000) of a CAN Bus present in almost every car for the past 10 years, loved by car hackers. The marine variant, adds some physical standards mostly aimed at easing amatuer installation and waterproofing. The underlying protocol and electrical characteristics are the same as a standard CAN Bus. The NMEA2000 standard also adds message types or PGNs specific to the marine industry. The standard is private, available only to members, but OpenSource projects like <a href="https://github.com/canboat/canboat">CanBoat</a> on GitHub have reverse engineered most of the messages.</p>

<p>Electrically the CAN Bus is a twisted pair with a 120Ohm resistor at each end to make the pair appear like an infinite length transmission line (ie no reflections). The marine versions of the resistors or terminators come with a marine price tag, even though they often have poor tolerances. Precision 120Ohm resistors are a few pence, and once soldered and encapsulated will exceed any IP rating that could be applied to the marine versions. The Marine bus runs at 250Kb/s slower than many vehicle CAN bus implementations. Manufacturers add their own variants for instances Raymarine SeatalkNG which adds proprietary plugs, wires and connectors.</p>

<p>My new instruments are Raymarine, a few heads and sensors, a chart plotter and an Autopilot. They are basic with limited functionality. Had I added a few 0s to the instrument budget I would have gone for NKE or B&amp;G which have a “Race Processor” and sophisticated algorithms to improve the sensor quality including wind corrections for heal and mast tip velocity, except, the corrections allowed in the consumer versions are limited to a simple linear correction table. I would be really interested to see the code for those extra 0s assuming it’s not mostly on the carbon fibre box. This is where it gets interesting for me. In addition to the CanBus project on GitHub there is an excelent <a href="https://github.com/ttlappalainen/NMEA2000">NMEA2000</a> project targeting Arduino style boards in C++ and <a href="https://github.com/SignalK">SignalK</a> that runs on Linux. The NMEA2000 project running on an <a href="https://www.arduino.cc/en/Main/arduinoBoardDue">Aduino Due</a> (ARM-M3 core processor) allows read/write interfacing to the CAN Bus, converting the CAN protocol into a serial protocol that SignalK running on a <a href="https://www.raspberrypi.org/blog/raspberry-pi-zero-w-joins-family/">Pi Zero W </a>can consume. SignalK acts as a conduit to an Instance of InfuxDB which captures boat metrics in a time series database. The metrics are then viewed in Grafana in a web browser on a tablet or mobile device.</p>

<p>I mentioned power earlier. The setup runs on the Pi Zero W with a load average of below 1 the board consuming about 200mA (5V). The Arduino Due consumes around 80mA@5V most of the time. There are probably some optimisations on to IO that can be performed in InfluxDB to minimize the power consumption further. Details of setup are in <a href="https://github.com/ieb/nmea2000">https://github.com/ieb/nmea2000</a>. An example dashboard showing apparent wind and boat speed from a test dataset. This is taken from the Pi Zero W.</p>

<p><img src="https://ik.imagekit.io/htj4bin8p/2017-04-grafanaaparentwind.png" alt="GrafanaAparentWind" /></p>

<p>Remember those expensive race processors. The marketing documentation talks of multiple ARM processors. The Pi Zero W has 1 ARM and the Arduino Due has another. Programmed in C++ the Arduino has ample spare cycles to do interesting things. On sailing boats, performance is predicted by the designer and through experience presented in a polar performance plot.</p>

<p><img src="https://ik.imagekit.io/htj4bin8p/2017-04-pogo1250polar.png" alt="Pogo1250Polar" /></p>

<p>A polar plot showing expected boat speed for varying true wind angles and speeds. Its a 3D surface. Interpolating that surface of points using bilinear surface interpolation is relatively cheap on the ARM giving me real time target boat speed and real time % performance at a rate of well above 25Hz. Unfortunately the sensors do not produce data at 25Hz, but the electrical protocol is simple. Boat speed is presented as pulses at 5.5Hz per kn and wind speed as 1.045Hz per kn. Wind angle is a sine cosine pair centered on 4V with a max of 6V and a min of 2V. Converting that all that to AWA, AWS and STW is relatively simple. That data is uncorrected. Observing the Raymarine messages with simulated electrical data I found its data is also uncorrected, as the Autopilot outputs Attitude information, ignored by the wind device. I think I can do better. There are plenty of 9DOF sensors (see Sparkfun) available speaking i2c that are easy to attach to an Arduino. Easy, because SparkFun/Adafruit and others have written C++ libraries. 3D Gyro and 3D Acceleration will allow me to correct the wind instrument for wind shear, heal and mast head velocity (the mast is 18m tall, cup anemometers have non linear errors wrt angle of heel). There are several published papers detailing the nature of these errors. I should have enough spare cycles to do this at 25Hz, to clean the sensors and provide some reliable KPIs to hit while at sea.</p>

<p>A longer term projects might be teach a neural net to steer, by letting it watch how I steer, once I have mastered that. Most owners complaining their autopilots can’t steer as well as a human. Reinforcement learning in the style of Apha Go could change that. I think I heard the Vendee Globe boats got special autopilot software for a fee.</p>

<p>All of this leaves me with more budget to spend on sails, hopefully not batteries. I will only have to try and remember not to hit anything while looking at the data.</p>]]></content><author><name>Ian</name></author><category term="Uncategorized" /><summary type="html"><![CDATA[I sail, as many of those who have met me know. I have had the same boat for the past 25 years and I am in the process of changing it. Seeing Isador eventually sold will be a sad day as she predates even my wife. The site of our first date. My kids have grown up on her, strapped into car seats when babies, laughing at their parents soaked and at times terrified (parents that is, not the kids). see https://hallbergrassy38forsale.wordpress.com/ for info.]]></summary></entry><entry><title type="html">Referendums are binary so should be advisory</title><link href="https://blog.tfd.co.uk/uncategorized/2016/06/28/referendums-are-binary-so-should-be-advisory.html" rel="alternate" type="text/html" title="Referendums are binary so should be advisory" /><published>2016-06-28T20:09:18+00:00</published><updated>2016-06-28T20:09:18+00:00</updated><id>https://blog.tfd.co.uk/uncategorized/2016/06/28/referendums-are-binary-so-should-be-advisory</id><content type="html" xml:base="https://blog.tfd.co.uk/uncategorized/2016/06/28/referendums-are-binary-so-should-be-advisory.html"><![CDATA[<p>If you ask the for the solution to the multi faceted question with a binary question you will get the wrong answer with a probability of 50%. Like a quantum bit, the general population can be in any state based on the last input or observation, and so a Referendum, like the EU Referendum just held in the UK should only ever be advisory. In that Referendum there were several themes. Immigration, the economy and UK Sovereignty. The inputs the general population were given, by various politicians on both sides of the argument, were exaggerated or untrue. It was no real surprise to hear some promises retracted once the winning side had to commit to deliver on them. No £350m per week for the NHS. No free trade deal with the EU without the same rights for EU workers as before. Migration unchanged. The Economy was hit, we don’t know how much it will be hit over the coming years and we are all, globally, hoping that in spite of a shock more severe than Lehman Brothers in 2008, the central banks, have quietly taken their own experts advice and put in place sufficient plans to deal with the situation. Had the Bank of England not intervened on Friday morning, the sheer cliff the FTSE100 was falling off, would have continued to near 0. When it did, the index did an impression of a base jumper, parachute open drifting gently upwards.</p>

<p><img src="https://ik.imagekit.io/htj4bin8p/2016-06-screen-shot-2016-06-28-at-20-08-07.png" alt="Screen Shot 2016-06-28 at 20.08.07" /></p>

<p>The remaining theme is UK Sovereignty. <a href="http://www.theguardian.com/profile/geoffreyrobertson">Geoffrey Robertson QC</a> makes an interesting argument in the <a href="https://www.theguardian.com/commentisfree/2016/jun/27/stop-brexit-mp-vote-referendum-members-parliament-act-europe">Guardian Newspaper</a>, that in order to exit the EU, the UK must under its unwritten constitution vote in parliament to enact Article 50 of the Lisbon Treaty. He argues that the Referendum was always advisory. It will be interesting, given that many of those who have voted now regret their decision, if they try and abandon the last theme that caused so many to want to leave. The one remaining thing so close to their heart that they were prepared to ignore all the experts, believe the most charismatic individuals willing to tell them what they wanted to hear. UK Sovereignty, enacted by parliament by grant of the Sovereign. I watched with interest not least because the characters involved have many of the characteristics of one of the US presidential candidates.</p>

<p>If you live in the UK, and have time to read the opinion, please make your own mind up how you will ask your MP to vote on your behalf. That is democracy and sovereignty in action. Something we all hold dear.</p>]]></content><author><name>Ian</name></author><category term="Uncategorized" /><summary type="html"><![CDATA[If you ask the for the solution to the multi faceted question with a binary question you will get the wrong answer with a probability of 50%. Like a quantum bit, the general population can be in any state based on the last input or observation, and so a Referendum, like the EU Referendum just held in the UK should only ever be advisory. In that Referendum there were several themes. Immigration, the economy and UK Sovereignty. The inputs the general population were given, by various politicians on both sides of the argument, were exaggerated or untrue. It was no real surprise to hear some promises retracted once the winning side had to commit to deliver on them. No £350m per week for the NHS. No free trade deal with the EU without the same rights for EU workers as before. Migration unchanged. The Economy was hit, we don’t know how much it will be hit over the coming years and we are all, globally, hoping that in spite of a shock more severe than Lehman Brothers in 2008, the central banks, have quietly taken their own experts advice and put in place sufficient plans to deal with the situation. Had the Bank of England not intervened on Friday morning, the sheer cliff the FTSE100 was falling off, would have continued to near 0. When it did, the index did an impression of a base jumper, parachute open drifting gently upwards.]]></summary></entry><entry><title type="html">Ai in FM</title><link href="https://blog.tfd.co.uk/uncategorized/2016/02/03/ai-in-fm.html" rel="alternate" type="text/html" title="Ai in FM" /><published>2016-02-03T13:09:51+00:00</published><updated>2016-02-03T13:09:51+00:00</updated><id>https://blog.tfd.co.uk/uncategorized/2016/02/03/ai-in-fm</id><content type="html" xml:base="https://blog.tfd.co.uk/uncategorized/2016/02/03/ai-in-fm.html"><![CDATA[<p>Limited experience in either of these fields does not stop thought or research. At the risk of being corrected, from which I will learn, I’ll share those thoughts.</p>

<p>Early AI in FM was broadly expert systems. Used to advise on hedging to minimise overnight risk etc or to identify certain trends based on historical information. Like early symbolic maths programs (1980s) that revolutionised the way in which theoretical problems can be solved (transformed) without error in a fraction of the time, early AI in FM put an expert with a probability of correctness on every desk. This is not the AI I am interested in. It it only artificial in the sense it artificially encapsulates the knowledge of an expert. The intelligence is not artificially generated or acquired.</p>

<p>Machine learning covers many techniques. Supervised learning takes a set of inputs and allows the system to perform actions based on a set of policies to produce an output. Reinforcement learning <a href="https://en.wikipedia.org/wiki/Reinforcement_learning">https://en.wikipedia.org/wiki/Reinforcement_learning</a> favors the more successful policies by reinforcing the action. Good machine, bad machine. The assumption is, that the environment is stochastic. <a href="https://en.wikipedia.org/wiki/Stochastic">https://en.wikipedia.org/wiki/Stochastic</a> or unpredictable due to the influence of randomness.</p>

<p>Inputs and outputs are simple. They are a replay of the historical prices. There is no guarantee that future prices will behave in the same way as historical, but that is in the nature of a stochastic system. Reward is simple. Profit or loss. What is not simple is the machine learning policies. AFAICT, machine learning, for a stochastic system with a large amount of randomness, can’t magic the policies out of thin air. Speech has rules, Image processing also and although there is randomness, policies can be defined. At the purests level, excluding wrappers, financial markets are driven by the millions of human brains attempting to make a profit out of buying and selling the same thing without adding any value to that same thing. They are driven by emotion, fear and every aspect of human nature rationalised by economics, risk, a desire to exploit every new opportunity, and a desire to be a part of the crowd. Dominating means trading on infinitesimal margins exploiting perfect arbitrage as it the randomness exposes differences. That doesn’t mean the smaller trader can’t make money, as the smaller trader does not need to dominate, but it does mean the larger the trader becomes, the more extreme the trades have to become maintain the level of expected profits. I said excluding wrappers because they do add value, they adjust the risk for which the buyer pays a premium over the core assets. That premium allows the inventor of the wrapper to make a service profit in the belief that they can mitigate the risk. It is, when carefully chosen, a fair trade.</p>

<p>The key to machine learning is to find a successful set of policies. A model for success, or a model for the game. The game of Go has a simple model, the rules of the game. Therefore it’s possible to have a policy of, do everything. Go is a very large but ultimately bounded Markov Decision Process (MDP). <a href="https://en.wikipedia.org/wiki/Markov_decision_process">https://en.wikipedia.org/wiki/Markov_decision_process</a> Try every move. With trying every move every theoretical policy can be tested. With feedback, and iteration, input patterns can be recognised and successful outcomes can be found. Although the number of combinations is large, the problem is very large but finite. So large that classical methods are not feasible, but not infinite so that reinforcement machine learning becomes viable.</p>

<p>The MDP governing financial markets may be near infinite in size. While attempts to formalise will appear to be successful the events of 2007 have shown us that if we believe we have found finite boundaries of a MDP representing trade, +1 means we have not. Just as finite+1 is no longer finite by the original definition, infinite+1 proves what we thought was infinite is not. The nasty surprise just over the horizon.</p>]]></content><author><name>Ian</name></author><category term="Uncategorized" /><summary type="html"><![CDATA[Limited experience in either of these fields does not stop thought or research. At the risk of being corrected, from which I will learn, I’ll share those thoughts.]]></summary></entry></feed>