Some problems about AS5600 PWM output Magnetic sensor

I’m using the ESP32-PICO-KIT board and AS5600 to get the angle with SimpleFOClibrary.
Now, when I use the provided example in the examples/sensor_test/magentic_sensor_pwm_example/find_raw_min_max to find out the maximal and minimal values, Only two strange values will be output.
Below is my MagneticSensorPWM class.

MagneticSensorPWM sensor = MagneticSensorPWM(2, 4, 1020);

This is a picture of the output of it.

Hopefully someone can help me!

Hi @222Byang , and welcome to the SimpleFOC forum!

I am sorry you did not receive an answer so far, but I think the problem is that people don’t really use the MagneticSensorPWM.

I’m not sure what the issue is here. But I can only strongly advise against trying to use the AS5600’s PWM mode, or the PWM sensor in general. While it can be made to sort of work, the sensor is too slow and imprecise to enable effective motor control.