Instrument stepper motor
The stepper motor is an open-loop control element that converts electrical pulse signals into angular displacement or linear displacement. In the case of non-overload, the motor speed and stop position only depend on the frequency and number of pulses of the pulse signal, and are not affected by load changes, that is, when a pulse signal is added to a phase coil of the motor, the motor rotates a step angle. The existence of this linear relationship, coupled with the characteristics of the stepper motor having only periodic errors but no cumulative errors, makes it very simple to use stepper motors to control in the fields of speed, position and other control. Although stepper motors have been widely used, they are not used in conventional conditions like ordinary DC motors and AC motors. They must be used under a control system composed of dual ring pulse signals, power drive circuits, etc.
Instrument stepper motors belong to the category of stepper motors with smaller size and power consumption. They can be directly driven by the pins of a microcontroller or a dedicated chip without the need for an external driver. Therefore, they are used to control the rotation of pointers in instruments.
Demand Analysis
The instruments used in this scheme have the following characteristics and design parameters:
●The pointer responds sensitively and moves accurately, that is, it cannot lose steps after receiving the drive pulse;
●The pointer rotates smoothly, that is, the pointer moves smoothly from the current position to the target position, and there should be no jitter in the forward and reverse directions;
●Two phases, step angle 10o, rotation range 300o.
According to the technical parameters, the step angles of two-phase four-beat and two-phase eight-beat are 10° and 5°, and only 30 and 60 scale divisions can be made within the range of 300°. In practical applications, it is found that the pointer step angle cannot meet the requirements and jitter is inevitable. In order to achieve high-precision accurate positioning and smooth operation of the pointer, the stepping motor step must be subdivided with high resolution, which is also the difficulty of the design.
The subdivision technology of stepper motor is an electronic damping technology, and its main purpose is to improve the running accuracy of the motor and realize the high-precision subdivision of the step angle of the stepper motor. The basic concept is: the step angle of the stepper motor becomes smaller through the drive of the subdivision driver. For example, when the driver works in the 10-subdivision state, its step angle is only one-tenth of the inherent step angle of the motor. Take two-phase four-beat as an example: when the motor works in the full-step state without subdivision, the control system sends a step pulse each time, and the motor rotates 10o; when the subdivision driver works in the 10-subdivision state, the motor only rotates 1o. The subdivision function is completely realized by the driver or the single-chip microcomputer by accurately controlling the phase current of the motor, and has nothing to do with the motor itself.
Segmentation principle
The driving state table of two-phase four-beat A, B, /A, /B is shown in Table 1.
The driving state table of two-phase eight-beat A, B, /A, /B is shown in Table 2. [page]
From the above analysis, we can know that two-phase four-beat is a full-step operation without subdivision, and two-phase eight-beat is actually 2 subdivisions. The angle between the synthetic magnetic field and the current vector changes in the manner of 90o and 45o, and so on.
After referring to relevant materials, it is not difficult to find that subdivision drive technology often uses a step-type current that is close to a sine wave instead of a rectangular wave current to generate a micro-step rotating magnetic field, thereby driving the motor to rotate at a smaller step angle. Its current waveform and rotating magnetic field vector are shown in Figure 1. At the same time, due to the smooth change of the sine wave current, the motor runs more smoothly and with less noise. That is, by changing the magnitude and direction of the current of the adjacent two phases (A, B) (the A phase sine wave and the B phase cosine wave vector are superimposed), the angle of the synthetic magnetic field is changed, and the operation of the stepper motor is controlled by the current vector synthesis method.
Hardware design and software programming
According to the subdivision principle, for a two-phase stepper motor, the voltage and direction of the two sets of coils need to be controlled simultaneously to achieve the purpose of synthetic current vector control. There are two solutions to control the current of the coil: one is to write digital quantities through the microcontroller, and the analog-to-digital converter outputs analog voltage to control the coil current; the other is to output a duty cycle-controllable square wave through the PWM pin of some microcontrollers, and use its AC effective value to control the coil current. Obviously, the duty cycle that changes according to the sinusoidal law determines that the coil current also changes according to the same sinusoidal law. The direction of the coil voltage application can be achieved through a logic gate circuit.
In summary, the ATMEGA48 microcontroller with two 16-bit precision PWM functions is selected, and the peripheral hardware circuit design is shown in Figure 2.
Use the PB1 and PB2 with PWM function of the microcontroller to connect PWM_A and PWM_B, and use two ordinary pins to connect DIR_A and DIR_B to control the motor. The principle is as follows: A, /A, B, /B of the motor correspond to 3, 6, 8, 11 pins of the four-input AND gate circuit respectively. When DIR_A and DIR_B are low, the 1 and 9 pins of the gate circuit are in the 0 state, the transistors Q3 and Q4 are cut off, and the 4 and 12 pins of the gate circuit are in the 1 state due to the pull-up. In this way, the 3 and 8 outputs of the AND gate circuit are 0, that is, A and B are 0; at this time, the 6 and 11 outputs of the AND gate circuit are consistent with PWM_A and PWM_B, that is, /A and /B are determined by PWM_A and PWM_B. In other states, it also has similar characteristics: the polarity of the conduction between A and /A, and between B and /B is determined by DIR_A and DIR_B; the current between A and /A, and between B and /B is determined by the duty cycle of PWM_A and PWM_B. Moreover, as long as transistors Q3 and Q4 work normally, there will be no logical confusion in the AND gate circuit.
In conjunction with the hardware design, an array of 64 data was written in the software, corresponding to the 8-bit digital quantization values of the sine wave amplitude change from 0 to 90 degrees (simulating 64-point sine wave sampling in a step wave manner). Each value is used to control the duty cycle of the output waveform, and actually participates in the calculation of the current magnitude during the process of the current vector angle rotating 90 degrees. As we all know, the phase difference between sine and cosine waves is 90o. After the sine wave amplitude variation table of 0~90o is known, the sine wave and cosine wave amplitude variation tables of 90o~180o, 180o~270o, and 270o~360o (0o) can also be obtained. Therefore, through the evolution of the 8-bit digital quantization table of the sine wave amplitude variation of 0~90o, the current vector angle can be divided into four quadrants on the basis of two-phase eight beats (two subdivisions). With the control of polarity, 8 combinations of A or/A sine wave and B or/B cosine wave can be made in each quadrant. The current size can be changed in each combination, and finally two-phase 64 beats (16 subdivisions) control can be achieved. Moreover, the most ingenious point is that by selecting 64 data corresponding to 64 points of the sine wave in the range of 90 degrees, one byte can be used as a mark to distinguish the four quadrants, which is convenient for the evolution of the sine and cosine angles, that is, 0~63 corresponds to 0~90 degrees, 64~127 corresponds to 90 degrees~180 degrees, 128~191 corresponds to 180 degrees~270 degrees, and 192~255 corresponds to 270 degrees~360 degrees.
The driving state table of two-phase 64 beats A, B, /A, /B is shown in Table 3 (with B as the starting state).
Since the change amount of the instrument pointer will be different when it points from the current angle to the target angle, in order to ensure that the pointer responds sensitively and without jitter, acceleration and deceleration control must be considered during positive and negative rotation. In the program, several control intervals can be set according to the size and positive and negative of the change amount, and different delay parameters can be written respectively. According to this delay parameter, the change time of the current size and direction (changing PWM_A and PWM_B, DIR_A and DIR_B) can be controlled to achieve the purpose of acceleration and deceleration control.
Conclusion
By controlling the two-phase stepper motor with dual PWM, the purpose of high-precision subdivision is achieved while optimizing the hardware cost. By adding a power drive circuit to the back stage of the existing circuit and making a small modification to the program, a high-precision, multi-subdivision stepper motor driver can be made.
Previous article:A Reconfigurable MAC Protocol Design Based on ARM and FPGA
Next article:Realization of intelligent auxiliary maintenance system for electric locomotive based on AVR microcontroller
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- ARM's strategic layout in the field of Internet of Things
- BearPi-HM Nano Development Board Review 1 Getting Started with Program Development
- 【GD32307E-START】Unboxing + Impressions of the board + Lighting ceremony
- Sequential logic circuit
- I have some doubts about SensorTile.box
- A novice needs help. When drawing PCB manual wiring in AD13.4, why can't I see the trace of the wiring before the wiring is completed?
- What are the important techniques for PCB wiring?
- Naming of Cadence Allegro 17.2 built-in pads
- TI - MCU - MSP430 User Guide 2 -> CPU/CPUX
- How to improve the hardware and software architecture of embedded minimum systems?