1. Motor speed control module.
Our design idea is to first generate a square wave with adjustable duty cycle (there are many methods, one is to use 555 to form a multi-vibrator 2. You can use a microcontroller to generate a PWM square wave) + an H-bridge circuit composed of 4 power devices to drive the DC motor to rotate. Of course, there are many drive solutions, such as transistor-resistor as gate drive\simple gate of low-voltage drive circuit Drive, you can also directly use an MCU to generate PWM and add a MOS tube driver.
1.1 Design goals of DC motor drive circuit
In the design of DC motor drive circuit, Here are the main points to consider:
1. Function: Does the motor rotate in one direction or two directions? Do you need to adjust the speed? For one-way motor drive, just use a high-power triode or field effect tube or relay to directly drive the motor. When the motor needs to rotate in both directions, you can use an H-bridge circuit composed of four power components or use a double-pole double-pole circuit. Throwing relay. If speed regulation is not required, just use a relay; but if speed regulation is required, switching elements such as transistors and field effect transistors can be used to achieve PWM (pulse width modulation) speed regulation.
2. Performance: For the motor drive circuit with PWM speed regulation, the main performance indicators are as follows.
1) Output current and voltage range, which determines how powerful the motor can be driven by the circuit.
2) Efficiency. High efficiency not only means saving power, but also reducing the heat generated by the drive circuit. To improve the efficiency of the circuit, you can start by ensuring the switching working status of the power device and preventing static conduction (a problem that may occur in H-bridge or push-pull circuits, that is, two power devices are turned on at the same time to short-circuit the power supply).
3) Impact on the control input terminal. The power circuit should have good signal isolation at its input end to prevent high voltage and large current from entering the main control circuit. This can be achieved by using a high input impedance or a photocoupler to achieve isolation.
4) Impact on power supply. Non-state conduction can cause an instant drop in the power supply voltage, causing high-frequency power supply pollution; large currents may cause the ground potential to float.
5) Reliability. The motor drive circuit should be as safe as possible, no matter what kind of control signal or passive load is added.
Considering the above factors, we use a 555 multivibrator to generate a square wave with an adjustable duty cycle + an H-bridge composed of 4 power devices to drive the DC motor. The circuit diagram is as follows:
1.2. Circuit diagram functional analysis of the motor speed control module
555 can realize a square wave with an adjustable duty cycle through an adjustable resistor, that is, it forms a multivibrator with an adjustable duty cycle.
Functional analysis of multivibrator realizing square wave with adjustable duty cycle:
At the moment when the power is turned on, the initial voltage on capacitor C2 is 0, Schmitt trigger The output voltage U is 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 temporary steady state I state. After that, the circuit cycles through the following four stages over and over again, generating periodic output pulses.
(1) In the temporary steady state I stage, 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 the output is high potential.
(2) During the flip I phase, the capacitor C continues to charge. When Uc is higher than 2/3VCC, the timer flips to the '0' state and the output is low. At this time, the open collector output terminal (pin 7) changes from disconnected to ground to conductive.
(3) In the transient steady state II stage, capacitor C begins to experience R7 and R6 discharging to ground (pin 7), and Uc decreases exponentially. Before Uc is lower than 1/3VCC, the timer still maintains 0' status. The output is low.
(4) In the flip II phase, the capacitor C continues to discharge. When Uc is lower than 1/3VCC, the timer flips to the '1' state and the output is high. At this time, the open collector output terminal (pin 7) changes from conducting to ground to disconnecting to ground. After that, the oscillator returns to the transient steady-state I state.
(5) The duty cycle of the timer output square wave can be adjusted by adjusting the size of R6.
The Uln2003 chip is a 16-pin seven-way motor driver chip. This chip can be regarded as a seven-NOT gate chip here. Its function is to ensure that the output of SINGLE1 and SINGLE2 of pins 10 and 14 is high. One low. The diodes in the chip act as a current shunt. The function of the right part of the circuit diagram is to adjust the speed of the motor by adjusting the forward and reverse rotation of the motor. When SINGLE1 is high and SINGLE2 is low, the transistors Q2, Q3, and Q5 are turned on, and Q1, Q4, and Q6 are turned off, and the motor 1 terminal Through Q5 grounding, Vcc is directly pressed on the 2nd terminal of the motor through Q2. At this time, the potential of the 2nd terminal of the motor is higher than that of the 1 terminal, and the motor reverses; when SINGLE1 is low and SINGLE2 is high, the motor rotates forward.
When the duty cycle is greater than 50% at a certain moment, the motor is in a forward acceleration or reverse deceleration state; when the duty cycle is less than 50% at a certain moment, the motor is in a forward deceleration or reverse acceleration state. The motor adjusts the speed through the difference in the duty cycle of the rectangular wave. The speed displayed by the motor is the average speed.
2. Motor speed measurement module circuit and functional analysis
Our design idea is to use photoelectric isolation devices and BCD counters to implement the DC motor speed measurement module circuit. When the motor rotates, it drives the paper to block The optocoupler allows the infrared light emitted by the light-emitting diode to be received by the phototransistor, and finally the number of revolutions per unit time is displayed through the BCD counter.
The circuit diagram is as follows:
1.3. Analysis of the entire circuit and other functions of the motor speed measurement module
1.3.1 Chip function analysis
CD40192:
BCD addition/subtraction can be preset Counter (dual clock) NSC\TI///J1J2J3J4 is an input that can preset numbers, and Q1Q2Q3Q4 is an output for up and down counting. C0 is the UP (adding counter) with carry termination connected to the high bit. BO is the borrowed pin, which is not connected in the diagram and is an empty pin. ENABLE is the enable end. VSS is connected to ground, and VCC is connected to power. DOWN is a down counter.
CD4511 BCD latch, 7-segment decoding, driver:
//A, B, C, and D are respectively connected to the output terminals of the BCD up and down counter to latch the numbers. Then 7-segment decoding outputs it to the digital tube.
CD40106 six Schmitt trigger:
NSC\TI //The input signal is A, the output signal is the inverse of A, the input pulse is shaped and inverted, so that the high bit The counter's up count can count.
1.4. Accept the functional analysis of the entire circuit diagram of the board
When the optocoupler OPTOISO1 receives a light signal, the LED emits light, the transistor is saturated and turned on, and the transistor Q1 is turned on because of the resistance R3 is 47K, most of the voltage is divided on the resistor, and A is low level. If no light is received, A is a high-point flat, thus forming a negative pulse at the A terminal, and then the CD40106 six Schmitt trigger is used to shape and invert the pulse, and the non-positive pulse of A is obtained ( It means that it is low level when there is no light, and it is high level when there is light signal).
After six Schmitt triggers, the pulse signal is then connected to the UP end of CD40192 to make BCD counting device 1 an up counter. The two CD40192ENABLE enable terminals are connected to the enable signal together.
REST signal is also connected to VCC high level through button S1/grounded through R9 10K. In this way, just press S1 to achieve REST reset and clearing. If you don't press S1, it will count as usual.
The generation of the Enable enable signal: through the button S1 and the 555 chip and the corresponding RC circuit, a certain time delay is achieved, which means that once S1 is pressed, at the timing T (determined by the RC value ), the counter is counting, counting the constant pulses received by the photocoupler, and stopping when the timing time is up. In this way, the speed of the motor can be measured. The timing time is 0.5S~1.0S. < /p>
To drive CD40192 to work, we analyze the function of this timer with reference to Figure 2.
When powered on, pin 3 (OUT) outputs a high level,