DC motor measurement and control system based on single chip PID algorithm


With the rapid development of electronic technology, DC motor measurement and control has gradually changed from analog to digital. The DC motor measurement and control system realized by the hardware circuit has complicated circuit, difficult adjustment and low reliability, and lacks control flexibility. In industrial control, PID regulators controlled by the ratio of deviation P, integral I and differential D are now widely used. Prior to the use of small microcomputers in the production process, pneumatic, hydraulic and electric PID regulators used in continuous process systems were almost monopolized. It can be proved by the optimal control theory that it can adapt to the control requirements of many industrial objects. The development of single-chip microcomputer control technology, especially the use of software PID algorithm controller, has replaced many of the original hardware PID regulators, and has been widely used in industrial control systems and embedded systems. The DC motor measurement and control technology based on software PID algorithm controller and hardware PWM technology is developing in digital, intelligent and high reliability.
1 system hardware composition DC motor measurement and control system as shown. The system is a closed-loop real-time measurement and control system composed of Cygnal C8051F020. It is a code that can realize speed preset and speed display, and can accurately measure and control the speed.
The sampling pulse generated by the Hall speed measuring circuit is sent to an external interrupt, and is counted by a counter to calculate the rotational speed. This speed value is compared with the preset speed value to obtain the difference. C8051 obtains the control increment by performing PID operation on the difference, and then the control parameter is output by C8051. The PWM circuit changes the effective voltage across the motor, and finally achieves the purpose of controlling the speed.
The schematic diagram of the DC motor measurement and control system keyboard and display circuit uses the 7279 control circuit of the serial interface.
Enter the control command on the function keyboard and the motor speed is displayed on the seven-segment display.
The direction of the PWM controller is computer measurement and control technology.
The p%Ms controller consists of a pwM wave open generator and a pwm delay protection t and a power amplifier circuit. The speed measurement part of the system uses the timer T0. If the PWM waveform is generated by the C8051, the software will increase the task of the software, thus affecting the real-time control effect of the entire system. Therefore, the PWM waveform is generated by an external circuit, and the C8051 only provides control parameters to change the pulse width duty cycle to achieve frequency conversion regulation of the motor speed. The PWM waveform generator is as shown.
The speed and frequency can be calculated from the period and frequency of the output pulse. In order to improve the accuracy of the motor speed measurement, multiple magnets can be evenly fixed on the motor turntable. Each time the motor rotates, the Hall sensor will generate multiple pulses, and the motor speed can be accurately measured by software calculation.
Since the pulse peak of the Hall sensor output is small and the edge of the waveform is incomplete, the Schmitt trigger circuit is used to pulse and output to the C8051 external interrupt INTO. The Schmitt trigger input and output waveforms are as shown.
u. In the PWM waveform generator, U1 is a 10-bit counter, and the clock input terminal CP of the counter is connected to the XTAL2 terminal of the C8051 crystal oscillator. The crystal frequency of the main frequency used in this system is 12MHz, and the frequency division of the PWM waveform is obtained after dividing by U1. U2's person>Bout terminates a zero-crossing comparator whose output is a PWM wave. The pulse width of the PWM wave can be changed by outputting the value from the P0 port.
The PWM wave output load capacity is too small to directly drive the motor, so we used a bipolar pulse width modulation power amplifier. It is necessary to consider that it takes a certain time for the high-power transistor to conduct from saturation to saturation, and prevent all the power amplifier tubes from being turned on at the same time. Therefore, a logic delay and a chain protection circuit are realized by using several gate circuits. At the same time, in order to make the motor work safely, the resistor and capacitor are connected at both ends of the motor. The resistance value and the capacitance are related to the motor parameters and the PWM waveform frequency, which can be calculated.
The L2 Hall detection circuit speed is a commonly used parameter in engineering. There are many methods for measuring the speed. The application of the Hall switch sensor is one of them. The Hall switch sensor is made of a semiconductor material whose output voltage is proportional to the magnitude of the external magnetic field. Due to its small size, no contact, good dynamic performance and long service life, it is widely used in measuring the rotational speed of rotating objects. This system uses the 3000 series Hall switch sensor produced by SPRAGUE Company of the United States.
According to the Hall effect principle, a permanent magnet is fixed on the edge of the rotating shaft of the motor shaft, and the magnetic steel rotates with the motor. A Hall switch sensor is installed in the vicinity of the motor relative to the rotating shaft. The Hall sensor should be in the effective range of the magnetic field of the magnetic steel. Inside. When the motor rotates, it is affected by the magnetic field generated by the magnetic steel. The Huo 2 system software design software design is based on the Cygnal IDE integrated development environment and the KeilC51 language. The main modules of this system include main program, INT0 interrupt subroutine, T0 interrupt subroutine, PID algorithm subroutine and display keyboard processing subroutine. After the main program performs a series of initializations, it transfers to the "PWM drive, keyboard control processing, and display" loop waiting interrupt; the external interrupt INT0 interrupt service subroutine counts the speed pulse outputted by the Hall circuit; T0 generates 50ms timer interrupt, T0 interrupt The service subroutine counts the number of interruptions, reads the speed pulse count value every 20 interruptions (1 second), calculates the rotation speed n times / s and sends the display buffer. At the same time, the PID subroutine is called to calculate the difference between the test speed and the set speed, and the control parameters are obtained, and sent to the PWM controller by the P0 port to adjust the motor speed. In the DDC system, the analog regulator is replaced by a computer, and the implementation of the control law is done 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 idea In the automatic control system, PID controller is a widely used control method. Since the motor speed is basically proportional to the magnitude of the applied voltage of the armature, this forms the basis of PID regulation. At the sampling time *=ixT is the sampling period, i is a positive integer), the mathematical model of the analog PID controller adjustment law can be expressed by differential equation: u(1)=Kp. Beijing: Beijing University of Aeronautics and Astronautics Press, 2002. Wang Jianxiao, Yang Jianguo. 51 series MCU and C51 program design. Beijing: Science Press, 2002. Pan Yijin, Shi Guojun. Principle and application of C8051Fxxx high speed SOC microcontroller. Beijing: Beijing University of Aeronautics and Astronautics Press, 2002. Sun Chuanyou, Sun Xiaobin. Principle and design of measurement and control system. Beijing: Beijing Aerospace University Press, 2002.

6 Seaters Off Road Golf Carts

our 6 seaters off road golf carts can be with 10,12 or 14inch off road tyre, we can do your required customs for it as you want, we make several models for it for the front part of it for your choice,you can ask for a rear basket for your stuffs that it is very practical for rutine usage, the size of rear basket is adjustable as your requirement,we can also mount the usb music player(combinated with Bluetooth,mega phone, FM radio) to advance your driving experience,we have gas and battery power for you choice,people prefer it with the gas power that enable a much bigger power for rough and mountain road,also as it is with a big off road tyre that intend for rough road.

6 Seaters Off Road Golf Carts,Environmental-Friendly Off Road Golf Carts,6 Seaters Electric Off Road Golf Carts,Off Road Golf Carts

Yongkang Jinghang Sightseeing Vehicle Co., Ltd. , https://www.jhgolfcarts.com