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

Build 18.01-rc4: CP calculation is bonkers #387

Closed
neilweinstock opened this issue Jan 18, 2018 · 24 comments
Closed

Build 18.01-rc4: CP calculation is bonkers #387

neilweinstock opened this issue Jan 18, 2018 · 24 comments

Comments

@neilweinstock
Copy link
Contributor

CP calculation is badly broken. I'm not yet sure what triggered it. See attached design; OR is showing me CP = -181 inches, which I'm pretty sure is not correct. :)

plasma_dart2_scoop_newOR.zip

@teyrana
Copy link
Member

teyrana commented Jan 27, 2018

@neilweinstock I took a look at your rocket, and there are two backward facing transitions. I'm not familiar with this particular model; are both of those supposed to be there?

@neilweinstock
Copy link
Contributor Author

neilweinstock commented Jan 29, 2018 via email

@neilweinstock
Copy link
Contributor Author

I'm seeing this again and I can show some examples. First, here's a simple test with pods:
image
This shows the CP way up front, despite the fact that it should clearly be towards the back, and in the text display in the upper right it says "N/A". Note that in side view, no CP is shown, which perhaps corresponds more closely to "N/A", but I'm not sure why it should be N/A in the first place.

If I add a nose cone, CP moves way to the front.
image

In other cases, I'm seeing the CP being rendered off-axis only in the 3D view, and only when pods are involved, and when conditions are correct (I haven't figured out exactly what those conditions are). Here's an example:
image
Note how the CP is shown axially centered on one of the pods.

Here's the ORK file used for the above screenshots. If you delete the fins on the pods you can get the CP to jump all the way into the nose cone.

cp_position.zip

@neilweinstock
Copy link
Contributor Author

neilweinstock commented Sep 11, 2018

Here's another example of a problem using the latest alpha that Daniel sent me:
image

I put this file together for another issue, but again the CP is miscalculated to be at the front of the rocket instead of closer to the back. It also is shown in the 3D view seemingly off axis in the wrong direction. CP location is listed as "N/A" for some reason. In side view, CP is not shown at all, which perhaps is correct if OR doesn't think it has one.

fin_decal_problem.zip

@wcravens
Copy link
Member

wcravens commented Sep 11, 2018 via email

@neilweinstock
Copy link
Contributor Author

neilweinstock commented Sep 11, 2018 via email

@neilweinstock
Copy link
Contributor Author

Here's the same file opened in 15.03:
image

Interestingly, the CP once again is calculated as N/A, and yet is displayed in the 3D view. Although this time it is shown closer to what I would expect to be "correct" in the 3D view. But I don't know for sure. So I don't know if my example file actually shows a new calculation problem, maybe just the 3D view display problem.

Also: the file I attached above might have 3 fins rather than 1, due to a previous but that has since been fixed. Setting number of fins to 1 creates the CP problem. When #fins=3, the CP is calculated correctly (I think) but once again shown off-axis in the 3D view.

@neilweinstock
Copy link
Contributor Author

Sorry, seemed to have hit "close" by accident.

@neilweinstock
Copy link
Contributor Author

Here's a design that creates a similar bug in rendering the CG in 3D finished mode.
cg-bug

cg_render_bug.ork.zip

@teyrana
Copy link
Member

teyrana commented Sep 30, 2018

That last design: it's neutrally stable: there is no Center of Pressure for us to calculate. I'm not sure what the expected output is, but I can't think of a better representation.

@teyrana
Copy link
Member

teyrana commented Sep 30, 2018

If we're talking about the example above, with the three detached pods, the 3D CoP seems to be displayed incorrectly in 3D (it's clamped to the x-axis in 2D). I haven't calculated if the x value makes sense for that design, though. That's probably the problem.

Edit: Clarification: 3d views don't work on my machines. :P

@neilweinstock
Copy link
Contributor Author

Both the CG and CP are sometimes shown off-axis, as shown above.

As for the design having no actual CP: if that's the case, then as far as I'm concerned nothing should be shown in the drawing. The red dot indicates a CP.

@teyrana
Copy link
Member

teyrana commented Oct 1, 2018 via email

@neilweinstock
Copy link
Contributor Author

Fair enough! Good luck with your search.

@neilweinstock
Copy link
Contributor Author

Still present in build alpha 9.

screen shot 2018-11-03 at 4 55 31 pm

@ChrisMickelson
Copy link
Contributor

Looking into this. So far it seems the 3D renderer is being told that CG and CP have a Y value, when any balanced design should be 0.
For example, here is some debug output I inserted into the renderer(RocketFigure3d.java:346) at the point where it's drawing the cg & cp carets:
CP: x=0.38327915090816433, y=0.008364311125459592, z=0.0
I can manually reset the Y value to 0 just prior to this point and it will look fine, but doesn't fix where the calculation is happening.
The offset CP seems to follow the first instanced fin attached to the main body tube.
The CG also seems to be pushed ~1% off-axis by pods, which is strange.

This issue is just as present with a simple 3FNC design.
image

@teyrana
Copy link
Member

teyrana commented Nov 5, 2018 via email

@ChrisMickelson
Copy link
Contributor

I started looking in where the cg & cp in the 3d view gets drawn
...\swing\src\net\sf\openrocket\gui\figure3d\RocketFigure3d.java in the method drawCarets()
around line 344 is where it's taking the cp and projecting them as 2d points before drawing the red dot.
Working backward, RocketFigure3d.java get's it's local cp value set from RocketPanel:607, which comes from line 586/588, which comes from BarrowmanCalculator:61 which bounces around to line 205.

That's as far as I can get for now.

That screenshot was just one of the built in examples.

teyrana added a commit to teyrana/openrocket that referenced this issue Dec 2, 2018
wcravens added a commit that referenced this issue Dec 8, 2018
[fixes #387] Fixes one source of off-axis CP error
@neilweinstock
Copy link
Contributor Author

Still not fixed in Alpha 10. On the same design I referenced previously, the CP has gotten closer to the center axis, but still not quite there.

image

I'm having a little more trouble getting this condition to show up on other designs, so it has clearly gotten better.

@teyrana
Copy link
Member

teyrana commented Dec 24, 2018

@neilweinstock

What's the name of that purple (sorry, "cranberry" ;) rocket you're posting there?

This issue seems to be fixed on the previous example files:
image

So the purple rocket probably has a different situation. Could you please post it, if it isn't already posted somewhere?

@neilweinstock
Copy link
Contributor Author

Here's a version where I stripped everything out that doesn't affect the CP offset.
alcubierre_cp.ork.zip

teyrana added a commit to teyrana/openrocket that referenced this issue Jan 2, 2019
teyrana added a commit to teyrana/openrocket that referenced this issue Jan 3, 2019
@neilweinstock
Copy link
Contributor Author

neilweinstock commented Feb 5, 2019

Alpha 11 report:
CP seems properly on-axis in most of my tests, but still not this one:
image

I notice that in this next one, the N/A CP is not shown in side view, but is shown in nonsense position in 3D view (this may or may not be a change from previous builds; just putting it here because I noticed it and we've discussed this design before).

Side view, no CP:
image

3D view, nonsense CP:
image

@neilweinstock
Copy link
Contributor Author

OK, on the real alpha 11, Alcubierre CP is shown properly on-axis in the 3D view.

I'm still seeing an off-axis CG problem, though, should I open a separate issue or address it here? It's the cg_render_bug.ork file from several messages up:
image

@neilweinstock
Copy link
Contributor Author

I believe the CP problem has been fixed (haven't seen crazy off-axis CP in quite a while), but the off-axis CG problem is still there, so I'm going to close this and file another just for that problem.

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

No branches or pull requests

4 participants