View Single Post
  #7   Spotlight this post!  
Unread 15-02-2012, 10:41
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: CANbus Jaguar control

1. Ive used the PID on the Jags, I couldn't figure out how to run the WPI PID.
2. I got about 450 rpm with the KOP US encoders, setting them to 360 degrees per turn

How we initialized our Jags
Code:
      //Left Master, 360 Encoder 
        left_wheel1 = new CANJaguar(2);
        left_wheel1.changeControlMode(CANJaguar.ControlMode.kSpeed);
        left_wheel1.setPID(drive_p, drive_i, drive_d);
        left_wheel1.configEncoderCodesPerRev(encoder_rev);
        left_wheel1.setSpeedReference(CANJaguar.SpeedReference.kEncoder);
        left_wheel1.enableControl();

      //Left Slave
        left_wheel2 = new CANJaguar(3);
        left_wheel2.changeControlMode(CANJaguar.ControlMode.kVoltage);
        left_wheel2.enableControl();
How we ran our jags
Code:
        try{
            left_wheel1.setX(eft_motor);//master
            left_wheel2.setX(left_wheel1.getOutputVoltage());//slave
            
        }
    	catch(Exception ex){
		ex.printStackTrace();
	    }
master, slave style, works like a charm!
__________________

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