|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools |
Rating:
|
Display Modes |
|
|
|
#1
|
||||
|
||||
|
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);
}
Code:
private void getReadings() {
leftMagnitude = leftStick.getMagnitude();
leftDirection = leftStick.getDirectionDegrees();
rotationRate = rightStick.getAxis(Joystick.AxisType.kX);
Timer.delay(0.01);
}
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;
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 |
|
#2
|
||||||
|
||||||
|
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?
|
|
#3
|
||||
|
||||
|
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 |
|
#4
|
||||
|
||||
|
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. |
|
#5
|
|||||
|
|||||
|
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 |
|
#6
|
||||
|
||||
|
Re: Holonomic Drive System Issues, Robot Drives Diagonally...
Quote:
http://www.chiefdelphi.com/forums/sh...ad.php?t=89153 http://www.chiefdelphi.com/forums/sh...ad.php?t=89257 |
|
#7
|
|||
|
|||
|
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.
|
|
#8
|
|||||
|
|||||
|
Re: Holonomic Drive System Issues, Robot Drives Diagonally...
Quote:
|
|
#9
|
|||
|
|||
|
Re: Holonomic Drive System Issues, Robot Drives Diagonally...
Quote:
Last edited by omalleyj : 17-02-2011 at 11:10. Reason: affirm 45 is correct |
|
#10
|
||||
|
||||
|
Re: Holonomic Drive System Issues, Robot Drives Diagonally...
Quote:
He meant mount each one parallel to its respective edge, like the attached image. |
|
#11
|
||||
|
||||
|
Quote:
![]() |
|
#12
|
|||||
|
|||||
|
Re: Holonomic Drive System Issues, Robot Drives Diagonally...
Quote:
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. |
|
#13
|
|||
|
|||
|
Re: Holonomic Drive System Issues, Robot Drives Diagonally...
Quote:
Quote:
Quote:
|
|
#14
|
|||||
|
|||||
|
Re: Holonomic Drive System Issues, Robot Drives Diagonally...
Quote:
There are several research papers published on this (mostly for robocup). Quote:
|
|
#15
|
||||
|
||||
|
Re: Holonomic Drive System Issues, Robot Drives Diagonally...
Quote:
A chart comparing omni, mecanum, and standard wheels can be found here. A force analysis of mec vs omni can be found here. A kinematic analysis can be done using a similar approach. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|