# OHMFalcon9 for Orbiter2016

#### BrianJ

Hi Barry,
well, my Dragon add-on works on a very vessel-specific energy-management algorithm for the reentry. It uses a look-up table of energy vs. range and makes the flightpath shallower or steeper accordingly. I don't know if this is how the old AFCS used to work? You could do the same for the Shuttle or X37B but you need to "record" a "nominal" reentry for it, and build that in to the module. Making a "generic" reentry/landing module would be a whole different can of worms ;-)
Cheers,
Brian

#### barrygolden

##### Active member
with the upcoming Falcon/X37 B might be good to have a landing scenario. your Dragon deorbit and entry with the rcs and chutes really looks and works super.
a little note if your doing crs12 you might tweek the drogue chutes covers a little where they pop off super job.

#### dropsofjupiter34

##### Member
BrianJ, it seems to me that changing the parameters in the .cpp files is harder than I thought.

Was I only supposed to change the numbers in the "Some Vessel Parameters" section or was there more than that?

#### BrianJ

Hi Barry,
you might tweek the drogue chutes covers a little where they pop off

@dropsofjupiter34
A couple of things that might help:
The entire Falcon9 vessel is controlled by the f9_v12.dll. At stage separation, the 1st stage is spawned as a new vessel controlled by f9_v12_stg1.dll, the main vessel reconfigures to 2nd stage parameters.

To compile the main vessel f9_v12.dll, you need:
f9_v12_stg2.cpp
f9_v12_stg2.rc
DlgCtrl.lib
gcAPI.lib
OrbiterSoundSDK40.lib

For the 1st stage f9_v12_stg1.dll, you need
f9_v12_stg1.cpp

So, to change the mass/thrust/etc. of the main vessel (1st and 2nd stages "on the way up") you need to change the parameters at the top of f9_v12_stg2.cpp.

To change the 1st stage ("on the way down") modify f9_v12_stg1.cpp

Hope this helps.
Good luck! The code is a bit of a mess, I know!
Brian

#### rcraig42

##### New member
What version of VS did you use? I'm getting a bunch of unrecognized symbols with VS 2017 Express. No missing includes or libraries though.

#### BrianJ

I use MS VC++ 2010 Express - guess I'm a bit out of date!

#### rcraig42

##### New member
I had a hunch and found and dl-ed a copy of 2010... got none of the slew of warnings I had with 2017, however, still the same errors.... here they are:

Code:
1>f9_v12_stg2.obj : error LNK2019: unresolved external symbol "bool __cdecl gcEnabled(void)" ([email protected]@YA_NXZ) referenced in function "public: virtual void __thiscall f9_v12_stg2::clbkSetClassCaps(void *)" ([email protected][email protected]@[email protected])
1>f9_v12_stg2.obj : error LNK2019: unresolved external symbol "bool __cdecl gcInitialize(void)" ([email protected]@YA_NXZ) referenced in function "public: virtual void __thiscall f9_v12_stg2::clbkSetClassCaps(void *)" ([email protected][email protected]@[email protected])
1>f9_v12_stg2.obj : error LNK2019: unresolved external symbol "void __cdecl oapiRegisterCustomControls(struct HINSTANCE__ *)" ([email protected]@[email protected]@@Z) referenced in function _InitModule
1>f9_v12_stg2.obj : error LNK2019: unresolved external symbol "void __cdecl oapiUnregisterCustomControls(struct HINSTANCE__ *)" ([email protected]@[email protected]@@Z) referenced in function _ExitModule
1>c:\Orbiter 2016\Modules\f9_v12.dll : fatal error LNK1120: 4 unresolved externals

There is a real good chance I am doing something wrong, I'm like a newbie to setting up VS for orbiter every 3 to 5 years when I decide to do something with it for orbiter.

This time I followed the directions I found in another post and made a new empty project, copied the property sheets from \resources, changed the orbiterroot macro to my installation folder, application type to dll, added \OrbiterSDK\include to the include directories, and added \OrbiterSDK\lib to the library directories, copied the OrbiterSoundsdk files to the \include and \lib folders, and your files to the project folder.....

What might I have missed?

(I modified the Commercial Satellites Direct TV satellite to match the specs I could find for the IntelSat 35e Satellite and added an attachment point, converted the sc3 to dll. Then edited the 6K to GTO scenario to use it and change the date. Then duplicated the GTO orbit that they had achieved, with over 500 m/s of dV remaining in the second stage. They said they burned to depletion to achieve that. I noticed the ISP of the second stage was different than what I found on WIKIpedia, and I think the 1st stage may be too light. It's usually a lot harder to match r/l performance than it was for me this time.)

#### BrianJ

Hi,
1)have you installed the D3D9 package (including the sdk files)?
I'm hopeless at compiler set up,not a clue really - but the errors relate to those two lib's.

#### rcraig42

##### New member
Hi,
1)have you installed the D3D9 package (including the sdk files)?
I'm hopeless at compiler set up,not a clue really - but the errors relate to those two lib's.
1) not sure about the SDK files, I just did the one download and unzipped into orbiter, activated the module in launchpad and it works.

2) They are both in my OrbiterSDK\lib folder and I pointed to that folder in the project properties. Should I copy them to my project folder as well? And the corresponding h fils are in OrbiterSDK\include as well. and it is pointed to in the project properties.

:\

#### BrianJ

Hi,
I have to add DlgCtrl.lib, gcAPI.lib, etc. to my project "External Dependencies".
Here's a screen shot...

DlgCtrl.lib, gcAPI.lib, orbiter.lib, Orbitersdk.lib are in my Orbiter/Orbitersdk/lib/ folder.

OrbiterSoundSDK40.lib, f9_v12_stg2.cpp, f9_v12_stg2.rc (together with f9_v12_stg2_resource.h, OrbiterSoundSDK40.h) are in their own Orbiter/Orbitersdk/Samples/Falcon9 for Orbiter2016/ folder.

Any help?
Brian

#### rcraig42

##### New member
Yes that helped, but only that it got me looking in the right places to figure it out, it turned out I had to add them in properties - linker - Input - Additional dependencies.

The library files still don't show up in external dependencies, but it does compile without errors now.

#### BrianJ

Update 170811 on OH:
Scenarios include "CONTEXT SpaceX" line for compatibility with "LC39A SpaceX" surface base add-on.
Better 1st Stage Re-entry burn algorithm.
Control panel inc. liftoff timer/clock, estimation of ASDS position for stage recovery.

#### BrianJ

Update 170913 on OH:
Modified estimation of ASDS location for EDL-Only flight profile.
Modified ASDS locations in EDL-Only flight scenarios.

#### fatcat

##### Member
Hi Brian,

If I am launching manually, how do i jettison the 1st stage and ignite the second stage? Is that possible.
Thanks,
fatcat:thumbup:

I have tried the jettison 1st stage from the launch control, without any luck.

Last edited:

#### BrianJ

Update 170925 on OH:
Manual 1st stage jettison re-instated (keypress N or control panel)

#### Ripley

##### Tutorial translator
Donator
BrianJ, the link to the recommended addon in the first post is broken (there's an extra-space before the "=7090" part).
I guess you should update the OH description.

#### BrianJ

BrianJ, the link to the recommended addon in the first post is broken (there's an extra-space before the "=7090" part).
I guess you should update the OH description.
Thanks. Should be fixed now.

#### fatcat

##### Member

Update 170925 on OH:
Manual 1st stage jettison re-instated (keypress N or control panel)
Now that was fast. Even updated the documentation :tiphat:

---------- Post added at 10:10 AM ---------- Previous post was at 09:05 AM ----------

Hello, can anyone help me? I try to guide the falcon 9 in manual mode, but when I press the J key, it releases the load and not the first stage.

Can the first and second stage be separated in manual mode?
First stage can be jettisoned either via control panel (K) or keypad 'N". (see his documentation)
Then hit the thrusters to propel the second stage.
Fairing can be jettisoned manually either via control panel (K) or keypad 'J', for launches that have a fairing (non-Dragon).

Don't mean to sound authoritative, just acknowledging Brian's great work.

Last edited:

#### dropsofjupiter34

##### Member
Will there be a future update that pertains to the new Block 4 upgrade of Falcon 9?