HackSpace – September 2019

(Jacob Rumans) #1

FEATURE


A food-foraging C. elegans robot


distributes power and controls signals from
the Raspberry Pi to the servos. Each servo
is capable of maintaining a specified
angular position that translates to
intersegment angular positioning.
We designed the parts and exported
them as STL files so they could be printed
on most 3D printers. The head is designed
to support sensors for food foraging and
touch, while segments support wheels and
parts of the electronics.
The segments are articulated. A servo
is mounted on the front top of the
segment, with its geared shaft extending
into an aperture in the next forward
segment. An arm secured to the gear
sits in a recession in the segment that
transfers the angular movement of the
gear into angular movements between
the segments.
As previously noted, the locomotion of
the worm was described in a paper that
specified a fine-grained model of the
worm’s neuromuscular system.
Unfortunately, the model entails a
computation-intensive physics engine that
is too demanding for the Raspberry Pi,
hence the recording/replay procedure.
The robot replays a recorded sequence
of segment angle positions, that are

generated by an offline run of the model.
Each entry in the recording is processed
at a fixed interval of time, and contains a
set of angles that are directly distributed
to the servos. The anterior (forward)
segments receive signals of greater
magnitude than the posterior (rear)
segments. The overall effect is to
achieve an undulating forward motion
that simulates actual worm locomotion.
Sample recorded angular movement data:

[78,-0.63,-0.65,-0.62,-0.58,-0.55,-0.51,-
0.48,-0.44,-0.41,-0.37,-0.34,-0.30],

[219,-0.63,-0.65,-0.62,-0.58,-0.55,-0.51,-
0.48,-0.44,-0.41,-0.37,-0.34,-0.30],
[375,-0.63,-0.65,-0.62,-0.58,-0.55,-0.51,-
0.48,-0.44,-0.41,-0.37,-0.34,-0.30],
[531,0.63,0.00,-0.62,-0.58,-0.55,-0.51,-
0.48,-0.44,-0.41,-0.37,-0.34,-0.30],
[672,0.63,0.65,-0.62,-0.58,-0.55,-0.51,-
0.48,-0.44,-0.41,-0.37,-0.34,-0.30],
[812,0.63,0.65,0.00,-0.58,-0.55,-0.51,-
0.48,-0.44,-0.41,-0.37,-0.34,-0.30],
[937,0.63,0.65,0.62,-0.58,-0.55,-0.51,-
0.48,-0.44,-0.41,-0.37,-0.34,-0.30],
[1047,0.63,0.65,0.62,0.00,-0.55,-0.51,-
0.48,-0.44,-0.41,-0.37,-0.34,-0.30],

The recording is transferred to the
Raspberry Pi via the scp (secure copy)
command. To run the robot, the user logs
in via SSH, and executes a Python script
that initialises the servos and executes the
recorded file line by line.
A short video of the robot in action can
be viewed here: hsmag.cc/TjaLNi.

V2: FOOD FORAGING
The RPi version supported locomotion,
however, we also wanted to have the robot
forage for simulated food. C. elegans
forages for bacteria in its environment by
sensing and following salt gradients

produced by the bacteria. For the robot, a
sensor that can provide a proximity signal
to a simulated food source was needed as
a counterpart. A chemical sensor was not
deemed to be feasible. Several other types
of sensors were tried: sound, laser
distance, and sonic.
Unfortunately, we found it difficult to use
the Raspberry Pi to both read the sensors
and drive the servos. So, for the second
version, a new processor was selected,
the ESP32 system on a chip (SoC).
The ESP32 provides a MicroPython
interface that can run numerous general-

Resources


The 3D models, code, assembly instructions,
and parts lists are available at:
github.com/openworm/robots


Both implementations of the robot can be
constructed by someone with moderate
technical skills, after obtaining the parts from
various vendors.


For the robot, a sensor that can provide


a proximity signal to a simulated food


source was needed as a counterpart


Above
One segment assembled and ready
to be inserted into the worm
Free download pdf