October 11, 2018: uQR: Generate QR Codes in MicroPython

This last week I ported the python-qrcode library to MicroPython. The result is uQR!

Porting python-qrcode to MicroPython involved:

  1. Removing libraries unavailable in MicroPython.
  2. Rewriting syntax that is unavailable in MicroPython.
  3. Removing Py2/Py3 cross-compatibility code.
  4. Removing QR code image generation.
  5. Rewriting recursive function calls into loops: MicroPython has a much shallower recursion limit than CPython.
  6. Consolidating all of the code into one file, for easier MicroPython deployment.

The result:A microcontroller connected to a miniature LED display, depicting a QR code.

Due to memory limitations, I can only create small QR codes on the ESP8266 microcontroller. But I’m getting an ESP32 and a slightly larger screen: I’d like to make a project and video about accepting lightning network payments with the ESP32.

October 10, 2018: The Legendary Octosniffle Lives

After months and versions of prototyping, the Legendary Octosniffle is finally printing. I printed the main components in wood PLA and applied stain and polyurethane to achieve a nice wood-like appearance.

I designed the Legendary Octosniffle around the basic Delta 3D printer geometry, with the following modifications:

  • Lead-screw drive vs. a belt drive.
  • Magnetic effector joints.
  • More printed structural parts vs. purchased parts than in a typical delta printer.

I’ve very happy with the printer’s:

  • accuracy
  • aesthetics

And I’m satisfied with the printer’s:

  • speed

More to follow.

September 6, 2018: Flying Cars – First Assignment

I just completed my first assignment in the Udacity Flying Car Nanodegree program.

Simulated drone flying in a square.

The task was to fly the drone in a square, and although there was no modeling of the physics of flight or sensors in the assignment, there was the challenge of programming the flight computer in such a way that competing goals (like collision avoidance) could flexibly assume control under appropriate conditions.

My solution is in GitHub, but here’s a sample of my writeup:

Autonomous flight is goverend by two sets of interacting control loops. The autopilot loop is responsible for low-level maintenance of flight goals. Its responsibilities are analogous to the “aviate” in “aviate, navigate, communicate”. Specifically, the autopilot has direct access to the flight sensors and GPS and can maintain station, or be programmed with and achieve a particular heading or destination.

The autopilot loop consists of:

  1. control inputs made by the autopilot upon the craft’s flight surfaces or motors
  2. the motion of the craft as effected by those flight surfaces or motors
  3. the readings of the craft’s sensors, as effected by the motion of the craft
  4. the new control inputs made by the autopilot as effected by its readings of its sensors

Read the rest of my writeup at GitHub…

September 3, 2018: Flying Cars

As a kid I watched hours of re-runs of The Next Step–the 1991 futurism serial documentary, not the 2013 Canadian dance drama. Little did I know that the future had already arrived in the 1949!

JASchilz posing in front of the Taylor Aerocar at Seattle's Museum of Flight
The Taylor Aerocar III, at Seattle’s Museum of Flight

Flying cars were apparently solved decades ago. The first Taylor Aerocar (pictured above) was built in 1949, by fellow Oregon son Molt Taylor. Wikipedia categorizes the Aerocar as a roadable aircraft–more of a driving plane than a flying car–and there are many more entries, including what was basically a Cessna Skymaster welded to a Ford Pinto.

Remembering back 25 years, I think that we were looking for the following characteristics in the flying car of the future:

  • Freeway capable performance as a car
  • Push-button conversion from car-mode to plane-mode
  • Takeoff and landing from/to street driving
  • Easy to fly, like driving a car
  • Ease of ownership: not much more difficult to obtain and store than a regular car

Ease of takeoff, landing, and flying would require some aerodynamic characteristics (like a low stall speed) and some technology (like automatic rudder coordination) that would have set a true “flying car” apart from an entirely airworthy “roadable aircraft” like the Taylor Aerocar.

Today, there’s a new flying car dream:

  • The flying car doesn’t drive at all: it performs vertical-takeoff-and-landing (VTOL)
  • You don’t own the flying car: you hail it like a taxi
  • You don’t pilot the flying car: it pilots itself using modern automation technology

To offer these affordances, the new flying car takes advantage of electric multirotor technology. Rotorcraft are generally less efficient than fixed-wing aircraft in terms of energy expended per mile of travel, but they are natural VTOL fliers. And some companies are designing hybrid craft with multirotor VTOL takeoff and landing capabilities and fixed-wing travel efficiency.

The new flying car will ultimately find some niche in a growing set of transportation options. In suburban regions, a flying car could provide last-mile transportation between a train-station and your home. In urban areas, flying cars might provide point-to-point transportation between transit hubs, avoiding congestion by taking advantage of big sky theory.

And as a postscript for future Martians, rotorcraft will be even more important in the Martian atmosphere: the lift of a wing scales linearly with air density and quadratically with speed. To get the same lift from a given wing in Mars’s 1% atmosphere then requires that the wing be moving at 10 times the speed it would move on Earth. A fixed-wing aircraft would have to travel at 10 times the speed on Mars compared to Earth to achieve identical lift, yielding stall speeds of 500+mph and requiring immense runways. A rotorcraft, on the other hand, only has to spin its rotors 10 times faster. A given craft only needs 38% of the lift on Mars that needs on Earth, of course, but in the back-of-the-envelope calculation the air density parameter dominates.

I’m making this post on the eve of my enrollment in Udacity’s Flying Car Nanodegree program.

August 12, 2018: Creating GitHub Repositories at the Command Line

I like programming in vim. But when I want to share a new project with the world, I have to fire up a web browser in order to create a new repository in GitHub.

No more. I dug into the GitHub API literature and found that you can create a repository by POST request to their RESTful web API. For example, you can  create a GitHub personal API token with at least the “public_repo” scope and then:

curl -u YOURGITHUBUSERNAME:YOURPERSONALAPITOKEN --header "Content-Type: application/json" --request POST --data '{"name": "test-repo"}' https://api.github.com/user/repos

See the API documentation link above for a full list of optional data that you can send to this endpoint. And of course, you can use any HTTP tool to send this request, curl is not required.

To make the process smoother, I added the following variables to my environment:

export GITHUB_CREATE_REPO_API_KEY="YOURPERSONALAPITOKEN"
export GITHUB_USERNAME="YOURGITHUBUSERNAME"

And then created the following shell script:

#!/bin/sh

curl -u $GITHUB_USERNAME:$GITHUB_CREATE_REPO_API_KEY --header "Content-Type: application/json" --request POST --data "{\"name\": \"$1\", \"description\": \"$2\"}" https://api.github.com/user/repos

With that script in my PATH, the command mkgithubrepo data-structures-exercises "Various data structures implemented in Python and C." creates a GitHub repository at https://github.com/JASchilz/data-structures-exercises with the description “Various data structures implemented in Python and C.”

July 13, 2018: Legendary Octo Sniffle Progress

Most of the mechanical work for the Legendary Octo Sniffle is complete! I’ve resolved a few interesting issues:

  1. I initially intended to use one smooth rod per leg, with the smooth rod sitting behind the lead screw. You can see this concept in my speculative drawing from March 19th.I knew that placing the rod to the side of the lead screw would allow the lead screw to sit further back, allowing the effector arms to sit further back and afford more print area, but I thought to leave this as an exercise to my students.It turned out that the lead-screw-forward configuration gave an unacceptable loss of print area: I had to push it back and the smooth rod to the side. In doing that, I designed it to accommodate two rods per leg.

    Using two smooth rods is also superior. This is because the lead-screw nut is a little loose: it’s only designed for linear drive in one axis and it’s not very good at preventing motion in the other five axes. So the carriages, as configured in the picture above with only a single smooth rod, yaw just a tiny bit. But a second smooth rod per leg eliminates this yaw.

  2. I’m using magnetic effector joints. And specifically, I’ll begin by using this magnetic effector from Thingiverse.All of my prints so far has been in PLA, but I’m using ABS material for this print because of the high temperatures endured by the effector. Printing in ABS is hard! My cheap printer has a tough time keeping its print bed at 90 degrees celsius: a good temperature for keeping the object stuck to the bed during the print.I managed to get a single effector printed. The rest, which I am printing for my students, all popped off the bed; it was my first true spaghetti print. I’ll have to add insulation to my heat bed, and maybe an enclosure, in order to reliably print these parts.

Mechanically, I still need to complete the effector arms and attach the effector. I also have to mount the end-stop switches and the extruder. Then I’ll complete the electronics, including the power supply, a heated bed, and the RAMPS control board.

April 20, 2018: APRS Roadtrip with APRSDroid and the Baofeng UV-5R

I’m flying down to Santa Barbara on Monday to meet my family for a few days. They’re returning from a motorhome trip, and I’m lending a hand by driving their car back up to Oregon. It’s a great chance for me to complete some experiments with APRS.

The Automatic Packet Reporting System (APRS) is a digital ham radio system for broadcasting short messages. The APRS network has both a physical and an internet component: messages sent by radio are broadcast to all listening stations, and rebroadcast by all receiving repeaters; some repeaters function as internet gateways, injecting the messages they receive into the APRS internet backbone. The internet gateways also provide a limited form of routing, selectively rebroadcasting messages from the internet backbone into their local radio region.

An APRS frame contains the call sign of the sending station, and may optionally be addressed to another station’s call sign. But most APRS messages are status reports that broadcast information about a sender’s location, movement, or local weather conditions. Here’s APRS data from the Seattle area, with a great deal of it sourced from internet stations.

Following a few YouTube videos and blog posts, I’ve begun transmitting a bit of APRS location data. The simplest setup involves a smart phone, a handheld VHF radio, and an audio cable to connect the two. The smart phone collects GPS data and constructs APRS data frames, sending them out through the radio via the audio cable. And of course, an amateur radio license is required as well.

The Baofeng UV-5R, my handheld radio, is inexpensive and popular, but a little finicky for this application. I tried strapping the whole setup to my bike for a ride last week, and somehow neglected to transmit any data. This road trip will be a great chance to work out the kinks. You just might be able to follow my progress with this APRS.fi tracking link.

When I’m done, I’ll write it up. My ultimate goal is to create an APRS beacon for bike, backpack, and sailboat. I’m working on a goal-tracking server, and it would be pretty awesome if it could automatically consume this location data off of the APRS internet backbone to see when I’ve completed recurring goals like finishing a bike century or summiting a 12k+ peak.

April 17, 2018: Passing the Amateur Extra Class Exam

I passed the ham radio amateur extra class exam last night. The extra class exam is the third in a series of three licensing exams. And though the extra class endorsement opens up some extra band privileges, I wanted to pass the final test so that I could volunteer to administer exams to other licensees.

Many of the answers in the first two exams are common sense, or can be guessed at given some background knowledge in electronics. There are also only about 400 questions in each pool of available questions for the technician and general class exams. On the other hand, the extra class exam has a pool of about 700 questions, and many of these are about very specific circuits, regulations, and scientific effects. Whereas there were maybe 100 questions I committed to memory for the first two exams, there were about 500 questions on the extra class exam that I needed to memorize.

Here was my strategy:

  1. I downloaded the list of test questions and created a flash card deck for Anki.
  2. I borrowed the ARRL Extra Class License Manual from the library.
  3. One chapter at a time, I read the book for some combination of familiarity and understanding: some chapters I was able to read for full comprehension; for difficult chapters it was my goal just to become familiar with that chapter’s words, images and concepts.
  4. At the end of each chapter, the ARRL license manual lists all of the test questions that were covered in that chapter. When I finished a chapter, I tagged all of those questions in my flash card program with their corresponding chapter and added them to my study deck.
  5. Just before sitting the test, I did a bit of cramming by searching out all of the questions I had a difficult time remembering: prop:ease<2.5. I tagged these questions–about 150 total–and moved them into a special “cram” deck.

It took me a week of studying and I correctly answered 45 out of 50 questions!

I’m always surprised by the number and diversity of people that come to Ada’s to become certified. In the thirty minutes that I was at the test I saw maybe ten people in the exam room, and I got the impression that more would be showing up. It was a real diversity of age, gender, and race. My own interest in ham radio has to do with sailing and a general interest in electronics, communication, small-scale disaster response. And, I guess, it’s also nice to be part of a community of geeks.

After the test I talked for a while with a guy who had just passed his general class exam: he was using amateur radio to talk with his daughter, and also to hedge against TEOTWAWKI. I wish I could have asked more people why they were there that night.

March 19, 2018: Legendary Octo Sniffle 3D Printer Design Project

I’ve built a couple of 3D printers from kit. For me, a “3 hour” or “8 hour” assembly turns into 10 hours or 24 hours. I began to wonder: how could you design a printer with the easiest and quickest assembly?

The Legendary Octo Sniffle project is an answer to that question! It’s a delta printer under design, featuring a lead-screw drive and magnetic effector joints.

I have a few former students and coworkers who are interested in getting into 3D printing, so we’re getting together to design the printed parts.

See the Legendary Octo Sniffle design repo on GitHub.

Depiction of a simple effector carriage/sled.
Depiction of a simple effector carriage/sled for the Legendary Octo Sniffle.

March 4, 2018: Chilly Hilly 2018

Last weekend I rode in Cascade Bicycle Club’s Chilly Hilly ride, a ride around Puget Sound’s Bainbridge island. Here’s the route.

Rounding a corner in the Chilly Hilly 2018 ride.
Cascade Bicycle Club’s Chilly Hilly, 2018. Riding past the Sinclair Inlet. Courtesy Woodinville Bicycle.

You show up at the Seattle ferry terminal at 8 or 9am on a Sunday morning in late February, join a horde of cyclists loading into the Bainbridge ferry, cross the Sound, unload, and bike 33 hilly miles around the island. At the end is a charity chili feed and a ferry to take you back to Seattle. It’s a fun shakedown ride to open the year.

Knees

The great success for me this year was my knees! I’ve struggled with moderate knee pain for about ten years. For some months last fall, after a challenging hike, I wasn’t able to ride for more than 15 minutes without serious knee pain.

Desperate and frustrated, I bought knee braces. And they worked for me! I was able to work up to longer rides, culminating in the Chilly Hilly. I’ve got a set of sleeves for biking and a set of strap on braces for running. The sleeve type knee braces are more comfortable, but they slide down my leg if I take them for a run.

Blood Sugar

My next challenge is managing my glucose! I hit the wall hard in the last six miles of the ride. As I was working along the southwest corner of the island my vision began to dim and I had trouble balancing on the bike as I cruised down hills. Pedaling up hills became impossible. At the finish line, I stumbled into the chili feed, received my bowl, and then sat recovering for an hour, stealing cornbread muffins that other bikers left on the table as they departed for the ferry.

Another rider let me know that he also “bonks” on rides. Armed with a word I could Bing, I found the solution to my problem: consume calories throughout the ride. Expect more posts on my progress.

February 21, 2018: My OMSCS Admissions Statements

Last year,  I applied to Georgia Tech’s Online Masters of Computer Science program. I’m now enrolled in my second semester; in my experience the program provides an excellent education and is an excellent match for my needs. But I’m not writing about the virtues of the OMSCS.

The application asks you to author two statements: a background statement and a statement of purpose. I sometimes visit the OMSCS subreddit—an excellent resource for anyone considering the program—and think over my experience with the admissions process. My statement responses and approach were a bit unconventional, but they didn’t disqualify me. I’m sharing them here for anyone exploring the long tail of Google advice for getting into the program.

Statement of Background

As I understood it, OMSCS admission is not competitive: they’ve employed an educational platform that scales, and would like to admit all who are qualified to study on that platform. I can’t find an official quote to that effect, so take it as heresay, but it’s the assumption that I base the rest of this post on.

Given that, Georgia Tech’s first question is, “Are you prepared for the program?” You answer this question in the background statement. Here’s their instruction:

Please describe your background (academic and extracurricular) and experience, including research, teaching, industry, and other relevant information.

And my response:

GENERAL

* Programming for 20 years, starting with language C.
* Picked up PHP, Python, and other languages as ideas or projects arose.
* Four year enlistment in the Marines.
* Achieved transfer admission to University of California, San Diego, towards goal of becoming a high school mathematics teacher.
* Minored in Mathematics, majored in Cognitive Science, with focus on theoretical neuroscience and machine learning. Graduated Cum Laude.
* Developed and analyzed behavioral experiments in MATLAB while working in a theoretical neuroscience lab, benchmarking results against Bayesian optimal models.
* Presented poster at Neuroscience conference.
* Taught high school math for two years in tribal, southwest Alaska.
* Formed company to develop educational software with machine learning component, in Python and Django.
* Now work as a web developer for the University of Washington, Office of Enrollment Information Services. Enroll in computer science and mechanical engineering courses from the University on lunch breaks.
* Teach Python to adult learners through the University's continuing education program.

CURRENT HOBBY PROJECTS

* 3D printer, built from kit.
* An interpretter/REPL for Bitcoin's internal programming language, built in JavaScript.
* Arduino programming, to include a networked alarm clock and networked thermostat.

RELEVANT COURSEWORK

* Natural Computation I (Machine learning via Bishop, plus applications in theoretical neuroscience, UCSD)
* Natural Computation II (Bayesian modeling in theoretical neuroscience, UCSD)
* Programming Languages (University of Washington)
* Data Abstractions (Data structures, concurrency, parallelism, and algorithms, University of Washington)
* Systems Programming (University of Washington)
* Operating Systems (Currently enrolled, University of Washington)

TEACHING

* High school mathematics, Yupiit School District, Alaska
* Python Internet Programming, University of Washington Continuum College.

Headings and bullet points. My experience with reading cover letters and resumes is that you get about ten seconds to convey your story to the person reading your application: your reader will glance over your application for about ten seconds before throwing you into either the “hard no” pile or the “maybies”. And did you read through the list? Or did you only take a few seconds to glance over it? If you only glanced, did you get a rough idea of a story from it?

I’m sure that the Georgia Tech admissions process is more holistic than a glance at your background statements, but I think that this list does convey a story to a ten-second scan.

Aside from listing the courses that I took in preparation for the program, I also wanted to answer some questions that might be raised by the rest of my application. I’ve picked up a lot of experience from different places: before and after the Marines, courses taken online and in person from community colleges in preparation for a transfer application, continuing education courses related to my Alaska teaching certificate. In the background statement, I wanted to put the story together: he transferred to UCSD to become a math teacher, and while he was there he did cognitive science research; he taught in Alaska, then followed up on that machine learning experience to develop educational software; now he’s programming for the University of Washington, taking classes, and teaching adults.

It’s a much tighter story in bullet points than I remember it in real life! And I’d like to say that if you had only looked over that list for ten seconds, you’d have picked up the highlights.

Nowhere in the application does it say that your description of your background has to be an essay. Use whatever format best answers the question of whether you have qualified yourself to join the program. In many cases, a list is the quickest way to answer that question with a “yes”. If you’re a marginal candidate trying to explain a 2.95 GPA with a story about challenge, perseverance, or growth then you might be able to best tell that story with an essay. In any case, choose the medium that suits the message.

Statement of Purpose

After answering whether or not you’re qualified to join the OMSCS, Georgia Tech will want to know whether your goals are a fit for the program. You address this in the statement of purpose:

Please give a Statement of Purpose detailing your academic and research goals as well as career plans. Include your reasons for choosing the College of Computing as opposed to other programs and/or other universities.

In effect, “Why Georgia Tech? Why the OMSCS?” or, “Will you be satisfied with your enrollment in this program?” My response:

In the next five years, I want to begin working on mission-critical aerospace software running close to the hardware.

The projects and companies that inspire me are constructing physical devices with semi-autonomous operation. For example, I'm working on a 3D printed, GPS guided autopilot for my sailboat. Most of all I want to work in aerospace, and I'm pursuing a master's degree to build the credentials and skills I need to begin programming real time control systems for that industry.

The OMSCS obviously presents the best combination of value, cost, and convenience for a working professional. For me personally, as an aspiring aerospace engineer, I hope that the program will yield an opportunity to work on a project that takes advantage of Georgia Tech's outstanding School of Aerospace Engineering.

You can use up to 4000 characters. I could have typed more, but I think that that would have obscured my answer: this thing that I want for myself is definitely something that Georgia Tech can help me achieve. Fewer words make it easier to see this at a ten-second glance.

Conclusion

I don’t think that my application really hinged on my application statements. I didn’t write them thinking that I had the burden of convincing anyone that I was qualified to join the program. My goal was to provide a story that led the reader through my application materials, a story that could be read at a ten-second glance.

It goes almost without saying that you shouldn’t reuse these materials directly for your own application. But I hope I’ve provided some inspiration!