Dec 18, 2018 Leave a message

Single-chip microcomputer pwm control motor, PWM motor speed control principle and 51 single-chip microcomputer PWM program classic

Single-chip microcomputer pwm control motor, PWM motor speed control principle and 51 single-chip microcomputer PWM program classic

For the motor speed adjustment, we use pulse width modulation (PWM) method. When controlling the motor, the power supply does not continuously supply power to the motor, but provides power in the form of square wave pulses at a specific frequency. Square wave signals with different duty cycles can regulate the motor. This is because the motor is actually a large inductor, which has the ability to block the input current and voltage abrupt change, so the pulse input signal is evenly distributed to the action time. In this way, changing the duty ratio of the input square wave on the initial energy terminals PE2 and PD5 can change the magnitude of the voltage applied across the motor, thereby changing the rotational speed.

In this circuit, a microprocessor is used to implement pulse width modulation. There are two common methods:

(1) Realized by software, that is, by executing a software delay loop program to alternately change the logic state of a certain bit of the port to generate a pulse width modulation signal, and setting different delay times to obtain different duty ratios.

(2) The hardware experiment automatically generates the PWM signal, which does not occupy the CPU processing time. This requires the counter 1 of the ATMEGA8515L in PWM mode. For details, please refer to related books.

51 single chip PWM program classic

Generate two PWMs, requiring two PWM waveforms to be occupied by 80/256. The two waveforms should be staggered and cannot be high at the same time! The difference between the high level is 48/256. The PWM function is available on the PIC microcontroller, but if you want to use the 51 MCU, it is ok, but it is more troublesome.

Timer T0 can be used to control the frequency, timer T1 to control the duty cycle: The general programming idea is this: T0 timer interrupt is to let an I0 port output high level, start in the interrupt of this timer T0 Timer T1, and this T1 is to let the IO port output low level, so that changing the initial value of the timer T0 can change the frequency, and changing the initial value of the timer T1 can change the duty cycle.


Send Inquiry

whatsapp

teams

E-mail

Inquiry