Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- Be respectful, on topic and if you see a problem, Flag it.
If you would like to contact our Community Manager personally, feel free to send a private message or an email.
How to model buoyancy for underwater robot?
alnis
Member, Developers Posts: 452 EDU
Does anyone have any tips for accurately modeling buoyant systems as far as mass properties? The underwater robotics team I'm on is designing an ROV using Onshape. However, getting useful mass properties is a bit challenging.
Ideally, we could override the volume of parts & assemblies to their measured values from dropping them in a beaker or something (e.g. air on the inside of the pressure hold adds extra volume, vendor models aren't exact, etc., etc.), but that functionality doesn't seem to be available today.
Also, having some way of finding the center of volume (geometric centroid) would be super useful so we can balance it with the center of mass.
It might be possible to whack this with the configuration hammer, i.e.:
Alternatively, maybe writing some sort of script in Blender could accomplish the buoyancy calculations based on the mesh without too much trouble. I've already done a bit of scripting in Blender with our ROV model to generate a transformation matrix from control inputs to motor power outputs & visualize propulsion, and it wasn't that bad. However, there's the time investment of writing a bunch of scripts, and there will be accuracy limitations from using a mesh representation...
Unfortunately, the assembly mass properties endpoint doesn't seem to have a way to exclude certain instances or override the density to get the geometric centroid, so the Onshape API probably won't work, at least in a simple way.
Ideally, we could override the volume of parts & assemblies to their measured values from dropping them in a beaker or something (e.g. air on the inside of the pressure hold adds extra volume, vendor models aren't exact, etc., etc.), but that functionality doesn't seem to be available today.
Also, having some way of finding the center of volume (geometric centroid) would be super useful so we can balance it with the center of mass.
It might be possible to whack this with the configuration hammer, i.e.:
- Two configs of every part: (A). the density of 1 (since the center of mass = center of volume for density = 1) and (B) the actual density for accurate mass/center of mass
- Two configs of every pressure vessel: (A) empty of parts inside, but has a block of air (for accurate volume) and (B) the actual parts inside (for center of mass)
Alternatively, maybe writing some sort of script in Blender could accomplish the buoyancy calculations based on the mesh without too much trouble. I've already done a bit of scripting in Blender with our ROV model to generate a transformation matrix from control inputs to motor power outputs & visualize propulsion, and it wasn't that bad. However, there's the time investment of writing a bunch of scripts, and there will be accuracy limitations from using a mesh representation...
Unfortunately, the assembly mass properties endpoint doesn't seem to have a way to exclude certain instances or override the density to get the geometric centroid, so the Onshape API probably won't work, at least in a simple way.
Get in touch: contact@alnis.dev | My personal site: https://alnis.dev
@alnis is my personal account. @alnis_ptc is my official PTC account.
@alnis is my personal account. @alnis_ptc is my official PTC account.
Tagged:
3
Answers
I'm kinda shooting from the hip here. Not sure if that's workable, and even if it is, it's certainly still cumbersome. Also not sure if it's any better than configs.
The only issue would be that you would need to fill any "sealed" cavities (either before or after the boolean). If you don't have too many of these a config where they are filled might not be that hard to setup.
With select bounded faces, pick the seed 1st, then pick all the bounding faces.
1st pick is the seed:
then, pick all the boundaries:
with the selected faces, create a manifold:
I found it odd that the OS's materials library doesn't include air or water. Maybe I couldn't find them or maybe they should add them.
It'd be interesting if we could write a feature script that would read the center of mass of water displacement & block weight and compute buoyancy. We can read computed numbers now with feature script, right?
The more I think about it..... You could compute an upright vector that'd compute the stability of the hull design. What's cool is that it'd be parametric and could display a 3d vector on your geometry. You could easily make changes to the hull and see the effects and maximize stability.
Your inputs would be:
-max waterline (red surface)
-face of hull (use a boundary method up to the max waterline)
-boat loads (pick those things that matter)
It returns:
-a surface showing waterline.
shifting weight on boat position 1:
shifting weight on boat position 2:
I'm not going to write it but I see how this could be a useful tool. As the weight moves around or you add weight, the buoyancy victors change depending on the shape of the hull. It's an iterative process which I think feature script could easily perform.
If you write this script make sure you put a counter in your while statement to prevent run away scripts. I think I had 10 or 15 OS sessions going when I wrote fitspline do to conditions that wouldn't solve. I think I stopped after 1000 iterations which meant things weren't converging.
@alnis if you write it, I'd definitely play with it.
@eric_pesty That seems like the easiest approach. It might get a bit cranky with surface models, non-manifold geometry (e.g. circles tangent to rectangles), etc., but it can probably give a decent result pretty quickly
@konstantin_shiriazdanov Thank you for the detailed information about how to approach writing a script for this!
@billy2 That looks like a really neat idea for a tool for ship/boat design! It would definitely make for a fun project. Unfortunately, our ROV has by no means a nice and friendly surface to work with, so maybe not super applicable here, but I'm sure someone would find something like it useful.
Thanks for all of the ideas everyone! I'll make sure to post an update later once we've put our ROV in the water and balanced it a few times to see which method gives the closest results for the least amount of work.
@alnis is my personal account. @alnis_ptc is my official PTC account.