Intermittent timeouts and nacks when using servo command
Navigates to RoboticsConnection.com Home RoboticsConnection.com HomePage
RoboticsConnection User Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        


12»»

Intermittent timeouts and nacks when using... Expand / Collapse
Author
Message
Posted Friday, August 20, 2010 2:18 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: Sunday, February 27, 2011 1:07 AM
Posts: 8, Visits: 38
When using the servo command to position a servo, roughly every 3rd or 4th time I send a command I'll time out waiting for the response, sometimes I'll then receive a NACK, and most of the time the 3rd time will work.  I get the same issue with SetIO, but only every once in a while.  75% of the time things work fine.

Any suggestions?  Can you tell me why setio would ever time out or nack?  It seems like it is just sending a PWM signal to the servo, so I'm not sure why there' ever be much of a delay. 

I've got the timeout set to 5 seconds and I'm doing direct serial port communication (not using any of your .net libraries, etc.)

Post #1951
Posted Friday, August 20, 2010 1:56 PM


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: Monday, October 31, 2011 9:18 PM
Posts: 640, Visits: 819
Hi Eric,

Our Serializer .NET lib is sending the same commands down, and I don't recall it getting any NACKs.  Double check the command strings you're sending down to make sure you're not sending an additional invisible character down, which would throw the parsing off.

Can you type the commands in from PuTTY, and see the same behavior?  If not, it is almost certainly your code that's speaking the protocol. 

Best Regards!

Jason Summerour
President,
Summerour Robotics Corporation
www.roboticsconnection.com

Post #1955
Posted Saturday, August 21, 2010 6:00 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: Sunday, February 27, 2011 1:07 AM
Posts: 8, Visits: 38
I've been looking for race conditions or other issues that might be misformatting the command, and I'll continue, but I don't that is the issue.  BTW I've seen this behavior on your old version of the board and the new one.

What made me wonder about the setio command sending NACKs or timing out sometimes was this: When I look at the disassembled code for CommunicationTask.ProcessJob in the latest version of RoboticsConnection.Serializer.dll, I noticed that the code ignores NACK and timeout exceptions up to 3 times, thus I suspect these get masked in many situations for users of that library at least.  See below.

Any way you can check the firmware to see in what situations a NACK can come back from the setio command (outside of a malformed command string) or what could cause it to time out?

[CODE REMOVED -- POSTED BELOW]

Post #1958
Posted Saturday, August 21, 2010 6:03 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: Sunday, February 27, 2011 1:07 AM
Posts: 8, Visits: 38
Oops, it looks like the code got munged when I posted it.  Here's another try at it:

private void ProcessJob(CommJobInfo jobInfo)
{
    string s = jobInfo.Job.GenerateCommand();
    string response = "";
    uint num = 1;
    while (num <= 3)
    {
        try
        {
            this.SerialPortWriteLine(s);
            response = this.SerialPortReadLine();
            if (response != "NACK")
            {
                break;
            }
        }
        catch (TimeoutException)
        {
        }
        num++;
    }
    if (num < 3)
    {
        jobInfo.Job.ProcessResponse(response);
    }
}

Post #1959
Posted Sunday, August 22, 2010 8:22 PM


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: Monday, October 31, 2011 9:18 PM
Posts: 640, Visits: 819
Hi Eric,

Yes, I will be glad to look into this.  I'm leaving for vacation Monday morning, and will be gone all week.  But I will look into this as soon as I get back.

Yep, those NACKs would get filtered by the current .NET library wouldn't they...Thanks for the detailed debugging info...It always helps a ton!

I'll also get Ringo to start looking into it as well.

Best Regards,

Jason Summerour
President,
Summerour Robotics Corporation
www.roboticsconnection.com

Post #1960
Posted Friday, August 27, 2010 9:44 PM


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: Monday, October 31, 2011 9:18 PM
Posts: 640, Visits: 819
Hi Eric,

I have verified that we see this behavior too. The .NET lib was masking the error.  It seems to occur most often when servo commands are sent VERY frequently...I'll keep you posted on the fix.

Best Regards,

Jason Summerour
President,
Summerour Robotics Corporation
www.roboticsconnection.com

Post #1971
Posted Friday, August 27, 2010 9:46 PM


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: Monday, October 31, 2011 9:18 PM
Posts: 640, Visits: 819
Eric,

What firmware versions are you using?  Thanks!

Jason Summerour
President,
Summerour Robotics Corporation
www.roboticsconnection.com

Post #1972
Posted Thursday, September 02, 2010 10:12 PM


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: Monday, October 31, 2011 9:18 PM
Posts: 640, Visits: 819
Eric,

We're still looking into this...The serializer seems to be getting corrupt commands, and we're trying to figure out if it's simply dropped characters, noise, or something else.

I'll post more results, and hopefully a fix this weekend.

Best Regards!

Jason Summerour
President,
Summerour Robotics Corporation
www.roboticsconnection.com

Post #1984
Posted Saturday, November 13, 2010 12:08 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: Sunday, February 27, 2011 1:07 AM
Posts: 8, Visits: 38
Sorry for the big delay in responding jason, I've had a whole bunch of work stuff going on and haven't been able to get back to the robot for a while.  It's a little tricky to get the firmware ID at this point since my code doesn't have that built into it.  Since you repro'd the problem, do you still need this?  I can get it if you do.

Also: is there a fix available yet?

Post #2042
Posted Tuesday, November 23, 2010 9:40 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: Sunday, February 27, 2011 1:07 AM
Posts: 8, Visits: 38
Jason, any news?
Post #2046
« Prev Topic | Next Topic »

12»»

Reading This Topic Expand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: jsummerour, ringo

Permissions Expand / Collapse

All times are GMT -8:00, Time now is 6:04am

Powered By InstantForum.NET v4.1.4 © 2012
Execution: 0.172. 9 queries. Compression Disabled.