View Single Post
  #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