Haptic Interface with Tablet Display
  • Device Home
  • Contact

Tablet Browser

Data from the server is transfered via Socket.io’s TCP protocol to a Chrome browser on the tablet. Initialization events are sent from the tablet browser to the server and once the simulation begins, the state of active objects are updated at a rate of 60Hz with every ‘state’ event sent from the server.

Graphical Environment

The graphical environment is rendered by Chrome using the Paper.js open-source vector graphics scripting framework, running on top of the HTML5 Canvas element. The animation frame is updated with every new ‘state’ event received by the browser.

You can checkout the code here.

Node Server

The http server is run on Node.js®, the event-driven, non-blocking I/O platform, built on Chrome’s JavaScript runtime environment. The Node.js® framework allows for pseudo real-time communication with the browser via Socket.io’s TCP protocol as well as the Arduino Due microcontroller via the node-serialport (UART) open-source library. The non-blocking I/O handles multiple communcation loops running at different rates. In addition to its real-time capabilities, Node.js® allows for cross-device compatibility, since it only requires a browser on which to run.

You can checkout the code here.

Virtual Environment

The virtual environment runs within the Node.js runtime and simulates the physics using a Chipmunk Physics library that has been ported to JavaScript.


The Arduino microcontroller and Node communicate using a COM port and the UART serial protocol. A synchronised loop is established upon connection where the microcontroller receives force data then replies with the updated position data. Node handles incoming data with Node Buffer objects to read the raw bytes as floating point numbers.

You can checkout the code here.

Encoder and Counter

The position of the end effector (user-interaction point) is calculated using the forward kinematics of the 5-bar mechanism. Each motor hosts an encoder which delivers a quadrature signal to a decoder IC. The decoder counts the rising and falling edges of the quadrature signal and stores the counted angle. Counting the angle at and storing it at a hardware level eliminates the limitations of using interrupts on the Arduino and allows for the system to run at a higher rate, improving fidelity.

Stepper Driver

Each of the three motors has its own driver. To reconfigure the mechanism, the stepper driver is taken out of sleep mode and high-low pulses are sent representing the number of steps to drive the motor as well as direction logic on a separate line. The position is calculated with an open control loop where the step count is converted to an angle an inputed into the parametric equations of the spiral, giving the distance between base joints.

DC Driver

Upon receiving force data, the Arduino calculates maps the cartesian forces to joint coordinates using the updated jacobian, based on the joint angles and stepper position. Torque commands are sent over the Arduino serial pins using the UART protocol. 3-byte commands are sent including one direction byte and two pulse-width-modulation command bytes.
500 400 300 200 100 1 2 3 4 5 6 7