Rotary Encoder
- Tchefter
-
Topic Author
- Offline
- Elite Member
-
Less
More
- Posts: 196
- Thank you received: 32
08 Dec 2017 12:49 #102769
by Tchefter
Rotary Encoder was created by Tchefter
Hi @all,
it's WinterTime
im trying to build something from my CNC for my CNC 
My Question: Is it possible to use this cheap Rotary Encoder www.ebay.de/itm/Drehregler-Drehgeber-Rot...e:g:pIYAAOSwn25aD28N
with LinuxCNC with a extra ParPort Card, to move my X or Y or Z Axis in diffrent Speeds like 1 / 10 / 100 seperatly?
Thanks for replys,
Fritz
it's WinterTime


My Question: Is it possible to use this cheap Rotary Encoder www.ebay.de/itm/Drehregler-Drehgeber-Rot...e:g:pIYAAOSwn25aD28N
with LinuxCNC with a extra ParPort Card, to move my X or Y or Z Axis in diffrent Speeds like 1 / 10 / 100 seperatly?
Thanks for replys,
Fritz
Please Log in or Create an account to join the conversation.
- PCW
-
- Offline
- Moderator
-
Less
More
- Posts: 18482
- Thank you received: 5055
08 Dec 2017 14:09 #102772
by PCW
Replied by PCW on topic Rotary Encoder
If you mean use this for a jog control, yes you can.
They are quadrature encoders and can be read by the encoder module in LinuxCNC
Since they also have a built in push button, you could perhaps use a single one for X,Y,Z
and use the pushbutton for axis select.
Note that like all mechanical encoders these have noisy output signals and may require
filtering the quadrature signals through a RC network or using the "debounce" component
in your hal file to clean up the signals.
They are quadrature encoders and can be read by the encoder module in LinuxCNC
Since they also have a built in push button, you could perhaps use a single one for X,Y,Z
and use the pushbutton for axis select.
Note that like all mechanical encoders these have noisy output signals and may require
filtering the quadrature signals through a RC network or using the "debounce" component
in your hal file to clean up the signals.
Please Log in or Create an account to join the conversation.
- Todd Zuercher
-
- Offline
- Platinum Member
-
Less
More
- Posts: 4987
- Thank you received: 1455
08 Dec 2017 14:14 #102773
by Todd Zuercher
Replied by Todd Zuercher on topic Rotary Encoder
Probably (if the output of it is an A-B quadrature signal, it should be pretty simple)
Please Log in or Create an account to join the conversation.
- Tchefter
-
Topic Author
- Offline
- Elite Member
-
Less
More
- Posts: 196
- Thank you received: 32
08 Dec 2017 14:22 #102775
by Tchefter
Replied by Tchefter on topic Rotary Encoder
Thanks PCW, thanks Todd, nice to read your Posts.
Do you have an example?
Do you have an example?
Please Log in or Create an account to join the conversation.
- PCW
-
- Offline
- Moderator
-
Less
More
- Posts: 18482
- Thank you received: 5055
08 Dec 2017 15:00 #102777
by PCW
Replied by PCW on topic Rotary Encoder
For the very low level parts the hal wiring would be something like:
loadrt encoder
loadrt debounce cfg=3
addf debounce.0 base-thread
addf encoder encoder.capture-position servo-thread
addf encoder.update-counters base-thread
net rawquada parport.0.pin-10-in debounce.0.0.in
net rawquadb parport.0.pin-11-in debounce.0.1.in
net rawjogbutton parport.0.pin-12-in debounce.0.2.in
net cleanquada debounce.0.0.out encoder.0.phase-A
net cleanquadb debounce.0.1.out encoder.0.phase-B
net jogbutton debounce.0.2.out
loadrt encoder
loadrt debounce cfg=3
addf debounce.0 base-thread
addf encoder encoder.capture-position servo-thread
addf encoder.update-counters base-thread
net rawquada parport.0.pin-10-in debounce.0.0.in
net rawquadb parport.0.pin-11-in debounce.0.1.in
net rawjogbutton parport.0.pin-12-in debounce.0.2.in
net cleanquada debounce.0.0.out encoder.0.phase-A
net cleanquadb debounce.0.1.out encoder.0.phase-B
net jogbutton debounce.0.2.out
The following user(s) said Thank You: Tchefter
Please Log in or Create an account to join the conversation.
- Tchefter
-
Topic Author
- Offline
- Elite Member
-
Less
More
- Posts: 196
- Thank you received: 32
08 Dec 2017 17:49 #102786
by Tchefter
Replied by Tchefter on topic Rotary Encoder
@PCW i don't know how to handle this :/
I tried out this example from andypugh forum.linuxcnc.org/24-hal-components/637...for-my-mill-how#6377
it works but only with one Phase, don't understand why.
it also works only in one direction, The Button works also not.
When i test it with an Arduino it works all fine...
I have TB6560 4-Axis red Board where the Pins 10-13 are available, so i tought this must work... hmmmm...
I tried out this example from andypugh forum.linuxcnc.org/24-hal-components/637...for-my-mill-how#6377
it works but only with one Phase, don't understand why.
it also works only in one direction, The Button works also not.
When i test it with an Arduino it works all fine...
I have TB6560 4-Axis red Board where the Pins 10-13 are available, so i tought this must work... hmmmm...
Please Log in or Create an account to join the conversation.
- Tchefter
-
Topic Author
- Offline
- Elite Member
-
Less
More
- Posts: 196
- Thank you received: 32
08 Dec 2017 19:24 #102790
by Tchefter
Replied by Tchefter on topic Rotary Encoder
Some fixes done.
I found, under a lot other things, thsi Panasonic Encoder
www.digikey.com/product-detail/en/panaso...16B/P12423-ND/637160
Following steps are working:
Push Button to select the Axis to move and Movement in + Direction but not - Direction
I found, under a lot other things, thsi Panasonic Encoder
www.digikey.com/product-detail/en/panaso...16B/P12423-ND/637160
Following steps are working:
Push Button to select the Axis to move and Movement in + Direction but not - Direction
Please Log in or Create an account to join the conversation.
- Todd Zuercher
-
- Offline
- Platinum Member
-
Less
More
- Posts: 4987
- Thank you received: 1455
08 Dec 2017 20:01 #102792
by Todd Zuercher
Replied by Todd Zuercher on topic Rotary Encoder
If you setp encoder.N.counter-mode 1, would explain your problems, set that to 0 (or leave that line out entirely as 0 is the default setting).
Here is what the man page for the software encoder says:
linuxcnc.org/docs/html/man/man9/encoder.9.html
encoder.N.counter-mode bit i/o Enables counter mode. When true, the counter counts each rising edge of the phase-A input, ignoring the value on phase-B. This is useful for counting the output of a single channel (non-quadrature) sensor. When false (the default), it counts in quadrature mode.
Here is what the man page for the software encoder says:
linuxcnc.org/docs/html/man/man9/encoder.9.html
encoder.N.counter-mode bit i/o Enables counter mode. When true, the counter counts each rising edge of the phase-A input, ignoring the value on phase-B. This is useful for counting the output of a single channel (non-quadrature) sensor. When false (the default), it counts in quadrature mode.
The following user(s) said Thank You: Tchefter
Please Log in or Create an account to join the conversation.
- Tchefter
-
Topic Author
- Offline
- Elite Member
-
Less
More
- Posts: 196
- Thank you received: 32
08 Dec 2017 20:07 #102794
by Tchefter
Replied by Tchefter on topic Rotary Encoder
coool
now it works fine, thanks Todd.


Please Log in or Create an account to join the conversation.
- Tchefter
-
Topic Author
- Offline
- Elite Member
-
Less
More
- Posts: 196
- Thank you received: 32
09 Dec 2017 20:42 #102847
by Tchefter
Replied by Tchefter on topic Rotary Encoder
Now i have my second parallel card on the run *lucky
. Is it possible to run an encoder on the first card, say with me on the controller, and run the second encoder on the second card? I would like to work with the first encoder as the stand is now and with the second encoder enter the step size, for example: 1/10/100
How do I combine the two encoders? I tried to read in the docs, but as a beginner I'm not really right there. are there any examples for this?
Regards Fritz

How do I combine the two encoders? I tried to read in the docs, but as a beginner I'm not really right there. are there any examples for this?
Regards Fritz
Please Log in or Create an account to join the conversation.
Time to create page: 0.091 seconds