Go to Post we can crank up the volume and let the world know that we are nerds with a pulse! - dlavery [more]
Home
Go Back   Chief Delphi > FIRST > General Forum
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 10-05-2012, 16:25
SoyStuff SoyStuff is offline
Registered User
FRC #1257
 
Join Date: Jan 2012
Location: Brooklyn
Posts: 29
SoyStuff is a jewel in the roughSoyStuff is a jewel in the roughSoyStuff is a jewel in the rough
CANJaguar Control C++

We are working with CANJaguar for the first time, and we are sort of lost. We have the motors themselves spinning, but we can't seem to control them as we want to. We're in PercentVBus mode, and we are using the regular old set function (we pass it a value between -1 and 1 using the axes on our gamepad). Instead of moving the motor at the speed that is specified, though, it gradually approaches that speed.

Here is a rough outline of our code, just highlighting stuff relating to the CANJags:
Code:
cjag(12, CANJaguar::kPercentVbus), // This is in the constructor for our drivetrain class

// Settings
cjag.SetPID(0.4, 0.005, 0);
cjag.ConfigEncoderCodesPerRev(200);
cjag.SetSpeedReference(CANJaguar::kSpeedRef_Encoder);
cjag.EnableControl();

// Moving 
cjag.Set(gamepad.GetY());
Reply With Quote
 


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 02:40.

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