The content of the invention
For prior art the problem of, the invention provides a kind of its communications and control circuit, provide the user with more
Multi-functional experience.
To solve the above problems, technical scheme provided by the invention is:
A kind of its communications and control circuit, including its communications circuit, power circuit, circuit for controlling motor, motor side
To control circuit and MCU, the MCU respectively at its communications circuit, the power circuit, the circuit for controlling motor and
The motor drive direction control circuit is connected, and the circuit for controlling motor is connected with the motor drive direction control circuit, the MCU's
Model PIC16F886.
Optionally, the circuit for controlling motor includes:Motor drive circuit and pwm signal control circuit, the motor drive
Dynamic circuit, the motor drive circuit are used for the work according to pwm signal controlled motor;The pwm signal control circuit includes:
Charging capacitor C43, charging capacitor C44, triode Q15, triode Q16, resistance R86, diode D14, diode D15;
The pwm signal is connected with the positive pole of the charging capacitor C43, and the negative pole of the charging capacitor C43 is respectively at institute
State triode Q15 base stage, the negative electrode of the diode D14 is connected, the anode of the diode D14 and the triode Q15
Emitter stage be connected, the colelctor electrode of the triode Q15 positive pole with the charging capacitor C44, the one of the resistance R86 respectively
End and the diode D15 anode are connected, and the other end of the resistance R86 is connected with operating voltage Vcc, the charging electricity
Hold C44 minus earth, the negative electrode of the diode D15 is connected with the base stage of the triode Q16, the triode Q16's
Grounded emitter, the colelctor electrode of the triode Q16 are connected with one end of resistance R15 one end and resistance R14 and accessed described
Motor drive circuit, the other end of the resistance R15 are connected with the pwm signal, the other end ground connection of the resistance R14.
Optionally, circuit for controlling motor according to claim 1, it is characterised in that motor drive circuit includes:Than
Positive input compared with device U1B is connected with one end of the resistance R14, and the reverse input end of the comparator U1B passes through resistance
R34 is connected with operating voltage, and the output end of the comparator U1B is connected with triode Q1 base stage, triode Q3 base stage, institute
State triode Q1 emitter ground connection, the colelctor electrode of the triode Q1 is connected with triode Q2 colelctor electrode, and three pole
Pipe Q2 base stage is connected with the emitter stage of the triode Q3, the colelctor electrode of the triode Q3 and electrochemical capacitor C5 positive pole
It is connected and resistance R4 one end is connected, solution electric capacity C5 negative pole ground connection, the other end ground connection of the resistance R4.
Optionally, the model of the comparator U1B:LM239, the triode Q3 model:It is MMBT4401, described
Triode Q2 model:MPS651.
Optionally, the motor drive direction control circuit includes:Motor drive direction control signal and Schottky diode D1 the moon
Pole connects, and the anode of the Schottky diode D1 is connected with comparator U1A positive input, and the comparator U1A
Reverse input end is connected with operating voltage, the output end of the comparator U1A by resistance R11 one end, resistance R10 one
End, Schottky diode D2 anode are connected, and the other end of the resistance R11 is connected with motor reverse control signal, Xiao
Special based diode D2 negative electrode is connected with operating voltage;
The output end of the comparator U1A is connected by resistance R17 with amplifier U3 reverse input end, the amplifier
U3 positive input is connected with operating voltage by resistance R27 and is grounded by resistance R20, the output of the amplifier U3
End is connected by resistance R18 with the reverse input end, and the output end of the amplifier U3 is connected with the MCU.
Optionally, the motor reverse control signal and the resistance R11, the resistance R10, resistance R22 one end phase
Even, the other end of the resistance R22 is connected with the MCU;Electric capacity C16, resistance of the other end of the resistance R22 by parallel connection
R29 is connected with the MCU, and the negative electrode of the Schottky diode D1 is connected with circuit for controlling motor.
Optionally, its communications circuit includes:Data receiver circuit includes:The earth terminal of RS232 interface respectively with
Charging capacitor C45 another input connection of negative pole, optocoupler U6, the first line of S232 interfaces and diode D19 anode, two
Pole pipe D18 anode is connected, and the negative electrode of the diode D18 is connected by resistance R88 with the input of the optocoupler U6, described
Diode D19 negative electrode is connected with the positive pole of the charging capacitor C45, diode D17 negative electrode, the sun of the diode D17
Pole is connected with the second circuit of RS232 interface, and the output end of the optocoupler U6 accesses triode Q8 base stage by resistance R76,
And data are sent by the colelctor electrode of the triode Q8.
Optionally, bag data transtation mission circuit is gone back, including:Tertiary circuit is connected with triode Q18 emitter stage, three pole
Pipe Q18 colelctor electrode is connected by resistance R5 with the base stage of the triode Q18, and in the base stage and hair of the triode Q18
Parallel diode D20 and the diode D20 anode and the triode Q18 base stage between emitter-base bandgap grading, optocoupler U5 it is another
Output end is connected, and the output end of the optocoupler U5 is connected with the anode of the charging capacitor C45, the moon of the charging capacitor C45
Pole is connected with charging capacitor C7 anode, and the negative electrode of the charging capacitor C7 is connected with the colelctor electrode of the triode Q18, described
Optocoupler U5 input is connected by resistance R89 with operating voltage, and another input for stating optocoupler U5 is carried out by triode Q13
The reception of data.
Optionally, in addition to diode D21, the colelctor electrode phase of the anode of the diode D21 and the triode Q18
Even, the negative electrode of the diode D21 is connected with the anode of the diode D19, and the colelctor electrode of the triode Q8 passes through resistance
R45 is connected with operating voltage, and the base stage of the triode Q8 is grounded by resistance R72, and connects resistance in optocoupler U6 output ends
R90 one end, electric capacity C39 one end, the other end of the resistance R90 are connected with operating voltage, the other end of the electric capacity C39
Ground connection, the colelctor electrode of the triode Q13 are connected with resistance R44 one end, resistance R36 one end, and the resistance R44's is another
End is connected with operating voltage, the other end ground connection of the resistance R36, wherein, the model of the triode Q13:MUN5233.
Optionally, the power circuit includes:Emitter stage, charging electricity of the input voltage by resistance R57 and switching tube Q6
The negative electrode for holding C43 and switching diode D15 is connected, and the colelctor electrode of the switching tube Q6 is connected with operating voltage, the charging
Electric capacity C43 other end ground connection, the base stage and controllable accurate of the negative electrode of the switching diode D15 and the switching tube Q6
Source of stable pressure U6 A ends and triode Q11 colelctor electrode are connected, and the K ends ground connection of the controllable accurate source of stable pressure U6, R ends pass through
Resistance R70 is grounded;The emitter stage of the triode Q11 passes through resistance R16 and electric capacity C31 one end, resistance R65 one end phase
Even, the other end ground connection of the electric capacity C31, the base stage and resistance of the other end of the resistance R65 and the triode Q11
R71 one end is connected, and the other end of the resistance R71 is connected with triode Q12 colelctor electrode, described base stage by respectively with
Resistance R69 diodes D13 and switching tube Q17 connect, and are set by the base stage and resistance R66 accesses of the switching tube Q17
It is standby, and the negative electrode of the diode D13 is connected with one end of the resistance R69, resistance R60 one end, the resistance R60's
The other end is connected with the operating voltage, and the anode of the diode D13 is connected by resistance R61 with the MCU.
Embodiment
To further appreciate that present disclosure, with reference to drawings and Examples, the present invention is described in detail.
Referring to Fig. 1, Fig. 1 is the circuit diagram of its communications provided in an embodiment of the present invention and control circuit, as shown in figure 1,
For its communications and the compositional block diagram of control circuit, the MCU respectively at its communications circuit, the power circuit,
The circuit for controlling motor is connected with the motor drive direction control circuit, and the circuit for controlling motor controls with the motor drive direction
Circuit is connected, the model PIC16F886 of the MCU.
Referring to Fig. 2, for the circuit diagram of motor control, when motor driving mouth has the output of PWM wave modes, capacitor C43 is two
Electricity is being rushed in the presence of pole pipe D14 always and under making triode Q15 base stage in the conduction state for high level, Q16 base stages
Cut-off state is in for low level, so that shadow noon U1B the 5th pin signal input, motor device are not in normal work.When
MCU damage or motor driving mouth be under abnormal state, as motor driving mouth be high level always, now capacitor C43 by
Then the effect of blocking circulation exchange, capacitor C43, C44 make Q15 base stages be under low level state due to that can not rush electricity,
It is in so as to Q15 emitter stage with colelctor electrode under cut-off state, Q16 base stages make Q16 emitter stage and colelctor electrode for high level
Conducting, so that U1B the 5th pin is in low level state, has cut off the input of signal, has protected motor and equipment.
Optionally, motor drive circuit includes:Comparator U1B positive input is connected with resistance R14 one end, compares
Device U1B reverse input end is connected by resistance R34 with operating voltage, comparator U1B output end and triode Q1 base stage,
Triode Q3 base stage is connected, triode Q1 emitter ground connection, triode Q1 colelctor electrode and triode Q2 colelctor electrode phase
Even, and triode Q2 base stage is connected with triode Q3 emitter stage, and triode Q3 colelctor electrode and electrochemical capacitor C5 are just
Extremely it is connected and resistance R4 one end is connected, solution electric capacity C5 negative pole ground connection, resistance R4 other end ground connection.
In the present invention, pwm signal is sent from MCU, and under normal circumstances, pwm signal passes through resistance R15 and resistance
Comparator U1B positive input is input in the presence of R14, and is compared in reverse input end after resistance R34 partial pressure
Compared with output, output result input after electric capacity C12 more than resistance R1 carries out RC aluminium foils to triode Q1 base stage, is according to Q1
Cut-off or conducting state so as to input a signal into the more J1 of motor control, in addition Q base stage and emitter stage it
Between triode Q3 in parallel, triode Q1 end in the case of coupled to triode Q2 base stage and by colelctor electrode export, electricity
The emitter that resistance R4 and resistance R5 is respectively triode Q2 provides 15V voltages, and charging capacitor C5 is charged to change triode
Q3 collector voltage.Comparator U1B model:LM239, triode Q3 model:MMBT4401, triode Q2 type
Number it is:MPS651.
Referring to Fig. 3, in of the invention, motor drive direction control signal is connected with Schottky diode D1 negative electrode, Schottky two
Pole pipe D1 anode is connected with comparator U1A positive input, and comparator U1A reverse input end and operating voltage phase
Even, comparator U1A output end is connected by resistance R11 one end, resistance R10 one end, Schottky diode D2 anode,
The resistance R11 other end is connected with motor reverse control signal, and Schottky diode D2 negative electrode is connected with operating voltage;
Comparator U1A output end is connected by resistance R17 with amplifier U3 reverse input end, amplifier U3 forward direction
Input is connected with operating voltage by resistance R27 and is grounded by resistance R20, and amplifier U3 output end passes through resistance R18
It is connected with reverse input end, amplifier U3 output end is connected with MCU.By compare amplification after motor drive direction signal DR send to
MCU processing.
In addition, motor reverse control signal is connected with resistance R11, resistance R10, resistance R22 one end, resistance R22's is another
One end is connected with MCU.The current direction signal that present motor can be combined is judged, it is ensured that the standard in MCU controlled motors direction
True property.The resistance R22 other end is connected by electric capacity C16, the resistance R29 of parallel connection with MCU.Using the present invention, by motor side
Pass through the identification of comparator to control signal, will be than sending to MCU, and relatively result is again passed by into amplifier and is amplified processing
Signal error that is same to send to MCU the identification for carrying out signal, avoiding MCU from receiving, motor can be improved by comparison twice
The accuracy of direction controlling, is avoided due to weak output signal and maloperation caused by when signal noise is larger.
Other, Schottky diode D1 negative electrode is connected with circuit for controlling motor, motor drive circuit and pwm signal control
Circuit processed, motor drive circuit, motor drive circuit are used for the work according to pwm signal controlled motor;Pwm signal control circuit
Including:Charging capacitor C43, charging capacitor C44, triode Q15, triode Q16, resistance R86, diode D14, diode D15;
Pwm signal is connected with charging capacitor C43 positive pole, base stage respectively at triode Q15 of charging capacitor C43 negative pole, diode
D14 negative electrode is connected, and diode D14 anode is connected with triode Q15 emitter stage, triode Q15 colelctor electrode respectively with
The anode of charging capacitor C44 positive pole, resistance R86 one end and diode D15 is connected, the resistance R86 other end and work
Voltage vcc is connected, charging capacitor C44 minus earth, and diode D15 negative electrode is connected with triode Q16 base stage, triode
Q16 grounded emitter, triode Q16 colelctor electrode are connected with one end of resistance R15 one end and resistance R14 and access horse
Up to drive circuit, the resistance R15 other end is connected with pwm signal, resistance R14 other end ground connection.
In the present invention, when MCU has been at reset state, motor driving mouth is possible to have been at high level state,
Make motor be in the driving of maximum current to work, motor and equipment are caused to damage.When motor driving mouth hinders damage for some reason,
When motor driving mouth is possible to breakdown meeting and power supply short circuit, motor and equipment can be caused to damage.In these cases, it is ensured that
Motor driving mouth does not have any signal output, so as to protect motor and equipment to be not damaged by.
Referring to Fig. 4, Fig. 1 is the circuit diagram of the data transmission circuit provided in an embodiment of the present invention based on RS232, including is wrapped
Including data receiver circuit includes:The earth terminal of the RS232 interface negative pole with charging capacitor C45, another inputs of optocoupler U6 respectively
Connection, the first line of S232 interfaces are connected with diode D19 anode, diode D18 anode, diode D18 negative electrode
It is connected by resistance R88 with optocoupler U6 input, diode D19 negative electrode and charging capacitor C45 positive pole, diode D17
Negative electrode be connected, diode D17 anode is connected with the second circuit of RS232 interface, and optocoupler U6 output end passes through resistance R76
Triode Q8 base stage is accessed, and data are sent by triode Q8 colelctor electrode.
In the present invention, first line, earth terminal, the second circuit and tertiary circuit are respectively 3,5,4 and the 2 of RS232 interface
Pin position, external equipment RS232 communication interfaces, optocoupler U6 input is input to by diode D18, resistance R88, optocoupler U6's
Another input is ground connection input, is connected and is grounded respectively at charging capacitor C45 negative electrode.And pass through optocoupler U6 output end
It is connected with triode Q8 by resistance R76, and is exported by triode Q8 colelctor electrode, resistance R76 both ends passes through electricity respectively
Hold C39, resistance R72 ground connection, and triode Q8 colelctor electrode is connected by resistance R45 with operating voltage.
Keep apart the electric effect mutual with high-altitude operation vehicle using optocoupler U6, when external equipment needs to send information
During to system, because the transmission data wire of external equipment can send certain time width according to the communication baud rate of setting
Low and high level is to represent data 0 or 1, and when the data of transmission are 1, RS232 transmission signal wire can export high level, and send
Data when being 0, RS232 transmission signal wire can export low level, and using this characteristic, the height that sends out RS232, low level is led to
Diode and current-limiting resistance are crossed, is connected on the infrared emission pin of optocoupler, realizes the transmission of data.
In addition, working as MCU needs to send information to RS232 ends (being reception for RS232 ends), also bag data transtation mission circuit,
Including:Tertiary circuit is connected with triode Q18 emitter stage, and triode Q18 colelctor electrode passes through resistance R5's and triode Q18
Base stage is connected, and parallel diode D20 and diode D20 anode and three poles between triode Q18 base stage and emitter stage
Pipe Q18 base stage, optocoupler U5 another output end are connected, and optocoupler U5 output end is connected with charging capacitor C45 anode, charging
Electric capacity C45 negative electrode is connected with charging capacitor C7 anode, and charging capacitor C7 negative electrode is connected with triode Q18 colelctor electrode,
Optocoupler U5 input is connected by resistance R89 with operating voltage, and another input for stating optocoupler U5 is carried out by triode Q13
Data RX reception.Similarly, when TX is the data for needing to send, coupling is carried out by colelctor electrodes of the resistance R52 through triode Q13
Close and send, triode Q13 colelctor electrode carries out RC filtering by electric capacity C36, resistance R44, and one sent to optocoupler U5 is defeated
Enter end, optocoupler U5 another input after optocoupler U5 coupling outputs, passes through diode by resistance R89 cut-in operation voltages
D20 is sent to triode Q18 base stage, and is sent to RS232 pin 2.
Therefore compare the on-off circuit that the transmission of RX signals is formed using diode and triode, receives the red of optocoupler end
External signal 0, or 1.
Preferably, in addition to diode D21, diode D21 anode is connected with triode Q18 colelctor electrode, diode
D21 negative electrode is connected with diode D19 anode.The balance of RS232 interface voltage is maintained using diode D21, i.e. charging electricity
Hold the voltage difference between C7 and charging capacitor C45.
In the present invention, triode Q8 colelctor electrode is connected by resistance R45 with operating voltage, and triode Q8 base stage is led to
Resistance R72 ground connection is crossed, and in optocoupler U6 output ends connection resistance R90 one end, electric capacity C39 one end, the resistance R90 other end
It is connected with operating voltage, electric capacity C39 other end ground connection.Rx signals are carried out to MCU by coupling output by triode Q8, improved
The multiplication factor of signal output, more stable signal is obtained.
In addition, triode Q13 colelctor electrode is connected with resistance R44 one end, resistance R36 one end, resistance R44's is another
End is connected with operating voltage, resistance R36 other end ground connection, wherein, triode Q13 model:MUN5233.Further carry
High Tx signals are sent to the stability of RS232 interface.
Referring to Fig. 5, the input of the equipment of exemplary outside for 1VC, opened by being formed by resistance R57 to switching tube Q6
Powered-down road, the change additionally, due to D15 and switching tube Q6 are charged to charging capacitor C33, are carried out so as to carry out Q6 switch
Control.In addition, switching tube Q6 base stage can obtain the voltage of an output by controllable voltage-stabilized power supply U6 later, and thus make
For triode Q11 colelctor electrode, in the case where triode Q11 is got through, 1VC voltages are transferred to triode Q11 base stage, may be used also
To be transmitted after diode D12 and RC wave filter (resistance R65 and electric capacity C42) to triode Q12 colelctor electrode, triode
Diode D14 one end is 1VC voltage in the case that Q12 is turned on.Therefore, external equipment KSI signals are defeated by interface end P3
Entering to switching tube Q17 base stages, Q17 and now make an on-off action, Q17 C, the conducting of E poles is logical, and D14 cathode voltages are 1VC, if
It is standby in running order;External equipment KSI signals can be between 12V to 72V, and Q17 C, E poles can all turn on, and equipment is normal
Work.The wide scope input of external signal is thus can reach, the flexible configuration for being adapted to different external equipments uses.
The present invention can utilize Darlington transistor BDW93CFP to make the signaling switch pipe effect of equipment first, make really to believe
Number;Darlington transistor BDW93CFP is opened by external input device, closes the on and off that signal is realized in control, external equipment
The control signal of input is because only controlling Darlington transistor BDW93CFP base stage, it is thus possible to reaches very wide input range.
The present invention has newly increased more reliable and safe one Darlington transistor BDW93CFP of protection according to the application of reality, can
The parameter of system is influenceed with isolating external signal, external parameter only makees the signal input of a gate valve value.
In addition, the signal of outside equipment input can have a very wide parameter, it is not necessary to be confined to need corresponding this be
The 1VC signals of system.
Schematically the present invention and embodiments thereof are described above, this describes no restricted, institute in accompanying drawing
What is shown is also one of embodiments of the present invention, and actual structure is not limited thereto.So if common skill of this area
Art personnel are enlightened by it, without departing from the spirit of the invention, without designing and the technical scheme for creativeness
Similar frame mode and embodiment, protection scope of the present invention all should be belonged to.