Author Archives: Luke

Cruise Control for Electronic Skateboards

Hoon and I wanted to attack the problem of campus transportation. Or, we were just excited about electric skateboards that were showing up in Kickstarter. Anyways, we wanted to do a project on electric skateboards.

The problem we saw with the existing skateboards was that they needed a special hand-held remote controllers like the one on the below.

Remote controller for e-skateboards

These controllers seemed cumbersome, and the interface didn’t seem intuitive enough to be safe. I mean no one rides the skateboard with fingers. We wanted to make new interface to control these e-skateboards.

Our idea was that e-skateboards should be ridden the same way as the normal ones. We believed that our results should be something similar to the hoverboard from the movie, ‘Back to the Future'(Our team name ‘BCDEF’ comes from this. It’s read as ‘B to F’).

Hoverboard from Back to the Future

To implement this, we put magnet on the wheel and used hall sensor to get the RPM of the board. After the rider kicks the board and put her/his feet on the board, the pressure sensor detects it, and the control system tries to maintain the RPM of the board, measured using the hall sensor.

Pressure sensor is located in the crossing point of X

The prototype was successful! Our project attracted many interests and even managed to get scholarship from NAVER. We were invited to NAVER D2 Startup Factory in Seoul.

During our stay in NAVER D2 Startup Factory, we tried to build commercial level products. We tried to develop our own PCB, BLDC motor drivers, hardware, and safe control algorithms, and had some success. Although we couldn’t make it to the actual commercialization steps, this was enlightening experience, and we learned a lot about motors and electronics.

Our first success in driving BLDC motor
Our second success
Our final success

Brief summary of my Master’s thesis

I got my Master’s degree from Virtual Machine & Optimization Laboratory(advisor: Soo-mook Moon) in Seoul National University.

My research involved speeding up JavaScript engine. My thesis is written in Korea, so I am briefly summarizing my work in English here.

Thesis : Recycling Optimized Machine Codes Generated by JavaScript Engine

In a virtual machine of dynamic languages, machine codes generated by optimizing just-in-time(JIT) compiler are recyclable, and they can enhance the execution speed of a program, if recycled judiciously. Machine codes are recyclable if they can be reused in the subsequent executions of the same program. They need to be cached in the first run, and pointers they contain must be adjusted in the later runs.

Traditional recycling techniques were limited to non-optimizing JIT compilers, whose generated codes only contain easy-to-patch pointers. To handle pointers in optimized machine codes, I classified the pointers into 3 groups: (1) recognizable from the original source program; (2) recognizable only by tracing the optimization processes; (3) unrecognizable. The unrecognizable ones are created by dynamic profiles in the virtual machines. First group is handled by the usual table keeping method. Table containing the pairs of pointer location and pointer identity is created during compilation. Second group is also treated using the same table, but additional identity transmitting is necessary during the optimization phases. Third group is simply removed from creation. The compiler is modified to remove such pointers.

We implemented this idea to one of commercial JavaScript engines called JavaScriptCore, which is powering the WebKit framework. Experiment with Sunspider benchmark showed at most 29% improvement in speed and on average 11%.

3d Printers

After encountering Hoon Kim from MAD(Mobile App Development) Camp, we became close friends. We shared common interests and were eager to build something interesting.

One of the things we got interested was 3d printers. We were fascinated by the idea of self-replicating systems, and we knew we had to build this. To work on this, I moved to his home in Jechon right after the camp. Below is the picture of the work space we set up in Hoon’s garage.

We wanted to make it from scratch, but it was really hard to get suitable parts. Although it was claimed as “self-replicating”, mechanical parts such as metal rods and belts were really hard to obtain. We visited Ewha Univ., Guro, Yongsan, and even Hwasung to gather these. In the end, we gave up and settled for a kit sold in Hwasung.

Although we couldn’t replicate another 3d printer(our winter break ended, and our interest shifted), the experience of gathering the parts and building the printer with Hoon was so much fun. We learned a lot about soldering through this experience.

I really miss those days.

This slideshow requires JavaScript.

λanguage Parser

I did my Master’s degree from a lab that focused on compilers and virtual machines. Surely enough, we were sometimes expected to write a compiler for unfamiliar languages in cooperative projects.

Tedious but unavoidable work in writing compiler is making a parser, and I really hated using ‘lex’ and ‘yacc’ for the job; I always found LALR parser generators distasteful, and it was immoderate to write prototypes in C.

So when I had to write a kind of an interpreter for a project with Samsung, I used Ometa-JS, a JavaScript parser generator based on PEG(parsing expression generator), and the result was incredible: It took only 3 days to write the entire interpreter, while my colleague was not able to finish his work with lex&yacc that started months ago.

I attribute the following for this success: 1) PEG is much intuitive than CFG; 2) dynamic language wins in prototyping; 3) plain lists & dictionaries are useful than structured data; 4) JS comes with some meta-programming facilities.


Because of the confidentialiy issue, I cannot disclose the code I wrote; instead, I am enclosing another parser I wrote in Ometa-JS.

This is a spin-off version of λanguage tutorial( The tutorial defines a new language and names it λanguage. It walks you down how to write recursive descent parser, interpreter, and CPS transformer in JavaScript. It’s a great fun and I adapted the parser part with Ometa-JS


For more information,


Drawing as a Child

As a child, I used to like drawing much; I even aspired to become a painter or a designer. My other passion at that time was about medieval fantasy. I was inspired by the creature designs of games such as Lineage.
I don’t remember the title of the book, but my school sold a drawing book about fantasy creatures. The below drawings are the results of going through that book. It was mostly just mimicking, but these were the first drawings I made with some completeness.

LED Matrix

Ok, so this was just a hobby project. I was avid for Arduino projects back in 2015 and this is one of the results of tinkering.

I came by this amazing project from instructables( and decided to work on it myself.


Outline of the project

Basically, this is just a grid of LEDs. You arrange and solder them so that all the anodes are connected in each row and the cathodes are connected in each column.

As you can see, this involves considerable amount of soldering.

By applying a voltage on one pair of these rows and columns, you can light on a LED that corresponds to the pair.

Actually, in this project, you will light row by row, from top to bottom to make a picture. The refresh rate should be fast enough to make an illusionary effect.


So what you need is the following 4 things.

  1. Electrically controlled switches. Transistors!
  2. A device to sequentially pick one row one at a time. A decade counter!
  3. A device to save row data. A shift register!
  4. A processor to mediate all these. Arduino UNO!

The above picture is the final assembly on PCB.

You can check out more details about this project from the link below.



Lessons Learned

The most important thing that I learned from this project was the need of more safe environment to work. I was so lucky to have no accidents.

Also, I found that a good tip for the welder and use of thin single-core solder dramatically increased the quality of the soldering. The wicks were also super useful.

Better documentation of the project could have been helpful.


Final Demo

A heart displayed on the matrix for Tae-yu. I love you Tae-yu 🙂



Maritime RobotX Challenge 2014

Project Summary

This is an autonomous unmanned-surface-vehicle(USV) that contended for Maritime RobotX Challenge 2014, organized by AUVSI Foundation and sponsored by Office of Naval Research (ONR).

I worked with Team KAIST in building this robot, and our team won 2nd place in the competition!!

The USV had to perform various tasks — including navigation, sonar detection, color detection and symbol identification — using various sensors.

Watch the above video to get the feel of the USV.


My Contribution

According to the team’s official website, the project lasted from Nov. 29, 2013 to Oct. 26, 2014; my involvement span from June 2014 to August 2014.

My major contributions to the project are solving the problem of thruster control and implementing a multi-client broadcast server.


What Did I Do Exactly?

1) Thruster Control

The biggest problem I saw with this project was the team’s failure to control the thrusters with programs. Thruster, which was provided by Torqeedo, was the only actuator in the robot that propelled the vessel into motion. The team was not able to carry out any field tests without having it in ready condition. Tests were getting delayed and people were getting really frustrated.

This situation was due to the lack of information on the internal architecture of the Torqeedo thrusters and understandings in asynchronous I/Os. The team’s frustration is clearly presented in their project site.


By the time I joined the team, they managed to obtain the information from Torqeedo. However, they still could not figure out how to programmatically control this. Fortunately, I was really interested in asynchronous I/Os and was programming Arduinos as a hobby at that time. I knew I could solve this problem and jumped right into it. Indeed, with many trial-and-errors, I came up with a solution that used both the HW and SW interrupts in Arduino Uno to properly handle 3 communication signals coming from RF module, main computer and the thruster itself.


This was such a rewarding experience: not only did I solve an important problem for others, but I did it with the knowledge that I acquired solely for my own curiosity. The connection between the two was a real thrill to me, and I believe it has guided me through my journeys in Computer Science.


2) Multi-client Broadcast Server


Another, relatively minor, issue was the absence of proper multi-client broadcast server. There was already a single-client, but this did not suffice. I still do not understand it, but they wanted the server implemented in C/C++. Rather than using multi-threads, I used multiplexing I/O to lower the pressure in the main PC. The book CSAPP, probably the best systems book out there, was very helpful in doing this.







3) Field Testing, Soldering and other HW stuffs…

Besides programming, I did field tests, soldered wires to boards, attached connectors to wires and assembled jigs for the first time in my life. I found myself really enjoying these, and it influenced me to work on other HW projects later on.


Looking back on my experiences, I think we could have done better by using ROS. It feels like the team unreasonably fixated on using bare C/C++. Most of the difficulty they faced was plumbing, and this could have been easily mitigated by using the ROS infrastructure. They could have also simply obtained GUI tools with ROS, not needing to costly implement them with MFC. Nonetheless, the team members were so nice and I really had an incredible time with them. It was also the place where I could learn hardware and new exciting problems such as sensor fusion(Kalman filters) and image recognition.


For more information visit,