JohnDTill / ContinuumRobotExamples

An incremental guide to continuum robot mathematical modeling and numerical implementation. The examples are divided into chapters within the folder structure, and each chapter contains a PDF and code examples.
MIT License
148 stars 47 forks source link

Rod with an Archimedean spiral reference shape #5

Closed jiefengsun closed 3 years ago

jiefengsun commented 4 years ago

Hello John,

I saw that you have graduated and Congratulations! Not sure if you have memory on the stuff or not. But I have a problem to initialize a complicated geometry curve as a reference configuration.

I am trying to see if the code can be applied to a rod with more complicated reference shapes rather than a planar straight rod or regularly curved rod. After some trials, it seems to work well for some complicated shape as long as I can reparameterize the shape using arc length s.

However, for a curve that cannot be parameterized using s, it will be a pain. For example, a rod that has Archimedean spiral shape as a reference configuration using cylindrical system $r =a\theta$ or using position vector $p = [\thetacos(\theta), \theta*sin(\theta), 0]'$. To set up such a reference shape, u_0(s) and v_0(s) are required and they are functions of s. Ideally, we need to find $\theta = f(s)$, which is represent \theta using s. But this is not possible, which can be seen from the following picture: we can not find an explicit function. Do you have any good ideas about this?

Thanks, Jiefeng

image

JohnDTill commented 4 years ago

Hello Jiefeng,

Thanks! I still remember most of my PhD research. We're actually at the proof stage of publishing my last paper!

This is a brain teaser. You have an explicit formula for the arclength s(θ). Perhaps you could parameterize all your equations by θ. For example ∂p/∂θ = ∂p/∂s * ∂s/∂θ = Rv * ∂s/∂θ. You would need to solve ∂s/∂θ. The arclength in polar coordinates is defined by ds = sqrt(r² + (dr/dθ)²) * dθ, where (dr/dθ)² = a², so ∂s/∂θ = sqrt(r² + a²) = sqrt(a²(1 + θ²)).

Then you have the curvature with respect to theta, κ(θ), and can build u₀ = [κ 0 0]. The local frame derivative is defined by v₀ ≔ R₀ᵀṗ₀, where ṗ₀ = ∂p₀/∂s = ∂p₀/∂θ * ∂θ/∂s. Depending on how you define your frames, you could have R₀= Rz(θ), and the Cartesian coordinates from polar coordinates could be p = r [cθ sθ 0] = aθ[cθ sθ 0], which you could find an analytical derivative for.

It's a little rough, but I think parameterizing by θ is probably the best approach.

jiefengsun commented 4 years ago

Hello John, Thanks for the response! It is a brain teaser. I thought about reparameterizing by θ and it should work well. The only thing is that I have to make sure that the constitutive equations are still valid since the distributed force previously is defined by force in a unit length and now I need to exam what is the unit when I applied a distributed force.

However, I am thinking whether there is a general way to do it because we will need to parameterize it differently for a different problem. For example, a parabola y = x², at any point x, the arc length is image

Then, I need to reparameterize the equation by x instead of s. I feel it is a way to go. But just not very convenient. I need reformulated the whole model when I have a curve that might be explicitly written as s(θ) or s(x).

Do you think if there is a numerical way to still parameterize a curve by s so that I can still keep the original formulation?

Best, Jiefeng

JohnDTill commented 4 years ago

That is a good point- it's a lot of work for one specific problem. You could build a table of values u₀(sᵢ) and v₀(sᵢ) and interpolate to find u₀(s) and v₀(s). If you wanted that table to be linspaced, you'd have to also do some numerical work to find θᵢ values such that sᵢ(θᵢ) values are approximately linspaced.

jiefengsun commented 4 years ago

Thanks! I will try to see if it is possible to build a table of values u₀(sᵢ) and v₀(sᵢ). Yet I don't have a concrete idea of how to implement it. It needs a table of p(sᵢ) from p(θ). And then, it might be difficult to do partial differentiation on a table to get ṗ₀(sᵢ) from p(sᵢ), and eventually, arrive at v₀(sᵢ) ≔ R₀(sᵢ)ᵀṗ₀(sᵢ).

Some guys use the discrete elastic rod theory (Bergou et, al). I can look into it and see if they have a convenient way to represent a curve that cannot be explicitly parameterized by s.

Anyway, I will try hard. Thank you again for your help!

Jiefeng