Previous in Forum: Crimping Tool Needed   Next in Forum: Software For Micro-Controller Circuit Simulation
Close
Close
Close
8 comments
Rate Comments: Nested
Power-User

Join Date: Aug 2007
Location: Lahore
Posts: 369

Problem in Data Read/Write on Servo Drives in RS232/485 Communication

09/10/2013 6:48 AM

Hi;

We have 18years old slitter scorer machine which has 20 servo drives. Originally the machine has an MS DOS based control system to read/write the values on servo drives parameters. Comm loop is as following;

PC-RS232 port >>> RS232/485 converter >>> parallel comm loop to all servo drives with corresponding node address.

We have designed a new system in a Windows-7 based PC to read/write data on servo drives. The communication loop is same as above. We just remove the DB9 connector from old MS DOS based system and connect with our new system. The system read/writes data well to all drives but some time it happens that during a sequence of operation, system doesn't read some parameters of any drive or doesn't write the values on some parameters of any drive. The situation has confused us where is the problem. We were thinking that if it can be a noise issue but old system works well with same comm loop. Moreover, RS485 is less sensitive against noise. If you have any other idea, please share.

__________________
Don't assume any thing, always check/ask and clear yourself
Register to Reply
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.

Good Answers:

These comments received enough positive votes to make them "good answers".

"Almost" Good Answers:

Check out these comments that don't yet have enough votes to be "official" good answers and, if you agree with them, vote them!
Guru

Join Date: Aug 2007
Location: Earth - I think.
Posts: 2143
Good Answers: 165
#1

Re: Problem in Data Read/Write on Servo Drives in RS232/485 Communication

09/10/2013 9:56 AM

Have you checked for proper terminating resistors?

__________________
TANSTAAFL (If you don't know what that means, Google it - yourself)
Register to Reply
3
Guru
Engineering Fields - Power Engineering - New Member

Join Date: May 2007
Location: NYC metropolitan area.
Posts: 3230
Good Answers: 444
#2

Re: Problem in Data Read/Write on Servo Drives in RS232/485 Communication

09/10/2013 12:38 PM

I suspect, but only you can prove/disprove, that your servo systems need deterministic, real-time data, but Windows (any variant) is anything but deterministic and real-time. It sounds like you issue a command and before every step is completed Windoze goes off and does something else, then returns to complete your task.

MS-DOS had many more controllable parameters in the scheduler that allowed the original programmer to set up and prioritize a system of flags and semaphores to ensure that processes were dispatched and completed in a relatively controllable fashion. He could also strip the kernel to only the services you needed, which made it use less space and execute a whole lot faster (relatively speaking) than the regular distribution. Maybe you can gut W7 and prevent it from doing non-essential services.

I haven't tried any of that in Windows, perhaps other CR4ers have expertise in real-time Windows (an oxymoron I'm sure) systems. It might be cheaper to find a more modern platform like a *nix variant or a microcontroller like PIC and do it that way. Why not buy some modern computers that will run MS-DOS and run your old code directly?

__________________
“Tell me and I forget. Teach me and I remember. Involve me and I learn.” Ben Franklin.
Register to Reply Good Answer (Score 3)
Active Contributor

Join Date: Jun 2013
Posts: 14
Good Answers: 2
#3

Re: Problem in Data Read/Write on Servo Drives in RS232/485 Communication

09/11/2013 2:56 AM

This might be due to flow control. The old DOS machine might have been set up to use XON/XOFF or RTS/CTS hardware flow control. This is a common cause of dropped data in serial systems. Flow control settings are set against the serial port. I think the old DOS command was MODE or it might have been set within the software. Flow control allows the receiver to request a pause in the data flow to prevent buffer overflow. It can also be the case that if the DOS system was set to no flow control and the Windows system is set to XON/XOFF, then if the machine happens to send an ASCII XOFF then the PC will stop sending data.

Register to Reply
Power-User

Join Date: Jan 2010
Location: Dayton Ohio
Posts: 265
Good Answers: 10
#4

Re: Problem in Data Read/Write on Servo Drives in RS232/485 Communication

09/11/2013 10:43 AM

With the servos being in parallel, you may be experiencing bus contention, everybody talking at once. Try inserting delays of 100-300mS between commands. You might also check the baud rate, and try one step slower.

__________________
MikeMack747
Register to Reply
Guru

Join Date: Jul 2010
Posts: 669
Good Answers: 176
#5

Re: Problem in Data Read/Write on Servo Drives in RS232/485 Communication

09/11/2013 1:08 PM

It worked for 18 years.
Something changed and now it doesnt' work as well as it used to. Hmmmm.

What changed?

The old system ran with/without terminating resistors, so the new one should, too.

The old system had no bus conflicts with belligerant drives talking when they shouldn't.

The converter has not changed.
The field wiring has not changed.
The drives have not changed.

Why should 'noise' be present now that wasn't before if the drives, field wiring and converter have not changed?

The PC and O/S changed. It is not clear whether the software changed, or not.

What do the changes or lack of changes tell you?

Windows 7 accesses COM much differently than DOS did. Hmmmmmm.
What about the software?

Register to Reply Score 1 for Good Answer
Power-User

Join Date: Aug 2007
Location: Lahore
Posts: 369
#6
In reply to #5

Re: Problem in Data Read/Write on Servo Drives in RS232/485 Communication

09/12/2013 3:10 AM

Dear All;

Thanks for your participation. The original DOS based PC is just like a Black Box for us as we don't know any thing about it. We have written the sequence of operation of machine in codes in Microsoft Visual Studio, Net framework 4.5. We just remove the DB9 connector from old PC and connect it to our new system.

The old system has/had been working well. The reason which compelled us to design a new system is that OEM declared that they have made obsolete this machine and they don't have any kind of spare of it.

__________________
Don't assume any thing, always check/ask and clear yourself
Register to Reply
Guru

Join Date: Jul 2010
Posts: 669
Good Answers: 176
#7

Re: Problem in Data Read/Write on Servo Drives in RS232/485 Communication

10/11/2013 7:50 PM

Apparently, the communications works some of the time to all drives, correct?
In fact, one might say that communications works most of the time to all drives, but there's an occasional missed message?

The PC and the software program have changed. Nothing else.

I see some potential problems

1) You are now wear the hat of a software developer which means you now have the responsibility to debug your system, since the software drives a com port and is responsible for communications.

Since the only change is the PC and software, some issue arises that causes a message to not be sent or not received or to send a message when the receiver is supposed to be listening.

The only remedy I know of is to shop for a serial port sniffer software/hardware package (also called serial protocol analyzer software, or serial port monitor software) that listens on the serial line and displays what happens on the serial line. Google will find them for you.

There might be freeware, but anyone I've talked to who has actually solved a real serial problem has use a licensed software package. Packages are $300 - $2,000 and need a Tee or Wye hardware device (one company calls it a bus tap) to tap into the serial line.

The RS-485 package I am aware of is different than packages for RS-232. IFtools MSB RS-485 package provides not only traffic display but has a scope display (not a true scope, just a waveform display. Serialtest makes a hardware tap for 232.

Caveat Emptor, there is a learning curve.

2) RS-485 is supposed to have termination resistance installed at each end. However, it appears that your 232/485 converter has not changed, not the field wiring. If that's the case, termination is not likely the problem now if it wasn't before. Incorrect termination results in reflections that disrupt bit patterns for messages in progress or cause a false byte reception if a reflection is interpreted as a start bit.

3) Co-incident with your changeover to new PC/new software, something was installed or or something else changed its performance so something now generates electrical noise which disrupts the serial communications.

An oscilloscope issue will help you see the noise, but finding the source can be a challenge. The good news is that since communications works some or most of the time, you have a baseline of what good communications looks like on a scope screen. The bad news is the effort to locate the source of the noise.

Finding out 'what changed' generally requires nagging and harping and bitching at the people involved in the area about who did what to make changes. Locating that fluorescent light ballast that is generating a storm of noise is sometimes just luck.

I think option 1 is far more likely than options 2 or 3.

If the cost of the software and the learning curve to get any value out of it seems too high, then consider the alternatives
- live with the problem,
- hire a consultant to fix the problem (VB people rarely know serial comm)- replace the drives and the software to get the performance needed.

Register to Reply
Guru

Join Date: Jul 2010
Posts: 669
Good Answers: 176
#8

Re: Problem in Data Read/Write on Servo Drives in RS232/485 Communication

10/13/2013 1:23 PM

A log can be an aid in assessing the problem.

It occurs to me that one of the devices might be faulting its communications intermittently.

You might want to consider logging whatever failure mode it is that makes you aware that there's a comm problem to see if the problem is associated with a given device.

Register to Reply
Register to Reply 8 comments

Good Answers:

These comments received enough positive votes to make them "good answers".

"Almost" Good Answers:

Check out these comments that don't yet have enough votes to be "official" good answers and, if you agree with them, vote them!
Copy to Clipboard

Users who posted comments:

Beynona (1); Iris (3); Kilowatt0 (1); MikeMack747 (1); RAMConsult (1); Signode (1)

Previous in Forum: Crimping Tool Needed   Next in Forum: Software For Micro-Controller Circuit Simulation

Advertisement