Go to Post Don't Canadians spell it that way? Someone should cheque on that.... - Travis Hoffman [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 01-02-2012, 20:13
ssirovica's Avatar
ssirovica ssirovica is offline
Programming Captain
AKA: Sasha Sirovica
FRC #1458 (Red Ties)
Team Role: Programmer
 
Join Date: Sep 2011
Rookie Year: 2010
Location: Alamo
Posts: 26
ssirovica is an unknown quantity at this point
Encoder Feedback From Jaguar

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.

Our Code:
Initialization
PHP Code:
try {
            
rightMotor1 = new CANJaguar(11CANJaguar.ControlMode.kPercentVbus);
            
rightMotor2 = new CANJaguar(12CANJaguar.ControlMode.kPercentVbus); //Change these to id Nums of jaguar!!!!!
            
leftMotor1 = new CANJaguar(13CANJaguar.ControlMode.kPercentVbus);
            
leftMotor2 = new CANJaguar(15CANJaguar.ControlMode.kPercentVbus);
            
rightMotor2.enableControl();


        } catch (
CANTimeoutException ex) {
            
            
ex.printStackTrace();
        } 
and here is our output code
PHP Code:
try {
        
driverStation.println(DriverStationLCD.Line.kUser31"Right Encoder Jaguar: " Double.toString(rightMotor2.getSpeed()));
          } catch (
CANTimeoutException ex) {

            
ex.printStackTrace();
        } 
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?
__________________
Computers run on smoke. When you let the smoke out the computer stops working.
Reply With Quote
  #2   Spotlight this post!  
Unread 02-02-2012, 11:27
eddie12390's Avatar
eddie12390 eddie12390 is offline
Registered User
AKA: Eddie
FRC #3260 (SHARP)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Pittsburgh
Posts: 285
eddie12390 is a glorious beacon of lighteddie12390 is a glorious beacon of lighteddie12390 is a glorious beacon of lighteddie12390 is a glorious beacon of lighteddie12390 is a glorious beacon of light
Re: Encoder Feedback From Jaguar

driverStation.updateLCD() needs to be called when you want the text to show up. (Every single time println is called)
Reply With Quote
  #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
  #4   Spotlight this post!  
Unread 07-02-2012, 07:45
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is online now
Flywheel Police
AKA: Matthew Lythgoe
FRC #2363 (Triple Helix)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Newport News, VA
Posts: 1,728
notmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond repute
Re: Encoder Feedback From Jaguar

Agreed, you are missing the encoder configuration.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 12:46.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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