Share this

DSP-based short-stroke linear motor position control

2026-04-06 04:35:10 · · #1
As an electromechanical transmission device, the linear motor simplifies the mechanical structure of traditional drive components and puts forward higher requirements for its current, speed and position control parts. Its biggest feature is that it meets the higher requirements of people for the servo performance of machine tool feed system, namely higher driving capability, faster feed speed and more accurate positioning accuracy. In the past ten years, with the development of advanced manufacturing technologies such as precision manufacturing and CNC technology, high speed, high efficiency and high precision have become the development direction of current CNC equipment. The linear motor has become a hot research topic with its high dynamic response capability[1]. In high-precision linear motor position control, position detection is one of its key technologies, which directly affects the control accuracy of the control system. The grating ruler is a key component for linear motor displacement detection. Therefore, the detection and processing of the output signal of the grating ruler is an important part of the closed-loop control of linear motor position. The DSP2407 Digital Signal Processor (DSP) is a microprocessor chip from TI specifically designed for motor control. It features high-speed computing power and an Event Manager (EV) module particularly well-suited for motor control. The EV module includes a Quadrature Encoded Pulse (QEP) circuit, which can be used to acquire the position information of the linear motor, making it easy to implement position control of the linear motor using the DSP. The linear motor developed in this project requires a positioning accuracy of 2μm, a response frequency of 20Hz, and a travel range within 10mm. Linear Motor Position Detection In the control system of a linear motor, to achieve precise control of linear displacement, it is necessary to detect it using a high-precision detection device. The detection results are converted into digital quantities and fed back to the DSP, which then processes these data. With the development of grating fabrication technology, electronic technology, continuous improvement of grating moiré fringe subdivision technology, and the tremendous progress in computer processing technology, grating technology has developed rapidly. In the position detection and control of linear motors, the use of grating rulers for high-speed, high-precision position detection has been widely applied. [b]Characteristics of Linear Grating Sensors for Displacement Detection[/b] Using linear grating sensors for motor position detection offers the following advantages: The grating sensor outputs a digital signal, easily interfaced with a DSP; it enables high-precision displacement measurement. Precise photolithography and electronic subdivision techniques, along with the local error elimination effect of moiré fringes, make the grating sensor's measurement accuracy second only to laser measurement, while at a significantly lower cost. Measurement error can be controlled within 0.2–0.4 μm/m, with an accuracy of 0.5–3 μm/m and a resolution of 0.1 μm. It allows for large-range, high-resolution measurements, with a measurement range reaching tens of meters. It has strong anti-interference capabilities. The digital signal output uses RS422TTL. The signal processing circuit is simple and reliable. Ordinary resolution and accuracy grating sensors typically assemble the signal processing circuit and grating components together, resulting in a small size and a driver-equipped output interface suitable for long-distance transmission. Grating Detection and its Output Signal Due to the above advantages, grating sensors are used here to detect motor displacement. The grating ruler used in this project is the JENA LIE5 2PLXFDO type grating ruler manufactured by JENA GmbH, Germany, with a measurement accuracy of 1μm. The grating sensor detects the movement of moiré fringes by amplifying the displacement between a fixed grating and a moving grating. The relationship between the fringe spacing B, the grating pitch W, and the angle between the two grating lines is as follows: When the gratings move relative to each other, the moiré fringes move along the direction of the lines. For every grating pitch moved, the moiré fringes also move by one pitch B. Simultaneously, the photosensitive element on the indicator grating receives a light pulse and outputs a corresponding electrical pulse. By counting the number of electrical pulses, the displacement x of the scale grating can be measured, where i is the number of pulses. Therefore, the detection is essentially counting the number of pulses output by the grating. Figure 1 shows the grating output signal. The output waveform of the photosensitive element is approximately a sine wave, which is then shaped into a square wave by a shaping circuit. The grating signal obtained by using a photoelectric element can only count. In order to determine the direction of motion, two photosensitive elements with a distance of W/4 are installed on the indicator grating, and the phase difference between the two output signals is 90°. This is the orthogonal encoded pulse signal. At the same time, in order to improve the measurement accuracy, the Mohr fringes of the grating need to be subdivided [2]. In the output of the grating ruler, there is also a reference point signal, which is used to determine the zero point of displacement. It has two light-transmitting holes on the two gratings. Only when light can pass through the two holes will a pulse be output. Figure 1 shows the output signal of the grating ruler. In Figure 1, a and b are the grating displacement signals, and c is the reference point signal. Figure 2 Connection diagram of grating signal and DSP [b]DSP processing of grating output signal DSP characteristics[/b] The TMS320LF2407 DSP chip used here integrates high-speed computing power and high-speed control capability for motors. It can realize the replacement of analog devices with software, conveniently modify control strategies and parameters, and has fault monitoring, self-diagnosis and upper and lower computer management and communication functions. Its internal bus is a Harvard architecture, and the instruction execution speed is 30MIPS. Most instructions can be executed in a single cycle, which enables the control system to process related calculations quickly. It has abundant resources, especially two event manager modules (EVA and EVB, which have the same structure but different register names), which can easily program and control the motor. The event manager has four general-purpose timers Tn (n=1, 2, 3, 4, two each of EVA and EVB, and each timer also has a comparison register and a period register), six full comparison units, six capture units and two QEP circuits. The general-purpose timer of the DSP's event manager module is used to generate the sampling period (using T1) and serve as the time base for the QEP circuit (using T2). The QEP circuit is used to connect the orthogonal encoded signal output by the grating and count the orthogonal encoded pulse signal output by the grating ruler. The CAP module is used to capture the count value in the counter of the general-purpose timer [3]. Acquisition and processing of displacement signals Before processing the displacement signal, the signal must first be obtained. After the signal is detected by the grating sensor, the DSP is used to acquire the signal. As shown in Figure 1, the grating sensor outputs three signals. The orthogonal encoded pulse signals a and b from these three signals are input to the QEP pin of the DSP, as shown in Figure 2. QEP1 and QEP2 are used to receive the a and b pulse signals from the grating, respectively. They are based on a general-purpose timer T2. Timer T2 counts each rising and falling edge of the two pulses, incrementing or decrementing the counter with each rising or falling edge. As shown in Figure 2, when counting pulse signals a and b, the clock source used is CLK, with a frequency four times that of the orthogonal encoded pulses. Knowing the displacement (i.e., pulse equivalent) represented by each detected pulse allows us to calculate the actual displacement. The counting direction is determined by the connection of the two pulse signals: if QEP1 is connected to the leading waveform of the two pulse signals, the count is incremented; otherwise, the count is decremented, as shown by the DIR signal in Figure 1. CAP3 is used to capture the number of pulses. It is connected to the capture drive signal T1PWM. The sampling period is generated by the general-purpose timer T1 of the DSP. After one period of time, a transition is output on the T1PWM pin. When a transition is detected on the CAP3 pin, the value in the counter of the T2 timer at that moment is loaded into a register, which is the displacement at that moment. After obtaining the number of pulses at a certain moment, it can be compared with the total number of pulses (the quotient of the predetermined displacement and the pulse equivalent). This is the displacement deviation at that moment. The deviation is substituted into the PID algorithm to calculate the required output voltage, which is used to drive the motor. Signal c in Figure 2 is the reference point signal of the two grating rulers of the grating sensor, which can be used as the zero point for measuring displacement. [b]Linear Motor Position Control Scheme[/b] Figure 3 Control Scheme Diagram The servo control system of the linear motor is a closed-loop system. When the linear motor moves, the grating sensor continuously detects the displacement of the linear motor, and the generated orthogonal coded pulse signal is input to the DSP as position feedback. The DSP compares the predetermined displacement of the linear motor with the detected current displacement, and the PID algorithm outputs the corresponding voltage to the power amplifier to drive the linear motor. This is the motor control scheme, and its block diagram is shown in Figure 3. In the control process of the linear motor, it is necessary to achieve precise positioning of the linear motor and a response frequency within a certain range. For the former, a suitable control algorithm needs to be selected. PID control is a relatively mature and widely used method in control systems. Its structure is simple, the parameters are easy to adjust, and it does not necessarily require knowing the exact model of the system. Therefore, this control scheme adopts it as the control algorithm. For the latter, an appropriate sampling period needs to be selected. A shorter sampling period results in a smaller displacement of the motor between two samples, which can achieve more accurate displacement detection, but at the same time, it will reduce the response frequency of the linear motor. The corresponding control system software consists of a main program and interrupt subroutines. The main program completes the initialization of the chip and various variables, waiting for the occurrence of interrupts, etc.; the subroutines include interrupt capture, PDPINT protection interrupt, PID algorithm implementation, etc. PID Algorithm and Determination of Control Parameters The control algorithm adopts the incremental digital PID algorithm. The PID algorithm is to form the control quantity by linearly combining the proportional (P), integral (I), and derivative (D) of the deviation. The control law of the analog PID controller is digitized according to formula (3). With the displacement deviation as the input, formula (4) can be obtained. Subtract the predetermined displacement from the displacement measured by the grating ruler each time. Substitute the resulting deviation into ek, ek-1 and ek-2 to calculate the change in the required output control voltage [4]. Figure 4 PID control position curve An important part of PID control is the determination of control parameters KP, TI and TD. In motor control, the system must first be stable. When the given value changes, the controlled variable should be able to track quickly and smoothly, and the overshoot should be small. Under various disturbances, the controlled variable should be able to stay near the given value. There are two available methods for selecting PID parameters: theoretical design method and experimental determination method. The premise of the theoretical design method to determine the PID control parameters is to have an accurate mathematical model of the controlled object, which is often difficult in motor control. Therefore, the experimental determination method is used to select the PID control parameters. The trial-and-error method is an effective experimental method. It involves observing the response curve of the system by simulating or running the system in a closed loop, and then changing the parameters according to the approximate influence of each control parameter on the system response. The trial-and-error method is repeated until a satisfactory response is obtained. After repeated trial-and-error, KP = 6.0, TI = 0.2, and TD = 1.2 were obtained. The simulation curve is shown in Figure 4. Using these parameters can make the system respond quickly, reach stability quickly, and have a small overshoot, which well meets the system requirements. In equation (4), ek, ek-1, and ek-2 are the deviations between the predetermined displacement and the detected displacement. Each time a sample is taken, it needs to be updated and stored in the array e[3]. The flowchart of the PID algorithm is shown in Figure 5. Figure 5 PID algorithm flowchart Determination of sampling period The sampling period determines the positioning accuracy and response frequency of the motor. The smaller the sampling period, the closer the digital control effect is to continuous control, and the higher the control accuracy. However, it will increase the computational load of the DSP, slow down the running speed of the motor, and affect its response frequency. Therefore, when actually selecting the sampling period, it is necessary to consider both the needs and the possibilities. The factors to be considered are as follows: From the perspective of regulation quality and digital PID algorithm requirements, the sampling period should be shorter. Otherwise, the sampled signal cannot reflect the transient process of the system. From the perspective of the dynamic performance and anti-interference performance of the control system, the sampling period should also be shorter. In this way, the change of the given value can be obtained quickly through sampling, without generating a large delay in the control. In addition, for low-frequency disturbances, a short sampling period can be used to quickly correct them. From the perspective of response frequency, the sampling period should be longer, which can reduce the computational load of the DSP and reduce the number of steps of the motor movement, thereby increasing the speed and frequency of the motor operation. From the perspective of the amount of computational work that the DSP needs to complete in one sampling period, the sampling period should be longer to ensure that the DSP has sufficient real-time computation time and processing time [4]. From the above analysis, it can be seen that the requirements of various factors on the sampling period are different and even contradictory. Therefore, it is necessary to make a comprehensive selection based on the specific situation and requirements. Here, a variable sampling period is adopted. Because a long sampling period can be used during the period when the motor is moving from its starting position, which is far from the predetermined position, speed can be the primary consideration. Once the motor has reached a certain position, the sampling period is reduced to prioritize positioning accuracy. This achieves a balance between positioning accuracy and motor response frequency. Moreover, this is easily implemented by a DSP. The implementation method is as follows: the sampling period is changed in the compare interrupt of the general-purpose timer T2, and the original sampling period is restored in the period interrupt. The former occurs when the motor moves to the position where the sampling period needs to be changed (i.e., when the value of the T2 counter equals the value of the compare register), and the latter occurs when the motor moves to the predetermined position (i.e., when the value of the T2 counter equals the value of the period register). Conclusion The linear motor developed uses a high-precision linear grating ruler to detect its displacement and a TI-manufactured DSP as the controller. During movement, the DSP samples the displacement signal output by the grating ruler, and a PID control algorithm is used to control the motor's movement. The expected displacement accuracy and frequency response are achieved, and the operation is reliable with flexible programming.
Read next

CATDOLL 138CM Tami TPE

Height: 138cm Weight: 26kg Shoulder Width: 30cm Bust/Waist/Hip: 65/61/76cm Oral Depth: 3-5cm Vaginal Depth: 3-15cm Anal...

Articles 2026-02-22
CATDOLL 146CM Vivian TPE

CATDOLL 146CM Vivian TPE

Articles
2026-02-22
CATDOLL 135CM Vivian

CATDOLL 135CM Vivian

Articles
2026-02-22