Orbiter-Forum  

Go Back   Orbiter-Forum > Orbiter Addons > Addon Development
Register Blogs Orbinauts List Social Groups FAQ Projects Mark Forums Read

Addon Development Developers post news, updates, & discussions here about your projects in development.

Reply
 
Thread Tools
Old 08-06-2015, 01:32 PM   #61
Face
Beta Tester
 
Face's Avatar

Default

Quote:
Originally Posted by fred18 View Post
 Do you mean contribution to the code? Well for the time being I have this steps in my mind:

1) gather feedbacks from beta testers to see if the module is properly reproducing the vinka's one and correct eventual issues
2) finish the implementations I have in mind, especially the peg autopilot.
3) modify what is needed for orbiter2015.
Well, that's more like a roadmap, not how we can contribute.

Quote:
Originally Posted by fred18 View Post
 Actually I let the code public so in the future, when the new "orbiter2028" will come out and I will be away or anything anybody can start from there and renew the multistage, for the moment I was not thinking of a repository or something "live" for multiple inputs.
Yeah, sure, that's the spirit of all this vinka replacements. I don't think that a repository is necessary immediately, my question was more geared towards this scenario:
  1. Some user mentions a bug/request.
  2. Some developer knows how to fix it, makes code-changes, and gets a working version.
  3. Now he wants to show you that changes, so you can integrate/merge it into your current work-in-progress to have it active in the next release. Or drop it and explain why.
How do you imagine the step 3 should happen? Posting ZIPs here in the thread? Email?


Quote:
Originally Posted by fred18 View Post
 Of course any help is appreciated and will be credited, if you check I also credited the functions and the inputs I had simply reading the forum in order not to disappoint anyone.
Perfect.

Quote:
Originally Posted by fred18 View Post
 I know that relevant to programming I still have millions of Kilometers to do, but it's an hobby and I'm simply enjoying the learning curve
Well, what you presented here is already a pretty big part of the road you're traveling.
Face is offline   Reply With Quote
Old 08-06-2015, 07:19 PM   #62
kuddel
Donator
Bug

This code part is accessing out of bounds if there are more than 4 "ENG_x"
entries in the scenario file.
Code:
    //engines///
    int nbeng;
    for(nbeng=0;nbeng<32;nbeng++){
    sprintf(engtxt,"ENG");
    sprintf(buff,"_%i",nbeng+1);
    strcat(engtxt,buff);
    GetPrivateProfileString(boostertxt, engtxt, buffreset, dataparsed, MAXLEN, filename);
    if(strncmp(dataparsed,buffreset,MAXLEN-5)==0){
    booster[b].nEngines=nbeng;        
    break;
        }else{
    CharToVec(dataparsed,&booster[b].eng[nbeng]);
        }
    }
"booster[b].eng[nbeng]" might access outside of eng bounds, wich is declared as beeng 4 elemens in size:
Code:
struct BOOSTER{
    //...
    VECTOR3 eng[4];
    //...
};
Seems like you accidentally mixed BOOSTER and STAGE ...

---------- Post added at 21:19 ---------- Previous post was at 21:11 ----------

Another thing cppcheck[1] found:

-- ------------------------------------------------------------------
In line 423 of Multistage2015.cpp
-- ------------------------------------------------------------------
Using 'sizeof' for array given as function argument returns the size of a pointer.
It does not return the size of the whole array in bytes as might be expected.
For example, this code:
Code:
int f(char a[100]) {
  return sizeof(a);
}
returns 4 (in 32-bit systems) or 8 (in 64-bit systems)
instead of 100 (the size of the array in bytes).
-- ------------------------------------------------------------------

I strongly recomment using static code analysis tools! And cppcheck is quite nice for C++

/Kuddel

----
[1] http://cppcheck.sourceforge.net/

Last edited by kuddel; 08-06-2015 at 07:22 PM.
kuddel is offline   Reply With Quote
Thanked by:
Old 08-06-2015, 07:45 PM   #63
fred18
Addon Developer

Default

Thanks for both pointing me the booster engine bug and for showing cppcheck which is extremely useful!
fred18 is offline   Reply With Quote
Thanked by:
Old 08-06-2015, 08:35 PM   #64
PhantomCruiser
Wanderer
 
PhantomCruiser's Avatar

Default

Man, not that you've mentioned boosters; I think I have a request.

Would it be possible to have engines of a different size on the same stage? As in the case with a Kosmos rocket 2nd stage there is one main engine with 4 verniers. In MS2 (to the best of my knowledge) all the engines are set as the same size and thrust rating. To use MS2 I've got to fake it, just use the main motor and the others are just there as candy.
PhantomCruiser is offline   Reply With Quote
Thanked by:
Old 08-06-2015, 09:07 PM   #65
fred18
Addon Developer

Default

Quote:
Originally Posted by PhantomCruiser View Post
 Man, not that you've mentioned boosters; I think I have a request.

Would it be possible to have engines of a different size on the same stage? As in the case with a Kosmos rocket 2nd stage there is one main engine with 4 verniers. In MS2 (to the best of my knowledge) all the engines are set as the same size and thrust rating. To use MS2 I've got to fake it, just use the main motor and the others are just there as candy.
yep, not too difficult, I think I can do this in the following way:

I'll add an additional parameter to engine definition which will determine the diameter scale, so it will be possible to define engines in two ways:

ENG_X=(xx,yy,zz)

and

ENG_Y=(xx,yy,zz,K), with K scale parameter for engine diameter.
Default value will be k=1, if you want a larger engine you will put like ENG_Y=(xx,yy,zz,1.5)

if you want a smaller engine: ENG_Y=(xx,yy,zz,0.75)

if you don't put anything k will be 1.

what do you think?
fred18 is offline   Reply With Quote
Old 08-07-2015, 02:14 AM   #66
PhantomCruiser
Wanderer
 
PhantomCruiser's Avatar

Default

Love it! That'll open up a whole slew of shelved projects of mine.
PhantomCruiser is offline   Reply With Quote
Thanked by:
Old 08-07-2015, 09:35 AM   #67
fred18
Addon Developer

Default Gravity Turn Computational Evaluation

Hi guys,

while fixing the reported bugs and waiting for other bugs/requests to come, I've started the automatic guidance autopilot implementation, which is actually the main reason why I started this project.

Let's say that the last step of this will be easy because I already have it ready for the jarvis, which is the last stage PEG autopilot.

In the middle there will be the re-implementation of the multistage PEG autopilot. I have it working for three stages rockets, but I have to test it on general launcher.

At start I'm finishing to implement a new feature:
as we know the rockets should follow the gravity turn while in the atmosphere, in order to avoid drag and structural failures. This gravity turn is difficult to calculate and is highly effected by initial pitch angle. Therefore I have implemented (and for now it seems to work properly) the computational evaluation of gravity turn.
It is essentially based on the following papers:

https://globaljournals.org/GJSFR_Vol...or-Gravity.pdf
http://www.princeton.edu/~stengel/MAE342Lecture3.pdf

Since it is a computational method it is a trial and error system which start with a low initial pitch angle (70*) and check if ther rocket is capable to perform the gravity turn and reach 35km of altitude (point from which the peg will take the control). If with the pitch angle it does not reach 35km then it increases the pitch angle of 1 degree and check again until it finds a solution (if any).

This will lead to have a trajectory optimization even if rockets are user defined as in this case.

My idea is then to implement the new autopilot as a call of the current one, like
Code:
-6=engine(0,100,6)
0=peg(300,220,51.57)
with first digit of peg as target apogee, second digit as target perigee and third as target inclination
fred18 is offline   Reply With Quote
Thanked by:
Old 08-07-2015, 10:16 AM   #68
K_Jameson
Orbinaut
 
K_Jameson's Avatar
Default

Hi Fred,
glad to see that your work is going well. FOI developing is not dead!

Unfortunately I have little time for developing, that I prefer to spend in my little projects, leaving no room for the beta testing of your ms2015. Usually my beta testings are fairly "aggressive" and this requires time...
Anyway, I hope to join the other beta testers soon...


Keep up the good work, and Hail the Probe!
K_Jameson is offline   Reply With Quote
Thanked by:
Old 08-07-2015, 11:47 AM   #69
BrianJ
thing
Default

Hi Fred,
just tested the multistage2015.dll with my LADEE add-on and performance seems pretty much the same as using multistage2.dll. Exhaust/flame visuals look better with multistage2015.

Only slight difference I noticed was with the initial ROLL command in the guidance file - multistage2.dll turns the launcher to the initial pitch angle (72 in this case) slightly quicker and then uses default KILLROT function for ~1 sec before beginning the PITCH sequence.
Using multistage2015.dll, the turn is slightly slower, resulting in slightly more vertical velocity at the start of the PITCH sequence, which means the gravity turn is not aligned so well, but overall performance is pretty much the same as multistage2.dll.

The launcher is a MinotaurV, 3 stages, no boosters. Here are the .ini and guidance.txt for reference. Tested on Orbiter2010-P1, Windows8.1.

Code:
[MISC]
cog=4.36
FOCUS=1

[TEXTURE_LIST]
TEX_1=Exhaust2

[PARTICLESTREAM_1]
NAME=Delta320contrail
SRCSIZE=3
SRCRATE=32
V0=125
SRCSPREAD=0.1
LIFETIME=2
GROWTHRATE=7
ATMSLOWDOWN=1
LTYPE=DIFFUSE
LEVELMAP=LVL_PSQRT
LMIN=0
LMAX=1
ATMSMAP=ATM_PLOG
AMIN=1e-5
AMAX=1
TEX=contrail1

[PARTICLESTREAM_2]
NAME=Delta320contrail2
SRCSIZE=3.0
SRCRATE=14
V0=160
SRCSPREAD=0.02
LIFETIME=0.3
GROWTHRATE=10
ATMSLOWDOWN=0.4
LTYPE=EMISSIVE
LEVELMAP=LVL_PSQRT
LMIN=0
LMAX=1
ATMSMAP=ATM_PLOG
AMIN=1e-5
AMAX=1
TEX=contrail3

[PARTICLESTREAM_3]
NAME=Delta320contrail3
SRCSIZE=4.0
SRCRATE=40
V0=120.0
SRCSPREAD=0.05
LIFETIME=0.25
GROWTHRATE=0.8
ATMSLOWDOWN=0
LTYPE=EMISSIVE
LEVELMAP=LVL_PSQRT
LMIN=0
LMAX=1
ATMSMAP=ATM_PLOG
AMIN=1e-5
AMAX=1
TEX=contrail3

[STAGE_1]
Height=8.72
Diameter=2.34
EmptyMass=4211
FuelMass=48809
Thrust=2248889 ;;;2024000 ;;;1606590
BurnTime=52.4 ;;;;58
off=(0,0,0)
MeshName="ladee/minotaurv_stg1"
ENG_TEX=Exhaust2
ENG_1=(0,0,-4.9)
ENG_DIAMETER=1.5
ENG_PSTREAM1=Delta320contrail
ENG_PSTREAM2=Delta320contrail3
speed=(0,0,-2)
rot_speed=(0,0,0)
PITCHTHRUST=80000
YAWTHRUST=80000
ROLLTHRUST=20000

[STAGE_2]
Height=6.23
Diameter=2.34
EmptyMass=2900
FuelMass=24900
Thrust=973000
BurnTime=78
off=(0,0,7.733)
MeshName="ladee/minotaurv_stg2"
ENG_1=(0,0,-4.7)
ENG_DIAMETER=1.5
ENG_TEX=Exhaust2
ENG_PSTREAM1=Delta320contrail
ENG_PSTREAM2=Delta320contrail3
IGNITE_DELAY=1
PITCHTHRUST=5300
YAWTHRUST=5300
ROLLTHRUST=5300
speed=(0,0,-2)
rot_speed=(0,0,0)

[STAGE_3]
Height=3.41
Diameter=2.34
EmptyMass=1400
FuelMass=6800
Thrust=303450 ;;;289000
BurnTime=71.5
OFF=(0,0,10.774)
MeshName="ladee/minotaurv_stg3"
ENG_1=(0,0,-2.6)
ENG_DIAMETER=1.5
ENG_TEX=Exhaust2
ENG_PSTREAM1=Delta320contrail
ENG_PSTREAM2=Delta320contrail3
IGNITE_DELAY=1
PITCHTHRUST=2000
YAWTHRUST=2000
ROLLTHRUST=1000
speed=(0,0,-1)
rot_speed=(0,0,0)

[FAIRING]
N=2
MeshName="ladee/minotaurv_fair"
Diameter=2.34
Height=6.36
angle=0
off=(0,0,15.565)
EMPTYMASS=500

[PAYLOAD_1]
MeshName="ladee/minotaurv_stg4;ladee/star37fm;ladee/ladee"
OFF=(0,0,12.92);(0,0,14.732);(0,0,16.772)
speed=(0,0,0.3)
rot_speed=(0,0,0)
Module="Vessels/ladee/minotaurv_stg4"
name="MinotaurV_Stg4"
Diameter=2.34
Height=4
Mass=3739
RENDER=1
Code:
-10=PlaySound(Sound\Vessel\countdown1.wav)
-1=engine(0,80,1)
0=engine(80,100,57)
5=roll(3,89,90,72,1)
15.0=pitch(71.95, 69.01, 5.0)
20.0=pitch(69.01, 65.24, 5.0)
25.0=pitch(65.24, 61.95, 5.0)
30.0=pitch(61.95, 59.10, 5.0)
35.0=pitch(59.10, 56.63, 5.0)
40.0=pitch(56.63, 54.46, 5.0)
45.0=pitch(54.46, 52.60, 5.0)
50.0=pitch(52.60, 50.99, 5.0)
55.0=pitch(50.99, 46.18, 5.0)
57=engine(100,100,0.1)
60.0=pitch(46.18, 36.83, 5.0)
65.0=pitch(36.83, 32.42, 5.0)
70.0=pitch(32.42, 29.76, 5.0)
75.0=pitch(29.76, 27.29, 5.0)
80.0=pitch(27.29, 24.87, 5.0)
85.0=pitch(24.87, 22.54, 5.0)
90.0=pitch(22.54, 20.30, 5.0)
95.0=pitch(20.30, 18.12, 5.0)
100.0=pitch(18.12, 16.04, 5.0)
105.0=pitch(16.04, 14.01, 5.0)
110.0=pitch(14.01, 12.09, 5.0)
115.0=pitch(12.09, 10.21, 5.0)
120.0=pitch(10.21, 8.40, 5.0)
125.0=pitch(8.40, 6.66, 5.0)
130.0=pitch(6.66, 4.98, 5.0)
135.0=pitch(4.98, 0.33, 5.0)
140.0=pitch(0.33, 0.00, 5.0)
145.0=pitch(0.00, 0.00, 5.0)
150.0=pitch(0.00, 0.00, 5.0)
155.0=pitch(0.00, 0.00, 5.0)
160.0=pitch(0.00, 0.00, 5.0)
163=fairing()
165.0=pitch(0.00, -0.00, 5.0)
170.0=pitch(-0.00, 0.00, 5.0)
175.0=pitch(0.00, -0.00, 5.0)
180.0=pitch(-0.00, 0.00, 5.0)
185.0=pitch(0.00, 0.36, 5.0)
190.0=pitch(0.36, 3.14, 5.0)
195.0=pitch(3.14, 6.93, 5.0)
200.0=pitch(6.93, 12, 5.0)
205.0=pitch(12, 12, 5.0)
210.0=pitch(12, 12, 5.0)
210=engine(0,0,234)
212=jettison()
I hope you can make your PEG autopilot work for multistage2015.dll - that would be great!

Best regards,
Brian
BrianJ is offline   Reply With Quote
Thanked by:
Old 08-07-2015, 03:01 PM   #70
fred18
Addon Developer

Default

Quote:
Originally Posted by K_Jameson View Post
 Anyway, I hope to join the other beta testers soon...
I am waiting the comments of an expert like you! Join soon

Quote:
Originally Posted by BrianJ View Post
 Only slight difference I noticed was with the initial ROLL command in the guidance file - multistage2.dll turns the launcher to the initial pitch angle (72 in this case) slightly quicker and then uses default KILLROT function for ~1 sec before beginning the PITCH sequence.
Using multistage2015.dll, the turn is slightly slower, resulting in slightly more vertical velocity at the start of the PITCH sequence, which means the gravity turn is not aligned so well, but overall performance is pretty much the same as multistage2.dll.
Yep, I know. The thing is that in ms2015 there is an actual roll program, since the rocket points towards the correct direction and roll to get the proper attitude, while in vinka it pitches down to the specified angle and then yaws to the launch azimuth. I know there is a small difference, maybe I'll tune it up to minimize it.

Quote:
Originally Posted by BrianJ View Post
 I hope you can make your PEG autopilot work for multistage2015.dll - that would be great!
You can count on it, it's the reason why I'm doing this

Thank you for the test and for the feedback!!

Quote:
Originally Posted by PhantomCruiser View Post
 Love it! That'll open up a whole slew of shelved projects of mine.
Hi Phantom, I added the feature mentioned, tested and it's working, when I will post the next release (shortly enough I hope) it will be included
fred18 is offline   Reply With Quote
Old 08-09-2015, 07:23 PM   #71
Loru
Moderator
 
Loru's Avatar


Default

O-F Staff note: License discussion moved here: http://www.orbiter-forum.com/showthread.php?t=36006
Loru is offline   Reply With Quote
Old 08-20-2015, 08:02 AM   #72
Michael_Chr
Orbinaut
 
Michael_Chr's Avatar
Default MS2015 Additional features

Quote:
Originally Posted by fred18 View Post
 I was thinking in the meantime to the additional features asnd that's my ideas:
- as said autonomous guidance computer as in Jarvis DLL (it will be the biggest feature)
- failures (I could leave this for last I think)
- Mach 1 Vapours with simple ini calls
- possibility to have rotated payloads (actually missing and could be very useful)
- ullage effects with simple ini calls
- possibility to have "live" payloads: with an option the payload will actually load itself and will not be a dead mesh

comments or any other ideas are more than welcome!

cheers
Fred
Hi Fred
Im currently using Velcro for a little project mine making a lifting rocket. The reason for not using multistage is because of the lack of ability to rotate the payload mesh and secondly that velcro allows having a "live" payload (as opposed to a "dead" mesh). I have monitored this thread closely with interest and have seen that you might be tinkering with having rotated as well as "live" payloads. Based on your current documentation I guess you havnt implemented those features yet - since in the current cycle you are "only" (sorry for lack of better words - because this is a mighty task you have taken upon your self) aiming at replicating Vinkas multistage as well as improving the autopilot. Just to let you know that there is still a "market" for your addon espescially with the improvements you have illustrated.
Best regards
Michael
Michael_Chr is offline   Reply With Quote
Thanked by:
Old 08-20-2015, 08:18 AM   #73
fred18
Addon Developer

Default

Hi Michael thanks!

Actually those two options are in my top list for the 1.0 version release.

I'm finishing to work on the autopilot (which is the most difficult thing) and then i'll implement exactly those two features so the 1.0 version will have them.

The vinka's replica was just the first step: the starting point on which (once working) i wanted to add new features like these!

Cheers!

Fred
fred18 is offline   Reply With Quote
Thanked by:
Old 08-20-2015, 12:05 PM   #74
Interceptor
Orbinaut
 
Interceptor's Avatar
Default

Hello fred18,I have tested your multistage2015,with alot of the FOI addons,and other stuff too,and here is what I have to say,first off I have to say that the roll program on most of the rockets I have tested this on is a lot more efficeint,I really like the the new booster seperation,and spinning animation,I also like the new text info on the hud.now for the problems.All of the FOI launchpads,and smoke animations for them the timing is way off,also so is the COG for the rockets,and alot of the spacecraft3 moving animations on launchpads are not woking correctly anymore,I have also noticed the boosters,and LES on some rockets spin wildly out of control, But the multistage 2015 autopilot seems to work well.Thanks for making this,and I hope you can Iron out the bugs,I am no expert,but I just wanted to give you my two cents,since I know that you have worked very hard on this. thanks

---------- Post added at 04:59 AM ---------- Previous post was at 03:44 AM ----------

Hi again fred18,I noticed you added a couple more commands for the guidance file, inverse,and spin rate,and duration,can you write a sample guidance file showing how these two commands would work when launching a space shuttle type craft upside down,and then rolling,or spinning to heads up position before orbit is achieved.Thanks

---------- Post added at 06:05 AM ---------- Previous post was at 04:59 AM ----------

Can you please add an option to have a different key for fairing seperation,I always want to see what my framerate is during the sim,but can't because its' the same key for both.

Last edited by Interceptor; 08-20-2015 at 03:35 PM.
Interceptor is offline   Reply With Quote
Old 08-20-2015, 06:07 PM   #75
boogabooga
Bug Crusher
 
boogabooga's Avatar
Default

The "live" payload option would be really useful.
boogabooga is offline   Reply With Quote
Thanked by:
Reply

  Orbiter-Forum > Orbiter Addons > Addon Development


Thread Tools

Posting Rules
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Jump


All times are GMT. The time now is 04:22 AM.

Quick Links Need Help?


About Us | Rules & Guidelines | TOS Policy | Privacy Policy

Orbiter-Forum is hosted at Orbithangar.com
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright 2007 - 2017, Orbiter-Forum.com. All rights reserved.