EMLabScript PartA
EMLabScript PartA
I. I NTRODUCTION
Fig. 1a depicts a 3-d Computer Aided Design (CAD) rendering of a simple ferromagnetic linear actuator composed
of a stator core, an armature (mover or plunger) and two independently connected electrical windings of N turns.
Note that a practically realisable actuator would require a mechanical retaining arrangement to physically constrain
the motion of the armature, maintain the two fixed air-gaps and provide a physical end-stop to limit the variable
air-gap, in this case to 5 mm. In addition a return spring mechanism is necessary to move the armature back to
the 5 mm end-stop when the coils are not energised since the actuator is unidirectional i.e. force is only generated
in one direction.
Winding 1
Armature
Core
Variable
air-gap
Fixed
Winding 2 air-gap
Side view Rear view
(a) 3-d illustration of the actuator. (b) 2-d section view of the actuator.
Fig. 1: Examples of concentrated and distributed e-machine windings with round and rectangular conductors.
The actuator topology is in effect an inductor with two fixed air-gaps and one variable length air-gap. When
the windings are energised, in this case with Direct Current (DC), I , a magnetomotive force, M M F , is set up,
1
M M F = N1 I1 + N2 I2 , giving rise to an associated flux, φ, which is limited by the reluctance, R, of the magnetic
circuit. The interaction of the current, magnetic field and the mechanical system results in attractive force between
the pole faces of the air-gaps. Here the two fixed air-gaps are of equal dimension, as such, balanced attractive forces
are imparted on the armature so no net motion is induced. However, the variable air-gap imparts an unbalanced
force which tends to move the armature toward the stator core, thereby, reducing the reluctance, increasing the
inductance and storing more energy in the magnetic field.
In this laboratory, students will analyse the electromagnetic behaviour of the ferromagnetic actuator using both
analytical and numerical techniques. The theory necessary to understand the operation of the actuator is contained
within Section B of the course notes, [1]. The laboratory script is split into two sections, A and B which take place
over two three-hour laboratory sessions. Part A (this document), focuses on familiarising students with the steps
necessary to model the ferromagnetic actuator using numerical Finite Element Method Magnetics (FEMM), [2],
and Matlab software, which is available for use on your personal computers to enable study beyond the formal
laboratory session. Part B of the laboratory script introduces the concepts necessary to analyse the electromagnetic
behaviour numerically and analytically, and sets out the bulk of the coursework tasks along with the required
technical note format, submission dates and the marking scheme.
II. I NTRODUCTION TO F INITE E LEMENT A NALYSIS
The laws of physics can typically be described by Partial Differential Equations (PDEs) which must be solved
over a geometric domain to yield a quantitative measure of the variable of interest which may be temperature,
magnetic flux, magnetic field intensity, pressure etc. If the geometric domain of interest is simple, for example
rectangular or cylindrical and the PDE to be solved is linear then a number of analytical methods exist to establish
a solution subject to boundary conditions. Examples are the calculation of magnetic flux density, B , in the air-gap
of a Permanent Magnet (PM) electrical machine, necessary to predict back-EMF, v , and torque capability, τ , [3],
[4]. However, if the geometric domain is of a complex shape or the PDE to be solved is non-linear, as is the case
for electromagnetic problems if non-linear material BH curves are to be modelled, then analytical methods are no
longer suitable. Instead, a numerical model of the PDE can be constructed, typically using dicretisation (meshing)
which can be solved using numerical methods to yield an approximation of the real solution of the continuous
PDE. The finite element method (FEM) is used to compute such approximations. A detailed description of FEM
formulaitons is beyond the scope of this unit, however, the interested reader may find [5] and [6] useful.
In the case of the ferromagnetic actuator studied in this laboratory, it is assumed that the applied winding current,
I , is DC (Direct Current), i.e. the current is time-invariant, and that both linear and non-linear core materials must
be modelled. Hence, a magnetostatic model is required in which the magnetic field intensity, H , current density,
J , and the magnetic flux density, B , must obey Maxwell’s Equations (1) and (2), [7], subject to the constitutive
relationship between B and H , representing the BH curve, for each material in the model, (3). If the material
being modelled is non-linear (i.e. it has a non-linear BH curve) then the permeability, µ, is a function of the flux
density, B , (4).
∇×H =J (1)
∇·B =0 (2)
B = µH = µr µ0 H (3)
B
µ (B) = (4)
H (B)
B =∇×A (5)
2
1
∇× ∇×A =J (6)
µ (B)
FEMM finds a field which satisfies (1) to (3) using a Magnetic Vector Potential approach where the flux density,
B , is defined in terms of the magnetic vector potential, A as, (5), which naturally satisfies (2) since ∇·(∇ × A) ≡ 0.
Hence, FEMM solves the magentic vector potential formulation, (6), which combines all of the conditions to be
satisfied in to a single equation and once A is found, B and H can be determined by differentiating A. In the general
3-d case, A is a vector with x, y , and z components in the Cartesian space, however, in the 2-d case considered
here, only the z component, out of the page exists. The form of, (6) is an example of an eliptic PDE which arises
in many engineering fields, as such, a large number of tools have been developed to solve them numerically over
arbitrarily shaped domains accounting for non-linear materials and sources, [5], [6].
III. C ONFIGURE FEMM AND M ATLAB
The Matlab and FEMM software can be used in isolation, however, when linked through ActiveX technology
they become a simple yet powerful analysis tool for electromagnetic and thermal problems. Follow the steps below
to set up your software environment:
Note: It is recommended to read each section in its entirety before implementing the instructions to avoid
missing information and having to repeat operations.
1) Create a folder called EMLab in the top level of your Documents folder - this folder will be used to contain
all of your modelling files and results
2) Open Matlab from the program menu - use the latest version available
3) Change the Matlab working directory (at the top of the window) to the EMLab folder that you created in
step 1.
4) Link FEMM and Matlab by adding the necessary FEMM files to the Matlab path
- execute addpath(genpath(’C:\femm42’)) in the Matlab command prompt, note the use of single
quotes
5) Confirm a successful link by executing openfemm() in the Matlab command prompt - a FEMM window
should appear - if not, seek help from a laboratory demonstrator
6) Go to the course page in Blackboard (https://www.ole.bris.ac.uk/), navigate to Electromagnetics Lab,
Fig. 2, and download the EMLabfiles.zip to your EMLab folder
7) Extract the contents of EMLabfiles.zip to the root (top level) of your EMLab folder
Note that steps 2-5 must be repeated each time Matlab is restarted to establish the necessary software
link and set up the current working directory.
3
Fig. 2: Laboratory support files available on Blackboard, https://www.ole.bris.ac.uk/.
4
mi_addnode(corep(:,1),corep(:,2)). It is not recommended to add the nodes manually, however, this
could be achieved by selecting the Operate on Nodes button, Fig. 3, pressing tab, entering the X- and Y-
coordinates, and then pressing OK.
Grouping entities such as nodes, line segments, arc segments and material labels into objects, for example the
core, using assigned group numbers allows object entities to be selected simultaneously which eases manipulation of
the actuator model later in the analysis. Group numbers can be assigned to the nodes using the GUI, see section 2.3
of the FEMM_manual.pdf, or programmatically using mi_selectnode(x,y) to select the node, setting the
node properties, mi_setnodeprop(’<None>’,1), and then clearing the selection, mi_clearselected().
This sequence of commands must be repeated for each node, hence implementing a for loop within a sub-function
is recommended.
5
Node Number X-position [mm] Y-position [mm] Group Number
1 20.5 -71.2 3
2 69.5 -71.2 3
3 69.5 -58.0 3
4 20.5 -58.0 3
6
Fig. 4: 2-d actuator geometry implemented in FEMM.
Fig. 5: 2-d actuator geometry implemented in FEMM with an Improvised Asymptotic Boundary Condition.
7
symbol), Fig. 3, and clicking at an appropriate location within a region. Right-click the block label, press
space-bar and select the appropriate block type, enter the group number, then press OK. The core and armature
will initially be set to core_linear while the winding regions will be set to copper. The remaining region
bounded by the Improvised Asymptotic Boundary Condition must be assigned as air. Material or block labels
may be added using the mi_addblocklabel(x,y) which must then be selected, mi_selectlabel(x,y),
modified, mi_setblockprop(’blockname’, automesh, meshsize, ’incircuit’, magdirec-
tion, group, turns), and deselected, mi_clearselected().
The actuator features two windings, winding_1 and winding_2 of N = 100 turns which are represented by four
discrete regions in the 2-d geometry. The windings are separately excited by 10A current sources. The upper and
lower region of each winding is assumed to be connected in series, due to the 2-d nature of the model, the end-
winding cannot be represented. Assign the predefined circuits to the appropriate copper regions, right-click
on the block label, press space-bar, choose the circuit and enter the number of turns, N = 100. The number of
turns should be negative in the upper winding regions and positive in the lower winding regions to indicate windings
out of and in to the page respectively. Circuit assignment can and is recommended to be achieved programmatically
using the mi_setblockprop() command as above.
F. Check the Problem Definition and Excitation
The FEMM template file should have an appropriate problem definition, nonetheless, it is important to check this
definition by clicking Problem in order to avoid misinterpretation of the results later in the analysis. The problem
definition should match Fig. 6 and can be updated using the GUI or using the mi_probdef() command, see
FEMM_programming_manual.pdf.
8
H. Analyse the Model
Use the mi_analyse() and mi_loadsolution() commands to analyse the model and load the results
respectively. When calculating the solution, the fkern window will appear briefly, Fig. 7. If the model has been
correctly implemented, you should see a results output similar to that shown in Fig. 8. If your model does not solve
as expected or you encounter an error, seek help from a laboratory demonstrator.
I. Conclusion
In this laboratory exercise you have learned how to interface FEMM and Matlab to programmatically generate
a 2-d magnetostatic model of a ferromagnetic actuator. Before the next laboratory session you should use the
resources available in EMLabFiles.zip to improve your Matlab script. Part B of the laboratory exercise will
cover model meshing considerations, how to programmatically move the armature, apply current and measure
various parameters such as winding loss, inductance and force. These operations will be used to characterise the
behaviour of the actuator numerically which can be compared to your analytical analysis, the methods of which
will be covered in forthcoming lectures. The remaining coursework tasks will be set out along with the required
technical note format, submission dates and the marking scheme.
R EFERENCES
[1] N. Simpson and D. Drury, “Industrial electronics 2: Electro-mechanical energy conversion,” Lecture Notes, 2019.
[2] D. Meeker. (2019) Finite element method magnetics (femm). [Online]. Available: www.femm.info
[3] Z. Xia, Z. Zhu, and D. Howe, “Analytical magnetic field analysis of halbach magnetized permanent-magnet machines,” IEEE
Transactions on Magnetics, vol. 40, no. 4, pp. 1864–1872, 2004.
9
[4] T. Lubin, S. Mezani, and A. Rezzoug, “Exact analytical method for magnetic field computation in the air gap of cylindrical electrical
machines considering slotting effects,” IEEE Transactions on Magnetics, vol. 46, no. 4, pp. 1092–1099, 2010.
[5] X.-Q. Sheng and W. Song, Essentials of computational electromagnetics. John Wiley & Sons, 2011, vol. 757.
[6] P. P. Silvester and R. L. Ferrari, Finite elements for electrical engineers. Cambridge university press, 1996.
[7] D. Fleisch, A student’s guide to Maxwell’s equations. Cambridge University Press, 2008.
[8] K. Sugahara, “Improvised asymptotic boundary conditions for magnetostatic field problems in ellipsoidal and elliptic cylindrical
domains,” IEEE Transactions on Magnetics, vol. 53, no. 6, pp. 1–4, June 2017.
[9] G. James, D. Burley, D. Clements, P. Dyke, and J. Searl, Modern engineering mathematics. Pearson Education, 2007.
[10] J. Shewchuck. A two-dimensional quality mesh generator and delaunay triangulator.triangle,. [Online]. Available: http:
//www.cs.cmu.edu/~quake/triangle.html
10