Design of stepper motor speed regulation and speed measurement system based on LPC2148

Publisher:码上奇迹Latest update time:2010-12-23 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

The speed regulation and speed measurement system of stepper motors generally uses ARM as the controller, plus discrete digital logic circuits and analog circuits. This system uses LPC2148 as the control core, reasonably selects the frequency control and closed-loop feedback control of the motor, and detects and adjusts the speed of the motor in real time, so that the system has both good steady-state performance and good dynamic performance.

1 Working principle of the system

The system is mainly composed of a main control circuit based on LPC2148, connected to a motor drive circuit, a communication module circuit (RS232), a speed measurement circuit (Hall sensor), an A/D conversion circuit and other circuits, as shown in Figure 1. Figure 2 shows the ARM main control chip. The main control circuit with LPC2148 as the core is responsible for frequency output, and controls the speed of the motor by changing the frequency. The data collected by the acquisition circuit can communicate with the PC through the RS-232 interface circuit. At the same time, the LPC2148 module processes the collected data and further corrects the output of the frequency control signal according to the deviation value.



2 Hardware Design

2.1 Speed ​​control module design

The system regulates the speed of the stepper motor by adjusting the frequency. The speed of the stepper motor = f × 60/200x, where x is the subdivision multiple. Under the subdivision drive mode, due to the small step angle, the control accuracy of the stepper motor is significantly improved. At the same time, this drive mode can effectively suppress the noise and oscillation generated during low-speed operation. The stepper motor adopts a 1.8° two-phase four-beat type, and 200 step pulses can make one circle. Its stepping action is controlled by ARM, and the motor-specific driver L298 drives the stepper motor. The drive circuit is shown in Figure 3. L298 contains a 4-channel logic drive circuit and is a dedicated driver for two-phase and four-phase motors. That is, it contains a high-voltage and high-current dual full-bridge driver with 2 H bridges, which receives standard TTL logic level signals and can drive motors below 46 V and 2 A. The ARM main controller is connected through the control port on the right end, and the four ports M1 to M4 are used to connect the motor and control it through the changes in the input pulse signal on the right end.


2.2 Hall sensor speed measurement module

2.2.1 Hall Effect

A semiconductor sheet with a length of l, a width of b, and a thickness of d, when placed in a magnetic field with a magnetic induction intensity of B, if a control current I flows on its opposite sides and the direction of the magnetic field is orthogonal to the direction of the current, then an electric potential UH proportional to the product of the control current I and the magnetic induction intensity B will be generated on the other two sides of the semiconductor, that is, UH=KHIB, where KH is the sensitivity of the Hall element. This potential is called the Hall potential. The semiconductor sheet is the Hall element, and its size is proportional to the external magnetic field and current. Hall switch sensors are widely used in the field of measuring the rotation speed of rotating objects due to their small size, no contacts, good dynamic characteristics, and long service life. The Hall speed sensor produced by SPRAGUE is selected here. It is a silicon monolithic integrated circuit, which contains a voltage regulator circuit, a Hall potential generator, an amplifier, a Schmitt trigger, and an open collector output circuit. It has the characteristics of a wide operating voltage range, high reliability, a simple external circuit, and an output level compatible with various digital circuits.

2.2.2 Working Principle

The Hall sensor signal amplifier amplifies the Hall potential UH, then shapes and amplifies it, and outputs a square wave signal with equal amplitude and changing frequency. The amplitude of the Hall potential changes with the strength of the magnetic field.

There are many methods for measuring speed. The methods for measuring speed based on pulse counting mainly include M method (frequency measurement method), T method (period measurement method) and MPT method (frequency period method). This system adopts M method (frequency measurement method) and the speed measurement circuit of Hall sensor, as shown in Figure 4.



2.3 Other circuit modules

2.3.1 Power module

When the power module supplies power, it first passes through the diode VD1 to prevent the hardware from being burned by the power supply with opposite polarity. The SPX1117M3-3.3 three-terminal regulator is used to provide power for the microcontroller, RS232, and Hall sensor, and also for the CAT811R. The CAT811R microcontroller monitoring circuit (at 3.3 V voltage, error ±5%) is used to monitor the power supply of the digital system. It can generate a reset signal, which is valid when the power supply voltage falls below the threshold set and within 140 ms after the power supply voltage rises to the threshold. K1 is a manual reset button.

2.3.2 RS232 power supply circuit

The RS232 interface realizes communication with the host computer, such as sending measured data to the host computer (host), receiving control instructions from the host computer, and performing parameter setting and calibration operations. The communication instructions with the host computer use ASC code instructions of variable length, use different signaling headers (SOT) to represent different controls, and have CRC error correction to ensure correct data transmission. The signaling has a unified end code (EOT).

2.3.3 LCD display circuit

TCM24064B is used to complete graphic display, text display, and mixed display of graphics and text. It has a built-in 128 types of 5×8 dot ASCI character font library CGROM, and the character code is 00H~07H. The software design of the LCD display is actually the instruction operation of the controller T6963C. The biggest feature of T6963C is its unique hardware initial value setting function. The parameters required for the display driver, such as duty cycle, the number of bytes/line transmitted by the driver, and the font of the character, all have pin level settings. Initialization is basically completed when power is turned on.

3 System Software Design

Figure 5(a) is a software design flow chart of the speed regulation system of the stepper motor, which mainly realizes the frequency of receiving the main controller. Figure 5(a) is a software design flow chart of the speed measurement system, which is used to collect the actual speed m and compare it with the input speed n to obtain whether there is a deviation (mn). The deviation value is fed back to the main controller through the A/D conversion circuit, and finally the output frequency is adjusted by the PC to achieve the adjustment of the speed.

4 Conclusion

The system design uses LPC2148 as the core controller, and uses the stepper motor speed control circuit and the speed measurement circuit based on the Hall sensor to greatly improve the stability and accuracy of the speed. The experimental results also verify that the speed error can be controlled within ±0.2 m/s. The problem that needs to be paid attention to during the debugging process is that if the motor is to achieve high-speed rotation, the pulse frequency should have an acceleration process, that is, the starting frequency is low, and then it rises to the desired high frequency at a certain acceleration; and solve the problem that the motor shakes and cannot rotate after the driver is powered on. When encountering this situation, first check whether the connection between the motor and the driver L298 is correct; if there is no wrong connection, then check whether the input frequency is too high; whether the frequency increase and decrease design is unreasonable; if none of the above reasons are, the driver may be burned. The entire system based on LPC2148 has the characteristics of high voltage utilization and low power consumption, and simplifies the design of the peripheral interface circuit. The collected signal is processed, and the error value is transmitted back to the main control chip through the feedback circuit to further correct the output frequency, thereby improving the speed accuracy.

Reference address:Design of stepper motor speed regulation and speed measurement system based on LPC2148

Previous article:Application of ARM9 in Temperature Control System of High Precision Biochemical Analyzer
Next article:Hardware Design of Radio Station Detection Controller Based on ARM Processor

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号