Foreword
In traditional motor servo control devices, one or more microcontrollers are typically used as the core processor for servo control. However, the complex peripheral circuitry and slow computation speed of such servo controllers lead to unsatisfactory control performance. In recent years, many new motor control algorithms have been researched and applied to motor control systems, such as vector control and direct torque control. As these control algorithms become increasingly complex, processors with high-speed computing capabilities are required to achieve real-time calculation and control. To meet this need, many foreign companies have developed high-end microcontrollers and digital signal processors (DSPs) specifically designed for motor control. Currently, the core control part of commonly used servo controllers is mostly composed of DSPs and large-scale programmable logic devices. This approach allows for the flexible design of high-performance dedicated servo controllers according to different needs, but the development cycle is generally quite long.
1. Introduction to MotionChip
MotionChip is a high-performance and easy-to-use motor motion control chip developed by Technosoft, a Swiss company. It is based on the TMS320C240 DSP and features numerous programmable configuration pins specifically designed for motor servo control. The TMS320C240 is a 16-bit fixed-point digital signal processor for motor control from Texas Instruments (TI), featuring high-speed computing power and peripheral interface circuits specifically designed for motor control. MotionChip effectively utilizes the advantages of this DSP and integrates multiple motor control algorithms to simplify user design, making it a novel dedicated motor control chip. MotionChip offers the advantage of integrating all necessary configuration functions onto a single chip, making it an ideal core processor for quickly and cost-effectively designing fully digital, intelligent drivers for various motor types. It has the following characteristics:
1. It can be used to control 5 types of motors: DC brushed/brushless motors, AC permanent magnet synchronous motors, AC induction motors and stepper motors, and is easy to embed into the user's hardware structure;
2. It can be selected to work independently or in master-slave mode, and can be configured to work collaboratively with multiple servo controllers via a network interface as needed;
3. Implementation of a fully digital control loop, including current/torque control loop, speed control loop, and position control loop;
4. It can realize various command structures: open-loop, torque, speed, position or outer loop control, micro-stepping control of stepper motors, and can realize the configuration of control structures, including AC vector control;
5. It can be configured to use various motion and protection sensors (position, speed, current, torque, voltage, temperature, etc.);
6. It can use various communication interfaces to achieve RS232/RS485 communication and CAN bus communication;
7. Based on the Windows 95/98/2000/ME/NT/XP platform, the powerful IPMMotionStudio advanced graphical programming and debugging software allows for quick setting and adjustment of various parameters and programming of motion control programs via RS232. Its powerful motion language includes 34 motion modes, decision-making, function calls, event-driven motion control, and interrupts. Therefore, it is easy to develop and use.
8. PC control can be implemented using VC/VB through the dynamic link library TMLlib; it can also be seamlessly connected with LabVIEW and PLC. Through the dynamic link library, users can develop motor control programs and study control strategies at the upper level.
2. Design of motion control system
This paper designs a servo driver using MotionChip as the controller core and a DC brushless motor/brushed motor/permanent magnet synchronous motor as the controlled object. The design specifications are: adaptability to a wide range of DC bus voltage input (12-36V), industrial standard 5V logic power input, maximum output current of 3A, and peak current of 6A. Before designing the servo controller, the overall functional design is based on the characteristics of MotionChip and the servo motor as follows:
(1) A three-loop structure of position loop, speed loop and current loop is adopted; all three loops use PID controllers; the motor parameter setting adopts a combination of computer-aided calculation and engineering tuning.
(2) It has a general servo controller interface and can use the provided human-machine interface to set independent parameters. It has a network communication interface for setting independent parameters and facilitates external monitoring and control.
The overall system architecture of a servo system can be divided into: MotionChip minimum system, drive circuit, current feedback detection, external control interface, communication interface, etc., as shown in Figure 1. The hardware structure of the servo driver is divided into two main parts: the drive circuit part, which mainly includes the inverter bridge, the pre-drive, and the current detection;
Control circuit section: includes feedback detection, external control interface, communication interface, and MotionChip minimum system.
Figure 1 System structure diagram
3. Control System Design
In the basic system of MotionChip, the Xicor X25650 SPI serial EEPROM from the US is used to store TML motion instructions. This EEPROM has a storage capacity of 8K×8 bits and a maximum clock frequency of 5MHz. Since the instruction access time is 21ns during normal operation of MotionChip, two 32×8-bit static RAMs (SRAMs) of the ASC256-12JC are added to enable high-speed and efficient program execution. The access time of this SRAM is 12ns, so the MotionChip's access time to the chip is also 12ns, eliminating the need for wait states when accessing data. Furthermore, this SRAM has low active power consumption and can automatically enter a lower power-saving state in standby mode.
The MotionChip chip itself provides a dedicated interface for motor control, including 6 PWM signals, which can be configured as drive signals for a three-phase motor inverter bridge. When the protection interrupt PDPINT is active or the motor enable signal ENABLE is inactive, the 6 PWM signals immediately enter a high-impedance state, cutting off the entire inverter bridge and stopping the motor. Furthermore, MotionChip provides a programmable dead-time setting (0-102μs) for each PWM output pair, eliminating the need for external dead-time logic circuitry. The encoder feedback signal interface includes ENCA, ENCB, and ENCZ. ENCA and ENCB are pulse signals with a 90° phase difference, while ENCZ is the encoder clear signal. MotionChip can quadruple the frequency of ENCZ and ENCB signals and perform direction discrimination before feeding them into an incremental counter to generate the motor's position signal. The encoder clear signal ENCZ corrects for counting errors. The motor Hall feedback signals HALL1, HALL2, and HALL3 are designed for positioning the magnetic poles of brushless DC motors/permanent magnet synchronous motors. Other important pins, such as DIR and PULSE, are directly used as input interfaces for motor pulse commands.
LSP and LSN can be used to extend the capture input for left and right limit events of the motion system. The MotionChip has two 10-bit A/D converters, each with built-in sample-and-hold circuitry, and a maximum sampling rate of 10kHz. The input range of the analog signal is determined by the MotionChip reference level input pins VREFLO and VREFHI. The MotionChip can operate in independent mode or in independent mode by detecting the AUTORUN pin. A high level on this pin operates in slave mode, while a low level operates in independent mode. In independent mode, after power-on, the MotionChip detects a low level on AUTORUN and enters independent mode; then it automatically executes the TML program from the SPI serial EEPROM.
4. Drive system design
The motor drive mainly consists of two parts: the motor PWM drive circuit and current detection.
The PWM drive circuit for the motor is shown in Figure 2. In this circuit, the brushless DC motor uses a full-bridge drive, allowing the motor to operate in four quadrants (forward drive, braking and reverse drive, braking). Driving a brushless DC motor requires six PWM signals, and each event management module (EV) of the MotionChip has three comparator units with programmable dead-time control that can generate three independent pairs of six PWM signals. Therefore, in the circuit, the comparator units in event management module B (EVB) are directly selected to generate the six required PWM signals, with output pins PWM7~PWM12. PWM7~PWM9 outputs are used to drive the upper half-bridge of the MOSFET power transistor bridge, and PWM10~PWM12 outputs drive the lower half-bridge. These three PWM signals output by the DSP are pre-amplified by the IR2102 and then drive the upper half-bridge (Q1, Q3, Q5) and lower half-bridge (Q2, Q4, Q6) of the MOSFET power transistor bridge to drive the motor.
Figure 2 Drive circuit diagram
The motor current detection circuit provides crucial feedback information. Combining this information with control signals from the main DSP allows control of the MOSFET or IGBT gate drive chips, ultimately adjusting the motor speed. Overcurrent protection requires current monitoring, but traditional overcurrent protection methods are prohibitively expensive for low-end applications. The current sampling scheme involves connecting a 0.027Ω sampling resistor in series with the lower arm of the inverter bridge, as shown in Figure 3(a). The sampling current range is 0~6.22A, and the sampled voltage is amplified by 14.63 times, as shown in Figure 3(b). The voltage is then boosted by 2.5V and input to the DSP. Therefore, the analog voltage input to the DSP is:
UAD = 2.5 + I × 0.027 × 14.63.
The analog input voltage of the MotionChipAD port is 0~5V, so the quantized value of the current sample is:
Figure 3 Schematic diagram of current detection principle
The ultrasonic inspection and imaging system for hydrogenation reactors is a system suitable for on-site inspection of weld layer peeling in hydrogenation reactors. It enables semi-automatic ultrasonic scanning of interlayer peeling of weld layers in hydrogenation reactors, automatic storage, analysis and evaluation of inspection data, and the system is applicable to hydrogenation reactors of different diameters.
The control system of the hydrogenation reactor stripping imaging system is essentially a two-dimensional motion control platform. From the perspective of the system's required performance indicators, the control system needs to meet the following indicators:
1. Horizontal scanning speed is infinitely adjustable up to 6 mm/s; vertical scanning speed is infinitely adjustable up to 300 mm/s.
2. Capable of performing both coarse and fine scanning, with fine scanning of designated areas;
3. The system has two control modes: manual and automatic, which can be switched between.
4. The motion error in the two directions of X-axis (horizontal) and Y-axis (vertical) is ≤ ±1mm.
Therefore, the motion control system designed above was chosen. It is small in size, high in performance, simple to control, and low in price, but each motor can only control one motor. To control two motors in tandem, they must be connected via an RS485 bus. The overall structure of the control system is shown in Figure 4. The X-axis motor controls the movement of the lead screw: an EC-max32 brushless 70W reducer with a planetary gear reducer (speed ratio 2:3, model GP32C) + encoder (three-channel 500-line). The Y-axis motor controls the movement of the probe: an RE-32 brushed 80W reducer with a planetary gear reducer (model GP42C, speed ratio 3:3) + encoder (three-channel 500-line). Figure 5 shows the hardware connection diagram.
Figure 4 Hardware Connection Diagram
5. Software Design
The control system software is designed based on the VC++ and MotionChip dynamic link library. The software mainly performs motion control of the probe position, as shown in Figure 5.
Figure 5 Control Scan Interface
The user interface features include:
The parameter setting and display module mainly sets some system parameters (such as scan length and detection width) and control parameters (such as speed parameters and acceleration parameters).
At all times, the control program monitors the system's operating status and takes appropriate action to address system malfunctions.
The software includes X-axis and Y-axis scanning motion, data storage and processing, manual control, fault handling, motion status display, and fault display. The user interface (GUI) provides a clear and simple interface for easy debugging and operation, while also displaying information transmitted from the servo drive for monitoring. The task programming module will implement the planning of control tasks, such as X-axis and Y-axis motion, including fault querying and handling.
The performance of the intelligent servo driver directly determines the success or failure of the entire system design. Therefore, a DC motor was used to test the driver. The motor's current and position error are shown in Figures 6(a) and (b). Figure 6 shows that the driver's response time is only 0.12s, and the position error is very small. Tests on communication speed and host computer control commands show that, under conditions where real-time requirements are not extremely stringent, communication rates via RS232 or 485 serial ports are fully sufficient to meet the system's needs.
Figure 6 Test curve
6. Conclusion
This paper presents the design and practical research of a servo controller based on Motionchip, a dedicated servo control chip, and designs a prototype of a relatively complete DC brushless servo driver. This controller is applied to an ultrasonic detection and imaging system for a hydrogenation reactor to control two-dimensional motion, ensuring good system performance. Motionchip, a multi-functional dedicated motion control chip, not only simplifies the design process but also offers excellent openness and networking capabilities, making it an ideal design solution for small to medium-sized projects.
For more information, please visit the Server Systems channel.