Go to Post So we developed AI... it figured out the clue... already... made itself accordingly... and is currently walking to the peachtree regional if you find him ask him what the objectives are, we'd sure like to know! - Collmandoman [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 Rating: Thread Rating: 3 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 16-02-2011, 18:16
Omgsar's Avatar
Omgsar Omgsar is offline
Registered User
AKA: Evan Gray
FRC #2745 (S.A.R.)
Team Role: Programmer
 
Join Date: Apr 2009
Rookie Year: 2008
Location: San Antonio
Posts: 7
Omgsar is an unknown quantity at this point
Unhappy Holonomic Drive System Issues, Robot Drives Diagonally...

Our robot is acting a bit wonky. We have a holonomic drive system made with the omni wheels, and mechanically everything seems sound. So, all that is left is the code. Here is our code:
Code:
  public void operatorControl() {

        System.out.println("operatorControl");
        initAll(); //init all variables
        while (true && isOperatorControl() && isEnabled()) {
            getReadings(); //Get the readings for the drive
            spikeTrigger(); //Get the readings for the actuator on the arm and map them, comment out to debug
            driveRobot.mecanumDrive_Polar(leftMagnitude, leftDirection, rotationRate);
 

            Timer.delay(0.01);
        }
That code is just for our drive. Here is where we declare things and such:
Code:
  private void getReadings() {


        leftMagnitude = leftStick.getMagnitude();
        leftDirection = leftStick.getDirectionDegrees();
        rotationRate = rightStick.getAxis(Joystick.AxisType.kX);
        Timer.delay(0.01);

    }
Here are some more:
Code:
 Joystick leftStick = new Joystick(1);
    Joystick rightStick = new Joystick(2);
    Jaguar jagFrontLeft = new Jaguar(1);
    Jaguar jagFrontRight = new Jaguar(2);
    Jaguar jagBackLeft = new Jaguar(3);
    Jaguar jagBackRight = new Jaguar(4);
    Victor victorLeft = new Victor(5);
    Victor victorRight = new Victor(6);
   Relay spike1 = new Relay(7);
    Relay spike2 = new Relay(8);
    RobotDrive driveRobot = new RobotDrive(jagFrontLeft, jagBackLeft, jagFrontRight, jagBackRight);
    Gyro roboGyro = new Gyro(2);
    double leftMagnitude = 0;
    double leftDirection = 0;
    double rotationRate = 0;
Can anyone here spot anything that seems off to you? I have never programmed a holonomic drive, nor was I really prepared, but I wanted to give it a try. Any help would be appreciated.

Attached is a diagram of what our robot tends to do. The green arrow is the direction that it is supposed to travel, and the red arrow is the direction that it actually travels.

We are using the Logitech Attack3 Joysticks, and yes I have tried to read most of the documentation that is already present on this forum. Specifically the posts by "Ether," those posts really helped... The problem exists in the fact that I don't really understand the calculations and diagrams presented in them.

Thanks in advance.

2745


OH! and all of our PWM cables are plugged in properly/in the right slot
Attached Thumbnails
Click image for larger version

Name:	lolbot.png
Views:	23
Size:	5.9 KB
ID:	10143  
Reply With Quote
  #2   Spotlight this post!  
Unread 16-02-2011, 19:44
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,561
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Holonomic Drive System Issues, Robot Drives Diagonally...

If you are using omniwheels, they should be mounted at 45 degree angles from your frames edges. If you mount them parallel to your frames edges, the robot will travel diagonally when you command it straight if you use the holonomic code from wpilib. What does your drive system look like?
Reply With Quote
  #3   Spotlight this post!  
Unread 16-02-2011, 20:06
Omgsar's Avatar
Omgsar Omgsar is offline
Registered User
AKA: Evan Gray
FRC #2745 (S.A.R.)
Team Role: Programmer
 
Join Date: Apr 2009
Rookie Year: 2008
Location: San Antonio
Posts: 7
Omgsar is an unknown quantity at this point
Re: Holonomic Drive System Issues, Robot Drives Diagonally...

Our wheels are mounted at the 45 degree angles needed.

Here is a link to our frame pictures:
http://www.chiefdelphi.com/media/photos/36312
Attached Thumbnails
Click image for larger version

Name:	Wheels@45.png
Views:	30
Size:	10.1 KB
ID:	10151  
Reply With Quote
  #4   Spotlight this post!  
Unread 17-02-2011, 07:58
Andrew Schuetze's Avatar
Andrew Schuetze Andrew Schuetze is offline
499 Founder / Alamo FTC & FLL AP
no team
Team Role: Leadership
 
Join Date: Jan 2002
Rookie Year: 2001
Location: San Antonio, Texas
Posts: 689
Andrew Schuetze has a reputation beyond reputeAndrew Schuetze has a reputation beyond reputeAndrew Schuetze has a reputation beyond reputeAndrew Schuetze has a reputation beyond reputeAndrew Schuetze has a reputation beyond reputeAndrew Schuetze has a reputation beyond reputeAndrew Schuetze has a reputation beyond reputeAndrew Schuetze has a reputation beyond reputeAndrew Schuetze has a reputation beyond reputeAndrew Schuetze has a reputation beyond reputeAndrew Schuetze has a reputation beyond repute
Re: Holonomic Drive System Issues, Robot Drives Diagonally...

I am working with this team as a mechanical mentor but I am not an engineer. (just an old chemistry teacher with 10 years of FRC experience)
Here is an image of their drive-base prior to mounting of the electronics board.
http://www.chiefdelphi.com/media/photos/36312
The battery is currently mounted just behind the front right wheel and other than that massive object, all of the current weight distribution is very symmetrical.
__________________
APS

Founder FRC 499
Parent alumni FRC 2745 & 4219
Co-Coach FTC 4549 & 6407
Alamo FTC Affiliate Partner
Alamo FLL Affiliate Partner
Reply With Quote
  #5   Spotlight this post!  
Unread 17-02-2011, 10:07
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,043
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: Holonomic Drive System Issues, Robot Drives Diagonally...

Quote:
Originally Posted by Omgsar View Post
We are using the Logitech Attack3 Joysticks, and yes I have tried to read most of the documentation that is already present on this forum. Specifically the posts by "Ether," those posts really helped... The problem exists in the fact that I don't really understand the calculations and diagrams presented in them.
Could you do the following very simple test and post the results? This would help greatly to diagnose the problem:
- put the robot up on blocks

- command pure forward motion and observe and record what each of the four wheels is doing

- do the same for reverse, strafe right, strafe left, rotate clockwise, and rotate counter-clockwise

And one more thing: you don't need to understand all the calculations and diagrams if that is not your area of interest. There are some posts and papers which just show how to program, for example:

http://www.chiefdelphi.com/media/papers/download/2906




Last edited by Ether : 17-02-2011 at 10:11.
Reply With Quote
  #6   Spotlight this post!  
Unread 17-02-2011, 10:08
AllenGregoryIV's Avatar
AllenGregoryIV AllenGregoryIV is offline
Engineering Coach
AKA: Allen "JAG" Gregory
FRC #3847 (Spectrum)
Team Role: Coach
 
Join Date: Jul 2008
Rookie Year: 2003
Location: Texas
Posts: 2,549
AllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond repute
Send a message via AIM to AllenGregoryIV
Re: Holonomic Drive System Issues, Robot Drives Diagonally...

We have a similar drive base as you do. I don't see anything wrong with your code but I know that we switched from the Meccanum Polar method to the Meccanum Cartesian because polar seemed to be giving odd results. (I know it shouldn't matter but it seemed to help us and it makes positioning easier for us).

When you put the robot on blocks and run the code does it still not power all the wheels? It may be that they are all trying to go strait but without some sort of programmed correction they are at such different speeds that it drives diagonally. Wheel slip with an omni holonomic platform is really hard to remove completely with a mechanical solution.

We corrected for this by getting field centric control working with the gyro. Without that our drive base becomes much harder to control. The gyro is able to control our angle and keeps our heading. If we do drift off of strait the driver has a much easier time correcting because he only has to correct one axis (the X axis if we are trying to drive strait forward).

This is a link to our code repository. If you have any questions please ask.
Our Code

We are also attempting to get Velocity control working but haven't been successful yet because our encoders have been giving us some problems.

Hope this helps and I look forward to seeing you at Alamo,
Allen Gregory
Reply With Quote
  #7   Spotlight this post!  
Unread 17-02-2011, 10:45
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,043
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: Holonomic Drive System Issues, Robot Drives Diagonally...

Quote:
Originally Posted by AllenGregoryIV View Post
We are also attempting to get Velocity control working but haven't been successful yet because our encoders have been giving us some problems.
Are you aware that this is a known bug in the FPGA code, and solutions have been posted?

http://www.chiefdelphi.com/forums/sh...ad.php?t=89153

http://www.chiefdelphi.com/forums/sh...ad.php?t=89257



Reply With Quote
  #8   Spotlight this post!  
Unread 17-02-2011, 11:03
omalleyj omalleyj is offline
Registered User
AKA: Jim O'Malley
FRC #1279 (Cold Fusion)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2008
Location: New Jersey
Posts: 132
omalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to behold
Re: Holonomic Drive System Issues, Robot Drives Diagonally...

Usually two motors need to be inverted. Are any of yours inverted in HW, because I don't see them inverted in the code.
Reply With Quote
  #9   Spotlight this post!  
Unread 17-02-2011, 11:09
omalleyj omalleyj is offline
Registered User
AKA: Jim O'Malley
FRC #1279 (Cold Fusion)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2008
Location: New Jersey
Posts: 132
omalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to behold
Re: Holonomic Drive System Issues, Robot Drives Diagonally...

Quote:
Originally Posted by Joe Ross View Post
If you are using omniwheels, they should be mounted at 45 degree angles from your frames edges. If you mount them parallel to your frames edges, the robot will travel diagonally when you command it straight if you use the holonomic code from wpilib. What does your drive system look like?
That is not actually correct, straight forward and back are the only things that will work correctly if using omni's mounted parallel to the frame. But you are certainly correct, they must be at 45s to work for anything else.

Last edited by omalleyj : 17-02-2011 at 11:10. Reason: affirm 45 is correct
Reply With Quote
  #10   Spotlight this post!  
Unread 17-02-2011, 12:26
AllenGregoryIV's Avatar
AllenGregoryIV AllenGregoryIV is offline
Engineering Coach
AKA: Allen "JAG" Gregory
FRC #3847 (Spectrum)
Team Role: Coach
 
Join Date: Jul 2008
Rookie Year: 2003
Location: Texas
Posts: 2,549
AllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond repute
Send a message via AIM to AllenGregoryIV
Re: Holonomic Drive System Issues, Robot Drives Diagonally...

Quote:
Originally Posted by Ether View Post
Thank you Ether, I did know it was a known issue but I actually hadn't seen one of the solutions that you posted. I'll see if it works tonight. We also have a hardware problem where one of our encoders is not returning the right number of counts per revolution, but that is either a mounting problem or a broken encoder.
Reply With Quote
  #11   Spotlight this post!  
Unread 17-02-2011, 13:53
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,043
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: Holonomic Drive System Issues, Robot Drives Diagonally...

Quote:
Originally Posted by omalleyj View Post
That is not actually correct, straight forward and back are the only things that will work correctly if using omni's mounted parallel to the frame. But you are certainly correct, they must be at 45s to work for anything else.
Joe said "If you mount them parallel to your frames edges,"

He meant mount each one parallel to its respective edge, like the attached image.


Attached Thumbnails
Click image for larger version

Name:	omni.png
Views:	7
Size:	1.3 KB
ID:	10165  
Reply With Quote
  #12   Spotlight this post!  
Unread 17-02-2011, 14:09
Andrew Schuetze's Avatar
Andrew Schuetze Andrew Schuetze is offline
499 Founder / Alamo FTC & FLL AP
no team
Team Role: Leadership
 
Join Date: Jan 2002
Rookie Year: 2001
Location: San Antonio, Texas
Posts: 689
Andrew Schuetze has a reputation beyond reputeAndrew Schuetze has a reputation beyond reputeAndrew Schuetze has a reputation beyond reputeAndrew Schuetze has a reputation beyond reputeAndrew Schuetze has a reputation beyond reputeAndrew Schuetze has a reputation beyond reputeAndrew Schuetze has a reputation beyond reputeAndrew Schuetze has a reputation beyond reputeAndrew Schuetze has a reputation beyond reputeAndrew Schuetze has a reputation beyond reputeAndrew Schuetze has a reputation beyond repute
Thumbs up Re: Holonomic Drive System Issues, Robot Drives Diagonally...

Quote:
Originally Posted by Ether View Post
Joe said "If you mount them parallel to your frames edges,"

He meant mount each one parallel to its respective edge, like the attached image.

I always forget about that option. It would appear to be a bit unstable in the corners as drawn. I know you just drew it up for discussion purposes. I wonder how many FRC applications have used the "+" holonomic verses the "X" holonomic system. I suppose one could set up a traditional 4 wheel tank steer with omniwheels all the way around and then add the center front and center rear wheels to add stafe and diagonal motions...
__________________
APS

Founder FRC 499
Parent alumni FRC 2745 & 4219
Co-Coach FTC 4549 & 6407
Alamo FTC Affiliate Partner
Alamo FLL Affiliate Partner
Reply With Quote
  #13   Spotlight this post!  
Unread 17-02-2011, 14:10
omalleyj omalleyj is offline
Registered User
AKA: Jim O'Malley
FRC #1279 (Cold Fusion)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2008
Location: New Jersey
Posts: 132
omalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to behold
Re: Holonomic Drive System Issues, Robot Drives Diagonally...

Quote:
Originally Posted by Ether View Post
Joe said "If you mount them parallel to your frames edges,"

He meant mount each one parallel to its respective edge, like the attached image.

Ah! Oops!
My apologies for doubting you, Joe.
Thanks Ether
Reply With Quote
  #14   Spotlight this post!  
Unread 17-02-2011, 15:06
AllenGregoryIV's Avatar
AllenGregoryIV AllenGregoryIV is offline
Engineering Coach
AKA: Allen "JAG" Gregory
FRC #3847 (Spectrum)
Team Role: Coach
 
Join Date: Jul 2008
Rookie Year: 2003
Location: Texas
Posts: 2,549
AllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond repute
Send a message via AIM to AllenGregoryIV
Re: Holonomic Drive System Issues, Robot Drives Diagonally...

Quote:
Originally Posted by Andrew Schuetze View Post
I suppose one could set up a traditional 4 wheel tank steer with omniwheels all the way around and then add the center front and center rear wheels to add stafe and diagonal motions...
We tried this last year and I can say that it is extremely hard to get traction on all six wheels. If your robot is not perfectly level and balanced it will be extremely easy to lose traction and not be able to strafe. It gave us nothing but headaches. I am not saying it's impossible it just is very difficult (more so than the standard x configuration).

One thing to note about the plus configuration is that you will travel slower in the robots orthogonal directions then you would traveling at 45 degree angles. Omni wheeled holonomic robots gain velocity when all 4 wheels are powering them because each wheel actually has a velocity vector perpendicular to it's normal velocity. The whole robot is able to travel faster than any one wheel velocity. In a perfect world a 4 wheeled omni wheel holonomic platform with wheels 90 degrees apart will travel ~1.4 times faster than wheel velocity when traveling 45 degrees to any wheel.

You could just redesign the robot so the "front" is on one of the corners but that could make things tricky for manipulators. I agree that the plus would be harder to balance as well.
Reply With Quote
  #15   Spotlight this post!  
Unread 17-02-2011, 15:18
omalleyj omalleyj is offline
Registered User
AKA: Jim O'Malley
FRC #1279 (Cold Fusion)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2008
Location: New Jersey
Posts: 132
omalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to behold
Re: Holonomic Drive System Issues, Robot Drives Diagonally...

Quote:
Originally Posted by AllenGregoryIV View Post
One thing to note about the plus configuration is that you will travel slower in the robots orthogonal directions then you would traveling at 45 degree angles.
yes
Quote:
Omni wheeled holonomic robots gain velocity when all 4 wheels are powering them because each wheel actually has a velocity vector perpendicular to it's normal velocity.
not sure I follow that
Quote:
The whole robot is able to travel faster than any one wheel velocity. In a perfect world a 4 wheeled omni wheel holonomic platform with wheels 90 degrees apart will travel ~1.4 times faster than wheel velocity when traveling 45 degrees to any wheel.
I think you need explain that more clearly. The robot will go at its maximum speed in the direction any pair is going in for the omni@45 arrangement. And .7071 of that speed in the regular front-back side-side directions. The ratio is 1.4, but you give the impression that it will go faster than its wheels are turning, which is impossible in any direction.
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:02.

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