A kind of speed measuring device of surveyed rotating speed of model of mind car
Technical field
The utility model relates to the model of mind car test and surveys the field, is specifically related to a kind of speed measuring device of model of mind car.
Background technology
Intelligent automobile contest organizing committee is defined as the car mould with the 7th electromagnetism group match and walks upright.The car mould walks upright and competes is the traveling mode that the double-wheel self-balancing electric motor car is copied in requirement, allows the car mould walk upright with two rear wheel drives.In recent years, the double-wheel self-balancing electric motor car has obtained very big development with characteristics such as its walking are flexible, convenient, energy-conservation.The research of a lot of this respects is arranged both at home and abroad, corresponding product is also arranged.In the match of electromagnetism group, the characteristics of having utilized the model car double rear wheel to drive realize the double-wheel self-balancing walking.With respect to the car mould competition model of traditional four-wheel walking, the car mould walks upright and has higher requirement at aspects such as hardware design, control software development and field adjustables.
For the upright car mould of stable control, accurate Detection ﹠ Controling to intelligent vehicle speed just seem of crucial importance, and the speed detection is the basis of speed control, and upright car mould has the possibility of operation forward or backward at any time, judges that accurately the direction of motion of car mould becomes to attach most importance to.
Intelligent vehicle realizes that the pattern that tests the speed all is to utilize the inner integrated external interrupt port of single-chip microcomputer to carry out timer counter to realize testing the speed.Utilize external interrupt to test the speed, at a high speed, can interrupt the operation of single-chip microcomputer principal function frequently, the time resource of the single-chip microcomputer of waste.Intelligent vehicle judges that motor positive and inverse (car mould forward-reverse) is to give motor-driven pwm signal size by judging.Yet sometimes give the motor-driven reverse signal, motor reality but is just to change in deceleration, and this erroneous judgement that will be easy to generate velocity reversal is disconnected.
Summary of the invention
At the deficiency that prior art exists, the purpose of this utility model is, a kind of speed measuring device of surveyed rotating speed of model of mind car is provided, and can accurately measure the rotating speed of a motor vehicle of model of mind car.
In order to realize above-mentioned task, the utility model adopts following technical scheme to be achieved:
A kind of speed measuring device of surveyed rotating speed of model of mind car, comprise code-disc, photoelectric tube sensor, Schmidt trigger, d type flip flop, counting chip and single-chip microcomputer, wherein, code-disc embeds in the groove of photoelectric tube sensor but does not contact with the photoelectric tube sensor, the photoelectric tube sensor links to each other with Schmidt trigger, Schmidt trigger links to each other with counting chip with d type flip flop respectively, the output terminal of counting chip links to each other with the input end of single-chip microcomputer, the output terminal of single-chip microcomputer links to each other with the input end of counting chip, forms a closed loop.
The utility model also has following technical characterstic:
Described photoelectric tube sensor adopts 1 pair of 2 photoelectric tube, and it is by a power valve and two transmission-type tachogenerators that receiver pope is formed.
Described code-disc adopts 100 line code dishes of Laser Processing.
Described Schmidt trigger adopts the 74HC14 Schmidt trigger.
It is the d type flip flop of 74LS74 that described d type flip flop adopts model.
Described counting chip adopts the CD4520 counting chip.
Described single-chip microcomputer adopts the XS128 single-chip microcomputer.
The utility model is judged the motor positive and inverse speed of a motor vehicle by the state that direct judgement motor rotates, and measures the rotating reliability height of motor, and is more accurate.The utility model is with low cost, and circuit is simple.The utility model utilizes the external counter counting, and it is more accurate to count; Save external interrupt, reduced the interruption amount, improved the efficient of single-chip microcomputer execution principal function.
Description of drawings
Fig. 1 is annexation synoptic diagram of the present utility model.
Fig. 2 is the installation site synoptic diagram of code-disc and photoelectric tube sensor.
Fig. 3 is the waveform synoptic diagram through the signal behind the Schmidt trigger.
Fig. 4 is the synoptic diagram of d type flip flop.
Below in conjunction with drawings and Examples particular content of the present utility model is done explanation in further detail.
Embodiment
Below provide specific embodiment of the utility model, need to prove that the utility model is not limited to following specific embodiment, all equivalents of doing on present techniques scheme basis all fall into protection domain of the present utility model.
Defer to technique scheme, as shown in Figure 1, a kind of speed measuring device of surveyed rotating speed of model of mind car, comprise code-disc, the photoelectric tube sensor, Schmidt trigger, d type flip flop, counting chip and single-chip microcomputer, wherein, code-disc embeds in the groove of photoelectric tube sensor but does not contact with the photoelectric tube sensor, the photoelectric tube sensor links to each other with Schmidt trigger, Schmidt trigger links to each other with counting chip with d type flip flop respectively, the output terminal of counting chip links to each other with the input end of single-chip microcomputer, the output terminal of single-chip microcomputer links to each other with the input end of counting chip, forms a closed loop.
Described code-disc adopts 100 line code dishes of Laser Processing; Described photoelectric tube sensor adopts 1 pair of 2 photoelectric tube, it is by a power valve and two transmission-type tachogenerators that receiver pope is formed, operating voltage is 5V, as shown in Figure 2, be installed in code-disc and grooved photoelectric sensor on the motor shaft of model of mind car, code-disc embeds in the groove of photoelectric tube sensor but does not contact with the photoelectric tube sensor, code-disc is along with the motor shaft rotation of model of mind car, the photoelectric tube sensor produces signal, signal a and signal b are arranged on the output pin, output signal is similar sine wave in the time of high speed, but the phase differential of waveform is 90 degree.
Described Schmidt trigger adopts the 74HC14 Schmidt trigger.As shown in Figure 3, be through the output signal behind the Schmidt trigger 74HC14, output signal has become the square wave of standard, and the phase of output signal difference of square wave also is 90 degree.
It is the d type flip flop of 74LS74 that described d type flip flop adopts model.As described in Figure 4, the output signal A after the shaping delivers to the D port of d type flip flop 74LS74, and the output signal B after the shaping delivers to the CLK port of d type flip flop.If when motor was just changeing, the output terminal Q of d type flip flop was low level; Then when the output terminal Q of d type flip flop was high level, motor was counter-rotating.The IO mouth that is sent to single-chip microcomputer by the sense of rotation signal with the output terminal Q of d type flip flop just can be judged the rotating of output signal.
Described counting chip adopts the CD4520 counting chip; Described single-chip microcomputer adopts the XS128 single-chip microcomputer.Output signal A(after the shaping or B) be sent to the CLKA end of counting chip CD4520, single-chip microcomputer is with common IO mouth (using the port A of XS128 here) reading the chip counter value periodically, read after the count value at once by output port (using the PORTB0 of the port B of XS128 here) counter O reset, just can carry out the counting work of next time period.The count value that reads is proportional to rotating speed of motor, and motor couples together by reduction gearing and model of mind wheel, does not have differential, so the speed of model of mind wheel also is proportional to the count value that reads.Therefore, the count value that reads is exactly the speed of model of mind wheel.
Embodiment 1: wheel just changes
When wheel just changeed, as Fig. 2, the code-disc that is connected on the motor output shaft turned clockwise; Produce the output signal of certain frequency on the photoelectric tube sensor output pin, anticipating signal b 90 degree on the output signal a phase place, output waveform contains the undesired signal irregularity that becomes, the similar sine wave of waveform in the time of at a high speed; The two-way output signal is sent into the square wave that the shaping of 74HC14 Schmidt trigger becomes standard, anticipating signal B90 degree still on the signal A phase place after the shaping; Signal A and signal B after the two-way shaping give the 74LS74D trigger as shown in Figure 4, and at this time the sense of rotation signal of d type flip flop output is high level.Single-chip microcomputer reads the sense of rotation signal by common input port, and judging wheel is just to change.
The CLKA end that output signal A after the shaping simultaneously is sent to counting chip CD4520 carries out step-by-step counting; Single-chip microcomputer periodically reads and zero clearing the count value of counting chip with common input port, because the speed of model of mind wheel is proportional to the count value that reads.Therefore, the count value that reads can be used as the velocity magnitude of model of mind wheel.
Embodiment 2: wheel reversing
In the time of wheel reversing, as Fig. 2, the code-disc that is connected on the motor output shaft is rotated counterclockwise; Produce the output signal of certain frequency on the photoelectric tube sensor output pin, anticipating signal a90 degree on the output signal b phase place, output waveform contains the undesired signal irregularity that becomes, the similar sine wave of waveform in the time of at a high speed; The two-way output signal is sent into the square wave that the shaping of 74HC14 Schmidt trigger becomes standard, anticipating signal A90 degree still on the signal B phase place after the shaping; Signal A and signal B after the two-way shaping give the 74LS74D trigger as shown in Figure 4, and at this time the sense of rotation signal of d type flip flop output is low level.Single-chip microcomputer reads the sense of rotation signal by common input port, and judging wheel is counter-rotating;
The CLKA end that output signal A after the shaping simultaneously is sent to counting chip CD4520 carries out step-by-step counting; Single-chip microcomputer periodically reads and zero clearing the count value of counting chip with common input port, because the speed of model of mind wheel is proportional to the count value that reads.Therefore, the count value that reads can be used as the velocity magnitude of model of mind wheel.