+ Reply to Thread
Page 13 of 40 FirstFirst ... 3111213141523 ... LastLast
Results 121 to 130 of 399

Thread: Expression Gate Documentation

  1. #121
    Expressionism 2.0 Syranide's Avatar
    Join Date
    Mar 2007
    Location
    Sweden
    Posts
    4,573

    Default

    i could really use the clock thing on the gate if sumone could reword it[/b]
    I don't quite understand what you mean?
    You don't understand what "we" say on how to use it?

  2. #122
    Wirererer CBBP's Avatar
    Join Date
    Apr 2007
    Posts
    201

    Default

    How would you make a double tap type thing?

    Like. hit and hold space it goes up while olding space. Else hit space then hit space again and hold it goes down?

    And something like...

    if A then forward
    if A then B forward and Up
    If B then A up only

  3. #123
    Expressionism 2.0 Syranide's Avatar
    Join Date
    Mar 2007
    Location
    Sweden
    Posts
    4,573

    Default

    Depends on the restrictions:

    Code:
    ~Tap & !Tap & !St -> Mode = 0;
    ~Tap & Tap & St -> St = 0, Mode = 2;
    ~Tap & Tap & !St -> St = 1, schedule(50);
    clk() & St -> St = 0, Mode = 1;
    That should work, mode is either 0 (off), 1 (hold), 2 (double tap).

  4. #124
    Wirererer CBBP's Avatar
    Join Date
    Apr 2007
    Posts
    201

    Default

    Depends on the restrictions:

    Code:
    ~Tap & !Tap & !St -> Mode = 0;
    ~Tap & Tap & St -> St = 0, Mode = 2;
    ~Tap & Tap & !St -> St = 1, schedule(50);
    clk() & St -> St = 0, Mode = 1;
    That should work, mode is either 0 (off), 1 (hold), 2 (double tap).[/b]
    mm.. I see... Never thought of using ~.
    Thanks.

    I think I am being too much of a perfectionist with this hover system thing that tilts haha.

    Edit. I does not work right. I dunno what it is doing .

  5. #125
    Wirererer EntropyGuardian's Avatar
    Join Date
    Apr 2007
    Posts
    154

    Default

    Here's what I doing:

    Code:
    N@BOTHOvering
    I@On Z Height Target
    O@Hovermode ZVelocity
    SPD = 3 #Max speed for hover-balls
    HTK = 30 #Height to keep from ground
    HDF = 40 #Height difference from target
    
    AJH = Z + HDF
    Hovermode = On
    !On -> ZVelocity = 0;
    On & Target ->
    Height > HTK ->
    ZVelocity = clamp(AJH, -SPD, SPD);
    Height < HTK & AJH < 0 ->
    ZVelocity = clamp((HTK - Height), -SPD, SPD);
    Height < HTK & AJH > 0 ->
    ZVelocity = clamp(AJH, -SPD, SPD);;
    On & !Target ->
    ZVelocity = clamp((HTK - Height), -SPD, SPD);
    Z is the Z offset from a beacon sensor, Height is a ranger aimed below this contraption, and Target is a Target finder.

    I set up several statements in there.

    1. Is the contraption above its "low" point (HTK)? If so, go wild after the target (ZVelocity = clamp(AJH, -SPD, SPD))
    2. Is the contraption too low, and is the target demanding the contraption go lower? If so, just worry about how low you are (ZVelocity = clamp((HTK - Height), -SPD, SPD)).
    3. Is the contraption too low, but is the target demanding you rise? If so, go nuts after the target (ZVelocity = clamp(AJH, -SPD, SPD)).
    4. Is there no target? If so, just worry about staying off of the ground (ZVelocity = clamp((HTK - Height), -SPD, SPD)).

    Now, I have done this before and I know exactly what will happen. The hover-balls aren&#39;t quite as easy to finesse as thrusters, so to get them to slow down and stop within a certain area I usually have to set up a "cushion range". Using that cushion range, I divide the speed they are moving by some number to steadily decrease the movement until they completely stop.

    Something like this:

    Code:
    CR = HTK / 10
    Height > HTK + CR -> ZVelocity = -SPD;
    Height < HTK - CR -> ZVelocity = SPD;
    Height > HTK - CR & Height > HTK - CR & -> ZVelocity = (HTK - Height) / (CR - 1);
    Which has worked in the past, but for 4 statements, creating cushion ranges for all of them seems a bit nutty.

    So is there a way of merging the two, using clamp() instead of two statements, and using the last line as a sort of override? Also, is there a simple statement that outputs a 1 if a value is within a set value boundry (Is Blah between X and Y? instead of Is Blah less than X AND greater than Y?)?

  6. #126
    Expressionism 2.0 Syranide's Avatar
    Join Date
    Mar 2007
    Location
    Sweden
    Posts
    4,573

    Default

    So is there a way of merging the two, using clamp() instead of two statements, and using the last line as a sort of override?[/b]
    Not quite sure what you mean.

    Also, is there a simple statement that outputs a 1 if a value is within a set value boundry (Is Blah between X and Y? instead of Is Blah less than X AND greater than Y?)?[/b]
    Nope, could be pretty useful with such a function actually, no there is currently no such function but I might add a one later.
    A = B > X & B < Y is the way to do it now, as you say.

  7. #127
    Wirererer EntropyGuardian's Avatar
    Join Date
    Apr 2007
    Posts
    154

    Default

    Not quite sure what you mean.[/b]
    I dig using the clamp() function to set the speeds. However, if I only use the clamp() I get the silly wobbling bit. If I use a cushion range, I use three lines (Value < -X, Value > X, and Value < X & Value > -X). Can I just use the clamp() and then have "Value < X & Value > -X" override it somehow?

    It really isn&#39;t *that* big of a deal, but I&#39;d like to consolidate as much as I possibly can.

    What would be perfect is if the range() or boundary() or whatever was a function and I could do something like

    Code:
    On ->
    !range(Value, -X, X) -> clamp(Value, l, u);
    range(Value, -X, X) -> #othercode;;

  8. #128
    Wirererer CBBP's Avatar
    Join Date
    Apr 2007
    Posts
    201

    Default

    Hey how would I do a square root with the + & - ontop of each other and in front of the sqrt symbol?

    also, a sin-1 is just sin^-1 right?

  9. #129
    Wire Sofaking Shandolum's Avatar
    Join Date
    Apr 2007
    Location
    Europe -> Denmark
    Posts
    887

    Default

    First time I&#39;ve actually asked for advice in expressions.
    I am working on perfecting the wire-gyro-engine and was wondering if there was a good way to use the internal timer together with the internal delta to find a good RPM.
    I am not so good with the internal timer yet, so I am asking for advise.

    Code:
    N@SH Engine
    I@Roll ERoll
    O@RPM
    interval(20)
    clk() -> RPM=RPM*0.8+angnorm($ERoll-$Roll)*0.2*(50*60/360)
    This is what I have so far, 20*50=1000=1 second, $Roll*60/360=RPM. Plus smoothed it out.

    Would this create RPM, or is there a far better way?

    And is there a way to get readings faster through an expression, because I need to get faster calculations to increase the speed of my engines that has maxed out at "angnorm($Roll)=148" and I want my engine to be faster still. I can quess that its the speed of the readings and calculations that is holding my engine back.
    Everything can be improved upon. Nothing is Perfect.
    The only way to move forward, is to surpass what has already been done.
    Creator of many things.

  10. #130
    Wire Amateur Psawhn's Avatar
    Join Date
    Aug 2007
    Posts
    34

    Default

    Hey how would I do a square root with the + & - ontop of each other and in front of the sqrt symbol?

    also, a sin-1 is just sin^-1 right?[/b]
    The +/- symbol actually means you have two possible solutions. In fact, you commonly find them in front of a square root symbol because of its nature.

    If you need to deal with it, the only way (both in programming and in written math) is to split it up into two equations: one with a plus and one with a minus.
    x* x+ 17 = 0
    When keeping it real goes wrong.

+ Reply to Thread
Page 13 of 40 FirstFirst ... 3111213141523 ... LastLast

Similar Threads

  1. !!!OLD!!! Documentation of hi-speed devices
    By Black Phoenix in forum CPU, GPU, and Hi-speed Discussion & Help
    Replies: 98
    Last Post: 02-10-2011, 07:41 PM
  2. !!!OLD!!! ZGPU Documentation
    By Black Phoenix in forum CPU, GPU, and Hi-speed Discussion & Help
    Replies: 38
    Last Post: 11-29-2010, 04:54 PM
  3. !!!OLD!!! ZCPU Documentation
    By Black Phoenix in forum CPU, GPU, and Hi-speed Discussion & Help
    Replies: 144
    Last Post: 09-05-2010, 03:46 AM
  4. Moongate Documentation
    By BlackNecro in forum Wiremod Addons & Coding
    Replies: 24
    Last Post: 04-22-2009, 01:32 AM

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