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

Adding viscous drag via hydrodynamics plugin #32

Merged
merged 19 commits into from
Jan 31, 2023

Conversation

quarkytale
Copy link
Contributor

@quarkytale quarkytale commented May 4, 2022

Adding Gazebo's Hydrodynamics plugin on the heave cone.

Try the test world ign gazebo src/buoy_sim/buoy_gazebo/worlds/test_heave_cone_model.sdf -v to play with different values of plugin parameters.


Parameters
Given: Added mass in z-direction, surface area and drag coefficient.

The quadratic damping, Zww (kg/m) = 0.5 * rho * C_d * A
where rho is density of water (kg/m^3), C_d is the drag coefficient, and A is the surface are of the cone (m^2)
A simple approach to test, used the average drag coefficient up/down to calculate Zww.
Zww(open) = 2700.10625 kg/m, Zww(close) = 3782.25 kg/m

Updated the plugin parameters and with the given properties.


Issues
With the current upstream plugin, we can't change the parameters dynamically for heave cone's open/close as well as up/down motion.


Discussion

  • Use separate worlds for open and close configurations
  • Up and down drag coefficients: use average for now, revisit later
  • May need to extend plugin in the future to add more coefficients and account for no up-down symmetry
  • Write a test to drop heave cone by itself and see if it reaches the expected terminal velocity

@quarkytale quarkytale linked an issue May 4, 2022 that may be closed by this pull request
@mjcarroll
Copy link
Collaborator

mjcarroll commented Oct 31, 2022

Test in conjunction with garden's added mass. Zero out the added mass terms in the hydrodynamics plugin but keep the viscous drag coefficients.

Does this yield something sane/stable?

@andermi to give @quarkytale nominal drag values.

@quarkytale
Copy link
Contributor Author

@hamilton8415 @andermi @mjcarroll Picking this up again. I added two buoys in a test world heave_cone_hydrodynamics.sdf, one having the hydrodynamics plugin and the other without it. Then plotting piston velocity from the ElectroHydraulicPTO plugin for both.

  • Buoy1 having the hydrodynamics plugin with just damping seems to be functioning, no crashes. Need more insights on how I can further validate damping.
  • Setting this up brought up the question of bringing up multiple buoys. I did some workarounds, had to set unique namespaces for the controllers to function. And using the model name in publishers generated ElectroHydraulicPTO plugin so those are unique too. (Just compiling the thoughts here to be explored later).

To try this, run ign gazebo src/buoy_sim/buoy_gazebo/worlds/heave_cone_hydrodynamics.sdf -v 4

two_buoys.mp4

@quarkytale
Copy link
Contributor Author

quarkytale commented Jan 26, 2023

@andermi @hamilton8415 I'm not sure why but this is not being stable independently. Putting a pin on the sign, I can only run the sim with added mass #115 in or if I reduce the damping values from the range of 1000s to 100s.
Only test I can think of is adding an opposing force to the link externally to make it stable, but what would that imply physically?

To run the world, gz sim src/buoy_sim/buoy_gazebo/worlds/test_viscous_drag.sdf -v 4

@quarkytale quarkytale changed the title Adding hydrodynamics plugin to heave cone Adding viscous drag via hydrodynamics plugin Jan 26, 2023
Signed-off-by: Dharini Dutia <[email protected]>
@quarkytale quarkytale marked this pull request as ready for review January 27, 2023 00:36
Signed-off-by: Dharini Dutia <[email protected]>
@hamilton8415
Copy link
Collaborator

hamilton8415 commented Jan 30, 2023

Comments on line 485 and 498 in model.sdf.em should refer to "Pitch" instead of "Roll"...

@hamilton8415
Copy link
Collaborator

Nice to see these tests passing on CI, although I can't get the to pass locally (I never can...). In any event, I am going to do a final review of the drag values this morning with Rob McEwen so hopefully we can merge this today if the tests really are passing.

Signed-off-by: Dharini Dutia <[email protected]>
@quarkytale
Copy link
Contributor Author

quarkytale commented Jan 30, 2023

Updated with the new drag values. Tests are passing for me locally too.

Are we defaulting the heave cone to be doors closed? Also, need advice on whether to keep the test world for testing values in future?

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.

I checked the sdf values and they match the documentation. I also built and ran this and the buoy behaved as one would expect. I am not able to get the tests to pass locally, although I see they are fine on the CI. This seems to be a problem for me locally recently, if they pass for you locally as well as on CI, merge away.

@andermi
Copy link
Collaborator

andermi commented Jan 31, 2023

@quarkytale @hamilton8415 is there anything left to do here or can I merge this so I can merge batch running?

@hamilton8415
Copy link
Collaborator

I say merge and move on. We will come back after the waves are merged as we've discussed.

@andermi andermi merged commit cb888d0 into main Jan 31, 2023
@andermi andermi deleted the quarkytale/heave_cone_plugins branch January 31, 2023 19: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.

Add hydrodynamics plugin / viscous drag to heave cone
4 participants