This paper discusses a magnetic levitation system used to control an inverted pendulum with three degrees of freedom, utilizing three magnets arranged in an equilateral triangle to provide stability. The study explores the dynamics and control methods needed for active balancing of the pendulum, which is inherently unstable in an upright position. The results demonstrate that when the forces generated by the magnets are balanced, the inverted pendulum can maintain stability in various orientations.