This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DRV2605LEVM-MD: Increasing the amplitude

Part Number: DRV2605LEVM-MD
Other Parts Discussed in Thread: DRV2605L

Hi E2E,

Good day.

Our customer is using a DRV2605LEVM-MD in order to run multiple lra motors and controlling the motors through Arduino Uno. The problem they have been encountering is about the amplitude of the motors, the customer can feel them vibrating but would like to increase the amplitude. Attached is the Arduino code.

Code.txt
#include //SparkFun Haptic Motor Driver Library 
#include 
#include //I2C library 

SFE_HMD_DRV2605L HMD; //Create haptic motor driver object 
DRV2605LEVM_MD multi_drv; //Create multi motor driver object 

uint8_t status_reg_result;
uint8_t control3_reg_result;

uint8_t reg_data = 0xA8; // Hex code for choosing unsigned int for RTP
//uint8_t reg_data = 0xA0; // Hex code for choosing signed int for RTP

uint8_t motor_speed = 0x00;

// Motor selection typdef
motor_sel motor_no = NO_MOTOR;

// Communication variables
int i = 0;
String input_cmd;
int incomingByte = 0; // for incoming serial data

void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
HMD.begin();

// Autocalibrate the motors at the start
Serial.println("Autocalibrating the motor drivers...");
// Start autocalibration by setting the GO bit to 1
HMD.Mode(0x07);
status_reg_result = HMD.readDRV2605L(STATUS_REG);
Serial.print("Autocalibration done! With the status code of ");
Serial.println(status_reg_result, HEX);

// Initialize the motor drivers for RTP mode
Serial.println("Intializing the motor drivers...");
// HMD.Mode(0); // Internal trigger input mode -- Must use the GO() function to trigger playback.
HMD.Mode(0x05); // RTP Mode -- Must use the RTP function to trigger amplitude.
HMD.MotorSelect(0xB6); // LRA motor, 4x Braking, Medium loop gain, 1.365x back EMF gain
HMD.Library(6); //1-5 & 7 for ERM motors, 6 for LRA motors 

//multi_drv.initialize_motors(motor_no);
//status_reg_result = HMD.readDRV2605L(STATUS_REG);
//Serial.print("Motor drivers initialized! With the status code of :");
//Serial.println(status_reg_result, HEX);

// Set the RTP data format type to unsigned int
control3_reg_result = HMD.readDRV2605L(CONTROL3_REG);
Serial.print("Control3 Reg :");
Serial.println(control3_reg_result, HEX);

HMD.writeDRV2605L(CONTROL3_REG, reg_data);
Serial.println("Setting the DATA_FORMAT_RTP to unsigned...");
control3_reg_result = HMD.readDRV2605L(CONTROL3_REG);
Serial.print("Control3 Reg :");
Serial.println(control3_reg_result, HEX);


Serial.println("Setting the CONTROL2_REG to unidirectional...");
HMD.writeDRV2605L(CONTROL2_REG, 0x7F);

Serial.println("Listening the MATLAB commands...");
}

void loop() {

// CHECK FOR COMMUNICATION
if (Serial.available() > 0) {
// read the incoming byte:
input_cmd = Serial.readString();
//Serial.print(input_cmd);
Serial.flush();

// CHECK FOR MOTOR NO
if (input_cmd == "NO_MOTOR\r\n") {
motor_no = NO_MOTOR;
motor_speed = 0;
multi_drv.initialize_motors(motor_no);
Serial.println("No motor is selected");
}
else if(input_cmd == "MOTOR_1\r\n") {
motor_no = MOTOR_1;
motor_speed = 255;
multi_drv.initialize_motors(motor_no);
Serial.println("Motor 1 is selected");
}
else if(input_cmd == "MOTOR_2\r\n") {
motor_no = MOTOR_2;
motor_speed = 255;
multi_drv.initialize_motors(motor_no);
Serial.println("Motor 2 is selected");
}
else if(input_cmd == "MOTOR_3\r\n") {
motor_no = MOTOR_3;
motor_speed = 255;
multi_drv.initialize_motors(motor_no);
Serial.println("Motor 3 is selected");
}
else if(input_cmd == "MOTOR_4\r\n") {
motor_no = MOTOR_4;
motor_speed = 255;
multi_drv.initialize_motors(motor_no);
Serial.println("Motor 4 is selected");
}
else if(input_cmd == "MOTOR_1_2\r\n") {
motor_no = MOTOR_1_2;
motor_speed = 255;
multi_drv.initialize_motors(motor_no);
Serial.println("Motor 1 and 2 are selected");
}
else if(input_cmd == "MOTOR_1_3\r\n") {
motor_no = MOTOR_1_3;
motor_speed = 255;
multi_drv.initialize_motors(motor_no);
Serial.println("Motor 1 and 3 are selected");
}
else if(input_cmd == "MOTOR_1_4\r\n") {
motor_no = MOTOR_1_4;
motor_speed = 255;
multi_drv.initialize_motors(motor_no);
Serial.println("Motor 1 and 4 are selected");
}
else if(input_cmd == "MOTOR_2_3\r\n") {
motor_no = MOTOR_2_3;
motor_speed = 255;
multi_drv.initialize_motors(motor_no);
Serial.println("Motor 2 and 3 are selected");
}
else if(input_cmd == "MOTOR_2_4\r\n") {
motor_no = MOTOR_2_4;
motor_speed = 255;
multi_drv.initialize_motors(motor_no);
Serial.println("Motor 2 and 4 are selected");
}
else if(input_cmd == "MOTOR_3_4\r\n") {
motor_no = MOTOR_3_4;
motor_speed = 255;
multi_drv.initialize_motors(motor_no);
Serial.println("Motor 3 and 4 are selected");
}
else if(input_cmd == "MOTOR_1_2_3_4\r\n") {
motor_no = MOTOR_1_2_3_4;
motor_speed = 255;
multi_drv.initialize_motors(motor_no);
Serial.println("Motor 1 , 2 ,3 and 4 are selected");
}
}


HMD.RTP(motor_speed);
delay(20);
}


Thank you in advance for your help.


Regards,
Carlo

  • Hello,

    So is the customer trying to run multiple LRAs of the same resonant frequency all with only one DRV2605L chip?

    A simple schematic could help me grasp the concept.

    Best Regards,

    Carson

    Low Power Audio Applications

  • As well as is this being intended to run in open or closed loop operation?

  • Hello Carson,

    Here is the response I received from our customer:

    No. I am using the DRV2605LEVM-MD(module that can run 8 haptic motors at the same time) .In another word, all the 8 drivers are in one module.

    The issue here is to increase the amplitude

    Let me know if you need other details.


    Regards,
    Carlo

  • If he is using RTP mode like the code implies than you would set the register 0x02 of the DRV2605L device

  • Hello Carson,

    According to our customer, even with the RTp mode with register (0×02), it's still the same.  The vibration is not that perceivable.


    Regards,
    Carlo

  • Could you clarify if this is being used in open or closed loop?

  • Hello Carson,

    It's closed-loop and unidirectional.

    Regards,
    Carlo

  • Hi Carlo,

    Is the customer trying to drive LRA or ERM? 

    If LRA could you have him read this reg and see if it matches resonant freq of the LRA he is using

     

    If ERM try switching to open loop 

    And also check status regs for irregularities.

  • Hello Carson,

    The customer is using  4 LRA. Let me know if you need other details.

    Regards,
    Carlo

  • Hello,

    Yes could you get him to read the LRA Resonance Period Register and see if it matches the LRA frequency of the LRAs he is trying to run.

    Best Regards,

    Carson

  • Hi Carson,

    Unfortunately, the frequency doesn't match. The frequency of their motors is 235 Hz. According to the customer, even with manipulation, they are still far from it. Also, which one do you advise for them, the open-loop or the closed-loop?

    Their only concern now is to increase the amplitude. Please advise if there's an easier way, to achieve it. They are using the auto resonance mode and RTp. The value they’re getting is between 40 to 140. Please see below.

     

    Regards,
    Carlo

  • Hello Carlo,

    Yes ensure they are using closed loop LRA Mode. LRA's have resonant frequency that need to be matched by device otherwise if they output waveform with a frequency that is totally off, barely any vibration will be felt.

    https://www.ti.com/lit/an/sloa209/sloa209.pdf?ts=1629902911568&ref_url=https%253A%252F%252Fwww.ti.com%252Fproduct%252FDRV2605

    This app note might help the point I am trying to make.

    Best Regards,

    Carson

  • Hello Carson,

    Our customer is now trying to work on the closed-loop mode. Which Register is for activating the vibration for lra in closed loop? It was just open loop and auto resonance are mentioned.
    Regards,
    Carlo

  • You can either put into RTP mode and use RTP input for a steady vibration or go through process of using waveform sequencer with the onboard library of haptic waveforms.

    Details of that process start on page 33 of datasheet for the device.

    https://www.ti.com/lit/ds/symlink/drv2605l.pdf?ts=1630103393454&ref_url=https%253A%252F%252Fwww.ti.com%252Fproduct%252FDRV2605L

    Best Regards,

    Carson

  • Hello Carson,

    Our customer needs your further help on this, please see below:

    We are already using the RTP mode through RTP_INPUT register (0x02) with the DATA_FORMAT_RTP register of Control3 Register (0x1D) is set to Unsigned and the BIDIR_INPUT register of Control2 Register(0x1C) is set to Unidirectional.

    We are using the autocalibration at the start of the program. When reading he LRA frequency from the LRA_PERIOD register of LRA Resonance-Register (0x22) we are getting values between 50 and 60. But we are also getting 0 sometimes.

    According to page 48 of the DRV2605L_LRA manual, a reading of 50 means:
    LRA_Period = 50 * 98,46 * 10^-6 seconds = 0.004923 seconds.
    LRA_Period = 60 * 98,46 * 10^-6 seconds = 0.005907 seconds.
    From that we calculate the frequency as:
    1 / LRA_Period = 1 / 0.004923 = 203.12 Hz
    1 / LRA_Period = 1 / 0.005907 = 169.27 Hz

    According to the datasheet, the natural frequency of our LRA motor is 235 Hz which means that we need a LRA resonance with period 43 microseconds. But we cannot change this period using the LRA_PERIOD register of LRA Resonance-Register (0x22). We try to set it to 43 at each iteration of our program loop bu we are still getting values between 50 to 60 and the vibration is always very weak. What could we do about it?

    And also during the autocalibration at the start should we set the values for RATED_VOLTAGE and OD_CLAMP? If yes, how do we find the values that we need to use in the calculations in the page 29?.

    Attached are the Trial codes. Trial codes.zip

    Unfortunately, the vibration is still low. (The aim also is to create a Gui through matlab where we be able to control the whole system)

    Thank you for the assistance.

    Regards,
    Carlo

  • Hi Carlo,

    So this is all being done in closed-loop mode?

    If it is you switch back to open loop which would then allow you to change LRA_PERIOD to what you desire to see if that improves performance

    Also make sure device is set to LRA mode

    Doesn't matter when you set RATED_VOLTAGE or OD_CLAMP, and the auto-cal settings should be fine that is not source of problem

  • and if you do switch back to open-loop to be able to change LPA_PERIOD make sure to change other register accordingly to work in open loop.

  • Hello Carson,

    Our customer was able to increase the amplitude. However, as another concern, every time, they start the setup, they always have errors until they try the code several times. It seems that it translates that the autocalibration is not saved. Any solution concerning that?

    Also, they would like to know how to change the frequency? The maximum amplitude they're getting is between 122-128.  After that, the strength is paradoxically decreasing.

    Regards,
    Carlo

  • When you say start-up do you mean from stand-by or from being shut down?

    Also you change frequency in open loop by writing to the period register.

    Carson

  • Hi Carson,

    Our customers mean sometimes they are getting FF from the status register after the calibration. Sometimes it's okay and sometimes it's not. When it's FF, motors are not vibrating .

    Concerning the frequency, they’ve tried that before but still, there is no change.

    Regards,
    Carlo

  • Hello Carlo,

    I might be missing something but what does FF represent?

    Carson

  • Hi Carson,

    According to our customer, this is when everything is normal, the selected motors are vibrating.

    They’re getting FF in the control register 3 and conf.reg as well sometimes. In that case, the motors are not vibrating but they can see on the DRV2605LEVM-MD that the motors are selected.

    This problem often happens during trials and experiments or when they reset the Arduino or the module for a second it stops working. They have to wait sometimes 1 hour or more before everything comes back to normal.

    Does the auto-calibration have to be saved?

    Regards,
    Carlo

  • Either registers being set by auto-calibration needs to be saved onto arduino memory and restored onto DRV devices on power on  or do auto-calibration every time

    Also it is register 0x20 not 0x22 to change frequency open-loop sorry for confusion before.

    If control register 3 ix 0xFF that means LRA is set for open loop and frequency must be adjusted via reg 0x20

    but also make sure you are selecting for analog or PWM as you would like for bit 1 in that reg Best Regards, also dont know reg you are talking about when you say conf.reg

    Based on our whole discussion there is problems with Arduino communication onto board, is there a way to either get full register dump of a DRV device or see the I2C data actually be sent out because I cannot understand the posted script 

    Carson

  • Hello Carson,

    According to our customer, there is no 0x20 register. There is 0x1E (Control4 Register) and 0x21 (Voltage Monitor Register) but nothing in between.

    Regards,
    Carlo

  • Hello,

    By what means is the board being interfaced so i may try to replicate?

  • Hi Carson,

    According to our customer, they're using an  Arduino Uno that is connected to the module. They're trying to run 4 motor at the same time. Two resistors(R61 and R62, are 0 ohm resistors which connect the SDA and SCL of the MSPP430F5510IRGC microcontroller to TCA9548APW and TCA9554PWR ICs.) in the  module have been removed in order to disconnect the MSPP430F5510IRGC microcontroller and be able to control the DRV2605LDGS motor drivers using Arduino (figure 15 at page 17 of the user's guide).
    They're also building a GUI in Matlab where everything will be controlled. The arduino files are the trials they're using.
    Regards,
    Carlo
  • So to verify, even when he puts device into open-loop mode there is no register 0x20 or Ox1F for him to access or read from?

  • Hi Carson,

    Based from our customer, they are not defined in the datasheet so they never try it.


    Regards,
    Carlo

  • In the DRV2605L there is definitely a 0x20 defined in datasheet.

    www.ti.com/.../drv2605l.pdf