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.

DRV2605L: Creating continual vibration over I2C

Part Number: DRV2605L
Other Parts Discussed in Thread: DRV2605, , DRV2625

Hi,

I am controlling a DRV2605 Haptic Controller over I2C interface to drive an ERM motor. I can activate a vibration but I would like to be able to have it vibrate until I tell it to stop. I have been attempting to use the effect library and then activating and stopping by changing the GO bit. Effect 47 (buzz-100%) only does a very brief buzz, Effect 118 (Long Buzz for programatic stopping) will go for a while longer and wlil also stop once I send a 0 to the Stop command, however, it will also stop itself after a few seconds. Is there an effect that I can activate and will keep going as long as I want until I clear the GO bit? Or alternatively is there a way I can achieve this without using the effect library?

Any help is greatly apprecitate

  • Hello,

    For a long vibration, you should use the Real-Time Playback (RTP) mode. You can control with the TRIG pin or the GO bit depending on the trigger mode. There is not a library effect that will play continuously.
  • Thank you for your feedback

    I have tried to use the Real time mode of I2C, however, I am having some issues.

    I write a value of 0 to register 0x02 (for 0 Amplitude) and then write value of 5 to register 0x02 (to turn on real time waveform). However, it still drives the amplitude at full. Am I missing something? My understanding is when I turn on Real time Feedback it will just drive whatever amplitude is in register 0x02.

    Regards,

    Benjamin

  • Hey Benjamin,

    You are correct, when in RTP (Real-Time playback) mode, then the DRV2605L drives the actuator continuously with the amplitude specified in the RTP_INPUT[7:0] bit in register 0x02. However, it makes a difference whether you are in open loop or closed loop mode. This is outlined in section 8.5.8 of the datasheet.

    If you are operating in open loop mode, then you should check whether DATA_FORMAT_RTP is 0 or 1, because it will determine whether the actuator gets 0V or -OD_CLAMP[7:0] when register 0x02 is set to 0. It may be the case that the ERM is being driven in the opposite direction. 

    Generally, the actuator is stopped by removing the DRV2605L from RTP mode either by the TRIG pin or the GO bit rather than setting the amplitude to 0V. (EDIT - do not use GO bit for RTP mode, but instead adjust 0x02 for the amplitude)

  • Thank you for your further clarification.

    I have done the following Set Register 1D to A8 - To enable open loop operation with an unsigned data and keep the NG threshold as data.

    Next as soon as I write a value to register 0x02 it turns on straight away, before I even activate the mode or turn on the go bit. Why is this so, shouldn't I have to first set the mode to RTP by writing a value of 0x05 to register 0x01 and then turning on and off the feedback by turning on and off the go bit within the register 0x0C?

    Also even when it does vibrate, it doesn't match up with the data you discussed that is contained in the data sheet.

    Firstly for when I set the register 0x1D to a value of 0xA8 to enable open loop unsigned data

    • When I set register 0x02 to a value of 0x00 it vibrates
    • When I set register 0x02 to a value of 0x71 it doesn't vibrate
    • When I set register 0x02 to a value of 0xFF it vibrates again.
    • When I set register 0x02 to a value of 0x81 it doesn't vibrate

    I have also tried it with setting the register 0x1D to a value of A0 (open loop unsigned). I get the following Results

    • Setting register 0x02 to a value of 0 doesn't vibrate
    • Setting register 0x02 to a value of 0x7F does vibrate
    • Setting register 0x02 to a value of 0xFF it doesn't vibrate
    • Setting register 0x02 to a value of 0x81 it does vibrate

    Do you have any idea why it I might be running into these issues? Is there another step that I have missed?

    Regards, Benjamin

  • Hey Benjamin,

    It is odd that writing data to 0x02 creates an output when the device is not in RTP mode. Before writing to 0x02, can you first read 0x01 to see what mode it is in?

    When register 0x1D has a value of 0xA8, that means DATA_FORMAT_RTP is 1 so the data for RTP mode is unsigned. What is your OD_CLAMP[7:0] value? Lets assume its the default, or 0x8C, which corresponds to an output voltage of about 3V at the maximum value. 

    • When I set register 0x02 to a value of 0x00 it vibrates
      • 0x00 corresponds to -100% of OD_CLAMP so it should be -3V on the output. A negative voltage will cause the ERM to spin in the opposite direct, so this vibration is expected

    • When I set register 0x02 to a value of 0x71 it doesn't vibrate
      • 0x71 corresponds to 113 in decimal, which is -11% of OD_CLAMP, which would be -0.33 V which is probably not enough to spin the ERM. 
    • When I set register 0x02 to a value of 0xFF it vibrates again.
      • 0xFF is 100% of OD_CLAMP so this would be 3V on the output
    • When I set register 0x02 to a value of 0x81 it doesn't vibrate
      • 0x81 is 1% of OD_CLAMP, which at 0.03V would not move the ERM

    When 0x1D is 0xA0, then DATA_FORMAT_RTP is 0 so the data is signed (2s complement).

    • Setting register 0x02 to a value of 0 doesn't vibrate
      • 0V is expected
    • Setting register 0x02 to a value of 0x7F does vibrate
      • 3V is expected
    • Setting register 0x02 to a value of 0xFF it doesn't vibrate
      • 0V is expected
    • Setting register 0x02 to a value of 0x81 it does vibrate
      • -3v is expected

    An easy way to look at what value creates what voltage on the output (percent of OD_CLAMP) is to download haptic control console and open up the console window for the DRV2605L. You do not need the EVM, there is a simulator version. Under work mode you can choose "Real Time Playback" and there is a slider bar that shows the corresponding decimal (or hex) value. It might also help to take a look at the register map under Tools. There is also a user guide available for haptic control console that is worth a look. 

    Hope that helps!

  • Hi Micah,

    That explanation clarified the register values for Signed and Unsigned - thank you.

    It appears I have it working now so that when it doesn't turn on until I change the mode to RTP.

    2 Final questions however,

    1) You previously stated that " Generally, the actuator is stopped by removing the DRV2605L from RTP mode either by the TRIG pin or the GO bit rather than setting the amplitude to 0V. " My TRIG bit is tied to ground, how do I activate/deactivate via the GO bit?

    2) Does driving it in real time through open loop provide any additional speed in start up time or braking time or does that only ok using the Closed loop operation. I am also confused about the calculation of OD_clamp and Rated voltage. I am using an ERM, so I need to use equations 2/4/6. However, what values should are determined from data sheet etc, and do you have an example of this calculation. This is the motor I am currently using (www.pololu.com/.../1637) which they do not provide very much information. Perhaps I need different vibration actuators to take advantage of this functionality?

    Thank you again for all your help, it has been very useful.
  • Hey Benjamin, 

    1) Upon reviewing the datasheet, I realized I was mistaken. The DRV2625 utilizes the GO bit to trigger RTP mode, depending on its settings, but the DRV2605L does not. Sorry about that. With the DRV2605L in RTP mode, you create an output by writing a nonzero value to 0x02, and stop the output by either writing the equivalent of 0 to 0x02 or by putting the device in low-power mode by setting the STANDBY bit, as outlined in 9.3.2.2 of the datasheet. 

    2) In open loop mode, there is no automatic overdrive or braking. You must used closed-loop mode to take advantage of these features. In open-loop mode, the output will be the peak voltage, which is whatever is set in OD_CLAMP (0x17), unless programmed otherwise like using RTP mode and setting the output to be half OD_CLAMP. So if using open loop mode, you only need to use equation 6 to find the correct value for the OD_CLAMP register.

    You could use your chosen ERM in either open loop or closed loop. From the webpage, I see its recommended operating voltage is 2.5 to 3.5 volts, so I would recommend setting OD_CLAMP to either 3 or 3.5 V. An easy wait to calculate this is to use the Haptic Control Console software and open up the DRV2605L console window:

    Or you could use equation 6 with the OD_CLAMP value in decimal.