alpk
Newbie level 4
industrial plasma cutter
Hi,
This is my first post here, so hopefully my question has found the appropriate forum area.
I currently work for a company that manufactures automated plasma cutters. I am a programmer by trade with experience in C++, Java, Delphi, PHP, C & Pascal in order of personal preference. For a coding junkie, I have good theoretical knowledge of electronic hardware, logic circuits, binary operations and so on. I'm not afraid of getting my hands dirty on low level design. The problem is that I lack knowledge and more importantly practical experience in the field of automated machinery and robotics.
The major aspect of my current project involves upgrading the design of a plasma cutting machine to use USB rather than the LPT port for the PC-to-Machine interface. This is to take advantage of the availability and cost effectiveness of USB-ready computer systems as opposed to outdated, increasingly difficult to source and progressively expensive LPT-enabled systems.
The plasma cutting machine itself consists of stepper motors and various hydraulic rams controlled by a wired-in laptop computer, which is not a new concept. The position of the cutting head is controlled by a stream of bytes. Each byte is a different command telling the machine what to do next. There is no complicated automatic hardware logic. For example the machine recieves a command to step the x-stepper motor one step clockwise, while lowering the cutter and switching on the flame, in a single byte. It is a simple system, but it works quite well.
Several USB-to-LPT adaptors and parallel PCMCIA interfaces, were tested with unsatisfactory results. After a small bit of research this problem seemed to be a simple matter of getting hold of a black box USB device, such as the USBMicro U421, and changing the software to set the pinouts on the U421 that the machine could then 'read' in the same way it read the lines of the parallel interface. The decision to use the U421 was made before I was contracted to do the work, so at the present time it is what I have to work with. More information can be found at h**p://www.usbmicro.com if it helps.
After a fun week or two spent cramming the old turbo pascal code into delphi, I performed a live test. The good news as a result of this test was that the USB interface works perfectly as far as getting the commands to the machine and making it do its thing.
The bad news and the crux of my problem is that the machine cuts the pattern at a horrendously slow pace, at about 3 seconds per centimeter. Not a good result.
I narrowed the problem down a little. When the machine is connected to the PC through the USB interface, the screen output shows just how slow the machine is working. If I then unplug the USB adapter mid-way through the pattern the on-screen output speeds up and the remainder of the pattern executes very quickly. The program is still attempting to write to a usb device that is no longer present, but since its no longer attached the driver must skip over the code that actually does the write operation.
What I think is happening is some delay in writing to the USB interface is causing the slowdown. I have a feeling this is a hardware issue with the U421. There is a chance that it is software related, however the driver provided with the U421 (USBm.dll) is not open source. This means I can't easily find out exactly how the software works on a low level without a lot of run-time debugging.
There could be a problem with speed due to the byte being written serially rather than in one direct memory write to a paralell port. I assume that with the high speed of USB this should not be a problem. If the 'potential' speed of the USB port (even 1.1) far exceeds the capabilities of LPT when transferring bytes, then I have to consider that the U421 hardware itself is simply not fast enough for this application. Maybe a firewire or USB2 solution is viable?
Another alternative I considered was that because of the high speed of my computer, the stepper motors are not ramping up properly and the commands to move are coming too quickly for them to reach their desired operating frequency. Frankly the timing code is a mess, using an ad-hoc system of delays and empty for-loops, and is potentially (99.5% certainly) buggy. However, the speedup that occurs in the software when the usb device is unplugged mid-pattern tells me something does indeed happen in the process of actually writing bytes to the U421 that is holding up the program itself.
Has anyone experienced these kind of slowdown issues with USB compared to LPT? If so, are there any ideas about what can be done about it? Are there any easy and low cost solutions as an alternative to an out-of-the-box device like the U421? My half-educated guess is that the USB device we're currently using to interface the machine to the PC is not fast enough for this application, and we may need to look at possibly finding a way to use USB2 or Firewire, or some other system. But, I don't really know, and an experts opinion would really help a great deal.
If anyone can point me in the right direction it would be much appreciated.
Cheers,
Alex
Hi,
This is my first post here, so hopefully my question has found the appropriate forum area.
I currently work for a company that manufactures automated plasma cutters. I am a programmer by trade with experience in C++, Java, Delphi, PHP, C & Pascal in order of personal preference. For a coding junkie, I have good theoretical knowledge of electronic hardware, logic circuits, binary operations and so on. I'm not afraid of getting my hands dirty on low level design. The problem is that I lack knowledge and more importantly practical experience in the field of automated machinery and robotics.
The major aspect of my current project involves upgrading the design of a plasma cutting machine to use USB rather than the LPT port for the PC-to-Machine interface. This is to take advantage of the availability and cost effectiveness of USB-ready computer systems as opposed to outdated, increasingly difficult to source and progressively expensive LPT-enabled systems.
The plasma cutting machine itself consists of stepper motors and various hydraulic rams controlled by a wired-in laptop computer, which is not a new concept. The position of the cutting head is controlled by a stream of bytes. Each byte is a different command telling the machine what to do next. There is no complicated automatic hardware logic. For example the machine recieves a command to step the x-stepper motor one step clockwise, while lowering the cutter and switching on the flame, in a single byte. It is a simple system, but it works quite well.
Several USB-to-LPT adaptors and parallel PCMCIA interfaces, were tested with unsatisfactory results. After a small bit of research this problem seemed to be a simple matter of getting hold of a black box USB device, such as the USBMicro U421, and changing the software to set the pinouts on the U421 that the machine could then 'read' in the same way it read the lines of the parallel interface. The decision to use the U421 was made before I was contracted to do the work, so at the present time it is what I have to work with. More information can be found at h**p://www.usbmicro.com if it helps.
After a fun week or two spent cramming the old turbo pascal code into delphi, I performed a live test. The good news as a result of this test was that the USB interface works perfectly as far as getting the commands to the machine and making it do its thing.
The bad news and the crux of my problem is that the machine cuts the pattern at a horrendously slow pace, at about 3 seconds per centimeter. Not a good result.
I narrowed the problem down a little. When the machine is connected to the PC through the USB interface, the screen output shows just how slow the machine is working. If I then unplug the USB adapter mid-way through the pattern the on-screen output speeds up and the remainder of the pattern executes very quickly. The program is still attempting to write to a usb device that is no longer present, but since its no longer attached the driver must skip over the code that actually does the write operation.
What I think is happening is some delay in writing to the USB interface is causing the slowdown. I have a feeling this is a hardware issue with the U421. There is a chance that it is software related, however the driver provided with the U421 (USBm.dll) is not open source. This means I can't easily find out exactly how the software works on a low level without a lot of run-time debugging.
There could be a problem with speed due to the byte being written serially rather than in one direct memory write to a paralell port. I assume that with the high speed of USB this should not be a problem. If the 'potential' speed of the USB port (even 1.1) far exceeds the capabilities of LPT when transferring bytes, then I have to consider that the U421 hardware itself is simply not fast enough for this application. Maybe a firewire or USB2 solution is viable?
Another alternative I considered was that because of the high speed of my computer, the stepper motors are not ramping up properly and the commands to move are coming too quickly for them to reach their desired operating frequency. Frankly the timing code is a mess, using an ad-hoc system of delays and empty for-loops, and is potentially (99.5% certainly) buggy. However, the speedup that occurs in the software when the usb device is unplugged mid-pattern tells me something does indeed happen in the process of actually writing bytes to the U421 that is holding up the program itself.
Has anyone experienced these kind of slowdown issues with USB compared to LPT? If so, are there any ideas about what can be done about it? Are there any easy and low cost solutions as an alternative to an out-of-the-box device like the U421? My half-educated guess is that the USB device we're currently using to interface the machine to the PC is not fast enough for this application, and we may need to look at possibly finding a way to use USB2 or Firewire, or some other system. But, I don't really know, and an experts opinion would really help a great deal.
If anyone can point me in the right direction it would be much appreciated.
Cheers,
Alex