+ Reply to Thread
Results 1 to 10 of 10

Thread: Hover and Flight/Turn Calculation.

  1. #1
    Wire Sofaking Tasuit's Avatar
    Join Date
    Jan 2009
    Location
    Sønderjylland, Denmark
    Posts
    582
    Blog Entries
    9

    Unhappy Hover and Flight/Turn Calculation.

    Hello, my name is Tasuit.

    I would like to ask for help about a little subject i am facing.
    Does anyone know a calculation for making something hover at a given altitude?.
    I am asking because i got inspired by the Drone project which lyinginbedmon is making, and so i thought that i would start making my own drones in E2.
    But the problem i am facing is the hover/flight code.
    If anyone could give me some examples on making something hover, using vector thrusters or applyforce.
    I've looked through the hover thingy which lyinginbedmon released, but i cant figure out HOW he does it.

    Thanks in advance
    - Tasuit.

    Creator of the Unofficial servers

  2. #2
    Wiremod Helper Lyinginbedmon's Avatar
    Join Date
    Mar 2009
    Location
    England
    Posts
    2,659

    Default Re: Hover and Flight/Turn Calculation.

    Well my drones use vectors, so using a simple ranger-based system would be inaccurate, and having them fly at a set level (The Z value of their vectors) would mean they wouldn't rise or lower from terrain beneath.

    What they do is compare their target altitude to their present altitude. The distance of one or more rangers on their underside is subtracted from their target altitude and the remainder is added to the Z value of their vectors.

    So if their target altitude is 100 units and their ranger outputs a distance of 70 units, they add 30 to the Z value of the base vector that they calculate from, causing them to rise up. If the same ranger later outputs a distance of 120 units, then the calculation subtracts 20 from the Z value and the drone descends. This works because, when the target vector is negated, vector thrusters thrust towards a given point at all times, so with a set vector the thrusters will hover at a given point until they receive a new point, hovering.

    The Olympus Technologies drones, totally not SkyNet in Gmod form.
    Cronus: The Ultimate Drone, definitely SkyNet in Gmod form.
    The gBrain Project, the drone controls system that thinks it's better than you

  3. #3
    Wire Sofaking Tasuit's Avatar
    Join Date
    Jan 2009
    Location
    Sønderjylland, Denmark
    Posts
    582
    Blog Entries
    9

    Default Re: Hover and Flight/Turn Calculation.

    Oh! Now i get it!
    I think it was me that didnt really understand the vector thrusters/vector.
    But just to clear things out: If i give a vector thruster Z:30, it will keep firing upwards until Z is 30?, and if its above Z:30 it fires downwards so it will stay at Z:30?.

    Thank you very much for your help

    Creator of the Unofficial servers

  4. #4
    Wire Sofaking Tasuit's Avatar
    Join Date
    Jan 2009
    Location
    Sønderjylland, Denmark
    Posts
    582
    Blog Entries
    9

    Default Re: Hover and Flight/Turn Calculation.

    All right, so after trying and trying, and failing, and failing, i gave up, and decided to come here for more help.
    It got the vector calculation right, i got everything right, except the wobblyness.
    You see, my problem is that the drone is incredibly wobbly. It keeps going up/down and wont float nice and easy. I tried suing a delta, but i fail at delta calculations.
    So if somebody would be so nice, to give me some hints on what to do, i would give you a cookie.

    Thanks in advance.

    Creator of the Unofficial servers

  5. #5
    Wiremod Helper Lyinginbedmon's Avatar
    Join Date
    Mar 2009
    Location
    England
    Posts
    2,659

    Default Re: Hover and Flight/Turn Calculation.

    The bouncing is difficult to avoid, because once you reach your target altitude the thrusters will turn off, so the drone will either drop from zero thrust is rise from inertia, which causes the thrusters to turn on again to push them back into place.

    The simplest way is to tone down the power of the thrusters. I know there are ways to better stabilise it though, I just don't know what they are personally.

    The Olympus Technologies drones, totally not SkyNet in Gmod form.
    Cronus: The Ultimate Drone, definitely SkyNet in Gmod form.
    The gBrain Project, the drone controls system that thinks it's better than you

  6. #6
    Wire Sofaking Tasuit's Avatar
    Join Date
    Jan 2009
    Location
    Sønderjylland, Denmark
    Posts
    582
    Blog Entries
    9

    Default Re: Hover and Flight/Turn Calculation.

    But, how are you going to do it, with your bots?

    Creator of the Unofficial servers

  7. #7
    Wiremod Helper Lyinginbedmon's Avatar
    Join Date
    Mar 2009
    Location
    England
    Posts
    2,659

    Default Re: Hover and Flight/Turn Calculation.

    Currently? No idea, haven't looked into it yet.

    In theory, have the drones reach their altitude, and then stop thrusting and only thrust to negate their downward momentum.

    So if you're using a basic thruster-based flight system, negate the delta Z of the drone and feed that to a thruster (So a drop in Z is a positive value for the thruster). I'd suggest not making it a bi-directional thruster but I'm not positive.

    Not entirely certain off-hand how to do that for vector-based flight systems.

  8. #8
    Wire Sofaking Tasuit's Avatar
    Join Date
    Jan 2009
    Location
    Sønderjylland, Denmark
    Posts
    582
    Blog Entries
    9

    Default Re: Hover and Flight/Turn Calculation.

    Oh, Guess ill have to keep trying then.
    I tried to use the calculation for calculating the momentum irl (Weight x Velocity = Momentum) But that just really, really, screwed up.
    Thanks for your help anyways

    Edit: Just noticed your post, going to test that out straight away!
    Ill be right back

    Edit2: Tested it, its completely stabble now, but it falls to the ground slowly, like, if something is pulling it. Other then that, it works pretty good.
    Last edited by Tasuit; 05-03-2009 at 11:20 AM.

    Creator of the Unofficial servers

  9. #9
    Wire Noob KustoM's Avatar
    Join Date
    Jun 2008
    Location
    Sydney
    Posts
    12

    Default Re: Hover and Flight/Turn Calculation.

    to stop the bobbing simply use delta. i cant think of the code(<----hopeless =S) but it will smooth it out.
    if someone here can post you a code your set.

  10. #10
    Wire Sofaking Tasuit's Avatar
    Join Date
    Jan 2009
    Location
    Sønderjylland, Denmark
    Posts
    582
    Blog Entries
    9

    Default Re: Hover and Flight/Turn Calculation.

    I dont think you get my problem here:
    I DID use delta, but im getting a downwards movement.
    Not a bobbing, but a downwards constant movement.
    What im wanting is: A plate that i can make hover, either using Applyforce or using vector thrusters. The problem im facing is the calculation for the hovering force. because my bot will have changing weigth i will need something that can withstand anything / A calulation.
    Thanks in advance.

    Creator of the Unofficial servers

+ Reply to Thread

Similar Threads

  1. E1 Flight Chip
    By Adept in forum Installation and Malfunctions Support
    Replies: 1
    Last Post: 04-26-2009, 07:28 PM
  2. Value of gravity (for calculation purposes)
    By farrel in forum Wiremod General Chat
    Replies: 5
    Last Post: 08-09-2008, 06:25 PM
  3. plane and flight tutorial
    By smidge146 in forum Gate Nostalgia (Old School Wiring) Discussion & Help
    Replies: 10
    Last Post: 02-01-2008, 11:35 AM
  4. Flight of the Valkyries
    By LASture in forum Finished contraptions
    Replies: 4
    Last Post: 08-16-2007, 01:45 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots