Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: spanky on March 02, 2008, 01:13:59 PM

Title: usb to parallel
Post by: spanky on March 02, 2008, 01:13:59 PM
I am trying to run my max nc cl system from a laptop through the usb.
Am I confused?
Can it be done?
Title: Re: usb to parallel
Post by: Chip on March 02, 2008, 03:04:21 PM
Hi, Spanky

As far as I now, A usb to parallel adapter cable Won't Work.

There are several usb type control's for Mach3, Thy all have there own CPU to store and send commands from Mach to your step & dir boards.

NC-Pod and SmouthStepper are 2, That I now of.

Hope this Helps, Chip
Title: Re: usb to parallel
Post by: jimpinder on March 02, 2008, 03:10:39 PM
You are not giving us much of a clue.

What machine - lathe, mill etc have you got, what drivers and more important - what laptop.

When this project first started, the output to the machine was via the parallel port - LPT1, principally because this port was faster, and could keep up with the fast response needed for a CNC system. The system could support a serial port for some of the slower responses.

I run my system from a laptop - but I am lucky - my Toshiba laptop has a parallel printer port - and runs from a 5 volt system. A lot of modern laptops have no LPT1 and only a 3.5 volt system.

What output have you got from the USB - is it USB2 - how does it fan out. To drive the various stepper motors and switches you need about 16 outputs and maybe 8 inputs - so you need a 24 port card, that is as fast as the old LPT1.
Title: Re: usb to parallel
Post by: spanky on March 02, 2008, 06:26:03 PM
looks like it's back to school for me.
IBM Lenovo Z61m
It sounds like the usb is out but how about the printer port on a docking station, providing that the 5 volts is there?
I would need to buy the second dock.
I am trying to run a MaxNC closed loop system.
I design in solid works and hope to do some prototyping on a home built machine.
I am a designer and have done some work with VB and Galil.
Title: Re: usb to parallel
Post by: Garyv on March 02, 2008, 07:16:57 PM
Do_you_have_a_PCMCIA_port?
If_so_there_are_a_few_adapters_out_there_for_a_LPT1_output_at_5_volts_Just_be_sure_that_
the_PCMCIA_card_will_fit_the_only_PCMCIA_to_LPT1_Ports_that_I_have_found_
are_the_regular_PCMCIA_not_the_PCMCIA-EXPRESS_ports..
Title: Re: usb to parallel
Post by: spanky on March 02, 2008, 09:11:16 PM
I have just ordered a pcmcia adaptor.
lets hope it works.
thank you :) :) :)
Title: Re: usb to parallel
Post by: stirling on March 03, 2008, 06:57:41 AM
Hi Spanky
Chip's already said this but just to expand a little. Mach uses a drive protocol called "step and direction". i.e. to move a motor it needs to set a direction signal and send a step signal AT THE SAME TIME. So, to drive three motors for example it needs to issue SIX signals AT THE SAME TIME. It therefore uses the parallel port because without external hardware that is the only way that the many control signals can occur in PARALLEL. It has nothing to do with the SPEED of parallel ports v the SPEEED of serial ports. If you want to use Mach with USB which of course stands for Universal SERIAL Bus then you can only send signals SERIALLY. These SERIAL signals must then be collected up by external hardware into the groups that WOULD have been sent in PARALLEL. Once collected up by storing them until you have all signals required for ONE 'pulse slot' the external hardware will then issue these signals in PARALLEL to the motor drives. The only SPEED issue is that if you use a USB and the associated and required external hardware then the USB must be able to send data fast enough that the SERIAL data can be parallelized in the same time as a parallel port could have sent it.
Hope this helps
Ian
Title: Re: usb to parallel
Post by: spanky on March 03, 2008, 11:18:45 AM
Thank you for the extended version.
It makes perfect sense when you think about it.

I am hopefull that the PMCCIA adaptor will do the job.

BTW, my real name is Jim Weatherly, Spanky is my cat.
My home page is  www.weatherlycustom designs.com
Title: Re: usb to parallel
Post by: jimpinder on March 03, 2008, 01:04:49 PM
Why use the name of your cat???

From one Jim to another - yes Stirling has the nub of it - you can use a serial connection if it can send the information fast enough - and in this case we are talking about 16 times or more faster that the parrallel port.

I got a pcmcia adaptor the other day for my laptop to try and get a USB 2 output to run a camera - it failed miserably. I hope you have more luck - I take it it is a PPMCIA to parrallel port card. It could work - best of luck.
Title: Re: usb to parallel
Post by: spanky on March 03, 2008, 11:44:52 PM
A rose by any other name doth smell as sweet.
What's in a name?
Title: Re: usb to parallel
Post by: stirling on March 04, 2008, 03:53:15 AM
yes Stirling has the nub of it - you can use a serial connection if it can send the information fast enough - and in this case we are talking about 16 times or more faster that the parallel port.
Sorry JimĀ  :) - but if you read my post again I'm sure you'll see that this was not what I was saying at all - quite the opposite in fact.
I'd also make the point that when it comes to discussing the relative speeds of parallel v serial transmission we need to establish some units - otherwise we're not comparing like with like. In fact if we use the same units for parallel and serial we'll find that - surprise surprise - to get the same throughput, by definition they both have to work at the same speed. (actually this isn't 100% true - one issue is that the serial has to work slightly faster to take into account the time needed by the operation of the shift registers in the external hardware to re-parallelize the data).
Art did NOT choose the parallel port because it was faster than any serial port or any other port for that matter - he chose it because Mach did not then need any external clocking hardware to re-parallelize the data and could therefore be sold as a 100% software motion controller - something others were struggling to do or had already given up on.
Cheers
Ian
Title: Re: usb to parallel
Post by: jimpinder on March 06, 2008, 09:41:51 AM
Yes - Mach 3 is simple, because it uses the parrallel port. I think that was what attracted me to it.

I have read your post again - and in the last two lines you are saying "The only SPEED issue is that if you use a USB and the associated and required external hardware then the USB must be able to send data fast enough that the SERIAL data can be parallelized in the same time as a parallel port could have sent it."

Perhaps we are coming from different angles - but that is what I was saying.
The PC collects date for the LPT1 port in three addresses. It amalgamates that into 17 lines of data and puts it out on the parrallel port. It is hard to know the internal workings of the CPU, but somewhere between 4 and no more than 8 moves would be required. For serial work, the same data has to be amalgamated, then moved to a buffer for one bit at a time for transmission. The transmitters I am familiar with only go at CPU clock speed. It follows, therefore that in simple terms the CPU will take at least 25 moves more to put out the data.

I must admit - and I know nothing of USB systems - if the CPU can put the parrallel data into a buffer, and then a seperate system moves the data serially at an enhanced rate - the the time difference may be small.

With the dissapearance of LPT1 ports, it would be a great benefit if someone could produce a USB2 to Parrallel output that could guarantee the speed and reliability of the LPT1. Even better if it had reversible pins. The plug and play type of connection could be a great enhancement.

Title: Re: usb to parallel
Post by: Overloaded on March 06, 2008, 10:03:57 AM
I think you both ARE saying basically the same thing.
And THANKS for putting in such clear and understandable terms.
I learn something here every day. BRAVO
Thanks much,
RC
Title: Re: usb to parallel
Post by: Hood on March 06, 2008, 05:02:34 PM
Might be worth you guys without parallel ports waiting a few more weeks then getting a Smooth Stepper, its USB and does the pulse external to the computer. It will do up to 4MHz per axis and is ultra clean compared to the software/parallel pulse. I have been Beta testing the Smooth Stepper and its working great, should mean you can basically use any computer (laptop etc) as all Mach has to do is the calcs and not worry about the pulses. I have had the Smooth Stepper running from a pico motherboard (total size of pico is 100mm x 70mm) its 1GHz embedded CPU and I have 1GHz memory in it. I will be using this setup in my Beaver mill that I am retrofiiting at the moment, another great thing is I will be able to use the 2000line encoders that my motor/drive combos have without having to resort to the drives electronic gearing :)

Hood