Documentation

Sensor Agnostic Module for Digiducer Accelerometer

roto_digiducer.framework for iOS®/iPadOS®


  • Created: 7 Feb, 2021
  • Update: 10 Oct, 2021

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


Description

roto_digiducer.framework is an iOS®/iPadOS® library that allows communication with the Digiducer USB Digital single-axis acceletometer. The framework provides simple commands to connect, calibrate, collect and post-process the vibration data.


Installation

Follow the steps below to install the roto-digiducer framework

  1. Drag and drop the roto_digiducer.framework file into your Xcode project
  2. Select the "Embed & Sign" option in the Framworks, Libraries and Embedded Content menu

Configuring your project

  1. Import the roto_digiducer.framework to your project class
  2. 
    #import "ViewController.h"
    #import "roto_digiducer/digi_collect.h"
    
    @interface ViewController ()
    @end
    
    @implementation ViewController
    
    - (void)viewDidLoad {
       [super viewDidLoad];
    }
    

Connecting to the Sensor

  1. Create an action to start reading the sensor's data using the startSensorInput method.
  2. 
    ...
    #import "roto_digiducer/digi_collect.h"
    
    ...
    - (IBAction) startSensor {
        [digi_collect startSensorInput];
    }
    ...
     
  3. Check the sensor's ID by using the command: getDeviceId
  4. 
    ...
    - (void) deviceId {
        NSLog(@"deviceID: %@", [digi_collect getDeviceId]);
    }
    ...
        

    Below is a sample of a console log response:

  5. Check the sensor's calibration value by using the command: getDeviceCalibration
  6. 
    ...
    - (void) calibrationValue {
        NSLog(@"calibration value: %.2f mV/G", [digi_collect getDeviceCalibration]);
    }
    ...
    

    Below is a sample calibration value received from the sensor in the console log response:


Collecting Data

  1. Request the data collection with the number of samples and sampling rate using the collectDataWithSamplingRate:(int) withNumberOfSamples:(int) method.
  2. 
    ...
    //Sampling Rate Selection:
    //
    //for 48kHz audio devices:
    //samplingRateCode:0 -> SamplingRate = 48000
    //samplingRateCode:1 -> SamplingRate = 24000
    //samplingRateCode:2 -> SamplingRate = 12000
    //samplingRateCode:3 -> SamplingRate = 6000
    //
    //for 44.1kHz audio devices:
    //samplingRateCode:0 -> SamplingRate = 44100
    //samplingRateCode:1 -> SamplingRate = 22050
    //samplingRateCode:2 -> SamplingRate = 11025
    //samplingRateCode:3 -> SamplingRate = 5512.5
    //
    //Number of Samples Selection
    //numberSamplesCode:0 -> NumberOfSamples = 4096
    //numberSamplesCode:1 -> NumberOfSamples = 8192
    //numberSamplesCode:2 -> NumberOfSamples = 16384
    //numberSamplesCode:3 -> NumberOfSamples = 32768
    
    - (void)measure {
        [digi_collect collectDataWithSamplingRate:0 withNumberOfSamples:0];
    }
    ...
             
  3. To request the full raw data array, use getsignalRawData method as follow:
  4. 
    ...
    - (void)getRawDataArray {
        NSLog(@"%@", [digi_collect getsignalRawData]);
    }
    ...
                        

    Below is a sample of a console log response:

  5. For this sample we will use the getOverallAccelerationRms method to calculate the acceleration overall rms in G's. there are other similar commands to request the velocity, displacement, etc
  6. 
    ...
    - (void)getOverallAccelerationRms {
        NSLog(@"acceleration overall value: %.4f G-rms", [digi_collect getOverallAccelerationRms]);
    }
    ...
                  

    Below is a sample of a console log response:


Combine this framework with vibEngine.framework to perform signal post-processing and with the vibeFDaD.framework to analize the machine condition. Third party frameworks can also be used to plot and enhance the users interface.


Changelog

See what's new added, changed, fixed, improved or updated in the latest versions.

Version 1.01 (10 Oct, 2021)

  • Fixed Issue with iOS®15 audio activation
  • Updated Optimized for iOS®15


Version 1.0 (7 Feb, 2021)

Initial Release