Design of DC motor stepless speed regulation system using PIC microcontroller

Publisher:mmsg3814Latest update time:2020-01-21 Source: elecfans Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

In modern industrial production, the motor is the main driving device. At present, the KZ-D drive system that uses thyristor (i.e., silicon controlled rectifier) ​​devices to power the motor has been widely used in DC motor drive systems, replacing the bulky F-D system of generator-motor. With the high development of electronic technology, the DC motor speed regulation has gradually changed from analog to digital. In particular, the application of single-chip microcomputer technology has brought the DC motor speed regulation technology into a new stage. Intelligence and high reliability have become its development trend. This speed regulation system uses PIC16F874 single-chip microcomputer as the central processor, and fully utilizes the characteristics of PIC16F874 single-chip microcomputer capture, comparison, and analog/digital conversion modules as the trigger circuit. Its advantages are: simple structure, synchronization with the main circuit, stable phase shift and sufficient phase shift range, control angle adjustment of up to 10,000 steps, can realize stepless smooth control of the motor, steep pulse front edge and sufficient amplitude, pulse width can be set, good stability and anti-interference performance, etc.


1 DC motor speed regulation principle
The relationship between the speed n of a DC motor and other parameters can be expressed by the following formula:
20171118102324519.png (1)
(1) Where: Va-armature voltage, Ia-armature current, Ra-total armature circuit resistance, Ca-potential constant, Φ-excitation flux.
20171118102324151.png       (2)
(2) Where: p-number of magnetic pole pairs, N-number of conductors, a-number of armature branches.

 CaΦ=K (3)
(3) In the formula: When the motor model is determined, CaΦ is a constant, so formula (1) is changed to
20171118102324115.png
In small and medium power DC motors, the armature circuit resistance is very small, and the IaRa term in formula (4) can be omitted. It can be seen that when the armature voltage of the DC motor is changed, the speed n changes accordingly.

 

2 System Working Principle
This system is mainly composed of the main control switch, motor excitation circuit, thyristor speed control circuit (including speed measurement circuit), rectifier filter circuit, smoothing reactor and discharge circuit, energy consumption braking circuit, and the system is controlled by a closed-loop PI regulator. When the main control switch is closed, the single-phase AC is controlled by the thyristor speed control circuit, and then passes through the bridge rectifier, filter, and smoothing reactor to obtain a small pulse and continuous DC, which is provided to the motor. At the same time, the AC is rectified by the excitation circuit to make the motor excited and start working. Adjust the speed setting potentiometer RP1 in the trigger circuit so that when the AN1 input voltage decreases, the control angle output by the PIC16F874 microcontroller also decreases accordingly, the thyristor conduction angle increases accordingly, the main circuit output voltage increases, the motor speed increases, and the speed measurement circuit output voltage also increases. After the PI regulator acts, the motor runs stably within the set speed range.

 

3 Circuit design of each part of the system
3.1 Main circuit design
The parameters of each component in the main circuit are shown in Figure 1:
20171118102325949.png
Press the start button SB1, the contactor KM coil is energized, the KM normally open contact is closed, the normally closed contact is opened, the start button is self-locked, and the main circuit is turned on. The thyristor speed control circuit controls the AC output by changing the control angle of the bidirectional thyristor, and then obtains DC after bridge rectification and filtering. At the same time, the motor is rectified by the excitation circuit, obtains excitation, and starts working.


Press the stop button SB2, the contactor KM coil is de-energized, the KM normally open contact opens, the normally closed contact closes, the self-locking is released, the main circuit is de-energized, and the motor stops working.


In order to limit the DC current pulsation, a smoothing reactor is connected to the circuit. The resistor provides a discharge circuit for the smoothing reactor when the main circuit is suddenly powered off.


In order to speed up braking and parking, this device adopts energy-consuming braking, and the braking link is composed of resistor R4 and the normally closed contact of the main circuit contactor. The motor excitation is powered by a separate rectifier circuit. In order to prevent the motor from losing magnetism and causing a runaway accident, an undercurrent relay KA is connected in series in the excitation circuit. The action current can be adjusted by the potentiometer RP.

3.2 Thyristor trigger circuit design
The thyristor trigger circuit and parameters are shown in Figure 2. The voltage from points A and B in the main circuit is transformed to -20 V by a transformer, and then after bridge rectification, 100 is generated at point 2. The half-wave signal of about Hz is connected to the NPN transistor for amplification after being divided by R6 and R7, and a zero-crossing pulse is generated at the collector of the transistor. The CCP1 module is used to capture the rising edge of the zero-crossing pulse and record its occurrence time, and then the falling edge of the zero-crossing pulse is captured. The time difference between the two is the zero-crossing pulse width, and half of its value is the midpoint of the pulse. This capture method can accurately obtain the actual zero-crossing point of the alternating current. At the same time, the ADC analog conversion module is used to convert the value of the analog voltage of the PIC16F874 pin RA1/AN1 as the setting value of the thyristor control angle (motor speed setting value), and the setting value of the potentiometer RP1 is changed to change the size of the thyristor control angle accordingly. At the same time, the output value of the speed measurement circuit is input by the PIC16F874 pin RC0/T1CKI, counted by the TMR1 counter, and the speed is calculated as the speed feedback value. The oscillation frequency of the microcontroller in this system is 4 MHz. From the characteristics of the instruction cycle of the PIC16F874 microcontroller, it can be seen that the resolution of the thyristor control angle is the reciprocal of one-fourth of the microcontroller oscillation frequency, that is, 1us. For the half-wave time of industrial frequency electricity of 10 ms, the control angle can reach 10,000 steps, which is fully capable of realizing stepless smooth control of the motor.
20171118102331740.jpg
 

3.3 Speed ​​measurement circuit design
The speed measurement circuit consists of an optical encoder attached to the motor rotor and an electric pulse amplification and shaping circuit. The frequency of the electric pulse is in a fixed proportional relationship with the motor speed. The electric pulse signal output by the optical encoder is amplified and shaped into a standard TTL level and input from the PIC16F874 microcontroller pin RC0/T1CKI. It is counted by the TMR1 counter to calculate the speed. This speed is compared with the preset speed to obtain the difference. The PIC16F874 performs PI calculation on this difference to obtain the control increment, and sends the size of the thyristor control angle in CCP2, thereby changing the effective voltage applied to both ends of the motor, and finally achieving the purpose of controlling the speed.

 

4 System software design
The speed closed-loop control is designed as a typical I system, namely, a PI regulator, which is used to adjust the thyristor control angle time Td. The control algorithm is: where a1=Kp, Kp-controller proportional coefficient, T1-integral time constant, Ti -sampling period. The software design modules of this system mainly include CCP1 rising edge capture module, CCP1 falling edge capture module, control angle setting value A/D conversion module, speed measurement circuit pulse timing counting module, PI regulator module, CCP2 comparison output module, etc. The relationship between the program flow charts of each module is shown in Figure 3. Figure 3 CCP1, CCP2 module interrupt program flow chart Assume that we get the zero-crossing time as Tσ, and the thyristor control angle time as Td, then send the comparison value Tf=Tσ+Td into the CCP2 register CCPR2H:L. After the comparison is consistent, a high level will be output on the CCP2 pin to turn on the thyristor. Then, according to the required trigger pulse width value, the CCPR2H:L value will be modified again to make the output high-level trigger pulse maintain for a certain period of time and then return to a low level. In this way, a bidirectional thyristor trigger pulse output is completed.
20171118102331247.png


20171118102339821.jpg


Summary: The software and hardware design of this system makes full use of the characteristics of the capture, comparison, and analog/digital conversion modules of the PIC16F874 microcontroller, as well as the advantages of the microcontroller such as high oscillation frequency and fast response, and designs the corresponding trigger circuit, so that the analog/digital conversion module of the PIC16F874 microcontroller can quickly and accurately convert the speed setting value; the CCP1 module can accurately capture the zero-crossing point of the alternating current; the timing and counting module of the speed measurement circuit can accurately count and calculate the feedback speed; the CCP2 module can timely compare the Tf value and output the trigger pulse. In the application of small and medium-sized DC motor speed control system, it has the characteristics of simple structure, reliable operation, wide adjustment range, good current continuity and fast response.

Reference address:Design of DC motor stepless speed regulation system using PIC microcontroller

Previous article:PIC microcontroller AD conversion (example analysis)
Next article:How to design a medical call intercom system based on PIC microcontroller

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号