Modelling and Simulation of a Controlled Solenoid

In this paper a suggested control system for a solenoid coil is proposed. This control model is based on the employment of the electrical part of the solenoid with a conventional proportional, integral, and derivative (PID) controller unit to investigate the performance of the control system. A mathematical model of the system has been derived, and the entire control system simulated via the MATLAB software package. The simulation process included tuning the gain parameters of the controller unit to achieve best behaviour of the system. In the computer simulation, two mathematical models of the electrical part of the solenoid coil were implemented; the first one involved the typical transfer functions of the coil, while the second dealt with an approximate model. The obtained results showed that the control system using the approximate model of the electrical part of the solenoid coil provides a more stable system and can thus be applied with acceptable response.


1.
Introduction In recent decades, the solenoid has been implemented as an electrodynamic device for many electrical and mechanical parts. It behaves like a magnet to implement the effect of electricity upon motion [1]; as such, a solenoid can be considered to be a coil carrying a current that is wound to a suitable size and shape to encapsulate an iron core, named a plunger or armature, which provides rectilinear motion. In several applications, such as fluid systems, solenoids are used as actuator devices and employed as a control element for rapid and safe implementation of switching tasks within fluid, as well as offering low electrical power consumption and compact controller design [2]. In application to control systems, solenoids can be mathematically modelled as electromagnetic circuits in addition to the related mechanical circuits, with one or several electrical inputs used to imply the interactions between currents in coil conductors and their corresponding magnetic fields [3]. The electrical part of the solenoid coil can be represented as a series combination of resistor and inductor elements, while the mechanical subsystem of the solenoid is represented as a mass model with a single conservative node [4]. Many researchers have conducted theoretical and experimental studies to investigate the dynamic response characteristics of the solenoid valve [5]. In other approaches, researchers have applied analysis methods to convert physical models of the solenoid into corresponding mathematical models in order to simulate solenoid valves with variable parameters [6]. The magnetic characteristics of the solenoid have also been studied in several pieces of research, with attempts to verify the performance of the solenoid valve according to specified design rules [7]. It should also be noted that, in some practical applications, the solenoid valve has been implemented as a control element in electromechanical circuits to meet the demands of motion control processes [8]. In this work, the modelling and simulation of the solenoid coil was done based on solenoid parameters, focusing on the electrical part of the solenoid to form a closed loop control system in order to test the response of this control system to the step input signal. The values of resistance and inductance of the solenoid coil were taken to correspond to the laboratory measurements of these elements. A PID controller model was used as a compensator within the

1234567890''""
2nd International Conference on Engineering Sciences IOP Publishing IOP Conf. Series: Materials Science and Engineering 433 (2018) 012082 doi:10.1088/1757-899X/433/1/012082 solenoid control system, and the gain factors of the controller unit were tuned using the MATLAB software package to obtain the overall response of the control system. This paper is thus organised as follows: the basic construction of solenoid is given in section 2; section 3 describes the suggested controller system of the solenoid coil, and the simulation processes are described in section 4; results and concluding remarks are given in section 5.

2.
Modelling of a Solenoid The solenoid under consideration is represented as a coil wound in the shape of a cylinder surrounding a movable iron core, as shown in figure (1). A solenoid can be considered to be an electromagnet device, and as soon as an electrical current passes through the coil, each section of wire generates a strong and uniform magnetic field inside the hollow of the solenoid. The strength of the magnetic field is proportional to the magnitude of the electric current in the coil and the iron core moves inside the casing of the solenoid. The solenoid is energised with the required level of electrical energy via proper electrical connections, and when the supply of electrical current to the coil is cut off, the mechanical parts push the plunger backward to its original position [2]. A mathematical model of the solenoid can be subdivided into its electrical, magnetic, and mechanical parts, as shown in figure (2). The voltage is applied to the electrical subsystem of the solenoid as an input signal with a specified value. The magnetic block then institutes a magnetic force corresponding to the electrical current in the coil, causing a movement of the spool plunger in the mechanical part to a specified distance or position.

Figure 2. Construction of Solenoid Coil
The electrical part of the solenoid coil is a series combination of inductance and resistance and can be considered as an RL circuit, as shown in figure (3) [2]. According to Kirchhoff's voltage law (KVL), the voltage across the solenoid coil is the algebraic sum of the voltages across the inductance and the resistance of the coil; it can thus be calculated as in equation (1).

1234567890''""
where V t = the total voltage applied to the solenoid coil (V); V R = the voltage across the resistance of the solenoid coil (V); V L = the voltage across the Inductance of the solenoid coil (V); and Using the assumption that the initial conditions are equal to zero, taking the Laplace transform of equation (2) gives Therefore, the transfer function of the coil of the solenoid is ( ) 1 By energizing the magnetic circuit of the solenoid with electrical energy, the magnetic force is set up in terms of the electrical current and applied into the armature placed inside the core of the solenoid as shown in figure (4). The produced magnetic force (F m ) of the coil depends on the distance travelled by the plunger (x) as well as the electrical current i (t); this can be calculated as below [5]:  The mechanical system of the solenoid can thus be represented as damper-mass-spring system, as shown in figure (6) [5]. The differential equation describing the motion of the spool in the solenoid is given by ..
where m = mass of the plunger (kg); x = distance of the plunger (m); kx= the spring force (N); c = the damping coefficient; F f = the friction force (N); F m = the magnetic force; and k c = the coil force coefficient.

A Controlled Model of a Solenoid
In the control system application, the conventional solenoid normally operates in two positions or states, either fully open or fully closed. Thus, it can be used in control systems as a two-position control device to maintain a classical position control model [4]. To make the proposed control system involving a conventional solenoid, a controller unit and amplifier unit with unity feedback were implemented, as shown in figure (7). The electrical part of the solenoid is taken under consideration as part of the employed control system to test the response of the solenoid coil to the suggested control system. The PID compensator was selected as a controller unit and inserted in the forward path of the control system, while the amplifier unit contained variable electrical resistance to provide the required amplification or attenuation of the output signal from the solenoid coil. The design of the control system of the solenoid coil was based on taking different values of resistance from the amplifier unit and applying arbitrary values to the controller gain parameters by means of the step input signal to obtain the output response of the system. The transfer functions of the controller unit, the electrical part of the solenoid coil, and the amplifier, as well as the overall transfer function, were obtained as shown in the following equations [3]: ( Equation (9) can be rewritten as

Simulation and Results
Simulations of the controlled system of the solenoid coil were done using the MATLAB software package to run the mathematical model previously obtained, as shown in figure (8) [10]. The error (e) between the input voltage and the output voltage was compensated by the controller unit to produce a voltage (V) that energized the coil of the solenoid valve.

Figure 8. Control System of the Solenoid Coil
The simulation process of the proposed controller system was run according to the measured values of the inductance (L) and resistance (R) of the solenoid coil. Experimentally, the process of calculating the values of the resistance and inductance of the solenoid coil were done in the control laboratory of the mechanical department of the college of engineering at Al-Mustansiriyah University. The values were obtained at room temperature using a digital ohmmeter device to measure the resistance, and a flux meter instrument to obtain the value of the inductance. The practical measured value was nearly equal to 230 Ω ±1% for resistance, while the value of the inductance was approximately 0.98 H [8]. In the suggested control model, the parameters of the PID controller were thus taken as K P =20, K I =10, and K D =10, and the PID controller tuned accordingly via the MATLAB software program. The output current from the coil was treated as an input signal to the amplifier unit and the output signal will be acted as feedback with unity gain to compare with the reference input signal. The impedance of the solenoid (Z Sol ) was the algebraic sum of the impedances of resistance (Z R ) and inductance (Z L ), hence (Ω); and X L = the inductive reactance of the solenoid and 2π = L X fL .
As the measured value of the resistance was much greater than the inductive reactance of the coil the mathematical model of the electrical part of the solenoid previously obtained in equation (5) can be simplified, and the approximated transfer function of the solenoid coil can thus be obtained as The overall transfer function of the control system in the simplified model can thus be written as The overall transfer function of the system (G sys ) in both typical and simplified models is calculated according to the selective gain parameters of the PID controller, as shown in The responses of the solenoid control system for the typical and approximate models are shown in figure (9)   To improve the performance of the solenoid control system, the parameters of the PID controller were tuned via MATLAB, taking R1=100 Ω as an example to observe the step response with a tuned PID controller. The results are displayed in figure (10). For approximate model: Rise time= 2.1 sec , Settling time=3.28 sec.

Conclusions
The objective of this proposed control system was to test the response of the electrical part of the solenoid coil in both a typical and an approximate control model. From the obtained results, the following conclusions can be drawn:  Controlling solenoids by adding amplifier units into the suggested control systems is efficient and has the capability to improve the performance of the overall control systems.  The mathematical structure of the approximate model of a solenoid coil is quite simple; this leads to a reduction in the complexity of the employed controller model of the solenoid.  The approximate control system of the electrical part of the solenoid coil provides similar results to those obtained in typical models based on the desired values of the controller unit.  Although the PID controller offers sufficient and convincing results, other controller models can also be used in activated solenoid coils.