Arduino MeArm USB-serial terminal using Vim-like shortcuts
C++ Ruby Makefile
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

arduino-mearm FreeBSD Build Status

Responsive and smooth servo steering of the Phenoptix MeArm robot using the Arduino microcontroller board.

MeArm servo steering

Polynomials for smooth motion profiles

Note, you might have to uninstall brltty if it conflicts with the Arduino ttyUSB0.

part list

Here is the list of parts I used.

JR plug

Screw terminal

MeArm connected to Arduino


Install the dependencies as follows:

sudo aptitude install arduino-mk screen google-mock ruby-rspec ruby-serialport ruby-qt4

Create the initial calibration file:

cp calibration.hh.default calibration.hh

Note: You might have to change the BOARD_TAG in the arduino/Makefile. See /usr/share/arduino/hardware/arduino/boards.txt for supported board tags.

Then build the Arduino program using make:



You can also build and run the tests on the PC using the check target:

make check

install on Arduino

The upload target will upload the program via /dev/ttyUSB0 to the Arduino board.

make upload

Warning: disconnect the servos from the power source while uploading the program to prevent erratic motion!

control robot

You can control the robot using the screen serial terminal:

screen /dev/ttyUSB0 115200

Examples of servo commands are:

  • r: check whether drives are ready to receive more commands (1=ready, 0=busy)
  • t: get time
  • b: get base servo angle
  • s: get shoulder servo angle
  • e: get elbow servo angle
  • g: get gripper servo angle
  • B: get base servo pulse width
  • S: get shoulder servo pulse width
  • E: get elbow servo pulse width
  • G: get gripper servo pulse width
  • c: get current configuration (base, shoulder, elbow, and gripper)
  • l: get lower limits for servos
  • u: get upper limits for servos
  • 45b: set base servo angle to 45 degrees
  • -12.5s: set shoulder servo angle to -12.5 degrees
  • 10e: set elbow servo angle to 10 degrees
  • 30g: set gripper servo angle to 30 degrees
  • 2400B: set base servo pulse width to 2400
  • 1500S: set shoulder servo pulse width to 1500
  • 1500E: set elbow servo pulse width to 1500
  • 544G: set gripper servo pulse width to 544
  • 1 2 3 4c: set configuration (base, shoulder, elbow, and gripper) to 1, 2, 3, and 4 degrees
  • 1 2 3 4t: time required to reach the specified configuration
  • ma: save teach point a (there are 12 teach points from a to l)
  • 'a: go to teach point a
  • pa: display configuration of teach point a
  • x: stop all servos (in fact any undefined key should do)

You can exit the screen terminal using Ctrl-A \.

Warning: self-collisions of the robot can damage the servos!

Warning: closing the gripper too far on an object can damage the servo!

Note that because of the teach points the program is short on memory (1024 bytes on Arduino Diecimila). Memory corruption can cause self-collisions. However one can test the program without servos being powered.

file structure

  • .: control software with tests
  • arduino: software to upload onto Arduino board
  • etc: prototype software, math, and simulations


You can edit the calibration.hh file and update the software on the Arduino. It is possible to specify the zero position and the resolution of each servo. Furthermore the limits for each servo can be adjusted in order to avoid self-collisions. The elbow and shoulder angles are limited against each other.

The zero configuration should look as follows:

  • base aligned with platform
  • shoulder pointing upward
  • elbow horizontal
  • gripper tongs at -45 and +45 degree


Thanks to Ian Patient for pointing out the Bernstein polynomials for achieving smooth robot motion.

External Links