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

Latent Data on ROS 2 #157

Merged
merged 35 commits into from
Sep 21, 2023
Merged

Latent Data on ROS 2 #157

merged 35 commits into from
Sep 21, 2023

Conversation

andermi
Copy link
Collaborator

@andermi andermi commented Aug 28, 2023

needs osrf/mbari_wec_utils#54

publish latent data (modeled but not directly measured) on ROS 2 including:

  • power
  • forces
  • losses
  • incoming wave heights (above water plane)
  • miscellaneous

@andermi
Copy link
Collaborator Author

andermi commented Sep 1, 2023

@hamilton8415 do you want hydraulic_motor_loss and relief_valve_loss to be in the latent data? If so, would you mind handling computing those?

@andermi
Copy link
Collaborator Author

andermi commented Sep 5, 2023

Sample message:

header:
  stamp:
    sec: 87
    nanosec: 890000000
  frame_id: ''
inc_wave_heights:
- use_buoy_origin: true
  pose:
    position:
      x: 0.0
      y: 0.0
      z: -0.8808675951160896
    orientation:
      x: -0.003990554574864658
      y: -0.005342048959267687
      z: -2.131821184897409e-05
      w: 0.9999777685191985
upper_spring:
  force: -6947.903626699504
  temperature: 288.2707047344805
  heat_loss: 609.4042334225376
  piston_position: 0.6226419249097868
  piston_velocity: 0.07149783057808637
lower_spring:
  force: 14718.269494734053
  temperature: 281.33897617870065
  heat_loss: -2361.8917248091725
  piston_position: 0.6226419249097868
  piston_velocity: 0.07149783057808637
electro_hydraulic:
  inst_power: 67.36702579975064
  rpm: -744.3751840001763
  force: 2582.348884922011
  motor_drive_i2r_loss: 10.121847152709961
  motor_drive_switching_loss: 15.078186988830566
  motor_drive_friction_loss: 74.424560546875
  battery_i2r_loss: 0.3493275046348572
wave_body:
  buoyancy:
    force:
      x: 0.0
      y: 0.0
      z: 72255.24314572435
    torque:
      x: -7.3750446819340585
      y: -6515.153314486855
      z: 0.0
  radiation:
    force:
      x: 83.6086979953471
      y: -0.0885099768620667
      z: -450.4780387299854
    torque:
      x: 0.3131910732220865
      y: 284.4873501665259
      z: 0.0005220048689208334
  excitation:
    force:
      x: 324.9787072939932
      y: -7.905087287026117e-06
      z: -41644.46129943828
    torque:
      x: 4.082321707116394
      y: 4565.312364086205
      z: 0.03130321979768935
piston_friction_force: 857.4891528904318

Base automatically changed from andermi/incoming_wave_service to main September 7, 2023 06:06
@hamilton8415
Copy link
Collaborator

hamilton8415 commented Sep 7, 2023

Great start, I'm catching up here and thought I'd start by brainstorming the items that I can think of, although I think you have most of this in here already, so in many cases my list here is already in the LatentData struct/msg. There are decisions to make about presenting forces, or instantaneous power losses. I think the latter may be more useful for many purposes, I'm not 100% sure... It would be really something to present a total power balance in real time, power in from the waves and out into all the losses (and hopefully the battery), but it's ambitious, a few items may be hard to compute. In any event, I can certainly take the electro-hydraulic and wave-body items to implement/check and will make a branch to work in...

Incident Waves

  • Wave elevation and slope at specified points (done)

Free Surface Hydrodynamics (these force/moments are a little tricky b/c the coordinate system they are expressed in can be ambiguous)

  • Wave Exciting Force/Powers
  • Wave Exciting Moment/Powers
  • Wave Radiation Force/Powers
  • Wave Radiation Moment/Powers
  • Buoyancy Force/Powers
  • Buoyancy Moment/Powers

Hydrodynamic Drag Losses (This may be tricky or impossible b/c we are using an existing Gazebo plugin, so maybe skip for now)

  • Surface buoy drag losses (instantaneous power in Watts)
  • Heave Code drag losses (instantaneous power in Watts)
  • PTO drag losses (instantaneous power in Watts)

Piston Behaviors

  • Friction Losses (instantaneous Power in Watts)

ElectroHydraulic PTO

  • motor drive i2R losses (instantaneous power in Watts)
  • motor friction losses (instantaneous power in Watts)
  • motor drive switching losses (instantaneous power in Watts)
  • battery i2R losses (instantaneous power in Watts)
  • Power in/out of battery storage (instantaneous power in Watts)
  • Hydraulic motor losses (instantaneous power in Watts)
  • Drive electronics hotel power (might be unmodelled at this point, very small... 2 Watts or so)
  • Shaft torque
  • differential hydraulic pressure
  • mechanical/volumetric efficiencies

Tether (May be impossible to divine)

  • Tether friction power loss

Air spring

  • Heat loss (instantaneous power in watts)
  • piston pos/vel
  • force
  • temperature
  • mass of N2

@andermi
Copy link
Collaborator Author

andermi commented Sep 7, 2023

@hamilton8415 edited your list with checkboxes

@andermi
Copy link
Collaborator Author

andermi commented Sep 7, 2023

added mechanical/volumetric efficiencies

@andermi
Copy link
Collaborator Author

andermi commented Sep 7, 2023

these force/moments are a little tricky b/c the coordinate system

I added them to latent_data in the same form as you apply the wrench
baseLink.AddWorldWrench(_ecm, w_FBp + w_FRp + w_FEp, w_MBp + w_MRp + w_MEp);

latent_data.wave_body.buoyant_force = w_FBp;
latent_data.wave_body.buoyant_moment = w_MBp;
latent_data.wave_body.radiation_force = w_FRp;
latent_data.wave_body.radiation_moment = w_MRp;
latent_data.wave_body.exciting_force = w_FEp;
latent_data.wave_body.exciting_moment = w_MEp;

@andermi
Copy link
Collaborator Author

andermi commented Sep 7, 2023

We have a force/torque sensor at the universal joint between the buoy and the pto. It provides 6dof force/torque, but we are only using force.z to act as the load_cell. Do we want to report all the other values in latent_data?

@andermi
Copy link
Collaborator Author

andermi commented Sep 7, 2023

we could also add more force/torque sensors anywhere we'd like for extra info

Signed-off-by: Michael Anderson <[email protected]>
Signed-off-by: Michael Anderson <[email protected]>
@hamilton8415
Copy link
Collaborator

Thanks, ros2 topic echo /latent_data now streaming data...

@andermi
Copy link
Collaborator Author

andermi commented Sep 16, 2023

@hamilton8415 next step is power for WaveBodyInteractions?

@hamilton8415
Copy link
Collaborator

Yeah, I made branches to get started on that, but am still thinking about it some. We might not want to get too crazy, in that case there's energy coming and going from potential/kinetic energies, so things aren't going to line up so well as the quasi-static ehpto, so it'll be interesting maybe, but I'm not thinking we want to pursue an entire energy balance checking for the whole system, since we don't also have easy ways to incorporate viscous drag, etc. So basically, I think we should go ahead and include potentially interesting quantities throughout, and call it done. :)

* added wave_body total forces

Signed-off-by: Michael Anderson <[email protected]>

* added buoy pose and twist to latent data

Signed-off-by: Michael Anderson <[email protected]>

* added pose/twist to operator== for latent data

Signed-off-by: Michael Anderson <[email protected]>

* init pose/twist

Signed-off-by: Michael Anderson <[email protected]>

* linters

Signed-off-by: Michael Anderson <[email protected]>

---------

Signed-off-by: Michael Anderson <[email protected]>
Copy link
Collaborator

@hamilton8415 hamilton8415 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Progress.

@andermi andermi merged commit 7b1e71e into main Sep 21, 2023
2 checks passed
@andermi andermi deleted the andermi/latent_data branch September 21, 2023 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants