Go to Post this is robotics--everything is going to go wrong at some point, it's how we deal with it that counts - abigailthefox [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 31-01-2012, 22:09
Wildcats1378 Wildcats1378 is offline
Registered User
no team
 
Join Date: Jan 2012
Rookie Year: 2011
Location: hawaii
Posts: 93
Wildcats1378 is an unknown quantity at this point
Motors jerk; but stop responding after that.

Good evening all,

I'm Chris, head programmer from Team 3878 in Hawaii.

I am having a problem concerning motor control with our robot. When Teleoperated mode is enabled on our Driver Station, the motors will jerk for a second, then stop moving. The motors do not respond to any joystick input after that, and I am at a blank to what could be causing this problem. I have rechecked this code at least 10 times and the other programmers on my team can't spot anything wrong with it either. A weird thing is, the code worked perfectly an hour before, and nothing was wrong with it.

I am really confused. Has anyone had this problem before? Please help.

Thanks so much,
Chris, Team 3878

Last edited by Wildcats1378 : 31-01-2012 at 22:11.
Reply With Quote
  #2   Spotlight this post!  
Unread 31-01-2012, 22:11
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,751
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Motors jerk; but stop responding after that.

Are there any messages or errors on the diagnostics page of the DS?

Greg Mckaskle
Reply With Quote
  #3   Spotlight this post!  
Unread 31-01-2012, 22:14
Wildcats1378 Wildcats1378 is offline
Registered User
no team
 
Join Date: Jan 2012
Rookie Year: 2011
Location: hawaii
Posts: 93
Wildcats1378 is an unknown quantity at this point
Re: Motors jerk; but stop responding after that.

Quote:
Originally Posted by Greg McKaskle View Post
Are there any messages or errors on the diagnostics page of the DS?

Greg Mckaskle
Yes, the RobotDrive loop is not running fast enough, or has too much code...

I don't know how to get rid of this error either... It never affected the operation of our robot before this started happening...
Reply With Quote
  #4   Spotlight this post!  
Unread 31-01-2012, 22:18
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,751
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Motors jerk; but stop responding after that.

Can you post an image of the code that most likely contains the error?

Greg Mckaskle
Reply With Quote
  #5   Spotlight this post!  
Unread 31-01-2012, 22:20
Wildcats1378 Wildcats1378 is offline
Registered User
no team
 
Join Date: Jan 2012
Rookie Year: 2011
Location: hawaii
Posts: 93
Wildcats1378 is an unknown quantity at this point
Re: Motors jerk; but stop responding after that.

Quote:
Originally Posted by Greg McKaskle View Post
Can you post an image of the code that most likely contains the error?

Greg Mckaskle
I do not have access to the code right now. I am away from the computer which contains our code. I will get the code to you as soon as possible.
Reply With Quote
  #6   Spotlight this post!  
Unread 01-02-2012, 17:19
Wildcats1378 Wildcats1378 is offline
Registered User
no team
 
Join Date: Jan 2012
Rookie Year: 2011
Location: hawaii
Posts: 93
Wildcats1378 is an unknown quantity at this point
Re: Motors jerk; but stop responding after that.

We had reset the code back to a previous version that worked, and it still was doing that. I am at a complete loss as to why this is happening. Here is a photo of the code we have that works:


Last edited by Wildcats1378 : 01-02-2012 at 17:20. Reason: word change
Reply With Quote
  #7   Spotlight this post!  
Unread 01-02-2012, 17:30
Keyreaper's Avatar
Keyreaper Keyreaper is offline
Keyreaper
AKA: Cyrus Duong
FRC #1710 (Revolution Ravonics)
Team Role: Programmer
 
Join Date: May 2011
Rookie Year: 2011
Location: Olathe
Posts: 140
Keyreaper is an unknown quantity at this point
Re: Motors jerk; but stop responding after that.

Quote:
Originally Posted by Wildcats1378 View Post
We had reset the code back to a previous version that worked, and it still was doing that. I am at a complete loss as to why this is happening. Here is a photo of the code we have that works:
Attempt putting a while loop around the arcade drive function vi, and the get axis vis.
Reply With Quote
  #8   Spotlight this post!  
Unread 31-01-2012, 22:13
sparkydp sparkydp is offline
Registered User
AKA: David Page
FRC #0435 (Robodogs)
Team Role: Mentor
 
Join Date: Apr 2005
Rookie Year: 2002
Location: Raleigh, NC
Posts: 32
sparkydp is on a distinguished road
Re: Motors jerk; but stop responding after that.

have you checked battery voltage? If it gets low enough, you'll see this behavior.
Reply With Quote
  #9   Spotlight this post!  
Unread 01-02-2012, 18:07
lemiant's Avatar
lemiant lemiant is offline
the Dreamer
AKA: Alex
FRC #4334 (Alberta Tech Alliance)
Team Role: Leadership
 
Join Date: Feb 2009
Rookie Year: 2008
Location: Calgary, AB, Canada
Posts: 562
lemiant has a reputation beyond reputelemiant has a reputation beyond reputelemiant has a reputation beyond reputelemiant has a reputation beyond reputelemiant has a reputation beyond reputelemiant has a reputation beyond reputelemiant has a reputation beyond reputelemiant has a reputation beyond reputelemiant has a reputation beyond reputelemiant has a reputation beyond reputelemiant has a reputation beyond repute
Try holding the joysticks in the drive forward position while enabling the robot. I have seen this problem when the code was only reading the joysticks once at the very start of the match.
__________________
FRC Team 4334
2012 - Archimedes Champions, IRI Champions
2013 - Western Canadian Regional Winner, Galileo Quarter-Finalilst

Reply With Quote
  #10   Spotlight this post!  
Unread 01-02-2012, 19:52
Bratmon Bratmon is offline
Software Wizard
AKA: Ronnie Weber
FRC #1038 (Thunderhawks)
Team Role: Programmer
 
Join Date: Nov 2011
Rookie Year: 2010
Location: West Chester
Posts: 5
Bratmon is an unknown quantity at this point
Re: Motors jerk; but stop responding after that.

Make sure that no matter what happens you always call a Robot Drive every time the Teleop vi is iterated and that if you're running a loop inside Teleop you continue executing a Robot Drive.

There's a thing called Watchdog used to make sure the robot safely stops in case of a program hang. If Robot Drive isn't called frequently enough, it will disable all motors.
Reply With Quote
  #11   Spotlight this post!  
Unread 01-02-2012, 20:11
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,751
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Motors jerk; but stop responding after that.

The DS contains a tab called Charts. The red trace is the CPU usage of the cRIO. You may want to see if the CPU is maxed out. Second, the project template contains a Support Code folder, and in it is an Elapsed Times VI.

Drag Elapsed Times from the project and place it in Teleop. Run your program, with your robot on blocks, and open the Elapsed Times panel. It will how you the time between successive calls to Teleop.

Some of the other advice given is good. You need to call RobotDrive at least every 100ms or the safety mechanism will assume your code is forgetful and will set the speed to 0. You do not need to put a loop around Teleop because Teleop is called within a loop each time a new joystick packet arrives. If you were to put a continuous loop in Teleop, you would never return, and since you likely wouldn't have a delay in it, you would read the joystick far faster than necessary and update the robot drive more often than necessary. This would interfere with the directions given by the DS and would cause issues with needing to reset the robot after teleop.

Once you have some info about Elapsed Times and CPU usage, I may have other ideas about what is going on.

Greg McKaskle
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 11:34.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi