How to choose the SimpleFOC mode for the application of three-axis gimbal

That is untrue. There is no evidence of such claim. Unless you find out the exact ADC and CORDIC MCU silicon reference as well as the CORDIC ADC/DSP algorithm implementation microcode used in calculating the angle from the four hall sensor coordinates, and have the knowledge to take it apart and critique its merits, this blanket claim is baseless.

This is unfortunate however short of me walking into your place and examining the setup and waving an EMF meter, it’s impossible to offer suggestions. This 5048A/B sensor is designed for the robotic and automotive industry, it can withstand a pretty noisy environment, there’s got to be a pretty obvious source for the noise. Did you also use true ground (literally a buried bucked in the backyard)?

Something very important, I am using 5047P which is the extra-high speed version which uses a different CORDIC system and angle timing deviation error correction algorithm so by the time the signal hits the SPI bus it’s already corrected, and you are using the slow speed 5048A. However such high error you showed cannot be explained away by systemic noise.

Perhaps you acquire a 5047P and re-setup your system? I am not sure. Wish I could help.

Edit: Perhaps a stupid suggestion on my part but you could check the value of the error register of the sensor to see if your magnet is correctly set up? May be your magnet is right or not set up correctly?

> ...register address x3FFD (AS5048A) : •OCF (Offset Compensation Finished), logic high indicates the finished Offset Compensation Algorithm. After power up the flag remains always to logic high. •COF (CORDIC Overflow), logic high indicates an out of range error in the CORDIC part. When this bit is set, the angle and magnitude data is invalid. The absolute output maintains the last valid angular value. • COMP low, indicates a high magnetic field. It is recommended to monitor in addition the magnitude value. • COMP high, indicated a weak magnetic field. It is recommended to monitor the magnitude value.