Connecting sensor and avoiding ground loop
Should you decide to connect Encoder directly to Arduino, then the TTL circuit's ground would be connected to Arduino ground. This connection might complete a ground loop. We cannot tell if a ground loop is created, because details of the Circuit DC power connection to its Powerline is not shown.
One way to avoid a ground connection from Machine to Arduino is the use of two opto-isolators on Signal_1 and Signal_2 lines. The encoder's TTL output should be able to drive an opto-coupler's internal LED.
This allows both Machine and Laptop to be plugged into powerline, eliminating ground currents due to a groundloop.



simulate this circuit &ndash; Schematic created using CircuitLab