From 48adf9b36d4dfb14321b85e5998cd5fe53182287 Mon Sep 17 00:00:00 2001 From: Yovany Molina Date: Sat, 8 Jul 2023 14:43:03 -0400 Subject: [PATCH 1/7] Added changes from recent testings - Changed the thruster ID values to correspond to the current thruster connection setup. - Changed FRV thruster direction from -1Z to +1Z. - Changed PID values for the sub. Values are still not ideal and will be adjusted over the next few testing sessions. - Changed the identifier for the USB to CAN board's USB to serial converter. - Changed tcp address for the depth sensor, imu, and dvl connection scripts to their ip addresses instead of their DNS names (there is an issue with the DNS server in the network box, or in the lab, or both). - Made changes to the sub8.urdf.xacro for gazebo to avoid URDF inertia warning. - Added bag_debugging_controller.launch file which is a launch file to record bags for debugging the PID controller on the sub. --- .../config/adaptive_controller.yaml | 11 ++++++----- .../launch/bag_debugging_controller.launch | 7 +++++++ .../subjugator_launch/launch/can.launch | 2 +- .../subjugator_launch/scripts/depth_conn | 2 +- .../command/subjugator_launch/scripts/dvl_conn | 2 +- .../command/subjugator_launch/scripts/imu_conn | 2 +- .../config/thruster_layout.yaml | 18 +++++++++--------- .../subjugator_gazebo/urdf/sub8.urdf.xacro | 8 ++++++++ 8 files changed, 34 insertions(+), 18 deletions(-) mode change 100644 => 100755 SubjuGator/command/subjugator_launch/config/adaptive_controller.yaml create mode 100755 SubjuGator/command/subjugator_launch/launch/bag_debugging_controller.launch mode change 100644 => 100755 SubjuGator/gnc/subjugator_thruster_mapper/config/thruster_layout.yaml mode change 100644 => 100755 SubjuGator/simulation/subjugator_gazebo/urdf/sub8.urdf.xacro diff --git a/SubjuGator/command/subjugator_launch/config/adaptive_controller.yaml b/SubjuGator/command/subjugator_launch/config/adaptive_controller.yaml old mode 100644 new mode 100755 index c6406c44d..f58ccebba --- a/SubjuGator/command/subjugator_launch/config/adaptive_controller.yaml +++ b/SubjuGator/command/subjugator_launch/config/adaptive_controller.yaml @@ -1,6 +1,7 @@ --- -kp: 1000, 1000, 1000, 5000, 5000, 5000 -kd: 150, 150, 150, 50, 100, 25 -kg: 5,5,5,5,5,5 -ki: 5,5,5,5,10,5 -use_learned: false +kp: 120, 150, 200, 100, 50, 50 +kd: 25, 25, 25, 25, 25, 25 +#kd: 0, 0, 0, 0, 0, 0 +kg: 2.5,2.5,2.5,2.5,2.5,2.5 +ki: 2.5,2.5,2.5,2.5,2.5,2.5 +use_learned: true diff --git a/SubjuGator/command/subjugator_launch/launch/bag_debugging_controller.launch b/SubjuGator/command/subjugator_launch/launch/bag_debugging_controller.launch new file mode 100755 index 000000000..4c6024669 --- /dev/null +++ b/SubjuGator/command/subjugator_launch/launch/bag_debugging_controller.launch @@ -0,0 +1,7 @@ + + + + + + + diff --git a/SubjuGator/command/subjugator_launch/launch/can.launch b/SubjuGator/command/subjugator_launch/launch/can.launch index 813b94625..b46fbd8ba 100644 --- a/SubjuGator/command/subjugator_launch/launch/can.launch +++ b/SubjuGator/command/subjugator_launch/launch/can.launch @@ -5,7 +5,7 @@ # Path of serial device - port: /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A800GHCF-if00-port0 + port: /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A50285BI-if00-port0 # Baudrate of device, should leave as is baudrate: 115200 # List of python device handle classes diff --git a/SubjuGator/command/subjugator_launch/scripts/depth_conn b/SubjuGator/command/subjugator_launch/scripts/depth_conn index 13bf8a480..c63922eb9 100755 --- a/SubjuGator/command/subjugator_launch/scripts/depth_conn +++ b/SubjuGator/command/subjugator_launch/scripts/depth_conn @@ -1,2 +1,2 @@ #!/bin/sh -exec socat -d -d pty,link=/tmp/depth,raw,echo=0 tcp:mil-sub-gumstix.ad.mil.ufl.edu:33056 +exec socat -d -d pty,link=/tmp/depth,raw,echo=0 tcp:192.168.37.61:33056 diff --git a/SubjuGator/command/subjugator_launch/scripts/dvl_conn b/SubjuGator/command/subjugator_launch/scripts/dvl_conn index f0be15464..745a45097 100755 --- a/SubjuGator/command/subjugator_launch/scripts/dvl_conn +++ b/SubjuGator/command/subjugator_launch/scripts/dvl_conn @@ -1,2 +1,2 @@ #!/bin/sh -exec socat -d -d pty,link=/tmp/dvl,raw,echo=0 tcp:mil-sub-gumstix.ad.mil.ufl.edu:349 +exec socat -d -d pty,link=/tmp/dvl,raw,echo=0 tcp:192.168.37.61:349 diff --git a/SubjuGator/command/subjugator_launch/scripts/imu_conn b/SubjuGator/command/subjugator_launch/scripts/imu_conn index 59275c393..bc93e1eb1 100755 --- a/SubjuGator/command/subjugator_launch/scripts/imu_conn +++ b/SubjuGator/command/subjugator_launch/scripts/imu_conn @@ -1,2 +1,2 @@ #!/bin/sh -exec socat -d -d pipe:/tmp/imu,wronly=1 tcp:mil-sub-gumstix.ad.mil.ufl.edu:1382 +exec socat -d -d pipe:/tmp/imu,wronly=1 tcp:192.168.37.61:1382 diff --git a/SubjuGator/gnc/subjugator_thruster_mapper/config/thruster_layout.yaml b/SubjuGator/gnc/subjugator_thruster_mapper/config/thruster_layout.yaml old mode 100644 new mode 100755 index 2d3de8ac9..48992559a --- a/SubjuGator/gnc/subjugator_thruster_mapper/config/thruster_layout.yaml +++ b/SubjuGator/gnc/subjugator_thruster_mapper/config/thruster_layout.yaml @@ -30,7 +30,7 @@ thruster_ports: # mapping from thrust in Newtons to effort (e = t[0]x^4 + t[1]x^3 + t[2]x^2 + t[3]x) thrusters: FLH: { - node_id: 3, + node_id: 4, position: [0.2678, 0.2795, 0.0], direction: [0.866, -0.5, 0.0], thrust_bounds: [-81.85, 99.7], @@ -42,7 +42,7 @@ thrusters: } } FLV: { - node_id: 1, + node_id: 5, position: [0.1583, 0.169, 0.0142], direction: [0.0, 0.0, 1.0], thrust_bounds: [-81.85, 99.7], @@ -54,7 +54,7 @@ thrusters: } } FRH: { - node_id: 2, + node_id: 0, position: [0.2678, -0.2795, 0.0], direction: [0.866, 0.5, 0.0], thrust_bounds: [-81.85, 99.7], @@ -66,9 +66,9 @@ thrusters: } } FRV: { - node_id: 0, + node_id: 1, position: [0.1583, -0.169, 0.0142], - direction: [0.0, 0.0, -1.0], + direction: [0.0, 0.0, 1.0], thrust_bounds: [-81.85, 99.7], calib: { # yamllint disable-line rule:line-length @@ -78,7 +78,7 @@ thrusters: } } BLH: { - node_id: 4, + node_id: 3, position: [-0.2678, 0.2795, 0.0], direction: [0.866, 0.5, 0.0], thrust_bounds: [-81.85, 99.7], @@ -90,7 +90,7 @@ thrusters: } } BLV: { - node_id: 5, + node_id: 6, position: [-0.1583, 0.169, 0.0142], direction: [0.0, 0.0, 1.0], thrust_bounds: [-81.85, 99.7], @@ -102,7 +102,7 @@ thrusters: } } BRH: { - node_id: 6, + node_id: 7, position: [-0.2678, -0.2795, 0.0], direction: [0.866, -0.5, 0.0], thrust_bounds: [-81.85, 99.7], @@ -114,7 +114,7 @@ thrusters: } } BRV: { - node_id: 7, + node_id: 2, position: [-0.1583, -0.169, 0.0142], direction: [0.0, 0.0, 1.0], thrust_bounds: [-81.85, 99.7], diff --git a/SubjuGator/simulation/subjugator_gazebo/urdf/sub8.urdf.xacro b/SubjuGator/simulation/subjugator_gazebo/urdf/sub8.urdf.xacro old mode 100644 new mode 100755 index 3f4517335..86efd1c33 --- a/SubjuGator/simulation/subjugator_gazebo/urdf/sub8.urdf.xacro +++ b/SubjuGator/simulation/subjugator_gazebo/urdf/sub8.urdf.xacro @@ -11,7 +11,15 @@ + + + + + + + + From 5d0b9bf61b22c959cb299fe91ce0e9d69989e103 Mon Sep 17 00:00:00 2001 From: Yovany Molina Date: Sat, 8 Jul 2023 22:08:29 -0400 Subject: [PATCH 2/7] Add documentation for bag_debugging_controller.launch --- SubjuGator/command/subjugator_launch/readme.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/SubjuGator/command/subjugator_launch/readme.md b/SubjuGator/command/subjugator_launch/readme.md index 7569e18fd..2006d4eca 100644 --- a/SubjuGator/command/subjugator_launch/readme.md +++ b/SubjuGator/command/subjugator_launch/readme.md @@ -9,3 +9,11 @@ sub8 launch files and scripts Each driver can be *turned off* If you are running this launch file alone, each of these defaults to false. This is because the only conditions that I expect someone to run the nav\_box file outside of a launch file is for debugging, and it is thus more convenient to default to off. This code is almost entirely inherited from previous subs, and is authored almost entirely by Forrest Voight. + +# PID Debugging Data Collection + +**NOTE:** This launch file needs the sub launch file (`sub8.launch`) running in order to function properly. + + roslaunch subjugator_launch bag_debugging_controller.launch prefix_name:="my_prefix" + +This launch file records a bag file containing adaptive controller `pose_error`, `twist_error`, `adaptation`, `dist`, and `drag` data along with `wrench`, `trajectory`, `odom`, `imu/data_raw`, and `dvl/range` data. This data is useful in determining if the PID values are getting better or worse using simulations. The bag file was written by Andres Pulido. From cde5c373d8ebf1acfad51f2cd59a7fca59aabeca Mon Sep 17 00:00:00 2001 From: Yovany Molina Date: Sat, 8 Jul 2023 22:24:54 -0400 Subject: [PATCH 3/7] pre-commit and CI fixes...probably --- .../command/subjugator_launch/config/adaptive_controller.yaml | 0 .../subjugator_launch/launch/bag_debugging_controller.launch | 0 SubjuGator/command/subjugator_launch/package.xml | 2 ++ .../gnc/subjugator_thruster_mapper/config/thruster_layout.yaml | 0 SubjuGator/simulation/subjugator_gazebo/urdf/sub8.urdf.xacro | 0 5 files changed, 2 insertions(+) mode change 100755 => 100644 SubjuGator/command/subjugator_launch/config/adaptive_controller.yaml mode change 100755 => 100644 SubjuGator/command/subjugator_launch/launch/bag_debugging_controller.launch mode change 100755 => 100644 SubjuGator/gnc/subjugator_thruster_mapper/config/thruster_layout.yaml mode change 100755 => 100644 SubjuGator/simulation/subjugator_gazebo/urdf/sub8.urdf.xacro diff --git a/SubjuGator/command/subjugator_launch/config/adaptive_controller.yaml b/SubjuGator/command/subjugator_launch/config/adaptive_controller.yaml old mode 100755 new mode 100644 diff --git a/SubjuGator/command/subjugator_launch/launch/bag_debugging_controller.launch b/SubjuGator/command/subjugator_launch/launch/bag_debugging_controller.launch old mode 100755 new mode 100644 diff --git a/SubjuGator/command/subjugator_launch/package.xml b/SubjuGator/command/subjugator_launch/package.xml index 6a6beeeb6..e3f6ef4ba 100644 --- a/SubjuGator/command/subjugator_launch/package.xml +++ b/SubjuGator/command/subjugator_launch/package.xml @@ -5,8 +5,10 @@ The subjugator_launch package Jacob Panikulam MIT + rosbag roslaunch roslaunch + rosbag robot_state_publisher nodelet c3_trajectory_generator diff --git a/SubjuGator/gnc/subjugator_thruster_mapper/config/thruster_layout.yaml b/SubjuGator/gnc/subjugator_thruster_mapper/config/thruster_layout.yaml old mode 100755 new mode 100644 diff --git a/SubjuGator/simulation/subjugator_gazebo/urdf/sub8.urdf.xacro b/SubjuGator/simulation/subjugator_gazebo/urdf/sub8.urdf.xacro old mode 100755 new mode 100644 From 876436d63b3211ad4c3e67f601d21a0e1f13a0bf Mon Sep 17 00:00:00 2001 From: Yovany Molina Date: Sun, 9 Jul 2023 18:07:13 -0400 Subject: [PATCH 4/7] Added documentation about PID controller - Added documentation page about PID controller containing information about the bag_debugging_controller.launch file and some tips for how to tune the PID controller. - Reverted subjugator_launch/readme.md changes to reflect moving to a new documentation page. - Modified adaptive controller values to remove commented out kd values. --- .../config/adaptive_controller.yaml | 1 - .../command/subjugator_launch/readme.md | 8 ------ docs/subjugator/index.rst | 1 + docs/subjugator/pid.rst | 26 +++++++++++++++++++ 4 files changed, 27 insertions(+), 9 deletions(-) create mode 100644 docs/subjugator/pid.rst diff --git a/SubjuGator/command/subjugator_launch/config/adaptive_controller.yaml b/SubjuGator/command/subjugator_launch/config/adaptive_controller.yaml index f58ccebba..aefd3cb36 100644 --- a/SubjuGator/command/subjugator_launch/config/adaptive_controller.yaml +++ b/SubjuGator/command/subjugator_launch/config/adaptive_controller.yaml @@ -1,7 +1,6 @@ --- kp: 120, 150, 200, 100, 50, 50 kd: 25, 25, 25, 25, 25, 25 -#kd: 0, 0, 0, 0, 0, 0 kg: 2.5,2.5,2.5,2.5,2.5,2.5 ki: 2.5,2.5,2.5,2.5,2.5,2.5 use_learned: true diff --git a/SubjuGator/command/subjugator_launch/readme.md b/SubjuGator/command/subjugator_launch/readme.md index 2006d4eca..7569e18fd 100644 --- a/SubjuGator/command/subjugator_launch/readme.md +++ b/SubjuGator/command/subjugator_launch/readme.md @@ -9,11 +9,3 @@ sub8 launch files and scripts Each driver can be *turned off* If you are running this launch file alone, each of these defaults to false. This is because the only conditions that I expect someone to run the nav\_box file outside of a launch file is for debugging, and it is thus more convenient to default to off. This code is almost entirely inherited from previous subs, and is authored almost entirely by Forrest Voight. - -# PID Debugging Data Collection - -**NOTE:** This launch file needs the sub launch file (`sub8.launch`) running in order to function properly. - - roslaunch subjugator_launch bag_debugging_controller.launch prefix_name:="my_prefix" - -This launch file records a bag file containing adaptive controller `pose_error`, `twist_error`, `adaptation`, `dist`, and `drag` data along with `wrench`, `trajectory`, `odom`, `imu/data_raw`, and `dvl/range` data. This data is useful in determining if the PID values are getting better or worse using simulations. The bag file was written by Andres Pulido. diff --git a/docs/subjugator/index.rst b/docs/subjugator/index.rst index c34f4e7fd..28566c2ac 100644 --- a/docs/subjugator/index.rst +++ b/docs/subjugator/index.rst @@ -15,6 +15,7 @@ SubjuGator 8 Simulating Enabling Cameras + PID Controller electrical diff --git a/docs/subjugator/pid.rst b/docs/subjugator/pid.rst new file mode 100644 index 000000000..c2feeae29 --- /dev/null +++ b/docs/subjugator/pid.rst @@ -0,0 +1,26 @@ +PID Controller +-------------- + +SubjuGator 8 uses 6 PID controllers for its 6 degrees of freedom (x, y, z, roll, pitch, yaw). The gain for these PID controllers can be adjusted in ``adaptive_controller.yaml`` found in the ``subjugator_launch/config`` directory. Since the weight of the sub shifts with each component modified, the PID controller values have to be adjusted from time to time. There are two approaches to adjust PID values in the water: + +1. Have someone with experience in tuning PID controllers swim with the sub and use the sub's response to movement commands to adjust the gains. +2. Eliminate the error in each axis by adjusting the gains and evaluating the RMS error in each axis after sending the same movement commands. + +PID Controller Tuning Tips +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +* The learning gains (``ki`` and ``kd``) provide very little input to the wrenches applied to the sub, so it is better to treat it as a PD controller to start with. You can disable the learning gains using ``use_learned: false``. +* While you are tuning the PID values, keep a history of the values you have tried for further analysis during and after testing. You can use ``scp`` for this, but it may just be easier to take a screenshot or a photo. You can also take videos of the sub from the side of the pool to reference later. + +PID Debugging Data Collection +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. code-block:: bash + + $ roslaunch subjugator_launch bag_debugging_controller.launch prefix_name:="my_prefix" + +This launch file records a bag file containing adaptive controller ``pose_error``, ``twist_error``, ``adaptation``, ``dist``, and ``drag`` data along with ``wrench``, ``trajectory``, ``odom``, ``imu/data_raw``, and ``dvl/range`` data. This data is useful in determining if the PID values are getting better or worse using simulations. The resulting bag file will be located in ``gnc/subjugator_controller/debug_bags/``. This launch file was written by Andres Pulido. + +.. warning:: + + This launch file needs the sub launch file (``sub8.launch``) running in order to function properly. From 593789fb2ca1b64520e1e13d9f07e9d6a5e30af1 Mon Sep 17 00:00:00 2001 From: Yovany Molina Date: Thu, 13 Jul 2023 06:08:53 -0400 Subject: [PATCH 5/7] Modify URDF fix to fix /mission_server crash - Another URDF xacro fix has been applied to the URDF xacro file using these ROS forum posts as reference: https://answers.ros.org/question/393006/urdf-link-not-properly-fixed-to-world/, https://answers.ros.org/question/192817/error-msg-the-root-link_base-has-an-inertia-specified-in-the-urdf-but-kdl/. NOTE: This is not a complete fix yet. I'm getting a tf republisher error that 'base_link' and 'map' do not have a connection with TF having 2+ unconnected trees. Additionally, gazebogui does not work since the /gzclient/set_physics_properties service is not advertised (even though /gazebo/set_physics_properties is). --- .../subjugator_gazebo/urdf/sub8.urdf.xacro | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/SubjuGator/simulation/subjugator_gazebo/urdf/sub8.urdf.xacro b/SubjuGator/simulation/subjugator_gazebo/urdf/sub8.urdf.xacro index 86efd1c33..9290884dd 100644 --- a/SubjuGator/simulation/subjugator_gazebo/urdf/sub8.urdf.xacro +++ b/SubjuGator/simulation/subjugator_gazebo/urdf/sub8.urdf.xacro @@ -11,15 +11,9 @@ - - - - - - - + - + @@ -39,6 +33,11 @@ + + + + + From 908205bc70c50367c0bbbbd3dad8f96323fcb2c5 Mon Sep 17 00:00:00 2001 From: Yovany Molina Date: Sat, 7 Oct 2023 23:29:09 -0400 Subject: [PATCH 6/7] Added documentation and changes made during summer Note that these are changes I made on my local PC that I'm getting around to submitting. - Added documentation for the nav tube including calibration for the IMU. - Added documentation for filling the watercooling loop (missing emptying loop and adding photos for clarification). - Made edits to testing procedures to reflect materials we ended up using at different points + reiteration of red battery tube cap. - Modified MOTD to reflect changes in local documentation. - Modified magnetic hardsoft compensation script for changes in matplotlib and numpy structure. --- .../scripts/generate_config | 13 +-- SubjuGator/etc/motd | 9 ++ docs/subjugator/index.rst | 2 + docs/subjugator/nav_tube.rst | 98 +++++++++++++++++++ docs/subjugator/watercooling.rst | 70 +++++++++++++ docs/testingprocedures.md | 33 ++++--- 6 files changed, 203 insertions(+), 22 deletions(-) create mode 100644 SubjuGator/etc/motd create mode 100644 docs/subjugator/nav_tube.rst create mode 100644 docs/subjugator/watercooling.rst diff --git a/SubjuGator/drivers/magnetic_compensation/sub8_magnetic_hardsoft_compensation/scripts/generate_config b/SubjuGator/drivers/magnetic_compensation/sub8_magnetic_hardsoft_compensation/scripts/generate_config index 5d12dad06..86ce1a09a 100755 --- a/SubjuGator/drivers/magnetic_compensation/sub8_magnetic_hardsoft_compensation/scripts/generate_config +++ b/SubjuGator/drivers/magnetic_compensation/sub8_magnetic_hardsoft_compensation/scripts/generate_config @@ -9,6 +9,7 @@ import rosbag import roslib import scipy.linalg import yaml +from mpl_toolkits.mplot3d import Axes3D from tf import transformations roslib.load_manifest("magnetic_hardsoft_compensation") @@ -20,7 +21,7 @@ def normalized_matrix(m): def calculate_error(points): - radii = map(numpy.linalg.norm, points) + radii = list(map(numpy.linalg.norm, points)) error = numpy.std(radii) / numpy.mean(radii) return error @@ -47,7 +48,7 @@ def fit_ellipsoid(points): B = numpy.ones((points.shape[0], 1)) - X = numpy.linalg.lstsq(A, B)[0].flatten() + X = numpy.linalg.lstsq(A, B, rcond=-1)[0].flatten() if X[0] < 0: X = -X # make sure ka turns out positive definite @@ -152,7 +153,7 @@ if __name__ == "__main__": import matplotlib.pyplot as plt fig = plt.figure(figsize=(10, 10)) - ax = fig.add_subplot("111", projection="3d") + ax = Axes3D(fig) ax.scatter([0], [0], [0], s=100, c="r") ax.scatter(*zip(*points[::10, :])) axisEqual3D(ax) @@ -170,7 +171,7 @@ if __name__ == "__main__": import matplotlib.pyplot as plt fig = plt.figure(figsize=(10, 10)) - ax = fig.add_subplot("111", projection="3d") + ax = Axes3D(fig) ax.scatter([0], [0], [0], s=100, c="r") ax.scatter(*zip(*points[::10, :])) ax.scatter(*zip(*compensated[::10, :]), c="g") @@ -185,8 +186,8 @@ if __name__ == "__main__": print( yaml.dump( { - "scale": (map(float, x) for x in scale), - "shift": map(float, shift), + "scale": scale.tolist(), + "shift": shift.tolist(), }, ), ) diff --git a/SubjuGator/etc/motd b/SubjuGator/etc/motd new file mode 100644 index 000000000..bf6bb0855 --- /dev/null +++ b/SubjuGator/etc/motd @@ -0,0 +1,9 @@ +#-------#-------#-------#-------#-------#-------#-------#-------# + You have connected to SubjuGator 8! +#-------#-------#-------#-------#-------#-------#-------#-------# + +If you are testing the sub in the water (or are preparing to do so), please make sure to read the Subjugator Testing Procedures page on uf-mil.github.io for useful tips, advice, and checklists. + +We (the previous MIL members) will watch your testing session with great interest. + +Happy Testing! diff --git a/docs/subjugator/index.rst b/docs/subjugator/index.rst index 28566c2ac..7a9416713 100644 --- a/docs/subjugator/index.rst +++ b/docs/subjugator/index.rst @@ -16,6 +16,8 @@ SubjuGator 8 Enabling Cameras PID Controller + Nav Tube + Watercooling electrical diff --git a/docs/subjugator/nav_tube.rst b/docs/subjugator/nav_tube.rst new file mode 100644 index 000000000..0456994ec --- /dev/null +++ b/docs/subjugator/nav_tube.rst @@ -0,0 +1,98 @@ +======== +Nav Tube +======== + +One of the major components of SubjuGator 8 is the navigation (nav tube). This pressure vessel is located right below the main pressure vessel and contains all of our navigation sensors and equipment. The navigation computer located inside the vessel allows access to the data from these components through a direct ethernet connection. + +.. warning:: + + This system was originally used on SubjuGator 7 and it was ported over with little to no changes in hardware. This does mean that the system will need a major overhaul for continued use of SubjuGator 8. + +Navigation Computer +=================== + +The navigation computer consists of a Gumstix Overo Computer-on-Module that mounts to a carrier board. The carrier board contains headers for the Teledyne Dopper Velocity Logger (DVL) connector board, Analog Devices Inertial Measurement Unit (IMU), and the pressure sensor. At one point, the navigation computer was also connected to a GPS antenna. + +.. warning:: + + No documentation or PCB design files exist for the navigation computer carrier board and there are no more functioning spare boards. Additionally, only the newer GumStix Overo COM boards are available to purchase (with a lead time of roughly 1 year) which may not be compatible with the current system. Be very careful when working inside of the navigation tube. + +Troubleshooting The Nav Tube Connection +--------------------------------------- + +If you cannot ping the Navigation Computer (192.168.37.61), please ensure (in the following order) that: + +* You are pinging 192.168.37.61. +* The ethernet subconn cable has been connected between both pressure vessels. +* You restart the sub at least once. +* That the proper ethernet interface is configured in /etc/netplan YAML file. You may need to check ifconfig for the 'enpXs0' interface (where X is a whole number) if you have unplugged and replugged anything in the sub recently (especially the graphics card). Make sure to test the netplan with ``sudo netplan try`` so that you don't get locked out of the sub because of a bad configuration! +* The ethernet cables are properly connected inside the main pressure vessel. +* The ethernet cables and other cables are properly connected inside the Nav tube. +* The navigation computer is receiving power AND is turned on (green AND blue light on the GumStix). Make sure to be extra careful and vigilent when opening and handling the navigation computer. + +ADIS16400/16405-BMLZ IMU & Magnetometer +=========================================== + +The `ADIS16400-BMLZ `_ / `ADIS16405-BMLZ `_ is the device responsible for tracking our position and orientation in the water. Currently, there is an ADIS16400 IMU in the sub, but it previously used an ADIS16405. + +.. warning:: + + These components are obsolete! It may be difficult to find replacement parts in the future if SubjuGator 8 will see continued use... + +Calibrating the Magnetometer +---------------------------- + +The magnetometer inside of the ADIS16400/16405 measures the strength of the magnetic field at the orientation it faces. We use this data in conjunction with the IMU's gyroscopes and accelerometers to determine the orientation of the sub in the water. The process of calibrating the magnetometer is called magnetic hardsoft compensation and essentially changes how we bias the data it gives us. + +.. note:: + + Calibrating the magnetometer must be done in a pool. + +To calibrate the magnetometer you must first collect magnetometer data (``/imu/mag_raw``) to use for the calibration script. This can be done through the following: + +.. code-block:: bash + + $ roslaunch subjugator_launch sub8.launch + +or if you prefer to not launch the entire sub: + +.. code-block:: bash + + $ roslaunch subjugator_launch nav_box.launch imu:=true + +Then, in a separate terminal window, navigate to a known directory start recording the rosbag by typing: + +.. code-block:: bash + + $ rosbag record -O .bag /imu/mag_raw + +where is a substitute for whatever name you want to give to your bag (I recommend something memorable, like Frank or Penelope). This will record the bag data in the directory that the terminal window is in. + +When you have started recording the bag, have members who are in the water rotate the sub. Only the sub should move, not the members holding onto the sub. The calibration can be done in any order, but you must complete a full roll, pitch, and yaw rotation plus have a few minutes of data with all three occurring at the same time. Once you are done collecting data, kill the recording window using ``ctrl+c``. + +Next, we must run the calibration script with our data. This script is located in ``SubjuGator/drivers/magnetic_compensation/sub8_magnetic_hardsoft_compensation/scripts``. Type the following: + +.. code-block:: bash + + $ ./generate_config + +note that this is a python script, so + +.. code-block:: bash + + $ python3 generate_config + +is also valid. + +.. note:: + + If the script fails because of the ``fit_ellipsoid`` method and the points on the first figure are colinear or nearly colinear you may not have collected thorough enough data. The alternate possibility is a malfunctioning magnetometer. + +The output of the script should be a 3x3 matrix labeled ``scale`` and a length 3 vector labeled ``shift``. These values go into the ``scale`` and ``shift`` values located inside of ``subjugator_launch/launch/subsystems/nav_box.launch``. + +After running ``cm``, you will have (hopefully) successfully calibrated the magnetometer. Make sure to test the sub after calibration to see if the new configuration values are an improvement over the old ones. + +Important Links and Datasheets +============================== + +- `ADIS16400/ADIS16405 Datasheet `_ diff --git a/docs/subjugator/watercooling.rst b/docs/subjugator/watercooling.rst new file mode 100644 index 000000000..5344e68bf --- /dev/null +++ b/docs/subjugator/watercooling.rst @@ -0,0 +1,70 @@ +============ +Watercooling +============ + +SubjuGator 8's hardware requires a watercooling loop for the CPU, graphics card, and ESCs. + +Filling the Water cooling Loop +============================== + +.. note:: + + Filling the water cooling loop requires at least 2 people. + +Materials +--------- + +* Sub Shore Power Supply +* Sub battery tube cover +* Sub battery cables +* Large Funnel +* Small Funnel +* Stool or Chair +* Deionized Water w/ Biocide +* Vacuum Pump +* Extra water cooling connectors and tubing +* Water cooling reservoir +* Bucket + +.. note:: + + While deionized water with biocide is preferred for longevity, distilled water will work fine. You should not use purified water. Bonus points if the water is dyed orange :) + +No-Pump Procedure +----------------- + +These steps should be taken when there is no external pump to help with the filling process. + +.. warning:: + + Exercise caution during steps 8 and 9 as the sub will be powered on with a water hazard nearby. + +#. Move the main vessel onto the wooden platform and down to the floor. +#. Set up the environment as shown in the picture below. +#. Gravity feed the system by filling the reservoir with water and letting the bubbles come out naturally. Move on when no more bubbles come out. +#. Empty the reservoir until the water is below the "stove pipe" (metal tube inside the reservoir). +#. Blow into the tube exposed to air to force the water into the loop while extracting the air inside of the loop. Make sure to fill the reservoir until the water is below the "stove pipe" when there is an air gap inside of the water inlet tube. Move on when you cannot remove any more bubbles. +#. Attach the vacuum pump to the tube exposed to air and pump until the pressure reaches around 10 PSI. Pinch the outlet tube and break the vacuum to allow water to fill the low pressure spots. Repeat this step until at least a decent amount of water makes it past the pump. +#. With water at the ready, connect the sub to shore power and fill the reservoir with water (you do not have to worry about the "stove pipe"). +#. Wiggle the sub around while the pump is running to extract any trapped bubbles. + +Emptying the Water Cooling Loop +=============================== + +The water cooling loop should be emptied before the sub is shipped anywhere. Emptying the water cooling loop is easier than filling it up. + +.. note:: + + Emptying the water cooling loop requires at least 2 people. + +Materials +--------- + +* Vacuum pump +* Extra water cooling connectors and tubing +* Water cooling reservoir +* Bucket + + +Procedure +--------- diff --git a/docs/testingprocedures.md b/docs/testingprocedures.md index 2fcf81852..b1a6d4dc5 100644 --- a/docs/testingprocedures.md +++ b/docs/testingprocedures.md @@ -2,6 +2,8 @@ ## Before leaving +For best results, packing should be done at least one day before a testing session. This + ### Packing list * Power Strip * Table @@ -16,7 +18,6 @@ * 5/32 Allen Key * Duct tape and scissor * Buoyancy foams for the sub -* Allen Key for paintball tank * Pliers * Flat-head screwdriver * Kill wand @@ -27,22 +28,22 @@ * O'ring grease (Molykote 55) * Cable grease (Molykote 44) * Hot glue gun -* Zip ties +* Hot glue sticks +* Large and small zip ties * clippers -* Towels +* Towel(s) * [Sunscreen](https://www.youtube.com/watch?v=sTJ7AzBIJoI) - +* Tent (If going to Graham Pool or Florida Pool) +* Chairs (If going to Graham Pool) ### Software/Electrical Checklist -* Update and build code -* Verify all sensors output data -* Verify thrusters spin given command -* Verify kill (soft an hard) -* Grease all electrical connectors appropriately - +* Update (`git pull`) and build (`cm`) code. +* Verify all sensors output data. +* Verify that the correct thrusters spin given the appropriate command. +* Verify kill (soft and hard). +* Grease all electrical connectors appropriately. ## At testing site - * Get wall power to powerstrip. * Setup and connect to Network Box. * Roll tether and connect it to network box. **(DO NOT USE POE)** @@ -51,11 +52,11 @@ * SSH into sub. * Start tmux, write code. * Grease O-rings with Molykote 55 every time a pressure vessel is closed. -* Make sure ALL pneumatic tubes are inserted correctly. **(DO NOT FLOOD THE VALVE BOX)** -* Make sure all holes to paintball tank are sealed correctly. **(THIS WILL ALSO RESULT IN FLOODING IF NOT DONE)** +* * **ENSURE THAT THE RED PRESSURE RELIEF CAP ON THE BATTERY TUBE HAS BEEN SCREWED IN PLACE AFTER CHANGING BATTERIES** * Person getting into the pool must do backflip. -* Deploy sub. (check for bubbles, make sure buoyancy is correct) +* Deploy sub. (check for bubbles, make sure buoyancy is correct). * Verify odometry. -What happens when the valve box isn't closed: -![What happens when the valve box isn't closed.](/flooded_valve_box.jpg) +### Troubleshooting + +- :ref:`Troubleshooting The Nav Tube Connection` From d3f11d40783d0c9d3b5fe60a4b56a625cb5e59fd Mon Sep 17 00:00:00 2001 From: Cameron Brown Date: Mon, 9 Oct 2023 16:30:54 -0400 Subject: [PATCH 7/7] Remove trailing whitespace --- docs/subjugator/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/subjugator/index.rst b/docs/subjugator/index.rst index e52976cde..7a9416713 100644 --- a/docs/subjugator/index.rst +++ b/docs/subjugator/index.rst @@ -18,7 +18,7 @@ SubjuGator 8 PID Controller Nav Tube Watercooling - + electrical RoboSub