Skip to content

navotoz/EnvChamberCtrl

Repository files navigation

Environment Chamber Ctrl module

Introduction

The environment chamber is composed of Six modules:

  • Oven - controlled via the Campbell controller.
  • Camera TAU2 - connected to the PC via USB.
  • Black Body - connected to the PC via Ethernet cable (The PC has two networking cards, thus allowing both the BB and the ARO network to work simultaneously)
  • Focus Stage - a Nanomotion inc. stage, connected to a re-worked lens, that can change the focus of the camera.
  • Scanning Mirror - Arduino connected to a mirror via a stepper motor, to allow for wider photography angles.
  • PC - connected to all of the above and running on Linux, and controlling all devices via a GUI written with python 3.8.

Caution

Do not change the state of the air-conditioning in the room during the entire run. Preferably - do not use it.

Installation

Requirements

The server is run using python 3.8 with requirements detailed in requirements.txt.

Installation

  1. Focus the Camera on the surface of the BlackBody. This is done by holding a metal slide outside the BlackBody ( to avoid scratches), on the approximate position of the hot surface. The focus can be done on the edge of the metal slide.
  2. Install Python with pip support, preferably using Anaconda package manager.
  3. Create a virtual environment and install the requirements file using python -m pip install -r requirements.txt
  4. Follow the next steps:
    1. Open the terminal (Ctrl+D)
    2. Write sudo su and enter the computer's root password.
    3. Write: echo "SUBSYSTEM==\"usb\", ACTION==\"add\", ATTRS{idVendor}==\"0403\", ATTRS{idProduct}==\"6010\", MODE=\"0666\"">/etc/udev/rules.d/99-taucamera.rules
    4. Write: sudo usermod -a -G dialout $USER
    5. Write: echo "SUBSYSTEM==\"usb\", ACTION==\"add\", ATTRS{idVendor}==\"067B\", ATTRS{idProduct}==\"2303\", MODE=\"0666\"">/etc/udev/rules.d/99-nanomotionstage.rules
    6. Write: echo "SUBSYSTEM==\"usb\", ACTION==\"add\", ATTRS{idVendor}==\"1772\", ATTRS{idProduct}==\"0002\", MODE=\"0666\"">/etc/udev/rules.d/99-thermapp.rules
    7. If 1-5 doesn't work, check which USB the device is connected to via lsusb and write in terminal: sudo chmod 666 # Where # is the correct device address.
    8. Reboot
  5. Install TkInter sudo apt-get install python3-tk
  6. The IP of the BlackBody can be found on the controller of the BB in "Menu"->"About". It is connected via ethernet to the secondary network card on the PC. In order to use the BlackBody, both it and the PC should be on the same network domain, meaning that PC address should look like [BlackBody].[BlackBody].[BlackBody].[DIFFERENT THAN THE BLACKBODY] The same digits for the first three blocks in the IP, and the last block different than the BlackBody. Currently, the Blackbody address is 10.26.91.56, so set the IP of the PC to 10.26.91.55.
  7. The oven is controlled via Loggernet, a proprietary software by Campbell scientific. Install VirtualBox, ** VirtualBox Extension Pack** and load the image win10_loggernet. These are all found in the Devices->Campbell-> VirtualBoxInstallation
  8. Enter in the terminal sudo usermod -a -G vboxusers $USER
  9. Enter in the terminal sudo usermod -a -G dialout $USER (if you had not done so already)
  10. Reboot.
  11. Make sure the oven is connected to the electricity, the Campbell controller is ON and the USB2Serial is connected to the PC.
  12. Make sure the ON switch on the front of the oven is ON, and the red light shines.
  13. After starting the WIN10 VM, make sure there is a 'V' next to the USB2SERIAL name in the options of the VM.
  14. Inside the WIN10 VM, check the COM port of the USB2SERIAL.
  15. On the Loggernet->Setup make sure the COM port is the same as on the device manager.
  16. Important notice - when the USB2SERIAL 'V' in the VM options is activated, the oven CANNOT be accessed from Python.

Usage

Test mode

Each device in the GUI window has a radiobox with "Real", "Dummy" and "Off" labels.

  • To use a dummy move the radiobox to "Dummy".
  • To prevent the use of the device, move the radiobox to "Off".

Take a photo

  1. Connect the Blackbody to the secondary network card. Make sure all IP configs are on-par with step (4) in the setup. Turn it on.
  2. Connect the Camera Tau2 336 to the USB socket.
  3. Run main.py.
  4. Set which type of devices to use - either 'dummy', 'off' or 'real' if connected.
  5. Set the experiment save directory with "Browse".
  6. Parameters for un-detected of 'off' devices will be grayed-out.
  7. The livefeed from the camera can be seen in "Viewer".
  8. Previously taken images can be watched in "Upload".
  9. To set a temperature for the oven:
    1. Start the Win10 VM, and LoggerNet.
    2. Turn on the controller and the oven itself.
    3. Connect the controller to the PC via the USB2SERIAL cable.
    4. Make sure there is a 'V' on the VM options for the USB2SERIAL.
    5. In the "Connect" screen of LoggerNet, press "connect".
    6. Set the setPoint in the NumDisplay to the desired temperature.
    7. Notice that the switch on the front of the oven must be ON to enable the heating.
    8. Wait for the settling of the temperatures.
  10. Set the number of minimal minutes to wait between consecutive experiments in the top-left corner.
  11. Press "Start".
  12. A progress bar is updated throughout the experiment.

Photo name parse

The FPA and Housing temperatures are acquired from the internal camera sensors.

YYYYMMDD_hHHmMMsSS_<device name>_<device value>_..._fpa_<FPA temperature>_housing_<Housing temperature>_<number of image>of<total number of images for this combination>.npy
mask.npy

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages