Author Topic: Dragon 2 ISS docking simulator  (Read 22503 times)

Offline CorvusCorax

  • Full Member
  • ****
  • Posts: 1922
  • Germany
  • Liked: 4154
  • Likes Given: 2825
Re: Dragon 2 ISS docking simulator
« Reply #20 on: 05/13/2020 07:14 pm »
OMG what a wonderful sim! As others reported above, I nailed it on my first try. I found it easy to get yaw, pitch and roll down to 0.0°/s at 0.1 and 0.0° from nominal, and found that I could get y translation to 0.0, however z translation needed constant station keeping. My initial approach for the first 190 meters or so I was going a little fast at -0.045m/s, but for the final 10 meters or so I slowed down to 0.025/s.

I decided the next time I try it I might try coming in even hotter than 0.045m/s, it really took a long time for the approach. And, if I still have issues with Z translation, just not worry about it as much until I get closer to docking. It occurred to me I'd probably end up wasting propellant al la Dreamliner if I spent too much time worrying about keeping it at or below 0.2 meters off nominal.

I'll have to check out that Roadster too! Thanks for sharing that!

The roadster is a bit tricky, its only visible when you look at it from the right direction and completely despawns when you try to look at it from the other side (you can then even fly through the empty space where it used to be). Even its 3d model is only downloaded once you look at it from the correct angle, so if you have a slow connection, it might pop up a bit delayed.

Offline CorvusCorax

  • Full Member
  • ****
  • Posts: 1922
  • Germany
  • Liked: 4154
  • Likes Given: 2825
Re: Dragon 2 ISS docking simulator
« Reply #21 on: 05/13/2020 07:52 pm »
After looking at the source code for a bit, I found the following list of cheatcodes:

If you type the following during the game, it will have the following effects:

"5512" -- engage auto-docking sequence - for those who are lazy

"flatearth" }
"earth"      }  toggle flat earth ( also accessible from the configuration menu )

I'm actually a bit disappointed that they didn't use the Konami code anywhere ;)

Does anyone know what 5512 refers to? That must be some sort of reference, but to what? Is that a verb or address in the Apollo computer by any chance?


Edit: "5512" only works when typed on the main keyboard number keys, not on the numpad. The numpad is being used for attitude control, either mirroring the cursor keys or with 4,5,6,8,7,9 for ←,↓,→,↑,↶,↷ depending on NumLock status
« Last Edit: 05/20/2020 03:06 am by CorvusCorax »

Offline snotis

Re: Dragon 2 ISS docking simulator
« Reply #22 on: 05/13/2020 08:19 pm »
Have you found any keyboard shortcuts for toggling the precision for translation and rotation?

Offline CorvusCorax

  • Full Member
  • ****
  • Posts: 1922
  • Germany
  • Liked: 4154
  • Likes Given: 2825
Re: Dragon 2 ISS docking simulator
« Reply #23 on: 05/13/2020 09:01 pm »
Have you found any keyboard shortcuts for toggling the precision for translation and rotation?

Yes. There is none.

There is a toggle function and the only places where its being called is from the "click" and "touch" events of the HUD touch element. It's not connected to any keyboard events.

Kinda makes sense, considering this whole interface is to emulate touchscreen-control in Dragon2 ;)

I am writing on a greasemonkey script to add some customizations. I will add shortcuts for toggling precision modes.

Offline CorvusCorax

  • Full Member
  • ****
  • Posts: 1922
  • Germany
  • Liked: 4154
  • Likes Given: 2825
Re: Dragon 2 ISS docking simulator
« Reply #24 on: 05/14/2020 01:29 am »
And here it is:

https://gist.github.com/CorvusCorax/d6e6e98c946b8bfad56563b514df23a9

Tested with GreaseMonkey for Firefox.

https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/


edit: with the extension loaded, toggling the precision mode is possible with "x" and "y" keys
« Last Edit: 05/14/2020 01:52 am by CorvusCorax »

Offline CorvusCorax

  • Full Member
  • ****
  • Posts: 1922
  • Germany
  • Liked: 4154
  • Likes Given: 2825
Re: Dragon 2 ISS docking simulator
« Reply #25 on: 05/14/2020 01:52 am »
Just tested, works in Chromium (open source Chrome) (Edit: and Google Chrome, just tested) as well - it doesn't even need an extension, it works out of the box.

but the installation is a bit tricky since Chrom(e/ium) doesn't want to install script from elsewhere but the chrome web store. (no github)

1. first download the raw .user.js file (link in previous post, click on "raw")

2. open chrome://extensions/ in chromium

edit: 2.5 enable "developer mode" in chrome, to allow step 3 to work

3. open a file manager of some sort and drag+drop the user script into the extensions tab

4. go to https://iss-sim.spacex.com

5. fun

« Last Edit: 05/14/2020 02:03 am by CorvusCorax »

Offline CorvusCorax

  • Full Member
  • ****
  • Posts: 1922
  • Germany
  • Liked: 4154
  • Likes Given: 2825
Re: Dragon 2 ISS docking simulator
« Reply #26 on: 05/14/2020 02:59 am »
I just noticed that the graphical arrow-circles that display the rotational speed - which don't work in Firefox - but do work in Chrome - were not being hidden by turning HUD off.

I fixed that now. All HUD effects - including feedback about thruster-activiy are now disabled when HUD is turned off. There still is feedback of touch-events.

Offline CorvusCorax

  • Full Member
  • ****
  • Posts: 1922
  • Germany
  • Liked: 4154
  • Likes Given: 2825
Re: Dragon 2 ISS docking simulator
« Reply #27 on: 05/14/2020 09:02 am »
According to

https://raw.githubusercontent.com/virtualagc/virtualagc/master/Colossus249/ASSEMBLY_AND_OPERATION_INFORMATION.agc

The 5512 cheat code might indeed be an Apollo guidance computer reference.

55 is the option verb for "increment agc time" and 12 is the noun for "option code" - looks like this would be used to fast foward the mission time by an arbitrary amount.

That can be interpreted as "time skip" in the sim ... but it could also be seen as a little stab to Boeing ;)

Edit: after looking at the AGC code listing for verb 55, 5512 doesn't really make sense, as verb 55 doesn't really take a noun. Instead it runs V25N24 to load a time into register R1-3 and then adjusts the AGC clock accordingly. - So while 5512 **CAN** be used to set the AGC time, the "12" part of it is effectively ignored

http://www.ibiblio.org/apollo/listings/Colossus237/EXTENDED_VERBS.agc.html

Edit edit: You can test that out under http://svtsim.com/moonjs/agc.html
Current AGC time can be displayed with Verb 16 Noun 65 Enter
try the following sequence:

 V16N65E
 V55N12E
 +00011E
 +00000E
 +00000E
 V16N65E

You now advanced the Apollo guidance computers clock by 11 hours prior to launch ;)
--

So maybe 5512 means something else after all. Any ideas?
« Last Edit: 05/14/2020 10:42 am by CorvusCorax »

Offline CorvusCorax

  • Full Member
  • ****
  • Posts: 1922
  • Germany
  • Liked: 4154
  • Likes Given: 2825
Re: Dragon 2 ISS docking simulator
« Reply #28 on: 05/14/2020 05:34 pm »
I was trying to figure out what other docking options exist.

On the real ISS, PMA-3 with IDA-3 is at the Zenith port of the Harmony module, and should allow an alternate approach corridor to Harmony.

Not so in the ISS model in the simulator. While IDA-2 is attached to PMA-2 on the forward port of Harmony, PMA-3 is on the port side of Tranquility and has no IDA attached.

IDA-2 was installed on PMA-2 on August 19 2016 . At that point PMA-3 as on Tranquility as depicted
PMA-3 was moved from there to Harmony on  March 26, 2017

Furthermore in the ISS-SIM, The Leonardo cargo module is connected to the Nadir port of Unity. It was moved from there to the forward facing port of Tranquility on May 27, 2015

There is also no BEAM in the simulator, which would have been installed on April 16 2016

As such the depicted ISS configuration never happened. The modules seem to be in a configuration prior to May 27, 2015, yet with IDA-2 installed on PMA-2 for docking. This could have been a configuration used internally to practice docking at SpaceX, as IDA-1 was originally planned to arrive in 2015 (however on the ill-fated CRS-7) to be installed on PMA-2 - but even then Leonardo would already have been on Harmony.

This makes it a bit tricky.  There is really only one compatible docking adapter on the ISS model - on PMA-2 on Harnmony's forward port.  PMA-3 on Tranquility cannot be used for 2 reasons:
1. It has no IDA installed and
2. the port  is blocked by one of the ISS' heat radiators, Not only does that block the approach vector, there isn't even enough room to squeeze dragon and its trunk in there.

One typical berthing port for Dragon-1 - Unity-Nadir is also blocked by Leonardo, although one could technically approach the other ports of Harmony, implementing that would be relatively boring.

 - This leaves the Russian ports as potential docking targets. There's 4 of them. Aft port of Zvesda, Nadir of Pirs, Zenith of Poisk and Nadir of Rassvet.

I'll see what I can do.








Offline CorvusCorax

  • Full Member
  • ****
  • Posts: 1922
  • Germany
  • Liked: 4154
  • Likes Given: 2825
Re: Dragon 2 ISS docking simulator
« Reply #29 on: 05/14/2020 08:37 pm »
On other news, the ISS-SIM currently requires all angles to be within 0.2 ° - this can be relaxed. At the same time the 0.2 m spacial deviation is actually too much, the docking adapter requires +-0.1m

According to the spec of the international docking adapter

https://www.internationaldockingstandard.com/download/IDSS_IDD_Revision_D_043015.pdf - table TABLE3.3.1.1-2INITIAL CONTACT CONDITIONS the following motion tolerances are allowed:

Position:
X: contact
Y,Z: 0.10 m

Translation:
X: 0.05 to 0.10 m/sec   (must not be too slow!)
Y,Z : 0.04 m/sec max

Orientation:
X (roll): 4 deg
Y,Z (vector sum): 4 deg

Rotation:
X (roll): 0.20 deg/sec
Y,Z (vector sum): 0.20 deg/sec

I'm gonna change the tolerances accordingly :)

Offline Rzeppa

  • Member
  • Posts: 30
  • Colorado
    • American 3D Printing
  • Liked: 39
  • Likes Given: 4936
Re: Dragon 2 ISS docking simulator
« Reply #30 on: 05/14/2020 08:45 pm »
The roadster is a bit tricky, its only visible when you look at it from the right direction and completely despawns when you try to look at it from the other side (you can then even fly through the empty space where it used to be). Even its 3d model is only downloaded once you look at it from the correct angle, so if you have a slow connection, it might pop up a bit delayed.

I found it pretty easily, just yaw 180° and then maneuver as required once it's in sight. I flew over it, around it etc. I also tried docking at over 2m/s. FAIL! LOL! Still couldn't zero out z translation, it always drifts one way or the other.
Jeff Zepp

Offline CorvusCorax

  • Full Member
  • ****
  • Posts: 1922
  • Germany
  • Liked: 4154
  • Likes Given: 2825
Re: Dragon 2 ISS docking simulator
« Reply #31 on: 05/15/2020 01:42 am »
New version 0.00003 with new features!

https://gist.github.com/CorvusCorax/d6e6e98c946b8bfad56563b514df23a9

User script -- Install as extension in Chrome (needs dev moe or TamperMonkey) or via Greasemonkey in Firefox

New features:
1. More reailistic docking constraints based on actual docking adapter specs ( great for NO-HUD manual docking)
2. Selectable docking port: Available ports:
* IDA-2 on PMA-2
* Harmony Zenith
* Harmony Nadir
* PMA-3 (just squeeze in from underneath and push against that radiator)
* Zvezda
* Poisk
* Pirs
* Rassvet

Offline CorvusCorax

  • Full Member
  • ****
  • Posts: 1922
  • Germany
  • Liked: 4154
  • Likes Given: 2825
Re: Dragon 2 ISS docking simulator
« Reply #32 on: 05/15/2020 10:17 am »
The roadster is a bit tricky, its only visible when you look at it from the right direction and completely despawns when you try to look at it from the other side (you can then even fly through the empty space where it used to be). Even its 3d model is only downloaded once you look at it from the correct angle, so if you have a slow connection, it might pop up a bit delayed.

I found it pretty easily, just yaw 180° and then maneuver as required once it's in sight. I flew over it, around it etc. I also tried docking at over 2m/s. FAIL! LOL! Still couldn't zero out z translation, it always drifts one way or the other.

Nah, the way collisions and docking success have been implemented there's only ever a single valid docking target. running into anything else simply counts as a collision, so unfortunately you can't dock with the roadster. Even with my userscript that doesn't really change, I basically move the entire ISS relative to the docking coordinate, and then adjust the required approach vector & orientation.

As such when you spawn, the docking target is always in front of you (coordinate [0,0,-150], and the roadster always behind you at [12,42,80])

Since the roadster is not part of the ISS model, it can't be made a valid docking target without some further code changes, as moving the ISS components relative to the docking target coordinate (0,0,0 on the ISS model) won't suddenly move the roadster there.

Offline CorvusCorax

  • Full Member
  • ****
  • Posts: 1922
  • Germany
  • Liked: 4154
  • Likes Given: 2825
Re: Dragon 2 ISS docking simulator
« Reply #33 on: 05/15/2020 01:24 pm »
Demo + Speedrun - no HUD - Zvezda - 1:30


Offline CorvusCorax

  • Full Member
  • ****
  • Posts: 1922
  • Germany
  • Liked: 4154
  • Likes Given: 2825
Re: Dragon 2 ISS docking simulator
« Reply #34 on: 05/15/2020 03:53 pm »
After a quick check - with the "warp to start after 500m" disabled - you can indeed descend all the way down to the earth surface - which is either 1500m away if "flat earth" is selected, or 450 km downwards if normal earth is used.

A "deorbit burn" won't work, since GRAVITY - despite the setting - isn't really doing anything but add a bit of a noise offset to dragons velocity. As such, if you want to go to the surface, you need to thrust straight down, then wait for a while (even at 100m/s 450 km will take a while)

If I feel like it, I might tweak this to implement proper orbital mechanics. It's a bit tricky, since the coordinate frame is relative to earth, and internally the game calculates velocities and accelerations "per frame" - not "per second" -- even though the framerate is browser dependent.

that's also why the displayed "0.1 °/s" rotation rate isn't really 0.1 °/s -- it would be if your game runs at only 5 fps, but if you run at 100 fps, then everything becomes quicker. The only place where the ISS-SIM calculates proper velocity  in m/s is the displayed "approach rate" - and that's extremely hacky - using averaging over the last 20 frames which is quite noisy and buggy.

I have the feeling they let an Intern code that entire thing at SpaceX, and he didn't take longer than a day for it.

Probably Elon asked if he could do it until the end of the day, he said yes, then added the entire night and had it the next morning. Some parts of the code feel like they were coded at 4am ;)

Offline CorvusCorax

  • Full Member
  • ****
  • Posts: 1922
  • Germany
  • Liked: 4154
  • Likes Given: 2825
Re: Dragon 2 ISS docking simulator
« Reply #35 on: 05/16/2020 10:57 pm »
After a quick check - with the "warp to start after 500m" disabled - you can indeed descend all the way down to the earth surface - which is either 1500m away if "flat earth" is selected, or 450 km downwards if normal earth is used.

But NOW you can!!!
https://gist.github.com/CorvusCorax/d6e6e98c946b8bfad56563b514df23a9

The lack of proper orbital mechanics bugged me,

To the point, I decided to add it. The ISS-SIM-Customizer mod NOW included the option to simulate GRAVITY as "PROPER ORBITAL MECHANICS"!!!

Selecting this will also display some orbital parameters on the HUD (I don't know where they are displayed on the real dragon, will gladly incorporate input, for now they are cluttering the top right sector)

Any thruster activity will change your orbit, as such, if you wait long enough, you will now encounter an intricate orbital dance in front and around the ISS if you wait long enough - just like the real thing. You can even orbit the ISS that way.

And to make that not take hours, I implemented a time warp feature, people from KSP will remember. Unlike KSP it does not go on rails though, so you can still fire thrusters and rotate around in timewarp (rotation speed remains unaffected though, to not get you dizzy)

Yes, you can now deorbit dragon. A retrograde thrust of around 100 m/s does the trick. Just get the Periapsis under 80km.

You can also go to completely different orbits and then try to re-sync with the ISS -- a completely new challenge.

(Make sure to set SPACE to "INFINITY" - or you get GAME OVER if you are more than 500m from ISS)


Changing ISS orbit - or that of the Tesla is not supported yet. Also there are no other celestial bodies. Play KSP or Orbiter if you want those, or add them yourself ;)

Offline ChrisC

  • Veteran
  • Senior Member
  • *****
  • Posts: 2305
  • Liked: 1695
  • Likes Given: 1923
Re: Dragon 2 ISS docking simulator
« Reply #36 on: 05/17/2020 02:41 am »
This is all incredible.  Can't wait for someone to put it online, somehow :)  (Yeah, I could set up my own local server, but I don't do that stuff anymore.) Thank you CC!
PSA #1:  Suppress forum auto-embed of Youtube videos by deleting leading 'www.' (four characters) in YT URL; useful when linking text to YT, or just to avoid bloat.
PSA #2:  Users who particularly annoy you can be suppressed in forum view via Modify Profile -> Buddies / Ignore List.  *** See profile for two more NSF forum tips. ***

Offline CorvusCorax

  • Full Member
  • ****
  • Posts: 1922
  • Germany
  • Liked: 4154
  • Likes Given: 2825
Re: Dragon 2 ISS docking simulator
« Reply #37 on: 05/17/2020 08:23 am »
This is all incredible.  Can't wait for someone to put it online, somehow :)  (Yeah, I could set up my own local server, but I don't do that stuff anymore.) Thank you CC!

But it IS On-line.

The simulator itself is online and can be played on iss-sim.spacex com, where it always was.

The modification is implemented as a "user script".

User scripts are a sort of mini-browser extension. They are a snippet of Javascript, which typically modify the way a particular web-site looks or is working. When you have them installed, they get loaded whenever you visit that web-page and have the ability to modify the way the page is displayed to you. This includes overriding Javascript functions. Since SpaceX ISS-SIM is entirely written in Javascript, a user-script can as such modify the game mechanics arbitrarily.

How you install a user script depends on the Browser. Google Chrome, and its derivatives (Chromium, etc...) support user scripts directly. Assuming you have downloaded and saved the extension as a file (download from
https://gist.github.com/CorvusCorax/d6e6e98c946b8bfad56563b514df23a9/raw/04dae005ce65481285e31d6ad32d4d935bac2ef5/ISS-SIM-Customizer.user.js
or click the "RAW" button on the link in the post above for the newest version)

You can go to the URL " chome://extensions " - enable "dev mode" (there's a slider at the top right) which allows you to install scripts from elsewhere than google store, then simply drag and drop SIM-Customizer.user.js from your downloads folder unto google chrome. It will asks you whether you want to install that, and that's it.

The next time you go to https://iss-sim.spacex.com the user script will load and give you the modded version.

On Firefox, you need an extension to load user scripts. One of them is called "Greasemonkey"

https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/?src=search

When you have that installed clicking on the "RAW" link (URL above) Greasemonkey will automatically ask you if you want to install that script. All user scripts are managed (and can be enabled and disabled) through the greasemonkey extension.

To make the management for user scripts more user-friendly and offer similar capabilities like Greasemonky, there's also Tamper-monkey for Chrome. With that installed, you also only need to click on the "RAW" button and it will ask you if you want to install it.

https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo

(
To make matters more complicated, there's also a "Tampermonkey" extension for Firefox, which does the same thing, but the orbital mechanics wont work ;) So don't use Tampermonkey on Firefox until I fixed that.

Edit: fixed it. Now works with Tampermonkey, too.  Welcome back Browser hell - now called Extension hell ;)
)


« Last Edit: 05/17/2020 10:13 am by CorvusCorax »

Offline CorvusCorax

  • Full Member
  • ****
  • Posts: 1922
  • Germany
  • Liked: 4154
  • Likes Given: 2825
Re: Dragon 2 ISS docking simulator
« Reply #38 on: 05/18/2020 04:05 am »
Version 0.000006 is out.  After previously fixing the orbits, I now fixed the navball. That was surprisingly hard. It's supposed to both show direction of Down as well as where North is. Down is easy (big blue ball) but North is tricky, considering the rotating inclined reference frame. Especially now that people can be in orbits different than the orbit of the reference frame.

And on top of that, earth also rotates around itself. So there's actually 3 axis involved: Earth axis, the ISS orbit axis, and the players orbit.

The HUD attitude indicator still displays the attitude relative to ISS. After all, Dragon is in Docking mode, that's probably what it would do ;)

So when switching to "Proper Orbital Mechanics" now, the orbit is now pro-grade at 51° inclination, while the earth rotates eastwards, and the attitude indicator nav-ball will point to proper North, so you can actually see the inclination.

By the way: if you have a javascript console open, the interesting values to edit are:
* camera.position
* motionVector
Both are 3d vectors. motionVector is a bit tricky, its not in m/s but in meter per frame - so it depends on your framerate - and relative to the rotating reference frame - so 0,0,0 will be stationary relative to ISS. You can find out how many meters per frame corresponds to your orbital velocity by putting negative values into motionVector.z  simply type
motionVector.z = -200  -- if you get the right value, your orbital speed becomes zero and you fall straight down. Then simply set it to - two times that, and you end up in a retrograde orbit (ISS will remain prograde though)

Or motionVector.z=-200; motionVector.x=200 - (or whatever the value corresponding to your orbital speed is) - you are now on an orbit perpendicular to that of the ISS. You can also change camera.position to directly go into higher or lower orbits (but they will be eccentric unless you also change the speed to match)

For stable orbits, the "frame rate" is measured during the first 1000 frames, then assumed constant, but every time you re-start the sim you get slightly different values.

ah by the way - to change ISS orbit, you need to rotate the earth:
earthObject.rotation.fromArray([0,0,(-90-10)*Math.PI/180])
would put ISS (and you) into a 10 degree inclination pro grade orbit
earthObject.rotation.fromArray([0,0,51*Math.PI/180]) will put you into a retrograde orbit similar to ISS-SIM's default

(that's definitely a bug. It was supposed to be 51, but whoever coded it didn't realize that his object is oriented with the north pole towards the ISS at 0,0,0)


Offline Rzeppa

  • Member
  • Posts: 30
  • Colorado
    • American 3D Printing
  • Liked: 39
  • Likes Given: 4936
Re: Dragon 2 ISS docking simulator
« Reply #39 on: 05/18/2020 08:32 pm »
"5512" -- engage auto-docking sequence - for those who are lazy

When I tried this it didn't work as intended. First I tried 5512 and then <Enter>, then I tried plain old 5512 without <Enter>. Both times yaw, pitch and roll all started drifting farther and farther from zero. Translation stays where it started with no change.
Jeff Zepp

Tags:
 

Advertisement NovaTech
Advertisement Northrop Grumman
Advertisement
Advertisement Margaritaville Beach Resort South Padre Island
Advertisement Brady Kenniston
Advertisement NextSpaceflight
Advertisement Nathan Barker Photography
1