Introduction to PWM
Pulse width modulation is a very effective technology that uses the digital output of a microprocessor to control analog circuits. It is widely used in many fields from measurement and communication to power control and conversion.
Pulse width modulation is an analog control method that modulates the bias of the transistor base or MOS tube gate according to changes in the corresponding load to change the conduction time of the transistor or MOS tube, thereby achieving the output of the switching regulated power supply. Change. This method can keep the output voltage of the power supply constant when the working conditions change. It is a very effective technology for using the digital signal of the microprocessor to control the analog circuit.
What is a steering gear
The steering gear is a position (angle) servo driver, suitable for control systems that require the angle to continuously change and be maintained. The steering gear is a large deck machinery on the ship.
This article mainly introduces the 51 microcontroller PWM dual servo control. Follow the editor to learn more about it.
Detailed explanation of 51 microcontroller PWM dual servo control
The steering gear used - Shenghui SG90 steering gear (standard version)
The working principle of Shenghui SG90 steering gear
First, there is a reference voltage inside the steering gear. If we want to control the rotation of this servo. Then we have to give it a certain period of DC bias voltage through a certain signal line.
Finally, the servo will internally compare the DC bias voltage with the internal reference voltage to obtain a voltage difference output. Finally, the positive and negative voltage difference is output to the motor driver chip to determine the forward and reverse rotation of the motor.
After such a simple description, we roughly know how to control the forward and reverse rotation of the steering gear.
Let's find out what kind of periodic DC bias voltage should be given to it?
Let’s take a look at the concept of duty cycle (picture):
As shown above: duty cycle = t/T;
To control the servo, we need a period T = 20ms. The high level small t is equal to such a square wave between 0.5ms-2.5ms.
Why is this parameter?
Through the above basic conceptual knowledge, we have roughly understood the working principle of the steering gear. Next, let's take a look at how to use C51 microcontroller PWM to adjust and control it.
for T = 20ms. We can count with timer 0 (mode 1). 0.1ms each time. If the count reaches 200, it means that a cycle has arrived and the count is cleared to 0.
Replenish:
For t = 0.5ms—–2.5ms we can use global variables. Let the global variable be equal to 5-25, because a counting period of my servo is 0.1ms, so the 5-25 of the global variable is exactly 0.5ms-2.5ms
With this correspondence, the program becomes simple:
Previous article:Use 51 microcontroller and DS1302 clock chip to make a simple electronic clock
Next article:Design of RC measurement system based on 555 timer and microcontroller
Recommended ReadingLatest update time:2024-11-16 08:31
- Popular Resources
- Popular amplifiers
- 西门子S7-12001500 PLC SCL语言编程从入门到精通 (北岛李工)
- Small AC Servo Motor Control Circuit Design (by Masaru Ishijima; translated by Xue Liang and Zhu Jianjun, by Masaru Ishijima, Xue Liang, and Zhu Jianjun)
- Intelligent Control Technology of Permanent Magnet Synchronous Motor (Written by Wang Jun)
- 100 Examples of Microcontroller C Language Applications (with CD-ROM, 3rd Edition) (Wang Huiliang, Wang Dongfeng, Dong Guanqiang)
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
- Release an operating system source code package that runs on NXP LPC1768.
- EEWORLD University Hall----Live Replay: SimpleLink? Latest Software and Hardware Solutions for Wireless Platform
- Thank you-Brothers of EE Water Army
- nF capacitor and 1M resistor in parallel between the metal case and GND
- 【CH579M-R1】+ Bluetooth function key preliminary test
- Angle estimation problem of micro-core sliding film observer SMO
- BPM shortwave receiver module
- Where can I change the component description in the AD printed circuit board BOM?
- CY8CKIT-149 PSoC 4100S PLUS PROTOTYPING KIT Resources
- Have any students participated in previous TI invitational competitions? Is it necessary to use a TI board as the development board?