How easy to add USB to a 1993 hass lathe?

This forum is dedicated to those Hobbyists Interested in CNC machining & 3D Printing in their home shops. (Digital Read Outs are also topical, as is CAD/CAM as it relates to CNC)

Moderator: Harold_V

John Hasler
Posts: 1852
Joined: Tue Dec 06, 2016 4:05 pm
Location: Elmwood, Wisconsin

Re: How easy to add USB to a 1993 hass lathe?

Post by John Hasler »

BigDumbDinosaur wrote: Thu May 28, 2020 12:27 pm Floppy drives are still readily available. In fact, I maintain a small inventory of Teac 3-1/2 inch drives for my clients whose machines have them.

As for USB, you should know you are significantly limited in cable length—the outer limit is three meters, less with USB 2.0, and even less with USB 3.0. Unless you plan to stand right next to the machine with a laptop, a USB port will be of very limited value.

Most shop machines have serial ports (TIA-232/422/485) or Ethernet ports, which allow the signals to be propagated over much greater distances without error. TIA-232 and Ethernet are generally reliable to 100 meters. TIA-422 or TIA-485 can be run out to over a kilometer if the data rates aren't too high. Most shop networks are built on TIA-485 due to its reliability over long distances and inherent resistance to electrical interference from nearby machines, especially arc welders.
John Hasler wrote:If it has a serial port (RS232) you want a USB to serial adapter like this:
I don't have much faith in those things. Most of them don't fully implement the TIA-232 standard for hardware flow control.
The ones with FTDI chips are significantly better. Often the problem is in the pc, though.
atunguyd
Posts: 199
Joined: Tue Oct 20, 2009 9:39 pm
Location: Durban South Africa

Re: How easy to add USB to a 1993 hass lathe?

Post by atunguyd »


BigDumbDinosaur wrote:
John Hasler wrote:If it has a serial port (RS232) you want a USB to serial adapter like this:
I don't have much faith in those things. Most of them don't fully implement the TIA-232 standard for hardware flow control.
Not familiar with the HAAS machines but a wick Google shows me they default to Xonn/Xoff for flow control which means you don't need hardware flow control support.

Sent from my SM-N975F using Tapatalk

John Hasler
Posts: 1852
Joined: Tue Dec 06, 2016 4:05 pm
Location: Elmwood, Wisconsin

Re: How easy to add USB to a 1993 hass lathe?

Post by John Hasler »

Some of the cheaper adapters don't get the levels correct either.
User avatar
Steggy
Posts: 1976
Joined: Tue Jun 28, 2011 9:19 pm
Location: JB Pritzker’s Hellhole
Contact:

Re: How easy to add USB to a 1993 hass lathe?

Post by Steggy »

atunguyd wrote: Sat May 30, 2020 2:55 amNot familiar with the HAAS machines but a wick Google shows me they default to Xonn/Xoff for flow control which means you don't need hardware flow control support.
It all depends on the data rate.

XON/XOFF (<DC1>/<DC3>, aka software flow control) is unreliable above 9600bps, which is well below the speed of even USB 1.0. The reason has to do with the amount of time required for the receiver to recognize that the input queue is in imminent danger of being overflowed and to react by transmitting <DC3> to the sender. Add to that the time required to serialize and deserialize <DC3> (~104 microseconds at 9600) and you have a potential data overrun error.

The subject machine probably can run the serial port at 19.2Kbps or 38.4Kbps—UARTs capable of that speed (and more) were commodities by 1993. It is impossible to run that fast using DC1/DC3 handshakes. Machines on which I've recently worked are able to support 115.2Kbps and some will even go as high as 230.4kbps. Without CTS/RTS handshaking, such an interface would be talking gibberish.
———————————————————————————————————————————————————————
Music isn’t at all difficult.  All you gotta do is play the right notes at the right time!  :D
User avatar
Steggy
Posts: 1976
Joined: Tue Jun 28, 2011 9:19 pm
Location: JB Pritzker’s Hellhole
Contact:

Re: How easy to add USB to a 1993 hass lathe?

Post by Steggy »

John Hasler wrote: Sat May 30, 2020 10:16 amSome of the cheaper adapters don't get the levels correct either.
Yep!

A while back, I helped out a client who was trying to communicate with a managed switch through its built-in TIA-232 port (don't ask why—I don't like to embarrass clients, even when they do something boneheaded) using his laptop and one of those USB-to-TIA-232 thingies. It wouldn't cooperate and finally he called asking for help. Suspecting what you mentioned, I brought along my TIA-232 test gear and sure enough: a mark was -3.2 volts and a space was +2.6. While the mark was (barely) within spec for TIA-232 (-3 to -15), the space was too low to be recognized by the switch. The only recourse was to get a different USB-to-TIA-232 adapter.
———————————————————————————————————————————————————————
Music isn’t at all difficult.  All you gotta do is play the right notes at the right time!  :D
atunguyd
Posts: 199
Joined: Tue Oct 20, 2009 9:39 pm
Location: Durban South Africa

Re: How easy to add USB to a 1993 hass lathe?

Post by atunguyd »

atunguyd wrote:
BigDumbDinosaur wrote:
John Hasler wrote:If it has a serial port (RS232) you want a USB to serial adapter like this:
I don't have much faith in those things. Most of them don't fully implement the TIA-232 standard for hardware flow control.
Not familiar with the HAAS machines but a wick Google shows me they default to Xonn/Xoff for flow control which means you don't need hardware flow control support.

Sent from my SM-N975F using Tapatalk
BigDumbDinosaur wrote:
atunguyd wrote: Sat May 30, 2020 2:55 amNot familiar with the HAAS machines but a wick Google shows me they default to Xonn/Xoff for flow control which means you don't need hardware flow control support.
It all depends on the data rate.

XON/XOFF (<DC1>/<DC3>, aka software flow control) is unreliable above 9600bps, which is well below the speed of even USB 1.0. The reason has to do with the amount of time required for the receiver to recognize that the input queue is in imminent danger of being overflowed and to react by transmitting <DC3> to the sender. Add to that the time required to serialize and deserialize <DC3> (~104 microseconds at 9600) and you have a potential data overrun error.

The subject machine probably can run the serial port at 19.2Kbps or 38.4Kbps—UARTs capable of that speed (and more) were commodities by 1993. It is impossible to run that fast using DC1/DC3 handshakes. Machines on which I've recently worked are able to support 115.2Kbps and some will even go as high as 230.4kbps. Without CTS/RTS handshaking, such an interface would be talking gibberish.
It really depends on the operation you are doing and the size of your buffers.
If the reason for using RS232 in this chase is to transfer a file into memory (RAM or EEPROM) the chances of your buffer running dry are minimal and you probably don't need flow control at all. Flow control on RS232 is there for devices like printers that actually do something mechanical with the data (print it) and have small buffers.
From looking on google the serial port on these CNC machines is to transfer files to them using Xmodem Protocol which itself contains flow control in the form of ACK's being sent back from the terminal upon receipt of each 128 byte packet. So if the FIFO buffers are bigger than 128 bytes even having hardware flow control is pointless as it will never be called upon to act regardless of bitrate.
Further XMODEM supports retries so I honestly think a USB to serial will work just fine regardless of flow control support.

Of course I am making a fairly large assumption on what the serial port is for so if I got that wrong then I stand corrected.

Sent from my SM-N975F using Tapatalk

Post Reply