Go to Post Can I help it if I check Chief Delphi before I look at the Team Updates? - Al Skierkiewicz [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 29-01-2011, 12:52
computerish computerish is offline
Registered User
FRC #0619
 
Join Date: Nov 2008
Location: va
Posts: 45
computerish is an unknown quantity at this point
Jaguars do not work except in percent vbus mode

We are attempting to use closed-loop encoder control with our Jaguars this year. When we hook our CAN network up to a computer, we can use BDC-COMM to set output values in RPM and the motors run correctly.

When we try to control the Jaguars from Java, we can't get it to work. We can control the Jaguars in the percent voltage mode just fine (that's the -1 to 1 output mode). When we switch to voltage, speed, or current mode, they don't work. The motors don't move, the light on the Jaguar stays solid yellow, and the voltage output according to the code is 0.

Our code is in teleopPeriodic() and looks like this:

Code:
try{
  leftMotor.changeControlMode(CANJaguar.ControlMode.kVoltage);
  leftMotor.setX(6);
  // a bunch of printlns for debugging
}catch(CANTimeoutException ex){
  ex.printStackTrace();
}
No exceptions, nothing but yellow lights on the Jaguar. Nothing.

Any ideas?
Reply With Quote
  #2   Spotlight this post!  
Unread 29-01-2011, 17:33
wmarshall wmarshall is offline
Registered User
FRC #0011
 
Join Date: Jan 2011
Location: New Jersey
Posts: 8
wmarshall will become famous soon enough
Re: Jaguars do not work except in percent vbus mode

This bit my team, too. In anything but PercentVBus, a few extra calls have to be made. You're using voltage, so the Jaguars can do the referencing internally, so no external references have to be set.

However, for any control mode that needs to go to a setpoint, you need to set and tune the Jaguars' internal PID loop. In addition, you have to manually enable control. Use something like

Code:
jag.setPID(1,1,0);
jag.enableControl();
without the made-up numbers. I'd recommend the BDC-COMM utility to tune the loop, as it drastically simplifies things.
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 09:10.

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