View Single Post
  #2   Spotlight this post!  
Unread 19-01-2012, 16:56
Doc543's Avatar
Doc543 Doc543 is offline
Electrical, Pneumatics, Driver
AKA: Eric
FRC #1891 (BullBots)
Team Role: Programmer
 
Join Date: Mar 2010
Rookie Year: 2009
Location: Meridian Idaho
Posts: 63
Doc543 is an unknown quantity at this point
Re: Jaguars return zero speed

did you use position ref or speed ref? Position ref is for position mode and speed ref is for speed mode.
We used the encoders that where in the KOP the other year, I think they are the same ones. With this code It said that it was about 450 rpm. I used just regular kEncoder and that seemed to work fine.

we did some testing and we got ours to work with the getSpeed() here is that part of our code that we used.
Code:
    double DriveP = 1; //PID is not tuned
    double DriveI = 0.1;
    double DriveD = 0;
    int EncoderRev = 360;

public void robotInit() {

           Left1 = new CANJaguar(2);
           Left1.changeControlMode(CANJaguar.ControlMode.kSpeed);
           Left1.setPID(DriveP, DriveI, DriveD);
           Left1.configEncoderCodesPerRev(EncoderRev);
           Left1.setSpeedReference(CANJaguar.SpeedReference.kEncoder);
           Left1.enableControl();

}
__________________

"Its just a prototype."
2011 Chairman's Award Utah Regional
2010 Gracious Perfectionism Utah Regional
2009 Gracious Perfectionism Portland Regional
Reply With Quote