Open loop DRV8302 with ESP32

Im trying to run the example code I’ve found to get used to the libraries. but after the motor init a got a fault and the motor keep buzzing, the power supply is limited to 12V and 0.05 A.

https://youtu.be/U9vBEJLJKxY

12V and 0.05 A for this motor?

I’ve set everything low to test the board first.

Hey @bgvsan,

I would suggest you not to limit the current so low. With 50ma even my big gimbal motors have problems.

I would suggest you to limit the voltage in the code to motor.voltage_limit=0.5 // or maybe 1V and current on your power supply arround 1amp(can be even more).

Also I’d suggest you to first make sure the velocity open loop works. And then angle loop.

What is the led that turns on when this noise happenes?
Is it ovecurrent protection?

Thanks for the reply, I’ve moved to the velocity example, and rised to 1A and 0.5 limit and at least it moves.
the led is the Fault flag.

the angle now seems to work, but I have to keep a value of motor.voltageLimit = 0.5 otherwise the motor is really noisy and stalls.

Hey @bgvsan,

This is normal with low resistance motors. You will have to keep the voltage limit very low in order to prevent the current being very high.

The rule of thumb is that the current will be voltage/resistance so for low resistance you need low voltage to keep the current low.

Did you try to spin your motor with high velocities?
Because of the influence of the back emf for the same voltage the current will fall a bit and you should have less noise.

These kinds of motors are really not intended to be run in this kind of open loop mode. In closed loop mode you will have less problems with high currents.

Thanks for be so exhaustive,
I’ve tried to set 60 rad/sec, I have to increase to 0.9 and provide 2.5A, but really cannot go more than that as it stalls.
But yes, I confirm high rpm goes below 0.5A and runs better.

So my guess was exact and with the closed loop the lib is working better.
Thanks for the support, will be awesome discover and analyze the lib.

Hi, were you able to run the motor correctly? I’m using the same hardware except motor. Are you able to share the code you used? thanks