Welcome to Keen Software House Forums! Log in or Sign up to interact with the KSH community.
  1. You are currently browsing our forum as a guest. Create your own forum account to access all forum functionality.

How does gyro over-ride work?

Discussion in 'General' started by Leon026, Aug 18, 2014.

Thread Status:
This last post in this thread was made more than 31 days old.
  1. Leon026 Apprentice Engineer

    Messages:
    155
    Question, I've noticed people starting to build 'drones' on the creation forums, and they talk about gyro overrides or control overrides.

    How does that work exactly? Are you able to control a ship other than your own?
     
  2. Volfram Senior Engineer

    Messages:
    1,564
    I can neither confirm nor deny that gyroscopes can be set to auto-turn and that antennas allow control of ships that you are not in physical contact with.
     
  3. Leadfootslim Senior Engineer

    Messages:
    1,300
    Overrides are, in effect, a way to set a thruster or gyro to operate on its own as if a player were holding down a thrust or rotation key, respectively - except with a much greater degree of finesse.

    For example, if you set a gyro override, the object will try to accelerate its rotation in a given direction (pitch, yaw, or roll) until it reaches a maximum speed. This may take longer depending on how low you set the override, or how much mass you're trying to spin. To create a functioning "drone", you place an override thruster (which is constantly pushing forward) on such a device so that it travels in a circle, rather than just spinning.

    It's very easy to instead put your "drone" into a loopy pattern that results in a net-forward direction, however. True orbiting takes a bit of math, for which I think a few players have figured out the science.
     
  4. Mansen Apprentice Engineer

    Messages:
    481
    [​IMG]
     
  5. Floki Apprentice Engineer

    Messages:
    247
    Can someone please post the math.
     
  6. Spets Master Engineer

    Messages:
    3,214
  7. Belthize Apprentice Engineer

    Messages:
    273
    Well I was going to say that I didn't think truly stable orbits were possible. All the tests I've done can come close but aren't long term stable but I refrained from posting since I knew Spets, Player2K, silentdeth or somebody else would come along and show it's possible.

    So Spets, is that truly stable over long time periods (hours, days ?) and if so what's the trick (edit: actually just knowing it's really stable and therefore possible is good enough).

    I've tried simple systems that are perfectly symmetrical around the axis of rotation and tried variations of starting the gyros first, engines first, both at same time. Secondary thrusters for stability etc. Nothing is truly stable because there's always a period of initial acceleration and skew that causes the machine to drift over time. So if those are really stable then I'm missing something obvious.

    If gyros and thrusters were instantaneous then in theory the RPM of the gyro sets the orbital period and the engine power sets the orbital radius and any combination would be stable.

    On a side note I suspect even a truly stable solution isn't completely stable on servers (sync issues) or a long way from the origin (round off precision errors)

    Edit2: Well I kept fiddling with it and I think I was just impatient. They're initially unstable but quickly spiral (about 3 to 4 orbits) to a stable orbit. I have a small drone that's been spinning around 2 large blocks for about 20 minutes now. It's a bit tricky to figure out where the center of the orbit will be (depends on mass, thrust, rpm etc) but pretty much any combination of rpm and thrust seems to be stable as long as the object is symmetric around the axis of rotation. A test drone is pretty easy, small ship of 1 block, 4 thrusters around the edge, gyro on the bottom, panels on each thruster to balance weight, reactor on top of block. Set the gryo to 5rpm, one thruster to 400N and then power up reactor and you'll get a stable orbit about 4 large blocks in diameter. The orbit will end up some ways off from where you started since the acceleration of the gryo is less than that of the thruster so it takes it a bit to catch up.

    The guy below has been orbiting in that pit for about 40 minutes now.

    [​IMG]
     
  8. manveti Trainee Engineer

    Messages:
    76
    The missing piece of the puzzle is the inital velocity. If you start from stationary with just your orbit-keeping thrust, you won't end up with an orbit around a static center. You could probably come close with a launch ship pushing it in the right direction (or just manually piloting the satellite), but the gyro spin-up time might throw you off.

    I think the best way to do it would be to set up a rotor arm to do the spin-up, set the overrides to match what the satellite is already doing, then decouple the rotor arm (either via a merge block or just grind it down -- you'll probably be grinding down the whole rotor assembly afterwards anyway).
     
  9. Spets Master Engineer

    Messages:
    3,214
    I din't tested it in deep, so Im not 100% sure if it maintains the same path when all the speed reach the max as you said, but the little I tested it seems to change the course a little bit.

    EDIT: ok didn't saw the part about 40 min test. So, yes, the tricky part is the start
     
  10. Belthize Apprentice Engineer

    Messages:
    273
    I did some more tests, it doesn't even matter that it's symmetric about the axis. I did some more fiddling in creative (control panels and antenna sure are handy for these) and the more I mess with it the more I'm convinced they're mostly stable after an initial spiraling regardless. I originally mistook that early spiraling as evidence that it would continue to spiral.

    This ugly thing with the reactor out on a boom has been stable for about 20 minutes and is very asymmetric. 200 meter diameter orbit every 20 seconds so average velocity of 30m/s. It consistently passes through those two pillars, any drift and it would smack them, there's not a lot of clearance since it's drifting through at an angle. With some trial and error you could get a satellite to orbit through an asteroid, the donut one would be easy, in fact my current survival base is built around the rim of the donut. I might just try some orbiting through there. The one with long core through the middle would be harder but potentially doable with a wide enough orbit.

    I'll leave them both running over night and see if they're still going in the morning.

    [​IMG]
     
  11. Spets Master Engineer

    Messages:
    3,214
    Im testing too, but I can't make a consistent orbital path, they change the course a little bit all the time
     
  12. Tiger313 Apprentice Engineer

    Messages:
    297
    Spetz, for the life of me, I can't hear anything of what you're saying in that video. You may want to either speak up louder or crank up the volume on your microphone some. Cause the music at the end comes in loud and clear. :(
     
  13. delabu Apprentice Engineer

    Messages:
    203
    I am guessing all these tests are on creative SP? I wonder how general MP wonkiness would affect these.

    I am thinking about using a BIG orbit for my base on a PVP server. The idea being that it's "fairly" close to the asteroids during the time I play (10-20km), and on the outside of it's orbit, very far away (50-100km), while I am not playing/sleeping/working. So the orbital cycle would be roughly 24 hours. Which translates roughly to 0.000694rpm rotation. I don't even know if it can be set this low. I also wonder what effect floating point calculation errors will have over time.

    Of course this means that the orbit needs to be fairly stable and predictable. Of course it's much harder to experiment on a survival server!
     
  14. Belthize Apprentice Engineer

    Messages:
    273
    I was doing this on creative SP yes. I suspect MP may be a bit wonky and I suspect round off may be an issue for large orbits over long time periods far from the system origin. I have some ideas for correcting orbits but it'll probably be fiddly.

    The next morning (8 hours later) the first little ship is still orbiting around the 2 large blocks in his 4x4 pen. If there was any drift it would have crashed. I'd call that pretty stable.

    The other unit must have been slightly tilted in the Y (up) axis. It was still orbiting just fine but had slowly climbed quite a bit. Even in the picture above the climbing is apparent after 20 minutes. It should have only been about 1 large block off the deck and it's already nearly 2. Making sure there's no motion out of axis when you start the gyro is critical or you'll get a stable orbit around and along a line rather than around a point. Hmm, I wonder if that long boom gave it some pitch, that would be weird and a bit annoying.

    Predictable is going to take some more testing. Figuring out exactly where the center will be based on starting conditions (existing motion, weight, thrust etc) is a bit tough.

    You can probably get kind of close starting it with low thrust and then very slowly increase the thrust until you reach the desired diameter. It should start spiraling out and have an orbit relatively near the same point. It helps to either bump it at random points in the orbit (the more small bumps the better) or alternate increasing the thrust on opposite edges of the orbit if you can. If you keep hitting the thrust at the same point the orbit point will shift up and to the right assuming you're looking down and it's orbiting clockwise. Basically the orbit will appear to shift along the direction of travel at the instant thrust is applied and into the gyro turn. This can be used to fine tune it.
     
  15. plaYer2k Master Engineer

    Messages:
    3,160
    Well, i was actually of the opinion that a stable orbit might be possible (unless the engine doesnt derp out) but the path is hardly predictable. So it would be very hard to get the satellites values to move through 3 pre-defined points.

    I got a stable orbit for 3 576 m diameter and about 1 minute 47 seconds per rotation and thus a total speed of 105 m/s with the following setup:
    [​IMG]

    The red thruster is on override with 296 N, the gyro is on override with pitch: -0.57 RPM.

    Video uploading


    Overall the orbit seems to be somewhat stable but it takes quite some time and "room" to settle.
    Though the slightest force applied to it would cause a change in orbit as there is no proper adjustment.

    I however did not run a test over several hours yet. The longest was 1 hour in the background iirc.

    Workshop: http://steamcommunity.com/sharedfiles/filedetails/?id=302778424
     
  16. Belthize Apprentice Engineer

    Messages:
    273
    Thanks Player2K, as I mentioned in a previous post I'd assumed/hoped one of the better engineers would pipe up.

    I agree that getting a generally stable orbit is very different than getting a stable orbit through a set of specific points. I have some ideas for bumping the thrust to nudge an object into a specific orbit but it would be incredibly fiddly. Doing it empirically may prove more effective than trying to work out the math and for many cases, e.g. random curiosity or meteor defense, good enough is good enough.

    I may do some tests to see how the netcode and large displacement from the origin impacts orbit stability.

    BTW, your video is flagged private.
     
  17. plaYer2k Master Engineer

    Messages:
    3,160
    Yes i noticed the video not being published yet too, shame on me!
    Also "we" arent bigger or better engineers. Some of us have just been longer around and thus more experience in SE, thats it :)
    Everyone will eventually come up with a great idea the others can benefit from.

    I didnt even touch that topic until you dropped my name in here tbh. At least not ingame.

    And yes, my thought exactly. Having a few tables and rough experience (empirically) will most likely be the better alternative for now. But i would however still love to see someone else looking into some proper math. The issue still is knowhing how the engine behaves, what moment does the gyro apply, how much force do the dampening thrusters actually apply at low speed and and and. There are some inconsistencies so far where the already mentioned dampening thrusters dont behave linear.
     
  18. Spets Master Engineer

    Messages:
    3,214
    How player2k? o.O it didn't worked for me :p
    I crashed all the satellites

     
  19. SaturaxCZ Senior Engineer

    Messages:
    1,718
    There can be one way how creat stable orbiting from start :D

    Did some one tryed release probe from flying ship at max speed ?

    With player2k setting it have to creat circle in diameter +-3586m

    ( it can be easy way how precisely launch probes :) )
     
  20. plaYer2k Master Engineer

    Messages:
    3,160
    Like Belthize has nicely explained over here, the orbit and its center changed until it "settled". I did not place the "gate" until that happened.

    Edit:
    My satellite is flying with max speed.

    diameter = 3 576 m
    time = 1 min 47 s = 107 s

    circumference = Pi * diameter = 3.14159 * 3 576 m = 11 234.335 m
    v = s / t = 11 234.335 m / 107 s ~= 105 m/s
     
  21. SaturaxCZ Senior Engineer

    Messages:
    1,718
    Yea but you and him did launch probes from static place, not from moving ship, so when you turn on gyroscope + thurster and just let it fly in 105m/s ?

    ( i did creat only remote controled rockets, not circling probe so i dont know :D )
     
  22. plaYer2k Master Engineer

    Messages:
    3,160
    Ah you mean to launch the ship into stable orbit from a like manveti sketched here? I only tried that with copy-paste and an astronaut flying at top speed.

    The result was a satellite whos orbit was drifting. That was because the satellite was not perfectly forward launched but with a slight "spin" to a side and thus a faulty launch.
    To fix that, one had to do as manveti intended, use a dropship with merge block aswell as a satellite with merge block. Any other method will most likely result in a faulty launch and thus a changed orbit.
     
  23. Spets Master Engineer

    Messages:
    3,214
    Im not that mathematical nerd:p I just do try and error, but hey! I got it, something... at least... I think...
    Im going to try that, deploying satellites while moving... I'll be back :p
     
  24. Belthize Apprentice Engineer

    Messages:
    273
    I don't think the initial velocity, say from ship launching really matters much other than to complicate either the prediction of orbital focus or the risk of drift in the axis perpendicular to the orbital plane.

    From what I can tell the weight, rpm and thrust settings alone dictate the orbit structure (period and diameter). The starting conditions, i.e. initial velocity, starting gyro then engines, both at once,etc only modify the center of the orbit. Launching with some initial velocity just means the damping thrusters have more work to do to get rid of that vector component once the gyro turns out of the initial direction of travel. With practice you might get higher precision but I'm dubious because it takes the gyro some time to spin up.

    I suspect you only need 2 thrusters. The overdrive one and a damping one on the outside edge such that it's damping vector is toward the center. The other 2 (or 4 if you have y axis) are probably superfluous. I'd only ever tested 1 thruster and 4. As the overdrive thruster constantly defines a new craft vector the damping engine pushes back toward the center to cancel drift from the previous vector. This is the reason you eventually achieve a stable orbit regardless of start conditions. I haven't tested this but replaying in my head some of the tests I did last night I think that's what's going on.

    Below is a drawing of what I mean. When the craft is oriented along the Z axis (as it is in the drawing) it is still drifting slightly along the x-axis. The two vectors at T0 and T1 are the same length, the second has a longer z-axis and shorter x-axis component. The main thruster is pushing along the Z axis and the dampening thruster is compensating for the x-axis drift by thrusting against it. By the time it reaches 0 on the z-axis and maximum width on the x-axis it's already rotated back inward a bit and the main thruster has a slight x-axis component. 1/4 RPM after T1 the main will be thrusting along the X-axis and the damper pushing down along the Z.

    [​IMG]

    Random side note, do space engineers in 2070 still use Xfig on Linux ?

    edit: It just occurred to me that larger drones will benefit from multiple gyros set to the same value. Eventually it will reach the desired RPM but gyros have limited torque so you might reach a stable orbit more quickly with multiple gyros.

    edit2: Hmm, I wonder if you can make a complex orbit that wanders around the shell of a sphere by adding a pitch component to the gyro.
     
  25. SaturaxCZ Senior Engineer

    Messages:
    1,718
    Meybe there is another problem: Let sattelit fly in max speed meybe affect perfect circle ( thx max limit force pushing against it ).
    I will try creat one sattelit moving realy slow, just see how many thrusters and gyroscopes will i need and if it creat perfect circle with lover speed or not.
     
  26. Spets Master Engineer

    Messages:
    3,214
    FAILED! :bawl:
     
  27. Spets Master Engineer

    Messages:
    3,214
    more testing, launching satellites from a moving platform

     
  28. delabu Apprentice Engineer

    Messages:
    203
    In the image below:
    • You first achieve a stable straightline speed at A.
    • Then, when you reach B (your desired center point is now to the left of the ship) you fire your "gravity thruster" that will thrust in the direction of arrow at B.
    • Also at the same time you start rotating your ship counter clockwise.
    Your thruster provides centripital acceleration a while your constant speed at A will match your orbital velocity v around the radius r. So, using the circular motion formula:
    a = v^2/r

    we can take the ship's total mass m and the thruster's thrust in Newton F and get:
    F/m = v^2/r

    So to calculate the force:

    F = (m * v^2) / r

    Now for the rotational period. Get the angular speed in radians per second first:

    w^2 = v^2/r
    w = sqrt(v^2/r)

    There are 2PI radians in a circle and 60 seconds in a minute (last time I checked):
    rpm = w*60/(2*PI)


    So, plug in the radius you need in meter, the mass of your ship and the velocity in m/s and you *should* get an orbit at that exact radius.

    Disclaimer : At work now and working off the top of my head, so will have to double check the math and test at home to see if I was talking complete bollocks.

    [EDIT] I forgot about the rotation not being instantanious. So this won't work unless you can achieve near instantanious rotation speed.

    [​IMG]
     
  29. gFleka Junior Engineer

    Messages:
    562
    I was doing some tests with orbiting also, and what i found is that orbits really need a lot of time to "settle". I will try using grav gen instead of thruster override today to try and make a slower orbiter.
     
  30. Belthize Apprentice Engineer

    Messages:
    273
    Yep, the spin up time of the gyros throws everything off. Coupled with the fact that in override there's no slew limit as a function of weight. A single gyro will eventually get a heavy drone up to 1RPM, so more gyros will help you more quickly achieve a stable orbit (I believe).

    In any event how's this for a stable orbit.



    Took me a few tries to insert it into the donut but it's a stable 90 second 800 meter orbit that passes through a donut asteroid. Basically I set up the orbit outside the donut but in the proper plane. Once I was happy I did a controlled 20 second burn perpendicular to the orbit to insert it through. I used a low and longer burn so I could time it and then just change the burn strength on each trial. It took about 5 tries to insert, I kept either over or under shooting and smacking the asteroid.

    Once you get the hang of it, bumping the diameter by hand entering gyro values allows for fine tuning, though the units are different than the slider. I'm not exactly sure what the heck the units are. Thrusting perpendicular to the orbit has no impact on the orbit geometry, it just moves it.
     
Thread Status:
This last post in this thread was made more than 31 days old.