GSFC/NGIMS-FSW-05 CONTOUR/NGIMS COMMANDING M Paulkovich November 17, 1999 rev 1.00 PRELIMINARY 1 INTRODUCTION This memo summarizes the approach for CONTOUR/NGIMS commanding, and will form the basis for the SIS-2 (level-2 Software Interface Specification). This encompasses both Stored Commands and Telecommands. STORED COMMANDS are contained in a sequence onboard the FC, triggered by S/C Time/Mode or by telecommand. Stored Commands allow Scan Control and Mechanism Control (valves, dust trap, heaters, etc). TELECOMMANDS are sent by GSE for Tuning Adjustments, Memory Loads (patches), Memory Dumps, Engineering Commands, and Stored Command Processor control (for testing). All Stored Commands also have a Telecommand counterpart and thus, Telecommands also allow Scan Control and Mechanism Control. Control over the Stored Command Processor software is also provided via Telecommands. Nomenclature We must distinguish between "scanning sequences" and "stored command sequences" (among other things) in our nomenclature. Definitions: IP - Integration Period (smallest unit in a scan); probably 15 or 20 ms for NGIMS. Subscan - A collection of around 10 to 20 IPs. Note that telemetry is also grouped per Subscan. Scan Mode - One of the five round-robin modes: OS, CS, IM, PM, SS. Scan - Complete traversal through one Scan Mode up to the commanded Last Subscan (qv). Pass - One traversal through five Scan Modes. Last Subscan - A commandable parameter ATCS (Absolute Time Command Sequence) - The list of Stored Commands that run during a flyby. SCP (Stored Command Processor) - the software that runs the ATCS. Telecommand (TC) - Command from ground to the instrument. Script - A file on the GSE which contains both TCs and GSE commands (e.g., "wait" commands are GSE-only). The following flow diagram illustrates the relationship of stored commands and telecommands to scan control and other instrument operation. 2 Stored Commanding The format the APL chooses for the T-zero (closest approach) message (currently unknown) may dictate whether ATCSs (Absolute Time-tagged Command Sequences) or RTCSs (Relative) are used for stored commands. We are baselining ATCSs. ATCSs will be created and maintained by the CO-Is in an easily readable format (e.g. in a spreadsheet); a software tool will be used to convert the spreadsheet version of the ATCSs into machine format (binary/hex) for object file creation, PROM burning and/or telecommanding. An example of a section of a Stored Command Sequence is shown below. Command Time Comments Valve 3, 1 0:10 Open valve 3 SetRepeat 1, 2, 0, 0 0:20 Set repeat count and scan parameters, Seq #1 OSBias 2 0:20 Set Open Source bias to 2 Valve 3, 0 0:30 Close valve 3 SetRepeat 1, 4, 0, 0 1:50 Set repeat count and scan parameters, Seq #1 . . . . . . . . . Example Stored Command Sequence 3 Command Dictionary The following table delineates the current thinking on the list of Telecommands and Stored Commands. Command Mnemonic Parameters SC TC Description Adapt. Mass Tbl MassTable SS, Table Y Y Select mass table Table for Subscan #SS for Scan Mode #4 (Programmed Masses) Set Repeat Count SetRepeat Mode, RepeatCnt, Y Y For Scan Mode number Mode, set the subscan repeat count to RepeatCnt (0..63). Acquire Baseline AcqBL n/a Y Y TBS (used in smart scanning) Dust Trap Open/Close DustTrap Op (Open/Close) Y Y Open or close the rock collector Test Mode Test Op (On/Off) N Y "On" Enables subsequent test-only commands Sequence Start Start n/a N Y Start/resume the ATCS Sequence Pause Pause n/a N Y Pause the ATCS Sequence Rewind Rewind n/a N Y Rewind and stop the ATCS Smartscan Control TBD TBD Y Y TBD Scan Mode Control Scan Mode, Frac, LastSS Y Y Allows Fractional (if Frac set) and partial scans (if LastSS nz) for Scan Mode Mode. Filament (n) On/Off Fil Fil , Op (On/Off) Y Y On/Off control for each filament Heater (n) On/Off Htr Htr, Op (On/Off) Y Y On/Off control for each heater Valve (n) Open/Close Valve Vlv, Op (Open/Close) Y Y Open/Close control for each valve Temperature Control Temp Htr, OnPeriod, OffPeriod Y Y Allow control of heater duty cycles DAC Override Mode DACORide DAC, Op (On/Off) Y Y Causes DAC value for DAC #DAC to freeze at current computer-generated state with subsequent control governed only by receipt of DAC teleommands (until DACORide Off) received). OS Bias OSBias Fil, Data Y Y Set 2-bit bias value for fil # Fil on Open Source BA On BA Op (On/Off) N Y Turn BA Filament On/Off EM Select EM Sel (0 / 1) Y Y Select EM 0 or 1 RAM Dump RamDump StartAddr, Length N Y Request contents of RAM memory area IORAM Dump IORamDump StartAddr, Length N Y Request contents of IORAM memory area CMP (Patch) Load Patch StartAddr, Length, Data N Y Load CMP (Computer Memory Patch) EEPROM Init EEPROMI Bank N Y Initialize (erase) all of EEPROM in Bank (1 or 2) EEPROM Dump EEPROMDump StartAddr, Length N Y Request contents of EEPROM memory area Reboot Reboot n/a N Y Boot from EEPROM (Test Mode Only) TGO Boot TgoBoot n/a N Y Cool reboot by TGO timer expiration and HW reset (Test Mode Only) Force Experiment SW ESW Data1, Data2, Data3, Data4 N Y Force value into ESW (Test Mode Only) Sleep Sleep n/a Y Y Command the instrument to Standby (Sleep) mode Raw I/O RawIO Port, Data N Y Diagnostic capability to output to any 1750 I/O port (Test Mode Only) No-Op Noop n/a Y Y No operation End Of List EOL n/a Y N Signifies end of the Stored Command list DAC Parameters DACn Data Y Y Allow tuning of specified D/A. Only honored for specified DAC# (n) after DACORide On received for that DAC#. 4 GSE Considerations 4.1 Remote Control. It will be advantageous to include simple TCP/IP connections to the GSE for the sake of flexibility. Moreover, this allows certain types of enhancements to be added by GSFC (by means of secondary GSE nodes) without requiring GSE software modification by SPRL. Thus it is suggested that a small feature be incorporated into the GSE to allow control via another node. This can be as simple as designating a TCP/IP port that the GSE monitors for GSE commands. This would allow great flexibility, in that another node (e.g. Lab software) could be used to control the Instrument in the GSE configuration. 4.2 Remote Data Reduction. It is also suggested that a small feature be incorporated into the GSE wherein all TM is echoed to a port (socket or IP) which is easily configurable via the GSE interface. This will allow us to customize easily special software tools to display and filter TM during test and calibration. 4.3 Special TM File/Display. In Cassini, we assigned 8 bits to a "Serial Number" which was used to identify TCs. For CONTOUR, 16 bits have been assigned. We should consider using a couple of bits in the Serial Number as a flag to the GSE to route TM data to special displays. For instance: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Destination Serial Number Assigning two bits to a GSE "Destination" allows the team to create TC scripts that direct selected TM packets to special GSE display windows. This is possible because each TM packet echoes the most recent telecommand, including the Serial Number word. 4.4 Voltage Scans. With Cassini/INMS, voltage scans were performed by changing the DAC data on an IP-by-IP basis. The current NGIMS scheme doesn't allow complete IP by IP control of DACs for special cases like voltage scans. But via TC scripts, DACs can be scanned at an acceptable rate (less than one second per step). This is done using the DAC Override and DAC commands. Using TC scripts along with the Destination bits proposed in 4.3 above, the important end result of voltage scans (commanded via the scripts) -- the TM -- can be displayed in special windows without being cluttered with data from "unimportant" IPs where the data was not changing. APPENDIX I COMMAND FORMATS 1. Command Argument Length Determination Table 1 assigns OpCodes ("OC" column) and lists the required length of arguments for all commands, with a Total column for SCs only. It is desirable to keep Stored Commands a constant length, and maintain the same header format for commands that are both TCs and SCs. Table 1 - Command Argument Lengths Tot for SCs only OC Mnemonic Parameters SC TC Arg #bits Tot LSB & units 0 (spare) 1 MassTable SS, Table Y Y SS - 5 bits Table - 10 bits 15 SS - 1 n.u. Table - 1 n.u. (allows 1024 mass/config tables) 2 SetRepeat Mode, RepeatCnt Y Y Mode - 3 bits RepeatCnt - 8 bits 11 Mode - 1 n.u. RepeatCnt - 0.25 n.u.; 0..63 3 AcqBL Y Y n/a 0 n/a 4 DustTrap Op (Open/Close ) Y Y Op - 1 bit 1 n/a (boolean) 5 Test Op (On/Off) N? Y Op - 1 bit 1 n/a (boolean) 6 Start constant: Op=1 N Y Op - 2 bits 2 n/a 6 Pause constant: Op=2 N Y Op - 2 bits 2 n/a 6 Rewind constant: Op=3 N Y Op - 2 bits 2 n/a 7 Smartscan TBD Y Y TBD TBD 8 (spare) 9 (spare) 10 Scan Mode, Frac, LastSS Y Y Mode - 3 bits Frac - 1 bit LastSS - 2 bits 6 Mode - 0..5 n.u. Frac - n/a (boolean) LastSS - 0 = 1-300, 1 = 1-TBD, 2 = 1-TBD, 3 = 1-TBD 12 Fil Fil , On/Off Y Y Fil - 2 bits On/Off - 1 bit 3 n/a (boolean) 13 Htr Htr, On/Off Y Y Htr - 2 bits On/Off - 1 bit 3 n/a (boolean) 14 Valve Vlv, Open/Close Y Y Vlv - 3 bits? Open/Close - 1 bit 4 n/a (boolean) 15 Temp Htr, OnPeriod, OffPeriod Y Y Htr - 2 bits TBC OnPeriod - 4 bits OffPeriod - 4 bits 10 Htr - n.u. OnPeriod - 0.5 (range 0..7.5) OffPeriod - 0.5 (range 0..7.5) 16 (spare) 17 DACORide DAC, On/Off N Y DAC - 5 bits On/Off - 1 bit DAC - 1 n.u. On/Off - n/a (boolean) 18 (spare) 19 OSBias Fil, Data Y Y Fil - 2 bits Data - 2 bits 4 Set 2-bit bias value for fil # Fil on Open Source 22 BA Op (On/Off) N Y On/Off - 1 bit Turn BA Filament On/Off 23 EM Em1 Y Y On/Off - 1 bit 1 Select EM 1 or 0 24 RamDump StartAddr, Length N Y Start Address - 16 bits Length - 4 bits TBC Start Address - n.u. Length - n.u. Note issue on length: should be equal to or less than #IPs/Subscan 25 IORamDump StartAddr, Length N Y Start Address - 16 bits Length - 4 bits TBC Start Address - n.u. Length - n.u. 26 Patch StartAddr, Length, Data N Y Start Address - 16 bits Length - 4 bits TBC Data - 16 bits each TBD: RAM | EEPROM Start Address - n.u. Length - n.u Data - n.u. Note: Contour limit for TCs is 64 words incl. CCSDS hdr. 27 EEPROMI Bank N Y Bank - 1 Bank - n.u. 28 EEPROMDump Bank, StartAddr, Length N Y Bank - 1 Start Address - 16 bits Length - 4 bits TBC Bank - n.u. Start Address - n.u. Length - n.u. 29 Reboot N Y n/a n/a 30 TgoBoot N Y n/a n/a 31 ESW Data1, Data2, Data3, Data4 N Y Data1..4: 16, 16, 16, 16 Data (n) - n.u. 32 Sleep Y? Y n/a 0 n/a 33 RawIO Port, Data N Y Port - 16 bits Data - 16 bits Port - n.u. Data - n.u. 34 Noop Y Y n/a 0 n/a 35 EOL Y N n/a 0 n/a 36 DACORide DAC, On/Off N Y DAC - 5 bits On/Off - 1 bit 6 DAC - 1 n.u. On/Off - n/a (boolean) 37 DAC1 Data Y Y Data - 14 bits 14 14 bits max 38 DAC2 Data Y Y Data - 14 bits 14 14 bits max 39 DAC3 Data Y Y Data - 14 bits 14 14 bits max 40 DAC4 Data Y Y Data - 14 bits 14 14 bits max 37 DAC5 Data Y Y Data - 14 bits 14 14 bits max 38 DAC6 Data Y Y Data - 14 bits 14 14 bits max 39 DAC7 Data Y Y Data - 14 bits 14 14 bits max 40 DAC8 Data Y Y Data - 14 bits 14 14 bits max 41 DAC9 42 DAC10 43 DAC11 44 DAC12 45 DAC13 46 DAC14 47 DAC15 48 DAC16 49 DAC17 50 DAC18 51 DAC19 52 DAC20 53 DAC21 54 DAC22 55 DAC23 56 DAC24 57 DAC25 58 DAC26 59 DAC27 60 DAC28 61 DAC29 62 DAC30 spare? 63 (spare) 2. Stored Commands - General Format 2.1 Common Fields. The common fields for all commands (including TCs) will be: OpCode 6 bits Identifies the command Checksum 6 bits Used by FSW to validate command contents VC 1 bit "Validate Command" - see §3.2 FT 1 bit "Fractional Time" - see §2.1.2 reserved 2 bits reserved spares 2.1.1 Op Codes have been rather arbitrarily assigned in Table 1 above. Six bits is adequate for an acceptable margin of spares for the OpCode field. No consideration for hamming distance has been given since there is another error detection mechanism (checksum). From Table 1 we see the biggest argument for Stored Commands is ~15 bits. Including the Header we can use constant length Stored Commands of two words. This may change due to special Smart Scan issues as yet unknown. 2.1.2 Stored Command Time Tags. The Stored Command Time Tags must also be considered. The longest time NGIMS is turned on for a comet encounter (Encke) is 14.6 Hrs. A sixteen-bit word with 1s resolution covers 18.2 Hrs. It may be desirable to allow 1/2 sec steps in Stored Commands; thus a reserved bit in the Header has been designated for Fractional Time (FT in the figure below). Figure 2-1 Stored Command Format 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 VC FT Checksum sp sp OpCode Data Word TimeTag VC =Validate Command FT = Fractional Time (TimeTag LSB, =0.5s) (used only in SCs) 3. Telecommands - General Format 3.1 Telecommands will use common fields as identified above in §2.1. The differences between Stored Command and Telecommands are: TCs need no Time Tag TCs have variable length Data segments TCs have Serial Numbers (and ID which is reflected in TM, used to assist data analysis). The general format for Telecommands will thus be: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 VC FT Checksum sp sp OpCode Data Word 1 Data Words 2+ (number of words dependent upon OpCode & Data Word 1 SN VC =Validate Command FT = Fractional Time (TimeTag LSB, =0.5s) (used only in SCs) See also 5.3 regarding the SN for "Special TM File/Display." 3.2 There is a special case for "Non-Validated Commands" (Ground Test) - the VC bit (Validate Command). When FSW validates command, command is valid if if S/C Mode = Ground, Checksum = 0 and VC = 0 (no checksum computation required). Otherwise, VC must always be SET (Flight) and checksums are compared. This feature allows manual creation of TCs with no software tool. 4. Itemized Command Formats Example formats for some commands are proposed below. For convenience of implementation and testing, it is possible to allocate some fields at byte boundaries, and also to expand them to more than the minimum bits. All command formats will eventually be defined in the SIS-2 (level-2 Software Interface Specification). MassTable - OpCode 1 As SC: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 VC FT Checksum sp sp 0 0 0 0 0 1 sp SS Table TimeTag As TC: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 VC FT Checksum sp sp 0 0 0 0 0 1 sp SS Table SN SetRepeat - OpCode 2 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 VC FT Checksum sp sp 0 0 0 0 1 0 sp Mode RepeatCnt TimeTag As TC: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 VC FT Checksum sp sp 0 0 0 0 1 0 sp Mode RepeatCnt SN AcqBL - OpCode 3 As SC: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 VC FT Checksum sp sp 0 0 0 0 1 1 spare TimeTag As TC: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 VC FT Checksum sp sp 0 0 0 0 1 1 spare SN DustTrap - OpCode 4 As SC: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 VC FT Checksum sp sp 0 0 0 1 0 0 Open TimeTag As TC: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 VC FT Checksum sp sp 0 0 0 1 0 0 Open SN Test - OpCode 5 As SC: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 VC FT Checksum sp sp 0 0 0 1 0 1 On TimeTag As TC: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 VC FT Checksum sp sp 0 0 0 1 0 1 On SN Start - OpCode 6, Operation 1 As SC: (n/a) As TC: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 VC FT Checksum sp sp 0 0 0 1 1 0 sp 0 1 SN Pause - OpCode 6, Operation 2 As SC: (n/a) As TC: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 VC FT Checksum sp sp 0 0 0 1 1 0 sp 1 0 SN Rewind - OpCode 6, Operation 3 As SC: (n/a) As TC: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 VC FT Checksum sp sp 0 0 0 1 1 0 sp 1 1 SN Fil - OpCode 12 (14h) As SC: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 VC FT Checksum sp sp 0 0 1 1 0 0 sp Fil sp On TimeTag As TC: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 VC FT Checksum sp sp 0 0 1 1 0 0 sp Fil sp On SN Htr - OpCode 13 (15h) As SC: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 VC FT Checksum sp sp 0 0 1 1 0 1 sp Htr sp On TimeTag As TC: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 VC FT Checksum sp sp 0 0 1 1 0 1 sp Htr sp On SN 1