Difference between revisions of "Poseidon Syringe Pump"

From MC Chem Wiki
Jump to navigation Jump to search
Line 10: Line 10:
  
 
The .stl files for the 3D printed parts can be found [https://github.com/pachterlab/poseidon/tree/release/HARDWARE/pump/stl here].
 
The .stl files for the 3D printed parts can be found [https://github.com/pachterlab/poseidon/tree/release/HARDWARE/pump/stl here].
 +
 +
You may consider cloning the main project repository, since it includes all of the software we will need to run it. I would recommend cloning it to the desktop of the Raspberry Pi that you will be using for the project.
  
 
== Assembly of 3D-Printed Parts ==
 
== Assembly of 3D-Printed Parts ==
Line 142: Line 144:
  
 
You can find the instructions on how to set up the Arduino and the CNC shield [https://www.youtube.com/watch?v=Xl02fsRCJ7U here]!
 
You can find the instructions on how to set up the Arduino and the CNC shield [https://www.youtube.com/watch?v=Xl02fsRCJ7U here]!
 +
 +
== Downloading and Running the Software ==
 +
 +
If you have not already done so, you should navigate to the [https://github.com/pachterlab/poseidon Github repository] for the Poseidon project and clone this.

Revision as of 21:18, 9 February 2019

Overview

This page is dedicated to the set-up of the Poseidon Syringe Pump (as originally constructed by the Pachter Lab at CalTech) for Advanced Physical Chemistry (Spring 2019). The project page is found here: Poseidon.

Obtaining Materials and Printing Parts

You can find the list of materials and vendors here.

Next, you must print the parts for the syringe pump apparatus.

The .stl files for the 3D printed parts can be found here.

You may consider cloning the main project repository, since it includes all of the software we will need to run it. I would recommend cloning it to the desktop of the Raspberry Pi that you will be using for the project.

Assembly of 3D-Printed Parts

The Pachter lab has created helpful videos on the construction of the pump apparatus once you have all the necessary materials and 3D printed parts.

Syringe Pump Assembly

Microscope Assembly (Optional)

Raspberry Pi Set-Up

If you are using a brand-new Raspberry Pi, you should see this page on set-up basics.

Once you have installed your Raspbian OS using NOOBS, you should connect to a Wi-Fi network. Then, open a terminal and run the following:

To update the Pi:

    sudo apt-get update

To upgrade the Pi:

    sudo apt-get upgrade

(If either of the above commands fails, then you have not connected to a Wi-Fi network yet... Do this and try again.)

To install a necessary GUI dependency:

    sudo apt-get install python3-pyqt5

To install a necessary library that will allow us to establish a serial connection between the Raspberry Pi and the Arduino:

    sudo pip3 install pyserial

We need to install a library called OpenCV, but first must get its dependencies by using the following commands:

    sudo apt-get install libatlas-base-dev
    sudo apt-get install libjasper-dev
    sudo apt-get install libqtgui4
    sudo apt-get install libqt4-qt3support
    sudo apt-get install libqt4-test

There is apparently some difficulty with loading OpenCV through the terminal... So we will put some extra steps into the process. We first must install an updated version of the Python Package Manager (pip) via the following:

    wget https://bootstrap.pypa.io/get-pip.py
    sudo python3 get-pip.py

Now officially getting OpenCV-Python is another series of steps:

    wget -O opencv.zip https://github.com/Itseez/opencv/archive/3.4.1.zip
    wget -O opencv_contrib.zip https://github.com/Itseez/opencv_contrib/archive/3.4.1.zip
    unzip opencv.zip
    unzip opencv_contrib.zip
    sudo apt-get install cmake
     cmake -D CMAKE_BUILD_TYPE=RELEASE \
     -D CMAKE_INSTALL_PREFIX=/usr/local \
     -D INSTALL_PYTHON_EXAMPLES=ON \
     -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.4.1/modules \
     -D ENABLE_PRECOMPILED_HEADERS=OFF \
     -D BUILD_EXAMPLES=ON ..

Now, open a new tab in the terminal (SHIFT+CTRL+T) and do the following:

    cd
    cd ..
    cd etc
    sudo nano dphys-swapfile

You will have to save the file using CTRL+O (this will write out the change to the file) and then hit enter. Now hit CTRL+X to exit the Nano Editor.

    sudo /etc/init.d/dphys-swapfile stop
    sudo /etc/init.d/dphys-swapfile start

This is done to facilitate compiling the OpenCV code using all four cores of the Raspberry Pi... Now, back to the other tab. Enter the following:

    make -j4

This should take care of the compilation. Since we have allowed all four cores of the Pi, this should only take about 2 hours... (Yes, I know that is a long time to wait - grab yourself a cup of coffee.)

WARNING: You had better put your heatsinks on the processors of the Pi before running this because it is going to use every bit of processing power that the Pi has... It's going to run at 100% for the entire time and give you a temperature warning.

Next, you simply need to run the installation:

    sudo make install
    sudo ldconfig

Now you should test the installation to ensure it was successful. This can be done by firing up a Python3 interactive console and using two lines of code...

To launch a python3 interactive console:

    python3
    import cv2
    cv2.__version__


Since we are already working on the Pi, we should prepare by downloading the Arduino IDE. This can be done by first going to the Arduino Website and then selecting Linux ARM. This should initiate a download.

Once your file is downloaded, you must extract the file. You can do this by going to your downloads, right-clicking on the file (it should look something like "arduino-1.8.8"), and selecting Archiver. This will take a moment to load.

Once the red and green light in the lower right-hand corner has stopped flashing, you should click on Action and Extract. Then extract the contents to your Downloads folder.

Once you have successfully done this, open up a Terminal window! Type in the following:

    cd Downloads
  
    ls 

This should show all of the files/directories in your current working directory. You should see something like arduino-1.8.8 listed here. Next, type in:

    sudo ./install.sh

Congratulations, you have now installed the Arduino IDE onto your Raspberry Pi!!!

You should next download the AccelStepper library for the Arduino here.

Once downloaded, you will have to unzip/extract this to the following location: pi/Downloads/arduino-1.8.8/libraries

If you are using the touchscreen display and Pi Microscope, then you should consider watching this video!

Arduino Assembly

You can find the instructions on how to set up the Arduino and the CNC shield here!

Downloading and Running the Software

If you have not already done so, you should navigate to the Github repository for the Poseidon project and clone this.