Documentation

Sample Vibration Analyzer App for iOS®

using Rotovibes CBM Libraries


  • Created: 09 Jun, 2021

If you have any questions that are beyond the scope of this documentation file, Please feel free to email via info@rotovibes.com


Scope

Create a simple vibration analysis app for iOS® to communicate with a commercially available Bluetooth vibation sensor, collect data and evaluate the condition of the machine using ISO-20816 Standard. The app in this sample will be developed to work with the Sensor-Works BluVib P-V-T BLE 128-bit single-axis vibration sensor and using the following iOS® libraries by Rotovibes:

  • roto_bluvibpvt.framework
  • vibEngine.framework

  • Architecture

    Importing roto_bluvibpvt.framework and vibEngine.framework into the iOS project will provide with the required tools to perform all the functionalities required for this sample.

    The tasks performed by the libraries are as follows:

    1. The roto_bluvibpvt.framework provides the communication with the iOS CoreBluetooth library to communicate with the ble devices
    2. The scanBleSensor functionality will return all available sensors and the getListOfSensors command will return the peripheral ID's
    3. Programatically or by using the GUI a specific sensor can be selected and connected by using the connectToSensorId method
    4. getDataWithParameters will request data collection with a specific sampling rate and number of samples
    5. The vibEngine.framework's method overallVelocityFromAccTWF will process the data array from the previous output and perform the adequate post-processing functions including FFT, filtering, windowing and integration to return the overall values in velocity.
    6. Calling the iso10816conditionWithVelocityVibration method with the machine parameters and the previous overall values will return the machine condition in terms of the ISO-20816 specs

    Installation

    1. Import both roto_bluvibpvt.framework and vibEngine.framework into the iOS project

    2. Import the following libraries/headers in the Xcode class.
    3. 
      ...
      #import "roto_bluvibpvt/roto_bluvib.h"
      #import "vibEngine/vibePostProc.h"
      #import "vibEngine/vibeStds.h"
      ...
                  

    Code

    1. The following method will scan and list the available sensors id's:
    2. 
      ...
      - (void) scanBleSensor {
      [roto_bluvib scanBleSensor];
      NSLog(@"ListOfSensor: %@", [roto_bluvib getListOfSensor]);
      }
      ...
                  

      The output in the log console should display:


    3. Use the following commands to connect to one of the listed sensors and collect data:
    4. 
      ...
      - (void) connectToSensorId {
          [roto_bluvib connectToSensorId:[[roto_bluvib getListOfSensor] objectAtIndex:yourSelectedPeripheralId]];
      }
      - (void) getDataWithParamters {
          //in this sample we will use samplingRate:2 for 2,560 and numberOfSamples:2 for 2,048
          NSArray *rawDataArray = [roto_bluvib getDataWithSamplingRate:2 numberOfSamples:2];
      }
      ...
                 

    5. To post-process the collected data and get the final condition of the machine use:
    6. 
      ...
      - (void) calculateOverallVelocity {
          //use the previous output data array and data collection parameters to obtain the overall velocity in ips and rms
          double oveallVelocityValue = [vibePostProc overallVelocityFromAccTWF:rawDataArray withSamplingRate:2560 withNumberOfSamples:2048 unitsMetric:false isRms:true];
      }
      
      - (void) evaluateusingISO20816 {
          NSString *result = [vibeStds iso10816conditionWithVelocityVibration:oveallVelocityValue withMachineGroup:1 isFoundationFlexible:false isUnitsMetric:false];
          NSLog(@"machine condition: %@", result);
      ...
                 

      The output in the log console wiill display the machine condition evaluated using the ISO-20816 Std:


    In this sample case we are just calculating the velocity overall and evaluating it using a standard, but other results or plots can be generated by using other Rotovibes' or third party libraries.