View Single Post
  #3   Spotlight this post!  
Unread 07-02-2012, 02:10
biojae's Avatar
biojae biojae is offline
Likes Omni drives :)
AKA: Justin Stocking
FTC #5011 (BOT SQUAD) && FTC#72(Garage bots)&& FRC#0399 (Eagle Robotics)
Team Role: College Student
 
Join Date: Oct 2008
Rookie Year: 2008
Location: Lancaster
Posts: 276
biojae is a jewel in the roughbiojae is a jewel in the roughbiojae is a jewel in the rough
Re: Encoder Feedback From Jaguar

Quote:
Originally Posted by ssirovica View Post
Our team has decided to plug an encoder into one of our Jaguars to regulate the speed of our shooter for more accurate results.

However, we are not getting any output from the encoder.
There is potentially a hardware or software issue.
Hardware wise everything seems to be wired normally except the Index signal which is supposed to go into the Jaguar is left floating because our encoder does not output an Index signal.

Any ideas?


It's most likely a software issue.
You have to tell the Jaguar the reference for the encoder.
I haven't tried it, but you should be able to set it without going into speed control.
(I have only tried it in position control mode, but after the reference is set, it works until the Jag is power cycled. That includes changing modes.)

What you should try is code that is something like this:
Code:
 
try { 
   rightMotor1 = new CANJaguar(11, CANJaguar.ControlMode.kSpeed); // on the one that has the encoder plugged into it.
   rightMotor1.configEncoderCodesPerRev(360); // change to however many counts per rev on your shooter
   rightMotor1.enableControl(); // Not sure if this line is needed
   rightMotor1.changeControlMode(CANJaguar.ControlMode.kPercentVbus); //Change back to voltage mode now that the encoder is configured
   rightMotor1.enableControl(); // From this point on, you should see a speed on your debugging statements
  
   rightMotor2 = new CANJaguar(12, CANJaguar.ControlMode.kPercentVbus);
   leftMotor1 = new CANJaguar(13, CANJaguar.ControlMode.kPercentVbus); 
   leftMotor2 = new CANJaguar(15, CANJaguar.ControlMode.kPercentVbus); 
            


        } catch (CANTimeoutException ex) { 
             
            ex.printStackTrace(); 
        }
__________________
FTC Team 72 - No site
FRC Team 399 - http://www.team399.org
2010 Rockwell Collins Innovation in Control Award - (Use of the CAN bus, among other reasons) Phoenix, Arizona!
Reply With Quote