Design of servo control system based on DSP

2022-06-22
  • Detail

Design of servo control system based on DSP

field operation tends to use man-machine interface. MT500 series touch screen is specially designed for PLC applications. It uses RS-232 and RS485 communication protocols to quickly and reliably read and write PLC internal data. In this paper, DSP is used to communicate with PLC directly, and each servo control board on ISA slot is controlled synchronously according to PLC node status. We use isa slot, but it is completely different from the ISA bus of PC. the introduction of ISA slot only provides standards for system design. All arbitration and most data calculation are completed by the main control board, so the design of the main control board is the key to the system design

system structure

the overall structure of the system is shown in Figure 1:

Figure 1 overall block diagram of the servo system

the control objects of the system are multiple circular motors and one belt guide main motor. The circular motor always follows the main motor. The system should keep the linear speed of each circle and belt guide synchronized. The main control board controls the bus of the system. Other boards (such as speed board and servo board) are in the slave position. DSP periodically sends data to each servo board and speed board. The touch screen communicates with PLC through serial port. Each touch screen is equipped with corresponding software and contains a large number of component libraries. These components can be used to realize various displays on the panel, such as indicator light, numerical display and input, text display and input, alarm, trend chart, etc. The communication between the touch screen and PLC is bidirectional, which can display or modify the data in the PLC. Therefore, the touch screen can replace the function of the panel. The function of the main control board is to control the process of the system, receive the field status from PLC through the serial port, and thus control the working status of the whole system. Specifically, it communicates with the speed board through the ISA slot to give the current working speed of the belt guide motor. Since the circular tracking guide belt is the main working state in the production process, it is also the easiest to collect the feedback of the master motor from the master control board. The position detection element of the master guide motor adopts a 5000p/r photoelectric encoder with a digital detection element, which is installed on the shaft of the passive roller of the printing machine, and its feedback is sent to the master control board

the circular motor drive unit adopts the full digital AC servo driver and supporting AC servo motor of Panasonic company. The position detection element of the circular motor adopts the servo motor with a 2500p/r photoelectric encoder, which is directly connected with the output shaft of the motor. The AC servo driver control board completes the control of the servo driver and the acquisition of the position feedback signal, and realizes the position semi closed-loop control of the circular motor

cupping experiment is an effective method to test the stamping performance of stainless steel materials. The principle of main control board design

the principle of main control board

Figure 2 shows the hardware schematic diagram of main control board. When the main control board controls the system, the following work should be completed:

Figure 2 Hardware schematic diagram of main control board

● realize data exchange with PLC

Stop, base speed, tracking, automatic deceleration, etc; System parameter settings, such as friction coefficient settings. Because the real-time requirement of these information is not very high, serial communication is adopted

● control the bus and communicate with the board on the bus

the communication based on ISA slot is adopted. The ISA bus here is arbitrated and controlled by the main control board. However, in recent years, with the depletion of these non renewable resources. The data communicated between the main control board and the servo board includes the speed setting value and some special command characters, which are used to control the operation mode of the servo motor. All data and addresses on the main control board are locked and processed by CPLD, which enhances the bus driving ability and ensures that the i/o operation of DSP can send and receive data smoothly

● acquisition of feedback signal of master motor

collect the speed value of the guide belt through the master motor encoder, and send these values to the servo board through the bus, so that it can track the speed of the guide belt quickly and accurately. The quadrature encoder pulse (QEP) capture unit in DSP can directly process two quadrature output signals of the photoelectric encoder. The QEP unit captures the rising and falling edges of the two input orthogonal signals, automatically judges the positive and negative rotation of the motor according to the phase relationship of the two signals, and counts the captured signals accordingly. In the program, the current count value and count direction can be easily read, that is, the angular displacement and steering of the motor; The motor speed can be obtained from the frequency of the counting pulse

● the global clock and the synchronization interrupt signal generate the sending pulse circuit between the

servo boards. If there is no reference clock, there will be cumulative error between them. Therefore, the system needs a global clock, which provides a synchronization reference for all control boards in the ISA slot. The global clock is sent by the crystal oscillator signal driven by CPLD after being processed by DSP, and the frequency is the same as that of cpuclk of DSP. In the system, the running speed of conduction band and circle is obtained within the sampling period. The circle should track the running speed of the guide band in real time. The shorter the given period is, the better the effect of the circle speed tracking will be. In order to control the synchronous action of each servo control board, a synchronous control signal is designed in the system

software design of the main control board

Figure 3 is the main program flow chart of the system main control board

Figure 3 main program flow chart of the main control board

the main control board software can be divided into two modules, which complete task scheduling and management, and interrupt service

● task scheduling and management

realize the communication between DSP and PLC. DSP uses the query method to obtain the status changes of PLC nodes. The whole module is a main cycle. The system uses Omron series PLC, which has a special communication frame format, and the communication function needs to be written on DSP. In this paper, the command words commonly used by PLC include RR (read ir/sr area), RD (read DM area), WR (write ir/sr area), WD (write DM area) and SC (write status). During actual operation, the nodes in the IR area of PLC correspond to the status of each button and switch on the control panel. Common parameter settings and some display data are placed in DM area, which can be maintained for a long time after power failure. The following figure shows the frame format of SC (write state), in which the short cell represents one byte and the long cell represents two bytes of data. In the program, the data is filled into the buffer area according to the frame format, and then the data in the buffer area is successively filled into scitxbuf to realize data transmission. Receiving data is similar to sending

no matter whether DSP reads or writes data, PLC will have a response frame. DSP can know whether the communication is successful according to the response information. The serial port operates at a rate of 9600bps, and the maximum length of all command frames is 19 bytes, which can ensure the normal communication even in the harsh industrial field environment

dsp always keeps communication with several PLC nodes in the program main cycle, and can control the state changes of each node in milliseconds, so the real-time performance of the system is very good. To ensure the real-time performance of the system, the program also needs to provide sufficient communication exception handling. Otherwise, during the communication between DSP and PLC, if the response frame of PLC is not received or the response frame is wrong, the system will crash or the state will be confused. In terms of communication abnormality detection, the program adopts timer timeout detection and response frame detection. When an error is found, the data frame is retransmitted. If the number of retransmissions exceeds the limit, the PLC node detection is skipped, and the system state remains the same. After the above measures are taken, the system can operate normally unless the communication line between DSP and PLC is physically interrupted

● interrupt service program

the interrupt used by DSP is the periodic interrupt of timer 1, and the interrupt program alternately executes two sub modules. In the first sub module, the DSP sends data to the speed board to control the band guide speed; In the second sub module, DSP receives the main motor coding feedback and sends it to each servo control board on ISA bus after processing. Other interrupts are shielded in this interrupt program, so its priority is the highest. In this way, it can ensure that all round data can be sent in real time and complete synchronous tracking. DSP has a single cycle instruction execution time of 50ns. 20000 instructions can be executed in millisecond level cycle interrupts, while there are only a few hundred instructions in the actual interrupt service program. Therefore, DSP can quickly execute the interrupt program, leaving enough time to execute the main cycle program. Even if the periodic interruption occurs when the data is being transmitted between DSP and PLC, the normal serial communication can be ensured

conclusion

in order to avoid the bottleneck of slow acquisition speed of industrial computer, this paper designs a new scheme based on DSP. Because the bus cycle of the system is consistent with that of the DSP, the data transfer and acquisition speed of the system is much higher than that of the general bus. An important problem in the design of the main control board is to ensure the reliability of the serial communication between DSP and PLC. The system has been running well in the production process. (end)

饭后腹胀是怎么回事
工作压力导致性功能障碍
2岁宝宝肚子疼怎么办
怎样提高精子质量

Copyright © 2011 JIN SHI