Jump to content

JoshTheCoward

Members
  • Posts

    19
  • Joined

  • Last visited

Posts posted by JoshTheCoward

  1. 2 hours ago, harrisjosh2711 said:

    The heights aren't right. I have files where I have fixed the height for everything besides the BFR I believe. I haven't fixed any of the attachment nodes for the tanks though. Considering the amount of work its taking to get working right in 1.4, I mostly considered that project on-hold until everything was updated to 1.4.X. I'm in my senior year of college, which is my main focus right now, not the mod. If you would like to give it a shot I can provide you with the files but you would need to fix the attachment nodes on the tanks. Also, I think this version might have a different tank or two, I re-made one or two of the tanks because I didn't like how scaling the height was making the textures look. You would also need to fix the fuel numbers & mass(I may have already done mass) on the tanks, as-well as the thrust/ISP on the engines. Most of that info is readily available. As to figuring out the fuel/oxy. numbers- the easiest way would be to copy the fuel amounts from a procedural tank (or just stack tanks and take their sum) of the exact same size as the tank you are working with. Then you can just use trial and error for any fine adjustments you may need to make. None of this is technically to difficult, if you can multiply and divide you can do it pretty easily, but its time consuming. The hardest part will likely be making sure you have the right config. for the corresponding part. 

    Yeah send me the files, if you got time, I can give it a try. Worst case I can get the fuels mass and thrust right so it can make orbit.

  2. 11 hours ago, harrisjosh2711 said:

    No, I was working on some recently but haven't gotten around to finishing them. If RSS/RO comes to 1.4.x I will finish them. I'm skeptical it will though I think I seen something about one of their people saying that performance is worse in 1.4 so they weren't worried about it. Of which I must point out, that person is out their mind. I can build a 500+ parts ship in 1.4 with mods and my clock in the green. 1.3 my clock was yellow with 50 parts probably.

    I have no clue what I would be doing but I can do any grunt work if you point me in the right direction. The size of the rockets seems right if you set the rescale to 1 but the fuel and oxidizer seems off. How would you go about figuring out the proper amount?

  3. @JoshTheCoward: That looks pretty cool. How did you make the print on the controller, and the markings inside the annunciators?

    Just cheep decal paper from Amazon and then latex clear coat on top.

    @Freshmeat 2 questions have you been able to program a map button using the Mode variable? How would that look?

     

    I tried

     

      if (digitalRead(MAPPIN)) {
           CPacket.Mode = 2;
        } 

    but that didn't seem to work. Also have you ever programed Max7219's? Having a real tough time with them, but that is probably because I have zero programing knowledge.

  4. On 1/13/2018 at 9:05 AM, ajden said:

    JoshTheCoward,

    Have you named your inputs the same as the SAS modes? I'm not sure you can get that to work since higher up in the code the SAS modes are defined. Example: "#define SMPrograde   2"  is up in the header of the main tab in the code. 

    So maybe if your Prograde button is hooked up to pin #2, the following would work

    
       if (digitalRead(SMPrograde)) {
          setSASMode(SMPrograde);

    But this isn't ideal, since you start running into serial I/O pins that should ideally be left blank (depending on your platform). 

     

    Other "gotchas":

    Make sure you declare the pinMode(WhateverPin, INPUT_PULLUP); somewhere

    After some tribulations I discovered that my pushbuttons were NC instead of NO. That made the coding a bit more of a pain.

    I'm fairly new to this, so if any of the above is way out in left field, please correct me for posterity's sake.

     

    Ok so I rewrote it to 

     

    That does not seem to work either. 

     

     

    Update: I just re-assigned one of the buttons to my stage button and it worked no problem, do the physical button is working.

     

    Update2: Never Mind I was using Serial inputs and it was messing it up.

  5. 1 hour ago, morgeturd said:

    Well don't you just want to set different SASModes then?  

    Read the various control states in front of you, build the table of what you should do then code it.  I.e., if main sas switch is set, and then there's a multi-select dial set to a specific mode, read the mode switches, then choose what to do.  If you have different buttons for different modes, you'll have to read the master SAS state, and select it, perhaps toggling a hidden state variable in your MEGA about whether the next button push enables, or disables the master SAS mode.  You might use encoding of a bit-field and read the field from another "sub-controller" on your board.  And switching SAS modes with SAS disabled may make sense (like if you have a rotary switch control), or it may not make sense (if you just have buttons that may, or may not light up if the mode is chosen, and the mode is active).  I.e. push prograde twice (once to switch from target to prograde, then from prograde to off).  

    As in any control system, it really does help to make a little table of what things should be first, otherwise debugging becomes a pain in the neck.  I use whiteboards (easy to erase) or pencil (easy to refer to my sheet of paper).  Without knowing exactly what you're up to I think you're just looking to set various nav ball modes based on the user's switches, but since we don't know exactly what switches you have, it's hard to guess at what's best for you.

      

    How do I get it to change state with button push? 

    if (digitalRead(SMSAS)) {
           setSASMode(SMSAS);
      }

    This doesn't seem to work

     

    I want it to work: 

     

    If SAS switch is on then:

             if prograde button is pushed then switch to prograde ....

    else 

     SAS is off

     

     

    Here is my code:

    void controls() {
      if (Connected) {
    
        if (digitalRead(SASPIN)) { 
          MainControls(SAS, HIGH);
    
         if (digitalRead(SMSAS)) {
           setSASMode(SMSAS);
         }
      
        if (digitalRead(SMPrograde)) {
          setSASMode(SMPrograde);
       
        }
       
       if (digitalRead(SMRetroGrade)) {
         setSASMode(SMRetroGrade);
        } 
       
        if (digitalRead(SMNormal)) {
           setSASMode(SMNormal);
        } 
    
        if (digitalRead(SMAntinormal)) {
           setSASMode(SMAntinormal);
        } 
    
         if (digitalRead(SMRadialIn)) {
           setSASMode(SMRadialIn);
        } 
        if (digitalRead(SMRadialOut)) {
           setSASMode(SMRadialOut);
        } 
         if (digitalRead(SMTarget)) {
           setSASMode(SMTarget);
        } 
        if (digitalRead(SMAntiTarget)) {
           setSASMode(SMAntiTarget);
        } 
    
         if (digitalRead(SMManeuverNode)) {
           setSASMode(SMManeuverNode);
        } 
            
     
        }
        else {
          
          MainControls(SAS, LOW);
        }
        


     

  6. On 1/11/2018 at 1:08 PM, zitronen said:

    You need to do it like the example code:

    
    if (digitalRead(SASPIN)) { //--------- This is how you do main controls
          MainControls(SAS, HIGH);
          setSASMode(SMPrograde); //setting SAS mode
          //setNavballMode(NAVBallSURFACE); //setting navball mode
        }
        else {
          //setNavballMode(NAVBallTARGET);
          MainControls(SAS, LOW);
        }

    MainControls(SAS, HIGH/LOW) does the actual turning on and off.

    Since you are using win10, check using the example code to see if you are getting any control inputs at all.

    I am trying to do the same thing, i think.

    I have a master switch for SAS ON/OFF. But I want 10 buttons to change the state of SAS once it is on. I have tried putting just a separate if statement but that doesn't seem to help

  7. On 4/20/2017 at 2:36 PM, Freshmeat said:

    The IC's I mentioned will bring that down to two for LEDS and three for the digital inputs.

    I have been reading up on this but may be a little over my head. Do I make an array and send it through the shift register as a binary number?

    or do I keep it as the variables I already have? but how do I send those through the register?

  8. Thanks for the tips, I will do some research. 

     

    I have 46 wires right now. I bought digital joystick with out know whick killed me. Now need 2 inputs per axis so 12 just for attitude and translation. 22 for anuciator LEDs and 6 for switches, 10 for was buttons, 3 for speed selector, 1 throttle, 1 abort, 1 stage. So need 56 in total. Also thinking of adding a few readouts.

     

    Yes a lot of wires. Is there a better way of doing it?

  9. 5 hours ago, Freshmeat said:

    @JoshTheCoward It looks very much like what zitronen wrote, each direction has a value in CPacket (Roll, Yaw, Pitch, TX, TY, TZ) that you assign a value when a signal is read from a pin. Start by reading up on code at the Arduino homepage and go through their basic tutorials if you are completely new to coding, debugging KSP controllers is terrible because you have to wait for the game to load to test it out.

    Try making a program that will output 1000 on the serial monitor when you pull the joystick. Then, a sketch that outputs the direction. Then mesh that program with the bit of code that zitronen wrote in the post above yours. Ask along the way if you have problems, and when you do paste the code here (use the code tag).

    Don't know what the code tag is.

     

    but here is my code.

     

     if (digitalRead(WPIN)){
          CPacket.Pitch = -500;
      }
        else if (digitalRead(SPIN)){ 
          CPacket.Pitch = 500;
      }
        else {
          CPacket.Pitch = 0; 
          } 

     

    But it starts out 500 pitch in the one direction. Once you press the opposited direction it goes to 500 the other way but then returns to 500 the other way.

  10. On 1/13/2017 at 2:09 AM, stibbons said:

    Sure. If the "left" switch is closed, set TX to -1000 (or Yaw, or Roll, depending on what you're using the joystick for). If the "right" switch is closed, set it to 1000. And so on.

    I'm using digital joysticks on my board, and added a potentiometer to let me set the intensity of movement. With the knob turned up full, the translation controls work at full strength. With the knob set to half way, the translation controls only send 500 instead of 1000. It works a lot better than I expected it would. :)

    What does the code for this look like feels like i've tried everything.

  11. On 11/29/2016 at 5:20 AM, Freshmeat said:

    The problem is driver based, so the plugin cannot fix it. A workaround is to purchase a USB to TTL converter based on a different chip and connect tx, rx to Dig0 and Dig1, and +5V and GND to Vin and GND instead of USB to Arduino.

    Sorry I am new to this, I apologize if this is a dumb question. Is the drivers for the arduino? Would the Leonardo be affected too?

     

    Edit: Never mind tried Arduino Leonardo on Win10 and it works perfect! Thanks so much guys cant wait to finish my build.

     

    Edit 2: Works perfect on my Mega 2560 as well on Win10

×
×
  • Create New...