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

PTO <=> WEC degrees of freedom #52

Closed
cmichelenstrofer opened this issue Feb 21, 2022 · 13 comments · Fixed by #63
Closed

PTO <=> WEC degrees of freedom #52

cmichelenstrofer opened this issue Feb 21, 2022 · 13 comments · Fixed by #63
Assignees
Labels
documentation Improvements or additions to documentation question Further information is requested

Comments

@cmichelenstrofer
Copy link
Member

cmichelenstrofer commented Feb 21, 2022

I think the conversion between PTO and WEC DoF is wrong. Currently we're using a kinematics matrix to go in one direction, and the transpose of that matrix to go in the other. If it was merely a change of coordinates, the two matrices would be the inverse of each other, not transpose. However it is not simply a change of coordinate, the number of WEC DoF doesn't need to be the same as the PTO DoF (and even if a square matrix doesn't have to be nonsingular). Seems to me that two different transformations are needed and one cannot be inferred from the other.

  1. From WEC DoF (solved in the dynamics) to PTO DoF (needed to calculate PTO forces)
  2. From PTO forces to forces on the WEC DoF (needed to solve the dynamics)
@cmichelenstrofer cmichelenstrofer changed the title Validate multiple PTO DoF's PTO <=> WEC degrees of freedom Feb 22, 2022
@cmichelenstrofer cmichelenstrofer added bug Something isn't working enhancement New feature or request labels Feb 22, 2022
@cmichelenstrofer cmichelenstrofer removed the enhancement New feature or request label Feb 22, 2022
@dtgaebe
Copy link
Collaborator

dtgaebe commented Feb 23, 2022

Thank you for bringing this up! I have to take back what I said earlier. I think we are mostly doing it right. My current understanding is that:

The way I derived the forward kinematics is fine to relate PTO forces to the generalized force vector on the WEC with the Jacobian J ,

The "inverse" kinematics, i.e. from WEC x to PTO p frame_ are in fact the transpose of the Jacobian J,
,
BUT the inverse kinematics, are not actually the inverse in terms of linear algebra. Commonly the literature states uses J^-1 to denote the inverse kinematics, but the way we are using the relation

One issue in the code is the position method. If I understand it correctly, we can use the Jacobian to relate forces and velocities in the different frames, but not the position coordinates.

I think we need to

  1. use the WEC position to calculate the Jacobian
  2. The PTO positions are either constant (PTO outside of WEC), or directly dependent on the WEC position (if PTO on WEC)
  3. use the transpose Jacobian to calculate PTO velocities
  4. use the Jacobian to convert PTO force to generalized force vector on the WEC

@cmichelenstrofer
Copy link
Member Author

@dtgaebe what we want is the PTO position not velocity, so if I understand your explanation correctly we in fact need something different than just J^T. But maybe we could create this transform from J followed by an integration.

The conclusion that the transformation from WEC velocity to PTO velocity is simply the transpose of the Jacobian is general? For any number and type of WEC and PTO DOFs? Could you document this?

@cmichelenstrofer
Copy link
Member Author

@ryancoe it sounds like there is a serious problem in the code, but that the solution would not require more information from the users as I thought.

@cmichelenstrofer
Copy link
Member Author

@dtgaebe if J and J^T are not inverse (J^T J =/= I) then what does the transformation from p_dot to x_dot look like? It can't be x_dot = J p_dot. Also how do you type math in here?

@dtgaebe
Copy link
Collaborator

dtgaebe commented Feb 23, 2022

@cmichelenstrofer I see. In that case, the PTO positions should always be a linear combination of the WEC state, i.e. can be obtained by rotation and translation with the standard homogeneous transformation matrix
image
This holds for the general case of 6Dof, but requires rotation about the other Dofs as well.

Yes, the transpose should be generally applicable, but I will look more into this. Yesterday I found a paper that uses the inverse kinematics for a tether submerged WEC and it turned out to be the transpose of what I derived for the moored WECs. https://www.sciencedirect.com/science/article/pii/S0960148116301495
But I can look into the robotics, plain kinematics literature again and document it!

I see you point and don't know the answer. I will need to look into the theory again....
Here is a full thread with hacks on how to write math: https://gist.github.com/a-rodin/fef3f543412d6e1ec5b6cf55bf197d7b
But I just use the simplest, albeit not very elegant, way:
<img src="https://render.githubusercontent.com/render/math?math=e^{i \pi} = -1" >

@cmichelenstrofer
Copy link
Member Author

To clarify

  • the PTO does not have to be a line going from the WEC to an anchor at the seabed. E.g. the RM3 could have a direct drive, with the PTO motion equal to the buoy heave - spar heave. We want a general answer for any PTO and WEC archetype.
  • The question boils down to "Are the two transformations we need related to each other? I.e. can we get one given the other?" for arbitrary WEC and PTO archetypes. The two transformations are:
    • From PTO force (in the PTO frame) to forces on the WEC
    • From WEC position to PTO position (in PTO frame)

@dtgaebe
Copy link
Collaborator

dtgaebe commented Feb 24, 2022

Yes, but we always need the direction that the PTO is acting in. If the direction is the difference (in Cartesian coordinates in the inertial frame) between an anchor and PTO, or the difference between a point on the WEC body and the PTO doesn't matter for the transformation of the forces. This transformation is the Jacobian, which generally depends on the positions of the PTO force attachment point, which depends on the WEC instantaneous position. (The transformation (Jacobian) will be different for rotational PTOs )

  • I think that the transformation from WEC position to PTO position is easy. It is eq. (8) in my previous post.
    • Why do we need the PTO position in the PTO frame again? Shouldn't that be constant?
  • The Jacobian to relate the forces from PTO to WEC depends on
    • The direction that the PTO is acting in
      • Which depends on the PTO position in the inertial frame and a reference point also in the inertial frame (thus eq. (8))
    • The position of the PTO attachment relative to the bodies center of gravity (I'd use the constant PTO position in the bodies coordinate system)
      • Which is required for the torques on the WEC
    • For a rotational PTO we need the axis of rotation

I did quite a bit of theory on paper today and will type it up soon, should be more elegant now. Long story short, I think the user will only have to provide the reference points and decide between linear, or rotational PTO.
The coordinate transformation for the positions only depends on the instantaneous WEC position, we'll use that to compute the Jacobian, which we will use for the relation between PTO force in PTO frame and the force acting on the WEC.

@cmichelenstrofer
Copy link
Member Author

  • the PTO motion is not constant, else there is PTO no force or power.
  • the attachment points can be between different WEC bodies.

@cmichelenstrofer
Copy link
Member Author

cmichelenstrofer commented Feb 25, 2022

I took a stab at this after @dtgaebe pointed me towards using conservation of energy in both frames. This was the additional information that was needed. I am now convinced we are doing it correctly. See figure below. @dtgaebe can you double check that this looks correct and I will close the issue.

Screen Shot 2022-02-25 at 09 46 37

@dtgaebe
Copy link
Collaborator

dtgaebe commented Feb 25, 2022

Yes, that is it! Granted, p and x are velocities.

Per this definition the kinematic matrix we need to ask the user for is commonly referred to as the inverse kinematics! That's where I was wrong in trying to focus on the standard Jacobian (forward kinematics from PTO to endeffector (WEC))

Last question I have is about the position method in the PTO class. It is also computed with the K^T, which I don't understand.

@cmichelenstrofer
Copy link
Member Author

cmichelenstrofer commented Feb 25, 2022

Oh my bad! I will update it soon and share it here. Actually, I think it is right.

@dtgaebe
Copy link
Collaborator

dtgaebe commented Feb 25, 2022

No, my apologies for the confusion.

Your math is correct, but now I am again confused how K looks like, or can be derived.

@cmichelenstrofer cmichelenstrofer mentioned this issue Feb 28, 2022
14 tasks
@cmichelenstrofer
Copy link
Member Author

There is no error in the code! I did make some changes to make the kinematics more clear (#63)

@cmichelenstrofer cmichelenstrofer linked a pull request Mar 1, 2022 that will close this issue
14 tasks
@cmichelenstrofer cmichelenstrofer added documentation Improvements or additions to documentation question Further information is requested and removed bug Something isn't working labels Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants