Quad-copter spins in a circle whilst in air

Does anyone know how to make it so rudder is in the center when the joystick is in the middle? My drone just keeps spinning in circles. (Its not a problem with the joystick I’ve tried several)

Maybe compass problem?

For some reason, resetting the APM parameters solved the problem