|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
WPILibrary's CANJaguar Class?
Hi,
I've got a few questions relative to the CANJaguar class in the WPI Library. Does the CANJaguar included in the WPI Library run on its own interrupt routine? In other words, if we run custom PID code, and we perform functions with Jaguars using CAN, are we going to be 100% sure that our IRQ rate specified in our program (for TeleopPeriodic) will be the actual IRQ rate for the Jags? I need the wisdom of someone experienced with the WPI Library. Thanks in advance. |
|
#2
|
|||
|
|||
|
Re: WPILibrary's CANJaguar Class?
Quote:
|
|
#3
|
|||
|
|||
|
Re: WPILibrary's CANJaguar Class?
Quote:
To clarify: last year, we actually did not use the PIDController class or the CANJaguar class; instead, we wrote our own PID algorithm and used the SetSpeed function from the normal Jaguar class (if I can recall the name of that function correctly) to carry out the ramped speed commands. (We did not use CAN, either.) What I'm now wondering is this: Last year, were we in fact trying to run our custom PID code, while at the same time the Jaguar was running its own little PID code in its own world, potentially interfering with our PID code? (i.e., did we just get lucky that we didn't have any problems with these two algorithms running in parallel?) And if so, is it possible to perhaps replace the PID algorithm that the Jaguar uses by default with our own PID code, so that we can be sure that our interrupt routine is the only interrupt routine that is running in this system? I am sorry if parts of this don't make sense, or if I am confounding any fundamental components of the Jaguar's internal operation, as I am somewhat inexperienced in this area. But I can further clarify my questions if necessary. |
|
#4
|
|||
|
|||
|
Re: WPILibrary's CANJaguar Class?
If you weren't using CAN last year, then you weren't using the Jaguar's PID. That is the only interface to enable the internal controller.
If you want to run the PID controller on the cRIO, that's fine. I'm surprised you wrote your own given the very capable implementations provided for you. There is no way for you to replace the PID algorithm in the Jaguar. You may either use it as is via CAN, or you may ignore it and run any other PID implementation on the cRIO. |
|
#5
|
|||
|
|||
|
Re: WPILibrary's CANJaguar Class?
You can set the constants however (and have to if using a mode that uses the PID controller)
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|