Go to Post Someday, when I grow up, I want to join the GDC so I can make people go crazy, and then release hints that get people even crazier. - unionylibertad [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
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 15-02-2012, 16:22
nighterfighter nighterfighter is online now
1771 Alum, 1771 Mentor
AKA: Matt B
FRC #1771 (1771)
Team Role: Mentor
 
Join Date: Sep 2009
Rookie Year: 2007
Location: Suwanee/Kennesaw, GA
Posts: 835
nighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant future
CANJaguar and Encoders

How do I set a Jaguar, using CAN, to read the encoders and to rotate to a certain position?

I'm assuming I can set the ControlMode to PositionControl, but after that I am not sure what to do.
Reply With Quote
  #2   Spotlight this post!  
Unread 15-02-2012, 17:08
jwakeman jwakeman is offline
Registered User
FRC #0063 (Red Barons)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: 16510
Posts: 182
jwakeman is just really nicejwakeman is just really nicejwakeman is just really nicejwakeman is just really nicejwakeman is just really nice
Re: CANJaguar and Encoders

set the control mode:
Code:
void ChangeControlMode(ControlMode controlMode);
set the gains:
Code:
void SetPID(double p, double i, double d);

set the position feedback device to encoder:
Code:
void SetPositionReference(PositionReference reference);
enable control:
Code:
void EnableControl(double encoderInitialPosition = 0.0);
set a reference:
Code:
virtual void Set(float value, UINT8 syncGroup=0);
Reply With Quote
  #3   Spotlight this post!  
Unread 15-02-2012, 17:09
Kevin Sevcik's Avatar
Kevin Sevcik Kevin Sevcik is offline
(Insert witty comment here)
FRC #0057 (The Leopards)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Houston, Texas
Posts: 3,650
Kevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond repute
Send a message via AIM to Kevin Sevcik Send a message via Yahoo to Kevin Sevcik
Re: CANJaguar and Encoders

You also need to SetPositionReference, SetPID, and ConfigEncoderCodesPerRev.

Once you do all that, you EnableControl, and then Set the position you want.

The trickiest part is setting the PID values to useful numbers. You'll need to experiment here, and you'll want to start with small number and work your way up. Sadly, you HAVE to do this with your system completely together. You can't tune a PID unloaded and then add a load and expect it to work well or at all.
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.

Lone Star Regional Troubleshooter
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 17:34.

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