Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hamilton8415/further edits #79

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion docs/docs/simulation.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
# Simulation
A computer simulation environment has been created that simulates the dynamics of the wave-energy converter and emulates the ROS 2 messages used on the buoy system. This simulation includes a solver of the multi-body dynamics of the system, a numerical representation of the behavior and losses of the electro-hydraulic PTO, and a numerical simulation of the wave-buoy interaction processes based on linear hydrodynamic theory.

A computer simulation environment has created that that emulates the ROS 2 messages used on the buoy system, and connects them to a numerical simulation of the system dynamics and behavior of the electro-hydraulic Power-Take-Off device. The aim of this simulation is to provide a computer based simulation that for most behaviors, interacts with computer code in the same way the physical buoy system does. The aim is that code running on a desktop Linux machine can run unchanged on the physical buoy, and that the response of the simulated buoy is indistinguishable from the real system. The following sections provide some details of this simulator, and additional details are in the [theory](theory.md) section.
The aim of this simulation is to provide a computer based simulation that replicates the physical systems behavior and also interacts with computer code in the same way the physical buoy system does. The aim is that code running on a desktop Linux machine can run unchanged on the physical buoy, and that the response of the simulated buoy is indistinguishable from the real system. The following sections provide some details of this simulator, and additional specifics are in the [theory](theory.md) section.

## Gazebo
The simulation environment here is built upon the popular [Gazebo](https://gazebosim.org/docs/garden) Simulator that is supported by the Open Source Robotics Foundation. The core of this simulator is provided by a physics engine that is responsible for solving the 6 degree-of-freedom multi-body equations of motion. This engine determines the position in space solution of all the bodies in a simulation, subject to the forces that are acting on those bodies in any particular environment. This multi-body simulator also can enforce constraints on, and joints between, the bodies, allowing one to develop simulations in which two bodies are only allowed to slide by one another in one degree of freedom, for instance. Gazebo includes a number of forcings that are typical in robotics, gravity, contact forces between bodies, hydrodynamic drag forces, etc. Also, when used with the DART physics engine, Gazebo can include a general added-mass matrix which adds inertial forcing on specified bodies due to the tendency of the fluid surrounding a body to be accelerated along with the body. This is a critically important feature in underwater robotics and simulation efforts. Of course, all the required forcings to

In particular, this project has created plugins that provide forcing on the components of wave-energy converter system that are specific to this device and application. These plugins are loaded at run-time so exist independently of the main Gazebo software, but behave in an integrated way during simulations. The plug-in code described in the following sections implement specific forcings needed by this project.

#### Electro-Hydraulic PTO
As described in the Architecture section, the MBARI wave-energy converter implements a custom developed electro-hydraulic power take-off device that converts mechanical power of a moving piston rod (force times velocity) to/from electrical energy that is supplied to or drawn from a battery system (voltage times current). This device consists of a linear hydraulic ram that is connected to a rotary hydraulic motor, linear motion of the ram translates to rotary motion of a shaft, and vice versa. The hydraulic motor shaft is directly coupled to a permanent magnet servo motor/driver. The power electronics maintains a commanded torque on the motor which results from current flowing to/from the battery system as appropriate. The Gazebo plugin developed to simulate this device takes in the piston velocity and commanded torque, and computes the resulting hydraulic pressure, motor RPM, and battery voltage and current. The plugin is programmed with the same default motor-current/RPM relationship as the physical system, and also respects the same limits on motor and battery current, motor RPMs, etc. A key simplifying assumption made in this model is that the rotary inertia of the motor shaft is negligible, and the hydraulic oil is incompressible. These assumptions cause the model of the PTO to be a quasi-static solution that neglects inertia forces of the rotary components of the motor. This has been shown to be a reasonable assumption at the motion frequencies the system operates at, and greatly increases the speed at which the solution progresses. The inertia of the piston itself is included in the simulation as it is an independent body in the equations of motion, constrained to move linearly with respect to the PTO housing.

#### Pneumatic Spring

#### Free-Surface Hydrodynamics


## Controller Interfaces
Loading