DC motor speed control system based on STC12C52 series microcontroller

Publisher:恬淡如云Latest update time:2016-02-26 Source: 21icKeywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
In modern industry, motor speed control systems are widely used in machinery, metallurgy, petrochemical, defense industry and other industrial sectors. With the entry of computers into the control field and the continuous emergence of new power electronic power components, the use of pulse width modulation (PWM) control has become the absolute mainstream. Pulse width modulation is a technology that uses a program to control the waveform duty cycle, period, and phase waveform. It is widely used in motor drive, D/A conversion and other occasions. This control method has been used as the basis for digital control of DC motors. In DC speed control, various controllers can be used, and single-chip microcomputers are one of the options.

1 Functional Description

The motor speed control system uses a microprocessor as the control core, and the control board, motor driver chip, peripheral circuits, motor, etc. form the entire motor speed control system. The microprocessor generates a pair (a total of 2 channels) of PWM signals, which are controlled by the motor driver chip to execute the motor to achieve the speed control requirements of the motor under different operating conditions.

2 Composition of motor speed control system

The composition of the motor speed control system is shown in Table 1.

a.jpg

3 Technical indicators

The technical indicators are as follows:

1) Working temperature: -40℃~+60℃;

2) Supply voltage: DC 27 V;

3) Output torque: 1.2 N·M;

4) Maximum no-load speed: 1 050 rpm;

5) Rated current: 2.3 A.

4 Design Principles

4.1 Block Diagram

The functional block diagram is shown in Figure 1.

b.jpg

4.2 Principle Introduction

As shown in Figure 1, by operating the computer screen display interface, different operating states of the motor are selected, and the computer control board collects the corresponding state information, outputs the corresponding state quantity code (see truth table 2 for state quantity indication) and sends it to the single-chip microcomputer. The single-chip microcomputer generates a PWM pulse width signal with a corresponding duty cycle based on the received code information. The pulse width signal is amplified by the power amplifier circuit and drives the execution motor, thereby realizing speed control of the motor.

c.jpg

The high bit D2 indicates directionality, 0 for positive direction and 1 for negative direction; D1 and D0 indicate speed.

5 Design Analysis

5.1 Control/Drive Circuit Design

The control/drive circuit is mainly composed of the single-chip microcomputer STC12C5206AD, the motor drive chip DRV8842, etc. The design principle of the control/drive circuit is shown in Figure 2.

d.jpg

5.2 Power Circuit

The working power supply of this speed control system is DC +24 V and DC +5 V. Among them, +5 V is converted from DC +24 V and output for use by the single-chip microcomputer STC12C5202AD. The +5 V conversion circuit is mainly composed of the voltage regulator LD1086, capacitors, etc., as shown in Figure 3. When designing the circuit board, the power line should be widened as much as possible, and the power line and signal line should be separated to avoid interference signals.

e.jpg

5.3 Motor drive circuit

The motor drive circuit is mainly composed of the driver chip DRV8842 and its peripheral circuits.

The driver chip DRV8842 is an integrated circuit dedicated to motors, which contains a PWM current-controlled H-bridge control circuit. The circuit is shown in Figure 4. The operating voltage is 8.2 V to 45 V, the operating current is 5 A, and the operating temperature is -40℃ to 85℃.

As shown in Figure 4, by controlling the input states of the IN1 and IN2 pins of DRV8842, the output states of OUT1 and OUT2 can be directly controlled. The logic control is shown in Table 3.

f.jpg

g.jpg

PWM pulse width modulation is used to control the motor speed, and its control logic is as follows: when IN1 inputs PWM signal and IN2 inputs low level, the motor rotates forward; when IN1 inputs low level and IN2 inputs PWM signal, the motor rotates reversely; the duty cycle of the PWM signal determines the speed of the motor.

5.4 Microprocessor

The microprocessor is STC12C5206AD produced by Shenzhen Hongjing Technology. STC12C5206AD is a single clock/machine cycle (1T) microcontroller produced by Hongjing Technology. It is a new generation of microcontroller with high speed/low power consumption/super strong anti-interference. The instruction code is compatible with the traditional 8051, but the speed is 8 to 12 times faster. It integrates MAX810 dedicated reset circuit, 2-way PWM, 8-way high-speed 8-bit A/D conversion (300 k/s, i.e. 300,000 times/second), which is aimed at motor control and strong interference occasions.

The main performance is as follows:

1) Working voltage: 5.5 V ~ 3.3 V;

2) Operating frequency: 0~35 MHz, equivalent to 0~420 MHz of ordinary 8051;

3) User application space: 6 k bytes;

4) On-chip integrated RAM: 256 bytes;

5) General I/O ports: 13;

6) With EEPROM function;

7) Watchdog;

8) Internally integrated MAX810 dedicated reset circuit (when the external crystal is below 20 M, the reset pin is directly connected to the ground with a 1 k resistor);

9)PWM: 2 channels;

10) A/D conversion: 8-bit precision ADC, 8 channels in total, conversion speed up to 300 k/s (300,000 times per second);

11) Working temperature: -40℃~85℃.

5.5 Software Analysis

The software mainly consists of two parts: the upper computer control program and the lower computer control program. The software flow chart is shown in Figure 5 and Figure 6.

h.jpg

i.jpg

6 Conclusion

The design results meet the requirements, operate well, and achieve the expected purpose.

Keywords:MCU Reference address:DC motor speed control system based on STC12C52 series microcontroller

Previous article:Design of remote monitoring system of temperature and humidity in facility agriculture based on mobile phone text messages
Next article:Multi-task and multi-process based on 51 single chip microcomputer

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号