Go to Post It definitely looked like a penalty, but in FRC if it looks like a penalty and smells like a penalty, well, unfortunately it might not be. - Basel A [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
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 19-01-2014, 07:11
theonlydvr theonlydvr is offline
Registered User
FRC #4338
 
Join Date: Jan 2014
Location: United States
Posts: 12
theonlydvr is an unknown quantity at this point
Gyro Returning Values Not According to Actual Robot Movement [Answered]

Hello everyone,

I am a programmer for team 4338 in Israel and have encountered problems while using the gyro supplied by First. On testing the gyro in operator control using a simple program which printed out the current angle, the printed values began at a negative number near zero and continued slowly increasing minimally only reaching 1 degree after a minute. The robot, however was turning frequently and definitely more than 1 degree.

This was our code for operator control:

Code:
public void operatorControl()
{
    chassis.setSafetyEnabled(false);
    gyro.reset();
    chassis.setInvertedMotor(RobotDrive.MotorType.kRearLeft, true);
    chassis.setInvertedMotor(RobotDrive.MotorType.kRearRight, true);

    while (isOperatorControl() && isEnabled())
    {
           chassis.tankDrive(leftStick.getY(), rightStick.getY());
           System.out.println("Angle: " + gyro.getAngle());
           Timer.delay(0.01);
    }
}
chassis is our RobotDrive object
rightStick is our right joystick object and vice verse for leftStick

Thanks for any help

Last edited by theonlydvr : 19-01-2014 at 10:09. Reason: Answered
Reply With Quote
  #2   Spotlight this post!  
Unread 19-01-2014, 08:29
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 590
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: Gyro Returning Values Not According to Actual Robot Movement

Check that the gyro is connected to Analog port 1 or 2 on the first digital module. Those are the only ports that have the hardware integrators for computing the heading from the gyros rate output.

Also, you can verify the operation of the gyro by just creating an AnalogChannel object on the channel that the gyro is plugged into. Watch the analog output with either a dashboard or print statements and verify that the output is near 2.5V when the robot is stationary. Now rotate the robot in one direction and the values should go either up or down momentarily, then rotate in the other direction and the values should go the other way. But remember, it will only do this while the robot is moving since the gyro is measuring rate of rotation.
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
Reply With Quote
  #3   Spotlight this post!  
Unread 19-01-2014, 09:47
theonlydvr theonlydvr is offline
Registered User
FRC #4338
 
Join Date: Jan 2014
Location: United States
Posts: 12
theonlydvr is an unknown quantity at this point
Re: Gyro Returning Values Not According to Actual Robot Movement

Thanks for the help!!!

We figured out the problem. We had a faulty analogio breakout and on replacing it our gyro worked fine.

Last edited by theonlydvr : 19-01-2014 at 10:08.
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 22:35.

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