Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   CAN (http://www.chiefdelphi.com/forums/forumdisplay.php?f=185)
-   -   BDC-COMM & CANJaguar function in C++ (http://www.chiefdelphi.com/forums/showthread.php?t=110107)

Dragonslayerend 18-12-2012 13:47

BDC-COMM & CANJaguar function in C++
 
I have used the BDC-COMM to implement my PID loop. The mode was Speed, encoder PPR 360, and Quadrature Encoder as my Reference. The problem though is that I found out in Windriver, the PID loop while using CAN was jittery and unstable.

My code In Windriver:
SslTwo->ChangeControlMode(CANJaguar::kSpeed);
SslTwo->SetSpeedReference(CANJaguar::kSpeedRef_QuadEncode r);
SslTwo->ConfigEncoderCodesPerRev(360);
SslTwo->SetPID(-.003, -.013, 0);
SslTwo->EnableControl();

I also notice that the Integral part (__,ki,__) alone of the loop, when implemented in Windriver gave the erratic jittery behavior. While in the BDC-COMM it worked perfectly. Can I get some assistance on this, how come the PID loop erraticly jitters in Windriver and not in BDC-COMM?

jhersh 19-12-2012 17:23

Re: BDC-COMM & CANJaguar function in C++
 
Are you sure you aren't disabling and enabling? Also are you sure your units are correct? I'm not sure that the units in the bdc-comm are the same as the API in WPILib. Maybe your constants are wrong.

Dragonslayerend 05-01-2013 20:23

Re: BDC-COMM & CANJaguar function in C++
 
I actually figured out that you can't do a slave and master using CAN, it was the problem that made everything jittery.


All times are GMT -5. The time now is 20:24.

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