View Single Post
  #20   Spotlight this post!  
Unread 17-01-2012, 17:26
mikets's Avatar
mikets mikets is offline
Software Engineer
FRC #0492 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Bellevue, WA
Posts: 674
mikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of light
Re: New to 2CAN and Jaguar

Quote:
Originally Posted by jwakeman View Post
if you are in percent vbus mode I would think the PID gains should have no effect.
That's exactly my point. I was using PercentVbus mode, PID constants should be totally irrelevant and should be ignored. It is true that I could just comment out the SetPID calls and call it good since PercentVbus mode doesn't need them. But there are cases where I need to call ChangeControlMode and change to a close-loop mode. When that happens, I must call SetPID to set the constants. And later on, I may switch back to PercentVbus mode. If calling SetPID would make non close-loop mode not working, that's not very intuitive.
BTW, I set Kp to 15 because I tested the Jag with bdc-comm tool using Position mode and found that if the value is higher than 15 (e.g. 20), the wheel will oscillate before stopping at the target position. If it is less than 15 (e.g. 5), it takes a long time to get to the set target. I am not familiar with the internal PID algorithm of the Jags, but from my point of view, K should be different in different modes. For example, Kp is multiplied to the "error" to get the output voltage. Different modes have different units (Amp in current, rev in Position and rev/sec in Speed). So the error will be in different ranges and so the K multiplier could be quite different. Since I am new to Jags, I could be totally wrong but this is my understanding. Regardless, even if my K's are wrong, as you said, PercentVbus mode should ignore them anyway. So why would it not work if I called SetPID?
__________________
Reply With Quote