SaddlebackCollegeRobotics / science_2022_23

SCR 2022-23's science package; Uses cli/srv ROS2 model to send commands to science equipment such as Lowering Platform, Vacuum/Pump, UV_Camera, and Funnel Cake

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

science_2022_23

Things to check:

  • The Funnel Cake and ATP testing chamber is mounted on the turret properly and is able to rotates to each five funnels under a singular channel for soil and water deposition and positions cuvettes. The testing chamber NEEDS TO BE is light-sealed, ensuring that NO outside light goes in and annihilate our extremely photon-sensitive PMT.

  • Make sure the Lowering Platform is in the front of the rover, with:

    • Camera
    • UV Flashlight
    • Light-blocking shroud
    • Vacuum tube connected to the ATP Apparatus
  • Make sure everything is connected to Nyx, Raspberry Pi, and the MOSFET circuit. Below is an img of how it should look on the rover:

img

Components:

Nyx:

- Ethernet (duh)
- USB:
    + MCP #3
    + Tic36v4 - Stepper Motor (part of Lowering Platform)
    + Lowering Platform Camera
    + PicoScope (Not set up, wait for Jasper, please don't fry the PMT...)
- GPIO Pins:
    + 9 (Ground) goes to Ground on PCB Mosfet (should be 3rd from closest power port)
    + 11 goes to the middle of the 3 (controls Vacuum)
    + 13 goes to pump, should be the first.
    + Writing from memory so double check with Tyler, or cross check with a fried Mosfet I have laying around over on the table Jacob and Liam usually sits.

MOSFET:

- Power --> 12V [20A Fuse blade] <-- Double check
- Pump/Vacuum wire is screwed in properly from terminal

Tic36v4:

- Power --> 12V [5A Fuse]

Lowering Platform

- Camera --> Nyx USB port
- UV Light (Should be on before starting the mission)
  • Make sure the Stepper Motor is DE-ENERGIZED after every usage!!!! If you hear the stepper motor running and the program is not running or off. KILL 12V POWER

MCP

- Power --> 12V [20A Fuse]
- We only need MCP #3, so make sure that's properly connected to Nyx, and to the turret.

Science Package Code

General build:

Build packages

cd ~/science_2022_23
make          # colcon build all

Clean packages

make clean    # clean all

Science Package (Turret, Lowering Platform, Pump, Vacuum):

Nyx's Terminal

make srv      # run server that will take actions upon request

Cameron hot ass sexy computer's Terminal

make cli c={} t={} # run client that will send request to server

where c is the command and t is the target/time. t should be defaulted to 0 if usage is not specified (for c = 1,2).

Commands (c):
  • 1 - Lower Lowering Platform for UV Experiment (Include t=0 by default)
  • 2 - Raise Lowering Platform for UV Experiment (Include t=0 by default)
  • 3 - Start Water Pump/Dispenser (for t seconds)
  • 4 - Start Vacuum Pump (for t seconds)
  • 5 - Rotate Funnel Cake into position with given targeted index t:[0,1,2,3,4]
Example run:

Nyx:

make srv

Local garbage machine:

make cli c=1 t=0    # Lower Lowering Platform for UV Experiment

make cli c=2 t=0    # Raise Lowering Platform for UV Experiment

make cli c=3 t=10   # Start Water Pump/Dispenser for 10 seconds

make cli c=4 t=69   # Start Vacuum Pump for 69 seconds

make cli c=5 t=2    # Rotate Funnel Cake into position with index 2 (3rd position) We are using 0-indexing

make cli c=5 t=0    # Rotate Funnel Cake into position with index 0 (1st position)

Recording

I don't want to push bandwidth over Telecom, so video is saved locally on Nyx within the same directory. You can retrieve it after you're done, you can download the video or copy it back through the terminal. In a different terminal, have this running:

make record     # Will start the recording

Just Ctrl + C to end the recording. Don't complicate things.

PMT Oscilloscope <-- Wait for Jasper to set up

# Terminal 1
make pico_sub

# Terminal 2
make pico_pub

About

SCR 2022-23's science package; Uses cli/srv ROS2 model to send commands to science equipment such as Lowering Platform, Vacuum/Pump, UV_Camera, and Funnel Cake


Languages

Language:Python 99.2%Language:Makefile 0.8%