Background technology
Existing encoder mainly contains photoelectric encoder, magnetic grid scrambler, holds grid scrambler, inductosyn, resistance contact scrambler five big classes from the principle branch.
Photoelectric encoder by axle system, grating pay, light source and photoelectricity receives and conversion element is formed.When key light grid (being code-disc) that link to each other with main shaft when rotating with main shaft, form Moire fringe with the indication grating overlaid, by output and the corresponding photoelectric displacement signal of corner after the opto-electronic conversion. handle through electronics, and with computing machine with after display device is connected, just can realize the real-time control and the measurement of position, angle.Photoelectric encoder has the following advantages: volume is little, precision, contactless nothing wearing and tearing; But the both detection angles displacements of same kind again can detection of straight lines displacement under mechanical switching device helps; Multi-turn photoelectricity absolute encoder can detect the straight-line displacement of quite long range; Life-span is long, installs arbitrarily, and interface shape is abundant, reasonable price, mature technology.But also there is following shortcoming in photoelectric encoder: accurate but propose higher protection requirement to using under open air and the rugged surroundings; Measure straight-line displacement and need rely on the mechanical hook-up conversion, need to eliminate the error that mechanical clearance is brought; Detect the orbital motion object and be difficult to overcome slippage; No velocity voltage output.Therefore, this has greatly limited the range of application of photoelectric encoder.
The magnetic grid scrambler is made up of magnetic scale or disk, magnetic head and testing circuit.Record has an equally spaced magnetic signal on the magnetic grid, and magnetic head is along magnetic railings ruler motion detection magnetic signal, and is converted into electric signal, thereby detects.Magnetic grid is to do substrate with non-magnetic material, applies the thin magnetic film of one deck 0.10 to 0.20mm on the surface of matrix equably, then the magnetic signal of the last constant pitch of record.Magnetic head is divided into dynamic magnetic head and static head.Dynamically magnetic head is the speed responsive magnetic head, and when speed of related movement was very slow or static relatively, output signal was very little or be zero, and its application just is restricted.Static head is a magnetic flux response type magnetic head, needs the electric magnetization of drive coil to work.Because the magnetic head output signal is more weak, testing circuit must with magnetic head promptly from nearer, signal is vulnerable to electromagnetic interference (EMI).
Hold the grid scrambler and used for reference the version of grating, electric capacity is made the grid type.Scrambler divides moving grid and quiet grid two parts, and emitter and receiving pole are arranged on the moving grid, between emitter and receiving pole screening electrode is arranged, and avoids emitter to be coupled to the direct capacitance between the receiving pole.Repeller and screening electrode are arranged on the quiet grid, and screening electrode needs reliable ground, and is consistent with the width of repeller.During work, apply the excitation cycle signal on the emitting electrode,, on receiving pole, form composite signal by emitter and repeller, repeller and two pairs of capacitive coupling of receiving pole.The current potential of output signal has one-to-one relationship (being single-valued function) with the displacement of capacitor grid transducer in one-period, phase-modulated signal is the one-period signal, the width of one group of emitter of the every relative motion of moving grid and quiet grid, and phase-modulated signal changes one-period.Around this principle can differentiate the phase change of phase-modulated signal, thereby extrapolate the relative displacement of moving grid and quiet grid by phase detector.Can also change number by the up-down counter recording of output signals cycle simultaneously, realize the measurement of long distance.Hold the grid scrambler low in energy consumption, cost performance advantages of higher is arranged.But it is particularly remarkable that its work is subjected to the influence of extraneous interference, especially humid environment and outside electromagnetic interference easily.Secondly as accurate absolute transducer when the long-term outage work, need the periodic replacement battery, so be difficult to be used for measuring automatically for a long time as sensor
Inductosyn is to utilize ac magnetic field and the work of mutual inductance principle, is made up of the slide rule that can relatively move and scale (orthoscopic) or rotor and stator (rotary).Need during work to pass to the interchange excitation voltage on a kind of therein winding, because electromagnetic coupled just produces induced electromotive force on another kind of winding, this induced electromotive force is sinusoidal, varies with cosine with the relative position difference of two kinds of windings.Must provide power supply when therefore, inductosyn is used.Because coupled magnetic field is not strong, the electromagnetic coupled output signal is more weak, testing circuit must with the dashing of magnetic head from nearer, signal is vulnerable to electromagnetism ten and disturbs.
Resistance contact scrambler is a scrambler the earliest, and copper-foil conducting electricity is pasted in design on insulating body, and the soil fertility of sticking Copper Foil does not insulate, and utilizes brush to contact with Copper Foil whether to conduct electricity to read the relative position signal.But because contacting of brush and Copper Foil conducted electricity reliably inadequately, application of today is few.Resistance contact scrambler device must provide power supply when using, testing circuit must with the close together of sensing head, signal is vulnerable to electromagnetic interference (EMI).
Summary of the invention
The present invention be directed to the problem of existing various scramblers, a kind of rotary encoder based on color identification has been proposed, by the color on the color sensor detection colour disk, thereby differentiate rotational angle and direction, technology is simple, make things convenient for miniaturization, have preferable antivibration heatproof and interference free performance, can adapt to any environment request for utilization.
Technical scheme of the present invention is: a kind of rotary encoder based on color identification, it is characterized in that, comprise light source, colour disk, at least one color sensor, processor, rotary main shaft, shading element, colour disk is fixed on the rotary main shaft, shading element has the printing opacity crack, light source and color sensor seal with shading element, and the printing opacity crack on the shading element, light source and color sensor are near colour disk but do not rotate with colour disk, the light that light source sends is received by color sensor after colour disk reflection or transmission, and color sensor is converted to digital signal with detected colorama, and export to processor, the processor processing calculated signals goes out encoder data.
Described colour disk is translucent, and light source and color sensor lay respectively at the both sides of colour disk, and the transmittance that light source sends is received by color sensor after crossing colour disk and printing opacity crack.
Described colour disk is opaque, and light source and color sensor are positioned at the homonymy of colour disk, and the light that light source sends is received by sensor after the reflection of place, printing opacity crack colour disk.
Described color sensor adopts when two or more, and is in a certain angle between each color sensor.
Beneficial effect of the present invention is: the present invention is based on the rotary encoder of color identification because color encoder can be realized the continuous detecting to the position, therefore, under the situation that adopts high-precision sensor, can reach very high resolution; With respect to code-disc structure complicated in the conventional codec, the employing of colour disk makes the structure of color encoder simplify more; Color encoder belongs to absolute position encoder, can realize the detection of current location, rotational angle and rotation direction easily; Color encoder adopts the light sensing, and low to environmental requirement, particularly anti-electromagnetic interference capability is strong, can adapt to the demand of various application scenarios.
Embodiment
Schematic diagram as shown in Figure 1, color encoder mainly is made of light source 1, colour disk 2, color sensor 3 and processor 4, light by light source 1 sends after the reflection or transmission of colour disk 2, is received by color sensor 3, color sensor 3 is converted to digital signal with detected colorama, and export to processor 4, the output signal of processor pick-up transducers is according to certain software algorithm, calculation code device current location, the anglec of rotation, sense of rotation etc., and output.
Based on the rotary encoder structural representation of color identification, colour disk 2 is fixing with main shaft 6 shown in Fig. 2,3 for implementation, and be that rotating shaft is rotated with main shaft 6; Light source 1A, 1B and color sensor 3A, 3B be with 8 sealings of light shield 7 or blanking disc, and printing opacity crack 5A, 5B on light shield 7 or the blanking disc 8; Light shield 7 or blanking disc 8 do not rotate with colour disk 2 near colour disk 2.Processor 4 is connected with light source 1A, 1B and sensor 3A, 3B's, realizes control and data acquisition.
Chromosphere on the colour disk 2 can adopt colored circle or black and white chromosphere.If adopt colored circle, need performance according to color sensor 3, select that the spectral response susceptibility is strong, linearity one section chromatogram preferably, arrange a circle around colour disk.If adopt the black and white chromosphere, then on colour disk, arrange a circle from deep to shallow according to color.
Corresponding with colour disk 2, the selection of color sensor 3 can be the color sensor that can discern various coloramas, maybe can only discern the sensor of black and white light.As long as sensor has higher resolution to certain gradual change look, can meet design requirement.
Its optical system can adopt reflective or the transmission-type structure.If adopt the transmission-type structure as shown in Figure 2, then colour disk 2 is designed to translucent, light source 1A, 1B and sensor 3A, 3B lay respectively at the both sides of colour disk 2, and the light that light source 1A, 1B send is received by color sensor 3A, the 3B of correspondence respectively after seeing through colour disk 2 and printing opacity crack 5A, 5B respectively; If adopt reflective structure as shown in Figure 3, then colour disk 2 is designed to opaquely, and light source 1A, 1B and sensor 3A, 3B are positioned at the homonymy of colour disk 2, and the light that light source 1A, 1B send is received by sensor 3A, 3B respectively after the reflection of printing opacity crack 5A, 5B place colour disk.
In order to solve the interference that the color saltus step of chromatogram junction produces, adopt two or more color sensors to detect (being provided with of optical filter can be identical or different) simultaneously in the design, as Fig. 2,3 usefulness two color sensor 3A, 3B, in a certain angle between a plurality of sensors, angular range is 0 °~180 °, but, should adopt than mitre for guaranteeing reliability as far as possible.When the bigger saltus step of output valve generation of one of them sensor, then program judges that this sensor is in the color joining place, and adopts the output valve of another sensor to calculate.
Sensor 3 is generally with the impulse form output signal.Adoptable pulse collection method has two kinds: equal time method and isopulse method.The equal time method is with timer to be set a regular time (as 1ms), and frequency acquisition 100% is set, and opens the optical filter of certain color then, measures the umber of pulse that collects in timing.And the isopulse method is when optical filter is opened, and measures the umber of pulse of output, when counting down to 255, calculates the used time.No matter which kind of method above adopting can obtain the precise counting value.
Based on above design, color encoder has following feature:
1, can realize continuous detecting to the position.The detected position quantity of conventional codec is saltus step mostly, is one group of discrete magnitude; And for color encoder, the employing of gradual change look on the chromosphere makes that when rotating color encoder, the sensor output signal value changes continuously, thereby has realized the continuous position detection.
2, color encoder belongs to absolute position encoder.When scrambler rotates to any one position, color sensor is detected to be well-determined color on the colour disk, corresponding output also is a determined value, according to the one-to-one relationship of sensor output value and encoder position, just can realize the judgement to the absolute position.
The program circuit of color encoder is as shown in Figure 4: after 1, scrambler powers on, carry out initialization, initialization procedure comprises the setting of color sensor optical filter, timer setting, counter O reset, empties register, pointer initialization etc.After initialization is finished, can carry out following cycling; 2, at first carry out data acquisition, count the pulse of each sensor, and deposit register respectively in; 3, reading pointer points to the pulse value (initial value is first sensor pulse value address) of address then, compare with a last pulse value, if bigger saltus step takes place, illustrate that this sensor is in the color joining place, and read umber of pulse with another sensor umber of pulse address of pointed this moment; 4,, calculate the residing position of current encoder, the angle of having rotated and sense of rotation, and export with digital signal by the corresponding relation of umber of pulse and rotary encoder encoder position; 5, at last current data is saved as historical data, and turn back to the circulation begin the place.
Color sensor 3 is selected TCS230 for use, structure as shown in Figure 5, its inner integrated configurable silicon photodiode array and an electric current/frequency converter.Silicon photodiode array comprises 64 photodiodes, it is four types that these diodes are divided into, wherein 16 photodiodes have red filter, 16 photodiodes have green filter, 16 photodiodes have blue electric-wave filter, all the other 16 do not have any wave filter, can see through whole optical informations.These photodiodes are cross arrangement in chip, can reduce the unevenness that the incident light width of cloth is penetrated to greatest extent, thereby increase the degree of accuracy of color identification; On the other hand, 16 photodiodes of same color are connected in parallel, and are evenly distributed in the diode array, can eliminate the site error of color.Come the needed wave filter of Dynamic Selection by two programmable pins during work, as red, green, blueness or white light.TCS230 is output as the square wave of dutycycle 50%, and output frequency and light intensity are linear, this sensor is 250000~1 to the photoresponse scope, typical case's reference frequency output is 2HZ~500KHZ, and the user can select 100%, 20% or 2% output-scale-factor by two programmable pins.
During different-waveband, the spectral response figure that the sensor outside has added photodiode behind the HOYA CM500 filter as shown in Figure 6, as can be seen, different wave filters all have the accommodation of self, as blue light greatly when spectral range 390~560nm response curve best, therefore need adopt suitable filters at different-waveband, curve must smooth and continuous and flex point can not be arranged, thereby reach the purpose of accurate detection, illustrate below.
Give an example 1: the spectral range on the colour disk is 490~540nm, and two one of TCS230 sensors adopt blue color filter, and another adopts green color filter.As shown in Figure 5, in this scope, blue with green response curve the best, and also two direction of a curve are opposite.Adopt this scheme, note the correct decision sense of rotation, when just changeing as regulation, the output umber of pulse of opening the sensor of blue color filter increases, and the output umber of pulse of then opening the sensor of green color filter should reduce.
Give an example 2: the spectral range on the colour disk is 530~600nm, and two TCS230 sensors all adopt green color filter.As Fig. 5, response curve the best of this scope green, adopting two TCS230 sensors is in order to solve the problem of color saltus step, by this scheme, scrambler can be measured rotational speed exactly.