Share this

DSP-based digital controller implementation in general-purpose frequency converters

2026-04-06 05:41:55 · · #1
0 Introduction The key to a variable frequency speed control system is designing a suitable frequency converter, and its core is the digital controller of the variable frequency speed control system. The digital controller of the frequency converter includes signal detection, filtering, shaping, real-time execution of core algorithms, generation of drive signals, system monitoring, and protection functions. The hardware of the frequency converter digital control system includes a microprocessor, interface circuits, and peripheral devices. The microprocessor is the control core of the system; it processes the data input from the input interface through its internal control program, performs control calculations, and sends various control signals to the external system through the output interface circuit. Peripheral devices include detection elements and actuators, as well as various operating, display, and communication devices. This paper designs a digital controller for a high-speed motor speed control system using TI's TMS320F240. The frequency can be set digitally via keyboard or analog. A brief analysis of its functions and technology is provided, and the output waveform of the controller is given when the motor is running at a steady state of 18000 r/min. 1. Hardware Structure and Working Principle of the Digital Controller The digital controller uses a TMS320F240 fixed-point DSP as the CPU and a CY7C199 as external data and program memory, each 32K. It has 16 analog/digital input channels, one of which can be used for analog frequency setting; an 8-bit digital I/O port allows for digital frequency setting via the keyboard; four 12-bit digital-to-analog conversion channels are used for motor output signal control; and RS232 and SPI series compatible interfaces are used, with SPI used for LED display of motor frequency during variable frequency speed control, and the SCI port expanded into an RS232 interface. Its functional layout is shown in Figure 1. The operating frequency of the motor or inverter is set via the keyboard, and its display is simultaneously reflected on the LEDs by the DSP's internal display program. When the run button is pressed, the frequency set by the keyboard is sent to the SVPWM processing subroutine that generates the space voltage vector. The generated SVPWM waveform is output after protection by the GAL device. Simultaneously, the real-time dynamic operating frequency of the motor or inverter is displayed on the LEDs. Orthogonal coded pulses can be connected to the photoelectric encoder of the motor to form a speed loop feedback for the system. The A/D module can be connected to the current loop of the motor. The protection interrupt sources for the variable frequency speed control system are provided by the DSP pin PDPINT, mainly for overvoltage, overcurrent, undervoltage control voltage, and overheating. The motor speed or the inverter output frequency can be changed via the keyboard. 2 Hardware Design The digital signal processor (DSP) is the core part of the digital controller, responsible for signal detection, filtering, shaping, real-time execution of core algorithms, generation of drive signals, system monitoring, and protection. The functional module design of the digital controller is as follows. 2.1 Design of Data and Program Memory DSP is a high-speed access device, placing high demands on peripheral interface chips. Although the DSP itself can provide 0-7 wait states in software to match the speed of external access devices, to avoid affecting the control and simulation functions of the entire system, a high-speed memory is generally used as the DSP's external data and program memory. This paper uses the CY7C199 memory, with an access time of 15ns. No software wait state or hardware wait circuit is needed because the CY7C199 is a 32K 8-bit memory. Therefore, four of these memory chips were used to form a 32K 16-bit RAM, with 32K for data and 32K for program. 2.2 Design of DSP Reset and Clock Circuit To ensure the system is correctly initialized by the reset signal, the pulse width of the reset signal must meet certain requirements. For the TMS320F240, the reset signal should be at least 1ms. However, after power-on, the system oscillator takes 20ms or even longer to reach a stable operating state. Generally, a 100-200ms low-level pulse on the reset pin is suitable for power-on reset. Based on this principle, the integrated microprocessor monitoring reset circuit from MAXIM is used, specifically the MAX705. Compared with traditional microcomputer monitoring circuits composed of discrete components, the MAX705 monitoring chip has high reliability, good dynamic response, low power consumption, simple design, and small size, and has been widely used in electronic product design. In design, the clock is often overlooked, but it is actually a crucial element in circuit design. The DSP clock can be provided externally or by an onboard oscillator. Since the DSP and other chips operate based on a clock, poor clock quality can severely compromise system reliability and stability. This paper employs an external clock input, generating a 10MHz pulse from an active crystal oscillator. Copper plating and a series LC filter circuit suppress external interference, ensuring stable system operation. 2.3 RS232 Serial Port Circuit Design RS232 is a serial communication interface standard released by the Electronic Industries Association (EIA) in 1960. Currently, RS232C and RS232D are widely used. The standard RS232C connection is DB25. However, in practical applications, a non-standard DB9 connection is used, and the defined pins are selected based on requirements. The most significant characteristic of RS232C's electrical characteristics is its use of negative logic. Logic 1 has a level of -3V to -15V, while logic 0 has a level of +3V to +15V. Therefore, a level conversion interface is required during use. This paper uses the MAX232C self-boosting integrated chip, powered only by a +5V power supply. The ±10V power required for level conversion is generated by an on-chip charge pump. After the controller was completed, the serial communication interface (SCI) of the computer was tested. Data communication transmission and reception were normal, and it could work stably. 2.4 Design of D/A Output Function Block In digital control systems, D/A and A/D circuits are indispensable. Depending on the application, the speed requirements of D/A and A/D vary. This paper uses the parallel input D/A chip DAC7625, which is a 12-bit parallel input, 4-channel analog output D/A converter. Its settling time is 10μs, power consumption is 20mW, and it can be powered by a single +5V power supply or dual ±5V power supplies. It is widely used in motor control and data acquisition. The data input of the digital-to-analog converter (DAC) comes from the high 12 bits of the DSP, and is sent to the data terminal of the DAC7625 via a 74LS245. It uses a single +5V power supply, with the reference voltage VHEFH provided by a precision voltage regulator at +2.5V, and VHEFL as analog ground. Its output is amplified by the operational amplifier TLCH2272, with an output range of 0 to +5V. 2.5 Keyboard Input Interface Circuit and LED Display Circuit Design The keyboard and seven-segment LED display are the most commonly used input and output devices in microcomputer systems. They are the main pathway for information exchange between humans and machines. The function of the keyboard is to convert the data and commands to be processed into binary code that the computer can recognize, i.e., symbols that the computer can understand; the seven-segment LED display converts the computer's calculation results and status codes into symbols that humans can recognize and display them. The keyboard is the main input device of a computer system, especially in microprocessors, where keyboard design is essential. Considering the high processing speed of the DSP, this design employs a hardware delay circuit for the keyboard debouncing stage, as shown in Figure 2. Seven-segment LED displays have two connection methods: static display and dynamic display. Dynamic scanning saves hardware. Commonly used BCD seven-segment decoder drivers and dynamic scanning driver circuits include the Intel 8279 and Max 7219, with the MAX7219 chip used in the controller. The DSP has a serial interface SPl for interacting with peripherals, which facilitates serial connection to displays. The MAX7219 is a serial common-cathode LED digital display driver with multiple control and data registers. Its operation can be flexibly designed through programming. It is a small, powerful, and easy-to-use serial interface. One issue to note in application is that the MAX7219 has relatively poor EMI resistance; the MAX7221 is relatively more reliable. Another issue is that although the manual states that registers can use arbitrary numbers, such as using XXXX for the high 4 bits in the data format, it is best to use non-zero bits in practical applications. This article uses 1111 to increase anti-interference capability. In addition, appropriate capacitors must be added to the serial data line and power supply to improve anti-interference capability, especially the power supply. If the power supply fluctuates significantly, the MAX7219 is easily damaged. 2.6 Design of the SVPWM Pulse Output Module The space vector SVPWM pulse output is a key part of the digital controller. Motor speed regulation or inverter frequency is controlled by the SVPWM waveform. To prevent shoot-through between the upper and lower bridge arms of the inverter, although dead time can be added in the DSP programming, the SVPWM pulses generated by the microprocessor may cause control chaos due to program overrun. For safety, an interlock protection circuit using GAL devices is implemented to prevent shoot-through between devices on the same bridge arm of the inverter. The digital controller uses Lattice's GAL16V8. 3 Software Design As frequency converter products continue to mature, their functions are constantly enriched, and their reliability is continuously improved, leading to increased complexity and difficulty in programming. The variable frequency speed control system designed in this paper is for use with a bearingless high-frequency motor in the laboratory. It mainly completes some basic functions, such as frequency setting and display, and torque compensation function at low speed. The program is not particularly complex, with nearly 2000 lines of code. The program has been tested and proven to run well. The entire program of the variable frequency speed control system in this paper mainly consists of a main program, a keyboard program, a display program, a PWM program, and a fault protection interrupt program. 3.1 Main Program and Fault Protection Interrupt Program The main program is the most important part of the entire program. It completes the main functions of the frequency converter. Its flowchart is shown in Figure 3(a). The program initialization part mainly includes: initialization of I/O ports, initialization of waveform generator, initialization of timer and counter, initialization of SPI, initialization of MAX7219, etc. Reading data into internal registers means reading commonly used data into internal registers to shorten DSP processing time and better achieve real-time performance. Setting frequency processing means judging the value given by the key and determining which of the set frequencies is the final target frequency. The frequency display section displays the final target frequency using LEDs in the thousands, hundreds, tens, and units digits. Operation control is determined by pressing the RUN button to start the motor. The hardware design utilizes Fujifilm's third-generation intelligent power module (IPM), which integrates alarm functions for overvoltage, overcurrent, overheating, undervoltage control, and short circuit. These alarms are sent to the DSP's external interrupt source pin (PDPINT) after optocoupler isolation to complete the corresponding protection functions. The specific flowchart is shown in Figure 3(b). 3.2 SVPWM Interrupt Subroutine The PWM interrupt subroutine is the key program for the entire controller's operation; it is responsible for achieving space vector modulation. The specific flowchart is shown in Figure 4. The PWM generator program mainly performs the following functions: dynamic display of the motor's operating frequency; angular velocity ω is obtained based on the target frequency given in the main program; the angle θ of usref is obtained through integration of ω; then, the projections usα and usβ of usref on the α and β axes of the two-phase stationary coordinate system are calculated; with θ, the sector/N of the reference voltage vector can be calculated simultaneously; the action times T1, T2, and T0 of two adjacent voltage vectors are obtained from the common values ​​based on the known quantities; and then values ​​are assigned to the three full comparison registers CMPRx (x=1, 2, 3) inside the DSP to generate the corresponding 5V PWM waveform. 4. Experimental Results Based on the system hardware circuit and software control algorithm described above, experimental research was conducted on the prototype. The experiment tested the no-load steady-state operation of the asynchronous motor to verify the feasibility of the prototype. The waveforms of the experimental results were recorded. The PWM control waveform and the measured line voltage waveform of the asynchronous motor during 300 Hz steady-state operation are shown in Figure 5. The parameters of the high-frequency motor used in the experiment are as follows: rated voltage Un=220V, rated current In=1.5A, rated frequency f=400Hz, number of pole pairs of the asynchronous motor=1, rated power Pe=800W, rated no-load current 0.75A. 5 Conclusion The digital controller based on the TMS320F240 digital signal processor is a signal processing system. This system can perform signal detection, filtering, shaping, real-time execution of core algorithms, generation of drive signals, system monitoring, and protection functions. Compared with systems composed of general single-chip microcomputers, it has a faster processing speed, better real-time performance, and is easier to select and integrate. It also integrates measurement, monitoring, and protection functions, can communicate with a host computer, and has high application value.
Read next

CATDOLL 139CM Tami Silicone Doll

Height: 139 Silicone Weight: 25kg Shoulder Width: 33cm Bust/Waist/Hip: 61/56/69cm Oral Depth: N/A Vaginal Depth: 3-15cm...

Articles 2026-02-22