Shop OBEX P1 Docs P2 Docs Learn Events
Why parallel port for CNC control? — Parallax Forums

Why parallel port for CNC control?

Timothy D. SwieterTimothy D. Swieter Posts: 1,613
edited 2014-04-06 03:32 in General Discussion
I have had an interest in home manufacturing and CNC for a while. Over the weekend I was reading the latest Make Magazine and it occurred to me that so many CNC drivers and software programs rely on the parallel port. Now, we have all read the articles and forum posts with lamenting at the lack of serial ports on computers, but aren't parallel ports heading down the same path?

I understand that the parallel port is used as digital I/O to make the stepper drivers move or to get feedback from a switch input, but why not use serial or USB and put a simple microcontroller in between the PC and the stepper driver? For home CNCing you want to keep the smarts in the computer because computers are cheap and easily available. For a home CNC person they don't want to have to learn some other complicated device or pay for it. However I could see a serial or USB micro to parallel port device being a good thing to open up the computers that can be used for controlling the CNC machine. The device wouldn't have to be expensive or complicated. In fact it could be as simple as a 'smart' usb/serial to parallel port driver.

The problem with just creating it is that there doesn't appear to be a protocol for communicating. Thus anything created would be target to one specific software or platform, unless they were all open enough to incorporate a driver to send commands over usb/serial. There would have to be a protocol for sending an instruction or set of instructions out the usb/serial port, having the micro execute them and then ask for more from the PC.

I know we have several people on the forum who are into the CNC arena more than I am so I am eager to learn if this idea has been tried or if there are other reasons that the Parallel port is used.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Timothy D. Swieter, E.I.
www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, 3.0" LCD Composite video display, eProto for SunSPOT
www.tdswieter.com

Post Edited (Timothy D. Swieter) : 2/2/2010 7:51:24 AM GMT
«1

Comments

  • BradCBradC Posts: 2,601
    edited 2010-02-02 08:11
    The Parallel port is used because it's ever present and very cheap. It's a dead easy way to get effectively GPIO control of pins and if run in a single-tasking operating system (ie DOS) you get completely deterministic timing. Because of this, most driver software seems to run on DOS and therefore is useless with anything that needs a driver. It's kinda a chicken and egg problem. There are some good Linux based tools coming up, but again they often hit the port directly because the commonly available hardware is Parallel based.

    If you made a $10 widget that did the same thing but using USB and a driver that worked pretty much anywhere, and sent them FOC to all the guys who write the control software, with a simply description of how they could do what they needed to do, you'd sell them like hotcakes. Until you can get the price down to nothing though, you are competing against the millions of old 386 machines lying around with Parallel ports that run tried and tested software.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Life may be "too short", but it's the longest thing we ever do.
  • Roy ElthamRoy Eltham Posts: 3,000
    edited 2010-02-02 09:29
    Most newer computers don't have Parallel ports or Serial ports. Even the PS/2 ports are fazing out. They just have 4-10 USB ports on the back instead.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Check out the Propeller Wiki·and contribute if you can.
  • LeonLeon Posts: 7,620
    edited 2010-02-02 09:33
    Just add a parallel port card, they are quite cheap.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
  • VIRANDVIRAND Posts: 656
    edited 2010-02-03 11:25
    Parallel port can control many pins instantly at the same time, instead of making a packet and waiting for the
    buffer to fill and then some time much later the pins get changed one at a time after the packet is sent one bit
    at a time. Serial has latency. The switch from IDE/PATA to SATA drives makes no sense at all to me, since you are
    accessing the hard drive 1 bit at a time instead of 16 or more bits at a time, obviously 16 times slower at least,
    and with 16 times the buffer latency. It makes even less sense for multicore. Maybe that explains why someone
    complained to me that an old DOS game runs slowly on their new machine, while it runs so fast on my Celeron
    that I can't play it, things go too fast for me to control or even SEE.

    Parallel is virtually instantaneous. Serial is guaranteed to be delayed.
    Which is better, running a race starting on a line across a wide track,
    or standing in a queue line with one person in front and everyone else behind another person on a narrow walkway?

    I remember intel's bogus huge pentium II and pentiumIII, with the fake hologram chips, and their claim that the
    laws of physics forced them to be made like that, but in laptops they used regular normal chips that looked like
    pentium 1 and pentium 4. It's like if you sell training wheels for cars, or ice cube trays for ovens,
    someone will buy them!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I should be typing in Spin now.
  • Erik FriesenErik Friesen Posts: 1,071
    edited 2010-02-03 14:28
    The ide to sata thing doesn't make sense to me either, but the new drives sure are fast. As bad as it is, why the switch?
  • BradCBradC Posts: 2,601
    edited 2010-02-03 14:54
    Erik Friesen said...
    The ide to sata thing doesn't make sense to me either, but the new drives sure are fast. As bad as it is, why the switch?

    Chips with less pins. Much easier to get timing to align (Let's try and layout a board that works at 3Ghz with 2 balanced conductors, now try it for 20 parallel conductors). Point to point (no master/slave excrement). Less board realestate for connectors. Cheaper connectors/cables. Differential signaling, so better SNR and longer cables.. want to go on?

    All in all, it's actually a much simpler interface to make go *fast*. Quite logical if you think about it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Life may be "too short", but it's the longest thing we ever do.
  • ManetherenManetheren Posts: 117
    edited 2010-02-03 17:36
    I have bought a PCI parallel port along with a USB to Parallel port in the past for using multiplt parallel port printers.

    http://www.tigerdirect.com/applications/category/category_slc.asp?CatId=471

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tia'Shar Manetheren
  • CannibalRoboticsCannibalRobotics Posts: 535
    edited 2010-02-03 21:41
    I think speed has nothing to do with any of it. CNC machines are real slow in relation to even a 'slow' processor once the G code is generated.
    The parallel port drivers dramatically reduce development time for the product. With a parallel port and an 8255 or similar latch/distributor a power supply and some beefy transistors, your stepper driver is done.
    With serial controllers there has to be some intelligence on the driver board in terms of command interpretation and buffering which means development in a second software environment besides windoze.
    Time is money, programming time is more.
    J-

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Signature space for rent!
    Send $1 to CannibalRobotics.com.
  • schillschill Posts: 741
    edited 2010-02-03 23:02
    As mentioned previously, I'm pretty sure the reason parallel ports are used is because it's easy to control multiple outputs at exactly the time you want with little or no latency. If you go with serial or usb, typically you are using an offboard computer and not just simple motor-interface circuitry.
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2010-02-03 23:36
    I don't buy the argument for, "control multiple outputs at exactly the time you want with no latency". This could be done with a micro. Packets of commands are sent to the micro via USB/Serial. The micro interprets them and then changes its outputs at once as desired. Latency isn't a problem I see with CNC.

    This is interesting feedback. I venture to guess that a USB/Serial protocol doesn't exist because it has been so easy to use the Parallel Port. At some point using the LPT gained momentum and that is why everyone is still using it today - but that doesn't mean that everyone still will be using it tomorrow or next year. If there was a standard for how to package and send commands from software like Mach3 or EMC2 to something as simple like an 8/16/32 bit micro whose only purpose is to translate between I/O and USB/Serial then we would see development in that area. I think some agreement or standard needs to help push in that direction. Maybe not a formal standard, but something not unlike the parallel port where a couple people start using, it gains momentum and then becomes a bit of a standard by default. Open source hardware/software could help push this movement.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter, E.I.
    www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, 3.0" LCD Composite video display, eProto for SunSPOT
    www.tdswieter.com
  • Peter KG6LSEPeter KG6LSE Posts: 1,383
    edited 2010-02-04 00:03
    I would buy the latency thing only on USB 1.1 .. I figurue that if I can do nearly seemless audio IO with USB , then CNC shoud be a cake walk ...
    BTW I have seen LPT to USB adapters everywhere ...
    personly I feel LPT is the standard and that if you buy a $20K CNC that a free adapter should come too .... kinda like how parallax offers in the same online store BS2 serial boards with a adapter or plain .

    Peter KG6LSE

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "Carpe Ducktum" "seize the tape!!"
    peterthethinker.com/tesla/Venom/Venom.html
    Never underestimate the bandwidth of a station wagon full of tapes hurtling down the highway. —Tanenbaum, Andrew S.
    LOL
  • schillschill Posts: 741
    edited 2010-02-04 00:43
    It's not so much that the 8 pins are being controlled at the same time, it's that it is harder to control the time between changes of state. As mentioned above, a lot of this stuff is even using DOS-based programs. The PC is in some ways being used like a really big microcontroller. The windows drivers for controlling the parallel port basically just get in the way and make things much harder (in this case, serial or usb are a lot better).

    If you offload enough of the intelligence to an external peripheral (a little computer or microcontroller in a box), you can get away with serial or usb. If you can download the entire motion program to the external device and then just monitor it from the PC then serial or usb are fine. The Makerbot works this way - you download the program and then the AVR chip it uses does all the work.

    A lot of PC based motion control has traditionally been done using fancy cards installed in the PC that control external motors. They are essentially "computers on a PC card" that sit inside your computer.

    Also, USB to LPT adapters are notoriously bad and should be eliminated from the face of the earth. They often don't even work well with printers. There are numerous USB to parallel output devices that work much better (including chips from FTDI) - just don't let a printer interface try to get in the way.
  • $WMc%$WMc% Posts: 1,884
    edited 2010-02-04 02:13
    Its called a parallel port for a reason.

    It's easy to confuse a DB25 serial port with a DB25 parallel port,they're·not the same.

    Not all CNC Apps use the parallel port, Take a look at FLASHCUT. Its USB based.

    The parallel port is nothing more than a serial to parallel shift register.Once the register is loaded, the enable pin is set and all the data is paralleled out at the same time.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The Truth is out there············___$WMc%___···························· BoogerWoods, FL. USA

    Post Edited ($WMc%) : 2/4/2010 2:20:21 AM GMT
  • BradCBradC Posts: 2,601
    edited 2010-02-04 13:37
    $WMc% said...
    Its called a parallel port for a reason.

    It's easy to confuse a DB25 serial port with a DB25 parallel port,they're not the same.

    How so? They are different genders.
    $WMc% said...


    The parallel port is nothing more than a serial to parallel shift register.Once the register is loaded, the enable pin is set and all the data is paralleled out at the same time.

    There is nothing "serial" about a Parallel port.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Life may be "too short", but it's the longest thing we ever do.
  • kwinnkwinn Posts: 8,697
    edited 2010-02-04 14:23
    There were a lot of reasons the parallel port became so popular for controlling external hardware, some of which I have listed below. Many of them also apply to the serial port as well, but it needed a bit more complex circuitry to connect to external hardware

    1 - Low cost parallel port boards available for all PC bus versions.
    2 - The parallel port quickly became a standard fixture on the motherboard.
    3 - Could be controlled by simple print commands from most languages.
    4 - Relatively simple to control directly from lowwer level languages.
    5 - The basic pinout was well known. At least 8 output pins plus a strobe, and a minimum of 2 input pins.
    6 - Simple to interface to external circuitry. In many cases a simple '373 was enough.
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2010-02-04 23:42
    Last night I was reading deeper in my January issue of Circuit Cellar. There was an article on a 'platformless' stepper motor controller. The article didn't go too far down the path on parallel ports or CNC control software, but made a mention that the inspiration for their project was trouble he had with previous products and not finding something that was platform insensitive (for parallel or serial port control). The author basically took an Arduino and made it into a stepper motor driver. He designed a protocol for sending various formats of data and commands. I foudn the article inspiring as well as a good refresher on stepper motors and their control.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter, E.I.
    www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, 3.0" LCD Composite video display, eProto for SunSPOT
    www.tdswieter.com
  • $WMc%$WMc% Posts: 1,884
    edited 2010-02-05 02:52
    BradC

    How does the front side bus and the back side bus on a home PC get loaded from a single core CPU?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The Truth is out there············___$WMc%___···························· BoogerWoods, FL. USA
  • photomankcphotomankc Posts: 943
    edited 2010-02-05 05:55
    There are USB controllers out there, SmoothStepper is one I believe. They are costly in comparison to a parallel port breakout and then you still have the cost of the stepper driver powering side to add on to it. Cards are still available even for mobos without them so given the other costs most people don't really fret the interface that much.
  • BradCBradC Posts: 2,601
    edited 2010-02-05 06:59
    $WMc% said...
    BradC

    How does the front side bus and the back side bus on a home PC get loaded from a single core CPU?

    A latch.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Life may be "too short", but it's the longest thing we ever do.
  • $WMc%$WMc% Posts: 1,884
    edited 2010-02-06 01:58
    BradC

    Not even close.

    You still have 1 life-line left, would You like to call a friend courtesy of AT&T?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The Truth is out there············___$WMc%___···························· BoogerWoods, FL. USA
  • olmstwolmstw Posts: 1
    edited 2014-04-03 11:24
    Leon wrote: »
    Just add a parallel port card, they are quite cheap.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM

    No room for a parallel port card in a CubieTruck....
  • ellipserellipser Posts: 43
    edited 2014-04-04 07:42
    The big reason to use a parallel port is timing. With USB there needs to be a microcontroller that interprets the USB signal and then turns it into steps/pulses. With parallel, the signal is already in a form that can be fed to the driver chip. With Windows, there are always times when your computer just locks up for a second or two and then continues. If it were the USB lagging like that when doing a direct feed to your driver chips, you'd mess up your part.
    Parallel ports are already obsolete, and for my CNC machine that I wanted to run Mach 3 on, I had to go onto Craigslist where I found a big fat HONKING desktop. It could double as a boat anchor.
    Fun Fact: The standard used in your parallel port requires that any pin may be accidentally connected to another without any damage to anything. I think that's pretty cool.

    I'd like to see a Prop-based solution to this. There are some good contributors on the forum making progress.

    For me, right now in the middle of my CNC build, I went with Mach3 and a setup from China (Board TB6560).

    Just as an aside, I hear people talking about getting a parallel card for their laptop. I don't even know where one would go on my laptop, there's no room.
  • MicksterMickster Posts: 2,694
    edited 2014-04-04 11:20
    If there was a standard for how to package and send commands from software like Mach3 or EMC2 to something as simple like an 8/16/32 bit micro whose only purpose is to translate between I/O and USB/Serial then we would see development in that area. I think some agreement or standard needs to help push in that direction. Maybe not a formal standard, but something not unlike the parallel port where a couple people start using, it gains momentum and then becomes a bit of a standard by default. Open source hardware/software could help push this movement.

    Good point! Mach3 actually do work with external devices, at least one of which has both an Ethernet AND USB interface. I am sure these guys would be open to collaborating on such a development because they are in the business of selling the software.
  • PublisonPublison Posts: 12,366
    edited 2014-04-04 11:24
    Mickster wrote: »
    Good point! Mach3 actually do work with external devices, at least one of which has both an Ethernet AND USB interface. I am sure these guys would be open to collaborating on such a development because they are in the business of selling the software.

    You guy's realize this is a four year old thread?

    Still may be pertinent.
  • MicksterMickster Posts: 2,694
    edited 2014-04-04 12:18
    Publison wrote: »
    You guy's realize this is a four year old thread?

    Still may be pertinent.


    LOL...too funny! But a great idea is a great idea....the external stuff that is available for Mach3 is way more spendy than need be!
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-04-04 12:49
    I'd have to say it was cheap and easy at a time when serial ports were much slower.

    And so, it is a legacy choice that lives on for all the old junk hoarders out their that want to scrounge for a 3-D printer.

    LinuxCNC supports it, but also supports serial via USB and regular serial.

    ++++++++++++
    What is wrong with supporting legacy devices that can use an old junker of a computer? Linux runs wonderfully on these devices.

    Do we always have to go shopping for new stuff for a new project?

    If I spend as much on woodworking equipment as I have spent on computer upgrades, I would actually have something of a decent woodshop and maybe some really nice custom furnature to show for the cash outlay.

    As it is, I have boxes of disks, and cables, and other stuff.

    In LinuxCNC does eliminate a layer of boards to translate motor control from serial to stepper pulses. So there is a cost savings.
  • PublisonPublison Posts: 12,366
    edited 2014-04-04 13:57
    I'd have to say it was cheap and easy at a time when serial ports were much slower.

    And so, it is a legacy choice that lives on for all the old junk hoarders out their that want to scrounge for a 3-D printer.

    LinuxCNC supports it, but also supports serial via USB and regular serial.

    ++++++++++++
    What is wrong with supporting legacy devices that can use an old junker of a computer? Linux runs wonderfully on these devices.

    Do we always have to go shopping for new stuff for a new project?

    If I spend as much on woodworking equipment as I have spent on computer upgrades, I would actually have something of a decent woodshop and maybe some really nice custom furnature to show for the cash outlay.

    As it is, I have boxes of disks, and cables, and other stuff.

    In LinuxCNC does eliminate a layer of boards to translate motor control from serial to stepper pulses. So there is a cost savings.

    Same reason I keep at least three 486 machines running to keep old DOS based parallel based EPROM Programmers running. I think I have a fourth if I need it. An plenty of 8 GB hard Drives. :)
  • MicksterMickster Posts: 2,694
    edited 2014-04-04 14:07

    LinuxCNC supports it, but also supports serial via USB and regular serial.



    In LinuxCNC does eliminate a layer of boards to translate motor control from serial to stepper pulses. So there is a cost savings.

    Hey Loopy, have you located a serial device supported by LinuxCNC or do I misunderstand?
  • kwinnkwinn Posts: 8,697
    edited 2014-04-04 18:23
    The main reason for using the parallel port for output to CNC's and other hardware was simplicity. On the external hardware you could have a simple 8 bit latch to receive the data. If you needed multiple bytes then you could use multiple latches and a '4017 or similar circuitry to load a series of latches with data. On the PC end it made programming much easier. You could use print commands to output the data and the print driver took care of things as long as the basic busy/ready signals were adhered to.

    And yes, I know this is a very old thread.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-04-04 18:33
    Mickster wrote: »
    Hey Loopy, have you located a serial device supported by LinuxCNC or do I misunderstand?

    LinuxCNC can support serial devices as is -- either RS232, RS485 (likely a best), or USB. But if you want to know about controller boards, they do exist.

    Arduino has a firmware that is supposed to work, called Grbl. But it won't support 3-D printers, just CNC. At this juncture, there is nothing for the Propeller to work with the LinuxCNC. It is a shame, but maybe someone can work off of the Grbl code to create a board.

    Why is RS485 the best interface for serial?
    1. Resistance to noise in what is likely to be a hostile industrial motor environment.
    2. Can easily out-distance USB cables, so computers don't have to be exposed to grease and other risks of damage.

    Try to port the Grbl code to a Propeller with Martin H.'s library of code. Look for Propelleruino. Go to page 1 for video.

    Propelleruino video
Sign In or Register to comment.