I found a strange problem during testing the BLDC motors having in build hall sensor. My setup is a 52 W bldc motor having 4 pp, motor driver DRV8302, and ESP 32 microcontroller.
In a torque control mode when I give a target voltage of 3-4 Volts the output from the hall sensor is ok as shown below :
but if any other target voltage value is given this is the noise introduced or it seems that it skips interrupting i.e not detecting hall sensor value:
I have already introduced the pull-up resistors and by changing the resistor value the result remains the same. Can anyone advise me on how I can solve this issue?
" In the figure, the red is the value from the sensor. get velocity() while blue is the filtered one "
You are right - you are hitting the following case - I don’t know why.
float HallSensor::getVelocity(){
if (pulse_diff == 0 || ((long)(_micros() - pulse_timestamp) > pulse_diff) ) { // last velocity isn't accurate if too old
return 0;
} else {