Closed
Description
During the initialization of magnetic sensor, if the direction of rotation is not set, the program will execute to find the direction of rotation.
When I use this feature, the AS5600 magnetic sensor sometimes find the wrong direction.
The code rotate the motor and check the data of magnetic sensor during the rotation to find the rihgt direction.
Maybe the wrong direction because the initial data of magnetic sensor is not correct, so I add sensor.update() during the rotate of the motor:
for (int i = 0; i <=500; i++ ) {
float angle = _3PI_2 + _2PI * i / 500.0f;
setPhaseVoltage(voltage_sensor_align, 0, angle);
sensor->update();
_delay(2);
}
Metadata
Metadata
Assignees
Labels
No labels