turnigy 9x and fire control

Discussion in 'Electrical & Radio' started by GregMcFadden, Oct 9, 2012.

  1. GregMcFadden

    GregMcFadden Facilitator RCWC Staff

    Joined:
    Dec 6, 2006
    Posts:
    2,536
    The rest of what I wanted to implement short of a unique menu screen is done. the patch file for open9x v1696 is linked to below if anyone wishes to compile it themselves.

    9xforums.com/forum/viewtopic.php
     
  2. GregMcFadden

    GregMcFadden Facilitator RCWC Staff

    Joined:
    Dec 6, 2006
    Posts:
    2,536
    so I would like some opinions... right now range and bearing are separate inputs. I have been contemplating setting up the math (it is already basically done to make the previous work, but needs to be modified) so that a pair of inputs combine to give both range and bearing. E.g. one could use ail/ele stick so that one points the stick to the target. the radial distance would be the range, and the angle off the Y axis would be bearing... I am not sure how useful it would be, but before I set this project aside and come back later it might be nice to implement if there is interest
     
  3. NickMyers

    NickMyers Admin RCWC Staff

    Joined:
    Nov 15, 2007
    Posts:
    4,409
    Location:
    Federal Way, WA
    Were I using this, I would use two different controls for range and bearing myself. I may be weird though.
     
  4. GregMcFadden

    GregMcFadden Facilitator RCWC Staff

    Joined:
    Dec 6, 2006
    Posts:
    2,536
    that was my thought as well, which is why I got it working first... however when I started thinking about it, I could imagine a situation where it might be easier to point the stick, so to speak. Not like one would preclude the other, if I code the alternatives, both will be an option.
     
  5. wrenow

    wrenow RIP

    Joined:
    Jul 30, 2007
    Posts:
    439
    I had worked on a "point the stick" or "point on a pad" type input as a thought as well, but you are still doing 2 inputs with one control (think about it, the stick is varying x and y with 2 pots). One control I had even looked at was a 3 axis stick (normal stick that has a rotation, or Z factor, built in) and a fire button on the top like this one:www.servocity.com/html/4_function_joystick.html
    This type is commonly used on single stick aircraft radios for elevator, aileron, and rudder. A downside is that you probably need to use a tray for the radio or some other support for the system, as you are not just flicking the tip of the stick around with your thumb - you are grasping the stick like an handle to tilt l/r and f/b AND rotate cw/ccw AND push the fire button. I actually mentioned a setup in the past of using two of these for 6 analog and 2 digital inupts in a setup kind of like the MMU en.wikipedia.org/wiki/Manned_Maneuvering_Unit
    Build that right, and you could also have a shelf for helping carry your ship to the pond.:)
    Eventually, I came to the same conclusion as you, Greg - get it working and polished on separate inputs (my current setup is a l/r slide pot for azimuth and a simple 3-position switch for range (snipe, gun-battle, knife-fight).
    By the way, I believe the Open9x allows for 16 channels of output from the radio (8 from the internal RF, 8 different outputs throught trainer port), and, with the Sky9x board, up to 32 output channels. Actually, that may shortly be achievable on the new Turnigy 9XR or the FRSky X9D. 32 output channels from a sub $200 system all in (as little as $50 base) - now we are talking some serious turkey shooting.
    Cheers,
     
  6. GregMcFadden

    GregMcFadden Facilitator RCWC Staff

    Joined:
    Dec 6, 2006
    Posts:
    2,536
    yep. if we can get easily more than 8 channels, adding more turret geometry math is easy and would fit even on the current stock board processor. (takes me about 2k memory for the math for all of it, each additional would be about 1k more, and right now I have 7k to spare without cutting out anything else we don't need) I will probably dabble in the pad method a bit mroe but I am trying to modivate myelf to get back to real construction
     
  7. Tugboat

    Tugboat Facilitator RCWC Staff Admiral (Supporter)

    Joined:
    Jan 10, 2007
    Posts:
    8,298
    Location:
    Statesboro, GA
    Sigh... I have all the basic Open9X goodies... except the radio!! ARRRGGGHHH.

    I have two of the 9ch radios on order (one to cut up the other for other stuff) but the shipping company is taking its time. Or I'm impatient. Or both.
     
  8. Tugboat

    Tugboat Facilitator RCWC Staff Admiral (Supporter)

    Joined:
    Jan 10, 2007
    Posts:
    8,298
    Location:
    Statesboro, GA
    Hooray! My 9X got here today! Let the modding commence!
     
  9. GregMcFadden

    GregMcFadden Facilitator RCWC Staff

    Joined:
    Dec 6, 2006
    Posts:
    2,536
    let me know when you are ready and I can send you both an eeprom file to upload as well as the modified firmware binary file
     
  10. Tugboat

    Tugboat Facilitator RCWC Staff Admiral (Supporter)

    Joined:
    Jan 10, 2007
    Posts:
    8,298
    Location:
    Statesboro, GA
    I need to review the instructions on the install, and I have the backlight to put in while I've got it open. Toyed with putting buttons in, but I am leaving the joystick in there for now. Too much change at one time can be problematic.
     
  11. GregMcFadden

    GregMcFadden Facilitator RCWC Staff

    Joined:
    Dec 6, 2006
    Posts:
    2,536
    I didn't bother with the back light (might later but never needed it yet). let me know when you are ready. At that point I will link you to the sourcecode which has a description of how to set it up


    -Greg
     
  12. GregMcFadden

    GregMcFadden Facilitator RCWC Staff

    Joined:
    Dec 6, 2006
    Posts:
    2,536
    Well, other than making an attractive menu, which I do not plan to do, I only plan to add support for 4 turret clusters (currently set at two). I will probably not do a lot more work than adding clusters 2 and 3 on this until I can play with it in a ship or ship simulator (or someone else can).

    so right now, the following functions:
    Setting the range input channel or mix, the bearing input channel or mix, and the maximum range allowed on the master turret (bow)
    [​IMG]
    AZ1, RN1, and RMX1 are the azimuth input, the range input and the max range for turret group #1. TSP2 & 3 are turret cluster spacings for clusters 2 and 3 (not yet implimented). All distance measures are normalized to the distance between turret cluster #1 and turret cluster #4. only the output for 4 is working right now (need to split one sloppy function into a couple of well coded ones to enable that). the numeric value sets various parameters, although it is a bit in code, e.g. for any input selection, the valid range is 0 to 150 (corresponding to mixers 1 thru 16) and 200 -260 (corresponding to calibrated stick inputs (0,1,2,3) and pots (4,5,6)). You will notice that all arrays start at 0, hence the offset between input and naming)
    I do not plan to add more turret support for a couple of reasons:
    1. with the open9x firmware I have run out of curves that can be called in the mix menu. adding this many removes most of the !c (negative curves) in the selection option. changing that is a major undertaking and it already is time consuming enough to keep merging newer open9x versions with the modified code (most thankfully in an additional header file, but some spread through 5 other files)
    2. 4 turret groups = 12 channels. With the second module/tx modification, the 9x / 9xr can output 16 channels stock. I wanted to challenge myself to stay with the stock hardware as much as possible . given what it is built on, it should be straightforward to make this work on the x9d, x12d and other higher channel count tx's that are coming out in the near future, but until someone actually says "dude, I need a fifth turret group and my other 4 are working" I think this will be sufficient.

    other than that, there are canned curves built in as part of this for sine, cosine, arcsine, and arccos. tangent/atan not included due to singularity

    code is available for anyone who wants to see it/test it/make fun of it/improve it.

    -Greg
     
  13. Tugboat

    Tugboat Facilitator RCWC Staff Admiral (Supporter)

    Joined:
    Jan 10, 2007
    Posts:
    8,298
    Location:
    Statesboro, GA
    So with 2 turret clusters, you can do the main armament on the classic fore-and-aft layout, and with 3, add one bank of wing turrets?
     
  14. GregMcFadden

    GregMcFadden Facilitator RCWC Staff

    Joined:
    Dec 6, 2006
    Posts:
    2,536
    effectively, although I don't take into account the offset from centerline (yet) although that can be added.