Phone

    00852-6915 1330

L298N Based DC Motor PWM Control System Design

  • Contents

I. Introduction

DC motors are widely used in various fields due to their good speed regulation performance, large starting torque, and strong overload capacity. In recent years, the structure and control methods of DC  motors have undergone great changes. With computers entering the control field and the continuous emergence of new power electronic power componentsPWM  (pulse width modulation) speed regulation has become a new way of DC motor speed regulation. And with the advantages of high switching frequency, stable low-speed operation, excellent dynamic performance, and high efficiency, it is widely used in DC motor speed regulation,  Therefore, this paper proposes the design of a DC  motor PWM  control system based on 80C196KC and L298N.

L298n

Catalog

I. Introduction

II. Principle of PWM Speed Control System

III. Control System Hardware Design

3.1Introduction to Power Integrated Circuit L298N

3.2 DC Motor Control System Hardware Circuit

3.3 Anti-interference and Electromagnetic Compatibility Design

IV. Control System Software Realization

V. Conclusion

FAQ

Ordering & Quantity

II. Principle of PWM Speed Control System

 

PWM, or pulse width modulation, refers to the use of the switching characteristics of high-power transistors to modulate a fixed voltage DC  power supply, which is turned on and off at a fixed frequency, and the length of the on and off time in a cycle is changed as needed. By changing the duty cycle of the voltage on the armature of the DC  servo motor, the average voltage is changed to control the speed of the motor. Therefore, it is often called a switch drive device. The schematic diagram of PWM control is shown in Figure 1.

Figure 1 PWM control schematic diagram

Figure 1 PWM control schematic diagram

There are usually two ways to change the duty cycle: PWM  and  PFM  (pulse frequency modulation).  PWM  is by changing the width of the on-pulse, which is commonly referred to as the fixed frequency width modulation method.  PFM means that the on-pulse width is constant and the duty cycle is changed by changing the switching frequency. Because when it encounters mechanical resonance at a particular frequency, it often results in system vibration and howling. Therefore, in the control of DC motors, the  PWM control method is mainly used.

 

III. Control System Hardware Design

 

The DC  motor speed control system based on 80C196KC and L298N is composed of the smallest single-chip microcomputer system, R/D converter, PWM power amplifier circuit, A/D, and D/A conversion circuit, and receiving command interface circuit. The minimum system of the single-chip microcomputer adopts the 16-bit single-chip 80C196KC external expansion interface circuit, which is mainly used to realize the functions of data acquisition and  PWM signal generation. The block diagram of the speed control system is shown in Figure 2.
Figure 2 Block diagram of PWM speed control system

Figure 2 Block diagram of PWM speed control system

 

3.1 Introduction to Power Integrated Circuit L298N

 

In order to improve system efficiency and reduce power consumption, the power amplifier drive circuit adopts the integrated circuit L298N based on the bipolar H-bridge pulse width modulation method. L298N is a high-performance pulse-width modulation power amplifier produced by SGS, which has the characteristics of small size and strong driving ability. It contains two H-bridge high-voltage and high-current bridge drivers, which can realize the full-bridge drive of the motor with a single chip, which can drive motors below 46V and 2A. The internal structure of L298N is shown in Figure 3.

Figure 3 L298N internal structure block diagram

Figure 3 L298N internal structure block diagram

 

3.2 DC Motor Control System Hardware Circuit

 

L298N can drive two  DC motors, because the speed control system is a single-axis structure, in order to make full use of the load capacity of the power amplifier circuit, so that the system starts at the maximum acceleration and brakes at the maximum acceleration, in the design, the input terminal and the output terminal are connected in parallel to control the  DC motor.

The single-chip 80C196KC gives a PWM signal according to the calculation results of the position loop and the speed loop. The PWM signal is directly output to the IN1 (IN3) terminal, and the PWM signal is inverted and output to IN2 (IN4) through 7406. When the duty cycle of the PWM analog signal is 50%, the positive and negative voltages at both ends of the motor are applied for the same time. The motor is in a state of tremor at this position, that is, in the "power lubrication" state. When the duty cycle is greater than 50%, the signal voltage OUTA is greater than OUTB, and the motor rotates forward, otherwise reverse.

Therefore, the output polarity of each link must be straightened out to form negative feedback and complete closed-loop control. Relying on changing the PWM duty cycle to control the motor speed can also change the motor rotation direction, the control method is simple and reliable.

 In addition, because the motor is of electric coil type, reverse electromotive force will be formed when the motor has an emergency stop and sudden commutation. To ensure the normal operation of the L298N drive chip, two pairs of continuations are added between the output terminals OUTA, OUTB, and the DC motor. The flow diode shunts the current to the positive or ground terminal of the power supply to prevent back electromotive force from damaging the L298N.

 

3.3 Anti-interference and Electromagnetic Compatibility Design

 

When the motor is driven, the rapid on-off of the power main switching element leads to a large rate of change of power current and voltage, which not only affects the drive circuit but also enters the control circuit through the power supply and ground.

In addition, when the motor starts and brakes, the transient voltage is generated at the sudden change of the load, its amplitude will be higher than the power supply voltage, and the leading edge is steep, the frequency band is very wide, and it enters the control circuit through the DC power supply. Therefore, anti-interference and electromagnetic compatibility design is also very important. The system has adopted measures such as current smoothing, deburring, and shielding.

 

Current smoothing: Because the instantaneous energy of the PWM switch is relatively large, the RC filter is used at the output of the PWM power amplifier to filter. By selecting the appropriate resistance and capacitance values, high-frequency harmonics are effectively suppressed and the peak voltage of the PWM power amplifier is absorbed. Thereby reducing the interference;

 

Deburring: The system increases the filter capacitor on the power supply side, and uses one large and one small capacitor in parallel. The large capacitor is responsible for the decoupling, filtering, and smoothing of low-frequency alternating signals, and the small capacitor eliminates mid-and high-frequency parasitics coupling in the circuit network, which effectively reduces spikes and burrs;

 

Shielding: The motor drive cable adopts double-shielded cables, and the wiring should be separated from other cables as much as possible.

Figure 4 Drive hardware circuit diagram

Figure 4 Drive hardware circuit diagram

 

IV. Control system software realization

 

The control system adopts the speed-position closed-loop combination method, taking the position control method as an example to introduce the realization method of the software. The position control is based on the classic PI control algorithm, and the proportional and integral parameters are simplified design, and the segmented PI control is introduced. , That is, the calculated error is divided into sections, and different proportional and integral parameters participate in the adjustment within the error range of each section, which ensures the smoother and more stable operation of the system. The derivation and simplification process of PI formula is as follows:

The specific software implementation flowchart is shown in Figure 5. That is, after receiving a given angle command, first calculate the difference between the sampled position information and the given angle, and then divide the difference into n equal parts, and each segment corresponds to a set of parameters Kp1 and ki1 participate in mediation control, calculate the output of PI control and then convert it into the corresponding PWM numerical output.

Figure 5 The specific software implementation flowchart

Figure 5 The specific software implementation flowchart

 

V. Conclusion

This article sums up the design scheme of the DC motor PWM control system based on 80C196KC and L298N. The single-chip microcomputer generates a PWM signal to the power integrated circuit L298N. The classic PI segment control is used to control the motor. It has the characteristics of a simple circuit and convenient control. The operating test results show that the system works stably and reliably, meets the requirements of the speed regulation function, and has been successfully applied to many airborne products.


FAQ

  • What method is the integrated circuit L298N based on?

Bipolar H-bridge pulse width modulation

  • What type of computer generates PWM signal to the power integrated circuit L298N?

Single-chip microcomputer

  • What is l298n?

This L298N Motor Driver Module is a high power motor driver module for driving DC and Stepper Motors. This module consists of an L298 motor driver IC and a 78M05 5V regulator. L298N Module can control up to 4 DC motors, or 2 DC motors with directional and speed control.

  • What is the use of l298n?

The L298N is a dual H-Bridge motor driver which allows speed and direction control of two DC motors at the same time. The module can drive DC motors that have voltages between 5 and 35V, with a peak current up to 2A.

  • How does l298n control DC motor speed?

1.If you send a HIGH signal to the enable 1 pin, motor A is ready to be controlled and at the maximum speed;

2.If you send a LOW signal to the enable 1 pin, motor A turns off;

3.If you send a PWM signal, you can control the speed of the motor. The motor speed is proportional to the duty cycle.

  • What is l298n motor driver module?

This L298N Motor Driver Module is a high power motor driver module for driving DC and Stepper Motors. This module consists of an L298 motor driver IC and a 78M05 5V regulator. L298N Module can control up to 4 DC motors, or 2 DC motors with directional and speed control.

  • How does l298n motor driver work?

The L298N is a dual H-Bridge motor driver which allows speed and direction control of two DC motors at the same time. The module can drive DC motors that have voltages between 5 and 35V, with a peak current up to 2A.

  • How do i use a l298 motor driver with Arduino?

Start by connecting power supply to the motors. In our experiment we are using DC Gearbox Motors(also known as 'TT' motors) that are usually found in two-wheel-drive robots. They are rated for 3 to 12V. So, we will connect external 12V power supply to the VCC terminal.

  • What is the function of H bridge?

An H-bridge is an electronic circuit that switches the polarity of a voltage applied to a load. These circuits are often used in robotics and other applications to allow DC motors to run forwards or backwards.

  • What is the difference between l293d and l298n?

L293 is quadruple half-H driver while L298 is dual full-H driver, i.e, in L293 all four input- output lines are independent while in L298, a half H driver cannot be used independently, only full H driver has to be used. ... Hence, heat sink is provided in L298.

 

Kynix

Kynix was founded in 2008, specializing in the electronic components distribution business. We adhere to honesty and ethics as our business philosophy and have gradually established an excellent reputation and credibility in our international business. With the accurate quotation, excellent credit, reasonable price, reliable quality, fast delivery, and authentic service, we have won the praise of the majority of customers.

Join our mailing list!

Be the first to know about new products, special offers, and more.

Leave a Reply

We'd love to hear from you! Feel free to share your thoughts and comments below. Rest assured, your email address will remain private.

Name *
Email *
Captcha *
Rating:

Kynix

  • How to purchase

  • Order
  • Search & Inquiry
  • Shipping & Tracking
  • Payment Methods
  • Contact Us

  • Tel: 00852-6915 1330
  • Email: info@kynix.com
  • Follow Us

authentication

Kynix

© 2008-2026 kynix.com all rights reserved.