View Single Post
  #4   Spotlight this post!  
Unread 03-02-2011, 19:54
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: A few Questions about proggramming with CAN

Quote:
Originally Posted by Trump View Post
1) We are using mecanum wheels for our drive train, My assumption after looking through the CANJaguar code is that all I need to do is set the control mode to kSpeed, and then set m_maxoutput to the physical max RPM of our slowest motor.
You must be talking about RobotDrive. Just call SetMaxOutput() to set the speed that you want joystick full forward to mean. Remember that you may want to leave a little headroom for variations in battery voltage, chain tension, etc.

Quote:
Originally Posted by Trump View Post
2) Does the CANJaguar class automatically use feedback from the encoders to correct its speed using PID? I'm assuming again that i would first need to set the speed reference to kSpeedRef_QuadEncoder, and then set the P, I, and D.
You need to SetSpeedReference() and ConfigEncoderCodesPerRev() and SetPID() and lastly EnableControl().

Quote:
Originally Posted by Trump View Post
3) When the CANJag is set to KSpeed, the source code comments say the constructor will automatically set the speed reference to the quad encoder, but i don't see where in the constructor it does that.
That comment is outdated. It no longer does that since this year there is more than one option available. I just didn't notice that comment to delete it.

-Joe
Reply With Quote