Research on the linkage of dual servo motors based on electronic cam curves

For the servo dual motor linkage lag and large error problems, electronic cam curve planning is introduced. This servo system uses Microchip's MPLAB development platform and consists of a digital servo driver, two servo motors, etc. The servo motors use a vector control strategy. The position command of the slave servo motor is calculated according to the speed of the spindle motor and the electronic cam table, and the reciprocating motion of the motor pendulum is realised by simulating a mechanical cam, and the five-term and one-term curves are used to articulate with each other in the acceleration, uniform speed and deceleration stages. The experimental results show that with the electronic cam scheme, the servo system combines the advantages of high response speed and high control accuracy, while the curve planning and parameters are easy to adjust and meet the requirements of industrial production.


Introduction
The electronicisation of machinery and the softwareisation of hardware has become the trend in industrial automation today. The electronic cam is a method of using mathematical algorithms to realise "cam curves" instead of mechanical cams, which can be designed for linear reciprocating movements, reciprocating oscillations and various types of variable speed movements according to actual requirements. The essence is to transform the law of motion of the slave axis and the position of the spindle servo motor into a functional relationship. Electronic cams are now widely used in advanced manufacturing industries such as automotive manufacturing, machining, printing, metallurgy, textiles, food packaging, water conservancy and hydropower.
In industry servo motors are widely used in the design of electronic cams because of their high response speed and high control accuracy. The servo system studied in this paper is mainly based on the MPLAB development platform, using the efficient computing and processing capability of the ARM chip to achieve the linkage of two servo motors by means of a digital driver. When the spindle servo motor is set to turn i turns, the corresponding slave servo motor pendulum needs to swing the set position angle, and so on and so forth, and the control position error is required to be within 1%. It is therefore important to design an electronic cam curve that meets the requirements and gives the best performance of this servo system with a low level of error.

Dual servo motor systems
Both motors of this servo system are permanent magnet synchronous motors (PMSM), which have the advantages of simple structure, small size, high power factor and high power density and are widely used in industrial production. As the PMSM is a non-linear, strongly coupled, non-linear system, a 2 mathematical model is required in order to design a highly efficient control algorithm. We specify the positive direction of motor rotation as counterclockwise in a three-phase coordinate system and make the following assumptions: (1) core saturation is neglected and eddy currents and core losses are not accounted for; (2) the conductivity of the permanent magnet material is zero; (3) there is no damping winding on the rotor; (4) the induced electric potential in the phase windings is sinusoidal. Then the voltage equation of the PMSM in the stationary abc coordinate system is as follows: In the formula s R is the resistance of the stator winding, , , In the field of vector control, in order to facilitate the analysis of the motor operation process, the three-phase motor current is transformed into a set of mutually perpendicular components, which are then controlled. Therefore, we convert the three-phase stationary coordinate system into a two-phase stationary coordinate system by means of the clark and park transformations, and then convert the two-phase stationary axes into two-phase rotational axes by means of the matrix. The voltage equation for the dq-axis after the conversion is as follows: From the resulting equation for the dq axis, we can derive the equation for the electromagnetic torque: The equation of mechanical motion can be expressed as:  Currently, field-oriented control (FOC) is the most common PMSM control strategy in the field of servo motor control. The dq-axis current command value is obtained through the current regulator (ACR) and the dq-axis control voltage is transformed to the αβ stationary coordinate system, then the three-phase inverter is controlled by the SIN Pulse Width Modulation (SVPWM) technology to supply 3 power to the PMSM. As the PMSM requires accurate position control, the position loop is added here to form a triple closed loop FOC control, the overall control loop is shown in Figure 1. The most critical part is the processing of the position information from the encoder feedback by the controller and the output of the position loop command, which is the key to realising the accurate linkage of the two servo motors.

Electronic cam curve planning
The electronic cam curve describes the position correspondence between the master and slave axes. The relationship function is constructed according to the relative position change of the master and slave axes, with the angle of the spindle servo motor as the independent variable and the swing angle of the following motor as the dependent variable. The general equation of the polynomial electronic cam curve describing the position of the master and slave motors is as follows: In the formula S represents the change in angle of swing from the axis, x is the angle of rotation of the spindle motor and 1 2 , , , n c c c  is a coefficient to be determined. In order to reduce the computational complexity of the system program, the function variable x will be quantized dimensionless to the interval [0-1]. When it is a primary term, it is expressed on the servomotor as a uniform motion or stationary state, with a rigid shock at the speed switching point.To reduce the rigid shocks that can occur at the speed switching point. The start and end of the stroke need to be bridged with other types of motion law, here we use a five-term curve for the bridging transition. When According to the boundary conditions, the initial and end state equations can be obtained: Combining the above equations one can solve for the individual coefficients of the fifth degree polynomial as: According to the above equation, the coordinated control of the two-axis motor position requires that the spindle motor moves at constant speed and the slave motor follows the spindle motor in a reciprocating variable speed motion. The trajectory of the slave motor is divided into three different phases: acceleration, constant speed and deceleration. The time used for a single swing angle of the slave motor is T. The proportion of each of the three periods is set in advance, the initial value of each stage is taken, the switching point is calculated and the trajectory of the spindle and slave motor positions is planned. The planning curve is shown in Fig. 2

Fig. 2 Electronic cam curve planning
When the spindle turns i turns and the slave motor oscillates at a set angle, the following ratio of the servo system is . The design of the slave motor has three main states: acceleration, constant speed and deceleration. The electronic cam table calculates the correspondence between the spindle and the following axis for each state according to the time ratio, in order to achieve precise control.

Experimental design and data analysis
The servo system uses Microchip's MPLAB software as the development environment for the user control program, a 32-bit ARM Cortex-M7 MCU chip with a maximum main frequency of 300 MHz and a DC bus voltage of 280 V. The spindle servo motor for speed control uses an incremental encoder with a resolution of 4000 pulses; the slave servo motor for The position control of the slave servo motor is carried out using a 17-wire absolute encoder from Tamagawa with a resolution of 2 17 pulses.
The overall experimental platform design for the servo control system is shown in Figure 3.  According to the above electronic cam curve design algorithm combined with the servo motor vector control, set the following ratio i = 3, the spindle motor speed is 6000rpm, the slave motor from 0 ° -76 ° -0 ° to do reciprocating motion, the sampling period is 0.5ms.
The master-slave motor position response curve and the slave motor speed response curve are shown in Figure 4:  .188% The experimental data shows that within the rated speed range of the servo motor, the electronic cam curve planning can control the following ratio error of the master and slave axis and the following error of the slave axis position to fluctuate within a small range, the following ratio error is controlled between -0.3% and 0.3%, the error of swing and following are far less than 1% of the industrial requirements, the whole servo system response speed, high positioning accuracy, stable motion, to meet the Industrial production requirements.

Conclusion
In this paper, for the linkage system of two permanent magnet synchronous motors, three closed-loop FOC control is achieved by establishing the mathematical model of the servo motor; the designed 5term electronic cam curve can make the servo motor substantially eliminate mechanical hard shocks in the operation process, and realize the key position and process motion of the slave motor in the operation process is completely controllable; In the experimental design, the servo system based on FOC and electronic cam curve planning achieves the desired speed and accuracy requirements and is able to perform movements that cannot be performed by traditional mechanical cam systems, extending the application of electronic cams in servo systems. In the context of the national smart industrial manufacturing policy, this study is of greater relevance. In order to further reduce the operating error of the two permanent magnet synchronous motors, subsequent research directions are mainly directed towards the deadband compensation of the inverter and the inclusion of a position feedforward role in the control loop.