hello ! i tried hall sensor test code for 2pole bldc motor .it give angle and velocity when i moving from hand. but when i do one roation it doent give axct 360angle .i get 56degree as one rotation . can anybudy help me how to get xctly 360 after one rotation . my code is here below,
#include <SimpleFOC.h>
// Hall sensor instance
// HallSensor(int hallA, int hallB , int cpr, int index)
// - hallA, hallB, hallC - HallSensor A, B and C pins
// - pp - pole pairs
HallSensor sensor = HallSensor(15, 4, 5, 2);
// Interrupt routine intialisation
// channel A and B callbacks
void doA(){sensor.handleA();}
void doB(){sensor.handleB();}
void doC(){sensor.handleC();}
//float HallSensor::getElecAngle()
//{
// return (HALLS_SEQ_120[state] * 60-120) * (_PI/180);
//}
void setup() {
// monitoring port
Serial.begin(115200);
// check if you need internal pullups
sensor.pullup = Pullup::USE_INTERN;
// initialise encoder hardware
sensor.init();
// hardware interrupt enable
sensor.enableInterrupts(doA, doB, doC);
Serial.println(“Sensor ready”);
_delay(1000);
}
void loop() {
// iterative function updating the sensor internal variables
// it is usually called in motor.loopFOC()
sensor.update();
// display the angle and the angular velocity to the terminal
Serial.print(sensor.getAngle());
Serial.print(“\t”);
Serial.println(sensor.getSensorAngle());
//Serial.println(sensor.getVelocity());
delay(100);
}