当前位置:网站首页>Design of stepping motor controller based on single chip microcomputer (forward rotation and reverse rotation indicator gear)
Design of stepping motor controller based on single chip microcomputer (forward rotation and reverse rotation indicator gear)
2022-07-05 10:08:00 【Chloroplasts don't forget to breathe】
WeChat official account : Chuangxiang diary
send out : Single chip microcomputer stepping motor
Get full report +AD Schematic source file +Proteus Simulation source file + SCM source program + Related information 
One 、 Design description
1. Design purpose
Through the specific small-scale test system design , Practice the whole process of single chip microcomputer system design and debugging , To deepen the understanding of the internal structure of MCU 、 Understanding of functions and instruction systems , And further learn the application of SCM development system and the interface and programming methods of some peripheral chips , Master the hardware of single chip microcomputer system preliminarily 、 Software design technology and debugging skills .
2. The design requirements
This time I choose to finish the project 1—— Design of stepping motor controller based on MCU .
The design requirements are as follows :
1) The motor speed can be controlled smoothly ;
2) Set the speed of the motor through the button on the test box or the dial switch , to turn to ;
3) Display the speed trend of the motor ;
4) Complete basic functions : start-up / stop it , Speed up , Slow down , Positive rotation , reverse ;
5) Use the controls on the experimental box to improve the control effect and control function ( Selected as ).
3. Instruments and equipment
This experiment is conducted online , Did not go to the laboratory for hardware physical verification , Use only Proteus Software simulation .
Two 、 Hardware circuit diagram and main chip description
The single chip microcomputer selected for this system is STC89C51. The stepping motor model is 28BYJ48, The motor has four phase windings , The working voltage is +5V, It can share a power supply with the MCU . For four phase winding of stepping motor P1 Oral P1.0~P1.3 control , because P1 Insufficient mouth drive , So use one piece ULN2803 Increase driving power . Use P0 The port is connected with a light emitting diode , Used to display the current status ,P3 Port control motor forward and reverse . According to the system requirements, draw based on STC89C51 The control block diagram of stepping motor controlled by single chip microcomputer 2.1 Shown .
The system mainly includes single chip microcomputer 、 Reset circuit 、 Crystal oscillator circuit 、 Key circuit 、 Digital display circuit 、 Stepping motor and driving circuit .
1. Minimum system circuit of single chip microcomputer
The minimum system of single chip microcomputer is the most basic and main part of the application of single chip microcomputer expansion development , It is generally composed of the following circuits , It is the core of the whole design, which ensures the expansion and Realization of other functions based on MCU . Pictured 2.2 Shown .
Reset circuit : Reset circuit is the most basic and important circuit in the application of single chip microcomputer , It is used to deal with urgent problems such as single chip microcomputer failure . When the reset port of MCU is at high level , The code in the MCU will not be executed . At the beginning of power on , The capacitor is not fully charged , Reset the port to high level , It avoids program errors caused by running the program directly after power on . When the capacitor is fully charged , The reset port becomes low , The program starts running .
Crystal oscillator circuit : Crystal oscillator circuit is also a necessary circuit in the design of MCU , Provide working sequence for the system . Crystal oscillator circuit provides 11.0592MHZ clock frequency , So as to form the whole stable oscillation circuit , Provide guarantee for the normal operation of single chip microcomputer .
2. Digital display circuit
The nixie tube shows the electrical route 1 position 7 paragraph LED The nixie tube displays the current speed and gear ( common 9 A gear ), See the picture for details 2.3 Shown .
3. Key circuit
The key circuit needs to realize the key to control the forward rotation of the stepping motor 、 reverse 、 Speed up 、 Slow down 、 stop it , All in all 5 A button , See the picture for details 2.4 Shown .
4. Motor and drive circuit
Electric motor and drive circuit ULN2003 Driver chip 、DC-5V Stepper motor 、 Revolution indicator light, etc , See the picture for details 2.5 Shown .
5. The overall circuit of the system 
3、 ... and 、 How the system works
1. Minimum control system
Pictured 3.1, This design uses STC89C51 Single chip microcomputer , This type of single chip microcomputer is STC A low power consumption produced by the company 、 High performance CMOS8 Bit microcontroller , have 4K In system programmable Flash Memory .. On a single chip , Have dexterous 8 position CPU And in system programmability Flash, It can completely meet the needs of this design . Yes STC89C51 Single chip microcomputer , The minimum control system should generally include : Reset circuit 、 Clock circuit .
Reset circuit : The reset circuit adopts manual reset , The so-called manual reset , It refers to turning on the button switch , Make the single chip microcomputer enter the reset state .
Clock circuit : use 22pF Capacitance and 12MHz The crystal oscillator provides the clock frequency for the whole circuit . The clock signal of single chip microcomputer is usually obtained by two circuit forms : Internal oscillation mode and external interruption mode . At pin XTAL1 and XTAL2 External crystal oscillator circuit ( Crystal oscillator for short ) Or ceramic crystal oscillator , It forms the internal crystal mode . Because there is a high gain inverting amplifier inside the MCU , After the external crystal oscillator , It forms a self-excited oscillator and generates an oscillating clock pulse . The capacitance of the external circuit with internal oscillation mode is generally 5~30 pF, The typical value of crystal oscillator frequency is 12MHz, use 6MHz There are more cases .
2. Drive circuit
ULN2803 High voltage and High Current Darlington transistor array , In this array 8 Ludlington transistor is a low logic level digital circuit (TTL、COMS、PMOS or NMOS) With high voltage and high current equipment ( Such as relay 、 Machine hammer 、 Light bulb: ) Ideal device for interface .ULN2803 The internal structure and external pins of the driver are shown in the figure 3.2 Shown .1-8 The foot is the input ,9 Foot joint GND,10 Pin connected load power supply +,11-18 Pin connected output . The left side of the figure below is the input ( Assuming that 1 foot ), The upper right corner is the output ( Corresponding 18 foot ),pin10 by 10 Pin connected load power supply +. When 1 Foot joint +5V When the triode is saturated , here 18 Foot output , The second triode from left to right turns on , Connect the load power GND, At this time, the load is powered on .
Darlington tube is also called composite tube . It is a common base combined amplifier , To form an equivalent new triode . This is equivalent to the amplification factor of the triode is the product of the two . In electronic circuit design , Darlington connection is often used in power amplifiers and regulated power supplies .
Darlington tube is a compound triode , He connected two triodes in series , The emitter of the first tube is connected to 2 The base of a tube , Therefore, the magnification of Darlington tube is the product of the magnification of two triodes . So it is characterized by very high magnification , The function of Darlington tube is generally to amplify very small signals in highly sensitive amplification circuits , Such as high-power switching circuit .
3. Stepper motor
Because the stepping angle of the stepping motor in this design is 18°, Stepping motor assembly Step Angle The default value of the property is 18, In the mode of four phases and eight beats , The step angle of each shot is 9°, Every output 8 Excitation sequence array of bytes FFW when , The motor steps in total 72°, so , Drive the motor for one revolution (360°) A common need 5 Row excitation sequence array FFW, Make the motor rotate n Circle needs to output 5n Row excitation sequence array FFW. The reverse rotation control principle of stepping motor is the same as that at this time .
Based on the above analysis , Can be designed separately STEP_MOTOR_FFW And STEP_MOTOR_REV function , They are respectively used to control the forward and reverse rotation of the stepping motor n circle , Its internal circulation is 8 Time , The external circulation is 5n Time .
choose ULN2803 As a driver chip , Through MCU P1.0P1.3 Output pulse to chip 1B4B mouth , After amplification, from 1C~4C The ports are respectively output to the A、B、C、D phase , Pictured 3.3 Shown .
Four 、 Programming
According to the design requirements , The following specific functions need to be realized through software programming :
1) Drive each module to work , Realize the clear display of digital tube , Realize motor drive ;
2) Realize the forward rotation of the stepping motor controlled by the key 、 reverse 、 Speed up 、 Slow down 、 stop it ;
3)2 LEDs show positive and negative ,1 position 7 paragraph LED The nixie tube displays the current speed and gear ;
4)4 A red LED, Indicates the speed of the motor .
( The following is omitted , See the original report for details )
边栏推荐
- Solve the problem of no all pattern found during Navicat activation and registration
- Android SQLite database encryption
- 【C语言】动态内存开辟的使用『malloc』
- Apache DolphinScheduler 入门(一篇就够了)
- tongweb设置gzip
- QT event filter simple case
- oracle 多行数据合并成一行数据
- 能源势动:电力行业的碳中和该如何实现?
- 移动端异构运算技术-GPU OpenCL编程(进阶篇)
- 卷起来,突破35岁焦虑,动画演示CPU记录函数调用过程
猜你喜欢

Kotlin Compose 多个条目滚动

宝塔面板MySQL无法启动

How do enterprises choose the appropriate three-level distribution system?

How to correctly evaluate video image quality
![[system design] index monitoring and alarm system](/img/83/81534fa31b525c4c7b3175d8312808.png)
[system design] index monitoring and alarm system

ArcGIS Pro creating features

高级 OpenCV:BGR 像素强度图

RMS TO EAP通过MQTT简单实现

为什么不建议你用 MongoDB 这类产品替代时序数据库?

Baidu app's continuous integration practice based on pipeline as code
随机推荐
Tdengine can read and write through dataX, a data synchronization tool
Apache DolphinScheduler 入门(一篇就够了)
宝塔面板MySQL无法启动
.Net之延迟队列
Wechat applet - simple diet recommendation (4)
Tianlong Babu TLBB series - questions about skill cooling and the number of attack ranges
Why does everyone want to do e-commerce? How much do you know about the advantages of online shopping malls?
How to choose the right chain management software?
How to implement complex SQL such as distributed database sub query and join?
【OpenCV 例程200篇】219. 添加数字水印(盲水印)
Observation cloud and tdengine have reached in-depth cooperation to optimize the cloud experience of enterprises
. Net delay queue
How Windows bat script automatically executes sqlcipher command
TDengine 离线升级流程
Single chip microcomputer principle and Interface Technology (esp8266/esp32) machine human draft
Uncover the practice of Baidu intelligent testing in the field of automatic test execution
【 conseils 】 obtenir les valeurs des axes X et y de la fonction cdfplot dans MATLAB
90%的人都不懂的泛型,泛型的缺陷和应用场景
Generics, generic defects and application scenarios that 90% of people don't understand
TDengine 已经支持工业英特尔 边缘洞见软件包