# How this linear Motor Shaft works?

I am trying to understand how this linear motor works:

You can see a video here for more details. From what I know each permanent magnet consist a North and South poles so for a cylindrical magnet I have half of the magnet which is South and the other half North, so If I understand correctly the are positioned on this way:

 XXXXXXXXXXXXXXXXXX
_______  _______
|   |   ||   |   |
| N | S || N | S |
|___|___||___|___|
..................


Where 'X' is the current going into and '.' is the current getting out. So If I understand correctly I will have opposite forces that cancels each other. Analyzing the current of the top ('X') North poles gives me a force going to the right, but the South pole gives me a force going to the left so I have no force, so, how exactly this linear motor moves?

The design you see is probably an AC linear motor. Such motors are always driven by alternating current, and have several sets of windings driven either in phase quadrature, or a common configuration is three separate phases driven by equispaced phased currents, i.e. proportional to $\cos(\omega\,t)$, $\cos(\omega\,t + 2\pi/3)$ and $\cos(\omega\,t + 4\pi/3)$. The conductors are layered so that the nett flux inside the solenoid varies like:
$$\sum\limits_{n=1}^\infty a_n \cos(n\, k\,z - \omega\,t)$$
where $\omega$ is the angular frequency, $t$ the time, $z$ the distance along the motor's axis and $k$ is the "wavenumber", which is set by the coil design. The number of windings from each of the three phases present at any given axial position is varied to achieve this wavenumber. The coils are also layered such that the fundamental harmonic $a_0$ is as big as it can be relative to the others. So we have a travelling wave field, and the wavenumber $k$ is engineered as described to match the wavelength with the "wavelength" of the periodic variation in magnetisation from the permanent magnets set up with unlike poles back to back. Owing to the travelling wave, the shaft is swept along to keep the relative positions of the permanent magnets and the field constant. So I'm guessing that this a synchronous motor design. It would be driven by a sophisticated controller that would vary the frequency of the field to accelerate the shaft without losing phase lock.