Magnetic separators for solid and powder mixtures with automatic cleaning