<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Dave Kincade on Medium]]></title>
        <description><![CDATA[Stories by Dave Kincade on Medium]]></description>
        <link>https://medium.com/@kincade?source=rss-a2984870d4d2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*-7hGP9GJFkUVQ0zlrCbHgQ.jpeg</url>
            <title>Stories by Dave Kincade on Medium</title>
            <link>https://medium.com/@kincade?source=rss-a2984870d4d2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 08:00:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kincade/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Track Beast build log: a trackball Dactyl-manuform]]></title>
            <link>https://medium.com/@kincade/track-beast-build-log-a-trackball-dactyl-manuform-19eaa0880222?source=rss-a2984870d4d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/19eaa0880222</guid>
            <category><![CDATA[diy]]></category>
            <category><![CDATA[ergonomics]]></category>
            <category><![CDATA[keyboard]]></category>
            <category><![CDATA[3d-printing]]></category>
            <category><![CDATA[computer-hardware]]></category>
            <dc:creator><![CDATA[Dave Kincade]]></dc:creator>
            <pubDate>Tue, 26 May 2020 00:30:48 GMT</pubDate>
            <atom:updated>2020-05-26T00:52:04.291Z</atom:updated>
            <content:encoded><![CDATA[<p>Here’s my build log for a 4x6 Dactyl-manuform with an integrated trackball, which I’ve named the Track Beast (since everything has to have a name, and this is sort of a beast of a device).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oaMaxPbLVWpIVhx8sOfnIQ.jpeg" /></figure><h3>Why do this?</h3><p>As a long-time Kinesis Advantage user, I’ve been quite happy with the ergonomics of a split keyboard, but I’ve been envious of the features in QMK, the versatility of different key switches, and the more optimized key layouts in the DM and broader Dactyl family. Finally, I broke down and bought a 3D printer and built my first DM mini, a gift for my partner for her birthday (and partly a gift for me, to lure her away from her gaming keyboard with unholy MX blues….) It came out quite well for a first attempt.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0PQrl3JigmWg8ml2dfHVGA.jpeg" /><figcaption>A 5x6 / 5x7 Dactyl-manuform mini (almost like an Ergodox) with V2 Zilents and DSA keycaps</figcaption></figure><p>I started planning one for myself almost immediately — identical, but perhaps as a 4x6 so I could really lean into the ergonomics of not moving my wrists, . Then my mind was blown when I saw two recent keyboards on <a href="https://www.reddit.com/r/ErgoMechKeyboards">r/ErgoMechKeyboards</a>: the <a href="https://www.reddit.com/r/ErgoMechKeyboards/comments/fqudmp/update_on_split_arcade_aka_the_dactyl_with_a/">Split Arcade</a> by <a href="https://www.reddit.com/user/sbabborello">u/sbabborello</a> and <a href="https://www.reddit.com/r/MechanicalKeyboards/comments/g3aue6/the_dactylmanuformrtrack_with_qmk_features_on_a/">Dactyl-Manuform-R-Track</a> by <a href="https://www.reddit.com/user/qqurn">u/qqurn</a>. The efficiency gain from the thumb cluster on a DM was great, but this pales in comparison to the ability to interact with a computer without moving my wrists at all. I messaged both of them to learn more. Ultimately I drew more inspiration from Qurn, and in fact my finished product looks closer than I would have expected (in the color, trackball placement, the QMK code, colemak, and even the trackball itself [which I already had]). Qurn’s gitlab fork of QMK is a huge asset to the community, since it supports multiple operational modes for the trackball and has fairly tight integration back to the keyboard… it saved me weeks over implementing this sort of thing myself.</p><p>Here’s a summary of what I built:</p><ul><li>4x6 Dactyl-manuform mini with 5 thumb keys on the left and 3 on the right</li><li>Outemu Sky Silent switches sold by <a href="https://www.reddit.com/user/hbheroinbob">u/hbheroinbob</a> with DSA Skeletor keycaps</li><li>34mm trackball on a mount pulled from Qurn’s dm-r-track STLs (which itself I believe came from Ploopy models)</li><li>Acrylic plates and LED underglow</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RMtdCYR1syyLmjurYSBQtg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ww2bMpDeY4H3Zkvx2s4nkQ.jpeg" /></figure><h3>Build log</h3><p>Here are the parts I used (listed in order of use):</p><ul><li>Hatchbox black PLA filament for the case (color doesn’t matter for this)</li><li>Outemu Sky Silent switches</li><li>A bunch of 22 AWG hookup wire — I used solid instead of stranded wire because of the number of cuts in the insulation in order for the handwiring to work</li><li>A bunch of <a href="https://www.digikey.com/product-detail/en/on-semiconductor/1N4148/1N4148FS-ND/458603">1N4148 diodes</a> (one per switch, but consider getting extras in case something… happens)</li><li>2 microcontrollers (one per side); I chose an <a href="https://keeb.io/products/elite-c-usb-c-pro-micro-replacement-arduino-compatible-atmega32u4">Elite-C</a> on the master side (right) because it has extra pins for the trackball and a more robust USB-C connection. On the left, I used more traditional <a href="https://www.aliexpress.com/item/32849563958.html?spm=a2g0s.9042311.0.0.1f734c4dmEJWHA">Pro Micro clones</a> — I buy them in packs of 10</li><li>2 <a href="https://keeb.io/products/trrs-jack-3-5mm">TRRS jacks</a>; Note: you may want to avoid TRRS altogether… see below</li><li>2 <a href="https://www.aliexpress.com/item/1058764733.html?spm=a2g0s.9042311.0.0.1f734c4dmEJWHA">buttons</a> for resetting the microcontrollers (optional, but I already had a bag of these)</li><li><a href="https://www.tindie.com/products/jkicklighter/pmw3360-motion-sensor/">PMW-3360 motion sensor</a> for the trackball</li><li>3 <a href="https://smile.amazon.com/gp/product/B07MKMN43F">steel dowels</a> for trackball bearings</li><li>3 <a href="https://smile.amazon.com/gp/product/B00ZHSQX42">roller bearings</a></li><li>Thin (1/8&quot;) acrylic sheet (for the bottom of the cases)</li><li>10<a href="https://smile.amazon.com/gp/product/B01IYWTCWW"> M3 threaded inserts</a>, and ideally 2 M2.5 threaded inserts</li><li>10 M3 and 2 M2.5 countersunk screws</li><li><a href="https://smile.amazon.com/gp/product/B07PJW6RQ7">TRRS cable</a></li><li><a href="https://www.aliexpress.com/item/2036819167.html?spm=a2g0s.9042311.0.0.7c154c4dJM3Rg4">WS2812B LED strip</a> (10 LEDs, optional)</li><li><a href="https://smile.amazon.com/gp/product/B003CT4AM0">Filler primer spray paint</a> (any color)</li><li><a href="https://smile.amazon.com/gp/product/B006ZLQVZG">Automotive spray paint for plastic</a></li><li><a href="https://smile.amazon.com/gp/product/B006ZLPX3W">Enamel spray</a> (for the top coat)</li><li>220, 320, 400, 600 grit sandpaper</li><li>USB-C and micro usb cables (if you’re going with the Elite-C and clone approach)</li><li><a href="https://smile.amazon.com/gp/product/B07BDF725X">Trackball</a> (I used a 34mm ball, but it’s a bit small with Qurn’s mount; suggest maybe 38mm)</li><li>Transparent rubber pads for stabilization (optional)</li></ul><h4>3D printing the cases</h4><p>There are a ton of DM forks out there. The one that I used as a base is <a href="https://www.reddit.com/u/DanL4">u/DanL4</a>’s DM mini <a href="https://github.com/l4u/dactyl-manuform-mini-keyboard">fork</a>, which accompanies his excellent <a href="https://www.beekeeb.com/dactyl-manuform-mini-mechanical-keyboard-build-log/">build log</a>. In fact, it’s this build log that encouraged me to get a 3D printer in the first place because of the care that he put into explaining the finishing process.</p><p>Locally, I made a few tweaks:</p><ul><li>Changing the layout to 4x6, which meant getting rid of the num rows</li><li>Increasing the thickness to 3mm; Dan printed his with an SLA printer, which can go thinner</li><li>Spacing was modified to better support DSA keycaps, which are shorter and wider; this changes the ideal curve as well</li><li>Tweaking the screw posts, since 4x6 messes it up</li><li>Changing the tenting (if I could do it again, I’d tent it even more)</li><li>Using 5 thumb keys instead of 3, and making them all 1u (I forget if this is the default)</li><li>Lowering the front and back left thumb keys about 1–2 cm; this is quite substantial, but I didn’t want these keys crowding the trackball on the right side. I kept it lowered on the left side to maintain symmetry</li></ul><p>Then I added the trackball. This introduced quite a few hours of pain. Initially I tried to design one myself, but I quickly accepted that my life’s journey hasn’t granted me the skills to be a 3D modeler. Instead, I trimmed the trackball from Qurn’s additive STL. I had to remove the hotswapping additions, etc, which I did imperfectly. Qurn’s design is also using a 5x6, which means the orientation, etc would be quite different from what I was doing. I worked in Meshmixer, since I found it a bit easier to brute-force manipulate STL meshes rather than cleanly merging solid models.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*39ITJc_J224zSQbSa5ov7A.png" /><figcaption>You can see the extent of the brutality. In the finished version, I managed to close a couple gaps</figcaption></figure><p>When merging the two models, I tried to use Meshmixer’s boolean combine operation. Unfortunately that only works if the models are correctly shaped, which these were… not. I used Meshmixer’s “make solid” function to make it work, which did some horrific things to the integrity of the model but did allow me to move on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*unae7kWcU6cnKzBi24z6bQ.png" /><figcaption>Nooo where did my clean lines go?! Incidentally, note the presence of the grooves for the roller bearings and the hole for the motion sensor… this is the real value in Qurn’s model</figcaption></figure><p>With previous DM iterations, I’ve been very careful to pick high quality settings when slicing the models for printing (low speeds, thin layers, generous supports) such that it could take up to 50 hours per side. For this one, I just let my Ender 5 Pro rip at full speed with .2mm height layer height and build plate supports only for 65 degree overhang. No problems, and each side finished in 16 hours.</p><p>It’s a good thing, too… I had to print a number of iterations before I didn’t have any mistakes or merging artifacts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UhBN76Yq9Fj-DPzoAIcSeQ.jpeg" /><figcaption>A couple iterations. Sadly there were more than just these…</figcaption></figure><p>After printing, I sanded each side with 220 grit sandpaper, and again with 320 grit. I’ve started with 120 grit in the past, but I’ve found it’s done more harm than good.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fZXAnDmXiuOI3AKnzPw04Q.jpeg" /><figcaption>After sanding one of the iterations. Note the flaws that came from messing with the model. A bit of hot glue can cover a number of sins…</figcaption></figure><p>After sanding, I took the cases out on my balcony and applied a couple coats of filler primer spray paint, then let it dry for a few hours. Filler primer is really important to get an even surface, especially for the curved segments. This is what allowed me to get away with faster prints — I found no difference in quality once the cases were primed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DSgL0X9LO_ytD1dR6_Pkiw.jpeg" /><figcaption>After sanding the primed cases the first time. See below for an explanation of that weird left side</figcaption></figure><p>Once the cases were primed, I sanded again with 320 grit as well as 400 grit, washing the cases between each step. I wet sanded with 600 grit, then primed the cases and repeated the sanding. This time, I wet sanded up to 800 grit.</p><p>Once that was done, I spray painted my red layer. My parts list above references automotive paint for plastic, which is what I used for my partner’s board. It’s quite robust and has a good shine on its own. The red paint I used here was a cheaper, more general primer + paint, which dulled the finish and ended up being quite flaky. When I redid the left side, I applied two layers of enamel spray as a clear coat, which somewhat addressed this issue. Enamel spray is a good idea regardless, since keyboards see a lot of rubbing and bumping from use.</p><p>By the time I was done, the case doesn’t look like it’s been printed, and it’s quite smooth to the touch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CvoB2V37J43OKCQ2pU9_qQ.jpeg" /><figcaption>One thing I didn’t figure out is how to avoid dripping from the final red layer. You can also that the paint sprays thin — some layering shows right through</figcaption></figure><h4>Wiring it together</h4><p>I handwired each side. This was my 3rd time wiring a DM, so I was able to finish each side in about two hours with some minimal mistakes. It’s quite tedious, but I found it to be faster and neater if I solder diodes first, then solder columns directly to the switches, then rows to each diode. Diode orientation and connection to row or column is configurable… just be consistent for each switch. To keep wiring neater, I solder the connection to each switch as I strip segments of the wire insulation, sliding back the insulation towards the prior soldering point to minimize exposed wire. Some people like to simply burn off insulation, but the fumes are awful (and toxic?), so I get wire with a high melting point for its insulation and rely on stripping it instead.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*brx6IppvB_Wrw6cjWIBpUQ.jpeg" /><figcaption>Clean lines, but you can really see the abuse of that fast printing without proper supports and fine layers</figcaption></figure><p>One thing I experimented with was attaching the pin headers to the Elite-C and Pro Micro. Sadly, there isn’t enough clearance to use jumpers to avoid soldering wires right to the microcontroller, and this ended up being messier than soldering wires directly to the pads, compared to an earlier build.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UAC_HX45_hPv-_1dLQq5KA.jpeg" /><figcaption>Note: never go 18 AWG</figcaption></figure><p>There are different schematics out there for how to properly wire a Dactyl-manuform, but those are very dependent on layout. They were also thrown out the window for me once I added the motion sensor. There is next to no information out there about how a PMW-3360 ought to be wired to a Pro Micro (or an Elite-C, which is essentially a Pro Micro with extra pins… not that you’ll find any schematics to prove that). Here’s what I ended up with:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/933/1*rBTNafNvl1nrKdbDKTii_A.png" /></figure><p>The pins for rows, columns, LED DIN, and CS / SS are all configurable, but the I2C and SPI pins are required in those positions. The exact wiring of the rows and columns doesn’t matter too much (even between the halves), as long as each switch is uniquely addressed by the matrix. I moved around my Elite-C wiring after the wiring pic was taken, but that’s a good representation of the right side; the left side simply has an extra row for the bottom two switches.</p><p>I don’t think there’s enough room on a Pro Micro to handle I2C, the motion sensor, and an LED strip, especially if you go larger than 4x6. I suppose one could switch I2C for serial and have enough pins, but I’m wary about things like LED support over serial.</p><p>The motion sensor is then done accordingly:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/1*Us3x77yh7ydDYzt4AZQkMw.png" /></figure><p>The PMW-3360 (presumably) needs to be placed particularly so that it can capture motion from the trackball, but Qurn’s mount already contained M2.5 screw holes and the hole for the sensor itself to see the trackball. The lens for the sensor additional contains a small ridge that catches on the edge of that hole, making the position easy to manage. Ideally one would have M2.5 threaded inserts in order to use M2.5 screws to attach the sensor. I had the screws, but not the inserts… so I did the unthinkable and hot glued the screws into the screw holes and onto the mount.</p><p>The TRRS jacks are wired using VCC, GND, and the two I2C pins. Keep it consistent between each half. Note that if using I2C between each keyboard half, on one side there must be 4.7k ohm resistors placed between each of the I2C pins and VCC. I find it easiest to place them right on the microcontroller, since there’s a fair amount of room there. TRRS has 4 wires, and going in the direction of tip-ring-ring-sleeve, it’s best to wire it as VCC, I2C 1, I2C 2, GND. Never expose VCC at the tip, or you’re setting yourself up to short the board early.</p><p>I recommend these keeb.io TRRS jacks ones over this more common <a href="https://www.digikey.com/product-detail/en/cui-devices/SJ-43514/CP-43514-ND/368146">digikey jack</a>… they’re cheaper, and the grounding ring pops off the digikey ones at the drop of a hat. The main value in the digikey jack is that it’s larger and easier to work with. TRRS hasn’t been wonderful for me to work with — it’s common to find the keyboard isn’t working because one of the ends of the TRRS cable isn’t fully inserted. Next time around, I’ll use a different connector, or skip the connector and wire the microcontrollers together directly.</p><p>Both the microcontrollers and the TRRS jacks should be firmly attached to the case. The DMOTE was the only DM version that I saw had a good mounting solution for microcontrollers, and I haven’t seen any at all for TRRS jacks, so I’ve been hot gluing them to the side of the case. Another problem is that the case can be too thick for a USB cable to maintain a solid connection to the microcontroller (particularly for the Elite-C, which doesn’t have the socket protrude from its PCB). I ended up shaving off a lot of the case around the socket so that the USB cable can stay connected without being blocked by its own case.</p><p>When wiring the LED strip (consider one of the pics at the top of the build log where the keyboard is flipped), I like to wire each side with 5 LEDs with the strip split into two segments so that I can get better coverage over the thumb clusters. I also like to point the LEDs *down* rather than up to get better dispersal through the acrylic plates. It’s not very bright shining up through the key switches, but I’ve found that the acrylic plates do a decent job of refracting enough light to diffuse it more evenly across the switches.</p><h4>Making the acrylic bottom plates</h4><p>I really like the aesthetics of an acrylic plate; much better than printing a bottom that matches the outline of the rest of the case. I haven’t really worked much with acrylic, so it honestly took me ages to make the plates for the first build that I did. Much faster with this build! Here’s what I did.</p><p>Taking a thin acrylic sheet from Amazon, I placed each keyboard half on top and sharpied their outlines on the protective layer covering the sheet. When drawing the outline, I was generous with the edges, making the plate flare out from the casein most places and giving me breathing room to sand the edges and make corrections.</p><p>Then I took my dremel to my balcony, laid the (still covered) acrylic sheet on some cardboard and just cut out the plates from the outlines using a plastic cutting bit. A jigsaw would probably be a better tool for the job, but I’m in an apartment… I get what I can. There are a number of potential issues with cutting into acrylic, especially with a dremel — cutting too fast can cause the edge to melt, and it’s very difficult to get a crisply defined edge. However, the dremel gave me the capability to shape the plates around the odd thumb clusters. It’s quite difficult to make concave edges, though — I usually end up with a few marks in my finished acrylic where the dremel bit cut into the plate. So I just cut slowly and at a low speed and took breaks when the dremel got too hot to hold.</p><p>The edges were fairly sharp and irregular when I finished, so I peeled off the protective layers, washed the plates, and went back out on my balcony to sand the edges vigorously with 120 and 220 grit sandpaper. I especially dug into any concave corners so that I could round them out. Once I was happy with the overall shape, I used 320 and 400 grit sandpaper to really get the edges smooth to the touch. At this point it’s best to be careful. The edge of the acrylic diffuses the light refracting through it, and while a smooth edge will be clearer and more pleasant to look at, a slightly rougher edge will actually do a better job of diffusing the light if you’re not looking at it straight-on (which you wouldn’t). I chose to leave the sanding at 400 grit, which gives the acrylic a sort of dusty appearance.</p><p>Once I finished all this, I laid the plates at the bottom of the case and marked with a sharpie where I’d need holes to thread in screws. It’s important to do this after cutting out the acrylic plates, because these holes have to be in exactly the right spot. I took a drill and cut holes at a very slow speed. I’ve read that acrylic has a tendency to crack when drilled, but that hasn’t been a concern when drilling into the thin sheets that I’m using.</p><p>Note that the keyboard still has to be programmed (and most likely debugged) before attaching the case, but assuming that’s done, I used my soldering iron to push in threaded inserts to the screw posts and then screwed the plates to my cases. The screw posts are intended for M4 screws and I believe are threaded already, but M4 screws are ridiculous. A standard FDM 3D printer doesn’t have the precision to produce threads for an M3 screw, so I went with threaded inserts. The screws themselves should be countersunk, but I didn’t have any on-hand. After the screws were attached, I stuck on rubber pads to give the keyboard feet and to prevent it from sliding.</p><p>I didn’t talk about the bearings for the trackball, but I took my dremel with a metal cutting bit and cut the dowels down to the correct size before putting the roller bearings on it. Ideally I would have just gotten dowels of the correct length, but I have no idea what that is.</p><h4>Configuring QMK</h4><p>I feel like every keyboard should be using <a href="https://docs.qmk.fm/">QMK </a>as its firmware at this point. I knew I was missing out when I had a Kinesis, and indeed this is the best thing ever. I already had a layout warmed up from my first couple attempts at a build, but ultimately the basics were the same as the <a href="https://github.com/qmk/qmk_firmware/tree/master/keyboards/handwired/dactyl_manuform">configuration for the DM</a> in the codebase.</p><p>The changes that I had to make were enabling the RGB underglow (which is well documented), configuring the pin mapping, setting my keymap, and adding support for the trackball. One thing I did was split up my keymap files into two different directories, one for each side. This allowed me to define the row &amp; column pin mappings for each side independently, and I could place trackball support in the right side without tweaking the left. The actual keymaps are shared between the two.</p><p>After I thought I had a reasonable keymap, I flashed the left side with the console enabled and configured to print the row and column for any key pressed. Plugging in just the left side (where normally the right side is the master), this a gives a simple place to make sure each switch is correctly soldered and connected, and confirms that the matrix &amp; pin layout matches my expectations. The actual key output doesn’t matter yet. Doing the same thing for the right side, I was then ready to connect both sides together and give it a proper test run.</p><p>Every time I’ve done a build, there’s been something funky with the TRRS connection. This time, I had the sleeve and ring 2 swapped, so VCC and I2C 2 were swapped on one of the jacks. Amazingly, the RGB LEDs still lit up on the left side, so it took some debugging with a multimeter to confirm that the pins from each microcontroller didn’t match the rings on the other side of the cable.</p><p>After fixing that, I was able to plug in the keyboard and spend some time tuning the keymap to my liking. I then looked for the best QMK integration with the PMW-3360, and I found 2. This <a href="https://github.com/qmk/qmk_firmware/issues/7047">open PR</a> for the Ploopy has an integration that seems fairly robust, but the context isn’t so helpful for someone integrating a trackball into another device. <a href="https://gitlab.com/keyboards1/qmk_firmware/-/tree/master/keyboards/handwired/dactyl_manuform_r_track">Qurn’s gitlab code</a> feels a bit less elegant, but has its lifecycle events tied much closer to the keyboard that’s driving it. It even has support for different modes of translating trackball movement into arrow keys and the scroll wheel, which is pretty sweet. I ended up using most of the trackball code from that repo, which worked out of the box (except for setting CPI, which I still need to work on). Qurn spent a lot of time on triggering behaviors based on modifier key tap dances, which is super cool. I didn’t want to use that strategy myself, since I made a 4x6 and will need to make heavier use of layers. Instead, I just mapped the trackball configuration behaviors to those secondary layers.</p><p>I set up most of the modifier keys to be on the left thumb cluster, as well as space &amp; backspace. The key to access the second layer (containing most of the number and punctuation keys) is also on the thumb cluster, while the third layer and alt keys are flung to the edges of the keyboard. The reduced thumb cluster on the right side has the left, middle, and right mouse buttons, as well as the various trackball modes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9zXd5Cm1Hqtnk1oZxqaocw.jpeg" /></figure><h3>Other notes from the build</h3><h4>How does it feel to use it?</h4><p>I’ve only been using the keyboard for one day, during which time I learned how to use the keyboard by making this post. The stiffness of the Sky Silent keyswitches is probably the most awkward thing, followed by the mental translation required for pressing any of the number keys or punctuation. My brain has already remapped space &amp; backspace using the left thumb cluster.</p><p>The trackball has been pretty easy to get used to, despite me never using one before. By default, the arrow and scroll functions are too fast to use without changing the CPI, so I’ve been relying more on the actual arrow keys. I’ll probably go back and have the CPI change depending on the mode. The main function of the trackball works quite well, but I’m using a 34mm trackball that’s just a hair too small; vigorous movement starts to bump it from its mount, which means that I can’t move it very quickly. Maybe as a consequence of the same thing, captured motion isn’t very smooth either, so mouse movements end up being jumpy. However, it’s sufficient so that I’ve been able to achieve my objective of not moving my wrists!</p><h4>How about that left side?</h4><p>A lot of the focus of the build is obviously on the trackball and its impact on the right side of the keyboard. I also spent a lot of time thinking about the left side: can I add more keys to it to take some pressure off of my right hand? Should I add more rows and columns to the left side? I tried that as a first attempt, but the asymmetry was pretty wild… much worse than navigating an extra column between two otherwise-equal DM halves. Should I expand the thumb cluster? I did that by printing a DMOTE left side. The <a href="https://github.com/veikman/dactyl-keyboard">DMOTE</a> by Viktor Eikman has always been on my mind for an endgame build — exotic, and sacrificing norms for ergonomics.This was probably the most successful attempt — it has 7 keys in its thumb cluster and does this without sacrificing finger movement.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QCTaDvGHXfDJUOvGyMuS4g.jpeg" /></figure><p>It was a *pain* to wire the DMOTE, enough to think that its author must seek some sort of thrill from frustration. I finished building it, but ultimately I had to scrap it for two reasons: the thumb cluster asymmetry was brutal, and (this was the deal breaker) the DMOTE wasn’t compatible with DSA keycaps. I had tried to modify the spacing in the model before printing, and I even tested 1/3 of the keycaps before wiring it… but I tested the wrong keys. You can see in the picture above that some of the keys didn’t even fit on the board, let alone with enough clearance to actuate.</p><h4>Why did I pick these key switches?</h4><p>I’ve spent my fair share of time looking at reddit’s mechmarket… I’ve seen what switches are in demand and I’ve looked at enough comparisons to get a sense for why someone would use certain sorts of switches. My goals are to have a quiet keyboard (if such a thing is possible with a mechanical keyboard) to keep things civil in the office, and I like a tactical feel to encourage me to not bottom out on each keypress. They’re also more familiar given that my Kinesis Advantage uses MX browns. I set up V2 Zilents for my partner’s board and really enjoyed their noise and tactility, and briefly set up Aliaz switches for one of my DM iterations, which are almost identical to the Zilents. I would have stuck with those Aliazs here, but I got sucked in by the in-depth analysis from u/hbheroinbob about the Outemu switches that he sells, hand-lubed.</p><p>These Sky Silents are purported to be even more quiet than Zilents (which they are) without sacrificing tactility (which is true). I also liked the idea of supporting a lesser-known switch maker, and they’re cheap. The main downside is that they’re much stiffer than I’m used to, but I’m hopeful that they’ll loosen up once I’ve spent some more time breaking them in.</p><h4>What keycaps should I use?</h4><p>I’ve been concerned about keycap layouts ever since I swapped my keys on my Kinesis Advantage: everyone and their mother in the mech keyboard community likes to use sculpted SA keys, but these make a lot of assumptions… like having uniform, flat rows. I like using DSA keys instead, because the keys are uniform (which is great for colemak / alternate layout users like me) and because they’re more tolerant to being pressed from the side, which can happen with a curved layout. Some people have tried to modify the Dactyl layout to support SA sculpting, but in my opinion that’s just working around the issue. I’d love to see more support out there for DSA, XDA, and other uniform keycap profiles!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19eaa0880222" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Controlling my media center by voice]]></title>
            <link>https://medium.com/@kincade/controlling-my-media-center-by-voice-ab92f8a19560?source=rss-a2984870d4d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/ab92f8a19560</guid>
            <category><![CDATA[smart-home]]></category>
            <category><![CDATA[amazon-echo]]></category>
            <category><![CDATA[home-theater]]></category>
            <dc:creator><![CDATA[Dave Kincade]]></dc:creator>
            <pubDate>Wed, 21 Dec 2016 05:58:00 GMT</pubDate>
            <atom:updated>2017-08-07T03:22:06.032Z</atom:updated>
            <content:encoded><![CDATA[<p>Amazon <a href="https://www.amazon.com/All-New-Amazon-Echo-Dot-Add-Alexa-To-Any-Room/dp/B01DFKC2SO">Echo</a> devices are popular, and I’ve spent a few dozen hours getting up to speed on how I can use them. I did the first thing everyone does when they get one and hooked it up to Spotify and commanded Spice Girls into my living room. I then connected my blinds and was able to summon darkness at will. But, uh… that was pretty much it.</p><p>Home automation is pretty much a money pit. I knew this, but the main reason why I had held off was because I didn’t want to control my appliances with some terribly designed tablet app with a screen of buttons, eg:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/1*-Gmy6dbMiJ4MnfLldBILkw.png" /><figcaption>An image search for “home automation controller”. Ick.</figcaption></figure><p>I didn’t want the Echo because I didn’t need the speaker it comes with. The Echo Dot, meanwhile, was a better fit because I could hook it right into my stereo system. Err, sort of. It’s worth it to describe my setup so that you can understand my constraints:</p><ol><li>A shiny new Samsung TV acting as a hub for all of my devices</li><li>An aging HDMI audio receiver, connected via <a href="http://hometheaterreview.com/everything-you-need-to-know-about-arc-audio-return-channel/">ARC</a> to the TV</li><li>A HTPC running Windows 10 and <a href="https://kodi.tv/">Kodi</a> (media center software)</li><li>A PS4 [not relevant to this post, but ultimately also voice controlled as a TV input]</li></ol><p>I don’t have a Fire TV or any other peripherals — my apps all run on that HTPC, which I’ve named Peter. Peter runs Windows, which wouldn’t normally be my first choice but I’ve had buttery smooth media playback with it where previous Linux (and hackintosh) builds have failed me. It unfortunately makes projects like this more difficult.</p><h3>Goals</h3><ol><li>Turn my TV on / off by voice. Bonus: switch HDMI inputs by voice</li><li>Control Kodi by voice for watching movies and TV shows</li><li>Use my speakers so I can hear the Echo while simultaneously playing audio from the HTPC</li></ol><p>I tackled this by from pulling information from various Reddit and blog posts, but unfortunately I didn’t record most of them to give credit. No single post met my needs, and for each case I ended up getting a little, uh, creative.</p><p>That’s a useful warning for you as well. Neither voice control goal was trivial to complete. I expect that even with this post and others as a resource, getting this to work for yourself may take a good amount of tenacity and cause quite some frustration.</p><p>You can read through the rest of this post, but if you just want the payoff, I’ve got a video of me turning on my TV and kicking off a TV episode:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FgRhP_c2gHVg%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DgRhP_c2gHVg&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FgRhP_c2gHVg%2Fhqdefault.jpg&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/eece06959063a5c7f6d064b0d7c3bd44/href">https://medium.com/media/eece06959063a5c7f6d064b0d7c3bd44/href</a></iframe><h3>Controlling the TV</h3><p>Controlling my TV was by far the simplest operation. Steps involved here include access to the TV via its EX-Link (serial) port, using EventGhost to send serial commands to the TV, and using a Philips Hue emulator to fool the Echo into controlling the TV. [Note: see the update at the bottom of this section for a different solution]</p><p>I bought a Samsung KS8000, which is a 2016 UHD TV. That may be important, but I gather any moderately recent Samsung TV will work as I’ve set it up. These TVs come with a nifty extra port, which uses a standard 3.5 mm headphone connection. Far from driving headphones, it’s for <a href="http://smartsamsungtv.com/what-is-the-samsung-smarttv-exlink-port/">EX-Link</a>, which is used for remote control or possibly debugging. Sniffing around Amazon, I didn’t identify any consumer devices that operate a TV via EX-Link, so I’m guessing it’s more for debugging. It ends up just being a serial connection, which had no issues communicating with my HTPC using one of <a href="https://smile.amazon.com/SF-Cable-Female-Serial-Cable-6/dp/B004T9BBJC">these cables</a>. If you don’t have a serial port on your computer, or if you don’t want to risk the motherboard, you can always buy a USB&lt;-&gt;serial adapter for dirt cheap.</p><p>Next, it’s useful to talk about <a href="http://www.eventghost.org/">EventGhost</a>. It’s a glue application to execute arbitrary behavior given certain triggers. It has a lot of useful applications, but for our purposes ends up being great for controlling Samsung TVs via EX-Link. The EX-Link protocol itself is somewhat inscrutable, but luckily EventGhost ships with a plugin for <a href="http://www.eventghost.net/forum/viewtopic.php?f=9&amp;t=2059">exactly this purpose</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gOL9QXbWn95JWLgvm5szuw.png" /><figcaption>Go to “Configuration” -&gt; “Add Plugin”</figcaption></figure><p>From here, you can fool around with a bunch of behaviors for controlling the TV. I’ve only engaged power and HDMI input switching, but you’ve got volume control and a bunch of honestly pretty scary controls for picture adjustment. Imagine that… “Alexa, dim my TV”. Here’s where I ended up with my EventGhost configuration for the TV:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8u1Rgm6JhCQrxJivod98cQ.png" /></figure><p>You can see that I’ve got a couple HTTP triggers, which drive between one and three actions. The most interesting one is “Power On”, which turns on the TV, switches the input to the receiver, then immediately to the HTPC. I had to do this because the power on behavior that EX-Link uses is very different from what happens when pressing the power button on the TV remote. There’s no animation on the screen and the TV doesn’t automatically wake devices up via HDMI-CEC. Activating the HDMI input achieves the same effect without any noticeable delays. <strong>Note: this should be a hint.</strong> EX-Link is likely triggering behaviors that may void your warranty or worse actually damage your TV. I really have no way of knowing, but I’m betting on its behavior being fairly benign.</p><p>The EventGhost HTTP triggers operate because you can enable an internal HTTP server inside of EventGhost that can act as triggers based on the URL. Useful for the next part. EventGhost can run on startup and in general just sits in the tray.</p><p>Probably the most vital part of this is the <a href="https://github.com/armzilla/amazon-echo-ha-bridge">Hue emulator</a> (titled the Amazon Echo Bridge by the creator). I had some trouble with the most recent versions of the repo, but had decent luck with <a href="https://github.com/armzilla/amazon-echo-ha-bridge/releases/tag/v0.2.1">v0.2.1</a>. There’s no issue with the jar running on Windows, and I daemonized it by making it a service with <a href="https://nssm.cc/">NSSM</a>. I run a few services on the HTPC so I had to mess around with the arguments when calling it. Port 8080 is otherwise in use, and unfortunately the “server.port” argument alone wasn’t enough to prevent the webserver from trying to bind on it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*69cQ9kQifzPDlbLcUbuuGw.png" /><figcaption>Pasted because I couldn’t figure out the double dash in Medium posting…</figcaption></figure><p>Visiting the web server at /configurator.html presents a page like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1tvDSC4ZtNMGrPTbzcJzng.png" /></figure><p>For clarity, I have EventGhost running on port 6666. Both of these are “unsafe” if visiting in Chrome, so I had to use a different browser. You can see that pretty much label can follow as a parameter in the URL to EventGhost. Once EventGhost gets called, you can drag and drop the event in the event log on the sidebar of EventGhost to the appropriate event that it should trigger. Pretty easy.</p><p>After I got that set up, I had my Echo look for additional devices and it spotted these three “devices”. I control each of them by saying something like “Alexa, turn on Samsung” or “Alexa, turn off Playstation”. It pretty much just works. I wasn’t able to use the name “TV” for some reason, which is why I labelled it “Samsung”.</p><h4>Notes if you don’t have a Samsung TV or EX-Link</h4><p>When I <a href="https://www.reddit.com/r/amazonecho/comments/5jyn6b/my_journey_controlling_tv_kodi_via_echo/">linked to this post</a> from Reddit, <a href="https://www.reddit.com/user/sidoh">/u/sidoh</a> mentioned a couple strategies that could work. The first is fairly simple — you may be able to use <a href="https://en.wikipedia.org/wiki/Wake-on-LAN">Wake on Lan</a> to turn on your TV. You won’t be able to control it other than that, but it could be useful if TV power is a focus for the rest of your home theater setup. EventGhost (naturally) <a href="http://www.eventghost.org/forum/viewtopic.php?f=2&amp;t=6279">has support for using WoL</a>, which you can use in the same fashion as I described above. In the same comment, sidoh described controlling a Sony TV via UPnP:</p><blockquote>I think a lot of them respond to WOL packets (my Sony does). At least with my TV, turning off is trickier, but still possible via network calls. There’s some shitty auth procedure, but once that’s done (it’s permanent) I can turn it off via a UPnP service.</blockquote><p>That’s an intriguing notion, since you could use these methods to control many more devices than just a TV. Googling a bit, I see that there’s a tool called <a href="https://github.com/sidoh/easy_upnp">easy_upnp</a> which among other things allows UPnP control over HTTP. This means that you can use the Hue emulator to control these devices as well.</p><h4>Update: SmartThings</h4><p>I’m not sure why I didn’t spot this the first time, but you can simplify a lot of this setup. If you have SmartThings already (say, to control your lights), there’s a decent chance that you can turn it on and off with SmartThings + Echo. Just a warning that some of the more intricate controls like volume and input selection may not work via voice control.</p><h3>Controlling the media server</h3><p>Kodi has a <a href="http://kodi.wiki/view/Web_interface">built-in webserver</a> for remote control, which is the basis for this section. For this section, there’s a <a href="https://github.com/m0ngr31/kodi-alexa/commits/master">single tool</a> that has a really great README. It’s also seeing active development at the moment so I won’t transcribe the setup here. In essence, you expose the port for Kodi’s webserver to the internet and host a service to accept requests from a custom Alexa skill. I’ll mention a couple issues that I ran into.</p><h4>Accessing Kodi while NATted</h4><p>First, this process requires exposing Kodi’s webserver to the internet. I imagine you could partly mitigate this by running the kodi-alexa service locally as well, but then you’d have to expose that so the AWS Alexa skill can reach it. I wasn’t happy about this requirement, but I figured it to be relatively low risk. To my dismay, my ISP (Webpass) doesn’t allocate IPv4 public addresses so I’m effectively stuck behind a giant NAT.</p><p>Luckily, from really sad work experiences I’m familiar with remote tunnels via SSH. Using Putty (specifically plink), trusty NSSM, and a VPS that costs $5 / year, I managed to expose Kodi via another host. I’ll paste the plink command here for reference. Here, 5051 is the Kodi port — the result of yet another port conflict.</p><blockquote>plink -R *:5051:127.0.0.1:5051 &lt;vps host&gt; -l &lt;remote user&gt; -pw &lt;remote pass&gt; -T -N</blockquote><p>If you don’t have a VPS to use here, there are regularly deals on <a href="https://lowendbox.com/">lowendbox</a>. For purposes of a tunnel, the cheapest possible options are more than plenty. If you haven’t burned your AWS free tier credits, a t1.micro instance is also more than sufficient. The only thing to keep in mind is that in the SSH config on the host, “GatewayPorts yes” will have to be added in order for the port to be publicly exposed.</p><h4>Actually deploying kodi-alexa</h4><p>I was hoping to kill two birds with one stone and use this crappy VPS to host the kodi-alexa service, which would have been super since then I wouldn’t need to expose my HTPC’s Kodi instance directly to the internet. Unfortunately my VPS instance only has 128mb of memory and literally can’t install the python dependencies for that project. I then hoped to use the docker install and ship a completed image to the instance, but of course OpenVZ instances have custom kernels that can’t run docker. I messed around a little bit with it but ended up just using the Lambda deploy suggested in the kodi-alexa README. I couldn’t actually deploy from the HTPC (because Windows) or from the VPS (because memory) but it was really trivial to execute the deploy from a Macbook.</p><p>Note: it may be a good move regardless of the above two issues to attempt to expose Kodi only to the server running kodi-alexa or to not expose it at all if they’re running on the same box. I’m thinking it’s a lot less dangerous if kodi-alexa is attacked than if Kodi is attacked directly.</p><h3>Using home theater speakers to hear Echo</h3><p>Mentioned earlier, one of my goals was to use my speakers to hear my Echo. The Echo Dot actually has a reasonably loud internal speaker, but it’s not stereo and it has pretty poor quality for music. I want to use my more expensive speakers to listen to music while controlling playback by voice, which the Echo is already really good at.</p><p>Unfortunately the issue I ran into here is that my receiver (and most receivers) don’t support mixing playback from multiple devices simultaneously. Newer receivers have Bluetooth support and I suspect could override playback of other content to play what’s coming over Bluetooth, but it’s just a guess. There are mixers that one can buy, but my TV is connected to my receiver via HDMI like imagine most people have it connected. My TV supports optical output, but a mixer that supports both optical and a regular line in seems pretty expensive and I lose the HDMI-CEC features like changing the volume via my TV remote (and my echo!). Without any more innovative solutions, I was reduced to switching inputs on my receiver to either hear my Echo or anything else.</p><p>The next obvious move was to use my HTPC to mix the Echo’s audio into its own. Windows is traditionally pretty good at mixing audio from multiple sources simultaneously. However, my HTPC is actually a server (a <a href="http://www.dell.com/us/business/p/poweredge-t130/pd">Dell T130</a>) that doesn’t come with a built-in sound card. I can only use it as a HTPC because sound is transmitted via the video card that I installed. The situation is almost unthinkable given the proliferation of onboard sound for at least a decade. PCIe sound cards <a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16829102062">cost at least $30</a> and worse I don’t have any spare PCIe slots due to said video card. Well…</p><p>I already had an old USB sound card — one of the <a href="https://smile.amazon.com/Sabrent-External-Adapter-Windows-AU-MMSA/dp/B00IRVQ0F8">cheap $7 devices on Amazon</a>. That had worked alright to replace a broken jack on an older netbook with similar quality to most onboard sound. However, the mic input is a different story — I found that unlike most onboard sound, these cards really <a href="http://shure.custhelp.com/app/answers/detail/a_id/758/~/mic-level-and-line-level----what-do-they-mean%3F">treat mic level separately than line level</a>. Microphones and line devices (like the Echo) ultimately have very different voltages and the Echo sounded really distorted using the mic input, not to mention that the input in not stereo. Derp.</p><p>Next, I investigated using Bluetooth to connect the Echo to my HTPC, since the Echo supports connecting to external speakers and I figured I could have the HTPC pretend to be speakers. I happened to have an Orinco Bluetooth USB adapter kicking around, so it was easy to try. This operation has the PC acting as an <a href="https://msdn.microsoft.com/en-us/library/cc510655.aspx">A2DP sink</a> for the Bluetooth profile. Earlier versions of Windows apparently worked well in this capacity, but Windows 10 actually butchered it with the default drivers. I tried using <a href="http://www.bluesoleil.com/">BlueSoleil</a>, which has an alternate set of drivers. BlueSoleil might be the most hideous software that I’ve used, but it did successfully set up an A2DP sink and I was able to play music with my speakers. Unfortunately the quality was subpar — I’m not sure how to quantify it, but there was definitely some loss. BlueSoleil isn’t cheap, so this left me pretty disgruntled. Later I tripped over Broadcom’s <a href="https://www.broadcom.com/support/download-search/?pf=Bluetooth+SoCs">WIDCOMM stack</a>, which apparently is compatible with many (most?) Bluetooth chipsets. This integrated much more cleanly with Windows and had decent quality from the get-go.</p><p>Still, I wasn’t very satisfied. Neither BlueSoleil nor the WIDCOMM drivers actually seamless presented the HTPC as an an A2DP sink for the Echo and there was somewhat of a manual attempt of a connection each time a connection was lost. In addition, the Bluetooth device didn’t behave like a normal input device from the perspective of Windows sound devices. That stops me from controlling it inline with other applications.</p><p>Luckily I had already ordered a <a href="https://smile.amazon.com/gp/product/B013256ODG">$16 5.1 USB sound card</a>. This sports an actual line in (with stereo input, no less!) Plugging the Echo into this sound card worked immediately and sound quality was back to what I expected. Of course, I still can’t hear my Echo when using my PS4, but I’m pretty sure that was never in the cards.</p><h3>Conclusions?</h3><p>For me, the effort of all 3 of these projects was worth it. First, I seem like an absolute badass during parties, but it also makes a lot of media operations more trivial. I can learn episodes of TV shows that I haven’t seen yet, control playback while eating dinner, and switch between gaming and TV watching seamlessly.</p><p>Of course, the journey was probably worth more than the destination. Dozens of hours don’t just evaporate!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ab92f8a19560" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Predicting how you’ll vote: a follow-up]]></title>
            <link>https://medium.com/brigade-engineering/predicting-how-youll-vote-a-follow-up-3eaf5452c4f6?source=rss-a2984870d4d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/3eaf5452c4f6</guid>
            <category><![CDATA[politics]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[social-media]]></category>
            <category><![CDATA[engineering]]></category>
            <dc:creator><![CDATA[Dave Kincade]]></dc:creator>
            <pubDate>Mon, 07 Nov 2016 17:43:29 GMT</pubDate>
            <atom:updated>2016-11-07T17:43:29.268Z</atom:updated>
            <content:encoded><![CDATA[<p>I <a href="https://brigade.engineering/predicting-vote-pledges-via-social-alignment-8ffefa3d645#.4z7o1wasx">recently wrote</a> about how Brigade is able to help people decide how they should vote on Election Day. In that post, I talked about our <a href="https://www.brigade.com/ballot-guide">social ballot guide</a>, which contains thousands of state and federal races as well as every statewide ballot measure in the country. Our tool compares your views on a range of issues to users who’ve pledged to vote for particular politicians or ballot measures in order to arrive at a voting recommendation for you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/569/1*pZYsn1lWL0vuj8gpgUWZrg.png" /><figcaption>Personalized recommendations for president</figcaption></figure><p>We calculate alignment by having users agree or disagree with short opinion statements we call positions and comparing responses to those positions. It is our main indicator for whether two people may be like-minded and it has a major presence throughout the product.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/971/1*kBEpfgA3uaL1Keb4dUTiFQ.png" /><figcaption>A position on Brigade</figcaption></figure><p>Since that blog post was published, <strong>more than a quarter million people have pledged their vote for a presidential candidate</strong>. We’ve added more races, ballot measures, dramatically improved the ability to share your pledges and attempt to sway others to vote with you. We’ve also reworked the system to incorporate more information to better calculate alignment.</p><p>What we haven’t changed is our calculation for alignment. In the screenshot above, the personalized recommendations for Hillary Clinton and Jill Stein are very close to each other, and the issues that have greatest alignment are the same. This was something that we’d identified as a weakness, and it gets more difficult to determine as candidates are more similar to each other:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/570/1*XVqzkBG_mnkcApq7vBRSUQ.png" /></figure><h3>Results of experimentation</h3><p>Over the course of a few weeks, our data team experimented with everything from <a href="https://en.wikipedia.org/wiki/Logistic_regression">logistic regression</a> to <a href="https://en.wikipedia.org/wiki/Random_forest">random forest</a>, up to <a href="https://en.wikipedia.org/wiki/Deep_learning">deep learning</a>. We focused largely on the presidential race, where we have the most data.</p><p>Most algorithms behaved similarly; random forest and deep learning in particular were very close. In general, for Hillary Clinton and Donald Trump we saw <a href="https://en.wikipedia.org/wiki/Precision_and_recall">precision</a> of ~0.85 (where the predictions that we made were for the right candidate and recall of ~0.6 (where the predictions that we made were for the candidate that users had actually chosen). As a rule of thumb, precision of 0.8 is roughly what one can expect with an unoptimized application of a model in most uses. Performing the same analysis against social alignment, we found precision of 0.6, implying that most machine learning models could be better at predicting who someone will vote for compared to what we are doing.</p><p>Looking at Jill Stein and Gary Johnson, we found that most models tended to optimize them out of the system — any vote pledges for them were mostly ignored. Recall for them dropped way down as a result. This is not true for social alignment, where we don’t take the number of pledges of each group into account. The more sophisticated models tended to have better recall for all candidates, especially when they took some factors into consideration that tend to sway Stein supporters from Clinton supporters.</p><h3>The objective</h3><p>This leads us to the question that we should have been asking from the beginning (and indeed was asked one or two members of our team): What should we be solving for? It’s useful to tell our users who we think they will vote for, which is what we get with our machine learning models. However, we built social alignment to tell users who they <strong>should</strong> vote for, based on how similar their views are to others who are pledging to vote. “Should” is a nebulous term, and we grappled with the difference for a time.</p><p>In the end, we decided that the distinction between the two is significant enough that identity of our recommendation being based on alignment is important. Once we start applying ML to this problem, we start to lose our ability to explain “why” someone should pledge to vote for a candidate. One of the pillars of Brigade is that by acting together as a community, we can have greater effect than being alone. By removing the feeling of the community from our recommendations, we risk losing a bit of that purpose.</p><p>Of course, that doesn’t mean that our analysis is done. In the previous post, we laid out a bunch of issues with alignment as it stands today, and those should be corrected. There is a lot that we can do to figure out the significance of each agree and disagree action that a user takes, identifying what positions unify groups of people, and what positions aren’t particularly important to a group.</p><p>Improving these can improve alignment across our product, and we’re eager to get to it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3eaf5452c4f6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/brigade-engineering/predicting-how-youll-vote-a-follow-up-3eaf5452c4f6">Predicting how you’ll vote: a follow-up</a> was originally published in <a href="https://medium.com/brigade-engineering">Brigade Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Predicting vote pledges via social alignment]]></title>
            <link>https://medium.com/brigade-engineering/predicting-vote-pledges-via-social-alignment-8ffefa3d645?source=rss-a2984870d4d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/8ffefa3d645</guid>
            <category><![CDATA[2016-election]]></category>
            <category><![CDATA[politics]]></category>
            <dc:creator><![CDATA[Dave Kincade]]></dc:creator>
            <pubDate>Sat, 24 Sep 2016 00:20:49 GMT</pubDate>
            <atom:updated>2016-09-24T00:20:49.104Z</atom:updated>
            <content:encoded><![CDATA[<p>Brigade has a big focus on connecting voters with varying viewpoints, showing them their similarities and differences, and helping them influence the policies and elections that affect their lives. It’s fundamental in our mission to reenergize public participation in our democracy. One significant tool at our disposal is the concept of alignment.</p><p>Alignment is a measure that helps users and Brigade as a platform establish a sense of similarity between a single user and another user or some portion of the platform in aggregate. For instance, look at this position:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/769/1*UVd8MaWtdemD2jynJSXInQ.png" /></figure><p>Taking the “agree” side on this position will increase a user’s alignment with anyone who agrees, while decreasing alignment with anyone who disagrees. Here’s a simple model to help you reason how alignment on Brigade works:</p><p>Alice and Bob are taking positions on immigration. When a position is taken, they can agree with it (✓), disagree with it (✗), or leave it as unsure. Brigade has seven immigration-specific positions that address key themes related to the issue and we require that a user take at least five of them to begin to show alignment with other users.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/445/1*ET1t9_Z4PmnvWQWM0T8rVg.png" /></figure><p>In this example, Alice and Bob have three overlapping positions (3, 4, and 5) and share the same response on only one of those (5). Thus you could conclude that they agree 33% of the time. That’s a really simple way to think about similarity.</p><h3>Aligning with candidates</h3><p>An important tool that Brigade is rolling out for the 2016 election is our personalized <a href="https://www.brigade.com/ballot-guide">Ballot</a>. It provides state and national voting recommendations from Brigade users who share your views and in so doing helps you understand which candidates align with you. The tool also allows you to recruit others to join you in voting for a particular candidate. That action is called a <strong>pledge</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/1*PKPk7s_-4Z3L7QaZRrUcTA.png" /><figcaption>Brigade’s ballot guide, after pledging</figcaption></figure><p>To date, we’ve calculated how you align with politicians in the same way we calculate alignment between users: you take a number of positions on a range of issues and establish similarity based on how much you agree on those issues. This has been an effective approach for presidential candidates and others on the national stage. We’ve painstakingly defined what we think represents many politicians’ platforms on a variety of issues.</p><p>However, the further down-ballot you go, the less likely the Democratic or Republican Party platforms apply and the harder it is for us to determine a politician’s views. For instance, San Francisco Supervisor Scott Wiener may be a Democrat but as a candidate for California State Senate, he has different concerns than his party at a federal level.</p><h3>Enter social alignment</h3><p>What if we applied one level of indirection? We might not know what Scott Wiener thinks, but we have a rich set of data about what his supporters (and supporters of his opposition, challenger and fellow San Francisco Supervisor Jane Kim) think. We have a mechanism to establish similarity for a user’s beliefs vs a group of people. If we apply similarity analysis against each candidate in a race (eg California State Senate District 11), we can come up with a recommendation for which candidate best represents voters that have similar views to a user.</p><p>Now we don’t need to curate a corpus of politicians’ likely responses to our positions. We can provide recommendations for any race or against any ballot measure as long as enough people have pledged for candidates (or sides, for measures).</p><p>You might spot a few problems with this approach:</p><ol><li>In the alignment model laid out earlier, each position is considered equally. In the Wiener-Kim race, views on defense are not as relevant as views on transportation and housing. Transportation and housing issues tend to be resolved at the state and local level, while defense issues are mostly a federal concern. Between districts at the same level, not all issues will be equally relevant (eg, California may have considerations for water conservation that don’t apply to Florida). Even within a single district, each candidate may be focusing on different positions and issues that rally their supporters to different degrees.</li><li>Not all (or even most) supporters of a candidate will agree on individual positions. There are a few reasons for this, not least of which is that candidates may not have published their stances on all positions such that there is no standard to rally behind. Even if all positions were known, in many cases a voter chooses between a small handful of candidates and likely none align with voters on all of the issues that they care about.</li><li>Having multiple candidates in a race can accentuate the differences between candidates in a way that doesn’t really fit reality (a phenomenon known as <a href="https://en.wikipedia.org/wiki/Distinction_bias">distinction bias</a>). For instance, the presence of the Green Party’s Jill Stein as a presidential candidate on Brigade shifts the average pledger for Hillary Clinton to be more centrist while the two candidates (as a whole) have a relatively similar platform.</li></ol><p>Nevertheless, the approach to similarity that we’ve built will result in a powerful tool to expose the supporting base for each candidate and give some immediate feedback to voters as to what sorts of issues they can expect candidates to be concerned with.</p><p>It ultimately results in a prediction, where the inputs are your responses to core positions on Brigade (as well as anybody else participating in your elections) and the output is a measure of how much each candidate represents your views.</p><h3>What next?</h3><p>Some of the challenges to our approach to social alignment are endemic to our approach to alignment in general. Similarity and prediction are incredibly hard problems, and we’re just scratching the surface so far. The specifics will have to wait for another post, but we’re excited for how we can better solve this issue of candidate vote pledge prediction.</p><p>Candidate vote pledging ends up being a classic problem for deep learning. The fact that we’ve got vote pledge data on Brigade means that we can train models very effectively. We believe that deep learning eliminates several issues that we have with our current approach — not all positions are equally important for each candidate, and deep learning highlights the positions that correlate with pledges. We’re particularly excited to compare this against our existing “direct” alignment approach where we attempt to divine the positions that each candidate would take, if they were on Brigade.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8ffefa3d645" width="1" height="1" alt=""><hr><p><a href="https://medium.com/brigade-engineering/predicting-vote-pledges-via-social-alignment-8ffefa3d645">Predicting vote pledges via social alignment</a> was originally published in <a href="https://medium.com/brigade-engineering">Brigade Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>