Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-27761

Update the M2 SAL Interface Based on the Latest XML File in Phase 4

    XMLWordPrintable

Details

    • Story
    • Status: Done
    • Resolution: Done
    • None
    • ts_main_telescope
    • 3
    • TSSW Sprint - Dec 07 - Dec 21
    • Telescope and Site
    • No

    Description

      Update the M2 SAL interface based on the latest xml file. After the summit test at Feb. in this year, the M2 xml has been updated to support more use cases than before. This task is to update the software to support this.

      The main focus is in this task is to support all available system-specific events.
      The work of generic events was done at DM-27584.

      This task is in the phase 4.

      Attachments

        1. getHardpointListBySal.png
          getHardpointListBySal.png
          27 kB
        2. getSalDetailedState.png
          getSalDetailedState.png
          49 kB
        3. getSalInclinationTelemetrySource.png
          getSalInclinationTelemetrySource.png
          32 kB
        4. getSalTempOffset.png
          getSalTempOffset.png
          33 kB
        5. getTcpIpConnection.png
          getTcpIpConnection.png
          255 kB
        6. getTempHigh.png
          getTempHigh.png
          276 kB
        7. getTempHighSal.png
          getTempHighSal.png
          65 kB
        8. M2 wish list.pdf
          63 kB
        9. probeOfHardpoint.png
          probeOfHardpoint.png
          65 kB

        Issue Links

          Activity

            No builds found.
            ttsai Te-Wei Tsai created issue -
            ttsai Te-Wei Tsai made changes -
            Field Original Value New Value
            Epic Link DM-27584 [ 441732 ]
            ttsai Te-Wei Tsai made changes -
            Link This issue is triggered by DM-27445 [ DM-27445 ]
            ttsai Te-Wei Tsai made changes -
            Status To Do [ 10001 ] In Progress [ 3 ]
            ttsai Te-Wei Tsai made changes -
            Status In Progress [ 3 ] To Do [ 10001 ]
            ttsai Te-Wei Tsai made changes -
            Status To Do [ 10001 ] In Progress [ 3 ]
            ttsai Te-Wei Tsai added a comment - - edited

            Updated the m2ms_outgoingSAL.vi to add the following SAL events:
            cellTemperatureHiWarning (Done)
            detailedState (Done)
            tcpIpConnected (Done)
            hardpointList (Done)
            forceBalanceSystemStatus (Done)
            inclinationTelemetrySource (Done)
            temperatureOffset (Done)

            ttsai Te-Wei Tsai added a comment - - edited Updated the m2ms_outgoingSAL.vi to add the following SAL events: cellTemperatureHiWarning (Done) detailedState (Done) tcpIpConnected (Done) hardpointList (Done) forceBalanceSystemStatus (Done) inclinationTelemetrySource (Done) temperatureOffset (Done)
            ttsai Te-Wei Tsai added a comment -

            NetworkInterface.vi checked the TCP/IP connection, and calls the NetIF_Signal_cRIO_Connection.vi to record the status of cRIO connection. This information is written into the SystemConfigurationStatus.lvclass, which is hold by the SystemStatusesFG.vi. This will be checked by the SystemMonitor.check_cRIO.vi.

            MainStatusView.vi will subscribe the user event of "General System Status" and reflect the status to the indicator of "cRIO Connected".

            ttsai Te-Wei Tsai added a comment - NetworkInterface.vi checked the TCP/IP connection, and calls the NetIF_Signal_cRIO_Connection.vi to record the status of cRIO connection. This information is written into the SystemConfigurationStatus.lvclass , which is hold by the SystemStatusesFG.vi . This will be checked by the SystemMonitor.check_cRIO.vi . MainStatusView.vi will subscribe the user event of " General System Status " and reflect the status to the indicator of " cRIO Connected ".
            ttsai Te-Wei Tsai made changes -
            Attachment getTcpIpConnection.png [ 46700 ]
            ttsai Te-Wei Tsai added a comment - - edited

            I can get the TCP/IP connection by SAL as the following:

            I realized the M2 controller can not update the status of TCP/IP connection if it lost the connection in the running. Created the DM-28033 for this.

            ttsai Te-Wei Tsai added a comment - - edited I can get the TCP/IP connection by SAL as the following: I realized the M2 controller can not update the status of TCP/IP connection if it lost the connection in the running. Created the DM-28033 for this.
            ttsai Te-Wei Tsai made changes -
            Link This issue is triggering DM-28033 [ DM-28033 ]
            ttsai Te-Wei Tsai added a comment - - edited

            Context.loadConfigurationFile.vi will load the configuration (contains the hardpoint list) to the Model class (Model.processConfigurationDataTelemetry.vi). This will write the "Configuration File Data" into the ConfigurationFileFG.vi.

            NetworkInterface.vi will call the read function of ConfigurationFileFG.vi and write the information to cRIO. If the deployment is successful, NetworkInterface.vi will call the SendDisperseConfigurationDataCommand.vi. This will call the DisperseConfigurationData.lvclass and send as a command.

            The exec.vi of DisperseConfigurationData contains the Context.disperseConfigurationData.vi.

            Context.disperseConfigurationData.vi calls the Context.transferHardpoints.vi to put the hardpoint list to SystemConfigurationFG.vi (read the list from ConfigurationFileFG.vi).

            ttsai Te-Wei Tsai added a comment - - edited Context.loadConfigurationFile.vi will load the configuration (contains the hardpoint list) to the Model class ( Model.processConfigurationDataTelemetry.vi ). This will write the " Configuration File Data " into the ConfigurationFileFG.vi . NetworkInterface.vi will call the read function of ConfigurationFileFG.vi and write the information to cRIO. If the deployment is successful, NetworkInterface.vi will call the SendDisperseConfigurationDataCommand.vi . This will call the DisperseConfigurationData.lvclass and send as a command. The exec.vi of DisperseConfigurationData contains the Context.disperseConfigurationData.vi . Context.disperseConfigurationData.vi calls the Context.transferHardpoints.vi to put the hardpoint list to SystemConfigurationFG.vi (read the list from ConfigurationFileFG.vi ).
            ttsai Te-Wei Tsai made changes -
            Attachment probeOfHardpoint.png [ 46702 ]
            ttsai Te-Wei Tsai added a comment - - edited

            I could get the hardpoint list by probe:

            The following is the SAL information:

            Based on the source code, only the first element will be printed:

            if (status == SAL__OK) {
                  cout << "=== Event hardpointList received = " << endl;
             
                   cout << "    actuators : " << SALInstance.actuators[0] << endl;
                cout << "    priority : " << SALInstance.priority << endl;
             
                }
            

            The debug message is:

            === [putSample] MTM2::logevent_settingsApplied_430e1926 writing a message containing :
                revCode  : 430e1926
            Outgoing array MTM2_logevent_hardpointList actuators, size = 6
            Outgoing MTM2_logevent_hardpointList priority =  0
            Client 0 publish an event logevent_hardpointList
            

            ttsai Te-Wei Tsai added a comment - - edited I could get the hardpoint list by probe: The following is the SAL information: Based on the source code, only the first element will be printed: if (status == SAL__OK) { cout << "=== Event hardpointList received = " << endl;   cout << " actuators : " << SALInstance.actuators[0] << endl; cout << " priority : " << SALInstance.priority << endl;   } The debug message is: === [putSample] MTM2::logevent_settingsApplied_430e1926 writing a message containing : revCode : 430e1926 Outgoing array MTM2_logevent_hardpointList actuators, size = 6 Outgoing MTM2_logevent_hardpointList priority = 0 Client 0 publish an event logevent_hardpointList
            ttsai Te-Wei Tsai made changes -
            Attachment getHardpointListBySal.png [ 46703 ]
            ttsai Te-Wei Tsai added a comment - - edited

            For the cellTemperatureHiWarning event, based on M2 wish list.pdf , the formula is:

            Formula:
            D1 = (Exhaust1 - intake1)
            D2 = (exhaust2 - intake2)
            D= (D1+D2)/2

            The default value of D is 2 degC based on the LTS-162:

            3.1.3 M2 Assembly CellTemperatureHiWarning

            Specification: The M2 Assembly shall publish a CellTemperatureHiWarning. The controller will set this value to True if and only if the difference between the intake and exhaust air temperatures is more than a specified value.

            Parameters:
            cellTemperatureHiWarning = True | False (Enumeration).

            Discussion: The threshold for the temperature difference should have a default value of 2 degC, and is configurable by the user.

            Relates this ticket to LVV-18863.

            ttsai Te-Wei Tsai added a comment - - edited For the cellTemperatureHiWarning event, based on M2 wish list.pdf , the formula is: Formula: D1 = (Exhaust1 - intake1) D2 = (exhaust2 - intake2) D= (D1+D2)/2 The default value of D is 2 degC based on the LTS-162: 3.1.3 M2 Assembly CellTemperatureHiWarning Specification: The M2 Assembly shall publish a CellTemperatureHiWarning. The controller will set this value to True if and only if the difference between the intake and exhaust air temperatures is more than a specified value. Parameters: cellTemperatureHiWarning = True | False (Enumeration). Discussion: The threshold for the temperature difference should have a default value of 2 degC, and is configurable by the user. Relates this ticket to LVV-18863 .
            ttsai Te-Wei Tsai made changes -
            Attachment M2 wish list.pdf [ 46716 ]
            ttsai Te-Wei Tsai added a comment -

            Model.setCellTelemetry.vi calls the Model.checkCellTemperatures.vi to check the temperature.

            Model.checkCellTemperatures.vi calls the CellTemperatureMonitor.check_cell_temperature.vi to check the temperature values are in the range or not.

            ttsai Te-Wei Tsai added a comment - Model.setCellTelemetry.vi calls the Model.checkCellTemperatures.vi to check the temperature. Model.checkCellTemperatures.vi calls the CellTemperatureMonitor.check_cell_temperature.vi to check the temperature values are in the range or not.
            ttsai Te-Wei Tsai made changes -
            Attachment getTempHighSal.png [ 46718 ]
            Attachment getTempHigh.png [ 46719 ]
            ttsai Te-Wei Tsai added a comment -

            Get the high temperature warning as the following:

            ttsai Te-Wei Tsai added a comment - Get the high temperature warning as the following:
            ttsai Te-Wei Tsai added a comment -

            Click the button of "Enter Closed-Loop Control" will issue the SendSetUI_ModeCommandUI.vi with the Enum of "Closed loop". This SendSetUI_ModeCommandUI.vi will issue the SendSetUI_ModeCommand command. Follow the code and find the SendSetUI_ModeCOmmand.CreateAndSendCommandUI.vi is triggered. This function will trigger the SetUI_Mode command. The SetUI_Mode.exec.vi will call the Context.setUI_Mode.vi.

            State.lvclass has the abstract function: EnterCLControl.vi. ManualOpenLoopSubstate.lvclass realizes this function.
            DisabledState.Enable.vi should enter the closed-loop control as well.

            The above two functions will call the SystemController.SE_Set_CLC_Mode.vi with the enum of "closed loop". This function will call the SystemController.put_sequence_engine_command.vi can put the queued command to "Sequence Engine Queue".

            SystemController.get_sequence_engine_command.vi will dequeue the element of "Sequence Engine Queue".

            SystemController.SE_ExecuteNextStep.vi will call SystemController.get_sequence_engine_command.vi. This will queue the element of "Sequence Engine Command Queue".

            SequenceEngine.lvclass has a SequenceEngineMain.vi to run forever by SystemController.start_sequence_engine.vi.

            ttsai Te-Wei Tsai added a comment - Click the button of " Enter Closed-Loop Control " will issue the SendSetUI_ModeCommandUI.vi with the Enum of " Closed loop ". This SendSetUI_ModeCommandUI.vi will issue the SendSetUI_ModeCommand command. Follow the code and find the SendSetUI_ModeCOmmand.CreateAndSendCommandUI.vi is triggered. This function will trigger the SetUI_Mode command. The SetUI_Mode.exec.vi will call the Context.setUI_Mode.vi . State.lvclass has the abstract function: EnterCLControl.vi . ManualOpenLoopSubstate.lvclass realizes this function. DisabledState.Enable.vi should enter the closed-loop control as well. The above two functions will call the SystemController.SE_Set_CLC_Mode.vi with the enum of " closed loop ". This function will call the SystemController.put_sequence_engine_command.vi can put the queued command to " Sequence Engine Queue ". SystemController.get_sequence_engine_command.vi will dequeue the element of " Sequence Engine Queue ". SystemController.SE_ExecuteNextStep.vi will call SystemController.get_sequence_engine_command.vi . This will queue the element of " Sequence Engine Command Queue ". SequenceEngine.lvclass has a SequenceEngineMain.vi to run forever by SystemController.start_sequence_engine.vi .
            ttsai Te-Wei Tsai added a comment - - edited

            For the "temperatureOffset" SAL event, the following paragraph comes from M2 wish list.pdf:

            17. Clarify the physical locations of the ​temperature​ sensors (with testing).
            Move the temperature inversion matrix to configuration file, and switch columns as needed to match the ordering the temperature sensors in the GUI and telemetry.
            a. Need to be able to set the zero points (offset) for these temperature sensors.

            ttsai Te-Wei Tsai added a comment - - edited For the "temperatureOffset" SAL event, the following paragraph comes from  M2 wish list.pdf : 17. Clarify the physical locations of the ​temperature​ sensors (with testing). Move the temperature inversion matrix to configuration file, and switch columns as needed to match the ordering the temperature sensors in the GUI and telemetry. a. Need to be able to set the zero points (offset) for these temperature sensors.
            ttsai Te-Wei Tsai added a comment - - edited

            ConfigurationFileData.temperatureDistributionMatrix.vi hard-coded the 4x12 temperature inversion matrix.

            Put the temperature distribution matrix (or temperature inversion matrix) into tempDistMat.json.

            ttsai Te-Wei Tsai added a comment - - edited ConfigurationFileData.temperatureDistributionMatrix.vi hard-coded the 4x12 temperature inversion matrix. Put the temperature distribution matrix (or temperature inversion matrix) into  tempDistMat.json .
            ttsai Te-Wei Tsai made changes -
            Attachment getSalDetailedState.png [ 46749 ]
            Attachment getSalInclinationTelemetrySource.png [ 46750 ]
            Attachment getSalTempOffset.png [ 46751 ]
            ttsai Te-Wei Tsai added a comment -

            Get the following SAL event:


            ttsai Te-Wei Tsai added a comment - Get the following SAL event:
            ttsai Te-Wei Tsai added a comment -

            Finished the detailed state that links to LVV-18861.

            ttsai Te-Wei Tsai added a comment - Finished the detailed state that links to  LVV-18861 .
            ttsai Te-Wei Tsai made changes -
            Link This issue is triggering DM-28132 [ DM-28132 ]
            ttsai Te-Wei Tsai added a comment -

            Created the DM-27584 to fix the bug of temperature offset.

            ttsai Te-Wei Tsai added a comment - Created the DM-27584 to fix the bug of temperature offset.
            ttsai Te-Wei Tsai added a comment -

            Please help to review the PR:
            https://github.com/lsst-ts/ts_mtm2/pull/26

            Thanks!

            ttsai Te-Wei Tsai added a comment - Please help to review the PR: https://github.com/lsst-ts/ts_mtm2/pull/26 Thanks!
            ttsai Te-Wei Tsai made changes -
            Reviewers Petr Kubanek [ pkubanek ]
            Status In Progress [ 3 ] In Review [ 10004 ]
            pkubanek Petr Kubanek added a comment -

            Looks good, seems to work as expected.

            pkubanek Petr Kubanek added a comment - Looks good, seems to work as expected.
            pkubanek Petr Kubanek made changes -
            Status In Review [ 10004 ] Reviewed [ 10101 ]
            ttsai Te-Wei Tsai made changes -
            Resolution Done [ 10000 ]
            Status Reviewed [ 10101 ] Done [ 10002 ]
            ttsai Te-Wei Tsai made changes -
            Link This issue is triggering DM-28167 [ DM-28167 ]
            ttsai Te-Wei Tsai made changes -
            Link This issue relates to LVV-18861 [ LVV-18861 ]
            ttsai Te-Wei Tsai made changes -
            Link This issue relates to LVV-18863 [ LVV-18863 ]

            People

              ttsai Te-Wei Tsai
              ttsai Te-Wei Tsai
              Petr Kubanek
              Petr Kubanek, Te-Wei Tsai
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Jenkins

                  No builds found.