{"id":619,"date":"2024-09-02T19:15:50","date_gmt":"2024-09-02T19:15:50","guid":{"rendered":"https:\/\/akaflieg.nl\/?p=619"},"modified":"2024-09-02T19:35:59","modified_gmt":"2024-09-02T19:35:59","slug":"hobbes-a-summary","status":"publish","type":"post","link":"https:\/\/akaflieg.nl\/index.php\/2024\/09\/02\/hobbes-a-summary\/","title":{"rendered":"Hobbes: A technical summary"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">In January of 2024 I decided to build an audio angle of attack instrument. This page attempts to summarize the most important aspects. This will mainly consist of technical details, for those interested. The full story is here: <a href=\"https:\/\/akaflieg.nl\/index.php\/tag\/hobbes\/\">https:\/\/akaflieg.nl\/index.php\/tag\/hobbes\/<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Inspiration<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The inspiration consisted of a couple of things. First was the existing audio of attack meter present in the F4 Phantom:<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Hard Wing Phantom Stall\" width=\"525\" height=\"295\" src=\"https:\/\/www.youtube.com\/embed\/H81AcnZeaMQ?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><figcaption class=\"wp-element-caption\">An impression of the F4 Phantom&#8217;s audio angle of attack indication<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Another inspiration was a previous job, where we made products with <strong>haptic feedback<\/strong>. I drove a car where the navigation system consisted of vibration motors in the driver&#8217;s seat. This was very relaxing. I later learnt that haptic feedback is processed in an old part of the brain. This reduces the mental energy required to process it, but also reduces response times. I saw this in patients who learn to walk with an artificial balance organ within 30 minutes of wearing it. <strong>Lesson learnt: how you convey information is very important.<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Development<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">For development, I wanted to experiment with <a href=\"https:\/\/saat-network.ch\/product\/extreme-manufacturing-explained\/\">eXtreme Manufacturing<\/a>. Since I had never designed PCBAs or even done anything serious with breadboards, I chose an iterative way of working to learn quickly. I ordered a new PCBA every two weeks from <a href=\"https:\/\/jlcpcb.com\/\">JLCPCB<\/a>. Those took a week to arrive, making feedback rather quick. I asked coworkers for help when Google wasn&#8217;t enough. For PCBA design I used <a href=\"https:\/\/easyeda.com\/editor\">EasyEDA<\/a>, which already contains footprints of parts that JLCPCB can place.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For CAD, I first used EasyEDA too. Later I switched to <a href=\"https:\/\/openscad.org\/\">OpenSCAD<\/a>, mainly because of it&#8217;s ability to be scripted easily. I eventually implemented <a href=\"https:\/\/akaflieg.nl\/index.php\/2024\/05\/15\/project-hobbes-part-9-foundation\/\">Test Driven Development for CAD<\/a> by checking for collisions between parts.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For the software, I used an existing codebase I had in C++20. Some things that were central to my codebase were:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A <strong>templated class<\/strong> <strong>encapsulating any SI-unit possible<\/strong>, which automatically handles things like addition and multiplication too. This allowed for the compiler&#8217;s type checker to look if things look sane in my physics calculations.<\/li>\n\n\n\n<li>Following the <a href=\"https:\/\/wiki.c2.com\/?LetItCrash\">Erlang<\/a> <strong>&#8220;let it crash&#8221;<\/strong> philosophy, I split my program into communicating processes. Each process can crash (for foreseen or unforeseen reasons) and will be restarted quickly. This makes surviving transient bugs easier, and speeds up development in the face of those. It also makes the code more focused in the &#8220;happy path&#8221; instead of being littered with error handling.<\/li>\n\n\n\n<li>I heavily used <strong>Test Driven Development <\/strong>and <strong>CI\/CD<\/strong> to increase confidence in the code.<\/li>\n\n\n\n<li><strong>I didn&#8217;t optimize<\/strong> anything until needed. Implementations were kept as simple as possible.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Estimating AoA<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Very early on in the project, I realised that measuring AoA is <em>hard<\/em>. Especially if you have never seen the gliders you&#8217;re going to measure it on.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Therefore I chose to <strong>estimate AoA by estimating C_L<\/strong>. And since I&#8217;m only interested in the glider&#8217;s approach to C_Lmax, I can even leave out more terms. I was left with: <strong>N \/ IAS^2<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Since I can&#8217;t predict C_Lmax, <strong>the pilot has to calibrate the system by pressing a PushButton while stalling the glider<\/strong>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Feedback<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">For feedback I used a <strong>Passive Piezo Buzzer<\/strong>. This generated 80dB of sound at it&#8217;s resonant frequency of 2700Hz. I used tiny beeps, inspired by a Geiger Counter, to indicate the approach to stall. I deliberately chose <strong>not just to beep at the stall<\/strong>, but to give near-continuous feedback to <strong>generate a sense of situational awareness<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">An exponential curve to translate the (normalized) C_L value into a beeping frequency was derived, such that:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>It beeps at 20Hz at the actual stall.<\/li>\n\n\n\n<li>It beeps at roughly 1Hz at circuit and landing speeds.<\/li>\n\n\n\n<li>It still beeps, but much slower at higher speeds. <\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Hardware<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Following the eXtreme Manufacturing principle &#8220;Optimize for change&#8221;, I chose the <strong>Raspberry Pi Zero 2W<\/strong> as the computing platform for the project. I tuned the Pi down to <strong>0.7 Watt<\/strong> power consumption and optimized for SD-card longevity. I used the Pi&#8217;s WiFi to upgrade software easily, by installing a Debian package that was generated by the CI\/CD pipeline.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"https:\/\/akaflieg.nl\/wp-content\/uploads\/2024\/05\/20240531_092250-1024x768.jpg\" alt=\"\" class=\"wp-image-427\" srcset=\"https:\/\/akaflieg.nl\/wp-content\/uploads\/2024\/05\/20240531_092250-1024x768.jpg 1024w, https:\/\/akaflieg.nl\/wp-content\/uploads\/2024\/05\/20240531_092250-300x225.jpg 300w, https:\/\/akaflieg.nl\/wp-content\/uploads\/2024\/05\/20240531_092250-768x576.jpg 768w, https:\/\/akaflieg.nl\/wp-content\/uploads\/2024\/05\/20240531_092250-1536x1152.jpg 1536w, https:\/\/akaflieg.nl\/wp-content\/uploads\/2024\/05\/20240531_092250-2048x1536.jpg 2048w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption class=\"wp-element-caption\">The LXNAV Input PCBA.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Since multiple input sources were available, I <strong>split my PCBA into two pieces<\/strong>: one for input and one for output. There existed an <strong>LXNAV<\/strong> input PCBA, which received <strong>5V and 3.3V TTL<\/strong> UART. The <strong>IGC<\/strong> version received <strong>12V and RS232 signal levels<\/strong>. These two PCBAs could be exchanged within 5 minutes.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"https:\/\/akaflieg.nl\/wp-content\/uploads\/2024\/06\/20240621_095504-1024x768.jpg\" alt=\"\" class=\"wp-image-457\" srcset=\"https:\/\/akaflieg.nl\/wp-content\/uploads\/2024\/06\/20240621_095504-1024x768.jpg 1024w, https:\/\/akaflieg.nl\/wp-content\/uploads\/2024\/06\/20240621_095504-300x225.jpg 300w, https:\/\/akaflieg.nl\/wp-content\/uploads\/2024\/06\/20240621_095504-768x576.jpg 768w, https:\/\/akaflieg.nl\/wp-content\/uploads\/2024\/06\/20240621_095504-1536x1152.jpg 1536w, https:\/\/akaflieg.nl\/wp-content\/uploads\/2024\/06\/20240621_095504-2048x1536.jpg 2048w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption class=\"wp-element-caption\">The Output PCBA<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The output PCBA contained the Buzzer, the (connection for the) PushButton and an RGB-Led to indicate system status.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"https:\/\/akaflieg.nl\/wp-content\/uploads\/2024\/07\/20240724_085421-1024x768.jpg\" alt=\"\" class=\"wp-image-501\" srcset=\"https:\/\/akaflieg.nl\/wp-content\/uploads\/2024\/07\/20240724_085421-1024x768.jpg 1024w, https:\/\/akaflieg.nl\/wp-content\/uploads\/2024\/07\/20240724_085421-300x225.jpg 300w, https:\/\/akaflieg.nl\/wp-content\/uploads\/2024\/07\/20240724_085421-768x576.jpg 768w, https:\/\/akaflieg.nl\/wp-content\/uploads\/2024\/07\/20240724_085421-1536x1152.jpg 1536w, https:\/\/akaflieg.nl\/wp-content\/uploads\/2024\/07\/20240724_085421-2048x1536.jpg 2048w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">PCBAs were stacked using long header pins and a set of push-through female headers on top of the PCBAs.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"949\" src=\"https:\/\/akaflieg.nl\/wp-content\/uploads\/2024\/07\/20240717_192121-1-1024x949.jpg\" alt=\"\" class=\"wp-image-516\" srcset=\"https:\/\/akaflieg.nl\/wp-content\/uploads\/2024\/07\/20240717_192121-1-1024x949.jpg 1024w, https:\/\/akaflieg.nl\/wp-content\/uploads\/2024\/07\/20240717_192121-1-300x278.jpg 300w, https:\/\/akaflieg.nl\/wp-content\/uploads\/2024\/07\/20240717_192121-1-768x712.jpg 768w, https:\/\/akaflieg.nl\/wp-content\/uploads\/2024\/07\/20240717_192121-1-1536x1424.jpg 1536w, https:\/\/akaflieg.nl\/wp-content\/uploads\/2024\/07\/20240717_192121-1-2048x1898.jpg 2048w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The <strong>PushButton<\/strong> was executed as a <strong>membrane button<\/strong> on a small 3D-printed<strong> adapter<\/strong> bracket. It was secured with a velcrow strap to the flight stick. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Results<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">It worked pretty well! Here is a demo of a base-to-final turn<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Audio Angle of Attack indicator, DG-1001S Neo 17.2m, simulated student error\" width=\"525\" height=\"295\" src=\"https:\/\/www.youtube.com\/embed\/DEI8vgY6NHw?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">And here is a 10 degrees skidded stall:<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Hobbes Audio Angle of Attack Skidded Stall\" width=\"525\" height=\"295\" src=\"https:\/\/www.youtube.com\/embed\/0OUQRnjIRxQ?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>In January of 2024 I decided to build an audio angle of attack instrument. This page attempts to summarize the most important aspects. This will mainly consist of technical details, for those interested. The full story is here: https:\/\/akaflieg.nl\/index.php\/tag\/hobbes\/ Inspiration The inspiration consisted of a couple of things. First was the existing audio of attack &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/akaflieg.nl\/index.php\/2024\/09\/02\/hobbes-a-summary\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Hobbes: A technical summary&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":568,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[1],"tags":[5],"class_list":["post-619","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-hobbes"],"jetpack_featured_media_url":"https:\/\/akaflieg.nl\/wp-content\/uploads\/2024\/08\/20240815_162133-1-scaled.jpg","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/akaflieg.nl\/index.php\/wp-json\/wp\/v2\/posts\/619","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/akaflieg.nl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/akaflieg.nl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/akaflieg.nl\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/akaflieg.nl\/index.php\/wp-json\/wp\/v2\/comments?post=619"}],"version-history":[{"count":6,"href":"https:\/\/akaflieg.nl\/index.php\/wp-json\/wp\/v2\/posts\/619\/revisions"}],"predecessor-version":[{"id":626,"href":"https:\/\/akaflieg.nl\/index.php\/wp-json\/wp\/v2\/posts\/619\/revisions\/626"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/akaflieg.nl\/index.php\/wp-json\/wp\/v2\/media\/568"}],"wp:attachment":[{"href":"https:\/\/akaflieg.nl\/index.php\/wp-json\/wp\/v2\/media?parent=619"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/akaflieg.nl\/index.php\/wp-json\/wp\/v2\/categories?post=619"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/akaflieg.nl\/index.php\/wp-json\/wp\/v2\/tags?post=619"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}