February 22, 2025

DC Motor Measurement and Control System Based on MCU PID Algorithm

With the development of electronic technology, the measurement and control of DC motors has gradually shifted from analog to digital. The DC motor measurement and control system, which is completely implemented by hardware circuits, has complicated circuits, difficult adjustment and low reliability, and lacks control flexibility. In industrial control, PID regulators that control the ratio of deviation P, integral I, and derivative D are now widely used. Pneumatic, hydraulic, and electric PID regulators used in continuous process systems almost monopolized the use of small microcomputers in the production process. The theory of optimal control can prove that it can adapt to the control requirements of many industrial objects. The continuous development of the single-chip microcomputer control technology, especially the use of the software PID algorithm controller, replaced many original hardware PID regulators, and has been more widely used in industrial control systems and embedded systems. The measurement and control technology of DC motors based on software PID algorithm controller and hardware PWM technology is being developed in a digital, intelligent and high reliability manner.

1 system hardware components DC motor monitoring and control system as shown. The system is based on the Cygnal C8051F020 as the core of the closed-loop real-time measurement and control system, is a classic enough to achieve speed preset, speed display, and can accurately measure and control the speed.

The sampling pulse generated by the hall speed circuit sends an external interrupt and counts through the counter to calculate the rotation speed. Compare this speed value with the preset speed value to get the difference. C8051 PID operation by the difference, to obtain the control increment, and then by the C8051 output control parameters, by the PWM circuit to change the effective voltage across the motor, and ultimately achieve the purpose of controlling the speed.

DC motor measurement and control system schematic keyboard and display circuit using a serial interface 7279 control circuit.

Enter the control command on the function keyboard. The motor speed is displayed on the seven-segment display.

PWM controller direction for the computer monitoring and control technology.

The p%Ms controller consists of a pwM wave open generator and pwm delay protection t and a power amplifier circuit. In the system, the timer T0 is used in the speed measurement. If the PWM waveform occurs, the C8051 will also increase the task of the software and affect the real-time control effect of the entire system. Therefore, the PWM waveform is generated by the external circuit, while the C8051 only provides control parameters to change the pulse width duty cycle, and achieves variable frequency control of the motor speed. The PWM waveform generator is as shown.

The cycle and frequency of the output pulse can be calculated rotational speed. In order to improve the accuracy of the motor speed measurement, multiple magnets can be evenly fixed on the motor turntable. The Hall sensor will generate multiple pulses for each revolution of the motor, and the motor speed can be accurately measured by software calculation.

Because the Hall sensor output pulse peak is small and the waveform edge is incomplete, the Schmidt trigger circuit is used to shape the pulse and output it to the C8051 external interrupt INTO. The Schmidt trigger input and output waveforms are as shown.

u. U1 of this PWM waveform generator is a 10-bit counter, and the clock input terminal of the counter is connected to the XTAL2 terminal of the C8051 crystal oscillator. The main frequency used in this system is a 12MHz crystal oscillator. After frequency division by U1, the PWM waveform frequency is cascaded. U2>Bout is terminated with a zero-crossing comparator. Its output is PWM wave. The pulse width of PWM wave can be changed by outputting the value from port P0.

The PWM wave output load capacity is too small to directly drive the motor, so we used a bipolar pulse width modulated power amplifier. Considering that it takes a certain time for the high-power transistor to turn on from saturation to saturation to prevent all the power amplifiers from being turned on at the same time, a logic delay and interlocking protection circuit are implemented using several gate circuits. At the same time, in order to make the motor work safely, resistors and capacitors are connected at both ends of the motor. The resistance value and the size of the capacitor are related to the motor parameters and the frequency of the PWM waveform and can be calculated.

L2 Hall detection circuit speed is a common parameter in engineering, and there are many measurement methods for speed. The application of Hall switch sensors is one of them. Hall switch sensors are made of semiconductor materials and their output voltage is proportional to the size of the external magnetic field. Due to its small size, no contact, good dynamic performance and long service life, it has been widely used in the field of measuring the rotational speed of rotating objects. In this system, 3000 Series Hall switch sensors manufactured by SPRAGUE Corporation of the United States are used.

According to the Hall effect principle, a permanent magnet is fixed on the rotating plate edge of the motor shaft, the magnet rotates with the motor, and a Hall switch sensor is installed near the motor in a position that is relative to the rotation shaft, and the Hall sensor should be in the magnetic magnetic field effective range. Inside. When the motor rotates, influenced by the magnetic field generated by the magnetic steel, the software design software of Huo2 system is based on CygnalIDE integrated development environment and KeilC51 language. The main modules of this system are main program, INT0 interrupt subroutine, T0 interrupt subroutine, PID algorithm subroutine and display keyboard processing subroutine. After a series of initializations, the main program is transferred to the "PWM drive, keyboard control processing, display adjustment" loop waiting for interrupt; external interrupt INT0 interrupt service routines count the speed pulses output from the Hall circuit; T0 generates a 50ms timer interrupt, T0 interrupt The service subroutine counts the number of interrupts, reads out the count value of the rotational speed pulse every 20 times (1 second), calculates the rotational speed n times/s and sends it to the display buffer. At the same time, the PID subroutine is called to calculate the difference between the test rotation speed and the set rotation speed. The control parameters are obtained and sent to the PWM controller to adjust the motor rotation speed from port P0. In the DDC system, the analog regulator was replaced by a computer. The implementation of the control law was accomplished by computer software. Therefore, the design of the digital controller in the system is the design of the computer algorithm in time. The author will focus on solving the PID algorithm and its implementation.

PID algorithm design ideas In the automatic control system, PID controller is a widely used control method. Since the motor speed is basically proportional to the armature applied voltage, this constitutes the basis for PID regulation. At sampling time * = ixT is the sampling period, i is a positive integer. The mathematical model for simulating the regulation of PID controller can be expressed by a differential equation: u(1) = Kp. Beijing: Beijing University of Aeronautics and Astronautics Press, 2002. Wang Jianxiao, Yang Jianguo. 51 series microcontroller and C51 program design. Beijing: Science Press, 2002. Pan Yijin, Shi Guojun. The Principle and Application of C8051Fxxx High Speed ​​SOC Microcontroller . Beijing: Beijing University of Aeronautics and Astronautics Press, 2002. Sun Chuanyou, Sun Xiaobin. Measurement and control system principle and design. Beijing: Beijing University of Aeronautics and Astronautics Press, 2002.

Solar LED Street Light

Solar LED Street Light has become an increasingly popular way of providing energy-efficient lighting for public spaces and roads. As the name suggests, solar street lamps are powered by solar panels that collect energy from the sun during the day, which is then stored in rechargeable batteries. This energy is then used to power LED lights, which can provide bright and long-lasting lighting for up to 12 hours without any additional power source. With the inclusion of various features such as motion sensors, solar induction street lights and more, these solar powered street lights have proven to be an effective solution for reducing energy consumption and carbon footprint. Let us dive deeper into the discussion and learn more about the benefits of this amazing technology.

solar street lamp,solar powered street lights, solar induction street lamp,solar street light with motion sensor

Ningbo Le Monde Lighting Co.,Ltd , https://www.nblemonde-lighting.com