introduction
With the development of science and technology, humanity has made tremendous progress in many fields such as microelectronics, computers, power electronics, and motor manufacturing, directly driving the rapid development and widespread application of servo control technology. Its applications are increasingly widespread in various CNC equipment, industrial robots, large-scale integrated circuit manufacturing, transportation, manned spacecraft, power tools, and household appliances. This paper proposes a design scheme for a motor servo control system based on DSP and a power module.
In the late 1990s, with the rapid development of digital signal processing technology and very large-scale integrated circuits (VLSI), some high-performance, low-cost DSP chips emerged. These chips integrated the DSP core, control peripherals, and large-capacity on-chip memory onto a single chip. They could execute complex, high-precision control algorithms in real time, reduce the delay between sensor sampling signals and control command output, improve dynamic behavior in control, and their on-chip communication mechanisms facilitated easier information exchange with other systems. These advancements injected new vitality into the design of motor control systems. The emergence of DSPs made it possible to design high-performance on-chip drive control systems with open architectures and network control capabilities, representing the future direction of motion control system implementation technology.
Robotics is an interdisciplinary field that has developed in recent years, integrating mechanical engineering, electrical engineering, and computer science.
The latest research achievements in numerous disciplines such as engineering, bionics, automatic control engineering, and artificial intelligence represent the advanced research in mechatronics.
The pinnacle of integration is one of the most dynamic areas of technological development today. Currently, robotics technology has achieved...
Significant development has led to the creation of various types of robots, such as industrial robots, wall-climbing robots, bomb disposal robots, and water robots.
Walking robots have been widely used in production and daily life, playing a significant role. Walking robots rely on motors located at the hip and knee joints to provide driving torque. In this system, because human walking is a complex, cyclical process, the motors need frequent starts, stops, braking, and reversals. Simultaneously, servo control of the motor's speed and position is required, placing high demands on the hardware system.
1 Servo Control System
A servo system is an automated control system in which the output quantity tracks changes in the input quantity with a certain degree of accuracy. As a position follow-up system in a closed-loop automatic control system, it plays a significant role in the control, positioning, aiming, tracking, signal transmission, and reception of moving objects in production processes, and has now become an important component of various regulation systems.
A typical DSP closed-loop control system, as shown in Figure 1, basically consists of three modules: a controller, a controlled object, and sensors. The controller compares the issued reference command with the feedback signal measured by the sensors, and the resulting error is then processed by the control algorithm to calculate an appropriate correction signal, which is sent to the controlled object. The main purpose of the controller is to generate an appropriate correction signal based on the control command and feedback signal to ensure the system responds optimally. This process primarily involves executing the control algorithm, which can be done using analog, digital, or hybrid methods.
Figure 1 Block diagram of DSP closed-loop control system
Various control methods employed in modern control theory, such as adaptive control, fuzzy control, neural network control, and robust control, can all be used for control system design. Control algorithms are diverse, but they are essentially composed of mathematical equations plus some flow control commands such as if…then, go…to, etc. Table lookup is sometimes also necessary. Therefore, the key to a control processor lies in how to implement control algorithms using software and hardware technologies.
Application of 2DSP in Control Systems
To control the speed, position, and current of the motor, and to communicate with the host computer, a joint servo system control block diagram (Figure 2) was designed. It mainly includes the motor, harmonic reducer, photoelectric encoder, control board, and drive board, which form an organic whole to achieve motor servo control and assist functions. The control board implements closed-loop control and communication with the motor, while the drive board amplifies the power and drives the motor.
Figure 2. Servo System Control Block Diagram
2.1 DSP Bus Module
In order to communicate with the host computer, the drive system uses the DSP's CAN bus module, which is an enhanced eCAN bus module.
The design employs a standard CAN controller (SCC) mode, utilizing only the first 15 of the 32 mailboxes, without using timed mail delivery. Since this joint servo unit needs to both receive and send messages, these mailboxes must be configured as both receive and transmit mailboxes, without receiver filtering. The communication baud rate is configured to 1M/s.
2.2 DSP Event Manager Module
This module is for motor control. The DSP contains two event management modules, EVA and EVB, both of which include general-purpose timers, compare units, capture units, PWM logic circuits, quadrature encoder pulse circuits, and interrupt logic circuits. The combination of optimized peripheral units and a high-performance DSP core provides advanced high-speed, high-efficiency, and full-speed control technology for all motor types.
Each event manager module can simultaneously generate eight pulse width modulation (PWM) signals, including three pairs of dead-time programmable CMP/PWM signals generated by a 16-bit full comparator and two independent PWM signals generated by a 16-bit general-purpose timer comparator. By setting different operating modes, it is possible to output an asymmetric PWM wave, a symmetric PWM wave, or an PWM wave with eight space vectors. The PWM output frequency can be directly changed as needed; the PWM pulse width can be changed within or after the PWM cycle; and the included auto-load comparator and cycle registers reduce CPU overhead.
The design utilizes the full compare unit in Event Manager A to generate an asymmetric PWM wave with dead-time protection. This PWM wave controls the switching on and off of the six N-channel MOSFET transistors in the H-bridge circuit. A quadrature encoder pulse (QEP) circuit composed of CAP1/QEP1 and CAP2/QEP2 in the capture unit is used to count the quadrature encoder pulses generated by the photoelectric encoder to calculate speed and position. An interrupt generated by the PDPINTx pin is used for circuit protection. An ADC module is used to acquire the phase current of the H-bridge circuit, achieving closed-loop control of the current loop.
3 power drive modules
In a control system, the control signal cannot directly drive the actuator—the electric motor—because it cannot provide enough power for the motor to operate. The control signal must pass through a power amplification device to drive the motor. In essence, the power amplification device transforms a power source with a fixed voltage into an energy source controlled by the control signal, where voltage, current, or other parameters change with the control signal. The three most widely used DC power amplifiers in servo systems are linear (proportional) power amplifiers, switching power amplifiers, and thyristor power amplifiers. Switching power amplifiers, in particular, are modulated using a pulse width modulation converter, a method known as PWM modulation.
3.1 PWM Speed Control Principle
PWM (Pulse Width Modulation) drive utilizes the switching characteristics of high-power transistors to modulate a fixed voltage in a DC power supply, switching it on and off at a fixed frequency. The duration of the "on" and "off" cycles can be adjusted as needed, thereby changing the average voltage by altering the "duty cycle" of the servo motor armature, thus controlling the motor's speed. Figure 3 shows the PWM control principle diagram.
Figure 3 PWM control principle diagram
3.2 Current Detection Circuit
The stator current of the three-phase motor is detected using the IR2277 chip manufactured by IR Systems, which detects phase current in the motor controller. This chip has signal terminals that are synchronized with the DSP. The stator current is detected by the chip and output to the DSP's AD converter, which detects the current of two phases, thereby obtaining the information of the three-phase stator current. The block diagram of the motor control system is shown in the figure.
Figure 4 Block diagram of motor control system
3.3 Speed Detection Circuit
An incremental photoelectric encoder is used to detect the rotational speed. It outputs two square wave signals A and B with a 90-degree phase difference, as well as non-signals PA, PB, and a zero pulse PZ signal. In the control system, the quadrature encoder unit of the event manager is used to detect the photoelectric encoder. A and B are connected to two channels QEP1 and QEP2 of the quadrature decoding pulse unit, respectively. The quadrature decoding pulse unit QEP has a direction detection function. Its direction detection logic identifies which of the two sequences is the leading sequence, and then generates a direction signal as the direction input for the selected timer. Note that both edges of the two quadrature input pulses are counted by the quadrature decoding pulse unit, therefore the generated clock frequency is four times that of each input sequence.
4. Conclusion
The system employs a DSP control structure, featuring a simple and compact current design that meets the system's vector control requirements. Furthermore, the fully digital control significantly improves control accuracy, functionality, and anti-interference capabilities. Analysis of typical closed-loop control system algorithms reveals that analog circuits struggle to implement complex algorithms. Given the high demands on the drive system of the walking robot, a DSP-based fully digital motor control system was chosen. The selected chip boasts high processing speed, high bit depth, large on-chip memory capacity, a dedicated motor control module, CAN bus communication capabilities, and an A/D conversion module, effectively fulfilling the control requirements.