Go to Post When it was at 222, I was like 'Tigertrons from Tunkhahoohaasomethingconfusing Pennsylvania!' and my friend hit me for being such a loser. - Church [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 23-01-2016, 14:48
Team5119Dmitri Team5119Dmitri is offline
Registered User
FRC #5119
 
Join Date: Jan 2016
Location: Lawrence, KS
Posts: 4
Team5119Dmitri is an unknown quantity at this point
Only half of the robot turns

We are having a peculiar issue with our arcade drive, when we drive forward or backward everything works normally, but when we try turning only the right side of our robot turns, whether we are turning left or right, while the left side doesn't move at all.

This is the code we have for driving in teleop:
Code:
myRobot.arcadeDrive(stick);
So this code works normally for going forward or backwards, which is why I don't think it is a wiring issue, but somewhere in the code.
Reply With Quote
  #2   Spotlight this post!  
Unread 23-01-2016, 15:08
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,042
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Only half of the robot turns

Quote:
Originally Posted by Team5119Dmitri View Post
We are having a peculiar issue with our arcade drive, when we drive forward or backward everything works normally, but when we try turning only the right side of our robot turns, whether we are turning left or right, while the left side doesn't move at all.

This is the code we have for driving in teleop:
Code:
myRobot.arcadeDrive(stick);
So this code works normally for going forward or backwards, which is why I don't think it is a wiring issue, but somewhere in the code.
Sounds like it might be Cheezy drive? I seem to recall seeing something about WPILib incorporating Cheezy Drive into their Arcade code. Or maybe I just imagined that...

Quote:
Originally Posted by AustinSchuh View Post
Cheezy Drive is split arcade on steroids. It can best be described as making your robot drive like a car. This has the side effect of not letting you turn in place, so there is a button that when held bypasses the car steering part and switches back to split arcade. This button is called 'Quick Turn'.

Code:
adjusted_wheel = SensitivityRemap(wheel);
Vl = throttle + adjusted_wheel * abs(throttle) + inertia compensation terms;
Vr = throttle - adjusted_wheel * abs(throttle) - inertia compensation terms;
The end result is that when the robot is tuned properly, it feels consistent through a wide range of motions. The robot reacts the same to the joystick inputs at high and low speeds. Arcade has the problem that when you want to drive in an arc at slower speeds, you end up over-steering since you need to only use a small range of stick movements to get the turns you want. The inertia compensation terms add extra power to start the robot turning and stop it again when the wheel angle changes. This helps the robot feel 'psychic' and start turning as the driver starts demanding a turn, not after.

Reply With Quote
  #3   Spotlight this post!  
Unread 23-01-2016, 15:23
Arhowk's Avatar
Arhowk Arhowk is offline
FiM CSA
AKA: Jake Niman
FRC #1684 (The Chimeras) (5460 Mentor)
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Lapeer
Posts: 542
Arhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to behold
Re: Only half of the robot turns

Quote:
Originally Posted by Ether View Post
Sounds like it might be Cheezy drive? I seem to recall seeing something about WPILib incorporating Cheezy Drive into their Arcade code. Or maybe I just imagined that...




The implementation in wpilibj does not appear to be cheezy drive..

Code:
  public void arcadeDrive(double moveValue, double rotateValue, boolean squaredInputs) {
    // local variables to hold the computed PWM values for the motors
    if (!kArcadeStandard_Reported) {
      UsageReporting.report(tResourceType.kResourceType_RobotDrive, getNumMotors(),
          tInstances.kRobotDrive_ArcadeStandard);
      kArcadeStandard_Reported = true;
    }

    double leftMotorSpeed;
    double rightMotorSpeed;

    moveValue = limit(moveValue);
    rotateValue = limit(rotateValue);

    if (squaredInputs) {
      // square the inputs (while preserving the sign) to increase fine control
      // while permitting full power
      if (moveValue >= 0.0) {
        moveValue = (moveValue * moveValue);
      } else {
        moveValue = -(moveValue * moveValue);
      }
      if (rotateValue >= 0.0) {
        rotateValue = (rotateValue * rotateValue);
      } else {
        rotateValue = -(rotateValue * rotateValue);
      }
    }

    if (moveValue > 0.0) {
      if (rotateValue > 0.0) {
        leftMotorSpeed = moveValue - rotateValue;
        rightMotorSpeed = Math.max(moveValue, rotateValue);
      } else {
        leftMotorSpeed = Math.max(moveValue, -rotateValue);
        rightMotorSpeed = moveValue + rotateValue;
      }
    } else {
      if (rotateValue > 0.0) {
        leftMotorSpeed = -Math.max(-moveValue, rotateValue);
        rightMotorSpeed = moveValue + rotateValue;
      } else {
        leftMotorSpeed = moveValue - rotateValue;
        rightMotorSpeed = -Math.max(-moveValue, -rotateValue);
      }
    }

    setLeftRightMotorOutputs(leftMotorSpeed, rightMotorSpeed);
  }
Can you try using the stick's move and rotate axes so you can print those off as you send them? (and post the output here)
__________________
FRC Team 1684 - Head Programmer (2013-2016)
FRC Team 5460 - Programming Mentor (2015-2016)

FIRST in Michigan - Technical Crew (2015-continuing)
Reply With Quote
  #4   Spotlight this post!  
Unread 23-01-2016, 16:15
Team5119Dmitri Team5119Dmitri is offline
Registered User
FRC #5119
 
Join Date: Jan 2016
Location: Lawrence, KS
Posts: 4
Team5119Dmitri is an unknown quantity at this point
Re: Only half of the robot turns

Quote:
Originally Posted by Arhowk View Post

Can you try using the stick's move and rotate axes so you can print those off as you send them? (and post the output here)
The robot is currently being re-assembled, I will be able to post the output on monday.
Reply With Quote
  #5   Spotlight this post!  
Unread 25-01-2016, 21:24
Team5119Dmitri Team5119Dmitri is offline
Registered User
FRC #5119
 
Join Date: Jan 2016
Location: Lawrence, KS
Posts: 4
Team5119Dmitri is an unknown quantity at this point
Re: Only half of the robot turns

Quote:
Originally Posted by Team5119Dmitri View Post
The robot is currently being re-assembled, I will be able to post the output on monday.
After the robot was rebuilt the issue disappeared. Thanks for all your help though guys.
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 10:18.

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