Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Correcting Mecanum Wheels with Encoders (Ether, We Summon You!) (http://www.chiefdelphi.com/forums/showthread.php?t=134149)

jhersh 15-02-2015 10:27

Re: Correcting Mecanum Wheels with Encoders (Ether, We Summon You!)
 
Quote:

Originally Posted by Alan Anderson (Post 1439947)
How heavy is your robot, and how is the weight distributed? The symptom sounds like the back wheels are slipping a little on the carpet, which suggests that the robot is front-heavy.

Another thing to consider that strongly affects mecanum... is your frame square? Perhaps one of the wheels is off the ground or bears too little of the weight.

Toa Circuit 15-02-2015 10:51

Re: Correcting Mecanum Wheels with Encoders (Ether, We Summon You!)
 
My #1 concern in your setup is this:
What is causing the odd strafing? If it's wheel slippage (my main guess), encoders on the drive wheels won't help you. Consider using a gyroscope to get your error. You'll likely be happier anyways.

Ether 15-02-2015 12:26

Re: Correcting Mecanum Wheels with Encoders (Ether, We Summon You!)
 

The OP has stopped responding to his thread, so we don't know the status is, or if he is still reading.

But so far, the responses have not addressed his original question:

Quote:

Originally Posted by goldenguy00 (Post 1439840)
To fix this, we are using encoders, but we are running into some severe difficulties my question is ... what am I doing wrong in the second example? The robot does not move in autonomous, nor in teleop.



jhersh 15-02-2015 12:42

Re: Correcting Mecanum Wheels with Encoders (Ether, We Summon You!)
 
Quote:

Originally Posted by goldenguy00 (Post 1439840)
Through a bit of troubleshooting, I found that this works...
Code:

public class TalonCan {

    CANTalon talon;

    public TalonCan(int canID){
        talon = new CANTalon(canID);
        talon.changeControlMode(ControlMode.PercentVbus);
    }
}

And this doesn't...
Code:

public class TalonCan {
   
    CANTalon talon;
   
    public TalonCan(int canID){
        talon = new CANTalon(canID);
        talon.changeControlMode(ControlMode.Speed);
        talon.setPID(0.1, 0.001, 1, 0.0001, 100, 36, 0);
        talon.set(0);
        talon.setFeedbackDevice(FeedbackDevice.QuadEncoder);
    }
}

I believe it's from not using the encoders, so my question is, what am I doing wrong in the second example? The robot does not move in autonomous, nor in teleop.

I assume that since you are only showing the constructor that you are not changing anything else. That would be your problem I suspect. When you change modes, you change the units of "set();". That means you need to select a velocity based on your joystick. If you are using it like you should for a typical open-loop robot, then the values you are sending to set() are -1 to 1. This means that when you switch to closed loop you are asking for a velocity of -1 to 1. Depending on your sensor (you indicated an encoder) that is incredibly slow. Depending on how your PID constants are tuned, it may give the results you described.

Ken Streeter 15-02-2015 13:37

Re: Correcting Mecanum Wheels with Encoders (Ether, We Summon You!)
 
Quote:

Originally Posted by jhersh (Post 1444485)
When you change modes, you change the units of "set();". That means you need to select a velocity based on your joystick. If you are using it like you should for a typical open-loop robot, then the values you are sending to set() are -1 to 1. This means that when you switch to closed loop you are asking for a velocity of -1 to 1.

Just to add a little bit more to what Joe has said, the "velocity" in the Talon SRX when using speed (velocity) control mode is in counts per 1/10 of a second. See section 17.1 of the Talon SRX Software Reference Manual for a little more info. On our robot, our top speed as measured on the Talon SRX is around 600 units, so we use set() commands which range from -600 to +600.


All times are GMT -5. The time now is 21:06.

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