You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/simplefoc_library/digging_deeper/theory/init.md
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,29 +18,29 @@ This page has been extracted from the [SimpleFOC Community forum](https://commun
18
18
19
19
# Motor and sensor alignment procedure
20
20
21
-
The motor and sensor alignment procedure is a crucial part of the motor control. It is the procedure that is used to find the correspondence in between the electrical angle of the motor and the angle of the sensor. This is a very important step because it is the first step in the motor control and it has to be done correctly in order for BLDC or Stepper motor to be able to move at all. 😃
21
+
The motor and sensor alignment procedure is a crucial part of motor control. It is the procedure that is used to find the difference between the electrical angle of the motor and the angle of the sensor. This is a very important step because it is the first step in motor control and it has to be done correctly in order for BLDC or Stepper motor to be able to move at all. 😃
22
22
23
23
24
24
## Basic principles of the BLDC
25
25
Every BLDC motor has windings in its stator and permanent magnets in its rotor. Here is a quick graphic of a very simple 1 pole pair motor. This motor has three phases and each phase has one pair windings.
26
26
27
27
<imgsrc="extras/Images/init1.png"class="width30">
28
28
29
-
Once the current is passed through the winding coils the motor phases it induces a magnetic field in the windings with a polarity depending on the current polarity. In my figures I am going to simplify this effect and draw the coils in color red/blue - north/south as if they were magnets.
29
+
When current is passed through the winding coils, a magnetic field is induced in the windings with a polarity depending on the current polarity. In my figures I am going to simplify this effect and draw the coils in color red/blue - north/south as if they were magnets.
30
30
31
-
So whenever you apply certain current through the motor coils, they will generate the magnetic field and the motor's rotor will try to align with the coils magnetic filed. Here is an example of the motor behavior for two different initial positions by applying current in the phase `a`
31
+
So whenever current flows through the motor coils, a magnetic field is generated and the motor's rotor will try to align with the coils' magnetic field. Here is an example of the motor behavior for two different initial positions by applying current in the phase `a`
32
32
33
33
<imgsrc="extras/Images/init2.png">
34
34
35
-
From the graphic, and whats intuitive, you can see that regardless of the rotor's initial position, when you set a certain magnetic field in the stator windings the motor will always try to align with that magnetic field, and in a case of this simple motor it will always some to the same position.
35
+
From the graphic, and what's intuitive, you can see that regardless of the rotor's initial position, when you set a certain magnetic field in the stator windings the motor will always try to align with that magnetic field, and in a case of this simple motor it will always come to the same position.
36
36
37
37
## Definition of the field vectors
38
38
39
-
Now when talking about how to align different magnetic fields, what does it mean in practice and how do we characterise the force that actually makes the rotor move it is usual to introduce the field vectors. Basically the magnetic field vector by its length shows the strength of the magnetic field and its direction will be determined going from the north to south pole. It is very simple, here is a quick visualisation:
39
+
Now when talking about how to align different magnetic fields, it is usual to introduce the field vectors. What does it mean in practice and how do we characterise the force that actually makes the rotor move? The magnetic field vector shows the strength of the magnetic field by its length and its direction will be determined going from the north to south pole. It is very simple, here is a quick visualisation:
40
40
41
41
<imgsrc="extras/Images/init3.png">
42
42
43
-
Now when we defined the vectors of the magnetic field based on the motor's physics the force that turns the rotor of the motor depends of the strength of the two magnetic fields ( \\(B_r\\) - strength of rotor's permanent magnets and \\(B_s\\) - strength of the field in the coils produced by the current \\(I\\)) and fields and the angle in between them
43
+
Now when we defined the vectors of the magnetic field based on the motor's physics, the force that turns the rotor of the motor depends on the strength of the two magnetic fields ( \\(B_r\\) - strength of rotor's permanent magnets and \\(B_s\\) - strength of the field in the coils produced by the current \\(I\\)) and fields and the angle in between them
44
44
45
45
$$
46
46
F \sim B_r\cdot B_s\cdot sin(\theta)
@@ -55,7 +55,7 @@ $$
55
55
<imgsrc="extras/Images/init4.png">
56
56
57
57
58
-
Basically this relationship means that the motor's torque will be directly proportional to the two magnetic fields but also to the sine of the angle between them. And in particular as we cannot control the magnetic filed of the rotor's magnets, we will have to control strength and orientation of the magnetic field vector of the stator windings (field oriented control).
58
+
This relationship means that the motor's torque will be directly proportional to the two magnetic fields but also to the sine of the angle between them. As we cannot control the magnetic field of the rotor's magnets, we will have to control the strength and orientation of the magnetic field vector of the stator windings (field oriented control).
59
59
60
60
## Control of the field vector orientation (FOC)
61
61
From the force equation we can see that we can see that in order to use maximally our current and produce the maximal force we need to keep the angle in between the two vectors at 90 degrees, because \\(sin(90) = 1\\). In that case the force pushing the rotor to move ( creating the motor's torque) will be proportional only to the current \\(I\\) and \\(B_r\\)
@@ -87,17 +87,17 @@ One simpler variant of bldc motor control is trapezoidal control (or six-step) t
87
87
88
88
<imgsrc="extras/Images/init5.jpeg">
89
89
90
-
As you can see the idea is very similar as the FOC (field oriented control) but the angle in between the vectors is not always kept at 90 degrees as we do using the FOC.
90
+
As you can see the idea is very similar to field oriented control but the angle in between the vectors is not always kept at 90 degrees as we do using FOC.
91
91
92
92
## SimpleFOClibrary init procedure
93
93
94
-
In the init procedure we are searching to find the correspondence in between the 0 angle to the position sensor we are using and the electrical 0 angle of out motor which is usually defined by the magnetic field vector of the phase `a`. As shown on the second image and on the one below we could set the stators magnetic field orientation to -180 degrees and we will be sure that the motor will always align to the 0 electric angle.
94
+
In the init procedure we are searching to find the difference between the 0 angle to the position sensor we are using and the electrical 0 angle of our motor which is usually defined by the magnetic field vector of the phase `a`. As shown on the second image and on the one below we could set the stator's magnetic field orientation to -180 degrees and we will be sure that the motor will always align to the 0 electric angle.
95
95
96
96
<imgsrc="extras/Images/init6.png">
97
97
98
98
Then we can just read the sensor value and add 90 degrees to it and use it as our target position to set out stator magnetic field vector \\(B_s\\) to.
99
99
100
-
As we will be always adding the 90 degrees to our sensor angles, in literature many approaches (park + clarke) are defined not for the actual rotor position but for the rotor angle+90 degrees. instead of searching for the relationship in between the position sensor angle and the electric angle 0, we often search for electric angle 90. And in order to force the rotor to go to the 90 degrees, you need to apply the 90-180 = -90 or 270 degrees.
100
+
As we will be always adding 90 degrees to our sensor angles, in literature, many approaches (park + clarke) are defined not for the actual rotor position but for the rotor angle+90 degrees. instead of searching for the relationship between the position sensor angle and the electric angle 0, we often search for electric angle 90. In order to force the rotor to go to 90 degrees, you need to apply the 90-180 = -90 or 270 degrees.
101
101
102
102
Here is an example:
103
103
@@ -106,9 +106,9 @@ Here is an example:
106
106
Or:
107
107
<imgsrc="extras/Images/init8.png">
108
108
109
-
Remembering the offset in between the position sensor angle and the rotor's electrical 90 degrees angle avoids the need for adding the 90 degrees in the formulas, at least for the sinusoidal modulation. But the approaches of finding the 0 or 90 degree angles are equivalent, its a choice of implementation.
109
+
Remembering the offset between the position sensor angle and the rotor's electrical 90 degrees angle avoids the need for adding the 90 degrees in the formulas, at least for the sinusoidal modulation. But the approaches of finding the 0 or 90 degree angles are equivalent, it's a choice of implementation.
This is a quiet standard procedure, and probably one of the most simple ones. But there are certainly limitations. The biggest downside is, as we are only doing one measurement it can happen that the rotor due to some physical imperfections (or sometimes just friction) does not go exactly to 90 degrees but some angle close to it. So in that case the force generated by the motor will not be 100 efficient because we will not be able to maintain \\(sin(90) = 1\\). This could be avoided by taking multiple measurements and doing some averaging or some more fancy statistics.
112
+
This is a standard procedure, and probably one of the most simple ones. But there are certainly limitations. The biggest downside is, it can happen that the rotor, due to some physical imperfections, (or sometimes just friction) does not go exactly to 90 degrees but some angle close to it. Since we are only performing one measurement, we will not know that this angle is incorrect. So in that case the force generated by the motor will be less efficient because we will not be able to maintain \\(sin(90) = 1\\). This could be avoided by taking multiple measurements and doing some averaging or some more fancy statistics.
113
113
114
-
The other downside of course is that if we do the calibration only once at the init, we are absolutely unaware if something happens in during the operation of your motor. If the sensor drifts, it could be potentially possible to account for the change in the alignment, but at the moment we do not implement such a feature.
114
+
The other downside of course is that if we do the calibration only once at the init, we are absolutely unaware if something happens during the operation of the motor. If the sensor drifts, it could be possible to account for the change in the alignment, but at the moment we do not implement such a feature.
0 commit comments