2.2. The Magnetic Spring as a 2-DoF Kinematic Chain
In the previous paper [
17], the authors show a 1-DoF model of the magnetic spring in an electromagnetic energy harvester. The electromagnetic energy harvester consists of the mechanical system—the magnetic spring and the electromagnetic system—coils, and magnets. The energy harvesting system structure, which consists of axially magnetized cylindrical permanent magnets in a magnetic spring and a coil located around the magnetic spring, is shown in
Figure 2a. In the magnetic spring, the fixed magnets are placed at the top and bottom of the magnetic spring and a levitated magnet is located between them. The levitation of the magnet is ensured by the repulsion force of the fixed magnets and the levitated magnet. The low height of the levitated magnet enables its rotation and causes its instability for higher air gaps between the magnets in the magnetic spring. The casing that contains the magnetic spring has a gap which reduces pressure inside the magnetic spring and also allows the levitated magnet to move with lower air resistance. In
Figure 2a, the levitated magnet moves linearly along the symmetry axis
z and rotates around the axis perpendicular to its symmetry axis, as described by the
θ angle. The voltage is induced in the coils due to the relative movement of the magnet and coils. For its calculation, Lorentz’s law has been used.
The repulsive forces of fixed and levitated magnets are considered as spring and damping forces; therefore, the magnetic spring with one moveable permanent magnet which levitates between two fixed magnets can be modeled as the mass between two springs and dampers. The novel approach of the magnetic spring modeling is based on the 2-DoF kinematic chain presented in
Figure 2b. The linear movement of the levitated magnet along the magnetization axis is illustrated by the prismatic joint and rotational movement around the radial axis by the rotational joint.
In
Figure 2b, the mass
mh1 is the symbolic representation of the mass center for the first joint and the mass of the levitated magnet is
mh2. In this case, the value of mass
mh1 is equal to 0. The stiffnesses of the springs
kh1(
z) and
kh2(
z) have the same value equal to ½ of the magnetic spring’s stiffness. The stiffnesses of the springs
kh1(
z) and
kh2(
z) depend on the position of the magnet. The damping coefficients
bh1 and
bh2 of the magnetic spring are equal and were calculated using optimization in Matlab [
17]. The force
Fz is the external force caused by the vibration generator movement. The magnetic spring is acting as an inertial generator; therefore, the force
Fz is considered an inertial force (1):
where
mh is the the proof mass and the levitated magnet mass, and
av is the acceleration of the vibration generator [
5].
The equations describing the levitated magnet movement are derived using the Denavit–Hartenberg notation [
15].
Table 1 presents the kinematic parameters of the kinematic chain shown in
Figure 2b), where
i is the ordinal number of the link relative to the kinematic chain,
ai is the distance between axes
zi and
zi-1,
αi is the angle between axes
zi and
zi-1,
di is the distance between axes
xi and
xi-1,
θi is the angle between axes
xi and
xi-1, d1 * is the displacement of the prismatic joint, and
θ2 * is the displacement of the rotational joint. The * sign means that the parameter changes with the time.
The kinematic parameters for the gravity centers are presented in
Table 2.
The homogenous transformation is obtained by rotation around the
x and
z axes and translation along the
x and
z axes. The homogenous transformations
Ai for each joint formulated based on
Table 1 and
Table 2 can be presented in (2):
where c
θi = cos
θi, s
θi = sin
θi, c
αi = cos
αi, and s
αi = sin
αi.
The homogenous transformation for the whole kinematic chain
T2 is given by (3):
where
d1 is the position of the levitated magnet in the direction of the magnetization,
θ2 is the rotation of the magnet around the radial axis of the magnetization, and
a2 is the radius of the levitated magnet.
The homogenous transformation for the last gravity center
Tc2 is shown in (4):
where
ac2 is the distance between the geometry center of the levitated magnet and the gravity center of the levitated magnet.
To obtain equations of the levitated magnet movement, the Euler–Lagrange equation can be used:
where
D is the inertia matrix,
C is the Christoffel matrix,
Fpi is the potential force or torque acting on the
i joint,
Fi is the external force or torque acting on the
i joint, and
Fbi is the damping forces or torques acting on the
i joint.
The inertia matrix
D is obtained as a part of a kinetic energy
Ek:
where
Jvi is the Jacobian matrix of the linear speed of the
i joint,
Jwi is the Jacobian matrix of the rotational speed of the
i joint,
mi is the mass of the
i link,
Ii is the moment of inertia of the
i link, and
q is the joint displacement [
15].
The Jacobian matrix of the linear and rotational speed can be obtained by the
z-axis and the coordinate of the joint center [
15]. The Jacobian matrix for the prismatic joint gravity center
Jc1 can be obtained by Equation (7) and the rotational joint gravity center
Jc2 by Equation (8):
where the
z0 is referred to the base coordinate system {0}—[0,0,1] (
Figure 2).
where
oc2 is the center of the second gravity center,
o1 is the center of the first gravity center, and
z1 is referred to in
Figure 2.
The external force
Fi expressed in the coordinate system of the the
i joint is calculated by Equation (9):
The inertia matrix is:
where
m1 is the mass of the first joint and is equal to 0,
m2 is the mass of the levitated magnet, and
I2 is the moment of inertia of the levitated magnet calculated along the radius.
The Christoffel matrix is calculated by the inertia matrix
D [
15], as shown in Equation (11):
where
is the rotational velocity of the levitated magnet.
Finally, the movement of the levitated magnet can be presented by Equation (12):
where
Fp1 is the potential force acting on the first joint and the spring force of the magnetic force presented in Equation (15),
Fb1 is the damping force acting on the first joint presented in Equation (13),
τp2 is the potential and damping torque acting on the second joint presented in Equation (16), and
τb2 is the damping torque acting on the second joint presented in Equation (14). The spring constant force and gravitational force are in equilibrium.
where
b1 is the linear damping of the spring and
is the linear velocity of the levitated magnet.
where
b2 is the rotational damping of the spring, and
is the rotational velocity of the levitated magnet.
The resonance frequency and movement of the levitated magnet in a magnetic spring depend on the spring force and the torque value. The spring force and torque change with the displacement. Thus, the relationship between the force and torque to linear and rotational displacement of the levitated magnet has been determined using the simulation modeling conducted in ANSYS Maxwell 3D.
In the magnetic spring, the repulsive force of the two magnets is considered a nonlinear restoring force depending on the magnetic field intensity, distance of the magnet, and potential energy [
10]. Therefore, the passive nonlinear spring force acts on the levitated magnet [
7,
10,
11]. In this simulation model, the force in the magnetic spring is considered a combination of two parallel spring forces of equal intensity.
The magnetic property of the magnets used in the simulation model of the magnetic spring is a relative magnetic permeability of 1.0535 and a magnetic coercivity of 800 kA/m. The magnetic coercivity used in the simulation differs from that given by the producer (937.4 kA/m) [
18]. Magnets in the magnetic spring have different manufactured properties and are probably demagnetized during vibration tests. The coercivity in the simulation was obtained based on the magnetic repulsive forces measured between the levitated magnet and the external magnet.
In the simulation model, the levitated magnet moves linearly and rotates. The force was calculated along the
z-axis and torque was considered around the
xm-axis (
Figure 3). The exterior boundaries were set to Neumann boundaries and the interior boundaries between magnets were set to natural boundaries.
The levitated magnet changes its position linearly along the
z-axis direction in the range of −3.2 mm to 3.2 mm and also rotationally around the
xm-axis in the range of 0° to 10°. The force approximation and torque equation by Matlab are presented, respectively, in Equations (15) and (16):
where
d1 is the position of the levitated magnet,
θ2 is the angle of the rotational variation of the levitated magnet,
pf00, …,
pf70 are coefficients of the force approximation equation, and
pt00, …,
pt60 are coefficients of the torque approximation equation. These coefficients are shown, respectively, in
Table 3 and
Table 4.
The force and torque, as a function of the linear and rotational position of the levitated magnet are presented, respectively, in
Figure 4a,b.
In
Figure 4a, the force changes as a function of the rotational angle of the levitated magnet, especially when the levitated magnet is near the fixed magnet. The force values vary from −1.5 N to 1.5 N. In
Figure 4b, the lower torque values in the range between 0 Nm and −1.5 × 10
−3 Nm are due to the low values of the magnetic field intensity during the rotational movement of the levitated magnet. The highest value of the torque is reached for the highest rotational angle of the levitated magnet. The torque value is the lowest when the levitated magnet is in the middle position between the fixed magnets. Therefore, the entire spring is affected more by the applied force than the torque.
The displacement of the levitated magnet
dm for a 2-DoF magnetic spring in the
z0-axis (
Figure 2) is calculated as:
where
dc1 is the linear displacement of the levitated magnet,
a2 is the radius of the levitated magnet, and
θ2 is the angular position of the levitated magnet.
In this paper, only the theoretical analysis of generated electrical power of an electromagnetic generator was conducted. Two coils connected in series, wounded around a magnetic spring using copper wire at a diameter of 0.18 mm with 400 turns, with 5 mm of height, 12 mm of internal diameter, and 18 mm of external diameter were considered. In the coil, the voltage is induced according to Faraday’s law. In this case, the transducer force
FT (18), derived from the induced voltage, is included in the external force Equation (1):
where
RL is the the load resistance,
RC is the resistance of the one coil, and e is the induced voltage.
The voltage induced in the coils takes the form:
where
dm is the displacement of the magnet, and
ϕ is the magnetic flux.
This force causes additional damping in the movement of the levitated magnet. The external force
Fz (1) is given by:
The magnetic flux in coils was calculated in ANSYS Maxwell. The magnetic flux approximation equation by Matlab is defined as:
where
dm is the relative displacement of the levitated magnet in coil, and
p1,
p2, and
p3 are coefficients of the magnetic flux approximation equation. These coefficients are shown in
Table 5 for each coil, respectively.
The electrical power obtained by an electromagnetic generator can be calculated by:
The maximum power is generated when the load resistance is equal to the resistance of the coil.
2.3. The Neural Network Model of the Vibration Generator
The vibration generator movements affect the magnetic spring displacement. In order to control the vibrations, the mathematical model presented in the literature of the vibration generator needs to be improved. The vibration generator displacement amplitude and frequency characteristic are nonlinear and complex. Therefore, in this research, the vibration generator is modeled using an artificial neural network (ANN) in order to establish an accurate relation between the amplitude and frequency of current and the amplitude of vibration generator displacement obtained by measurements in the laboratory. The ANN can work continuously and more efficiently than the analytical model and provides a high accuracy after extensive parameter optimization, contrary to the SVM model. Basically, SVM utilizes nonlinear mapping to make the data linear and separable; hence, the kernel function is the key. However, the ANN employs multi-layer connection and various activation functions to deal with nonlinear problems, as in this case.
The ANN is able to perform computational tasks involving multiple entities called neurons (neurons), organized in a network divided into levels (layers), which calculate the value of parameters (weight) useful to minimize a cost function. ANNs are composed of an input layer, one or more hidden layers, and an output layer. Each node, or artificial neuron, has an associated weight and threshold. Each layer, except the last one, is fully connected with neurons to the subsequent layer. A bias neuron represents a biasing feature and produces 1 output in every situation. Input–output transfer functions of neural networks can be easily obtained by a supervised learning process based on empirical data. The network is trained by a suitable algorithm, usually a backpropagation learning algorithm. The latter is used to change the weights
wi and parameters (thresholds) within the same network to minimize the sum of the squared error functions. The weight of an input is the number which, when multiplied by the input
xi, gives the weighted input. The function
g is the unit’s activation function:
where
Each input weight, layer weight, and bias vector has as many rows as the size of the i layer, after the training network bias and weights change. In our case, iw [1,1] is the weight to layer 1 from input 1, iw [1,2] is the weight to layer, b [1] is the bias to layer 1, and b [2] is the bias to layer 2. In a multi-layer feed-forward neural network, artificial neurons are arranged in layers, and all the neurons in each layer are connected to all neurons in the next layer. Each connection between these artificial neurons is assigned a weight value that represents the weight of the connection.
Given the frequency and amplitude current input values of the vibration generator, the neural network feedforward is used to compute the amplitude of the movement of the vibration generator at the output of the multi-layer perceptron (MLP) neural network. In the feedforward process, external input values are first multiplied by their weights and summed. The output y = f(x) is a weighted sum function, called the activation function. The relation between the input variable X and the output variable Y is achieved by adjusting the parameters and weights to reduce errors. The process of finding a set of weights so that the network produces the desired output for a given input is called training. Neural networks learn the relations between different input and output patterns.
The feedforward backpropagation neural network was used to determine a nonlinear mapping from the input vector of the current, specifically frequency and amplitude, and the amplitude of vibration. The input
x is defined as a vector of frequency and amplitude of the current whose waveform was obtained by signal generator AGILENT 33210a amplified by amplifier IRS2092. The amplitude of the current was calculated using fast Fourier transform (FFT). The output
y(
x) is expressed by the amplitude of the vibration generator obtained by the FFT applied to the signal of laser distance meters LK-G32 (25). The training dataset for the network has 140 samples and the validation dataset has 70 samples. The feedforward backpropagation neural network is composed of the input layer with two neurons arranged in the first hidden layer and other two neurons arranged in the second hidden layer using a Log-sigmoid transfer function (logsig), and an output layer with hyperbolic tangent sigmoid transfer function (tangsig), as shown in
Figure 5.
The hyperbolic tangent function has the properties to be differentiable and the output has a range of values of [−1, 1] (different from that [0, 1] of the logistic function), which leads each output of the level to be more or less normalized (i.e., centered around the value 0) at the beginning of training. This often helps speed convergence. The input–output mathematical relation obtained by the ANN is described as follows:
where
Wi is an array containing weights to layer 1 from input 1,
Wh is an array containing weights to the hidden layer,
Wo is an array containing weights to the output layer,
bi is an array containing bias values to layer 1,
bh is an array containing bias values to hidden layer 2, and
bo is an array containing bias values to the output layer. The weights and biases are shown in
Table 6.
The mechanism to update the weight and bias values corresponding to Levenberg–Marquardt optimization was conducted using the network training function (trainbr). The process called Bayesian regularization using trainbr has combined the minimization of the squared error and weights of the network in order to generalize the ANN. The gradient descent with momentum weight and bias learning function (learngdm) is selected for the calculation. The learning curve has exhibited the good performance of the ANN and after 293 epochs obtained an MSE of 0.036 and an excellent generalization due to the fact that the test curve is always under the training curve, as shown in
Figure 6.
2.4. The Simulink Model of Magnetic Spring Based on the Input Signal of the Vibration Generator Obtained by the Neural Network
The magnetic spring and the vibration generator were designed and simulated using a block diagram by Simulink/Matlab to define the mathematical relation between the input (current of vibration generator) and output (displacement of magnetic spring) signal, including the results obtained by the 2-DoF kinematic chain model (12), the ANN (25), and simulation modeling in ANSYS (15) and (16). The input signal of the model is represented by the amplitude and frequency values of the current that supply the vibration generator. The force generated by the vibration generator is the input of the magnetic spring model. The output of the simulated model is represented by the linear and rotational displacement of the magnetic spring. The magnetic spring model is controlled by the magnetic spring force and torque that depend on its displacement. The used model algorithm represents the physical system in multidomain blocks (
Figure 7).
The displacement of the vibration generator is obtained by the input–output equation based on the ANN (
Figure 8).
In the simulation model (
Figure 7), the inputs
I and
f are, respectively, the current amplitude and frequency of the vibration generator. The neural network of the vibration generator is identified by the block
Fz shown in
Figure 8. In
Figure 7, the transposition of the Jacobian of the second joint mass center
Jc2T is obtained by Equation (8). The potential force presented in Equation (15) and damping force for the first joint presented in Equation (13) are contained in block
F1. The potential torque presented in Equation (16) and damping torque for the second joint presented in Equation (14) are contained in block
τ2. The inversion of the inertia matrix
D presented in Equation (10) and Christoffel matrix
C presented in Equation (11) are contained, respectively, in blocks
D−1 and
C. The result of the model is vector
q of the linear and rotational movement of the levitated magnet. In integration blocks, 1/s acceleration and velocity of the levitated magnet are integrated. The movement of the magnet is limited by the magnetic spring design. The derivation block du/dt is a derivative of the position of the levitated magnet velocity.
In
Figure 8, block
y(
x) contains the input–output function for the vibration generator model by the ANN presented in Equation (25). The block sin(2πft) contains a sinusoidal function with the input frequency
f and simulation time
t. The
m2 contains the mass of the levitated magnet.
The mass of the levitated magnet m2 is 1.77 × 10−3 kg and the inertia moment I2 of the levitated magnet around the axis perpendicular to linear movement is calculated from the magnet’s height and radius and equals 1.24 × 10−8 kgm2. The distance a2 between the geometry center of the levitated magnet and the point on which the movement was measured is equal to the radius of the levitated magnet 5 × 10−3 m. The distance ac2 between the geometry center of the levitated magnet and the gravity center of the levitated magnet is assumed to be equal to 5 × 10−4 m. The linear damping coefficients bh1 and bh2 were calculated in the optimization process and each equals 0.045 Ns/m. The linear damping coefficient of the whole magnetic spring b1 is the sum of the linear damping coefficients bh1 and bh2 and it is equal to 0.09 Ns/m. The rotational damping coefficient b2 of the whole magnetic spring is equal to 2 × 10−7 Nms/rad.
In order to take into account the electrical power induced by the inertial generator that contains the magnetic spring, the transducer force is included in the external force block diagram. For the simulation of the magnetic spring without a coil transducer force, FT is equal to 0. For the simulation with the coil transducer force, FT is calculated based on Equation (18). Transducer force depends on the velocity of the magnet in the coil. The voltage is calculated by Equation (19) and the magnetic flux by Equation (21). The generated power is calculated by Equation (22). The voltage and electrical power depend on the velocity of the levitated magnet. The magnetic flux depends on the position of the levitated magnet. The position and velocity are obtained from the simulation in Simulink. The load resistance equals the resistance of the coil, which is 24 Ω.