Entwicklung des Sojus-TMA-Raumfahrzeugsimulators

Hallo! Wir sind das Team des Sojus-TMA-Simulators, eines Programms, das den Orbitalflug des Sojus-Raumfahrzeugs und der Internationalen Raumstation, das Rendezvous und das Andocken des Raumfahrzeugs an die ISS sowie das Abdocken und Sinken simuliert. All dies wird sowohl in der Automatik (d. H. Unter der Kontrolle der Modelle der Bordausrüstung des Bewegungssteuerungssystems) als auch in den manuellen Flugmodi simuliert, die in ihrer algorithmischen und logischen Zusammensetzung mit denen identisch sind, die an Bord des Sojus-TMA-Raumfahrzeugs verwendet werden.





Wir haben eine Software namens "Modeling and Control" in der C ++ Builder 6-Umgebung entwickelt. Warum genau darin und nicht in VS - dies ist unser erstes Projekt, und keiner von uns hatte Erfahrung in der Programmierung und noch mehr in der Simulatorkonstruktion "Stifttests" wurde die einfachste Umgebung ausgewählt, aber gleichzeitig wird der Code so entwickelt, dass er schnell in eine andere Umgebung (Qt, VS) integriert werden kann.





Zunächst haben wir uns entschlossen, die Hauptfensterformulare für das Debuggen des Betriebs von Softwarealgorithmen zu entwickeln - ein Ereignisprotokollierungsprotokoll sowie Formate, die die Bordausrüstung simulieren, mit der der Kosmonaut während des Flugprogramms interagiert.





- " ". , , . , . , , , , . .





:





  1. :





    • (Jxx, Jyy, Jzz, Jxy, Jyz, Jzx) - . , .





    • ( ).





    • .





  2. :





    • .





    • J2000.





  3. :





    • ( ).





    • (, , ).





    • (Wx, Wy, Wz).





  4. :





    • ( ).





    • .





    • .





    • .





    • .









:





Format "NU Input" - Komplex
" " -













, -, , , , .





- , . , TSaveDialog TOpenDialog. ini (TIniFile), . .





( , ) .









Quittung zum Laden der Anfangsbedingungen aus einer Datei

, .





//    
struct{
////     ////
TDateTime nu_day;                   // 2    /
////    ////
double vec_j2000_mks[3];                // 8      ..   J2000 (X, Y, Z)
double vel_j2000_mks[3];                // 11       ..         J2000 (X, Y, Z)
double Q_mks[4];                        // 14                                                  0  1  2
double w_j2000_mks[3];                  // 18        J2000      (Wx Wy Wz)
double vec_mks_PC[3];                   // 21      ..             (X, Y, Z)
double m_mk;                            // 24   
double mi_mks[3][3];                    // 25       (Jxx, Jxy, Jxz...)
////   ////
double vec_j2000_tk[3];                 // 34     ..   J2000 (X, Y, Z)
double vel_j2000_tk[3];                 // 37       ..         J2000 (X, Y, Z)                   0   1   2   3
double Q_tk[4];                         // 40         J2000 (Qs, Qx, Qy, Qz)
double w_j2000_tk[3];                   // 44        J2000      (Wx Wy Wz)
double vec_tk_TPK[3];                   // 47      ..    /         (X, Y, Z)
double m_tk;                            // 50   
double mi_tk[3][3];                     // 51       (Jxx, Jxy, Jxz...)
//// M I S C ////
double vec_solar[3];                    // 60      J2000      J2000 (ex, ey, ez)
unsigned long r_st_mks;                 // 63    
unsigned long n_su_4_dk;                // 64     ,      (,  )
unsigned long nu_otor_switch_styk_dk;	  // 65  № ,     (    )
double tk_top_zap;                      // 66     ( +)
double mks_top_zap;                     // 67     (  +)
unsigned long pr_doking;                // 68         
unsigned long nr_sudn;                  // 69      
} NU_temp;

//   
static bool USO_Booled[20][16];         //   (  _ .. 3.7)

      
      



(. . - ISBN 5-7038-2178-9), ( SoyCOM) , .





SGP4, ( TLE - ).





() UI , "" -





"-16". ().





, .





: () 15- ( + / -), "" - . . :





  • / ( 16- ).





  • ( ).





  • .





  • / .





, , .





, - , "" ( 246), (1-1) ( , () ). 20.





C++ Builder 6 Visual Studio (, MFC + OpenGL ) (***_form.cpp) , /. :





, ON, brvi_on = true;





void __fastcall TIrBrForm::brvi_on_btnClick(TObject *Sender)
{
brvi_on=true;           //   
Panel1->Color=clLime;   //      
}
      
      



- , , , , . . - , №228

















14









15









17









18





"0"





30





"1"





31

















24









25









27









28









04









05





TPanel, Caption. - . "1":





void __fastcall TIrBrForm::brvi_btn_1Click(TObject *Sender)
{
if(brvi_on){
USO_BitType[16][3] = 0111;
if(i1->Caption=="")
        i1->Caption="1";
else if(i2->Caption=="")
        i2->Caption="1";
else if(i3->Caption=="")
        i3->Caption="1";
else if(i4->Caption=="")
        i4->Caption="1";
else if(i5->Caption=="")
        i5->Caption="1";
else if(i6->Caption=="")
        i6->Caption="1";
else if(i7->Caption=="")
        i7->Caption="1";
else if(i8->Caption=="")
        i8->Caption="1";
else if(i9->Caption=="")
        i9->Caption="1";
else if(i10->Caption=="")
        i10->Caption="1";
else if(i11->Caption=="")
        i11->Caption="1";
else if(i12->Caption=="")
        i12->Caption="1";
else if(i13->Caption=="")
        i13->Caption="1";
else if(i14->Caption=="")
        i14->Caption="1";
else {}
}
}
      
      



, for, . . , "", , "".





, :





void __fastcall TIrBrForm::isp_btnClick(TObject *Sender)
{
if(brvi_on) { //   
if(i1->Caption==""&&i2->Caption==""){  //      ,
i1->Caption=="A";     //   
i2->Caption=="A";
JPS(3,is_irvi,is_operator,"","");  //    
} else {              //  ( 1  2  )
AnsiString brvi_msg = i1->Caption+i2->Caption+i3->Caption+i4->Caption+    //      
i5->Caption+i6->Caption+i7->Caption+i8->Caption+i9->Caption+i10->Caption+
i11->Caption+i12->Caption+i13->Caption+i14->Caption+i15->Caption;
JPS(1,is_operator,is_irvi,brvi_msg,"");
Timer1->Enabled=true;  //    
//    
i1->Caption="";
i2->Caption="";
i3->Caption="";
i4->Caption="";
i5->Caption="";
i6->Caption="";
i7->Caption="";
i8->Caption="";
i9->Caption="";
i10->Caption="";
i11->Caption="";
i12->Caption="";
i13->Caption="";
i14->Caption="";
i15->Caption="";

irvi_string = brvi_msg; //     

ChekIrvi(irvi_string); }} else  //   
JPS(3,is_miu,is_operator,cmd_brvi_error,"");   //   
}

      
      



, AnsiString irvi_string. ChekIrvi :





void ChekIrvi (AnsiString irvi_str){
if(irvi_str.IsEmpty())JPS(3,is_miu,is_operator," !",""); else {
irvi_type.mode = StrToInt(irvi_str.SubString(1,2)); //       ""
switch (irvi_type.mode) {   //  
        case 00: /*      - 1 - 4 */ break;
        case 04: /*   10-  */ break;
        case 05: /*   8-  */ break;
        case 10: /*    */   break;           // Arg addr RUS AUS data?
        case 11: /*    1-  */  break;
        case 12: /*    2-  */  break;
        case 14: /*   10-  */                       //   14, 
                 if((irvi_str.SubString(3,5)).IsEmpty())JPS(3,is_miu,is_operator," !",""); else {
                 irvi_type.addr = StrToInt(irvi_str.SubString(3,5));   //   
                 if(CorrectAddr(irvi_type.addr)) {                     //   ,  , 
                 if((irvi_str.SubString(8,7)).IsEmpty())JPS(3,is_miu,is_operator," !",""); else {
                 irvi_type.value = StrToInt(irvi_str.SubString(8,7));  //  
                 ArgonMemoryType[irvi_type.addr] = irvi_type.value;    //      
                 SetItvi(irvi_type.mode,irvi_type.addr,ArgonMemoryType[irvi_type.addr], irvi_type.z );   //    
                 JPS(4,is_argon,is_irvi,"  "+               //   (  )
                 IntToStr(irvi_type.value)+"   "+IntToStr(irvi_type.addr),"");}}
                 else {                                                 //     ,
                 irvi_err = true;
                 JPS(3,is_argon,is_operator,arg_addr_error,"");     } }  //      16
                 break;
        case 15: /*   8-  */  break;
        case 17: /*   10-  */ break;
        case 18: /*   8-  */
                // irvi_type.addr = StrToInt(irvi_str.SubString(3,5));   //   
                 // if(CorrectAddr(irvi_type.addr)) {                    //   ,  , 
                 //irvi_type.value = StrToInt(irvi_str.SubString(8,7));  //  
                // ArgonMemoryType[irvi_type.addr] = irvi_type.value;   //      
                 //SetItvi(irvi_type.mode,(irvi_type.addr)+1,ArgonMemoryType[irvi_type.addr], irvi_type.z );   //    
                 //mode18act=true;
                 break;
        case 21: /*    1-  */ break;
        case 22: /*    2-  */ break;
        case 24: /*   10-  */                      //   24, 
                 irvi_type.addr = StrToInt(irvi_str.SubString(3,5));   //     
                 if(CorrectAddr(irvi_type.addr)) {                     //   ,  , 
                 SetItvi(irvi_type.mode,irvi_type.addr,ArgonMemoryType[irvi_type.addr], irvi_type.z ); }  //    
                 else   {                                               //     ,
                 irvi_err = true;
                 JPS(3,is_argon,is_operator,arg_addr_error,"");   }     //      16
                 break;
        case 25: /*   8-  */ break;
        case 27: /*   10-  */ break;
        case 28: /*   8-   */break;
        case 30: /*      -   */
                 irvi_type.addr = StrToInt(irvi_str.SubString(3,5));   //     
                 if(CorrectAddr(irvi_type.addr)) {                     //   ,  , 
                 irvi_type.value = StrToInt(irvi_str.SubString(8,7));  //  
                 mode_30(irvi_type.addr,irvi_type.value); }             //    
                 else   {                                              //     ,
                 irvi_err = true;
                 JPS(3,is_argon,is_operator,arg_addr_error,"");   }    //      16
                 break;
        case 31: /*      -   */
                 irvi_type.addr = StrToInt(irvi_str.SubString(3,5));   //     
                 if(CorrectAddr(irvi_type.addr)) {                     //   ,  , 
                 irvi_type.value = StrToInt(irvi_str.SubString(8,7));  //  
                 mode_31(irvi_type.addr,irvi_type.value); }             //    
                 else   {                                              //     ,
                 irvi_err = true;
                 JPS(3,is_argon,is_operator,arg_addr_error,"");   }    //      16
                 break;
        case 40: /*  */ break;
        case 41: /*  */ break;
        case 42: /*  */ break;
        case 43: /*  */ break;
        case 44: /*  */ break;
        case 45: /*  */ break;
        case 46: /*  */ break;
        case 48: /*   */
        break;
        default: irvi_err = true;       //   (   )
                 JPS(3,is_argon,is_irvi,"","");        //     
                 JPS(3,is_miu,is_operator," !","");
        irvi_type.addr = StrToInt(irvi_str.SubString(3,5));
        irvi_type.value = StrToInt(irvi_str.SubString(8,7));
        break;
} } }

      
      



/ , . , :





(, , .) .





"-16", " 16", :





( ), ( , .. 2 - UDP), , (.. 2 3) . . TLabel , .





( ) ( ).





, , - . "-" . - , , . :









, , - №219 ( № 5.19, № 5.1)





.. . , . - () , (), , . , , "", "7". , , "" .





, , :





, - , , () . , 11 " 4" 15 " 15" 13 " 8".





.





static bool KSP_Booled[16][9];
      
      



, , true, . 7 " " KSP_Booled[0][6]=true;



, KSP_Booled[0][6]=1 , , , " ", :





//  ,    7
 ...
   if (KSP_Let[0]){ //                                  
   KSP_Booled[0][6]=true;                          //    7 - 
   JPS(1,is_operator,is_miu,is_ksp,"7"); } else   //   
 ... 

//  uso_model.cpp  USO_work
 ...
     if(KSP_Booled[0][6]) { // A 7
        KSP_Booled[0][6] = false;
        // 95     
        USO_Booled[0][3]=true;
        kdu_sdd = false;
     }
 ...
 
//   -   
 ...
  if(USO_Booled[0][3]){  // KSP A7
  A7_LABEL->Color=clLime;
  A7_LABEL->Font->Color=clBlack;  } else {
  A7_LABEL->Color=clGreen;
  A7_LABEL->Font->Color=clYellow; }
 ...  
      
      



Daher implementieren wir die Standardlogik der Arbeit mit der Leiterplatte und dem USO. Wenn es Leute gibt, die die USO des Sojus-Raumfahrzeugs verstehen und einen Fehler in unserer Interpretation der Logik der Arbeit mit der Leiterplatte gefunden haben, korrigieren Sie uns bitte, weil Wir haben keine Materialien zu USO und haben diese Logik aufgebaut, indem wir die Arbeit der InPU-Modelle und das Handbuch für die Arbeit mit dem Neptune-ME-System studiert haben.





Ich denke, dies sind ziemlich viele Informationen für einen Beitrag, daher werde ich den Rest der Formate im nächsten Beitrag beschreiben.








All Articles