Control software for the Drosophila handling robot MAPLE (Modular Automated Platform for Large-scale Experiments)
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

MAPLE v2 Control Software

This repository contains the software to control the FlySorter fly manipulation platform, specifically the hardware version MAPLE version 2.

The software is distributed under the GPL v2.0 license. See the LICENSE file for more details.

Installation (Windows only, for now)

  1. Install Python 2.7

Choose the appropriate installer package (x86 or x86-64) for your system. Preferable to install in default location (C:\python27)

Add c:\python27 and c:\python27\scripts to your path.

  1. Install pip, numpy, OpenCV, pyserial & "future"

Download and then run it. -- you're looking for the installer like numpy-1.13.3-2-cp27-none-win32.whl or numpy-1.13.3-cp27-none-win_amd64.whl From a command prompt, run pip install c:\path\to\numpy\file\numpy-1.13.3-2-cp27-none-win32.whl (change path and filename as appropriate) Double check by running python and typing: import numpy -- same as numpy... -- ditto

From a command prompt, type: pip install future This module makes some code written for Python 3.x compatible with Python 2.7, specifically py-ic-imaging-control

  1. Install driver & SKD for The Imaging Source cameras (optionally, viewer)

  • Device Driver for USB Cameras
  • IC Imaging Control C Library
  • optionally IC Capture - image acquisition

You'll have to add the DLL directory to your path at this point, which should be:

C:\Users\username\Documents\The Imaging Source Europe GmbH\TIS Grabber DLL\bin\x64 OR C:\Users\username\Documents\The Imaging Source Europe GmbH\TIS Grabber DLL\bin\win32

depending on which architecture you've got.

  1. Install py-ic-imaging-control - download archive as zip, unpack, then, in command prompt window, run: python install

  1. Download this github repository (

  2. Copy Examples\ExampleRobot.cfg to the main directory, rename (most scripts assume the name "MAPLE.cfg"), and edit as necessary.

  3. Use the GUI to drive the robot around

If necessary, edit to refer to the correct config file, then run it. If everything installed correctly, you should get a window that shows the camera view and the current position / state of the robot. Press '?' for a list of keyboard commands.

  1. Create or edit a workspace file that defines which modules are being used and where they are located

Some example workspaces are included in the Examples folder. To use one of them, move it to the main directory and rename to something appropriate. For example, if you created a layout that included the Fly Dispenser and a FlyPlate 96 well plate, you might call that (and again, it should be in the main directory so you script can find it.)

  1. Create or edit a script to run to actually do something with the robot!

Again, there are some samples in the Examples folder. They will need to be edited to account for:

  • your configuration file name
  • the workspace they depend on
  • the actual actions they take
  1. To use the remote operating mode (Listen Mode):

System Architecture

The goal of this platform is to automate various fly handling tasks. To accomplish this, we have designed a robot with a multi-purpose end effector, which has:

  1. Three independent Z axes: a) One to pick up and deposit flies b) One to focus a downward-pointing camera c) One to pick up and deposit other small parts (such as lids)

  2. A high-resolution camera ( This camera is affixed to the middle Z axis, which serves as its focusing mechanism.

  3. An LED ring to illuminate the space underneath the camera

  4. The two manipulators (fly and small part) can pick up and put down objects, and are independently controlled. Four solenoid valves control the flow of compressed air and vacuum to each manipulator.

Control of the robot is by way of a PC, running Windows.

So there are five different motors to control in the system (X, Y, and 3x Z axes), and four devices to turn on/off (the four solenoid valves).

We use a 5-axis SmoothieBoard ( to control the 5 motors, and also the 4 solenoid valves (by way of load switches). The Smoothie connects to the PC by USB, and appears as a COM port to the operating system. It uses G-Code to communicate with the PC (

The Python code in this repository translates API calls into the appropriate G-code commands and sends them to the Smoothie (and waits for replies, as appropriate).


This code was authored by: Dave Zucker, Tom Alisch, Yong-Li Dich, William Long, and Ben De Bivort