DRV2605 timing info

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
aleemh
 
Posts: 3
Joined: Fri Jan 27, 2017 10:48 pm

DRV2605 timing info

Post by aleemh »

hi

beginner in arduino here. I am using the DRV2605 with an ERM motor. I wanted to know if there is any way to find out the exact duration of the vibration for each of the styles provided in their table in 11.2. For example, what is the timespan of #14, a strong buzz. Is there any way to measure this myself if its not listed?

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: DRV2605 timing info

Post by adafruit_support_mike »

The datasheet doesn't provide any information about how long the effects last.

The easiest way to measure the timing would be with a logic analyzer or an oscilloscope, but those are pricey. You can probably get a good approximation by connecting a 100k resistor between one side of the motor and a digital pin configured as an input, and doing digitalRead()s every millisecond. That should show the general pattern of activity.

User avatar
aleemh
 
Posts: 3
Joined: Fri Jan 27, 2017 10:48 pm

Re: DRV2605 timing info

Post by aleemh »

Thank you for the suggestion, I will try that. However, do you recommend any alternative where I can myself feed the timing into the vibration motor? I guess it would have to be without the driver, but I would need to be able to recreate some mechanisms like sharp vs dull buzz, not sure how to do that.

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: DRV2605 timing info

Post by adafruit_support_mike »

The DRV2605 lets you set the output level directly. The .setRealtimeValue() function takes vaues from 0 to 255.

User avatar
aleemh
 
Posts: 3
Joined: Fri Jan 27, 2017 10:48 pm

Re: DRV2605 timing info

Post by aleemh »

Hi Mike.

I'm sorry it took a while to respond, I got dragged away from the project.

I have been playing around with the 'realtime' demo, however, I am confused about how it is implemented. For example the bit values are not given directly as 0-255 as you suggested but through hex. Is there a simpler way around this? Also, I see you cannot simply give value of intensity, but need to indicate in an array the duration of onset intensity and then offset intensity. How can one do this without hex? How does .setRealTimeValue() know what is the duration values etc? It would be helpful to have a guide to this function!

for example in

Code: Select all

void loop() {

  if (rtp_index < sizeof(rtp)/sizeof(rtp[0])) {
    drv.setRealtimeValue(rtp[rtp_index]);
    rtp_index++;
    delay(rtp[rtp_index]);
    rtp_index++;
  } else {
    drv.setRealtimeValue(0x00);
    delay(1000);
    rtp_index = 0;
  }
I am not sure where the values for duration are getting fed in.

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: DRV2605 timing info

Post by adafruit_support_mike »

Neither the microcontroller nor the DRV2605 know what decimal or hexidecimal numbers are. They only see patterns of bit. Number formats are strictly a convenience feature for humans reading and writing the source code. You can use whatever notation you prefer.

The point of analog control is that the DRV2605 adjusts its output to whatever value you send it, when you send it. To control timing, you control how often your code sends the DRV2605 new values.

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Arduino products from Adafruit”