Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Motors jerk; but stop responding after that. (http://www.chiefdelphi.com/forums/showthread.php?t=101671)

Wildcats1378 31-01-2012 22:09

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

Greg McKaskle 31-01-2012 22:11

Re: Motors jerk; but stop responding after that.
 
Are there any messages or errors on the diagnostics page of the DS?

Greg Mckaskle

sparkydp 31-01-2012 22:13

Re: Motors jerk; but stop responding after that.
 
have you checked battery voltage? If it gets low enough, you'll see this behavior.

Wildcats1378 31-01-2012 22:14

Re: Motors jerk; but stop responding after that.
 
Quote:

Originally Posted by Greg McKaskle (Post 1117470)
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...

Greg McKaskle 31-01-2012 22:18

Re: Motors jerk; but stop responding after that.
 
Can you post an image of the code that most likely contains the error?

Greg Mckaskle

Wildcats1378 31-01-2012 22:20

Re: Motors jerk; but stop responding after that.
 
Quote:

Originally Posted by Greg McKaskle (Post 1117479)
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.

Wildcats1378 01-02-2012 17:19

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:


Keyreaper 01-02-2012 17:30

Re: Motors jerk; but stop responding after that.
 
Quote:

Originally Posted by Wildcats1378 (Post 1118015)
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.

lemiant 01-02-2012 18:07

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.

Bratmon 01-02-2012 19:52

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.

Greg McKaskle 01-02-2012 20:11

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


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

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