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 07-28-2015, 08:18 PM   #46
boogabooga
Bug Crusher
 
boogabooga's Avatar
Default

No, it is in the ini.

I thought you meant spin in general in multistage2. I didn't know spin could be implemented in the guidance, or that that was what you were talking about specifically.

Still, I recommend that you leave it, since it could be really useful.
I'm thinking of sounding rockets. I might have used it for NH, had I known about it.
boogabooga is offline   Reply With Quote
Thanked by:
Old 08-02-2015, 04:34 PM   #47
Donamy
Beta Tester


Default

Here's a shuttle guidance I did way back that uses the spin for the Roll to heads-up manuever.

Code:
-6=engine(0,100,6)
-5=PlaySound(sound\multistage\atlantis_launch.wav)
0=disable(jettison)
2=roll(2,86,43,78,-1)
6=PlaySound(sound\multistage\rollprogram.wav)
20=pitch(82,72,10)
30=pitch(76,70,20)
31=engine(100,65,6)
50=pitch(70,65,20)
61=engine(65,100,6)
68=PlaySound(sound\multistage\gothrottleup.wav)
70=pitch(65,60,20)
90=pitch(60,40,20)
110=pitch(40,40,20)
124=jettison()
130=pitch(40,32,10)
140=pitch(32,26,10)
150=pitch(26,20,30)
180=pitch(20,14,10)
190=pitch(14,10,10)
200=pitch(10,5,10)
210=pitch(5,3,40)
260=pitch(3,10,20)
280=pitch(10,20,300)
300=spin(5)
335=spin(3)
336=spin(1)
337=spin(0)
524=engine(100,0,1)
526=jetison()
Donamy is offline   Reply With Quote
Thanked by:
Old 08-02-2015, 05:23 PM   #48
fred18
Addon Developer

Default

Quote:
Originally Posted by Donamy View Post
 Here's a shuttle guidance I did way back that uses the spin for the Roll to heads-up manuever.

Code:
-6=engine(0,100,6)
-5=PlaySound(sound\multistage\atlantis_launch.wav)
0=disable(jettison)
2=roll(2,86,43,78,-1)
6=PlaySound(sound\multistage\rollprogram.wav)
20=pitch(82,72,10)
30=pitch(76,70,20)
31=engine(100,65,6)
50=pitch(70,65,20)
61=engine(65,100,6)
68=PlaySound(sound\multistage\gothrottleup.wav)
70=pitch(65,60,20)
90=pitch(60,40,20)
110=pitch(40,40,20)
124=jettison()
130=pitch(40,32,10)
140=pitch(32,26,10)
150=pitch(26,20,30)
180=pitch(20,14,10)
190=pitch(14,10,10)
200=pitch(10,5,10)
210=pitch(5,3,40)
260=pitch(3,10,20)
280=pitch(10,20,300)
300=spin(5)
335=spin(3)
336=spin(1)
337=spin(0)
524=engine(100,0,1)
526=jetison()
Thanks!

I finished the full vinka implementation and it seems to work, i'm just setting up the save/restore parameters.

Now all the autopilot modes described in the vinka documentation (should) work: roll, pitch, spin, attitude, target.

I just needed some other examples to try and this is very useful!

Cheers!
fred18 is offline   Reply With Quote
Thanked by:
Old 08-02-2015, 08:52 PM   #49
Donamy
Beta Tester


Default

This Guidance file is for the Hll-B launch, which I am doing an update for the near HTV-5 mission.

Will this be ready to test soon ?

old release :
H-IIB HTV


Code:
 -10=PlaySound(sound\JAXA\H2Blaunch.wav)
-3=engine(0,100,3)
0=disable(jettison)
2=roll(2,78,136.5,65,1)
20=pitch(65,45,10)
30=pitch(45,40,20)
50=pitch(40,38,60)
110=pitch(38,35,8)
118=pitch(35,35,6)
124=pitch(35,30,16)
127=jettison()
131=jettison()
138=pitch(30,25,22)
150=pitch(25,20,50)
200=pitch(20,17,30)
230=pitch(17,12,50)
240=pitch(12,7,50)
244=fairing()
280=pitch(7,5,90)
390=pitch(5,5,20)
396=engine(0,0,1)
400=jettison()
406=engine(0,100,7)
412=pitch(5,10,20)
432=pitch(10,10,500)
944=engine(100,-0,0)
945=engine(0,0,0)
Donamy is offline   Reply With Quote
Thanked by:
Old 08-03-2015, 06:41 PM   #50
fred18
Addon Developer

Default

Quote:
Originally Posted by Donamy View Post
 Will this be ready to test soon ?
tonight or tomorrow if everything goes fine

---------- Post added at 17:59 ---------- Previous post was at 06:13 ----------

Currently working on 2 issues I've discovered (thanks to Donamy):

1) in the guidance at the moment my pitch program controls also the roll (keeping it at 0 or at 180) so spin command doesn't work if a pitch program is running, I'm correcting it in order to make it possible to use them also combined (I'll put a control on the roll to check whether a spin call is running)
2) Booster composition: I've made a lot of testing up to now and the way I was adding the booster meshes has always worked, even with the delta 2 which has many boosters, but the way the jaxa boosters are defined are different than the usual way, so I have to figure out how to make all the options working at the same time. It's more a math problem than a programming problem, I'm confident to find the way to solve it soon.

---------- Post added at 19:41 ---------- Previous post was at 17:59 ----------

@Donamy: please note that in the .ini file of the Jaxa rocket the rotation speed of the booster is marked as
Code:
ROT_SPEED=250
according to vinka's documentation:
Code:
ROT_SPEED : rotation speed of 1st booster jettison (in rad/s), for other boosters, the
rotation speed vector is also rotated.
so it should be a vector and not a number, and 250 rad/s of course it's a crazy rotation. Actually many things in vinka didn't work perfectly and this problem didn't show, while with the new module the boosters separate with a crazy rotation around the X axis.
fred18 is offline   Reply With Quote
Thanked by:
Old 08-03-2015, 07:23 PM   #51
Donamy
Beta Tester


Default

Understood, I'll look at it when you finish.
Donamy is offline   Reply With Quote
Old 08-03-2015, 08:33 PM   #52
fred18
Addon Developer

Default

Quote:
Originally Posted by Donamy View Post
 This Guidance file is for the Hll-B launch, which I am doing an update for the near HTV-5 mission.


old release :
H-IIB HTV

Code:
 -10=PlaySound(sound\JAXA\H2Blaunch.wav)
-3=engine(0,100,3)
0=disable(jettison)
2=roll(2,78,136.5,65,1)
20=pitch(65,45,10)
30=pitch(45,40,20)
50=pitch(40,38,60)
110=pitch(38,35,8)
118=pitch(35,35,6)
124=pitch(35,30,16)
127=jettison()
131=jettison()
138=pitch(30,25,22)
150=pitch(25,20,50)
200=pitch(20,17,30)
230=pitch(17,12,50)
240=pitch(12,7,50)
244=fairing()
280=pitch(7,5,90)
390=pitch(5,5,20)
396=engine(0,0,1)
400=jettison()
406=engine(0,100,7)
412=pitch(5,10,20)
432=pitch(10,10,500)
944=engine(100,-0,0)
945=engine(0,0,0)
Hi Don, I'm almost finished and everything seems to be working fine.

I have a doubt on your guidance file, which is not working also with the vinka's module: the last two lines at T+945 are far too late, the HTV is already in an iperbolic orbit when engine is cutting off. Also, the third digit of the engine call should not be 0, because it is the duration of the step.

I have been thinking a bit about this, do you agree with me?
fred18 is offline   Reply With Quote
Thanked by:
Old 08-03-2015, 09:04 PM   #53
Donamy
Beta Tester


Default

Hi Fred,

That file as done a long time ago. I don't doubt it has errors. It may have been a borrowed one.
Donamy is offline   Reply With Quote
Thanked by:
Old 08-04-2015, 11:05 PM   #54
kuddel
Donator
Default

Quote:
Originally Posted by fred18 View Post
 ... Also, the third digit of the engine call should not be 0, because it is the duration of the step.
When I read the documentation right, a duration of 0 is perfectly sane.
The line:
944=engine(100,-0,0)
likes to kill thrust immediately (from 100% to 0% in 0 seconds),
while the next line is kind of redundant in this case, I agree:
945=engine(0,0,0)

A duration of 0 just means immediately, I would say.
kuddel is offline   Reply With Quote
Thanked by:
Old 08-04-2015, 11:38 PM   #55
fred18
Addon Developer

Default

Quote:
Originally Posted by kuddel View Post
 When I read the documentation right, a duration of 0 is perfectly sane.
The line:
944=engine(100,-0,0)
likes to kill thrust immediately (from 100% to 0% in 0 seconds),
while the next line is kind of redundant in this case, I agree:
945=engine(0,0,0)

A duration of 0 just means immediately, I would say.



Vinka's documentation says:
Quote:
engine(starting_thrust, final_thrust, thrusting_time)
This will control the thrust of the main engine varying it from the value indicated in
“starting_thrust” to the value indicated in “final_thrust” in a time duration defined in
“thrusting_time”
. Thrust is indicated in percent and must be between 0 and 100.
a time duration of 0 actually it's not correct, also in general. An event which has a time duration of 0 would lead to have the pre-event status and the post-event status at the same time instant.

Anyway by reading this I am pretty sure that what Vinka was meaning was the same that I am thinking about: between time start and time finish there will be linear interpolation of the values, therefore to have an immediate event you can simply put a very very short duration with a third digit like 0.01, and it will work.
fred18 is offline   Reply With Quote
Thanked by:
Old 08-05-2015, 09:04 AM   #56
BrianJ
thing
Default

Quote:
Originally Posted by kuddel View Post
 When I read the documentation right, a duration of 0 is perfectly sane.
The line:
944=engine(100,-0,0)
likes to kill thrust immediately (from 100% to 0% in 0 seconds),
while the next line is kind of redundant in this case, I agree:
945=engine(0,0,0)

A duration of 0 just means immediately, I would say.
I kind of agree - a duration of 0 means immediately or by the end of the current simulation time-step.

The redundant line 945=engine(0,0,0)is there because there was a bug where the engine sometimes does not shut-down completely by the end of the command sequence time (I think, due to the linear interpolation not matching the number/size of time-steps).

Also, there was a bug: if the guidance file is commanding RCS to fire when the guidance file ends, the RCS is locked ON.

Would be good to fix these bugs.

Good luck and best regards,
Brian
BrianJ is offline   Reply With Quote
Old 08-05-2015, 09:35 PM   #57
fred18
Addon Developer

Default FIRST RELEASE!

So finally here we are!

Vinka's module re-implementation is finished!

From my tests it works, but for sure I need to gather your feedbacks before proceeding!

Things to know before installing:

- There is a document which rensemble the first few new features implemented.
- It will backup the multistage2.cfg and update it directly with the Multistage2015 call, so you will be able to test every scenario already written for the old Multistage2 by simply launching it. In case you would like to get back to the vinka's module, simpy restore the multistage2.cfg from the backed up one.
- code included, it's my first time!

I've inserted a couple of checks for engine calls in order to allow duration of call = 0 and to avoid the old vinka bug when shutting down the engine.

Also the killing of the autopilot ensures the shutdown of all the thrusters, so also the bug of the crazy rotating ship should be now only an old memory.

Credits and thanks inside documents.

Bug reports, comments, critics (and appreciation ) awaited

Cheers!

Fred18
Attached Files
File Type: zip Multistage2015.zip (175.9 KB, 24 views)

Last edited by fred18; 08-06-2015 at 02:33 AM. Reason: small bug found and corrected already+implementation of multiple payload meshes added
fred18 is offline   Reply With Quote
Old 08-06-2015, 11:30 AM   #58
fred18
Addon Developer

Default

I updated it to GNU, GPL3.0 license included

Cheers
Attached Files
File Type: zip Multistage2015.zip (187.0 KB, 32 views)
fred18 is offline   Reply With Quote
Thanked by:
Old 08-06-2015, 12:51 PM   #59
Face
Beta Tester
 
Face's Avatar

Default

Quick feedback on the code before I get the chance to compile and test it here:
  1. Overall your code-base looks compact and clean. Well done! There was really no reason to fear embarrassment in the first place.
  2. In the Multistage2015.cpp, there is some code commented out at the end of the file. What is this?
  3. In the parser.cpp, there is the following sequence at the end of parseInterstages() and parseAdapter():
    Code:
        return;
        }else{
        return;
        }
        return;
    }
    Is there a reason for this not being simplified like the code below?
    Code:
        }
    }
  4. How do you want patches to be contributed?
Face is offline   Reply With Quote
Thanked by:
Old 08-06-2015, 01:15 PM   #60
fred18
Addon Developer

Default

Quote:
Originally Posted by Face View Post
 Quick feedback on the code before I get the chance to compile and test it here:
  1. Overall your code-base looks compact and clean. Well done! There was really no reason to fear embarrassment in the first place.
Thank you very much!

Quote:
Originally Posted by Face View Post
 
  1. In the Multistage2015.cpp, there is some code commented out at the end of the file. What is this?
Since development is still ongoing I left it there: it's some code I used for getting information from default vinka module. I loaded the scenarios with both multistage2015 and multistage2 and with that code in postcreation I gathered some information from the vinka one. Also there is a start of initialization for the autopilot I will implement. Anyway, nothing to be considered, is there only because it's a preliminary release for beta testing.


Quote:
Originally Posted by Face View Post
 
  1. In the parser.cpp, there is the following sequence at the end of parseInterstages() and parseAdapter():
    Code:
        return;
        }else{
        return;
        }
        return;
    }
    Is there a reason for this not being simplified like the code below?
    Code:
        }
    }
Sometimes I'm just afraid of loss of information or the computer that "looses the proper pattern" and I add some extra closing lines just to be sure that all the loop is closed and nothing is missing. For sure it's not necessary.

Quote:
Originally Posted by Face View Post
 
  1. How do you want patches to be contributed?
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.

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.

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.

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

PS: the dll included in the package is the exact compiled module of the code

Last edited by fred18; 08-06-2015 at 01:32 PM.
fred18 is offline   Reply With Quote
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 09:36 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.