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: Auto-calibration failed with ERM 310-118 (precision microdrive)

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

Hi,

The setup: See picture erm_board_setup.

I am using an arduino mega2560 to send the I2C that i transform from 5V to 3V using TCA9517. The VCC is at 3.3V (confirmed by measurements).

My code is as follows: (Note: The idea is to control the pwm output not in open loop but by setting the rtp register duty cycle and letting the drv2605L handle the PWM)


void setup(){

Serial.begin(9600);
delay(250); //wait for arduino
Wire.begin(); //setup I2C

drv.ratevolt(0x8E); //operating voltage of 3V
drv.clamp(0x99); //clamp voltage 3.3V

drv.Mode(0x07); //Set autocalibration mode
drv.go(); //Start calibration
while(bitRead(drv.readDRV2605L(GO_REG),0)); //wait for GO bit to clear
bool calibOK = bitRead(drv.readDRV2605L(STATUS_REG), 3);

if(!calibOK){
Serial.println("Calibration is successful.");
}else{
Serial.println("Calibration failed."); //This is the output i get
}

drv.cntrl2(0x75);//set unidirectionnal mode
drv.cntrl3(0x88);//set closed loop mode
drv.Mode(0x05);//mode RTP
drv.RTP(127);

}

Two main problems:

1 - The auto-calibration always fails

2 - The PWM output is 50% but there seems to be another signal overlapping. (See picture pwm _oscilloscope) 

Thanks for the help

  • Hi Karim,

    Are these traces OUT+/-? If you are in ERM mode, then one output will be at ~1% duty cycle, which looks like the bottom signal and the other output will be at whichever duty cycle translates to the rated voltage you set.
    I have reached out to Precision Microdrives to ask if this motor has any integrated electronics. I have seen this be an issue with certain ERMs in the past.

    How is the motor mounted? There should be a stable mechanical ground in order for the BEMF signal from the ERM to be stable. This usually means mounting the ERM to a ~50g mass (or heavier) and then performing the calibration.
  • Hi,

    I put the ground of the oscilloscope to OUT- and the plus to OUT+ and this is the output i get.

    I don't understand why should one output be at 1% duty and the other at the duty cycle set (here close to 50%). Shouldn't it be OUT- at GND and OUT+ at PWM 50% duty cycle? I connected my motor to OUT- and OUT+. Is that correct?

    The motor is mechanically constrained.

    Thanks for the help,

    ZEID Karim.
  • Hi Zeid,

    Sorry for the confusion. This is not the correct way to connect the oscilloscope. You should connect each probe from OUT+ to GND and OUT- to GND and then use the math function to perform OUT+ - OUT-.
    There are special differential probes, that can be hooked up across OUT+/-, but you shouldn't connect the probe GND node on to the output.

    My mistake, one output will be completely off during the driving stage and the other one will be the respective duty cycle. However, you will see a pulse on both outputs during the closed-loop portion of the waveform when the device detects the BEMF signal. The interval for the BEMF sensing in ERM mode is determined by the DRIVE_TIME register. By default, this should only occur every ~4.8ms.

  • Hi,

    Thank you for the explanation that explains a lot.

    This is OUT- to GND. The frequency measured is 205Hz which is 4.87ms.

    This is OUT- to GND but I zoomed in on one pulse:

    This is OUT+ to GND and sometimes there is the pulse.

    The BEMF sensing seems to work correctly. 

    I have also made the differential measurement. In yellow OUT+ to GND, In blue OUT- to GND and in red the difference between the two signals. I am expecting a PWM of 49.8% because i write 127 in the RTP register. However i measure  52.42%. Is that because the auto-calibration fails?

    Last but not least if I zoom out a lot in differential I see this: 

    Why does the PWM suddenly become negative for some period of time?

  • Hi Zeid,

    The PWM duty cycle shouldn't be contributing to the calibration failure.
    These waveforms seem correct up until this last one. It looks like the device is switching to LRA mode and driving an AC signal.. Are there any more I2C write being made? Can you post the full waveform for auto-calibration?
    A typical ERM auto-calibration will drive two different levels: the first is the over drive and the second is closer to the rated voltage. There should not be any negative voltage.
    When you play a waveform, there is negative voltage in order to stop the ERM faster.
  • Hi,

    There are no other I2C signal being written. The code running is the one I put in my first post (the loop() is empty).

    Here is the waveform of the calibration. I changed the last line of the code to be drv.RTP(0):

    1div = 2Volts. The time is in seconds.


    I have found that one way to make the calibration successful is to lower the line drv.ratevolt(0x8E); and change it to at maximum drv.ratevolt(0x75);

    There is 3.3V going into the driver and the motor has a 3V rated voltage. According to the datasheet the computation to do is:

    For a rated voltage of 3V the register should be set to 141.64. I chose 0x8E = 142 but the value working is actually 0x75 = 117 which according to the formula corresponds only to 2.47V.

    Does that mean that my motor will operate at a lower voltage due to the calibration?

  • The motor may not have enough headroom to drive the ERM at 3V using a 3.3V rail (typically the headroom is ~0.4V). Therefore, it may never reach the calibration level resulting in a failed calibration.. Could you try increasing the supply voltage to see if that is the issue?

    Yes, if you calibrate the motor at 2.47V it will be driven at 2.47V in 100% RTP mode. Also if you are using unidirectional mode, then the max output in RTP mode will be at 0xFF or 255 (figure 27 in the datasheet).

    Your calculation seems correct. FYI we have a tool to make the register settings easier. Below is an image of the typical ERM calibration; you can see the overdrive voltage and two voltage levels.

    It is difficult to tell what is going on with your waveform with the RTP(0) appended at the end of the calibration.

    Also I heard back from Precision Microdrives and this ERM should be compatible with the DRV2605.

    • I tried using a 5V supply and an I2C of 5V. The calibration is successful with the good value of rated voltage of 0x8E.
    • It seems that i don't have the problem of switching into LRA mode and having a negative part anymore.

    With 3V supply (calibration fails):

    With 5V (calibration successful):

    That solves all my problems.

    Thanks a lot Kelly Griffin!