Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Industrial plasma cutter & USB

Status
Not open for further replies.

alpk

Newbie level 4
Joined
Sep 25, 2006
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,369
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
 

usbm.dll source

I little research and some communications with the manufacturer of the U421 have revealed that my problem is based on the USB polling rate in windows XP being set to 8ms.

I know there are 'tweaks' to set the polling rate to 1ms, allowing me to send 1000 commands per second to the machine, but I am not sure if this will be enough (only 8 times faster).

Alternatively the U421 supports commands for stepper motor control meaning the chip can be set to output control signals at a certain frequency. This might be fine for straight lines but on curved sections where the stepper motors speed is constantly changing we will have the same issue with slowdown due to polling speed restrictions.

If anyone else here had to face it issue of USB polling speeds, what alternatives have worked for you to get a high speed device interface?

Thanks again,
Alex
 

u421 speed

I doubt that you can do real-time control with a computer. You need dedicated hardware to drive your equipment with the PC providing a user interface and that's about it. I had a 3/4 HP servo that had was driven by a 100% digital controller. You could load the registers for positional, velocity or torque control. You had registers for ramp-up and ramp-down and the like. Once you set the parameters away it went. These controllers send out stepping and correction signals at over 100,000 times a second. And they are reading a feedback signal from the encoder at the same time. You aren't going to do that with a computer. And I doubt that you can use USB for an industrial setting anyway. You need special industrial grade communications (ie: noise-shielded cabling). My comm link was DeviceNet, an expensive offshoot of the CAN serial link. The card cost me $750. Check around for controllers for your device. I'm sure you can find one.
 

plasma stepper

Hi jhbbunch,
Thanks for the response.

You are making sense, the ideal situation would definitely involve an embedded controller with a computer acting merely as an interface.

With parallel communication, we could achieve well over 100,000 bytes per second to the machine, bytes which could instantaneously have an effect. This is in Dos, with Turbo Pascal, and it allowed full real-time control. The existing machine, as of right now, using old technology, can be controlled in real time by a normal laptop computer with no expensive, dedicated embedded controllers.

You're telling me that even considering the speed of modern computers, the speed of modern interfaces, that this is no longer possible? Thats interesting if it is so, because it will mean the machine will need totally re-doing in hardware. This is something my employer expressly wants to avoid, the whole reason that he's moving to support USB is that it is getting more and more expensive to find laptops with lpt these days. He can save himself around $20000 a year if he can get the devices talking through an alternative to lpt that enables him to buy standard laptops rather than ones geared up with any special kind of interface.

So unfortunately, nice as it seems, the option of changing the hardware is out of the question. He wants to save money by using existing software and hardware in pretty much its current configuration, with only a slight change in the software. If this can't be done, without ethernet, usb or firewire, if there is no way that he can save this money, then he will abandon the project.

This is the challenge I have been set. I know there are lots of better ways to do the job, involving shielded cables, embedded control circuitry, etc, but all of that is out of the question for me. Its not a matter of what I think is the best option, I have certain boundaries to what I can consider as an alternative to his current setup, the main thing being that it has to work out cheaper than his current setup, and be impimented within 3 months.

I am starting to think that this will be impossible.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top