Mesa 7i96s TTL Encoder Question

More
08 Apr 2025 08:58 - 08 Apr 2025 09:36 #325906 by Eich
Mesa 7i96s TTL Encoder Question was created by Eich
Hi @all,

i'm using LinuxCNC 2.9.3 in combination with a Mesa 7i96s to control my JMC servo based x-y-z laser handling system.
I added the following components to my system:
- gladevcp
- WHB HB04
- Arduinoconnector (for periphery like compressed air, lamps, fume extraction...)
and thanks to your posts and the detailed videos of talla83 and alexmagtoast i somehow got it working. Thank you very, very much.
I'm based in mechanical engineering so the software and electronics part is fun but a steep learning curve. This is my first self-build maschine.

My current problem:
I have a second PC with a third party software for setting the laser parameters. For adjusting the focus, this pc can put out 5V step/dir TTL signals 5 μs for steppers. In the machine setup process i would like to use this signals to control my z- and x-axis.
I cant just connect it to the steppers because it would corrupt the position in LinuxCNC, so my idea was to connect this TTL signal to the encoder input of the mesa.

Wiring:
Jumper W1 in left position (for single ended TTL encoders)
step+ on ENCA+ (TB2-7)
step-gnd on GND (TB2-9)
dir+ on GPIO38 (successfully shows in HALshow)
dir- on GPIO GND

Would that work in principle? Can i just use a GPIO pin instead?
Do i need to configure the encoder somehow?
While writing this i realised my logical mistake might be that a single ended encoder still uses ENCA+ for positive and ENCB+ for negative direction?

In my custom_postgui.hal i use the following code but it doesnt register anything in halshow.

Warning: Spoiler!


Help would be very appreciated.

Best regards,
Chris
Last edit: 08 Apr 2025 09:36 by Eich.

Please Log in or Create an account to join the conversation.

More
08 Apr 2025 14:27 - 08 Apr 2025 17:19 #325932 by PCW
Replied by PCW on topic Mesa 7i96s TTL Encoder Question
You would normally use ENCB for direction.
(and set counter-mode to true for "Step/Dir")

From the hostmot2 manual page:

       counter-mode (bit r/w)
           Set to False (the default) for Quadrature. Set to True for Step/Dir (in which case
           Step is on the A pin and Dir is on the B pin).

Using GPIO for direction could lose/gain counts on
a direction change.

Note that if you need more encoder channels, there are 7I96S configurations with multiple
encoders on the P1 expansion connector.
Last edit: 08 Apr 2025 17:19 by PCW.

Please Log in or Create an account to join the conversation.

Time to create page: 0.089 seconds
Powered by Kunena Forum