Realization of the Missile Servo System Based on the Application of Microcontroller and Contactless Rotary Position Sensor of the Missile Wings

This paper describes the procedure for the realization of servo systems for the guided missiles. The realized servo system consists of four servo units for driving the missile wings. The servo units are independent of the each other and they are controlled by a 32-bit microcontroller STM32F407. Contactless high resolution magnetic encoders are used as the position sensors of the missile wings. The communication between the microcontroller and the magnetic encoders is realized via the serial port using the SPI protocol. DC motors are used as actuators. The actuator's energy converters are realized in a Hbridge configuration. These converters are controlled by the corresponding pulse width modulation (PWM) signal from the microcontroller. This servo system with four independents servo units makes possible to rotate the missile wings according to the guidance algorithm and at the same time according to the algorithm for the missile rolling control. The steering structures of the servo units are based on the application of the PI controllers.


Introduction
N control engineering a servomechanism, sometimes shortened to servo, is an automatic device that uses errorsensing negative feedback to correct the action of a mechanism.It usually includes a built-in encoder or other position feedback mechanism to ensure the output is achieving the desired effect.
The term correctly applies only to systems where the feedback or error-correction signals help control mechanical position, speed or other parameters.
Positioning servomechanisms were first used in military fire-control and marine navigation equipment.Today servomechanisms are used in automatic machine tools, satellite-tracking antennas, remote control airplanes, automatic navigation systems on boats and planes, and antiaircraft-gun control systems.Other examples are fly-bywire systems in aircraft which use servos to actuate the aircraft's control surfaces, and radio-controlled models which use RC servos for the same purpose.Many autofocus cameras also use a servomechanism to accurately move the lens.A hard disk drive has a magnetic servo system with submicrometre positioning accuracy.In industrial machines, servos are used to perform complex motion, in many applications.
A servomotor is a specific type of motor that is combined with a rotary encoder or a potentiometer to form a servomechanism.This assembly may in turn form part of another servomechanism.A potentiometer provides a simple analog signal to indicate position, while an encoder provides position and usually speed feedback, which by the use of a PID controller allow more precise control of position and thus faster achievement of a stable position (for a given motor power).Potentiometers are subject to drift when the temperature changes whereas encoders are more stable and accurate.
Servomotors are used for both high-end and low-end applications.On the high end are precision industrial components that use a rotary encoder.On the low end are inexpensive radio control servos (RC servos) used in radiocontrolled models which use a free-running motor and a simple potentiometer position sensor with an embedded controller.The term servomotor generally refers to a high-end industrial component while the term servo is most often used to describe the inexpensive devices that employ a potentiometer.Stepper motors are not considered to be servomotors, although they too are used to construct larger servomechanisms.Stepper motors have inherent angular positioning, owing to their construction, and this is generally used in an open-loop manner without feedback.They are generally used for medium-precision applications.
RC servos are used to provide actuation for various mechanical systems such as the steering of a car, the control surfaces on a plane, or the rudder of a boat [1].Due to their affordability, reliability, and simplicity of control by microprocessors, they are often used in small-scale robotics applications.A standard RC receiver (or a microcontroller) sends pulse-width modulation (PWM) signals to the servo.The electronics inside the servo translate the width of the pulse into a position.When the servo is commanded to rotate, the motor is powered until the potentiometer reaches the value corresponding to the commanded position.
A brief description of several technical solutions for missile servo systems is shown in [2].The bandwidths of these technical solutions are within the range of several Hz to several tens of Hz.
This paper presents a description of the servo system synthesis using the following available elements: microcontroller, position sensor, DC motor, reducer and energy converter.

Experimental environment
The servo system described in this paper consists of four interconnected independent servoes.The parts of each of these servoes are shown in Fig. 1: a microcontroller (1), a DC servo motor (2) with a gearbox (3), an energy converter (4), a wing (5) and a contactless position sensor of the wing (6).Microcontroller STM32F407VGT6 was selected because of its low price, processor speed and a wide range of peripheral capabilities.
The servo drive actuator is a DC servo motor "maxon motor 428322, 1949034".This servo motor is supplied in a kit witch consisting of: DC brush motor, reduction gear with ratio 1:28 and incremental encoder.The "Arduino" module "IBT_2" is used as an energy converter.At the base of this converter, the H-bridge is realized using integral circuits BTN7968B and 74HC244D.
The wing is made of aluminum alloy and it is a technical solution developed at the Military Technical Institute in Belgrade.
A contactless AS5048A position sensor is used to determine the angular position of the wing shaft.Reading this sensor is done in 13-bit resolution.The data exchange between the microcontroller and the motion sensor is done through the SPI protocol.
The complete servo system is packaged in one body, which is made up of a rocket flight control module (FCM).The design of this module is a technical solution that was implemented at Military Technical Institute in Belgrade.In Fig. 2, FCM is shown on the test table.Instead of one wing, the imitation of the maximum load of the wing shaft was installed to test the FCM.
Fig. 3 shows a complete experimental environment for the development and testing of the missile servo system.
In addition to the FCM, the experimental environment consists of data acquisition devices, measuring devices, a microcontroller development system, a DC power supply and other tools.

The actuator control
DC motor with parallel excitation was used as an actuator.The input signal for the actuator is the voltage that is applied to the rotor connection, and the output signal of the actuator is the angular velocity.The polarity of the rotor voltage determines the direction of rotation of the motor rotor, and the mean value of the voltage on the rotor determines the angular velocity of the motor rotor.The nominal voltage of the used motor is 24 V. Considering the predominantly integral nature of the DC motor, if an impulse of the appropriate frequency and amplitude has been bring to the rotor of the motor, the mean value of the resulting voltage on the rotor of the motor will be some DC voltage level in the range 0-24V.For defined the impulse frequency, if the ratio of the pulse behavior period and the duration of the pulse is changed according to the same law, the mean value of the voltage level on the rotor of the motor is also changed.It is concluded that with the PWM signal, with appropriate frequency and with the corresponding amplitude of the pulse, it is possible to control the angular speed of the rotor of a DC motor.Relationship between the rotor voltage average value and the level of the PWM signal, for several characteristic cases, is shown in Fig. 4.  If all switches are open, the rotor coil current does not flow and the magnetic field of the stator keeps the rotor stiff.By closing the SW1 and SW4 switches the current circuit is closed through the rotor coil and the rotor angular velocity has one direction.By opening the SW1 and SW4 switches and closing the switches SW2 and SW3, the direction of the current through the rotor coil has been changed, resulting in a change in the direction of the rotor angular velocity.

Programming the microcontroller
The application "STM32CubeMX", version 4.24.0, was used for the microcontroller programming.Microcontroller STM32F407VGT6 is selected from the drop-down menus.After selecting the appropriate microcontroller, it is necessary to initialize the periphery of the microcontroller, to the extent necessary for the realization of the idea.
The first step is to configure the microcontroller periphery.The high speed processor clock (HSE) is clocked with external crystal / ceramic resonator is selected.SPI3 protocol for full duplex SPI communication in "master" mode is activated.The processor clock is used for the time base.Timers TIM1 and TIM8, with internal clock, are used to generate control PWM signal for four actuators.Each actuator is assigned with two PWM signals.Timer TIM2, with internal clock, is used as a time base for generating the interrupt requests.Generation of these interruptions is performed in order to periodically read the state of the missile wing position sensor.
The next step is the processor and peripheral clock configuration.The frequency of the peripheral clock is set to the maximum values by selecting the oscillator frequency on 25 MHz and the system clock on168 MHz.
The parameters of the activated periphery are configured after the configuration of the system clock.
The configuration of the SPI communication is done according to the following: Data Size (8 Bits), First Bit (MSB First), Baud Rate (1.3125 Mbits / s), Clock Polarity (Low) and Clock Phase (1 Edge).
The timer configuration TIM2 and TIM8 was performed according to the following: Prescaler (79), Counter Mode (Up), Counter Period (500).Other parameters are left by difolt.
The motors 1, 2, 3 and 4 correspond to the pairs of pins (PE9, PE11), (PE13, PE14), (PC6, PC7) and (PC8, PC9), respectively.A pair of pins (X, Y) represent the pins generating the PWM signal for the respective motor (X for the positive direction and Y for the negative direction of rotation of the motor rotor).
Pin PD1 is the output pin to which the LE diode is connected in order to indicate certain conditions.Fig. 6 shows the appearance of the graphical environment for configuring the microcontroller STM32F407VGT6.
After executing the microcontroller configuration, the source code generation should be started.
The source code is the environment for writing the code for reading the position sensor of the wings and programming of the actuator control algorithm.

Reading data from the wing position sensor
As already mentioned, the exchange of data between the microcontroller and the position sensor is done via the SPI protocol.The AS5048A is a 14-bit position sensor.A block diagram of the sensor is shown in Fig. 7.The sensor actually determines the absolute position of the magnet that should be located directly above or directly below, the sensor.The information about the absolute position of the magnet is directly accessible via the PWM signal, and can be read directly through the SPI protocol.The obtained information is the position of the magnet in the range 0-360˚.The position information is stored in a 14-bit registry.However, the range of the magnet position 0-360˚ corresponds to the range of values 2^13 -(2^14-1).So, the sensor has a 13-bit resolution.In this way, simple calibration of the sensor is enabled.
In the concrete case, the calibration of the sensor is done by positioning the wing in a position with zero deflection.Then the value of the sensor is read and this value is entered into a special register for the memory of the offset.Each next reading of the sensor gives the value of the absolute position of the magnet reduced by the memorized offset.Sensor calibration can be performed only once.
The microcontroller can exchange data with multiple sensors via a single SPI port.Sensors can be connected on a daisy chain or in parallel (separate chip select).The SPI communication timing diagram is shown in Fig. 8, and the characteristic time values in Fig. 9.

Parametric identification of the actuator
The parametric identification of the actuator was made based on the actuator response to the bipolar pulse excutation.The function "ident" from the Matlab software package was used for the parametric identification.Application of the function "ident" and Graphical User Interface of MATLAB has been presented in [3].Fig. 10 shows the input and output signals on the basis of which the identification was performed.The recording of the actuator response was performed on the missile flight control module shown in Fig. 2, with no added load.The frequency of the input signal is 4 Hz, the amplitude is 24 V, and the sampling time is 1 ms.It has been experimentally established that in this case the operating point of the actuator corresponding to the nominal actuator mode.The adopted models of the actuator, with the identified parameters, are presented in the equations ( 1) and (2).1.9119 10 ( ) 1 2.3123 10 G s s The bandwidth of the feedback system In order to determine the bandwidth of the servo mechanism, the wing position feedback was closed and the response of the servo mechanism to the desired position of the wing was measured.The wings' position values are strangled in the form of sinusoidal functions of the same amplitude (5°), and different frequencies.The control variable of the PI controller is calculated according to the following: On the basis of the obtained responses, the frequency diagrams were recorded and shown in Figures 13 and 14.The bandwidth frequency of the servo system for used input amplitude is 10 Hz.

Conclusion
This paper describes the procedure for the realization of the missile servo system.The realized servo system enables the acquisition of all variables that are necessary for parameter identification of the system and determination of its dynamic characteristics.The results obtained in the parameter identification and recording of the frequency characteristics of a single servo mechanism, are presented.
In further work it is necessary to examine the dynamic properties of the loaded servo mechanism, as well as the servo system as a whole.

Figure 1 .
Figure 1.Parts of the servo unit

Figure 2 .
Figure 2. The missile flight control module, on the test bench

Figure 3 .
Figure 3. Experimental environment The servo drive unit has a 1:9 reduction ratio and represents a technical solution developed at Military Technical Institute in Belgrade.The "Arduino" module "IBT_2" is used as an energy converter.At the base of this converter, the H-bridge is realized using integral circuits BTN7968B and 74HC244D.The wing is made of aluminum alloy and it is a technical solution developed at the Military Technical Institute in Belgrade.A contactless AS5048A position sensor is used to determine the angular position of the wing shaft.Reading this sensor is done in 13-bit resolution.The data exchange between the microcontroller and the motion sensor is done through the SPI protocol.The complete servo system is packaged in one body, which is made up of a rocket flight control module (FCM).The design of this module is a technical solution that was implemented at Military Technical Institute in Belgrade.In Fig.2, FCM is shown on the test table.Instead of one wing, the imitation of the maximum load of the wing shaft was installed to test the FCM.Fig.3shows a complete experimental environment for the development and testing of the missile servo system.In addition to the FCM, the experimental environment consists of data acquisition devices, measuring devices, a microcontroller development system, a DC power supply and other tools.

Figure 4 .
Figure 4. PWM timing diagramThe block diagram of the energy converter is shown in Fig.5.Signal "Power" represents a positively polarized PWM signal that carries information about the intensity of the desired angular speed of the motor rotor.The direction of the angular velocity of the motor rotor depends on the direction of the current through the rotor.

Figure 5 .
Figure 5. Principal block diagram of the energy converter with H bridge.

Figure 6 .
Figure 6.GUI for configuring the microcontroller.

Figure 7 .
Figure 7. Block diagram of the position sensor.

Figure 10 .
Figure 10.Input and output signals A parametric identification of two models of the actuator was performed.The first model is with two real poles, and the second model is with one real pole.Measured and simulated outputs of the above models are shown in Figures 11 and 12, respectively.

Figure 11 .
Figure 11.Measured and simulated model output.Two poles.

Figure 12 .
Figure 12.Measured and simulated model output.One pole.