Hardware manual

18
Looking at the above example of discretization on the figure 3.5-1 and thinking little bit, we will
find out another very important problem: it is impossible to put to the pins negative and positive
values at the same time. In other words, we can assume that the voltage levels on the pins now
are negative or positive, but we can't have them both. How to solve it? The solution is also quit
easy. We just need to shift maximum negative values to be equal to zero. True zero will be equal
to the middle level in our case it will be 0x3fff, and the maximum positive value will be equal
to 0x7fff. Here is small mathematical explanation: range of levels is from 0-0x7fff, what gives us
0x8000 possibilities. We divide 0x8000/2 and we get 0x4000. Because we count from zero we
should decrease this value by 1 and as the final result we will get: 0x3fff. This number is also the
amplitude of sinusoids which we should generate for phase tables.
The last serious problem which we can meet, can occur at 
imagine the situation that the rotor is in the position of and we want to rotate it to the
right. To make it, we should put magnetic field perpendicular to the rotor field, so the angel for
the magnetic field should be equal to . Everything seems to be quite easy,
but in real it's not. Let
analyze. If we start the program and an index for phase table will point to a good position in the
phase table then nothing wrong should happen the magnetic field will have . But, what if
the index will be set wrong and gives rise to wrong position of the magnetic field? The answer
depends on the error. If index will be little bit ahead of the right position only the torque will be
little bit lower, but after short time it will grow to the desired value. The same happens if the
index will be only little bit before good position. And what if the index will be behind the proper
position more than ¼ of the phase table length? In this case it will give rise to torque with wrong
direction, because the direction of magnetic field will be less than . The worst case will be if
the index will be ½ of the length before the proper position or in other words the
magnetic field direction generated by this position will be to the rotor field, then the
torque will be the highest and additionally with wrong direction. What does it mean a wrong
direction of torque? It means that the motor will start to rotate for a short time in wrong
direction. In simple application it can hav
lift with heavy load, in this case such error can have catastrophic consequences.
To solve these problems we can use hall sensors presented in subsection 3.3. If not every than
at least most of the modern brushless motors have such sensors. Using hall sensors we can find
out the actual position of the motor with 60
o
precision and put proper voltages to the right
windings. This avoids the situation presented in the previous paragraph. It is also worth to note
that some of the motors have - please look at the picture 3.4-2
and explore the channel I. This means, that always when the motor cross some defined point,
sensor detects it and send some signal. We can use this to make some kind of synchronization
between the position of the motor and the index in the phase table. The following picture
presents the reads from hall sensors and voltages on the windings which are needed to place
the motor to the proper position.