|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
PID Control for Jaguars with PWM?
If you wish to use PID with US Digital encoders to control the speed of Jaguars for driving, do you need to use the CAN bus on the Jaguars, or will it work with PWM?
|
|
#2
|
||||
|
||||
|
Re: PID Control for Jaguars with PWM?
Quote:
If you use PWM, you can do the PID in the cRIO, either home-brew or WPILib. |
|
#3
|
||||
|
||||
|
Re: PID Control for Jaguars with PWM?
Thanks. Is there any disadvantage to using the one on the cRIO? I know that CAN has its advantages, but our team is much more familiar with the PWM interface, and we already have all the resources required for it (namely, a whole boatload of cables).
Would the code for using the PID controller differ at all between the cRIO controller and the CAN Jag controller? Which one is handled by the WPILib/WPILibJ PIDController library? |
|
#4
|
||||
|
||||
|
Re: PID Control for Jaguars with PWM?
Quote:
|
|
#5
|
||||
|
||||
|
Re: PID Control for Jaguars with PWM?
If that's the case, I think I'll stick with PWM and use the cRIO's controller, having never used PID before.
|
|
#6
|
|||||
|
|||||
|
Re: PID Control for Jaguars with PWM?
We had a sample program that we used to test the the adjustable PID values and the results, to verify what we would need so that our shooter wheels stayed within the desired RPM values that we set it to (or based on distance to camera targets). It took us a couple of hours and bit of network searching to find acceptable values for the variables, but once we did, it was set and we never had to deal with it again.
Over the course of our competitions, we did run into some reported "time-out" errors on our CAN network, according to our driver station output log, but they were so intermittent and quickly resolved so they never impacted the way that our shooter functioned. We stuck with it and were happy with the performance and advantages we gained by using it. (we used it so that our upper elevator section would not move to feed balls into the shooter unless we were able to determine that the wheels were moving at the desired RPM) I would say don't dismiss the idea without experimenting -- it can be a great asset when trying to maintain something like a shooter wheel speed -- but it is not a simple plug-in-and-go solution. Like most new technologies, it will take time to learn how to configure and adjust it... but it definitely has advantages. |
|
#7
|
||||
|
||||
|
Re: PID Control for Jaguars with PWM?
Quote:
|
|
#8
|
||||
|
||||
|
Re: PID Control for Jaguars with PWM?
Quote:
Quote:
|
|
#9
|
|||||
|
|||||
|
Re: PID Control for Jaguars with PWM?
The advantage of using the Jaguar's internal PID control loop is that the cRio does not use any CPU time for that task. Very valuable if you have a lot of PID loops or your cRio is seeing heavy utilization (e.g., over 60% CPU load). The disadvantage is that you must use the CAN interface. While not terribly difficult, unfamiliar territory in the middle of the season might be best avoided.
Running a PID loop on the cRio is slightly more effort, but PWM control should be very comfortable by now. There is a library function for this (at least in Labview), or you can write your own. I advise building a special program that runs just this code and nothing else, so you can get familiar with it and tune it without worrying about drive/dashboard/etc. code. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|