again in between ... what a quadrature decoder
What's your a quadrature decoder?
This is an evaluation of the
signals of linear and angle encoders
just as one finds them on machine tools, etc.
.
These donors provide a signal of two
staggered wave signals.
a period equivalent to 20μ, so that
be at 5μ 5μ offset in increments
evaluated.
(1μ = 1 micron = 1 / 1000000 m = 1 / 1000 mm)
All times just freshly typed quickly after work
............
a "quadrature decoder Display "
application based on a proposal by Bascom.
$ regfile =" m88def.dat "
$ crystal = 8000000 $ baud = 9600
Lcdpin Config = Pin, DB4 = Portb.0, DB5 = Portb.1 , Qb6 = Portb.2, Db7 Portb.3 =, E = Portb.5, Rs = Portb.4
Lcdbus Config = 4
Config Lcd = 20 * 4, Chipset = Ks077 'for EA-4 DIP204
cursor Off
Cls
Dim A As Long Dim Pos
As String * 10
A = 0
Enable Interrupts Enable INT0
Enable Int1
Pind.2 Config = Config Pind.3
Input = Input Config
Pind. 4 = Input
Portd.2 = 1
Portd.3
Portd.4 = 1 = 1 = INT0
Config Change
Config Int1 = Change
On INT0 Inta
On Int1 INTB
Cls
Thurs
If Pind.4 = 0 Then A = 0
Pos = Str (a)
Pos = Format (pos, "+000,000)
Locate 1, 1
Lcd" X ", pos," mm "
Loop
Inta:
If Pind.2 <> Pind.3 Then A
Decr Incr A
Else End If Return
INTB:
If Pind.2 <> Pind.3
Then Incr Decr A
A
Else End If Return
What makes this cute little program?
This will be a display for
incremental linear encoder.
With me is a wonderful
milling machine in the workshop (a cover FP2!)
and there for years, the display is broken.
The part must once again be usable
.. let's see if this is how!
In the "laboratory" in principle, it works fine
before.
is completely finished it but not yet.
I mean the program ....
I need more data for the
conversion of bars in mm.
and I still want to switch between absolute and relative terms
.
.... and the interface (RS232 / USB?)
should also eventually gehen.Ich operating
thinking to the recording
of values, eg for measuring
of Holes or contours.
three axes, the machine has already
and if you then turn builds a small
sensor and the calculated coordinates
............
...... someday .......
Addendum 11/11/2010:
Today I made first tests with a donor
.
It looks quite useful from ..
The speed should be enough.
After I reduced the resolution
and only create a channel interrupts
and have omitted the third decimal
and 12MHz
contacts and also only every 200
runs the display write new ......
(which is still very fast) I'm with
the speed of satisfaction.
The resolution of 10μ (1 / 100 mm).
I can record about 300 mm per second.
this is still more than 30 kHz clock is counted
reliable. Wow !!!!!!
(I have not measured, but
only be estimated, but that's out already)
moment to write two lines
. When only one line would
and also all the letters were dropped
(Display 1 x 8 characters)
and clocked at 20 MHz, then there is a lot !!!!!!!!
Unfortunately I have no
20MHz quartz
at hand.
I'm assuming that 500 mm / s
possible can be.
This is actually much more than I need,
but this is necessary if, for example vibrations
should be as fast cause disturbances. In
goes there once a clock strikes
lost!
Addendum of 30.11.2010:
Today I used the time to OPs
signal processing
and commissioned.
values so I inverted the signals from the encoder
well.
be interference somewhere
be captured largely eliminated.
This is something similar to RS485, but
two channels in one direction.
(there would be even a third channel, as
a pulse is an absolute
to define zero, but the
I do not use in this case.)
would There even specially
developed ICs, but so what I have
not just to hand.
It seems the OP
fulfill its task quite gut.Während before it was enough to put
a wire near a transformer
turn now and this has no effect
more. One could provide a
slight hysteresis in switching, but I think
, that simply is not necessary.
must now first time the program something
be adapted to make it again
runs on an ATmega48 and a switch
absolute / relative has (again) pure.
I have the clarity, when I went away
speed tests. The above listing
respond to all
change of the signal and counts in increments of 5μ. So exactly
need it here actually does not!
have so I divided it, so that an input
the positive and the other the negative
detects edges. Both inputs are connected in parallel
(So was the original
program proposal, but mainly because
was written the program for the 2313 Attiny
, and can not "change" detection)
Thus, I measure with much greater speed
the way and 10μ Aulösung
me rich at all costs!
runs the rest of the Atmega now with 20MHz clock frequency
! This is fun!
since you have already quite formidable donor
push until the miscounted!
need the shock, the mere shifting
with his hand, he creates each speed, creating
I! That should suffice
!
mfG
Franz
0 comments:
Post a Comment