New code has been checked in. The DAP works reasonably well, although it doesn't null pitch rate errors properly. In theory, pitch commands will be converted to a target pitch rate. Setting a nonzero trim will provide a constant pitch rate.Everything is (mostly) working now. I'll try to check in a test version in a few days to see what people feel about the autopilot.
That and the fact the ALT and KEAS should be tapes, not digital readouts.Basically, although the declutter modes and guidance diamond isn't implemented.
BEGIN_DESC
Sim run of final approach to KSC33. No specific mission, just generic training.
END_DESC
BEGIN_ENVIRONMENT
System Sol
Date MJD 51982.6888685577
END_ENVIRONMENT
BEGIN_FOCUS
Ship Discovery
END_FOCUS
BEGIN_CAMERA
TARGET Discovery
MODE Cockpit
FOV 44.80
END_CAMERA
BEGIN_HUD
TYPE Surface
END_HUD
BEGIN_MFD Left
TYPE Surface
SPDMODE 1
END_MFD
BEGIN_MFD Right
TYPE User
MODE CRT
Mode2 1
MDU 9
END_MFD
BEGIN_MFD 5
TYPE User
MODE CRT
Mode2 1
MDU 9
END_MFD
BEGIN_VC
END_VC
BEGIN_SHIPS
Discovery:SpaceShuttleUltra
STATUS Orbiting Earth
RPOS 5237967.53 3578793.67 -598581.50
RVEL -27.768 -17.483 383.782
AROT 75.95 51.37 76.48
AFCMODE 7
PRPLEVEL 0:0.189117 1:0.714162 2:0.785184 3:0.785368 4:1.000000 5:0.992000 6:0.323961 9:0.030000
NAVFREQ 0 0
MISSION STS-133
CONFIGURATION 3
MET 24909.652723
GEAR 0 0.0000
OPS 305
PEG7 -250.000000 0.000000 0.000000
WT 211805.221838
TIG 0 6 25 0.0
TV_ROLL 0.000000
MNVR 1 0
TGT_ID 2
BODY_VECT 1
ROLL 0.000000
PITCH 0.000000
YAW 0.000000
P_ANGLE 0.000000
Y_ANGLE 0.000000
OM_ANGLE -1.000000
DAP MODE 0 0
ROT MODE 0 0 0
TRANS MODE 0 0 0
CONTROL MODE 2
PAYLOAD CACTIVE1 8.000000 0.000000 0
PAYLOAD CACTIVE2 0.000000 0.000000 0
PAYLOAD CACTIVE3 -8.000000 0.000000 0
PAYLOAD CPASSIVE1 4.000000 0.000000 0
PAYLOAD CPASSIVE2 2.000000 0.000000 0
PAYLOAD CPASSIVE3 -6.000000 0.000000 0
PAYLOAD CPASSIVE4 7.000000 0.000000 0
PAYLOAD PORT1 3.000000 0.000000 0
PAYLOAD PORT2 -2.000000 0.000000 0
PAYLOAD PORT3 -8.000000 0.000000 0
PAYLOAD PORT4 7.000000 0.000000 0
PAYLOAD STBD1 3.000000 0.000000 0
PAYLOAD STBD2 -2.000000 0.000000 0
PAYLOAD STBD3 -8.000000 0.000000 0
PAYLOAD STBD4 0.000000 0.000000 0
MPSGOXVENT 1
PLBD_CAM 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
@SUBSYSTEM MPS_C
@ENDSUBSYSTEM ;MPS_C
@SUBSYSTEM MPS_L
@ENDSUBSYSTEM ;MPS_L
@SUBSYSTEM MPS_R
@ENDSUBSYSTEM ;MPS_R
@SUBSYSTEM FMC1
@ENDSUBSYSTEM ;FMC1
@SUBSYSTEM FMC2
@ENDSUBSYSTEM ;FMC2
@SUBSYSTEM FMC3
@ENDSUBSYSTEM ;FMC3
@SUBSYSTEM MMC1
@ENDSUBSYSTEM ;MMC1
@SUBSYSTEM MMC2
@ENDSUBSYSTEM ;MMC2
@SUBSYSTEM MMC3
@ENDSUBSYSTEM ;MMC3
@SUBSYSTEM MMC4
@ENDSUBSYSTEM ;MMC4
@SUBSYSTEM AMC1
@ENDSUBSYSTEM ;AMC1
@SUBSYSTEM AMC2
@ENDSUBSYSTEM ;AMC2
@SUBSYSTEM AMC3
@ENDSUBSYSTEM ;AMC3
@SUBSYSTEM FF1
@ENDSUBSYSTEM ;FF1
@SUBSYSTEM FF2
@ENDSUBSYSTEM ;FF2
@SUBSYSTEM FF3
@ENDSUBSYSTEM ;FF3
@SUBSYSTEM FF4
@ENDSUBSYSTEM ;FF4
@SUBSYSTEM FA1
@ENDSUBSYSTEM ;FA1
@SUBSYSTEM FA2
@ENDSUBSYSTEM ;FA2
@SUB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535
IDP4 DISP 65535
@ENDSUBSYSTEM ;IDP4
@SUBSYSTEM IMU1
@ENDSUBSYSTEM ;IMU1
@SUBSYSTEM IMU2
@ENDSUBSYSTEM ;IMU2
@SUBSYSTEM IMU3
@ENDSUBSYSTEM ;IMU3
@SUBSYSTEM GPC1
@ENDSUBSYSTEM ;GPC1
@SUBSYSTEM GPC2
@ENDSUBSYSTEM ;GPC2
@SUBSYSTEM GPC3
@ENDSUBSYSTEM ;GPC3
@SUBSYSTEM GPC4
@ENDSUBSYSTEM ;GPC4
@SUBSYSTEM GPC5
@ENDSUBSYSTEM ;GPC5
@SUBSYSTEM ODS
RING_STATE -1 0.0000
@ENDSUBSYSTEM ;ODS
@SUBSYSTEM ADPS
LEFT_AIRDATAPROBE 0 0 1.000000
RIGHT_AIRDATAPROBE 0 0 1.000000
@ENDSUBSYSTEM ;ADPS
@SUBSYSTEM ETUmbDoors
ET_DOORS 0.000000 0.000000
ET_DOOR_LATCHES 1.000000 0.000000 0.000000
@ENDSUBSYSTEM ;ETUmbDoors
@SUBSYSTEM -YStarTrackerDoorMotor
@ENDSUBSYSTEM ;-YStarTrackerDoorMotor
@SUBSYSTEM -ZStarTrackerDoorMotor
@ENDSUBSYSTEM ;-ZStarTrackerDoorMotor
@SUBSYSTEM ACBusSystem
@ENDSUBSYSTEM ;ACBusSystem
@SUBSYSTEM INVERTER1
@ENDSUBSYSTEM ;INVERTER1
@SUBSYSTEM INVERTER2
@ENDSUBSYSTEM ;INVERTER2
@SUBSYSTEM INVERTER3
@ENDSUBSYSTEM ;INVERTER3
@SUBSYSTEM APU1
APU1_State 2
APU1_FuelPress 1441.427077
APU1_HydPress 3006.235863
APU1_Speed 136.864150
@ENDSUBSYSTEM ;APU1
@SUBSYSTEM APU2
APU2_State 2
APU2_FuelPress 1441.877926
APU2_HydPress 3016.494552
APU2_Speed 130.070520
@ENDSUBSYSTEM ;APU2
@SUBSYSTEM APU3
APU3_State 2
APU3_FuelPress 1445.146947
APU3_HydPress 2977.574297
APU3_Speed 140.474498
@ENDSUBSYSTEM ;APU3
@SUBSYSTEM WSB1
@ENDSUBSYSTEM ;WSB1
@SUBSYSTEM WSB2
@ENDSUBSYSTEM ;WSB2
@SUBSYSTEM WSB3
@ENDSUBSYSTEM ;WSB3
@SUBSYSTEM LATCH0
LATCH_STATE1 1 1.0000
LATCH_STATE2 1 1.0000
LATCH_STATE3 1 1.0000
LATCH_STATE4 1 1.0000
LATCH_STATE5 1 1.0000
@ENDSUBSYSTEM ;LATCH0
@SUBSYSTEM LATCH1
LATCH_STATE1 1 1.0000
LATCH_STATE2 1 1.0000
LATCH_STATE3 1 1.0000
LATCH_STATE4 1 1.0000
LATCH_STATE5 1 1.0000
@ENDSUBSYSTEM ;LATCH1
@SUBSYSTEM LATCH2
LATCH_STATE1 1 1.0000
LATCH_STATE2 1 1.0000
LATCH_STATE3 1 1.0000
LATCH_STATE4 1 1.0000
LATCH_STATE5 1 1.0000
@ENDSUBSYSTEM ;LATCH2
@SUBSYSTEM RMS
ARM_STATUS 0.500000 0.013605 0.014688 0.500000 0.500000 0.500000
SHOULDER_BRACE 0.000000
GRAPPLE 1 1.0000
RIGIDIZE 1 1.0000
EXTEND 1 1.0000
RMS_ELBOW_CAM 0.0000 0.0000
RMS_ROLLOUT 0 0.0000
RMS_LATCHES 0 0.0000
@ENDSUBSYSTEM ;RMS
CRT_SEL 0 1
@PANEL F2
@ENDPANEL
@PANEL F4
@ENDPANEL
@PANEL F6
"Cdr Flt Cntlr Pwr" ON
@ENDPANEL
@PANEL F7
@ENDPANEL
@PANEL F8
"Plt Flt Cntlr Pwr" OFF
@ENDPANEL
@PANEL R2
"Boiler1 N2 Supply" ON
"Boiler2 N2 Supply" ON
"Boiler3 N2 Supply" ON
"Boiler1 Cntlr" ON
"Boiler2 Cntlr" ON
"Boiler3 Cntlr" ON
"Boiler1 Cntlr Pwr/Htr" A
"Boiler2 Cntlr Pwr/Htr" A
"Boiler3 Cntlr Pwr/Htr" A
"APU1 Run" START/RUN
"APU2 Run" START/RUN
"APU3 Run" START/RUN
"Hyd Main Pump Press 1" NORM
"Hyd Main Pump Press 2" NORM
"Hyd Main Pump Press 3" NORM
"APU1 Cntlr Pwr " ON
"APU2 Cntlr Pwr " ON
"APU3 Cntlr Pwr " ON
"APU1 Fuel Tank Valve" OPEN
"APU2 Fuel Tank Valve" OPEN
"APU3 Fuel Tank Valve" OPEN
"ET Umb Centerline Latch" GND
"ET Umb Left Door" OFF
"ET Umb Left Door Latch" OFF
"ET Umb Right Door" OFF
"ET Umb Right Door Latch" OFF
"MPS Pwr Left AC2" [0]
"MPS Pwr Ctr AC1" [0]
"MPS Pwr Right AC3" [0]
"MPS Pwr Left AC3" [0]
"MPS Pwr Ctr AC2" [0]
"MPS Pwr Right AC1" [0]
"MPS He Isol A Left" GPC
"MPS He Isol A Ctr" GPC
"MPS He Isol A Right" GPC
"MPS He Isol B Left" GPC
"MPS He Isol B Ctr" GPC
"MPS He Isol B Right" GPC
@ENDPANEL
@PANEL C3
"LOMS Arm" OFF
"ROMS Arm" OFF
"LADP Stow Enable" INHIBIT
"RADP Stow Enable" INHIBIT
"LADP Deploy" STOW
"RADP Deploy" STOW
@ENDPANEL
@PANEL O6
"L GLRSHLD FLOOD" VAR
"S TRK DR CNTL SYS1" OFF
"S TRK DR CNTL SYS2" OFF
"GPC_POWER_1_COVER" [0]
"GPC_POWER_2_COVER" [0]
"GPC_POWER_3_COVER" [0]
"GPC_POWER_4_COVER" [0]
"GPC_POWER_5_COVER" [0]
"GPC POWER 1" ON
"GPC POWER 2" ON
"GPC POWER 3" ON
"GPC POWER 4" ON
"GPC POWER 5" ON
"GPC_OUTPUT_1_COVER" [0]
"GPC_OUTPUT_2_COVER" [0]
"GPC_OUTPUT_3_COVER" [0]
"GPC_OUTPUT_4_COVER" [0]
"GPC_OUTPUT_5_COVER" [0]
"GPC OUTPUT 1" NORMAL
"GPC OUTPUT 2" NORMAL
"GPC OUTPUT 3" NORMAL
"GPC OUTPUT 4" NORMAL
"GPC OUTPUT 5" NORMAL
"IPL SOURCE" OFF
"GPC MODE 1" STBY
"GPC MODE 2" STBY
"GPC MODE 3" STBY
"GPC MODE 4" STBY
"GPC MODE 5" STBY
@ENDPANEL
@PANEL R11
@ENDPANEL
@PANEL A6
"SENSE" -X
"Aft Flt Cntlr Pwr" OFF
"Payload Ret Latch 1" OFF
"Payload Ret Latch 2" OFF
"Payload Ret Latch 3" OFF
"Payload Ret Latch 4" OFF
"Payload Ret Latch 5" OFF
"Payload Select" 1
@ENDPANEL
@PANEL AftMDU
@ENDPANEL
@PANEL A7U
@ENDPANEL
@PANEL A7A3/A8A3
"SYSTEM POWER MNA" [1]
"SYSTEM POWER MNB" [1]
"PYRO POWER MNA" [0]
"PYRO POWER MNC" [0]
"SYS1 VENT ISOL" [1]
"SYS1 VENT" [1]
"SYS2 VENT ISOL" [1]
"SYS2 VENT" [1]
"PSU POWER MNA" [0]
"PSU POWER MNB" [0]
"LIGHTS AIRLOCK 1-4" [0]
"LIGHTS AIRLOCK 2-3" [0]
"LIGHTS DOCKING TRUSS FWD" [0]
"LIGHTS DOCKING TRUSS AFT" [0]
"ARLK/TNL FAN A" [0]
"ARLK/TNL FAN B" [0]
"LIGHTS C/L VESTIBULE PORT" [0]
"LIGHTS C/L VESTIBULE STBD" [0]
"CNTL PNL PWR A" OFF
"CNTL PNL PWR B" OFF
"CNTL PNL PWR C" OFF
"HTRS/DCU PWR H1" OFF
"HTRS/DCU PWR H2/DCU" OFF
"HTRS/DCU PWR H3/DCU" OFF
"APDS PWR A" OFF
"APDS PWR B" OFF
"APDS PWR C" OFF
"PYROS Ap" [0]
"PYROS Bp" [0]
"PYROS Cp" [0]
@ENDPANEL
@PANEL A8
"Port MPM Deploy Cover" [0]
"Stbd MPM Deploy Cover" [0]
"Port RMS Latches" OFF
"Stbd MPM Latches" OFF
"Port MPM Deploy" OFF
"Stbd MPM Deploy" OFF
"EE Mode" OFF
"RMS SELECT" OFF
"Parameter" TEST
"Joint" SHOULDER_YAW
"RMS Mode" OPR_CMD
@ENDPANEL
END
END_SHIPS
I could take a shot at it as long as it doesn't involve coding/math. I could use a break from redoing the MLP/ET meshes.The aerodynamic model only works at low speeds (final approach and possibly the HAC). An earlier version was tested at high mach (around M20.0) and it worked, but I'm in the process of redoing the lookup tables. Help typing the lookup tables would be appreciated; there's a lot of data to enter.
const double cn_M0040_AOA100[] = {0.42583, 0.42324, 0.42000, 0.41224, 0.40515, 0.39643, 0.38558};
Doing that yielded a MSVC++ debug assertion failure at the same CTD point, screenshot attached.The scenario works for me (although the DAP causes the orbiter to shake). If you're compiling in Release mode, can you try compiling in Debug mode and running the scenario? It might provide more error information.
I can try as long as the naming conventions are simple.The lookup table work just involves creating lines like
There are documents on NTRS that give aerodynamic data tables for AOA, mach, and control surface deflection; these just need to be defined as arrays in the code. I'll post links to the documents and details on the naming conventions if you're interested.Code:const double cn_M0040_AOA100[] = {0.42583, 0.42324, 0.42000, 0.41224, 0.40515, 0.39643, 0.38558};
That worked, no more CTDs! I guess something overloaded Orbiter causing it to CTD?Checked in a fix (I think) for the CTD.
That's basically what I'm doing; there are classes that copy the data into a table. (The code is in Aerodynamics/AerodynamicLookupTable.cpp). It might be easier to put the data into a csv file, though, rather than putting the raw data into the code.Hmm... that look up table looks pretty ineffective, wouldn't it be possible to create a CSV file, read it during module initialization (dllInit) and select the lines by having an index table for finding the right parameter lines?
So, for interpolating the data, you would seek maximal sets of parameters:
(M, AOA)
(M, AOA+1)
(M+1, AOA)
(M+1, AOA+1)
with the actual parameters being interpolated by the 2D coordinates (m, aoa).
Would work better than entering the whole chunk of data in constant array form, and the data could get verified outside Orbiter, for example by plotting it with a standard spreadsheet program, which wouldn't be too bad for large amounts of data.
That's basically what I'm doing; there are classes that copy the data into a table. (The code is in Aerodynamics/AerodynamicLookupTable.cpp). It might be easier to put the data into a csv file, though, rather than putting the raw data into the code.
Checked in a new version with some debugging output (this is what caused the CTD, but it should work now). Can you keep an eye on the error and rates values during approach? These show the commanded pitch rate and the error between the actual and commanded values. Also, are you using a joystick? I've been testing using keyboard controls.That worked, no more CTDs! I guess something overloaded Orbiter causing it to CTD?
---------- Post added at 01:14 AM ---------- Previous post was at 01:10 AM ----------
OK, got to test things: Seems smooth down to pre-flare(1800 ft) when the elevons lose all effectiveness and the orbiter fails to make the final glide to the runway hitting the ground at a catastrophic Hdot.
New version works fine in terms of CTDs. And yes, I'm using a joystick.Checked in a new version with some debugging output (this is what caused the CTD, but it should work now). Can you keep an eye on the error and rates values during approach? These show the commanded pitch rate and the error between the actual and commanded values. Also, are you using a joystick? I've been testing using keyboard controls.
You can use the standard Orbiter trim (Ins/Del) for derotation, although at the moment I think you need maximum down trim to get 2 degrees/sec rotation rate. I'll make it a bit more sensitive. I'll also look into changing the HUD brightness.New version works fine in terms of CTDs. And yes, I'm using a joystick.
---------- Post added at 09:53 AM ---------- Previous post was at 07:41 AM ----------
Maybe I'm doing the whole A&L wrong. Could someone check in a playback of a proper HDG-to-wheelstop scenario so that I can review and compare?
---------- Post added at 12:29 PM ---------- Previous post was at 09:53 AM ----------
After doing some final approach runs, I have concluded that there's no problem with the elevons. You just have to time the flare correctly. Something that would be great help is automatic speedbrake control that modulates the speedbrake for you.
Another thing is de-rotation for WONG. That is done by a trim switch on the CDR/PLT RHCs which automatically lowers the nose towards the ground at a rate of about 2°/s.
Also, the ability to adjust HUD brightness would be great! Right now it gets nearly washed out during the day and nearly unreadable.
Any ideas where we should put the aerodynamic data csv files? The modules or the missions folder seem to be the most logical places.