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

Elevator example, test and docs #63

Merged
merged 8 commits into from
Nov 12, 2021
Merged

Elevator example, test and docs #63

merged 8 commits into from
Nov 12, 2021

Conversation

chapulina
Copy link
Contributor

@chapulina chapulina commented Nov 4, 2021

Part of #48

  • Added example executable that controls just the elevator
  • Fixed the forward direction in the lift-drag plugin to be -X, because the link's -X is facing the forward direction. But I think that what really matters is the axis, not necessarily the direction.
  • Documented the direction of the elevator joint angle

image

  • Added a test that checks that the vehicle goes down for a positive elevator angle when propelled forward.

I checked manually that the behaviour doesn't seem to be entirely correct though. I'd expect a positive angle of attack to generate lift on the back of the vehicle, so it tilts forward and goes down when propelled forwards. But at low thrust, the vehicle is going up. The higher the thrust, the more it arches downwards. In all cases though, the oscillation of death is present (probably related to #49 ).

elevator = 0.26 rad, prop omega = 3.0 rad/s

omega3

elevator = 0.26 rad, prop omega = 10.0 rad/s

omega10

elevator = 0.26 rad, prop omega = 30.0 rad/s

This is the value used in the test

omega30

Update

At @arjo129 's suggestion I used a lower angle of attack on the test, which has less oscillation for higher prop omegas:

elevator = 0.15 rad, prop omega = 30.0 rad/s

0 15rad30rads


// Rotate elevator counter-clockwise when looking from starboard, which
// causes the vehicle to pitch down
cmdMsg.set_elevatorangleaction_(0.27);
Copy link
Member

@arjo129 arjo129 Nov 5, 2021

Choose a reason for hiding this comment

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

Given the stall angle of the foil is 0.17 radians as defined here:

<alpha_stall>0.17</alpha_stall>
I don't think we should expect any reasonable behavior if we move the rudder/elevator passed that.

One additional assertion could be that the vehicle will never go passed 40 degrees pitch.

Copy link
Collaborator

@braanan braanan Nov 5, 2021

Choose a reason for hiding this comment

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

Hi @arjo129 @chapulina,

Here are notes regarding the LRAUV control surfaces along with a plot of their lift/drag coefficients as a function of angle of attack. As you can see, the control surfaces are still generating lift with minimal drag throughout the nominal operation range of the fins (+/- 15 degrees). Drag increases past the nominal range. As Arjo pointed out, alpha stall is found at the edge of the linear range around +/-0.17 rad (or ~9.7 deg).

lrauv_lift_drag

LRAUV control surfaces:
area: Surface area of the link.

122 cm^2 for one fin.

a0: The initial "alpha" or initial angle of attack. a0 is also the y-intercept of the alpha-lift coefficient curve.

0.0 degrees

cla: The ratio of the coefficient of lift and alpha slope before stall. Slope of the first portion of the alpha-lift coefficient curve.

C_{L\alpha} = 4.13  (alpha in radians)

cda: The ratio of the coefficient of drag and alpha slope before stall.

The coefficient of drag at alpha =0 is 0.03.  The ratio drag/aoa is given below.  Please see Coeffs.png.

C_{D\alpha} = .04/.2 = .2 (alpha in radians)

cp: Center of pressure. The forces due to lift and drag will be applied here.

(3.7, 7.9) cm as shown in the attached diagram OriginalFin.png.  This moves as a function of aoa, as show by the attached diagram cp.png.  Note that cp.png is referenced to mean chord length, not the root chord length.

forward: 3-vector representing the forward direction of motion in the link frame.

[1 0 0]

upward: 3-vector representing the direction of lift or drag.

[0 0 -1]

alpha_stall: Angle of attack at stall point; the peak angle of attack.

9.5 degrees (.17 rad)

cla_stall: The ratio of coefficient of lift and alpha slope after stall. Slope of the second portion of the alpha-lift coefficient curve.

-1.1 (alpha in radians)

cda_stall: The ratio of coefficient of drag and alpha slope after stall.

.030 (alpha in radians)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ohh good point. I see on the controller's config that the rudder angle limit is 15 deg (0.261799 rad), which matches the joint limits. The only stall angle that I found on MBARI's code was the tailcone's stall angle, which is 30 deg. Do you remember where the elevator and rudder stall angles that we're using on lift-drag were taken from? We should document it.

If angles beyond stall result in unreasonable behaviour (at least with our lift-drag plugin), maybe we should limit the joint there?

Copy link
Member

Choose a reason for hiding this comment

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

From the above plot. Ben sent it to us on slack.

Copy link
Collaborator

@braanan braanan Nov 5, 2021

Choose a reason for hiding this comment

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

I believe the values for the coeffs in the plugin came from the notes above. These notes are from Rob McEwen, our controls engineer. The lrauv-application already limits the angle of the fins to +/- 15 deg, and that's the range we operate with in the field. I guess it's worth noting that the plot above is for the angle of attack and not the fin angle. Still, plenty of lift should be generated past the alpha stall — I think that's also shown in this Gazebo tutorial: http://gazebosim.org/tutorials?tut=aerodynamics&cat=physics

It might be worth revisiting the coeffs values since there might be a gap between Rob's understanding and what we're doing with these values in the plugin.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks! Hmm.. are these in the vehicle frame? X velocity magnitude is about right but I'd expect the sign to be positive.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, oops — I see there in the world frame!

Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice!

Copy link
Member

@arjo129 arjo129 Nov 5, 2021

Choose a reason for hiding this comment

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

So liftdrag plugin, should theoretically be giving the correct force values up to +/- 15 degrees. The liftdrag doesn't support any Cp other than Cp (0 0 0). It might be worth using the force visualizations to see whats actually going on.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I captured the gist of this conversation in #78

@chapulina chapulina self-assigned this Nov 5, 2021
@braanan
Copy link
Collaborator

braanan commented Nov 5, 2021

FYI, the source for calculating lift drag for the control surfaces in the MBARI sim can be found here: https://bitbucket.org/mbari/lrauv-application/src/master/Source/simulatorModule/Simulator.cpp#lines-852

@chapulina
Copy link
Contributor Author

@arjo129 , are there any other changes you'd like to see in this PR? I believe I've addressed all your comments.

@arjo129
Copy link
Member

arjo129 commented Nov 12, 2021

So I went on to study why our vehicle is slowly floating up at low velocities:

At 3 rads^-1, elevator pitch =0.26

The vehicle floats up, I was wrong about the hydrodynamics as it is always acting in the correct direction opposing the general direction of motion. The issue may be due to hydrostatics.

image

Now look at the forces at high velocities:

This is at 30rads^-1, pitch =0.26
image

For some reason we have a non-zero force from the rudder... Note: I am unable to reproduce the oscilatiions here.
@braanan At 3 rad/s the vehicle moves at 1cm/s is it controllable via fins at such low velocities?

Copy link
Member

@arjo129 arjo129 left a comment

Choose a reason for hiding this comment

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

I'm OK with approving this PR as I don't think the issues highlighted by @chapulina have much to do with the odd behaviour at low velocities.

@chapulina
Copy link
Contributor Author

For some reason we have a non-zero force from the rudder...

Interesting, does the vehicle have any yaw then?

Note: I am unable to reproduce the oscilatiions here.

You mean the "skipping" from #78? Interesting, I have to check if it's my setup then. Does the vehicle stabilize at a downwards pitch for you then?

@chapulina chapulina merged commit 16bf805 into main Nov 12, 2021
@chapulina chapulina deleted the chapulina/elevator branch November 12, 2021 18:13
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.

3 participants