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

Set up new LabJack devices on TMA and TEA in ESS

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Story Points:
      1
    • Sprint:
      TSSW Sprint - Feb 27 - Mar 13
    • Team:
      Telescope and Site
    • Urgent?:
      No

      Description

      This ticket is for tracking my time spent on setting up new LabJack devices on TMA and TEA in ESS.

        Attachments

        1. image001.jpg
          image001.jpg
          21 kB
        2. image002.jpg
          image002.jpg
          17 kB
        3. image003.jpg
          image003.jpg
          16 kB
        4. image004.jpg
          image004.jpg
          15 kB

          Issue Links

            Activity

            Hide
            wvreeven Wouter van Reeven added a comment - - edited

            A successful connection was made to the TEA accelerometers using python. Data was read from all accelerometers as well.

            from labjack import ljm
             
            min_frequency = 0
            max_frequency = 100
            num_frequencies = 200
            num_frequencies_from_0 = round(
                num_frequencies * max_frequency / (max_frequency - min_frequency)
            )
            num_samples = num_frequencies_from_0 * 2 - 2
            modbus_addresses = [2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24]
            input_channel_names = [f"AIN{addr//2}" for addr in modbus_addresses]
            desired_sampling_frequency = 2 * max_frequency
             
            print("Creating handle.")
            handle = ljm.openS("T7", "TCP", "139.229.178.63")
             
            print("Reading names.")
            values = ljm.eReadNames(handle, len(input_channel_names), input_channel_names)
            print(values)
             
            print("Starting stream.")
            actual_sampling_frequency = ljm.eStreamStart(
                handle,
                num_samples,
                len(modbus_addresses),
                modbus_addresses,
                desired_sampling_frequency,
            )
            desired_sampling_frequency = 2 * max_frequency
            print(f"{desired_sampling_frequency=}, {actual_sampling_frequency=}")
             
            print("Reading stream.")
            data, log1, log2 = ljm.eStreamRead(handle)
            print(f"{data}, {log1}, {log2}")
             
            print("Disconnecting.")
            ljm.eStreamStop(handle)
            

            Now I need to find out how to configure this new LabJack device, notably how to get the offsets and scales.

            Show
            wvreeven Wouter van Reeven added a comment - - edited A successful connection was made to the TEA accelerometers using python. Data was read from all accelerometers as well. from labjack import ljm   min_frequency = 0 max_frequency = 100 num_frequencies = 200 num_frequencies_from_0 = round( num_frequencies * max_frequency / (max_frequency - min_frequency) ) num_samples = num_frequencies_from_0 * 2 - 2 modbus_addresses = [ 2 , 4 , 6 , 8 , 10 , 12 , 14 , 16 , 18 , 20 , 22 , 24 ] input_channel_names = [f "AIN{addr//2}" for addr in modbus_addresses] desired_sampling_frequency = 2 * max_frequency   print( "Creating handle." ) handle = ljm.openS( "T7" , "TCP" , "139.229.178.63" )   print( "Reading names." ) values = ljm.eReadNames(handle, len(input_channel_names), input_channel_names) print(values)   print( "Starting stream." ) actual_sampling_frequency = ljm.eStreamStart( handle, num_samples, len(modbus_addresses), modbus_addresses, desired_sampling_frequency, ) desired_sampling_frequency = 2 * max_frequency print(f "{desired_sampling_frequency=}, {actual_sampling_frequency=}" )   print( "Reading stream." ) data, log1, log2 = ljm.eStreamRead(handle) print(f "{data}, {log1}, {log2}" )   print( "Disconnecting." ) ljm.eStreamStop(handle) Now I need to find out how to configure this new LabJack device, notably how to get the offsets and scales.
            Hide
            rowen Russell Owen added a comment - - edited

            See SUMMIT-6894 for information on where things are mounted.

            I have attached the calibration certificates for the 4 accelerometers:

            • -X Side (Serial number A435784)
            • +X Side (Serial number A435781)
            • Spider Spindle (Serial number A435788)
            • M2 (Serial number A435804)

            The pin assignments are as follows, according to SUMMIT-7240:

            A0 to A2 - Leg -x sensor
            A3 to A5 - Leg +x sensor
            A6 to A8 - TEA sensor
            A9 to A11 - M2 surrogate sensor

            Show
            rowen Russell Owen added a comment - - edited See SUMMIT-6894 for information on where things are mounted. I have attached the calibration certificates for the 4 accelerometers: -X Side (Serial number A435784) +X Side (Serial number A435781) Spider Spindle (Serial number A435788) M2 (Serial number A435804) The pin assignments are as follows, according to SUMMIT-7240: A0 to A2 - Leg -x sensor A3 to A5 - Leg +x sensor A6 to A8 - TEA sensor A9 to A11 - M2 surrogate sensor
            Hide
            rowen Russell Owen added a comment -

            I decided it was safest to use a new ESS instance to read this data (salIndex=104) because the data is read at about 200 Hz and it's 12 numbers per read (3 channels from 4 accelerometers).

            I also added a new scripts directory containing a script to convert accelerometer calibration data to configuration, and saved the data for these new M2 accelerometers.

            Pull request: https://github.com/lsst-ts/ts_config_ocs/pull/157

            Show
            rowen Russell Owen added a comment - I decided it was safest to use a new ESS instance to read this data (salIndex=104) because the data is read at about 200 Hz and it's 12 numbers per read (3 channels from 4 accelerometers). I also added a new scripts directory containing a script to convert accelerometer calibration data to configuration, and saved the data for these new M2 accelerometers. Pull request: https://github.com/lsst-ts/ts_config_ocs/pull/157
            Hide
            wvreeven Wouter van Reeven added a comment -

            I approved the ts_config_ocs PR on GitHub.

            Show
            wvreeven Wouter van Reeven added a comment - I approved the ts_config_ocs PR on GitHub.
            Hide
            rowen Russell Owen added a comment -

            We have decided to run the code with a tag on the ticket before merging, to make sure it works.

            Show
            rowen Russell Owen added a comment - We have decided to run the code with a tag on the ticket before merging, to make sure it works.
            Hide
            rowen Russell Owen added a comment -

            Reviewed on github

            Show
            rowen Russell Owen added a comment - Reviewed on github
            Hide
            rowen Russell Owen added a comment -

            Tested and merged

            Show
            rowen Russell Owen added a comment - Tested and merged

              People

              Assignee:
              rowen Russell Owen
              Reporter:
              wvreeven Wouter van Reeven
              Reviewers:
              Wouter van Reeven
              Watchers:
              Russell Owen, Wouter van Reeven
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins

                  No builds found.