Our design idea is to generate a square wave with adjustable duty ratio (there are many methods, one is to form a multivibrator with 555, and the other is to generate a PWM square wave with a single chip microcomputer) +4 power devices to drive the DC motor to rotate. Of course, there are many driving schemes, such as triode-resistor as gate drive \ simple gate drive of low-voltage driving circuit, and PWM can be directly generated by adding a MOS transistor drive to an MCU.
1.1design goal of DC motor drive circuit
In the design of DC motor drive circuit, we mainly consider the following points:
1. Function: Does the motor rotate unidirectionally or bidirectionally? Do you need to adjust the speed? For one-way motor drive, just use a high-power triode or field effect transistor or relay to directly drive the motor. When the motor needs to rotate in both directions, an H-bridge circuit composed of four power components or a double-pole double-throw relay can be used. If you don't need speed regulation, use a relay; However, if speed regulation is needed, switching elements such as triode and field effect transistor can be used to realize PWM (pulse width modulation) speed regulation.
2. Performance: For the motor drive circuit with PWM speed regulation, there are mainly the following performance indicators.
1) output current and voltage range determine how much power the circuit can drive the motor.
2) Efficiency. High efficiency not only means saving power supply, but also reduces the heating of the driving circuit. In order to improve the efficiency of the circuit, we can start with ensuring the switching state of power devices and preventing the conduction of * * *(H a possible problem in H-bridge or push-pull circuit, that is, two power devices are turned on at the same time to make the power supply short-circuited).
3) Influence on control input. The power supply circuit should have good signal isolation at the input end to prevent high voltage and large current from entering the main control circuit, which can be isolated by high input impedance or photoelectric coupler.
4) Impact on power supply. * * * state conduction will cause the power supply voltage to drop instantly, resulting in high-frequency power supply pollution; Large current may cause the ground potential to float.
5) Reliability. No matter what control signals and passive loads are added, the motor drive circuit should be as safe as possible.
Considering the above factors, we use a 555 multivibrator to generate a square wave with adjustable duty ratio, and use an H-bridge composed of four power devices to drive the DC motor. The circuit diagram is as follows:
1.2. Functional analysis of circuit diagram of motor speed regulation module
The 555 square wave with adjustable duty cycle can be realized by using adjustable resistor, that is, a multivibrator with adjustable duty cycle can be formed.
Function analysis of square wave with adjustable duty cycle realized by multivibrator;
At the moment when the power supply is turned on, the initial voltage on the capacitor C2 is 0, and the output voltage of the Schmidt trigger is U, which is a high level. At the same time, because the open collector output terminal (pin 7) is disconnected from the ground, the power supply starts to charge the capacitor C through R5 and R7, and the circuit enters the transient I state. After that, the circuit repeats the cycle in the following four stages to generate periodic output pulses.
(1) Transient I, VCC passes through R5. R7 charges the capacitor C, and the voltage Uc of the capacitor C rises exponentially. Before UC is higher than 2/3VCC, the timer temporarily maintains the state of'1'and outputs a high potential.
(2) In the flip I stage, the capacitor C continues to charge. When Uc is higher than 2/3 VDC, the timer flips to "0" and the output is low. At this time, the open collector output terminal (pin 7) changes from the disconnected state with the ground to the on state.
(3) In the second phase of the transient, the capacitor C begins to discharge to the ground through R7 and R6 (pin 7), and Uc decreases exponentially. Until Uc is lower than 1/3VCC, the timer remains in the state of' 0'. The output is low potential.
(4) In the inversion stage II, the capacitor C continues to discharge. When Uc is lower than 1/3VCC, the timer flips to "1" and the output is high. At this time, the open collector output terminal (pin 7) is connected to the ground and disconnected from the ground. Thereafter, the oscillator returns to the transient I state.
(5) The duty ratio of the timer output square wave can be adjusted by adjusting the size of R6.
Uln2003 chip is a 16 pin seven-channel motor driver chip, which can be regarded as a seven-gate chip here. Its function is to ensure that the outputs of 10 pin and 14 pin are 1 high, and the outputs of SINGLE 1 and SINGLE2 are 1 low. The diode in the chip plays the role of shunt. The right part of the circuit diagram is used to adjust the speed of the motor by adjusting the forward rotation and reverse rotation of the motor. When SINGLE 1 is at high level and SINGLE2 is at low level, transistors Q2, Q3 and Q5 are turned on, while Q6, Q4 and Q6 are turned off. The 1 terminal of the motor is grounded through Q5, and Vcc is directly placed at the 2 terminals of the motor through Q2. At this time, the potential at the 2 terminals of the motor is higher than 65438+. When SINGLE 1 is low level and SINGLE2 is high level, the motor rotates forward. When the duty ratio is greater than 50% at a certain moment, the motor is in a state of forward acceleration or reverse deceleration; When the duty ratio is less than 50% at a certain moment, the motor is in a state of forward deceleration or reverse acceleration. The speed of the motor is adjusted by the difference of the duty ratio of the rectangular wave, and the speed presented by the motor is the average speed.
2. Circuit and function analysis of motor speed measuring module.
Our design idea is to use photoelectric isolation device and BCD counter to realize DC motor speed measurement module circuit. When the motor rotates, it drives the paper to block the optocoupler, so that the infrared light emitted by its light-emitting diode is received by the phototransistor, and finally the BCD counter displays the number of revolutions per unit time.
The circuit diagram is as follows:
1.3, and functional analysis of the overall circuit of the motor speed measuring module.
1.3. 1 functional analysis of the chip
CD40 192:
The preset BCD up-down counter (double clock) NSC \ ti/NSC \ ti//j1j2j3j4 is the input of the preset number, and Q 1Q2Q3Q4 is the output of the up-down count. C0 goes up (up counter), and carry ends high. There is no connection BO on the borrowing diagram, which is an empty foot. ENABLE is an enable terminal. VSS is grounded and VCC is connected to the power supply. Down is the down counter.
CD45 1 1 BCD latch, 7-segment decoding, driver:
//A, B, C and D are respectively connected to the output end of BCD addition and subtraction counter to latch the numbers. Then it is decoded in seven sections and output to the digital tube.
CD40 106 six Schmidt trigger;
NSC\TI // The input signal is A, and the output signal is A inverse. The input pulse is shaped and inverted, so that the incremental count of the high counter can be counted.
1.4. Functional analysis of the overall circuit diagram of the receiving board.
Optocoupler light ISO 1, when receiving the optical signal, the LED emits light, the transistor is saturated and turned on, and the transistor Q 1 is turned on, because the resistor R3 is 47K, most of the voltage is divided on the resistor, and A is low level. If no light is received, A is at a high level, thus forming a negative pulse at the A terminal. Then, the pulse is shaped and inverted by CD40 106 six Schmidt trigger, and the non-positive pulse of A is obtained (meaning low level in the absence of light and high level in the presence of light signal).
The pulse signal passing through the six Schmidt trigger is then connected to the uplink terminal of CD40 192, so that BCD counter device 1 becomes an uplink counter. The other two CD 40 192 enable terminals are connected to the enable signal.
Other signals are also connected to VCC high level through the key s 1/ and grounded through R9 10K. So just press S 1 to reset REST to zero. If you don't press S 1, count as usual.
Generation of enable signal: A certain time delay is realized by pressing the buttons S 1 and 555 chip and the corresponding RC circuit, that is to say, once S 1 is pressed, the counter counts within the time of timing t (determined by RC value), and counts the constant pulse received by the photoelectric coupler, and stops counting after the timing time. In this way, the speed of the motor can be measured. Timing time.
Drive CD40 192 to work. Let's analyze the function of this timer with reference to Figure 2. When it is powered on, the 3 (OUT) pin outputs a high level,