Design of stepper motor control system based on FPGA

Publisher:chang_riLatest update time:2014-01-19 Source: 电源网Keywords:FPGA Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

The stepper motor is an open-loop control motor that converts electrical pulse signals into angular displacement or linear displacement. The total number of input pulses controls the total rotation angle of the stepper motor, and the speed of the motor is determined by the number of input pulses per second, so it is easy to achieve precise control of the mechanical position. In addition, due to the low price and strong controllability of stepper motors, they have been widely used in automatic control fields such as CNC machine tool transmission control. However, with the development of technology and the requirements of enterprise production, the traditional control system of stepper motors with microprocessors such as single-chip microcomputers as core units has exposed the following shortcomings: the single control strategy is not conducive to human-computer interaction, and the control circuit is complex, the control accuracy is low, the production cost is high, the system stability is insufficient, the step resolution is low, the flexibility is lacking, the oscillation and noise at low frequency are large, and due to the mechanical structure and space limitations of the stepper motor, the step angle of the stepper motor cannot be infinitely small, and it is difficult to meet the needs of high-precision open-loop control. Due to the simple programming method of FPGA, short development cycle and high reliability, its application in the field of industrial control is becoming more and more extensive. Based on the summary of FPGA frequency division technology and stepper motor subdivision control principle, this paper improves the resolution of stepper motor through PWM control technology. Simulation and experiments show that the measures taken in this paper can effectively realize efficient and precise control of stepper motor.

1 Stepper Motor Subdivision Control Principle

The working principle of the stepper motor is shown in Figure 1. For a four-phase stepper motor, the rotation of the motor can be controlled by energizing each phase winding in a certain order. For example, when switch B is connected to the power supply and other switches are disconnected, the magnetic poles of phase B and rotors 0 and 3 are aligned under the action of magnetic lines of force; when switch C is connected to the power supply and other switches are disconnected, the rotor rotates under the action of magnetic lines of force, and teeth 1 and 4 are aligned with the magnetic poles of phase C winding. Similarly, when power is supplied to the four-phase windings A, B, C, and D in sequence, the motor will rotate in the directions of A, B, C, and D.

 

 

In order to understand the shortcomings of stepper motors, it is also necessary to understand the step angle of stepper motors. The step angle is defined as:

 

 

In the formula: km is the working cycle coefficient of the stepper motor; zn is the number of teeth.

Limited by the number of beats and the number of teeth of the rotor of the stepper motor, the step angle of the stepper motor cannot be very small, that is, the rotation amount of each single step control is relatively large. In many fields of precision control, the function of the stepper motor cannot meet the use requirements. Therefore, in order to improve the resolution of the stepper motor, it is necessary to use subdivision control technology to optimize its control. Subdivision control is similar to interpolation. Its basic principle is to subdivide the current in the motor winding and add many intermediate currents between the two control currents, so that the stepper motor can work in many intermediate states, so that each step of the stepper motor is subdivided, its step angle is smaller, the resolution of the system is improved, and the performance is optimized. There are usually two subdivision methods for subdivision control. One is to subdivide the current according to the linear law, and the other is to subdivide according to the equal step angle. In order to compare the advantages and disadvantages of the two subdivision methods, it is also necessary to understand the static angle characteristics of the stepper motor when it is working.

 

 

Where: M is the electromagnetic torque; Mk is the maximum static torque at a certain winding current; for a reactive stepper motor, when the magnetic circuit saturation is not considered, Mk can be considered to be proportional to the square of the current i, and the negative sign indicates that there is a Lenz relationship between the electromagnetic torque and the stator magnetic field, that is, the electromagnetic torque always prevents the rotor from leaving the position of minimum magnetic resistance of the magnetic field.

Now let’s analyze the two subdivision methods using a three-phase reactive stepper motor.

When the three-phase windings of a three-phase reactive stepper motor are energized separately, their torque-angle characteristics are sinusoidal curves that differ by 120° electrical angle from each other, as shown in Figure 2.

 

 

When phases A and B are energized, the currents are assumed to be iA and iB respectively, and the corresponding static torques are MA and MB. Ignoring the influence between the magnetic circuits, the synthetic torque-angle characteristic is the superposition of the two, as shown in formula (3):

 

 

From formulas (3) and (4), it can be seen that when the current of the stepper motor changes according to a linear law, its step angle characteristic is shown in Figure 3(a). Since the characteristic amplitude of the step angle is different due to the different currents, the step angle of each subdivision cannot be kept consistent. The ideal subdivision current waveform should make the amplitude and shape of the step angle characteristic in each power-on state equal, as shown in Figure 3(b).

 

Therefore, the subdivision method of current changing according to the linear law makes the control accuracy of each small step after subdivision unequal. If the subdivision is based on equal step angle, the step angle after subdivision is:

 

 

If the current distribution coefficient is strictly used to control each power-on state in the control circuit, the control accuracy of each small step after subdivision can be guaranteed to be equal. Therefore, this paper adopts the subdivision method based on equal step angle.

2 Implementation of stepper motor subdivision control hardware

In order to achieve equal step angle subdivision of stepper motor, this paper adopts pulse width modulation (PWM) to achieve it. PWM is to control the on and off of the switching device of the inverter circuit so that the output end can obtain a series of pulses with equal amplitude. These pulses can be combined to form equivalent sine waves, square waves and other expected waveforms. The quality of the equivalent output waveform is related to the step distance of the pulse, that is, the more PWM channels are output at the same time, the higher the pulse density, and the better the quality of the output equivalent waveform. The traditional stepper motor control system mostly uses a single-chip microcomputer as a microprocessor, and the single-chip microcomputer is a single-threaded microprocessor. It can only execute one command at the same time, that is, it can only generate one PWM signal at the same time. Therefore, the output waveform quality is poor, resulting in low control accuracy of the stepper motor. The computing speed of FPGA is much higher than that of the single-chip microcomputer, and through modular design, it can be put into multi-threaded working mode, that is, it can generate multiple PWM signals at the same time, which improves the quality of the output equivalent waveform. In this paper, the new Cyclone II series FPGA device launched by Altera in 2004 is selected as the development platform, which outputs 8 PWM signals at the same time to control the 16 subdivisions of the four-phase stepper motor. At the same time, the serial port module is used to connect to the host computer to realize human-computer interaction. The system schematic diagram is shown in Figure 4.

 

 

The control system adopts bus control mode, and uses chip select signals to control the on and off of 4 PWM latches in sequence, which can simplify the hardware circuit and software design. Taking phase A control as an example, when chip select A is high and the other chip selects are low, PWM latch A works while the other PWM latches are dormant. The subdivided current distribution coefficient is calculated according to formula (8), and then converted into the duty cycle of the control PWM signal. At the same time, several latches are turned on and the stepper motor is driven through the latch output.

3 Design of stepper motor subdivision control software

In this design, Quartus II software development platform and Verilog design language are used to design the control software. The system needs to use linear feedback shift registers (Linear Feedback Shift Registers) in FPGA to realize the generation of random numbers and control the random sampling rotation of the stepper motor. The core PWM control module design of this system is as follows:

 

 

4 System Testing

After the system design is completed, the entire system is tested and inspected.

The simulation result of the PWM control system is shown in Figure 5. By observing the simulation output waveform, it can be seen that the control pulse output is correct. After the program is solidified into the FPGA hardware, the controlled four-phase reactive stepper motor is connected, and the FPGA is connected to the host computer through the serial port. The host computer outputs commands to control the speed, direction, rotation angle, etc. of the stepper motor.

 

 

5 Conclusion

This paper proposes a design scheme for a stepper motor control system based on FPGA. This scheme takes advantage of the characteristics of FPGA such as fast control speed and strong reliability, and uses the principle of equal step subdivision and PWM control technology to design a stepper motor control system with high flexibility, human-computer interaction and high resolution. The verification results show that the control system realizes 16-level subdivision of the equal step angle of the stepper motor, and realizes the main technical indicators of arbitrarily changing the order of each phase through human-computer interaction, with high control accuracy and strong reliability. This confirms the feasibility of the scheme.

Keywords:FPGA Reference address:Design of stepper motor control system based on FPGA

Previous article:Multi-core DSP power-on loading technology based on TMS320C6678
Next article:FPGA implementation of fixed-point square root based on Python

Recommended ReadingLatest update time:2024-11-15 10:15

Hot LED driver design, simplifying the system and making it easy to implement
1. Design goals As the concept of energy saving becomes more and more popular, LED, a new luminous material for solid-state lighting, has made great progress. In Europe, they have specially formulated the COST five-year action plan, which proposes that new light sources must meet three conditions: high efficiency and
[Power Management]
Hot LED driver design, simplifying the system and making it easy to implement
Three major players compete for the high-end FPGA market
Intel announced earlier this week that they have begun shipping their first batch of new Agilex FPGAs to early access customers. This brings the competition between the two largest FPGA vendors into the "head-to-head" stage. Xilinx delivered their first "Versal ACAP" FPGA in June, so after a long and controversial bat
[Embedded]
Design of a control circuit for all-optical current transformer based on FPGA
  As the main equipment for high-voltage power grid detection, current transformers not only provide parameters for electric energy measurement, but also provide the basis for relay protection. With the development of the national smart grid and ultra-high voltage power grid, traditional electromagnetic current tra
[Embedded]
Design of a control circuit for all-optical current transformer based on FPGA
Design of FIR digital filter based on FPGA (Part 2)
After the model is built, the coefficients of the 16th-order FIR digital filter need to be determined. Here, the FDATool filter design tool in Matlab is used to determine the filter index:   (1) Design a 16-order FIR filter;   (2) Low-pass filter;   (3) The sampling frequency fs is 16 384 Hz and the cutoff frequ
[Analog Electronics]
Design of FIR digital filter based on FPGA (Part 2)
Reduce the risk of powering low voltage processors and FPGAs directly from intermediate bus voltages
Industrial, aerospace and defense systems often use an intermediate bus voltage rated at 24V to 28V. In these systems, series batteries are used as a backup power source, but 12V bus architectures are not suitable due to distribution losses. The large voltage difference between the system bus and the digital processor
[Power Management]
Reduce the risk of powering low voltage processors and FPGAs directly from intermediate bus voltages
FPGA Implementation of High-Speed ​​Burst Mode Bit Error Tester
introduction Passive optical network PON has been applied on a large scale in the network with its unique advantages. Since the GPON system has the highest bandwidth utilization rate, the lowest system cost and the ability to support all services among the existing PON systems, its prospects are generally optimistic
[Test Measurement]
FPGA Implementation of High-Speed ​​Burst Mode Bit Error Tester
Power ICs required for the latest FPGAs
In recent years, the diversification and high performance of electronic devices (applications) have been developing at an astonishing speed. It can be said that this trend has shortened the development cycle of each product and brought huge development space to semiconductor technology. Against this backdrop, LSIs cal
[Power Management]
Power ICs required for the latest FPGAs
Silicon chip fusion technology helps SoC FPGA design architecture stand out (Part 1)
For system designers, increasing the integration of integrated circuits is both good news and brings new problems. The good news is that at each new silicon process node, chip designers can package more components in a single chip, such as more processors, accelerators, and peripheral controllers. More components built
[Analog Electronics]
Silicon chip fusion technology helps SoC FPGA design architecture stand out (Part 1)
Latest Power Management Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号