Skip to content

Electrical Plug Mating Plugin

Duane Davis edited this page Nov 23, 2021 · 21 revisions

Overview

Connecting underwater electrical flying leads is a common task that is performed by UUVs in the real world. A video of this task being performed can be found here:

Video demonstration

This plugin provides the latching/unlatching (mating/unmating) functionality to the simulation.

You will need a joystick to perform the actual mission. See this page for controlling the robot and the arm.

Motivation and Possibilities

Users can program an autonomous mission where the UUV is tasked with grabbing the electrical plug and connecting it to the socket. The mating and demating are dependent on the forces between the plug and the socket and their relative alignments to each other.

Getting Started

The plug_and_socket_plugin plugin can be found in the dave_gazebo_model_plugins package. The socket_box model located in the dave_object_models package incorporates the plugin and is incorporated into the following demo:

roslaunch dave_demo_launch dave_electrical_mate.launch

Upon launch, a Gazebo instance is generated with a world containing a RexROV UUV (with manipulator arm), the socket platform (the socket itself is on the front vertical panel), and a plug resting on a static platform.

electrical_mating_launch

Closeup views of the plug and socket are provided in the following images:

plug

socket

The joystick is used to maneuver the UUV and manimpulator arm to grasp the plug, approach the platform, and attach the plug to the socket. Upon connecting, a joint will be formed automatically to lock the plug to the socket.

A video that demonstrates the functionality of this plugin is provided here.

Plugin Operation

For the plug to mate with the socket, it must be inserted with the correct alignment and pushed with sufficient force. Similarly, for it to be removed, it must be pulled with sufficient force. Plugin parameters are specified through the SDF parameters as follows.

     <plugin name="plug_and_socket" filename="libplugAndSocketPlugin.so">
      <socketTubeLink>socket</socketTubeLink>
      <sensorPlateLink>sensor_plate</sensorPlateLink>
      <plugModel>plug</plugModel>
      <plugLink>plug</plugLink>
      <rollAlignmentTolerance>0.15</rollAlignmentTolerance>
      <pitchAlignmentTolerance>0.15</pitchAlignmentTolerance>
      <yawAlignmentTolerance>0.15</yawAlignmentTolerance>
      <matingForce>25</matingForce>
      <unmatingForce>125</unmatingForce>
    </plugin>

Default values will be used for any plugin parameter that is not specified in the SDF (values depicted here are the default values but are not necessarily the same values that are used in the demos).

The State Machine

The plugin itself is abstractly implemented as a finite state machine. During operation, it transitions between three states as depicted in the following diagram:

state_machine

Free State

The state at which the plug can move freely in the world. In this state, the plug is not physically bound to the socket. The plug transitions out of this state to the joined state when the plug is aligned with the socket in all three axes and when the plug is within close proximity to the socket.

Joined State

When the plugin transitions to the joined state, a prismatic joint is dynamically created to bind the plug to the socket. The plug can be pushed towards or pulled away from the the socket when it is in this state, but the joint eliminates all other degrees of freedom to facilitate insertion of the plug (as a door key hole guides the key into the lock). This provides a more robust mechanism for maintaining alignment than relying on the physical geometry of the socket. Once the plug is inserted all of the way into the socket and the force applied to the socket exceeds the mating force, the plugin transitions into the the fixed state.

Fixed State

Upon transitioning to the fixed state, the limits of the prismatic joint are set to zero to fix the plug into position. To release the plug from the socket, a pulling force on the plug must be applied using the UUV's manipulator arm's fingers. When the force exceeds the specified unmating force, the plut-to-socket joint is destroyed and the plugin transitions back to the free state.

A timer is utilized to prevent the plugin from immediately transitioning back to the joined state (after unmating, the plug will be within the alignment and range tolerances).

URDF Models and Demo

URDF (Xacro) versions of the plugin are provided in the plug_and_socket_description package to facilitate the utilization of the plugin with arbitrary models. The URDF macros are incorporated into the following demo:

roslaunch dave_demo_launch dave_plug_and_socket_demo.launch

Upon launch, a Gazebo instance is generated with a world containing a RexROV UUV (with manipulator arm), a plug resting on a static platform, and a simple socket platform with a socket on each vertical side and on the top:

plug_and_socket_demo_launch

Maneuvering the UUV and manipulator arm is accomplished using the joystick as with the dave_electrical_mate_demo.launch example. The plug can be joined to any of the five sockets:

plug_and_socket_demo_join

Limitations

  1. Mating and unmating forces are treated as scalar values and are not vectorized. That is, the mating force does not have to be directly towards the socket to lock the plug into place, and the unmating force does not have to be directly away from the socket to release.
  2. Since the plug model and link are explicitly specified within the plugin definition, only the plug will be compatible with a particular socket even if multiple plugs will technically "fit".
  3. To go from the Fixed to Free state, the force applied to the plug needs to come from a link that contains the name finger_tips. This is to make sure that if the manipulator arm is pushing the plug into the socket, and the socket is applying an equal an opposite force, that force does not accidentally unlatch the plug.

Future Improvements

  1. Incremental updates to improve realism and fidelity (e.g., vector mating and unmating forces).
  2. Allow for multiple plugs to be used with a single socket when required.

Relevant links

Initial implementation Pull Request can be found here. Updated capability Pull Request can be found here.

Clone this wiki locally